mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 16:19:43 +08:00
chore: bump blocksuite (#4801)
This commit is contained in:
@@ -24,13 +24,13 @@
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@affine/workspace": "workspace:*",
|
||||
"@blocksuite/block-std": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/global": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/block-std": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@blocksuite/global": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@blocksuite/icons": "2.1.35",
|
||||
"@blocksuite/lit": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@blocksuite/store": "0.0.0-20231101080734-aa27dc89-nightly",
|
||||
"@dnd-kit/core": "^6.0.8",
|
||||
"@dnd-kit/sortable": "^7.0.2",
|
||||
"@emotion/cache": "^11.11.0",
|
||||
|
||||
@@ -31,6 +31,7 @@ import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
|
||||
import { pageSettingFamily } from '../atoms';
|
||||
import { fontStyleOptions } from '../atoms/settings';
|
||||
import { useAppSettingHelper } from '../hooks/affine/use-app-setting-helper';
|
||||
import { useBlockSuiteMetaHelper } from '../hooks/affine/use-block-suite-meta-helper';
|
||||
import { BlockSuiteEditor as Editor } from './blocksuite/block-suite-editor';
|
||||
import { Bookmark } from './bookmark';
|
||||
import * as styles from './page-detail-editor.css';
|
||||
@@ -64,6 +65,8 @@ const EditorWrapper = memo(function EditorWrapper({
|
||||
const meta = useBlockSuitePageMeta(workspace).find(
|
||||
meta => meta.id === pageId
|
||||
);
|
||||
const { switchToEdgelessMode, switchToPageMode } =
|
||||
useBlockSuiteMetaHelper(workspace);
|
||||
const pageSettingAtom = pageSettingFamily(pageId);
|
||||
const pageSetting = useAtomValue(pageSettingAtom);
|
||||
const currentMode = pageSetting?.mode ?? 'page';
|
||||
@@ -80,6 +83,17 @@ const EditorWrapper = memo(function EditorWrapper({
|
||||
return fontStyle.value;
|
||||
}, [appSettings.fontStyle]);
|
||||
|
||||
const setEditorMode = useCallback(
|
||||
(mode: 'page' | 'edgeless') => {
|
||||
if (mode === 'edgeless') {
|
||||
switchToEdgelessMode(pageId);
|
||||
} else {
|
||||
switchToPageMode(pageId);
|
||||
}
|
||||
},
|
||||
[switchToEdgelessMode, switchToPageMode, pageId]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Editor
|
||||
@@ -94,6 +108,7 @@ const EditorWrapper = memo(function EditorWrapper({
|
||||
}
|
||||
mode={isPublic ? 'page' : currentMode}
|
||||
page={page}
|
||||
onModeChange={setEditorMode}
|
||||
onInit={useCallback(
|
||||
(page: Page, editor: Readonly<EditorContainer>) => {
|
||||
onInit(page, editor);
|
||||
|
||||
Reference in New Issue
Block a user