mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: bump blocksuite (#5624)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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} />;
|
||||
|
||||
Reference in New Issue
Block a user