chore: bump BlockSuite version (#910)

Co-authored-by: QiShaoXuan <qishaoxuan777@gmail.com>
Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
x1a0t
2023-02-10 03:09:05 +08:00
committed by GitHub
parent 18e1eecefc
commit d524fe3c6c
16 changed files with 276 additions and 210 deletions
@@ -22,15 +22,26 @@ export const Editor = ({ page, workspace, setEditor }: Props) => {
const editorContainer = useRef<HTMLDivElement>(null);
// const { currentWorkspace, currentPage, setEditor } = useAppState();
useEffect(() => {
let blockHubElement: HTMLElement | null = null;
const ret = () => {
const node = editorContainer.current;
while (node?.firstChild) {
node.removeChild(node.firstChild);
}
blockHubElement?.remove();
};
const editor = new EditorContainer();
editor.page = page;
editor.createBlockHub().then(blockHub => {
const toolWrapper = document.querySelector('#toolWrapper');
if (!toolWrapper) {
throw new Error('Can not find toolWrapper');
}
blockHubElement = blockHub;
toolWrapper.appendChild(blockHub);
});
editorContainer.current?.appendChild(editor);
if (page.isEmpty) {
const isFirstPage = workspace?.meta.pageMetas.length === 1;