mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore(core): bump blocksuite (#6525)
## Features - https://github.com/toeverything/BlockSuite/pull/6728 @fundon - https://github.com/toeverything/BlockSuite/pull/6714 @doouding - https://github.com/toeverything/BlockSuite/pull/6733 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6560 @golok727 - https://github.com/toeverything/BlockSuite/pull/6727 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6645 @regischen - https://github.com/toeverything/BlockSuite/pull/6724 @fundon - https://github.com/toeverything/BlockSuite/pull/6719 @zzj3720 - https://github.com/toeverything/BlockSuite/pull/6682 @donteatfriedrice ## Bugfix - https://github.com/toeverything/BlockSuite/pull/6734 @Flrande - https://github.com/toeverything/BlockSuite/pull/6732 @fourdim - https://github.com/toeverything/BlockSuite/pull/6726 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6721 @Flrande - https://github.com/toeverything/BlockSuite/pull/6725 @fundon - https://github.com/toeverything/BlockSuite/pull/6716 @golok727 - https://github.com/toeverything/BlockSuite/pull/6723 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6722 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6718 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6702 @Tzyito - https://github.com/toeverything/BlockSuite/pull/6711 @Tzyito - https://github.com/toeverything/BlockSuite/pull/6694 @fundon - https://github.com/toeverything/BlockSuite/pull/6717 @golok727 ## Refactor - https://github.com/toeverything/BlockSuite/pull/6672 @Saul-Mirone ## Misc - https://github.com/toeverything/BlockSuite/pull/6720 @raintoway
This commit is contained in:
@@ -19,13 +19,13 @@
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@affine/workspace-impl": "workspace:*",
|
||||
"@blocksuite/block-std": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/blocks": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/global": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/block-std": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@blocksuite/blocks": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@blocksuite/global": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@blocksuite/icons": "2.1.46",
|
||||
"@blocksuite/inline": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/presets": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/store": "0.14.0-canary-202404090831-25c5310",
|
||||
"@blocksuite/inline": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@blocksuite/presets": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@blocksuite/store": "0.14.0-canary-202404111515-fb8a834",
|
||||
"@dnd-kit/core": "^6.1.0",
|
||||
"@dnd-kit/modifiers": "^7.0.0",
|
||||
"@dnd-kit/sortable": "^8.0.0",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { useWorkspaceEnabledFeatures } from '@affine/core/hooks/use-workspace-features';
|
||||
import { FeatureType } from '@affine/graphql';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { AiIcon } from '@blocksuite/icons';
|
||||
import { ChatPanel } from '@blocksuite/presets';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useCallback, useRef } from 'react';
|
||||
|
||||
import type { SidebarTab, SidebarTabProps } from '../sidebar-tab';
|
||||
@@ -8,14 +11,21 @@ import * as styles from './chat.css';
|
||||
|
||||
// A wrapper for CopilotPanel
|
||||
const EditorChatPanel = ({ editor }: SidebarTabProps) => {
|
||||
const workspace = useService(Workspace);
|
||||
const copilotEnabled = useWorkspaceEnabledFeatures(workspace.meta).includes(
|
||||
FeatureType.Copilot
|
||||
);
|
||||
const chatPanelRef = useRef<ChatPanel | null>(null);
|
||||
|
||||
const onRefChange = useCallback((container: HTMLDivElement | null) => {
|
||||
if (container) {
|
||||
assertExists(chatPanelRef.current, 'chat panel should be initialized');
|
||||
container.append(chatPanelRef.current);
|
||||
}
|
||||
}, []);
|
||||
const onRefChange = useCallback(
|
||||
(container: HTMLDivElement | null) => {
|
||||
if (container && copilotEnabled) {
|
||||
assertExists(chatPanelRef.current, 'chat panel should be initialized');
|
||||
container.append(chatPanelRef.current);
|
||||
}
|
||||
},
|
||||
[copilotEnabled]
|
||||
);
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user