mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
Merge pull request #14 from toeverything/chore/title
chore: tweak title config
This commit is contained in:
@@ -5,6 +5,7 @@ import '@blocksuite/blocks';
|
|||||||
import '@blocksuite/editor';
|
import '@blocksuite/editor';
|
||||||
import '@blocksuite/blocks/style';
|
import '@blocksuite/blocks/style';
|
||||||
import { useEditor } from '@/components/editor-provider';
|
import { useEditor } from '@/components/editor-provider';
|
||||||
|
import pkg from '../../package.json';
|
||||||
|
|
||||||
export const Editor = () => {
|
export const Editor = () => {
|
||||||
const editorRef = useRef<EditorContainer>();
|
const editorRef = useRef<EditorContainer>();
|
||||||
@@ -13,16 +14,17 @@ export const Editor = () => {
|
|||||||
setEditor(editorRef.current!);
|
setEditor(editorRef.current!);
|
||||||
const { store } = editorRef.current as EditorContainer;
|
const { store } = editorRef.current as EditorContainer;
|
||||||
|
|
||||||
|
const version = pkg.dependencies['@blocksuite/editor'].substring(1);
|
||||||
const pageId = store.addBlock({
|
const pageId = store.addBlock({
|
||||||
flavour: 'page',
|
flavour: 'page',
|
||||||
title: 'Blocksuite live demo',
|
title: `BlockSuite live demo ${version}`,
|
||||||
});
|
});
|
||||||
const groupId = store.addBlock({ flavour: 'group' }, pageId);
|
const groupId = store.addBlock({ flavour: 'group' }, pageId);
|
||||||
|
|
||||||
const text = new Text('Legend from here ...');
|
const text = new Text('Legend from here...');
|
||||||
store.addBlock({ flavour: 'paragraph', text }, groupId);
|
store.addBlock({ flavour: 'paragraph', text }, groupId);
|
||||||
|
|
||||||
// store._history.clear();
|
// store.resetHistory();
|
||||||
}, [setEditor]);
|
}, [setEditor]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user