mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore:Update blocksuite dependency version (#525)
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blocksuite/blocks": "^0.2.24",
|
||||
"@blocksuite/editor": "^0.2.24",
|
||||
"@blocksuite/blocks": "0.3.0-alpha.0",
|
||||
"@blocksuite/editor": "0.3.0-alpha.0",
|
||||
"@emotion/css": "^11.10.0",
|
||||
"@emotion/react": "^11.10.4",
|
||||
"@emotion/server": "^11.10.0",
|
||||
|
||||
@@ -78,11 +78,11 @@ const UndoRedo = () => {
|
||||
const { editor } = useEditor();
|
||||
useEffect(() => {
|
||||
if (!editor) return;
|
||||
const { store } = editor;
|
||||
const { space } = editor;
|
||||
|
||||
store.signals.historyUpdated.on(() => {
|
||||
setCanUndo(store.canUndo);
|
||||
setCanRedo(store.canRedo);
|
||||
space.signals.historyUpdated.on(() => {
|
||||
setCanUndo(space.canUndo);
|
||||
setCanRedo(space.canRedo);
|
||||
});
|
||||
}, [editor]);
|
||||
|
||||
@@ -92,7 +92,7 @@ const UndoRedo = () => {
|
||||
<StyledToolbarItem
|
||||
disable={!canUndo}
|
||||
onClick={() => {
|
||||
editor?.store?.undo();
|
||||
editor?.space?.undo();
|
||||
}}
|
||||
>
|
||||
<UndoIcon />
|
||||
@@ -102,7 +102,7 @@ const UndoRedo = () => {
|
||||
<StyledToolbarItem
|
||||
disable={!canRedo}
|
||||
onClick={() => {
|
||||
editor?.store?.redo();
|
||||
editor?.space?.redo();
|
||||
}}
|
||||
>
|
||||
<RedoIcon />
|
||||
|
||||
@@ -38,14 +38,14 @@ export const Editor = () => {
|
||||
return;
|
||||
}
|
||||
setEditor(editorRef.current);
|
||||
const { store } = editorRef.current as EditorContainer;
|
||||
const pageId = store.addBlock({
|
||||
flavour: 'page',
|
||||
const { space } = editorRef.current as EditorContainer;
|
||||
const pageId = space.addBlock({
|
||||
flavour: 'affine:page',
|
||||
title: 'Welcome to the AFFiNE Alpha',
|
||||
});
|
||||
const groupId = store.addBlock({ flavour: 'group' }, pageId);
|
||||
const groupId = space.addBlock({ flavour: 'affine:group' }, pageId);
|
||||
editorRef.current.clipboard.importMarkdown(exampleMarkdown, `${groupId}`);
|
||||
store.resetHistory();
|
||||
space.resetHistory();
|
||||
}, [setEditor]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user