feat(editor): update footnote node style and config (#10392)

[BS-2581](https://linear.app/affine-design/issue/BS-2581/优化-footnote-node-正文样式)
This commit is contained in:
donteatfriedrice
2025-02-24 08:15:04 +00:00
parent 8b4175c44d
commit 1b2a4377fd
6 changed files with 57 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import { WorkspaceService } from '@affine/core/modules/workspace';
import {
createSignalFromObservable,
DocModeProvider,
FootNoteNodeConfigExtension,
RefNodeSlotsProvider,
} from '@blocksuite/affine/blocks';
import { useFramework } from '@toeverything/infra';
@@ -20,6 +21,11 @@ export interface SidebarTabProps {
onLoad?: ((component: HTMLElement) => void) | null;
}
// Disable hover effect for footnote node in chat panel
const FOOTNOTE_CONFIG = FootNoteNodeConfigExtension({
disableHoverEffect: true,
});
// A wrapper for CopilotPanel
export const EditorChatPanel = forwardRef(function EditorChatPanel(
{ editor, onLoad }: SidebarTabProps,
@@ -84,8 +90,9 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
);
},
};
chatPanelRef.current.previewSpecBuilder =
createPageModePreviewSpecs(framework);
const previewSpecBuilder = createPageModePreviewSpecs(framework);
previewSpecBuilder.extend([FOOTNOTE_CONFIG]);
chatPanelRef.current.previewSpecBuilder = previewSpecBuilder;
} else {
chatPanelRef.current.host = editor.host;
chatPanelRef.current.doc = editor.doc;