mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor: move doc-title and ai-chat-block components (#10316)
### TL;DR Moved doc title and AI chat block components to more appropriate locations while removing unused backlink functionality. ### What changed? - Relocated doc title component from presets to affine-components - Moved AI chat block from presets/blocks to blocks directory - Removed unused backlink-related code and components - Updated imports across files to reference new component locations - Consolidated AI-related exports through a single entry point ### How to test? 1. Verify doc title still renders correctly in documents 2. Confirm AI chat functionality works as expected 3. Check that no backlink-related features are accessible 4. Ensure all AI features continue to work through the new import paths ### Why make this change? This reorganization improves code organization by: - Placing components closer to their related functionality - Removing dead/unused code around backlinks - Simplifying the import structure for AI-related features - Making the codebase more maintainable by consolidating related components
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets';
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { partition } from 'lodash-es';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets';
|
||||
import { toggleGeneralAIOnboarding } from '@affine/core/components/affine/ai-onboarding/apis';
|
||||
import type { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets';
|
||||
import { mixpanel, track } from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { GfxPrimitiveElementModel } from '@blocksuite/affine/block-std/gfx';
|
||||
|
||||
@@ -2,12 +2,12 @@ import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import {
|
||||
appendParagraphCommand,
|
||||
type DocMode,
|
||||
type DocTitle,
|
||||
focusBlockEnd,
|
||||
getLastNoteBlock,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type {
|
||||
AffineEditorContainer,
|
||||
DocTitle,
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/affine/presets';
|
||||
|
||||
@@ -20,17 +20,14 @@ import track from '@affine/track';
|
||||
import {
|
||||
codeToolbarWidget,
|
||||
type DocMode,
|
||||
DocTitle,
|
||||
embedCardToolbarWidget,
|
||||
formatBarWidget,
|
||||
imageToolbarWidget,
|
||||
slashMenuWidget,
|
||||
surfaceRefToolbarWidget,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
DocTitle,
|
||||
EdgelessEditor,
|
||||
PageEditor,
|
||||
} from '@blocksuite/affine/presets';
|
||||
import { EdgelessEditor, PageEditor } from '@blocksuite/affine/presets';
|
||||
import type { Store } from '@blocksuite/affine/store';
|
||||
import {
|
||||
useFramework,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/blocks';
|
||||
import {
|
||||
AICodeBlockSpec,
|
||||
AIImageBlockSpec,
|
||||
AIParagraphBlockSpec,
|
||||
} from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks/ai-chat-block';
|
||||
} from '@affine/core/blocksuite/presets';
|
||||
import {
|
||||
AdapterFactoryExtensions,
|
||||
AttachmentBlockSpec,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/blocks';
|
||||
import {
|
||||
AICodeBlockSpec,
|
||||
AIImageBlockSpec,
|
||||
AIParagraphBlockSpec,
|
||||
} from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks';
|
||||
} from '@affine/core/blocksuite/presets';
|
||||
import { DocService, DocsService } from '@affine/core/modules/doc';
|
||||
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-setting';
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { notify } from '@affine/component';
|
||||
import {
|
||||
isMindmapChild,
|
||||
isMindMapRoot,
|
||||
} from '@affine/core/blocksuite/presets/ai/utils/edgeless';
|
||||
import { isMindmapChild, isMindMapRoot } from '@affine/core/blocksuite/presets';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { I18n } from '@affine/i18n';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAIEdgelessRootBlockSpec } from '@affine/core/blocksuite/presets/ai';
|
||||
import { createAIEdgelessRootBlockSpec } from '@affine/core/blocksuite/presets';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import { builtInTemplates as builtInEdgelessTemplates } from '@affine/templates/edgeless';
|
||||
import { builtInTemplates as builtInStickersTemplates } from '@affine/templates/stickers';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAIPageRootBlockSpec } from '@affine/core/blocksuite/presets/ai';
|
||||
import { createAIPageRootBlockSpec } from '@affine/core/blocksuite/presets';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import {
|
||||
PageRootBlockSpec,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks/ai-chat-block';
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/blocks';
|
||||
import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view';
|
||||
import { AppThemeService } from '@affine/core/modules/theme';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { handleInlineAskAIAction } from '@affine/core/blocksuite/presets/ai';
|
||||
import { pageAIGroups } from '@affine/core/blocksuite/presets/ai/_common/config';
|
||||
import {
|
||||
handleInlineAskAIAction,
|
||||
pageAIGroups,
|
||||
} from '@affine/core/blocksuite/presets';
|
||||
import { DocsService } from '@affine/core/modules/doc';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
pushGlobalLoadingEventAtom,
|
||||
resolveGlobalLoadingEventAtom,
|
||||
} from '@affine/component/global-loading';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets';
|
||||
import { SyncAwareness } from '@affine/core/components/affine/awareness';
|
||||
import { useRegisterFindInPageCommands } from '@affine/core/components/hooks/affine/use-register-find-in-page-commands';
|
||||
import { useRegisterWorkspaceCommands } from '@affine/core/components/hooks/use-register-workspace-commands';
|
||||
|
||||
Reference in New Issue
Block a user