feat: bump blocksuite (#5624)

This commit is contained in:
regischen
2024-01-18 17:26:31 +08:00
committed by GitHub
parent c3fda80599
commit 8b1b5b2e93
17 changed files with 168 additions and 168 deletions

View File

@@ -26,14 +26,14 @@
"@affine/templates": "workspace:*",
"@affine/workspace": "workspace:*",
"@affine/workspace-impl": "workspace:*",
"@blocksuite/block-std": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/blocks": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/block-std": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/blocks": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/global": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/icons": "2.1.41",
"@blocksuite/inline": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/lit": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/presets": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
"@blocksuite/inline": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/lit": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/presets": "0.12.0-nightly-202401180838-f0c45fd",
"@blocksuite/store": "0.12.0-nightly-202401180838-f0c45fd",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/sortable": "^8.0.0",
"@emotion/cache": "^11.11.0",

View File

@@ -1,9 +1,9 @@
import {
registerFramePanelComponents,
registerTOCPanelComponents,
registerOutlinePanelComponents,
} from '@blocksuite/presets';
registerTOCPanelComponents(components => {
registerOutlinePanelComponents(components => {
for (const compName in components) {
if (window.customElements.get(compName)) continue;

View File

@@ -1,7 +1,7 @@
import { useActiveBlocksuiteEditor } from '@affine/core/hooks/use-block-suite-editor';
import { assertExists } from '@blocksuite/global/utils';
import { TocIcon } from '@blocksuite/icons';
import { TOCPanel } from '@blocksuite/presets';
import { OutlinePanel } from '@blocksuite/presets';
import { useCallback, useRef } from 'react';
import type { EditorExtension } from '../types';
@@ -9,13 +9,13 @@ import * as styles from './outline.css';
// A wrapper for TOCNotesPanel
const EditorOutline = () => {
const tocPanelRef = useRef<TOCPanel | null>(null);
const outlinePanelRef = useRef<OutlinePanel | null>(null);
const [editor] = useActiveBlocksuiteEditor();
const onRefChange = useCallback((container: HTMLDivElement | null) => {
if (container) {
assertExists(tocPanelRef.current, 'toc panel should be initialized');
container.append(tocPanelRef.current);
assertExists(outlinePanelRef.current, 'toc panel should be initialized');
container.append(outlinePanelRef.current);
}
}, []);
@@ -23,13 +23,13 @@ const EditorOutline = () => {
return;
}
if (!tocPanelRef.current) {
tocPanelRef.current = new TOCPanel();
if (!outlinePanelRef.current) {
outlinePanelRef.current = new OutlinePanel();
}
if (editor !== tocPanelRef.current?.editor) {
(tocPanelRef.current as TOCPanel).editor = editor;
(tocPanelRef.current as TOCPanel).fitPadding = [20, 20, 20, 20];
if (editor !== outlinePanelRef.current?.editor) {
(outlinePanelRef.current as OutlinePanel).editor = editor;
(outlinePanelRef.current as OutlinePanel).fitPadding = [20, 20, 20, 20];
}
return <div className={styles.root} ref={onRefChange} />;