From 66c432174f86f06ff701902a43cd5eef230a3a5b Mon Sep 17 00:00:00 2001 From: Yifeng Wang Date: Thu, 13 Oct 2022 18:43:31 +0800 Subject: [PATCH] chore: tweak title config --- src/components/editor.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/editor.tsx b/src/components/editor.tsx index d2462ea28d..512f16c51a 100644 --- a/src/components/editor.tsx +++ b/src/components/editor.tsx @@ -5,6 +5,7 @@ import '@blocksuite/blocks'; import '@blocksuite/editor'; import '@blocksuite/blocks/style'; import { useEditor } from '@/components/editor-provider'; +import pkg from '../../package.json'; export const Editor = () => { const editorRef = useRef(); @@ -13,16 +14,17 @@ export const Editor = () => { setEditor(editorRef.current!); const { store } = editorRef.current as EditorContainer; + const version = pkg.dependencies['@blocksuite/editor'].substring(1); const pageId = store.addBlock({ flavour: 'page', - title: 'Blocksuite live demo', + title: `BlockSuite live demo ${version}`, }); 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._history.clear(); + // store.resetHistory(); }, [setEditor]); return (