refactor(editor): reorg blocksuite ai code (#10372)

### TL;DR

Relocated AI-related code from `presets` directory to a dedicated `ai` directory for better organization and maintainability.

### What changed?

- Moved AI-related code from `blocksuite/presets/ai` to `blocksuite/ai`
- Relocated AI chat block code from `blocksuite/blocks` to `blocksuite/ai/blocks`
- Updated imports across files to reflect new directory structure
- Renamed `registerBlocksuitePresetsCustomComponents` to `registerAIEffects`
- Fixed path references in GitHub workflow file

### How to test?

1. Build and run the application
2. Verify AI functionality works as expected:
   - Test AI chat blocks
   - Check AI panel functionality
   - Verify AI copilot features
   - Ensure AI-related UI components render correctly

### Why make this change?

This restructuring improves code organization by:
- Giving AI features a dedicated directory that better reflects their importance
- Making the codebase more maintainable by grouping related AI functionality
- Reducing confusion by removing AI code from the more general `presets` directory
- Creating clearer boundaries between AI and non-AI related code
This commit is contained in:
Saul-Mirone
2025-02-23 09:26:00 +00:00
parent 542f759ffb
commit eef2f004b8
233 changed files with 254 additions and 286 deletions

View File

@@ -1,4 +1,4 @@
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { DocsService } from '@affine/core/modules/doc';
import { TemplateDocService } from '@affine/core/modules/template-doc';

View File

@@ -5,7 +5,7 @@ import {
notify,
useConfirmModal,
} from '@affine/component';
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import { useDeleteCollectionInfo } from '@affine/core/components/hooks/affine/use-delete-collection-info';
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
import { CollectionService } from '@affine/core/modules/collection';

View File

@@ -5,7 +5,7 @@ import {
toast,
useConfirmModal,
} from '@affine/component';
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import { DocPermissionGuard } from '@affine/core/components/guard/doc-guard';
import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';

View File

@@ -6,7 +6,7 @@ import {
MenuSub,
notify,
} from '@affine/component';
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
import type {
ExplorerTreeNodeIcon,

View File

@@ -5,7 +5,7 @@ import {
toast,
useConfirmModal,
} from '@affine/component';
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
import { WorkspaceDialogService } from '@affine/core/modules/dialogs';
import { DocsService } from '@affine/core/modules/doc';

View File

@@ -1,4 +1,4 @@
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
import { usePageHelper } from '@affine/core/blocksuite/block-suite-page-list/utils';
import {
ExplorerService,
ExplorerTreeRoot,

View File

@@ -1,7 +1,7 @@
import { useThemeColorV2 } from '@affine/component';
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-editor';
import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary';
import type { AffineEditorContainer } from '@affine/core/components/blocksuite/block-suite-editor';
import { useActiveBlocksuiteEditor } from '@affine/core/components/hooks/use-block-suite-editor';
import { usePageDocumentTitle } from '@affine/core/components/hooks/use-global-state';
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';

View File

@@ -5,7 +5,7 @@ import {
MobileMenu,
MobileMenuItem,
} from '@affine/component/ui/menu';
import { useFavorite } from '@affine/core/components/blocksuite/block-suite-header/favorite';
import { useFavorite } from '@affine/core/blocksuite/block-suite-header/favorite';
import { IsFavoriteIcon } from '@affine/core/components/pure/icons';
import { DocInfoSheet } from '@affine/core/mobile/components';
import { MobileTocMenu } from '@affine/core/mobile/components/toc-menu';