feat: bump blocksuite (#5194)

Co-authored-by: AyushAgrawal-A2 <ayushagl06@gmail.com>
This commit is contained in:
Yifeng Wang
2023-12-06 18:15:03 +08:00
committed by GitHub
parent 2dcb5a3030
commit 6cbf5b2a92
37 changed files with 292 additions and 430 deletions
+3 -3
View File
@@ -168,13 +168,13 @@ export const createConfiguration: (
'blocks',
'dist'
),
'@blocksuite/editor': blocksuiteBaseDir
? join(blocksuiteBaseDir, 'packages', 'editor', 'src')
'@blocksuite/presets': blocksuiteBaseDir
? join(blocksuiteBaseDir, 'packages', 'presets', 'src')
: join(
workspaceRoot,
'node_modules',
'@blocksuite',
'editor',
'presets',
'dist'
),
'@blocksuite/global': blocksuiteBaseDir
@@ -35,7 +35,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
serverUrlPrefix: 'https://insider.affine.pro', // Let insider be stable environment temporarily.
editorFlags,
appVersion: packageJson.version,
editorVersion: packageJson.dependencies['@blocksuite/editor'],
editorVersion: packageJson.dependencies['@blocksuite/presets'],
appBuildType: 'stable',
},
get beta() {
@@ -82,7 +82,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
serverUrlPrefix: 'https://affine.fail',
editorFlags,
appVersion: packageJson.version,
editorVersion: packageJson.dependencies['@blocksuite/editor'],
editorVersion: packageJson.dependencies['@blocksuite/presets'],
appBuildType: 'canary',
},
};
+7 -7
View File
@@ -25,14 +25,14 @@
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/workspace": "workspace:*",
"@blocksuite/block-std": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/blocks": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/editor": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/global": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/block-std": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/blocks": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/global": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/icons": "2.1.36",
"@blocksuite/lit": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/store": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/virgo": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/lit": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/presets": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/store": "0.0.0-20231205045113-03964196-nightly",
"@blocksuite/virgo": "0.0.0-20231205045113-03964196-nightly",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/sortable": "^8.0.0",
"@emotion/cache": "^11.11.0",
@@ -2,10 +2,8 @@ import './page-detail-editor.css';
import { PageNotFoundError } from '@affine/env/constant';
import type { LayoutNode } from '@affine/sdk/entry';
import { rootBlockHubAtom } from '@affine/workspace/atom';
import type { BlockHub } from '@blocksuite/blocks';
import type { EditorContainer } from '@blocksuite/editor';
import { assertExists, DisposableGroup } from '@blocksuite/global/utils';
import type { EditorContainer } from '@blocksuite/presets';
import type { Page, Workspace } from '@blocksuite/store';
import { useBlockSuitePageMeta } from '@toeverything/hooks/use-block-suite-page-meta';
import { useBlockSuiteWorkspacePage } from '@toeverything/hooks/use-block-suite-workspace-page';
@@ -16,7 +14,7 @@ import {
} from '@toeverything/infra/__internal__/plugin';
import { contentLayoutAtom, getCurrentStore } from '@toeverything/infra/atom';
import clsx from 'clsx';
import { useAtomValue, useSetAtom } from 'jotai';
import { useAtomValue } from 'jotai';
import type { CSSProperties, ReactElement } from 'react';
import {
memo,
@@ -59,33 +57,6 @@ function useRouterHash() {
return useLocation().hash.substring(1);
}
function useCreateAndSetRootBlockHub(
editor?: EditorContainer,
showBlockHub?: boolean
) {
const setBlockHub = useSetAtom(rootBlockHubAtom);
useEffect(() => {
let canceled = false;
let blockHub: BlockHub | undefined;
if (editor && showBlockHub) {
editor
.createBlockHub()
.then(bh => {
if (canceled) {
return;
}
blockHub = bh;
setBlockHub(blockHub);
})
.catch(console.error);
}
return () => {
canceled = true;
blockHub?.remove();
};
}, [editor, showBlockHub, setBlockHub]);
}
const EditorWrapper = memo(function EditorWrapper({
workspace,
pageId,
@@ -142,11 +113,9 @@ const EditorWrapper = memo(function EditorWrapper({
[isPublic, switchToEdgelessMode, pageId, switchToPageMode]
);
const [editor, setEditor] = useState<EditorContainer>();
const [, setEditor] = useState<EditorContainer>();
const blockId = useRouterHash();
useCreateAndSetRootBlockHub(editor, !meta.trash);
const onLoadEditor = useCallback(
(editor: EditorContainer) => {
// debug current detail editor
@@ -2,7 +2,6 @@ import {
AppSidebarFallback,
appSidebarResizingAtom,
} from '@affine/component/app-sidebar';
import { RootBlockHub } from '@affine/component/block-hub';
import {
type DraggableTitleCellData,
PageListDragOverlay,
@@ -305,7 +304,6 @@ export const WorkspaceLayoutInner = ({
children
)}
<ToolContainer inTrashPage={inTrashPage}>
<RootBlockHub />
<HelpIsland showList={pageId ? undefined : showList} />
</ToolContainer>
</MainContainer>
@@ -6,8 +6,8 @@ import {
import { WorkspaceSubPath } from '@affine/env/workspace';
import { globalBlockSuiteSchema } from '@affine/workspace/manager';
import { SyncEngineStep } from '@affine/workspace/providers';
import type { EditorContainer } from '@blocksuite/editor';
import { assertExists } from '@blocksuite/global/utils';
import type { EditorContainer } from '@blocksuite/presets';
import type { Page } from '@blocksuite/store';
import {
contentLayoutAtom,
@@ -45,9 +45,13 @@ export const loader: LoaderFunction = async args => {
return redirect('/404');
}
if (!args.params.pageId) {
if (args.params.pageId) {
localStorage.setItem('last_page_id', args.params.pageId);
rootStore.set(currentPageIdAtom, args.params.pageId);
} else {
rootStore.set(currentPageIdAtom, null);
}
const [workspaceAtom] = getBlockSuiteWorkspaceAtom(currentMetadata.id);
workspaceLoaderLogger.info('get cloud workspace atom');