mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
refactor(editor): cleanup dead code (#12072)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Simplified and removed several internal AI block extension files and utility functions, streamlining the codebase and reducing unused features. - Updated logic to access editor modes and controllers directly, removing reliance on DOM queries and certain abstractions. - Reduced and restructured effect type declarations for improved clarity. - **Bug Fixes** - Improved type safety in the editor component by explicitly typing queried elements. - **Chores** - Removed obsolete exports and internal functions with no impact on user-facing functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import type * as Effects from '@blocksuite/affine/effects';
|
||||
import type * as ConnectorToolEffect from '@blocksuite/affine/gfx/connector';
|
||||
import type * as ShapeToolEffect from '@blocksuite/affine/gfx/shape';
|
||||
import type * as Effect from '@blocksuite/affine/effects';
|
||||
import type * as ConnectorEffect from '@blocksuite/affine/gfx/connector';
|
||||
import type * as ShapeEffect from '@blocksuite/affine/gfx/shape';
|
||||
import type { EditorHost } from '@blocksuite/affine/std';
|
||||
import type { Store, Transformer, Workspace } from '@blocksuite/affine/store';
|
||||
import type { TestAffineEditorContainer } from '@blocksuite/integration-test';
|
||||
|
||||
declare const _GLOBAL_:
|
||||
| typeof Effects
|
||||
| typeof ConnectorToolEffect
|
||||
| typeof ShapeToolEffect;
|
||||
declare type _GLOBAL_ =
|
||||
| typeof Effect
|
||||
| typeof ConnectorEffect
|
||||
| typeof ShapeEffect;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import type * as BlocksuiteEffects from '@blocksuite/affine/effects';
|
||||
import '@blocksuite/affine/effects';
|
||||
|
||||
import type { IVec, XYWH } from '@blocksuite/affine/global/gfx';
|
||||
import type { CodeBlockComponent } from '@blocksuite/affine-block-code';
|
||||
import type { ParagraphBlockComponent } from '@blocksuite/affine-block-paragraph';
|
||||
import type { BlockComponent } from '@blocksuite/std';
|
||||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
|
||||
declare type _GLOBAL_ = typeof BlocksuiteEffects;
|
||||
|
||||
const EDGELESS_TOOLBAR_WIDGET = 'edgeless-toolbar-widget';
|
||||
export const ZERO_WIDTH_FOR_EMPTY_LINE =
|
||||
process.env.BROWSER === 'webkit' ? '\u200C' : '\u200B';
|
||||
|
||||
Reference in New Issue
Block a user