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:
Saul-Mirone
2025-02-20 10:45:47 +00:00
parent 4f831732e1
commit 1516903c77
49 changed files with 66 additions and 280 deletions
@@ -1,4 +1,4 @@
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
import { AIProvider } from '@affine/core/blocksuite/presets';
import type { OAuthProviderType } from '@affine/graphql';
import { track } from '@affine/track';
import { OnEvent, Service } from '@toeverything/infra';
@@ -2,14 +2,12 @@ import type { DefaultOpenProperty } from '@affine/core/components/doc-properties
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
import {
type DocMode,
type DocTitle,
FeatureFlagService as BSFeatureFlagService,
HighlightSelection,
type ReferenceParams,
} from '@blocksuite/affine/blocks';
import type {
AffineEditorContainer,
DocTitle,
} from '@blocksuite/affine/presets';
import type { AffineEditorContainer } from '@blocksuite/affine/presets';
import type { InlineEditor } from '@blocksuite/inline';
import { effect } from '@preact/signals-core';
import { Entity, LiveData } from '@toeverything/infra';
@@ -1,11 +1,11 @@
import { toReactNode } from '@affine/component';
import { AIChatBlockPeekViewTemplate } from '@affine/core/blocksuite/presets/ai';
import { AIChatBlockPeekViewTemplate } from '@affine/core/blocksuite/presets';
import { AINetworkSearchService } from '@affine/core/modules/ai-button/services/network-search';
import type { EditorHost } from '@blocksuite/affine/block-std';
import { useFramework } from '@toeverything/infra';
import { useMemo } from 'react';
import type { AIChatBlockModel } from '../../../../blocksuite/blocks/ai-chat-block/ai-chat-model';
import type { AIChatBlockModel } from '../../../../blocksuite/blocks/ai-chat-block/model/ai-chat-model';
import { createPageModePreviewSpecs } from '../../../../components/blocksuite/block-suite-editor/specs/preview';
export type AIChatBlockPeekViewProps = {
@@ -1,6 +1,6 @@
import { Scrollable } from '@affine/component';
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
import { AIProvider } from '@affine/core/blocksuite/presets';
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-viewer';
import { PageNotFound } from '@affine/core/desktop/pages/404';
@@ -1,8 +1,7 @@
import { AIChatBlockSchema } from '@affine/core/blocksuite/blocks/ai-chat-block/model';
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
import { Schema } from '@blocksuite/affine/store';
import { AIChatBlockSchema } from '../../blocksuite/blocks';
let _schema: Schema | null = null;
export function getAFFiNEWorkspaceSchema() {
if (!_schema) {