fix(editor): affine preview root style (#10420)

Fix [BS-2677](https://linear.app/affine-design/issue/BS-2677/linked-doc-embed-view样式错误)

1. Only show the border of embed synced doc block (in note) when hover.
2. Fix affine preview root padding style, set padding only when affine preview root in embed synced doc block (in surface).
3. Only add the footnote config extension to the chat panel and chat block center peek. For footnotes in other page preview scenarios, such as footnote nodes within embed synced doc blocks or embed linked doc blocks, the hover effect should be maintained.
This commit is contained in:
donteatfriedrice
2025-02-26 04:25:24 +00:00
parent 0e4a79959f
commit d63f16da5e
9 changed files with 52 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
import { ChatPanel } from '@affine/core/blocksuite/ai';
import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-editor';
import { enableFootnoteConfigExtension } from '@affine/core/blocksuite/extensions';
import { AINetworkSearchService } from '@affine/core/modules/ai-button/services/network-search';
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
import { DocSearchMenuService } from '@affine/core/modules/doc-search-menu/services';
@@ -84,7 +85,9 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
);
},
};
const previewSpecBuilder = SpecProvider._.getSpec('preview:page');
const previewSpecBuilder = enableFootnoteConfigExtension(
SpecProvider._.getSpec('preview:page')
);
chatPanelRef.current.previewSpecBuilder = previewSpecBuilder;
} else {
chatPanelRef.current.host = editor.host;