mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
chore: bump version (#2249)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/jsonwebtoken": "^9.0.2",
|
||||
"@types/lodash-es": "^4.17.7",
|
||||
"@types/node": "^18.16.3",
|
||||
"@types/node": "^18.16.5",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"c8": "^7.13.0",
|
||||
"nodemon": "^2.0.22",
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
"@affine/jotai": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@affine/workspace": "workspace:*",
|
||||
"@blocksuite/blocks": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/icons": "^2.1.15",
|
||||
"@blocksuite/store": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@dnd-kit/core": "^6.0.8",
|
||||
"@dnd-kit/sortable": "^7.0.2",
|
||||
"@emotion/cache": "^11.10.8",
|
||||
@@ -38,7 +38,7 @@
|
||||
"css-spring": "^4.1.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"graphql": "^16.6.0",
|
||||
"jotai": "^2.0.4",
|
||||
"jotai": "^2.1.0",
|
||||
"jotai-devtools": "^0.5.2",
|
||||
"lit": "^2.7.4",
|
||||
"lottie-web": "^5.11.0",
|
||||
@@ -59,14 +59,14 @@
|
||||
"@swc-jotai/debug-label": "^0.0.10",
|
||||
"@swc-jotai/react-refresh": "^0.0.8",
|
||||
"@types/react": "^18.2.5",
|
||||
"@types/react-dom": "^18.2.3",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"@vanilla-extract/css": "^1.11.0",
|
||||
"@vanilla-extract/next-plugin": "^2.1.2",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-next": "^13.4.0",
|
||||
"next": "^13.4.0",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-next": "^13.4.1",
|
||||
"next": "^13.4.1",
|
||||
"next-debug-local": "^0.1.5",
|
||||
"next-router-mock": "^0.9.3",
|
||||
"raw-loader": "^4.0.2",
|
||||
|
||||
@@ -45,7 +45,7 @@ const schema = z.object({
|
||||
});
|
||||
|
||||
const getPersistenceAllWorkspace = () => {
|
||||
const items = storage.getItem(AFFINE_STORAGE_KEY);
|
||||
const items = storage.getItem(AFFINE_STORAGE_KEY, []);
|
||||
const allWorkspaces: AffineWorkspace[] = [];
|
||||
if (
|
||||
Array.isArray(items) &&
|
||||
@@ -152,7 +152,7 @@ export const AffinePlugin: WorkspacePlugin<WorkspaceFlavour.AFFINE> = {
|
||||
return id;
|
||||
},
|
||||
delete: async workspace => {
|
||||
const items = storage.getItem(AFFINE_STORAGE_KEY);
|
||||
const items = storage.getItem(AFFINE_STORAGE_KEY, []);
|
||||
if (
|
||||
Array.isArray(items) &&
|
||||
items.every(item => schema.safeParse(item).success)
|
||||
@@ -226,7 +226,7 @@ export const AffinePlugin: WorkspacePlugin<WorkspaceFlavour.AFFINE> = {
|
||||
permission: workspace.permission,
|
||||
} satisfies z.infer<typeof schema>;
|
||||
});
|
||||
const old = storage.getItem(AFFINE_STORAGE_KEY);
|
||||
const old = storage.getItem(AFFINE_STORAGE_KEY, []);
|
||||
if (
|
||||
Array.isArray(old) &&
|
||||
old.every(item => schema.safeParse(item).success)
|
||||
|
||||
+3
-3
@@ -49,14 +49,14 @@
|
||||
"@playwright/test": "^1.33.0",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@types/eslint": "^8.37.0",
|
||||
"@types/node": "^18.16.3",
|
||||
"@types/node": "^18.16.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"@vanilla-extract/vite-plugin": "^3.8.0",
|
||||
"@vitejs/plugin-react": "^4.0.0",
|
||||
"@vitest/coverage-istanbul": "^0.31.0",
|
||||
"@vitest/ui": "^0.31.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
@@ -77,7 +77,7 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"serve": "^14.2.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.3.4",
|
||||
"vite": "^4.3.5",
|
||||
"vite-plugin-istanbul": "^4.0.1",
|
||||
"vite-tsconfig-paths": "^4.2.0",
|
||||
"vitest": "^0.31.0",
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"@toeverything/theme": "workspace:*",
|
||||
"@vanilla-extract/dynamic": "^2.0.3",
|
||||
"clsx": "^1.2.1",
|
||||
"jotai": "^2.0.4",
|
||||
"jotai": "^2.1.0",
|
||||
"lit": "^2.7.4",
|
||||
"lottie-web": "^5.11.0",
|
||||
"react": "^18.2.0",
|
||||
@@ -48,36 +48,36 @@
|
||||
"react-is": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/icons": "^2.1.15",
|
||||
"@blocksuite/store": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@storybook/addon-actions": "^7.0.8",
|
||||
"@blocksuite/store": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@storybook/addon-actions": "^7.0.9",
|
||||
"@storybook/addon-coverage": "^0.0.8",
|
||||
"@storybook/addon-essentials": "^7.0.8",
|
||||
"@storybook/addon-interactions": "^7.0.8",
|
||||
"@storybook/addon-links": "^7.0.8",
|
||||
"@storybook/addon-storysource": "^7.0.8",
|
||||
"@storybook/blocks": "^7.0.8",
|
||||
"@storybook/builder-vite": "^7.0.8",
|
||||
"@storybook/addon-essentials": "^7.0.9",
|
||||
"@storybook/addon-interactions": "^7.0.9",
|
||||
"@storybook/addon-links": "^7.0.9",
|
||||
"@storybook/addon-storysource": "^7.0.9",
|
||||
"@storybook/blocks": "^7.0.9",
|
||||
"@storybook/builder-vite": "^7.0.9",
|
||||
"@storybook/jest": "^0.1.0",
|
||||
"@storybook/react": "^7.0.8",
|
||||
"@storybook/react-vite": "^7.0.8",
|
||||
"@storybook/react": "^7.0.9",
|
||||
"@storybook/react-vite": "^7.0.9",
|
||||
"@storybook/test-runner": "^0.10.0",
|
||||
"@storybook/testing-library": "^0.1.0",
|
||||
"@types/react": "^18.2.5",
|
||||
"@types/react-dnd": "^3.0.2",
|
||||
"@types/react-dom": "18.2.3",
|
||||
"@types/react-dom": "18.2.4",
|
||||
"@vanilla-extract/css": "^1.11.0",
|
||||
"@vitejs/plugin-react": "^4.0.0",
|
||||
"concurrently": "^8.0.1",
|
||||
"jest-mock": "^29.5.0",
|
||||
"serve": "^14.2.0",
|
||||
"storybook": "^7.0.8",
|
||||
"storybook": "^7.0.9",
|
||||
"storybook-dark-mode": "^3.0.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.3.4",
|
||||
"vite": "^4.3.5",
|
||||
"wait-on": "^7.0.1",
|
||||
"yjs": "^13.6.1"
|
||||
},
|
||||
|
||||
Vendored
+2
-2
@@ -4,8 +4,8 @@
|
||||
"main": "./src/index.ts",
|
||||
"module": "./src/index.ts",
|
||||
"devDependencies": {
|
||||
"@blocksuite/global": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"next": "^13.4.0",
|
||||
"@blocksuite/global": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"next": "^13.4.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zod": "^3.21.4"
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
"react-i18next": "^12.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.16.3",
|
||||
"@types/node": "^18.16.5",
|
||||
"@types/prettier": "^2.7.2",
|
||||
"next": "^13.4.0",
|
||||
"next": "^13.4.1",
|
||||
"prettier": "^2.8.8",
|
||||
"react-dom": "^18.2.0",
|
||||
"ts-node": "^10.9.1",
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
"main": "./src/index.ts",
|
||||
"dependencies": {
|
||||
"@affine/env": "workspace:*",
|
||||
"jotai": "^2.0.4"
|
||||
"jotai": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"lottie-web": "^5.11.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -15,16 +15,16 @@ type SetStateActionWithReset<Value> =
|
||||
// similar to atomWithStorage, but will not trigger twice on init
|
||||
// https://github.com/pmndrs/jotai/discussions/1737
|
||||
export function atomWithSyncStorage<Value>(key: string, initialValue: Value) {
|
||||
const storedValue = storage.getItem(key) as Value;
|
||||
const storedValue = storage.getItem(key, initialValue) as Value;
|
||||
const _value =
|
||||
typeof storedValue === 'symbol'
|
||||
? initialValue
|
||||
: (storage.getItem(key) as Value);
|
||||
: (storage.getItem(key, initialValue) as Value);
|
||||
const baseAtom = atom(_value);
|
||||
|
||||
baseAtom.onMount = setAtom => {
|
||||
if (storage.subscribe) {
|
||||
return storage.subscribe(key, setAtom);
|
||||
return storage.subscribe(key, setAtom, initialValue);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@napi-rs/cli": "^2.15.2",
|
||||
"@types/node": "^18.16.3"
|
||||
"@types/node": "^18.16.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vanilla-extract/vite-plugin": "^3.8.0",
|
||||
"vite": "^4.3.4",
|
||||
"vite": "^4.3.5",
|
||||
"vite-plugin-dts": "^2.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"@affine/env": "workspace:*",
|
||||
"@toeverything/y-indexeddb": "workspace:*",
|
||||
"firebase": "^9.21.0",
|
||||
"jotai": "^2.0.4",
|
||||
"jotai": "^2.1.0",
|
||||
"js-base64": "^3.7.5",
|
||||
"ky": "^0.33.3",
|
||||
"lib0": "^0.2.74",
|
||||
|
||||
@@ -50,8 +50,7 @@ const getStorage = () => createJSONStorage(() => localStorage);
|
||||
|
||||
export const getStoredWorkspaceMeta = () => {
|
||||
const storage = getStorage();
|
||||
const data = storage.getItem('jotai-workspaces') as RootWorkspaceMetadata[];
|
||||
return data;
|
||||
return storage.getItem('jotai-workspaces', []) as RootWorkspaceMetadata[];
|
||||
};
|
||||
|
||||
// global store
|
||||
|
||||
@@ -21,8 +21,9 @@ const logger = new DebugLogger('affine:workspace:local:crud');
|
||||
*/
|
||||
export function saveWorkspaceToLocalStorage(workspaceId: string) {
|
||||
const storage = getStorage();
|
||||
!Array.isArray(storage.getItem(kStoreKey)) && storage.setItem(kStoreKey, []);
|
||||
const data = storage.getItem(kStoreKey) as z.infer<typeof schema>;
|
||||
!Array.isArray(storage.getItem(kStoreKey, [])) &&
|
||||
storage.setItem(kStoreKey, []);
|
||||
const data = storage.getItem(kStoreKey, []) as z.infer<typeof schema>;
|
||||
const id = data.find(id => id === workspaceId);
|
||||
if (!id) {
|
||||
logger.debug('saveWorkspaceToLocalStorage', workspaceId);
|
||||
@@ -34,9 +35,9 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
||||
get: async workspaceId => {
|
||||
logger.debug('get', workspaceId);
|
||||
const storage = getStorage();
|
||||
!Array.isArray(storage.getItem(kStoreKey)) &&
|
||||
!Array.isArray(storage.getItem(kStoreKey, [])) &&
|
||||
storage.setItem(kStoreKey, []);
|
||||
const data = storage.getItem(kStoreKey) as z.infer<typeof schema>;
|
||||
const data = storage.getItem(kStoreKey, []) as z.infer<typeof schema>;
|
||||
const id = data.find(id => id === workspaceId);
|
||||
if (!id) {
|
||||
return null;
|
||||
@@ -56,7 +57,7 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
||||
create: async ({ doc }) => {
|
||||
logger.debug('create', doc);
|
||||
const storage = getStorage();
|
||||
!Array.isArray(storage.getItem(kStoreKey)) &&
|
||||
!Array.isArray(storage.getItem(kStoreKey, [])) &&
|
||||
storage.setItem(kStoreKey, []);
|
||||
const binary = BlockSuiteWorkspace.Y.encodeStateAsUpdateV2(doc);
|
||||
const id = nanoid();
|
||||
@@ -76,9 +77,9 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
||||
delete: async workspace => {
|
||||
logger.debug('delete', workspace);
|
||||
const storage = getStorage();
|
||||
!Array.isArray(storage.getItem(kStoreKey)) &&
|
||||
!Array.isArray(storage.getItem(kStoreKey, [])) &&
|
||||
storage.setItem(kStoreKey, []);
|
||||
const data = storage.getItem(kStoreKey) as z.infer<typeof schema>;
|
||||
const data = storage.getItem(kStoreKey, []) as z.infer<typeof schema>;
|
||||
const idx = data.findIndex(id => id === workspace.id);
|
||||
if (idx === -1) {
|
||||
throw new Error('workspace not found');
|
||||
@@ -93,8 +94,10 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
||||
list: async () => {
|
||||
logger.debug('list');
|
||||
const storage = getStorage();
|
||||
let allWorkspaceIDs: string[] = Array.isArray(storage.getItem(kStoreKey))
|
||||
? (storage.getItem(kStoreKey) as z.infer<typeof schema>)
|
||||
let allWorkspaceIDs: string[] = Array.isArray(
|
||||
storage.getItem(kStoreKey, [])
|
||||
)
|
||||
? (storage.getItem(kStoreKey, []) as z.infer<typeof schema>)
|
||||
: [];
|
||||
|
||||
// workspaces in desktop
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
"idb": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"vite": "^4.3.4",
|
||||
"@blocksuite/blocks": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"vite": "^4.3.5",
|
||||
"vite-plugin-dts": "^2.3.0",
|
||||
"y-indexeddb": "^9.0.11"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user