feat(editor): remove chat-cards and Open AI Chat menu item (#9626)

Support issue [BS-2353](https://linear.app/affine-design/issue/BS-2353).

### What changed?
- Remove `Open AI Chat` menu item.
- Remove `chat-cards` web component.
- Add `extractAll` function for page and edgeless doc full content extract.
This commit is contained in:
akumatus
2025-01-10 03:53:11 +00:00
parent dcd691cd31
commit 2f49c064eb
17 changed files with 157 additions and 698 deletions
@@ -11,7 +11,11 @@ import {
type EdgelessRootService,
RefNodeSlotsProvider,
} from '@blocksuite/affine/blocks';
import { Bound, DisposableGroup } from '@blocksuite/affine/global/utils';
import {
Bound,
type Disposable,
DisposableGroup,
} from '@blocksuite/affine/global/utils';
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
import {
FrameworkScope,
@@ -123,17 +127,17 @@ function DocPeekPreviewEditor({
);
useEffect(() => {
const disposable = AIProvider.slots.requestOpenWithChat.on(() => {
const disposables: Disposable[] = [];
const openHandler = () => {
if (doc) {
workbench.openDoc(doc.id);
peekView.close();
// chat panel open is already handled in <DetailPageImpl />
}
});
return () => {
disposable.dispose();
};
disposables.push(AIProvider.slots.requestOpenWithChat.on(openHandler));
disposables.push(AIProvider.slots.requestSendWithChat.on(openHandler));
return () => disposables.forEach(d => d.dispose());
}, [doc, peekView, workbench, workspace.id]);
const openOutlinePanel = useCallback(() => {