From dd6901fe15a36c122a4b70d7aee4a1ea9d691008 Mon Sep 17 00:00:00 2001 From: donteatfriedrice Date: Thu, 25 Jul 2024 07:26:39 +0000 Subject: [PATCH] feat: bump blocksuite (#7603) ## Features - https://github.com/toeverything/BlockSuite/pull/7717 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7691 @L-Sun ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7720 @akumatus - https://github.com/toeverything/BlockSuite/pull/7719 @doouding ## Refactor - https://github.com/toeverything/BlockSuite/pull/7703 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7694 @doouding - https://github.com/toeverything/BlockSuite/pull/7700 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7716 @doodlewind ## Misc --- packages/common/env/package.json | 4 +- packages/common/infra/package.json | 12 +- packages/frontend/component/package.json | 10 +- packages/frontend/core/package.json | 12 +- .../presets/ai/actions/edgeless-handler.ts | 4 +- .../presets/ai/actions/edgeless-response.ts | 4 +- .../blocksuite/presets/ai/actions/types.ts | 2 +- .../ai/entries/slash-menu/setup-slash-menu.ts | 26 ++-- .../blocksuite/presets/ai/utils/edgeless.ts | 4 +- .../presets/ai/utils/selection-utils.ts | 2 +- .../frontend/core/src/bootstrap/preload.ts | 1 - .../register-blocksuite-components.ts | 26 ---- .../block-suite-editor/ai/tracker.ts | 2 +- .../specs/custom/spec-patchers.tsx | 15 +- .../src/components/page-detail-editor.tsx | 2 +- .../hooks/use-register-workspace-commands.ts | 2 +- .../view/doc-preview/doc-peek-view.tsx | 8 ++ .../workspace/detail-page/detail-page.tsx | 30 ++-- .../pages/workspace/detail-page/tabs/chat.tsx | 7 +- packages/frontend/electron/package.json | 8 +- packages/frontend/graphql/src/schema.ts | 3 + tools/cli/package.json | 2 +- yarn.lock | 136 +++++++++--------- 23 files changed, 156 insertions(+), 166 deletions(-) delete mode 100644 packages/frontend/core/src/bootstrap/register-blocksuite-components.ts diff --git a/packages/common/env/package.json b/packages/common/env/package.json index 731dc8866f..39aca0137c 100644 --- a/packages/common/env/package.json +++ b/packages/common/env/package.json @@ -3,8 +3,8 @@ "private": true, "type": "module", "devDependencies": { - "@blocksuite/global": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/store": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/global": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/store": "0.16.0-canary-202407250137-267cd23", "react": "18.3.1", "react-dom": "18.3.1", "vitest": "1.6.0" diff --git a/packages/common/infra/package.json b/packages/common/infra/package.json index d21d6738fc..386932b342 100644 --- a/packages/common/infra/package.json +++ b/packages/common/infra/package.json @@ -14,10 +14,10 @@ "@affine/debug": "workspace:*", "@affine/env": "workspace:*", "@affine/templates": "workspace:*", - "@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/global": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/store": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/blocks": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/global": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/store": "0.16.0-canary-202407250137-267cd23", "@datastructures-js/binary-search-tree": "^5.3.2", "foxact": "^0.2.33", "fuse.js": "^7.0.0", @@ -34,8 +34,8 @@ "devDependencies": { "@affine-test/fixtures": "workspace:*", "@affine/templates": "workspace:*", - "@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/block-std": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", "@testing-library/react": "^16.0.0", "async-call-rpc": "^6.4.0", "fake-indexeddb": "^6.0.0", diff --git a/packages/frontend/component/package.json b/packages/frontend/component/package.json index afbea4325b..1aa131656a 100644 --- a/packages/frontend/component/package.json +++ b/packages/frontend/component/package.json @@ -78,12 +78,12 @@ "zod": "^3.22.4" }, "devDependencies": { - "@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/global": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/block-std": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/blocks": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/global": "0.16.0-canary-202407250137-267cd23", "@blocksuite/icons": "2.1.59", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/store": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/store": "0.16.0-canary-202407250137-267cd23", "@storybook/addon-actions": "^7.6.17", "@storybook/addon-essentials": "^7.6.17", "@storybook/addon-interactions": "^7.6.17", diff --git a/packages/frontend/core/package.json b/packages/frontend/core/package.json index 1804c80bd7..3e4b56eaad 100644 --- a/packages/frontend/core/package.json +++ b/packages/frontend/core/package.json @@ -19,13 +19,13 @@ "@affine/graphql": "workspace:*", "@affine/i18n": "workspace:*", "@affine/templates": "workspace:*", - "@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/global": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/block-std": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/blocks": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/global": "0.16.0-canary-202407250137-267cd23", "@blocksuite/icons": "2.1.59", - "@blocksuite/inline": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/store": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/inline": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/store": "0.16.0-canary-202407250137-267cd23", "@dnd-kit/core": "^6.1.0", "@dnd-kit/modifiers": "^7.0.0", "@dnd-kit/sortable": "^8.0.0", diff --git a/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-handler.ts b/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-handler.ts index 4967f82437..4edab551e4 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-handler.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-handler.ts @@ -63,7 +63,7 @@ function actionToRenderer( if (id === 'brainstormMindmap') { const selectedElements = ctx.get()[ 'selectedElements' - ] as BlockSuite.EdgelessModelType[]; + ] as BlockSuite.EdgelessModel[]; if ( isMindMapRoot(selectedElements[0] || isMindmapChild(selectedElements[0])) @@ -123,7 +123,7 @@ async function getContentFromHubBlockModel( export async function getContentFromSelected( host: EditorHost, - selected: BlockSuite.EdgelessModelType[] + selected: BlockSuite.EdgelessModel[] ) { type RemoveUndefinedKey = T & { [P in K]-?: Exclude; diff --git a/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-response.ts b/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-response.ts index 854aec6cc2..320e79b1c4 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-response.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/actions/edgeless-response.ts @@ -317,7 +317,7 @@ export const responses: { const elements = ctx.get()[ 'selectedElements' - ] as BlockSuite.EdgelessModelType[]; + ] as BlockSuite.EdgelessModel[]; const data = ctx.get() as { node: MindMapNode; }; @@ -371,7 +371,7 @@ export const responses: { ) as SurfaceBlockModel[]; const elements = ctx.get()[ 'selectedElements' - ] as BlockSuite.EdgelessModelType[]; + ] as BlockSuite.EdgelessModel[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any const data = ctx.get() as any; let newGenerated = true; diff --git a/packages/frontend/core/src/blocksuite/presets/ai/actions/types.ts b/packages/frontend/core/src/blocksuite/presets/ai/actions/types.ts index 7d7d9f5eb6..8395b237c8 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/actions/types.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/actions/types.ts @@ -70,7 +70,7 @@ declare global { // internal context host: EditorHost; - models?: (BlockModel | BlockSuite.SurfaceElementModelType)[]; + models?: (BlockModel | BlockSuite.SurfaceElementModel)[]; control: TrackerControl; where: TrackerWhere; } diff --git a/packages/frontend/core/src/blocksuite/presets/ai/entries/slash-menu/setup-slash-menu.ts b/packages/frontend/core/src/blocksuite/presets/ai/entries/slash-menu/setup-slash-menu.ts index 6a6ffdbbfa..785cf46c0c 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/entries/slash-menu/setup-slash-menu.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/entries/slash-menu/setup-slash-menu.ts @@ -30,27 +30,27 @@ export function setupSlashMenuEntry(slashMenu: AffineSlashMenuWidget) { const showWhenWrapper = (item?: AIItemConfig) => - ({ rootElement }: AffineSlashMenuContext) => { - const affineAIPanelWidget = rootElement.host.view.getWidget( + ({ rootComponent }: AffineSlashMenuContext) => { + const affineAIPanelWidget = rootComponent.host.view.getWidget( AFFINE_AI_PANEL_WIDGET, - rootElement.model.id + rootComponent.model.id ); if (affineAIPanelWidget === null) return false; - const chain = rootElement.host.command.chain(); - const editorMode = rootElement.service.docModeService.getMode( - rootElement.doc.id + const chain = rootComponent.host.command.chain(); + const editorMode = rootComponent.service.docModeService.getMode( + rootComponent.doc.id ); - return item?.showWhen?.(chain, editorMode, rootElement.host) ?? true; + return item?.showWhen?.(chain, editorMode, rootComponent.host) ?? true; }; const actionItemWrapper = ( item: AIItemConfig ): AffineSlashMenuActionItem => ({ ...basicItemConfig(item), - action: ({ rootElement }: AffineSlashMenuContext) => { - item?.handler?.(rootElement.host); + action: ({ rootComponent }: AffineSlashMenuContext) => { + item?.handler?.(rootComponent.host); }, }); @@ -61,7 +61,7 @@ export function setupSlashMenuEntry(slashMenu: AffineSlashMenuWidget) { subMenu: item.subItem.map( ({ type, handler }) => ({ name: type, - action: ({ rootElement }) => handler?.(rootElement.host), + action: ({ rootComponent }) => handler?.(rootComponent.host), }) ), }; @@ -81,11 +81,11 @@ export function setupSlashMenuEntry(slashMenu: AffineSlashMenuWidget) { name: 'Ask AI', icon: AIStarIcon, showWhen: showWhenWrapper(), - action: ({ rootElement }) => { - const view = rootElement.host.view; + action: ({ rootComponent }) => { + const view = rootComponent.host.view; const affineAIPanelWidget = view.getWidget( AFFINE_AI_PANEL_WIDGET, - rootElement.model.id + rootComponent.model.id ) as AffineAIPanelWidget; assertExists(affineAIPanelWidget); assertExists(AIProvider.actions.chat); diff --git a/packages/frontend/core/src/blocksuite/presets/ai/utils/edgeless.ts b/packages/frontend/core/src/blocksuite/presets/ai/utils/edgeless.ts index 8609f76cd0..b3b0e3e145 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/utils/edgeless.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/utils/edgeless.ts @@ -29,13 +29,13 @@ export function mindMapToMarkdown(mindmap: MindmapElementModel) { return markdownStr; } -export function isMindMapRoot(ele: BlockSuite.EdgelessModelType) { +export function isMindMapRoot(ele: BlockSuite.EdgelessModel) { const group = ele?.group; return group instanceof MindmapElementModel && group.tree.element === ele; } -export function isMindmapChild(ele: BlockSuite.EdgelessModelType) { +export function isMindmapChild(ele: BlockSuite.EdgelessModel) { return ele?.group instanceof MindmapElementModel && !isMindMapRoot(ele); } diff --git a/packages/frontend/core/src/blocksuite/presets/ai/utils/selection-utils.ts b/packages/frontend/core/src/blocksuite/presets/ai/utils/selection-utils.ts index fca6cc8c23..1b3a61b992 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/utils/selection-utils.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/utils/selection-utils.ts @@ -271,7 +271,7 @@ export const getSelectedNoteAnchor = (host: EditorHost, id: string) => { export function getCopilotSelectedElems( host: EditorHost -): BlockSuite.EdgelessModelType[] { +): BlockSuite.EdgelessModel[] { const service = getService(host); const copilotWidget = getEdgelessCopilotWidget(host); diff --git a/packages/frontend/core/src/bootstrap/preload.ts b/packages/frontend/core/src/bootstrap/preload.ts index d78043eca3..a4e6a1c8cc 100644 --- a/packages/frontend/core/src/bootstrap/preload.ts +++ b/packages/frontend/core/src/bootstrap/preload.ts @@ -1,5 +1,4 @@ import '@affine/env/constant'; -import './register-blocksuite-components'; import './edgeless-template'; import { setupGlobal } from '@affine/env/global'; diff --git a/packages/frontend/core/src/bootstrap/register-blocksuite-components.ts b/packages/frontend/core/src/bootstrap/register-blocksuite-components.ts deleted file mode 100644 index 4911fbce8c..0000000000 --- a/packages/frontend/core/src/bootstrap/register-blocksuite-components.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { - registerFramePanelComponents, - registerOutlinePanelComponents, -} from '@blocksuite/presets'; - -registerOutlinePanelComponents(components => { - for (const compName in components) { - if (window.customElements.get(compName)) continue; - - window.customElements.define( - compName, - components[compName as keyof typeof components] - ); - } -}); - -registerFramePanelComponents(components => { - for (const compName in components) { - if (window.customElements.get(compName)) continue; - - window.customElements.define( - compName, - components[compName as keyof typeof components] - ); - } -}); diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/ai/tracker.ts b/packages/frontend/core/src/components/blocksuite/block-suite-editor/ai/tracker.ts index 1ba577ad4e..7de1157511 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/ai/tracker.ts +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/ai/tracker.ts @@ -4,7 +4,7 @@ import type { EditorHost } from '@blocksuite/block-std'; import type { BlockModel } from '@blocksuite/store'; import { lowerCase, omit } from 'lodash-es'; -type ElementModel = BlockSuite.SurfaceElementModelType; +type ElementModel = BlockSuite.SurfaceElementModel; type AIActionEventName = | 'AI action invoked' diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx index d090dd97b1..4013c24e46 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx @@ -20,7 +20,7 @@ import { } from '@affine/core/modules/quicksearch'; import { mixpanel } from '@affine/core/utils'; import { DebugLogger } from '@affine/debug'; -import type { BlockSpec, WidgetElement } from '@blocksuite/block-std'; +import type { BlockSpec, WidgetComponent } from '@blocksuite/block-std'; import { type AffineReference, AffineSlashMenuWidget, @@ -53,7 +53,7 @@ function patchSpecService( ? BlockService : never ) => (() => void) | void, - onWidgetConnected?: (component: WidgetElement) => void + onWidgetConnected?: (component: WidgetComponent) => void ) { const oldSetup = spec.setup; spec.setup = (slots, disposableGroup) => { @@ -435,7 +435,7 @@ export function patchQuickSearchService( }, }; }, - (component: WidgetElement) => { + (component: WidgetComponent) => { if (component instanceof AffineSlashMenuWidget) { component.config.items.forEach(item => { if ( @@ -443,11 +443,12 @@ export function patchQuickSearchService( (item.name === 'Linked Doc' || item.name === 'Link') ) { const oldAction = item.action; - item.action = async ({ model, rootElement }) => { - const { host, service, std } = rootElement; + item.action = async ({ model, rootComponent }) => { + const { host, service, std } = rootComponent; const { quickSearchService } = service; - if (!quickSearchService) return oldAction({ model, rootElement }); + if (!quickSearchService) + return oldAction({ model, rootComponent }); const result = await quickSearchService.searchDoc({}); if (result === null) return; @@ -463,7 +464,7 @@ export function patchQuickSearchService( }, ]); const isEdgeless = - rootElement instanceof EdgelessRootBlockComponent; + rootComponent instanceof EdgelessRootBlockComponent; if (result.isNewDoc) { mixpanel.track('DocCreated', { control: 'linked doc', diff --git a/packages/frontend/core/src/components/page-detail-editor.tsx b/packages/frontend/core/src/components/page-detail-editor.tsx index d280f9bf1f..e8b1797e88 100644 --- a/packages/frontend/core/src/components/page-detail-editor.tsx +++ b/packages/frontend/core/src/components/page-detail-editor.tsx @@ -80,7 +80,7 @@ const PageDetailEditorMain = memo(function PageDetailEditorMain({ if (onLoad) { // Invoke onLoad once the editor has been mounted to the DOM. editor.updateComplete - .then(() => editor.host.updateComplete) + .then(() => editor.host?.updateComplete) .then(() => { disposableGroup.add(onLoad(page, editor)); }) diff --git a/packages/frontend/core/src/hooks/use-register-workspace-commands.ts b/packages/frontend/core/src/hooks/use-register-workspace-commands.ts index cbd80c988a..235f3932a9 100644 --- a/packages/frontend/core/src/hooks/use-register-workspace-commands.ts +++ b/packages/frontend/core/src/hooks/use-register-workspace-commands.ts @@ -24,7 +24,7 @@ import { useNavigateHelper } from './use-navigate-helper'; function hasLinkPopover(editor: AffineEditorContainer | null) { const textSelection = editor?.host?.std.selection.find('text'); if (editor && textSelection && textSelection.from.length > 0) { - const formatBar = editor.host.querySelector('affine-format-bar-widget'); + const formatBar = editor.host?.querySelector('affine-format-bar-widget'); if (formatBar) { return true; } diff --git a/packages/frontend/core/src/modules/peek-view/view/doc-preview/doc-peek-view.tsx b/packages/frontend/core/src/modules/peek-view/view/doc-preview/doc-peek-view.tsx index aabc626e2e..bc90b95d1c 100644 --- a/packages/frontend/core/src/modules/peek-view/view/doc-preview/doc-peek-view.tsx +++ b/packages/frontend/core/src/modules/peek-view/view/doc-preview/doc-peek-view.tsx @@ -26,6 +26,10 @@ function fitViewport( xywh?: `[${number},${number},${number},${number}]` ) { try { + if (!editor.host) { + throw new Error('editor host is not ready'); + } + const rootService = editor.host.std.spec.getService('affine:page'); rootService.viewport.onResize(); @@ -113,6 +117,10 @@ export function DocPeekPreview({ if (editor) { editor.updateComplete .then(() => { + if (!editor.host) { + return; + } + const rootService = editor.host.std.spec.getService('affine:page'); // doc change event inside peek view should be handled by peek view disposableGroup.add( diff --git a/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx b/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx index 2e922c2002..6d8ec19c0f 100644 --- a/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx +++ b/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx @@ -160,7 +160,7 @@ const DetailPageImpl = memo(function DetailPageImpl() { const editorHost = editor.host; // provide image proxy endpoint to blocksuite - editorHost.std.clipboard.use( + editorHost?.std.clipboard.use( customImageProxyMiddleware(runtimeConfig.imageProxyUrl) ); ImageBlockService.setImageProxyURL(runtimeConfig.imageProxyUrl); @@ -179,22 +179,24 @@ const DetailPageImpl = memo(function DetailPageImpl() { // provide page mode and updated date to blocksuite const pageService = - editorHost.std.spec.getService('affine:page'); + editorHost?.std.spec.getService('affine:page'); const disposable = new DisposableGroup(); doc.setMode(mode); - disposable.add( - pageService.slots.docLinkClicked.on(({ docId, blockId }) => { - return blockId - ? jumpToPageBlock(docCollection.id, docId, blockId) - : openPage(docCollection.id, docId); - }) - ); - disposable.add( - pageService.slots.tagClicked.on(({ tagId }) => { - jumpToTag(workspace.id, tagId); - }) - ); + if (pageService) { + disposable.add( + pageService.slots.docLinkClicked.on(({ docId, blockId }) => { + return blockId + ? jumpToPageBlock(docCollection.id, docId, blockId) + : openPage(docCollection.id, docId); + }) + ); + disposable.add( + pageService.slots.tagClicked.on(({ tagId }) => { + jumpToTag(workspace.id, tagId); + }) + ); + } setEditor(editor); diff --git a/packages/frontend/core/src/pages/workspace/detail-page/tabs/chat.tsx b/packages/frontend/core/src/pages/workspace/detail-page/tabs/chat.tsx index d2851e9608..155cb2a82b 100644 --- a/packages/frontend/core/src/pages/workspace/detail-page/tabs/chat.tsx +++ b/packages/frontend/core/src/pages/workspace/detail-page/tabs/chat.tsx @@ -42,7 +42,8 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel( useEffect(() => { if (!editor) return; - const pageService = editor.host.spec.getService('affine:page'); + const pageService = editor.host?.spec.getService('affine:page'); + if (!pageService) return; const disposable = [ pageService.slots.docLinkClicked.on(() => { @@ -65,7 +66,9 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel( chatPanelRef.current = new ChatPanel(); } - (chatPanelRef.current as ChatPanel).host = editor.host; + if (editor.host) { + (chatPanelRef.current as ChatPanel).host = editor.host; + } (chatPanelRef.current as ChatPanel).doc = editor.doc; // (copilotPanelRef.current as CopilotPanel).fitPadding = [20, 20, 20, 20]; diff --git a/packages/frontend/electron/package.json b/packages/frontend/electron/package.json index 7bf77d870f..b79f72a14e 100644 --- a/packages/frontend/electron/package.json +++ b/packages/frontend/electron/package.json @@ -29,10 +29,10 @@ "@affine/env": "workspace:*", "@affine/i18n": "workspace:*", "@affine/native": "workspace:*", - "@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", - "@blocksuite/store": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/block-std": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/blocks": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", + "@blocksuite/store": "0.16.0-canary-202407250137-267cd23", "@electron-forge/cli": "^7.3.0", "@electron-forge/core": "^7.3.0", "@electron-forge/core-utils": "^7.3.0", diff --git a/packages/frontend/graphql/src/schema.ts b/packages/frontend/graphql/src/schema.ts index d784aecc3d..e3e2b300e1 100644 --- a/packages/frontend/graphql/src/schema.ts +++ b/packages/frontend/graphql/src/schema.ts @@ -320,6 +320,7 @@ export enum ErrorNames { OAUTH_ACCOUNT_ALREADY_CONNECTED = 'OAUTH_ACCOUNT_ALREADY_CONNECTED', OAUTH_STATE_EXPIRED = 'OAUTH_STATE_EXPIRED', PAGE_IS_NOT_PUBLIC = 'PAGE_IS_NOT_PUBLIC', + PASSWORD_REQUIRED = 'PASSWORD_REQUIRED', RUNTIME_CONFIG_NOT_FOUND = 'RUNTIME_CONFIG_NOT_FOUND', SAME_EMAIL_PROVIDED = 'SAME_EMAIL_PROVIDED', SAME_SUBSCRIPTION_RECURRING = 'SAME_SUBSCRIPTION_RECURRING', @@ -912,6 +913,8 @@ export interface ServerConfigType { * @deprecated use `features` */ flavor: Scalars['String']['output']; + /** whether server has been initialized */ + initialized: Scalars['Boolean']['output']; /** server identical name could be shown as badge on user interface */ name: Scalars['String']['output']; oauthProviders: Array; diff --git a/tools/cli/package.json b/tools/cli/package.json index 6e83774023..b34956fd38 100644 --- a/tools/cli/package.json +++ b/tools/cli/package.json @@ -6,7 +6,7 @@ "@affine/env": "workspace:*", "@affine/templates": "workspace:*", "@aws-sdk/client-s3": "3.614.0", - "@blocksuite/presets": "0.16.0-canary-202407230727-128fc57", + "@blocksuite/presets": "0.16.0-canary-202407250137-267cd23", "@clack/core": "^0.3.4", "@clack/prompts": "^0.7.0", "@magic-works/i18n-codegen": "^0.6.0", diff --git a/yarn.lock b/yarn.lock index 713ca41f05..f0a66bb389 100644 --- a/yarn.lock +++ b/yarn.lock @@ -226,7 +226,7 @@ __metadata: "@affine/env": "workspace:*" "@affine/templates": "workspace:*" "@aws-sdk/client-s3": "npm:3.614.0" - "@blocksuite/presets": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/presets": "npm:0.16.0-canary-202407250137-267cd23" "@clack/core": "npm:^0.3.4" "@clack/prompts": "npm:^0.7.0" "@magic-works/i18n-codegen": "npm:^0.6.0" @@ -284,12 +284,12 @@ __metadata: "@affine/i18n": "workspace:*" "@atlaskit/pragmatic-drag-and-drop": "npm:^1.2.1" "@atlaskit/pragmatic-drag-and-drop-hitbox": "npm:^1.0.3" - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/blocks": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/blocks": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" "@blocksuite/icons": "npm:2.1.59" - "@blocksuite/presets": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/presets": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@dnd-kit/core": "npm:^6.1.0" "@dnd-kit/modifiers": "npm:^7.0.0" "@dnd-kit/sortable": "npm:^8.0.0" @@ -385,13 +385,13 @@ __metadata: "@affine/graphql": "workspace:*" "@affine/i18n": "workspace:*" "@affine/templates": "workspace:*" - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/blocks": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/blocks": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" "@blocksuite/icons": "npm:2.1.59" - "@blocksuite/inline": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/presets": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/inline": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/presets": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@dnd-kit/core": "npm:^6.1.0" "@dnd-kit/modifiers": "npm:^7.0.0" "@dnd-kit/sortable": "npm:^8.0.0" @@ -519,10 +519,10 @@ __metadata: "@affine/env": "workspace:*" "@affine/i18n": "workspace:*" "@affine/native": "workspace:*" - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/blocks": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/presets": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/blocks": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/presets": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@electron-forge/cli": "npm:^7.3.0" "@electron-forge/core": "npm:^7.3.0" "@electron-forge/core-utils": "npm:^7.3.0" @@ -578,8 +578,8 @@ __metadata: version: 0.0.0-use.local resolution: "@affine/env@workspace:packages/common/env" dependencies: - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" lit: "npm:^3.1.2" react: "npm:18.3.1" react-dom: "npm:18.3.1" @@ -3447,11 +3447,11 @@ __metadata: languageName: node linkType: hard -"@blocksuite/block-std@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/block-std@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/block-std@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/block-std@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" "@lit-labs/preact-signals": "npm:^1.0.2" "@lit/context": "npm:^1.1.1" "@types/hast": "npm:^3.0.4" @@ -3462,20 +3462,20 @@ __metadata: w3c-keyname: "npm:^2.2.8" zod: "npm:^3.23.8" peerDependencies: - "@blocksuite/inline": 0.16.0-canary-202407230727-128fc57 - "@blocksuite/store": 0.16.0-canary-202407230727-128fc57 - checksum: 10/3c87f57092b90a2f93dab7c27de58e202d047c1a1a73a54febcf0bf490a768c582bcdb8877966eca28754ba7fa98f39bf563aa801d0c189e726ea7699e1cb2c0 + "@blocksuite/inline": 0.16.0-canary-202407250137-267cd23 + "@blocksuite/store": 0.16.0-canary-202407250137-267cd23 + checksum: 10/b63b9f183f841ad5c26dcabd38a09a94265aea1ed66d2f6fb5b50579fd9e433b0c3c43122af33eed36312698ff73758b49818e1efb59c058edd72a68f61937cb languageName: node linkType: hard -"@blocksuite/blocks@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/blocks@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/blocks@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/blocks@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/inline": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/inline": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@dotlottie/player-component": "npm:^2.7.12" "@floating-ui/dom": "npm:^1.6.5" "@lit-labs/preact-signals": "npm:^1.0.2" @@ -3513,17 +3513,17 @@ __metadata: sortablejs: "npm:^1.15.2" unified: "npm:^11.0.4" zod: "npm:^3.23.8" - checksum: 10/6600a28eccf6b9e491bac5ec2fab431fcb688b9035068318aae71c6e6d869189cc1fe7613fde13b973a0a5fa1d1667979e9b0c9ded8f8aad75c1ce9b401811ce + checksum: 10/8a59dc1fea6565ab260d23f4c9e0edcf0ba3cf335b30262bca1a2aecf4069c5c44b6b81d8d6b1a3946f69f371f27159bf6cc0fe0491db6165380e370a3249a95 languageName: node linkType: hard -"@blocksuite/global@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/global@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/global@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/global@npm:0.16.0-canary-202407250137-267cd23" dependencies: lib0: "npm:^0.2.94" zod: "npm:^3.23.8" - checksum: 10/bad82caed178a3a891ea211bf7deb9675dab7685febf866209eaad7148e0b6f507371075d0df903aff4d63a1415bcaea3ba5cacd5f52c5900ff599415e3ccbdc + checksum: 10/8e6b8c2ad743851c5bbde5fcab42ac40fff3bb5cab4d7fecc7fa7a44245c5d093bc9ef2eb07b002977109b76ff9d02a42ef77e05799ff8b341f54cb686322ec7 languageName: node linkType: hard @@ -3543,28 +3543,28 @@ __metadata: languageName: node linkType: hard -"@blocksuite/inline@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/inline@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/inline@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/inline@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" zod: "npm:^3.23.8" peerDependencies: lit: ^3.1.1 yjs: ^13.6.15 - checksum: 10/2e6dc3c9b6435f4ea31155a20f0f0e699ebb64dbb2b4fa810cf8b49a2f73f76af11a9c75fced3ed9732d1026582420f3560687f93fa7588f9d8446ddf86faeb2 + checksum: 10/21628c27660bfd18afca361b6fed3298bafe18922832045a08c71789459de4587c25764a4f665e98e0b5e6bdbf502eae52ef9baaa0e2976bf106793b0e18ca0f languageName: node linkType: hard -"@blocksuite/presets@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/presets@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/presets@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/presets@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/blocks": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/inline": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/blocks": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/inline": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@dotlottie/player-component": "npm:^2.7.12" "@fal-ai/serverless-client": "npm:^0.10.0" "@floating-ui/dom": "npm:^1.6.5" @@ -3573,17 +3573,17 @@ __metadata: lit: "npm:^3.1.3" openai: "npm:^4.47.2" zod: "npm:^3.23.8" - checksum: 10/8672ae9b7b5299bf3790d1a42fccda4af3f1e689dc8f8de35f957d89f6f6c64f46be814a429e7f3788f3c943ac23225d5f0e18b90137d80591d5a9f1e737753b + checksum: 10/78dd80f7514dd698b7eafff9cedf6a603c13de04a14d4c5d2f4623d91580d633040d19b8d19837068a2ae6127db79175a961c7d8ce20fea1de65b7462a24f460 languageName: node linkType: hard -"@blocksuite/store@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/store@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/store@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/store@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/inline": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/sync": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/inline": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/sync": "npm:0.16.0-canary-202407250137-267cd23" "@preact/signals-core": "npm:^1.6.1" "@types/flexsearch": "npm:^0.7.6" flexsearch: "npm:0.7.43" @@ -3595,21 +3595,21 @@ __metadata: zod: "npm:^3.23.8" peerDependencies: yjs: ^13.6.15 - checksum: 10/3d8861e352fe0b06d2e93754c8207559bd8c849497e642a6e11e3fc3dc04d265649c3af9c810789fe0f52ff08e7b20d3387a6046b499a19f8c627ee1effd38f4 + checksum: 10/509901c01079fbe15ca7bc07af9126ce51b4469387f1bb3719bcf664859b17e2cd18056ddc8d722e1af8ef1cf2d4c3e4247779ac891095f3d696c7c70d85fe4a languageName: node linkType: hard -"@blocksuite/sync@npm:0.16.0-canary-202407230727-128fc57": - version: 0.16.0-canary-202407230727-128fc57 - resolution: "@blocksuite/sync@npm:0.16.0-canary-202407230727-128fc57" +"@blocksuite/sync@npm:0.16.0-canary-202407250137-267cd23": + version: 0.16.0-canary-202407250137-267cd23 + resolution: "@blocksuite/sync@npm:0.16.0-canary-202407250137-267cd23" dependencies: - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" idb: "npm:^8.0.0" idb-keyval: "npm:^6.2.1" y-protocols: "npm:^1.0.6" peerDependencies: yjs: ^13.6.15 - checksum: 10/3b5c928b041c78f25b080750e5e1d16a598cc484efc5103121602ddb8adf672d8b5de5af264904fb3086c3144497f9fbd2b9b9d599ff044f8309484c46ff46cf + checksum: 10/6ff310749cb1616824ed269723f35d20eb84d432b42cdc23ecb456f1ad454112467506a9a9ca5fb1b22726afe7f94b25303395b9e2daa3108da0884b96fa4bea languageName: node linkType: hard @@ -14874,11 +14874,11 @@ __metadata: "@affine/debug": "workspace:*" "@affine/env": "workspace:*" "@affine/templates": "workspace:*" - "@blocksuite/block-std": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/blocks": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/global": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/presets": "npm:0.16.0-canary-202407230727-128fc57" - "@blocksuite/store": "npm:0.16.0-canary-202407230727-128fc57" + "@blocksuite/block-std": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/blocks": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/global": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/presets": "npm:0.16.0-canary-202407250137-267cd23" + "@blocksuite/store": "npm:0.16.0-canary-202407250137-267cd23" "@datastructures-js/binary-search-tree": "npm:^5.3.2" "@testing-library/react": "npm:^16.0.0" async-call-rpc: "npm:^6.4.0"