From 603f82ffc29b9c03a9f060ef042e40e8776c4f35 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Wed, 27 Sep 2023 21:53:04 -0500 Subject: [PATCH] refactor: using unified nanoid (#4519) --- apps/core/package.json | 12 +- apps/core/src/adapters/local/index.tsx | 2 +- apps/core/src/bootstrap/setup.ts | 2 +- .../collections/add-collection-button.tsx | 4 +- apps/core/src/hooks/use-workspaces.ts | 2 +- apps/core/src/layouts/workspace-layout.tsx | 2 +- apps/core/src/utils/user-setting.ts | 3 +- apps/electron/package.json | 8 +- .../src/helper/db/__tests__/migration.spec.ts | 2 +- apps/storybook/package.json | 12 +- packages/component/package.json | 10 +- .../notification-center/index.jotai.ts | 4 +- .../page-list/view/create-collection.tsx | 4 +- packages/env/package.json | 2 +- packages/hooks/package.json | 12 +- packages/infra/package.json | 10 +- .../infra/src/__tests__/migration.spec.ts | 2 +- packages/infra/src/blocksuite/index.ts | 28 ++- packages/infra/vite.config.ts | 1 + packages/sdk/package.json | 6 +- .../src/local/__tests__/crud.spec.ts | 2 +- packages/workspace/src/local/crud.ts | 3 +- .../__tests__/indexeddb-provider.spec.ts | 2 +- .../__tests__/sqlite-provider.spec.ts | 5 +- packages/y-indexeddb/package.json | 4 +- .../y-indexeddb/src/__tests__/index.spec.ts | 7 +- packages/y-provider/package.json | 2 +- packages/y-provider/src/lazy-provider.ts | 36 ++++ .../0.7.0-canary.18/e2e/basic.spec.ts | 4 + .../0.7.0-canary.18/package.json | 8 +- .../0.8.0-canary.7/e2e/basic.spec.ts | 4 + .../affine-legacy/0.8.0-canary.7/package.json | 8 +- tests/affine-legacy/0.8.3/e2e/basic.spec.ts | 4 + tests/affine-legacy/0.8.3/package.json | 8 +- tests/affine-local/e2e/image-preview.spec.ts | 8 +- .../e2e/local-first-collections-items.spec.ts | 12 +- .../e2e/local-first-delete-page.spec.ts | 2 + yarn.lock | 194 +++++++++--------- 38 files changed, 258 insertions(+), 183 deletions(-) diff --git a/apps/core/package.json b/apps/core/package.json index b0fb01d6d1..e950f56a90 100644 --- a/apps/core/package.json +++ b/apps/core/package.json @@ -24,13 +24,13 @@ "@affine/i18n": "workspace:*", "@affine/templates": "workspace:*", "@affine/workspace": "workspace:*", - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", "@blocksuite/icons": "^2.1.33", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@dnd-kit/core": "^6.0.8", "@dnd-kit/sortable": "^7.0.2", "@emotion/cache": "^11.11.0", diff --git a/apps/core/src/adapters/local/index.tsx b/apps/core/src/adapters/local/index.tsx index 816d8c671d..fba05f34fc 100644 --- a/apps/core/src/adapters/local/index.tsx +++ b/apps/core/src/adapters/local/index.tsx @@ -20,11 +20,11 @@ import { globalBlockSuiteSchema, } from '@affine/workspace/manager'; import { createIndexedDBDownloadProvider } from '@affine/workspace/providers'; -import { nanoid } from '@blocksuite/store'; import { useStaticBlockSuiteWorkspace } from '@toeverything/infra/__internal__/react'; import { getCurrentStore } from '@toeverything/infra/atom'; import { initEmptyPage } from '@toeverything/infra/blocksuite'; import { buildShowcaseWorkspace } from '@toeverything/infra/blocksuite'; +import { nanoid } from 'nanoid'; import { useCallback } from 'react'; import { setPageModeAtom } from '../../atoms'; diff --git a/apps/core/src/bootstrap/setup.ts b/apps/core/src/bootstrap/setup.ts index f0f01e4adf..e8e78bdc26 100644 --- a/apps/core/src/bootstrap/setup.ts +++ b/apps/core/src/bootstrap/setup.ts @@ -12,7 +12,6 @@ import { globalBlockSuiteSchema, } from '@affine/workspace/manager'; import { assertExists } from '@blocksuite/global/utils'; -import { nanoid } from '@blocksuite/store'; import { migrateLocalBlobStorage, migrateWorkspace, @@ -20,6 +19,7 @@ import { } from '@toeverything/infra/blocksuite'; import { downloadBinary, overwriteBinary } from '@toeverything/y-indexeddb'; import type { createStore } from 'jotai/vanilla'; +import { nanoid } from 'nanoid'; import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs'; import { WorkspaceAdapters } from '../adapters/workspace'; diff --git a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx index 86e76eca23..5212c2260a 100644 --- a/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx +++ b/apps/core/src/components/pure/workspace-slider-bar/collections/add-collection-button.tsx @@ -6,8 +6,8 @@ import type { Collection } from '@affine/env/filter'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { PlusIcon } from '@blocksuite/icons'; import type { Workspace } from '@blocksuite/store'; -import { uuidv4 } from '@blocksuite/store'; import { IconButton } from '@toeverything/components/button'; +import { nanoid } from 'nanoid'; import { useCallback, useState } from 'react'; import { useGetPageInfoById } from '../../../../hooks/use-get-page-info'; @@ -28,7 +28,7 @@ export const AddCollectionButton = ({ const handleClick = useCallback(() => { showUpdateCollection(true); setDefaultCollection({ - id: uuidv4(), + id: nanoid(), name: '', pinned: true, filterList: [], diff --git a/apps/core/src/hooks/use-workspaces.ts b/apps/core/src/hooks/use-workspaces.ts index 91e172de21..a6475f35d7 100644 --- a/apps/core/src/hooks/use-workspaces.ts +++ b/apps/core/src/hooks/use-workspaces.ts @@ -6,7 +6,6 @@ import { getOrCreateWorkspace, globalBlockSuiteSchema, } from '@affine/workspace/manager'; -import { nanoid } from '@blocksuite/store'; import { getWorkspace } from '@toeverything/infra/__internal__/workspace'; import { getCurrentStore } from '@toeverything/infra/atom'; import { @@ -14,6 +13,7 @@ import { WorkspaceVersion, } from '@toeverything/infra/blocksuite'; import { useAtomValue, useSetAtom } from 'jotai'; +import { nanoid } from 'nanoid'; import { useCallback } from 'react'; import { LocalAdapter } from '../adapters/local'; diff --git a/apps/core/src/layouts/workspace-layout.tsx b/apps/core/src/layouts/workspace-layout.tsx index 808f2778fc..6336559e5f 100644 --- a/apps/core/src/layouts/workspace-layout.tsx +++ b/apps/core/src/layouts/workspace-layout.tsx @@ -17,7 +17,6 @@ import { rootWorkspacesMetadataAtom, } from '@affine/workspace/atom'; import { assertExists } from '@blocksuite/global/utils'; -import { nanoid } from '@blocksuite/store'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext, @@ -32,6 +31,7 @@ import { useBlockSuitePageMeta } from '@toeverything/hooks/use-block-suite-page- import { usePassiveWorkspaceEffect } from '@toeverything/infra/__internal__/react'; import { currentWorkspaceIdAtom } from '@toeverything/infra/atom'; import { useAtom, useAtomValue, useSetAtom } from 'jotai'; +import { nanoid } from 'nanoid'; import type { PropsWithChildren, ReactElement } from 'react'; import { lazy, Suspense, useCallback, useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; diff --git a/apps/core/src/utils/user-setting.ts b/apps/core/src/utils/user-setting.ts index f53b5de0bd..7bda66e0c0 100644 --- a/apps/core/src/utils/user-setting.ts +++ b/apps/core/src/utils/user-setting.ts @@ -5,6 +5,7 @@ import { currentWorkspaceAtom } from '@toeverything/infra/atom'; import { type DBSchema, openDB } from 'idb'; import { atom } from 'jotai'; import { atomWithObservable } from 'jotai/utils'; +import { nanoid } from 'nanoid'; import { Observable } from 'rxjs'; import type { Map as YMap } from 'yjs'; import { Doc as YDoc } from 'yjs'; @@ -116,7 +117,7 @@ const pageCollectionBaseAtom = atomWithObservable(get => { settingMap.set( userId, new YDoc({ - guid: `${rootDoc.guid}:settings:${userId}`, + guid: nanoid(), }) ); } diff --git a/apps/electron/package.json b/apps/electron/package.json index c37e9d13d4..ff915bae21 100644 --- a/apps/electron/package.json +++ b/apps/electron/package.json @@ -29,10 +29,10 @@ "@affine/env": "workspace:*", "@affine/native": "workspace:*", "@affine/sdk": "workspace:*", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@electron-forge/cli": "^6.4.1", "@electron-forge/core": "^6.4.1", "@electron-forge/core-utils": "^6.4.1", diff --git a/apps/electron/src/helper/db/__tests__/migration.spec.ts b/apps/electron/src/helper/db/__tests__/migration.spec.ts index f59bad5edd..0eaaef8402 100644 --- a/apps/electron/src/helper/db/__tests__/migration.spec.ts +++ b/apps/electron/src/helper/db/__tests__/migration.spec.ts @@ -59,7 +59,7 @@ describe('migrateToSubdocAndReplaceDatabase', () => { expect(pageMeta.title).toBe('Welcome to AFFiNEd'); // get the subdoc through id - const subDoc = rootDoc.getMap('spaces').get(`space:${pageMeta.id}`) as YDoc; + const subDoc = rootDoc.getMap('spaces').get(pageMeta.id) as YDoc; expect(subDoc).toEqual(rootDoc.subdocs.values().next().value); await db.close(); diff --git a/apps/storybook/package.json b/apps/storybook/package.json index c193317775..e659583937 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -31,13 +31,13 @@ "wait-on": "^7.0.1" }, "devDependencies": { - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", "@blocksuite/icons": "^2.1.33", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@tomfreudenberg/next-auth-mock": "^0.5.6", "chromatic": "^6.24.1", "react": "18.2.0", diff --git a/packages/component/package.json b/packages/component/package.json index ef9b4036ca..344a564f36 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -54,12 +54,12 @@ "rxjs": "^7.8.1" }, "devDependencies": { - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", "@blocksuite/icons": "^2.1.33", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@types/react": "^18.2.21", "@types/react-datepicker": "^4.15.0", "@types/react-dnd": "^3.0.2", diff --git a/packages/component/src/components/notification-center/index.jotai.ts b/packages/component/src/components/notification-center/index.jotai.ts index 8ecccb6a12..89dfb934ca 100644 --- a/packages/component/src/components/notification-center/index.jotai.ts +++ b/packages/component/src/components/notification-center/index.jotai.ts @@ -1,5 +1,5 @@ -import { uuidv4 } from '@blocksuite/store'; import { atom } from 'jotai'; +import { nanoid } from 'nanoid'; export type Notification = { key?: string; @@ -42,7 +42,7 @@ export const removeNotificationAtom = atom(null, (_, set, key: string) => { export const pushNotificationAtom = atom( null, (_, set, newNotification) => { - newNotification.key = newNotification.key || uuidv4(); + newNotification.key = newNotification.key || nanoid(); const key = newNotification.key; const removeNotification = () => set(notificationsBaseAtom, notifications => diff --git a/packages/component/src/components/page-list/view/create-collection.tsx b/packages/component/src/components/page-list/view/create-collection.tsx index 0972a38005..1d6cb88e31 100644 --- a/packages/component/src/components/page-list/view/create-collection.tsx +++ b/packages/component/src/components/page-list/view/create-collection.tsx @@ -8,9 +8,9 @@ import { RemoveIcon, SaveIcon, } from '@blocksuite/icons'; -import { uuidv4 } from '@blocksuite/store'; import { Button } from '@toeverything/components/button'; import { Modal } from '@toeverything/components/modal'; +import { nanoid } from 'nanoid'; import { useCallback, useMemo, useState } from 'react'; import { Input, ScrollableContainer } from '../../..'; @@ -280,7 +280,7 @@ export const SaveCollectionButton = ({ const handleClick = useCallback(() => { changeShow(true); setInit({ - id: uuidv4(), + id: nanoid(), name: '', filterList, workspaceId, diff --git a/packages/env/package.json b/packages/env/package.json index 29565de18e..33de12e631 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -5,7 +5,7 @@ "main": "./src/index.ts", "module": "./src/index.ts", "devDependencies": { - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", "react": "18.2.0", "react-dom": "18.2.0", "zod": "^3.22.2" diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 098273d754..a62c00ef88 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -12,12 +12,12 @@ "devDependencies": { "@affine/env": "workspace:*", "@affine/y-provider": "workspace:*", - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@types/lodash.debounce": "^4.0.7" }, "peerDependencies": { diff --git a/packages/infra/package.json b/packages/infra/package.json index 5824c7ebf9..ef0e2071a4 100644 --- a/packages/infra/package.json +++ b/packages/infra/package.json @@ -55,16 +55,16 @@ }, "dependencies": { "@affine/sdk": "workspace:*", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "jotai": "^2.4.1", "tinykeys": "^2.1.0", "zod": "^3.22.2" }, "devDependencies": { - "@blocksuite/editor": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/lit": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly", "async-call-rpc": "^6.3.1", "electron": "link:../../apps/electron/node_modules/electron", "react": "^18.2.0", diff --git a/packages/infra/src/__tests__/migration.spec.ts b/packages/infra/src/__tests__/migration.spec.ts index 12cfa238fe..a133950c93 100644 --- a/packages/infra/src/__tests__/migration.spec.ts +++ b/packages/infra/src/__tests__/migration.spec.ts @@ -33,7 +33,7 @@ describe('migration', () => { } const blocks = doc.getMap('space:hello-world').toJSON(); const newDoc = migrateToSubdoc(doc); - const subDoc = newDoc.getMap('spaces').get('space:hello-world') as Doc; + const subDoc = newDoc.getMap('spaces').values().next().value as Doc; const data = (subDoc.toJSON() as any).blocks; Object.keys(data).forEach(id => { if (id === 'xyWNqindHH') { diff --git a/packages/infra/src/blocksuite/index.ts b/packages/infra/src/blocksuite/index.ts index 791eb84d7c..216b651ca1 100644 --- a/packages/infra/src/blocksuite/index.ts +++ b/packages/infra/src/blocksuite/index.ts @@ -213,6 +213,7 @@ import { applyUpdate, encodeStateAsUpdate } from 'yjs'; const migrationOrigin = 'affine-migration'; import type { Schema } from '@blocksuite/store'; +import { nanoid } from 'nanoid'; type XYWH = [number, number, number, number]; @@ -404,7 +405,11 @@ function updateBlockVersions(versions: YMap) { } } -function migrateMeta(oldDoc: YDoc, newDoc: YDoc) { +function migrateMeta( + oldDoc: YDoc, + newDoc: YDoc, + idMap: Record +) { const originalMeta = oldDoc.getMap('space:meta'); const originalVersions = originalMeta.get('versions') as YMap; const originalPages = originalMeta.get('pages') as YArray>; @@ -423,24 +428,34 @@ function migrateMeta(oldDoc: YDoc, newDoc: YDoc) { Array.from(page.entries()) .filter(([key]) => key !== 'subpageIds') .forEach(([key, value]) => { - map.set(key, value); + if (key === 'id') { + idMap[value] = nanoid(); + map.set(key, idMap[value]); + } else { + map.set(key, value); + } }); return map; }); pages.push(mapList); } -function migrateBlocks(oldDoc: YDoc, newDoc: YDoc) { +function migrateBlocks( + oldDoc: YDoc, + newDoc: YDoc, + idMap: Record +) { const spaces = newDoc.getMap('spaces'); const originalMeta = oldDoc.getMap('space:meta'); const originalVersions = originalMeta.get('versions') as YMap; const originalPages = originalMeta.get('pages') as YArray>; originalPages.forEach(page => { const id = page.get('id') as string; + const newId = idMap[id]; const spaceId = id.startsWith('space:') ? id : `space:${id}`; const originalBlocks = oldDoc.getMap(spaceId) as YMap; const subdoc = new YDoc(); - spaces.set(spaceId, subdoc); + spaces.set(newId, subdoc); const blocks = subdoc.getMap('blocks'); Array.from(originalBlocks.entries()).forEach(([key, value]) => { const blockData = value.clone(); @@ -461,8 +476,9 @@ export function migrateToSubdoc(oldDoc: YDoc): YDoc { return oldDoc; } const newDoc = new YDoc(); - migrateMeta(oldDoc, newDoc); - migrateBlocks(oldDoc, newDoc); + const idMap = {} as Record; + migrateMeta(oldDoc, newDoc, idMap); + migrateBlocks(oldDoc, newDoc, idMap); return newDoc; } diff --git a/packages/infra/vite.config.ts b/packages/infra/vite.config.ts index 19f7bc3247..a59c8ed098 100644 --- a/packages/infra/vite.config.ts +++ b/packages/infra/vite.config.ts @@ -36,6 +36,7 @@ export default defineConfig({ 'zod', 'react', 'yjs', + 'nanoid', /^jotai/, /^@blocksuite/, /^@affine\/templates/, diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 657360bcb0..3d69d81f16 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -22,9 +22,9 @@ "dist" ], "dependencies": { - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "jotai": "^2.4.1", "zod": "^3.22.2" }, diff --git a/packages/workspace/src/local/__tests__/crud.spec.ts b/packages/workspace/src/local/__tests__/crud.spec.ts index fa106aad6f..51339eed59 100644 --- a/packages/workspace/src/local/__tests__/crud.spec.ts +++ b/packages/workspace/src/local/__tests__/crud.spec.ts @@ -60,7 +60,7 @@ describe('crud', () => { expect(localWorkspace.blockSuiteWorkspace.doc.toJSON()).toEqual({ meta: expect.anything(), spaces: expect.objectContaining({ - 'space:page0': expect.anything(), + page0: expect.anything(), }), }); diff --git a/packages/workspace/src/local/crud.ts b/packages/workspace/src/local/crud.ts index 498a0837f8..da40919386 100644 --- a/packages/workspace/src/local/crud.ts +++ b/packages/workspace/src/local/crud.ts @@ -1,8 +1,9 @@ import { DebugLogger } from '@affine/debug'; import type { LocalWorkspace, WorkspaceCRUD } from '@affine/env/workspace'; import { WorkspaceFlavour } from '@affine/env/workspace'; -import { nanoid, Workspace as BlockSuiteWorkspace } from '@blocksuite/store'; +import { Workspace as BlockSuiteWorkspace } from '@blocksuite/store'; import { createJSONStorage } from 'jotai/utils'; +import { nanoid } from 'nanoid'; import { z } from 'zod'; import { getOrCreateWorkspace } from '../manager'; diff --git a/packages/workspace/src/providers/__tests__/indexeddb-provider.spec.ts b/packages/workspace/src/providers/__tests__/indexeddb-provider.spec.ts index b8eb217c6f..4105401a78 100644 --- a/packages/workspace/src/providers/__tests__/indexeddb-provider.spec.ts +++ b/packages/workspace/src/providers/__tests__/indexeddb-provider.spec.ts @@ -76,7 +76,7 @@ describe('download provider', () => { ...prev, // download provider only download the root doc spaces: { - 'space:page0': { + page0: { blocks: {}, }, }, diff --git a/packages/workspace/src/providers/__tests__/sqlite-provider.spec.ts b/packages/workspace/src/providers/__tests__/sqlite-provider.spec.ts index a48506aa50..945c711fca 100644 --- a/packages/workspace/src/providers/__tests__/sqlite-provider.spec.ts +++ b/packages/workspace/src/providers/__tests__/sqlite-provider.spec.ts @@ -5,12 +5,13 @@ import type { import { getDoc } from '@affine/y-provider'; import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models'; import type { Y as YType } from '@blocksuite/store'; -import { Schema, uuidv4, Workspace } from '@blocksuite/store'; +import { Schema, Workspace } from '@blocksuite/store'; import type { DBHandlerManager } from '@toeverything/infra/handler'; import type { EventMap, UnwrapManagerHandlerToClientSide, } from '@toeverything/infra/type'; +import { nanoid } from 'nanoid'; import { setTimeout } from 'timers/promises'; import { beforeEach, describe, expect, test, vi } from 'vitest'; @@ -79,7 +80,7 @@ const schema = new Schema(); schema.register(AffineSchemas).register(__unstableSchemas); beforeEach(() => { - id = uuidv4(); + id = nanoid(); workspace = new Workspace({ id, isSSR: true, diff --git a/packages/y-indexeddb/package.json b/packages/y-indexeddb/package.json index c661603e88..a52f335389 100644 --- a/packages/y-indexeddb/package.json +++ b/packages/y-indexeddb/package.json @@ -38,8 +38,8 @@ }, "devDependencies": { "@affine/y-provider": "workspace:*", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "vite": "^4.4.9", "vite-plugin-dts": "3.5.3", "y-indexeddb": "^9.0.11" diff --git a/packages/y-indexeddb/src/__tests__/index.spec.ts b/packages/y-indexeddb/src/__tests__/index.spec.ts index 0035c12805..46c1a8e167 100644 --- a/packages/y-indexeddb/src/__tests__/index.spec.ts +++ b/packages/y-indexeddb/src/__tests__/index.spec.ts @@ -8,8 +8,9 @@ import { setTimeout } from 'node:timers/promises'; import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models'; import { assertExists } from '@blocksuite/global/utils'; import type { Page } from '@blocksuite/store'; -import { Schema, uuidv4, Workspace } from '@blocksuite/store'; +import { Schema, Workspace } from '@blocksuite/store'; import { openDB } from 'idb'; +import { nanoid } from 'nanoid'; import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; import { applyUpdate, Doc, encodeStateAsUpdate } from 'yjs'; @@ -61,7 +62,7 @@ const schema = new Schema(); schema.register(AffineSchemas).register(__unstableSchemas); beforeEach(() => { - id = uuidv4(); + id = nanoid(); workspace = new Workspace({ id, isSSR: true, @@ -119,7 +120,7 @@ describe('indexeddb provider', () => { data.updates.forEach(({ update }) => { Workspace.Y.applyUpdate(testWorkspace.doc, update); }); - const subPage = testWorkspace.doc.spaces.get('space:page0'); + const subPage = testWorkspace.doc.spaces.get('page0'); { assertExists(subPage); await store.get(subPage.guid); diff --git a/packages/y-provider/package.json b/packages/y-provider/package.json index 4b58e9dc37..7d1700eb59 100644 --- a/packages/y-provider/package.json +++ b/packages/y-provider/package.json @@ -9,7 +9,7 @@ ".": "./src/index.ts" }, "devDependencies": { - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly" + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly" }, "peerDependencies": { "yjs": "^13.5.51" diff --git a/packages/y-provider/src/lazy-provider.ts b/packages/y-provider/src/lazy-provider.ts index 6584e11d49..ee59b4c01e 100644 --- a/packages/y-provider/src/lazy-provider.ts +++ b/packages/y-provider/src/lazy-provider.ts @@ -97,6 +97,42 @@ export const createLazyProvider = ( async function syncDoc(doc: Doc) { const guid = doc.guid; + { + // backport from `@blocksuite/store` + const prefixId = guid.startsWith('space:') ? guid.slice(6) : guid; + const possible1 = `${rootDoc.guid}:space:${prefixId}`; + const possible2 = `space:${prefixId}`; + const update1 = await datasource.queryDocState(possible1); + const update2 = await datasource.queryDocState(possible2); + let hasUpdate = false; + if ( + update1 && + update1.missing.length !== 2 && + update1.missing[0] !== 0 && + update1.missing[1] !== 0 + ) { + applyUpdate(doc, update1.missing, origin); + hasUpdate = true; + } + if ( + update2 && + update2.missing.length !== 2 && + update2.missing[0] !== 0 && + update2.missing[1] !== 0 + ) { + applyUpdate(doc, update2.missing, origin); + hasUpdate = true; + } + if (hasUpdate) { + await datasource.sendDocUpdate( + guid, + encodeStateAsUpdate( + doc, + update1 ? update1.state : update2 ? update2.state : undefined + ) + ); + } + } if (!connected) { return; } diff --git a/tests/affine-legacy/0.7.0-canary.18/e2e/basic.spec.ts b/tests/affine-legacy/0.7.0-canary.18/e2e/basic.spec.ts index 7c0ef5925f..71642c1ebb 100644 --- a/tests/affine-legacy/0.7.0-canary.18/e2e/basic.spec.ts +++ b/tests/affine-legacy/0.7.0-canary.18/e2e/basic.spec.ts @@ -9,6 +9,7 @@ import { check8080Available, setupProxyServer, } from '@affine-test/kit/utils/proxy'; +import { clickSideBarAllPageButton } from '@affine-test/kit/utils/sidebar'; import { expect } from '@playwright/test'; const { switchToNext } = setupProxyServer( @@ -28,5 +29,8 @@ test('init page', async ({ page, context }) => { await page.waitForTimeout(1000); await page.goto('http://localhost:8081/'); await waitForEditorLoad(page); + await clickSideBarAllPageButton(page); + await page.getByText('hello').click(); + await waitForEditorLoad(page); expect(await page.locator('v-line').nth(0).textContent()).toBe('hello'); }); diff --git a/tests/affine-legacy/0.7.0-canary.18/package.json b/tests/affine-legacy/0.7.0-canary.18/package.json index 1280ac9d94..22d20969fa 100644 --- a/tests/affine-legacy/0.7.0-canary.18/package.json +++ b/tests/affine-legacy/0.7.0-canary.18/package.json @@ -10,10 +10,10 @@ "devDependencies": { "@affine-test/fixtures": "workspace:*", "@affine-test/kit": "workspace:*", - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@playwright/test": "^1.37.1", "express": "^4.18.2", "http-proxy-middleware": "^3.0.0-beta.1", diff --git a/tests/affine-legacy/0.8.0-canary.7/e2e/basic.spec.ts b/tests/affine-legacy/0.8.0-canary.7/e2e/basic.spec.ts index d522e89365..827a127f4d 100644 --- a/tests/affine-legacy/0.8.0-canary.7/e2e/basic.spec.ts +++ b/tests/affine-legacy/0.8.0-canary.7/e2e/basic.spec.ts @@ -37,6 +37,10 @@ test('database migration', async ({ page, context }) => { await switchToNext(); await page.waitForTimeout(1000); await page.goto(url); + //#region fixme(himself65): blocksuite issue, data cannot be loaded to store + await page.waitForTimeout(5000); + await page.reload(); + //#endregion await waitForEditorLoad(page); // check page mode is correct expect(await page.locator('v-line').nth(0).textContent()).toBe('hello'); diff --git a/tests/affine-legacy/0.8.0-canary.7/package.json b/tests/affine-legacy/0.8.0-canary.7/package.json index efedee49f3..7cc59b06a0 100644 --- a/tests/affine-legacy/0.8.0-canary.7/package.json +++ b/tests/affine-legacy/0.8.0-canary.7/package.json @@ -9,10 +9,10 @@ "devDependencies": { "@affine-test/fixtures": "workspace:*", "@affine-test/kit": "workspace:*", - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@playwright/test": "^1.37.1", "express": "^4.18.2", "http-proxy-middleware": "^3.0.0-beta.1", diff --git a/tests/affine-legacy/0.8.3/e2e/basic.spec.ts b/tests/affine-legacy/0.8.3/e2e/basic.spec.ts index 536d6e2761..649b05eff9 100644 --- a/tests/affine-legacy/0.8.3/e2e/basic.spec.ts +++ b/tests/affine-legacy/0.8.3/e2e/basic.spec.ts @@ -52,6 +52,10 @@ test('surface migration', async ({ page, context }) => { await switchToNext(); await page.waitForTimeout(1000); await page.goto(url); + //#region fixme(himself65): blocksuite issue, data cannot be loaded to store + await page.waitForTimeout(5000); + await page.reload(); + //#endregion await waitForEditorLoad(page); // check edgeless mode is correct diff --git a/tests/affine-legacy/0.8.3/package.json b/tests/affine-legacy/0.8.3/package.json index 99e34335a9..aedd111ad2 100644 --- a/tests/affine-legacy/0.8.3/package.json +++ b/tests/affine-legacy/0.8.3/package.json @@ -9,10 +9,10 @@ "devDependencies": { "@affine-test/fixtures": "workspace:*", "@affine-test/kit": "workspace:*", - "@blocksuite/block-std": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/blocks": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/global": "0.0.0-20230921103931-38d8f07a-nightly", - "@blocksuite/store": "0.0.0-20230921103931-38d8f07a-nightly", + "@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly", + "@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly", "@playwright/test": "^1.37.1", "express": "^4.18.2", "http-proxy-middleware": "^3.0.0-beta.1", diff --git a/tests/affine-local/e2e/image-preview.spec.ts b/tests/affine-local/e2e/image-preview.spec.ts index a1b8317b5e..475bb69d48 100644 --- a/tests/affine-local/e2e/image-preview.spec.ts +++ b/tests/affine-local/e2e/image-preview.spec.ts @@ -415,11 +415,9 @@ test('image able to download', async ({ page }) => { const downloadPromise = page.waitForEvent('download'); await locator.getByTestId('download-button').click(); const download = await downloadPromise; - expect(download.suggestedFilename()).toBe(`${blobId}.png`); - await download.saveAs(`download/ + ${download.suggestedFilename()}`); - expect( - fs.existsSync(`download/ + ${download.suggestedFilename()}`) - ).toBeTruthy(); + const name = download.suggestedFilename(); + await download.saveAs(`download/ + ${name}`); + expect(fs.existsSync(`download/ + ${name}`)).toBeTruthy(); }); test('image should only able to move when image is larger than viewport', async ({ diff --git a/tests/affine-local/e2e/local-first-collections-items.spec.ts b/tests/affine-local/e2e/local-first-collections-items.spec.ts index c9c51ec106..7b29d4a345 100644 --- a/tests/affine-local/e2e/local-first-collections-items.spec.ts +++ b/tests/affine-local/e2e/local-first-collections-items.spec.ts @@ -33,9 +33,15 @@ const createAndPinCollection = async ( name: 'test page', }); await expect(cell).toBeVisible(); - await page.getByTestId('create-first-filter').click(); - await page.getByTestId(`filler-tag-Created`).click(); - await page.getByTestId('save-as-collection').click(); + await page.getByTestId('create-first-filter').click({ + delay: 200, + }); + await page.getByTestId(`filler-tag-Created`).click({ + delay: 200, + }); + await page.getByTestId('save-as-collection').click({ + delay: 200, + }); const title = page.getByTestId('input-collection-title'); await title.isVisible(); await title.fill(options?.collectionName ?? 'test collection'); diff --git a/tests/affine-local/e2e/local-first-delete-page.spec.ts b/tests/affine-local/e2e/local-first-delete-page.spec.ts index aed262384a..a11e6f60a5 100644 --- a/tests/affine-local/e2e/local-first-delete-page.spec.ts +++ b/tests/affine-local/e2e/local-first-delete-page.spec.ts @@ -90,11 +90,13 @@ test('page delete -> create new page -> refresh page -> new page should be appea await clickNewPageButton(page); await getBlockSuiteEditorTitle(page).click(); await getBlockSuiteEditorTitle(page).fill('this is a new page1'); + await page.waitForTimeout(1000); const newPageId1 = page.url().split('/').reverse()[0]; await page.getByTestId('all-pages').click(); await clickNewPageButton(page); await getBlockSuiteEditorTitle(page).click(); await getBlockSuiteEditorTitle(page).fill('this is a new page2'); + await page.waitForTimeout(1000); const newPageId2 = page.url().split('/').reverse()[0]; await page.getByTestId('all-pages').click(); await page.reload(); diff --git a/yarn.lock b/yarn.lock index 0914afd668..48a6846f9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,10 +25,10 @@ __metadata: dependencies: "@affine-test/fixtures": "workspace:*" "@affine-test/kit": "workspace:*" - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@playwright/test": ^1.37.1 express: ^4.18.2 http-proxy-middleware: ^3.0.0-beta.1 @@ -42,10 +42,10 @@ __metadata: dependencies: "@affine-test/fixtures": "workspace:*" "@affine-test/kit": "workspace:*" - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@playwright/test": ^1.37.1 express: ^4.18.2 http-proxy-middleware: ^3.0.0-beta.1 @@ -59,10 +59,10 @@ __metadata: dependencies: "@affine-test/fixtures": "workspace:*" "@affine-test/kit": "workspace:*" - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@playwright/test": ^1.37.1 express: ^4.18.2 http-proxy-middleware: ^3.0.0-beta.1 @@ -190,12 +190,12 @@ __metadata: "@affine/debug": "workspace:*" "@affine/i18n": "workspace:*" "@affine/workspace": "workspace:*" - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly "@blocksuite/icons": ^2.1.33 - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@dnd-kit/core": ^6.0.8 "@dnd-kit/modifiers": ^6.0.1 "@dnd-kit/sortable": ^7.0.2 @@ -284,13 +284,13 @@ __metadata: "@affine/templates": "workspace:*" "@affine/workspace": "workspace:*" "@aws-sdk/client-s3": 3.400.0 - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly "@blocksuite/icons": ^2.1.33 - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@dnd-kit/core": ^6.0.8 "@dnd-kit/sortable": ^7.0.2 "@emotion/cache": ^11.11.0 @@ -369,10 +369,10 @@ __metadata: "@affine/env": "workspace:*" "@affine/native": "workspace:*" "@affine/sdk": "workspace:*" - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@electron-forge/cli": ^6.4.1 "@electron-forge/core": ^6.4.1 "@electron-forge/core-utils": ^6.4.1 @@ -416,7 +416,7 @@ __metadata: version: 0.0.0-use.local resolution: "@affine/env@workspace:packages/env" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly lit: ^2.8.0 react: 18.2.0 react-dom: 18.2.0 @@ -603,9 +603,9 @@ __metadata: version: 0.0.0-use.local resolution: "@affine/sdk@workspace:packages/sdk" dependencies: - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly jotai: ^2.4.1 vite: ^4.4.9 vite-plugin-dts: 3.5.3 @@ -718,13 +718,13 @@ __metadata: dependencies: "@affine/component": "workspace:*" "@affine/i18n": "workspace:*" - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly "@blocksuite/icons": ^2.1.33 - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@storybook/addon-actions": ^7.4.0 "@storybook/addon-essentials": ^7.4.0 "@storybook/addon-interactions": ^7.4.0 @@ -821,7 +821,7 @@ __metadata: version: 0.0.0-use.local resolution: "@affine/y-provider@workspace:packages/y-provider" dependencies: - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly peerDependencies: yjs: ^13.5.51 languageName: unknown @@ -3404,26 +3404,26 @@ __metadata: languageName: node linkType: hard -"@blocksuite/block-std@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/block-std@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/block-std@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/block-std@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly lz-string: ^1.5.0 w3c-keyname: ^2.2.8 zod: ^3.22.2 peerDependencies: - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly - checksum: 72f06c2ce137247ba4a85070469548390b929217b8704227044ca255e7768fafbd9352d0067fa4da041d212ed2036ad9c27842f556cd3703757290536ca92c8e + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly + checksum: d20c28bcdae0cb9d6d79c615c7caffdba818ffc5fd5627646eb78e1bfdedf14e58f0ed46ec573b701fbd15077dd194b7378c6d0d4acc461166a7487a0f63619c languageName: node linkType: hard -"@blocksuite/blocks@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/blocks@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/blocks@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/blocks@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/virgo": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/virgo": 0.0.0-20230926212737-6d4b1569-nightly "@floating-ui/dom": ^1.5.1 "@types/webfontloader": ^1.6.35 buffer: ^6.0.3 @@ -3440,37 +3440,37 @@ __metadata: webfontloader: ^1.6.28 zod: ^3.22.2 peerDependencies: - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@toeverything/theme": ^0.7.16 nanoid: ^4 - checksum: 373f309e81628be9962f094d6a47dae54f2e5a656a14cd9e49db9c5f46ced7cbb5cab49aa5808de199ec0c80f0c64d4acfefe4f9134a66045283b71d6b73a658 + checksum: 6a6f0a8ec00a86eaff48a97b0d49a8bcc0639f2a375314b05b94ae6e93d55d972af38c704126eab16608654e39e0df9f96d6eb914278dc17ea432d600b24ba31 languageName: node linkType: hard -"@blocksuite/editor@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/editor@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/editor@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/editor@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly lit: ^2.8.0 peerDependencies: - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@toeverything/theme": ^0.7.16 - checksum: c78a384b9d7bab8f2592d4d716a2e2a075a31fec576514100821a115c3f181e51cf32a715b9b7de6a8e8fcf2542a5e0827a09aa99db6cfdf6ab1db330daf4d92 + checksum: 032e861ee0a0dd19d7cc46e5f3e196cd004221bb604df553ef9206db06ccdb315862a003d3d751f70a26e4372d118eff8667f4746e3db4ce406a87713396d456 languageName: node linkType: hard -"@blocksuite/global@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/global@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/global@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/global@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: ansi-colors: ^4.1.3 zod: ^3.22.2 - checksum: 60543e000325f2a8a062c1cad5c6a4de9d0efe947b219cfb4145f8a2e4c95d046f121b1dbd54b1ca16a36396b6b0faed6793d5a96109cf24a6c39f1ca73579a9 + checksum: 23a4eb6d2d99accc569a9a2cfc925b7acaaae2b78da1224b3b7348734336ff96a33ccd80bfa2e4e9c25bfc0c45835870d4498064b5354b87c09f06dc1906c9a1 languageName: node linkType: hard @@ -3484,26 +3484,26 @@ __metadata: languageName: node linkType: hard -"@blocksuite/lit@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/lit@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/lit@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/lit@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/virgo": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/virgo": 0.0.0-20230926212737-6d4b1569-nightly lit: ^2.8.0 peerDependencies: - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly - checksum: bb6cde2e4460b91b84c22291c0d0b9c8d7de9c24c9e3e6cc509dd3eccffb528f29eaa61a563a843762004d3402c14796d70ff128ceba6df23ef171d838914cd7 + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly + checksum: fe387db73765a264508561e05acaf912fd1c8f5064d63208b95f6300755fb5cbeb167f5ba063c325bb90f826469cf138f6878795effb3f87b26b136cd72bdcc2 languageName: node linkType: hard -"@blocksuite/store@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/store@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/store@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/store@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/virgo": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/virgo": 0.0.0-20230926212737-6d4b1569-nightly "@types/flexsearch": ^0.7.3 buffer: ^6.0.3 flexsearch: 0.7.21 @@ -3518,20 +3518,20 @@ __metadata: peerDependencies: async-call-rpc: ^6 yjs: ^13 - checksum: ec658250117f022d8fd1d4ee0f9932d04763224a1fb9dcfb46b9d280946e949d2d4d1a2914d17290e388883b6dcf2b90f28e1782037b3c98de60baed67108f8b + checksum: 3114ad5aa867b04f24ac8ab23757538adc45c43196955351b9b2b4135bc6f74b9be84eafa1caceac3b30f315c87a25e2e1669dc748b59e3eab349e24e18ad71c languageName: node linkType: hard -"@blocksuite/virgo@npm:0.0.0-20230921103931-38d8f07a-nightly": - version: 0.0.0-20230921103931-38d8f07a-nightly - resolution: "@blocksuite/virgo@npm:0.0.0-20230921103931-38d8f07a-nightly" +"@blocksuite/virgo@npm:0.0.0-20230926212737-6d4b1569-nightly": + version: 0.0.0-20230926212737-6d4b1569-nightly + resolution: "@blocksuite/virgo@npm:0.0.0-20230926212737-6d4b1569-nightly" dependencies: - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly zod: ^3.22.2 peerDependencies: lit: ^2.7 yjs: ^13 - checksum: d3cf1917d9b6fb70bb16c9c147b9dc9ead22d9d26af7d74139a34d43e43db25f14094cd9957192d1f39ed1de4d6966e01c3f499c8b6bf2e42a86f39431ea60cd + checksum: 9fbd99fe3f5fbe784b48c820601a777e0f01914e6a4a03c90e9c7732a515329b07c7ce6268510ed0a630ab3640a3f7dce1d8e843b943f6dcea433c0572777a75 languageName: node linkType: hard @@ -12243,12 +12243,12 @@ __metadata: dependencies: "@affine/env": "workspace:*" "@affine/y-provider": "workspace:*" - "@blocksuite/block-std": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly "@types/lodash.debounce": ^4.0.7 foxact: ^0.2.20 lodash.debounce: ^4.0.8 @@ -12285,11 +12285,11 @@ __metadata: resolution: "@toeverything/infra@workspace:packages/infra" dependencies: "@affine/sdk": "workspace:*" - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/editor": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/global": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/lit": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/lit": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly async-call-rpc: ^6.3.1 electron: "link:../../apps/electron/node_modules/electron" jotai: ^2.4.1 @@ -12337,8 +12337,8 @@ __metadata: resolution: "@toeverything/y-indexeddb@workspace:packages/y-indexeddb" dependencies: "@affine/y-provider": "workspace:*" - "@blocksuite/blocks": 0.0.0-20230921103931-38d8f07a-nightly - "@blocksuite/store": 0.0.0-20230921103931-38d8f07a-nightly + "@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly + "@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly idb: ^7.1.1 vite: ^4.4.9 vite-plugin-dts: 3.5.3