refactor(*): 代码质量 - 优化前后端实现并完善协议与画布验证

This commit is contained in:
ddcat666 committed 2026-10-08 19:38:57 +08:00
1 parent 9be3aa8235
commit 87ecb3000c
724 files changed
+3045 -3884

No files matched your search

@@ -20,7 +20,7 @@ type CanvasHistoryStore = {
clearDeletedHistory: () => void;
};
export const CANVAS_HISTORY_STORE_KEY = "infinite-canvas:deleted_history_store";
export const CANVAS_HISTORY_STORE_KEY = "yingce:deleted_history_store";
const historyStorage: PersistStorage<CanvasHistoryStore> = {
getItem: async (name) => {
+2 -2
View File
@@ -47,7 +47,7 @@ type CanvasStore = {
};
const initialViewport: ViewportTransform = { x: 0, y: 0, k: 1 };
export const CANVAS_STORE_KEY = "infinite-canvas:canvas_store";
export const CANVAS_STORE_KEY = "yingce:canvas_store";
type PersistedCanvasState = Pick<CanvasStore, "projects">;
type QueuedCanvasPersist = {
name: string;
@@ -85,7 +85,7 @@ type CanvasStorageLockOptions = {
requireCrossRealmLock?: boolean;
};
const CANVAS_STORAGE_LOCK_PREFIX = "infinite-canvas:canvas-generation-storage-lock:";
const CANVAS_STORAGE_LOCK_PREFIX = "yingce:canvas-generation-storage-lock:";
const canvasStorageTails = new Map<string, Promise<void>>();
function runWithBrowserCanvasStorageLock<T>(scope: string, operation: () => Promise<T>, options: CanvasStorageLockOptions) {
@@ -12,7 +12,7 @@ export const useCanvasThemeStore = create<CanvasThemeStore>()(
persist(
(set) => ({ theme: DEFAULT_CANVAS_COLOR_THEME, active: false, setTheme: (theme) => { if (theme === "light" || theme === "dark") set({ theme }); } }),
{
name: "infinite-canvas:canvas-theme",
name: "yingce:canvas-theme",
partialize: ({ theme }) => ({ theme }),
merge: (persisted, current) => {
const theme = (persisted as Partial<CanvasThemeStore> | null)?.theme;