mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
chore: bump blocksuite (#6635)
## Features - https://github.com/toeverything/BlockSuite/pull/6825 @regischen ## Bugfix - https://github.com/toeverything/BlockSuite/pull/6828 @regischen - https://github.com/toeverything/BlockSuite/pull/6823 @fundon - https://github.com/toeverything/BlockSuite/pull/6822 @fundon - https://github.com/toeverything/BlockSuite/pull/6826 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6794 @fundon - https://github.com/toeverything/BlockSuite/pull/6821 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6781 @doouding - https://github.com/toeverything/BlockSuite/pull/6820 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6819 @regischen - https://github.com/toeverything/BlockSuite/pull/6817 @donteatfriedrice ## Refactor ## Misc
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { AiIcon } from '@blocksuite/icons';
|
||||
import { ChatPanel } from '@blocksuite/presets';
|
||||
import { useCallback, useRef } from 'react';
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
||||
import type { SidebarTab, SidebarTabProps } from '../sidebar-tab';
|
||||
import * as styles from './chat.css';
|
||||
@@ -17,6 +17,13 @@ const EditorChatPanel = ({ editor }: SidebarTabProps) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!editor) return;
|
||||
editor.host.spec.getService('affine:page').slots.docLinkClicked.on(() => {
|
||||
(chatPanelRef.current as ChatPanel).doc = editor.doc;
|
||||
});
|
||||
}, [editor]);
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
@@ -27,6 +34,7 @@ const EditorChatPanel = ({ editor }: SidebarTabProps) => {
|
||||
|
||||
if (editor !== chatPanelRef.current?.editor) {
|
||||
(chatPanelRef.current as ChatPanel).editor = editor;
|
||||
(chatPanelRef.current as ChatPanel).doc = editor.doc;
|
||||
// (copilotPanelRef.current as CopilotPanel).fitPadding = [20, 20, 20, 20];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user