mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
chore(editor): cleanup dead code (#9904)
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
type ConnectionOverlay,
|
||||
ConnectorPathGenerator,
|
||||
EdgelessCRUDIdentifier,
|
||||
isNoteBlock,
|
||||
Overlay,
|
||||
OverlayIdentifier,
|
||||
type RoughCanvas,
|
||||
@@ -44,7 +45,6 @@ import { classMap } from 'lit/directives/class-map.js';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
import type { EdgelessRootBlockComponent } from '../../edgeless-root-block.js';
|
||||
import { isNoteBlock } from '../../utils/query.js';
|
||||
import { mountShapeTextEditor } from '../../utils/text.js';
|
||||
import type { SelectedRect } from '../rects/edgeless-selected-rect.js';
|
||||
import { EdgelessAutoCompletePanel } from './auto-complete-panel.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isNoteBlock } from '@blocksuite/affine-block-surface';
|
||||
import { SmallScissorsIcon } from '@blocksuite/affine-components/icons';
|
||||
import { DEFAULT_NOTE_HEIGHT } from '@blocksuite/affine-model';
|
||||
import { EDGELESS_BLOCK_CHILD_PADDING } from '@blocksuite/affine-shared/consts';
|
||||
@@ -22,7 +23,6 @@ import type {
|
||||
NoteBlockModel,
|
||||
RootBlockModel,
|
||||
} from '../../../../index.js';
|
||||
import { isNoteBlock } from '../../utils/query.js';
|
||||
|
||||
const DIVIDING_LINE_OFFSET = 4;
|
||||
const NEW_NOTE_GAP = 40;
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from '@blocksuite/affine-block-embed';
|
||||
import {
|
||||
CanvasElementType,
|
||||
isNoteBlock,
|
||||
normalizeShapeBound,
|
||||
OverlayIdentifier,
|
||||
TextUtils,
|
||||
@@ -91,7 +92,6 @@ import {
|
||||
isFrameBlock,
|
||||
isImageBlock,
|
||||
isMindmapNode,
|
||||
isNoteBlock,
|
||||
} from '../../utils/query.js';
|
||||
import {
|
||||
HandleDirection,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { insertLinkByQuickSearchCommand } from '@blocksuite/affine-block-bookmark';
|
||||
import { EdgelessTextBlockComponent } from '@blocksuite/affine-block-edgeless-text';
|
||||
import { isNoteBlock } from '@blocksuite/affine-block-surface';
|
||||
import { toast } from '@blocksuite/affine-components/toast';
|
||||
import {
|
||||
ConnectorElementModel,
|
||||
@@ -45,7 +46,7 @@ import {
|
||||
} from './utils/consts.js';
|
||||
import { deleteElements } from './utils/crud.js';
|
||||
import { getNextShapeType } from './utils/hotkey-utils.js';
|
||||
import { isCanvasElement, isNoteBlock } from './utils/query.js';
|
||||
import { isCanvasElement } from './utils/query.js';
|
||||
import {
|
||||
mountConnectorLabelEditor,
|
||||
mountShapeTextEditor,
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ThemeService,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { AFFINE_DRAG_HANDLE_WIDGET } from '@blocksuite/affine-widget-drag-handle';
|
||||
import { AFFINE_EDGELESS_AUTO_CONNECT_WIDGET } from '@blocksuite/affine-widget-edgeless-auto-connect';
|
||||
import { AFFINE_FRAME_TITLE_WIDGET } from '@blocksuite/affine-widget-frame-title';
|
||||
import {
|
||||
AFFINE_DOC_REMOTE_SELECTION_WIDGET,
|
||||
@@ -25,7 +26,6 @@ import { literal, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { ExportManagerExtension } from '../../_common/export-manager/export-manager.js';
|
||||
import { RootBlockAdapterExtensions } from '../adapters/extension.js';
|
||||
import { AFFINE_EDGELESS_AUTO_CONNECT_WIDGET } from '../widgets/edgeless-auto-connect/edgeless-auto-connect.js';
|
||||
import { AFFINE_EDGELESS_ZOOM_TOOLBAR_WIDGET } from '../widgets/edgeless-zoom-toolbar/index.js';
|
||||
import { EDGELESS_ELEMENT_TOOLBAR_WIDGET } from '../widgets/element-toolbar/index.js';
|
||||
import { AFFINE_EMBED_CARD_TOOLBAR_WIDGET } from '../widgets/embed-card-toolbar/embed-card-toolbar.js';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { insertEdgelessTextCommand } from '@blocksuite/affine-block-edgeless-text';
|
||||
import {
|
||||
ConnectorUtils,
|
||||
isNoteBlock,
|
||||
OverlayIdentifier,
|
||||
} from '@blocksuite/affine-block-surface';
|
||||
import { focusTextModel } from '@blocksuite/affine-components/rich-text';
|
||||
@@ -56,7 +57,6 @@ import {
|
||||
isCanvasElement,
|
||||
isEdgelessTextBlock,
|
||||
isFrameBlock,
|
||||
isNoteBlock,
|
||||
} from '../utils/query.js';
|
||||
import type { EdgelessSnapManager } from '../utils/snap-manager.js';
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isNoteBlock } from '@blocksuite/affine-block-surface';
|
||||
import type {
|
||||
EdgelessTextBlockModel,
|
||||
EmbedSyncedDocModel,
|
||||
@@ -22,7 +23,6 @@ import {
|
||||
isEmbedSyncedDocBlock,
|
||||
isFrameBlock,
|
||||
isImageBlock,
|
||||
isNoteBlock,
|
||||
} from './query.js';
|
||||
|
||||
const offset = 10;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { isNoteBlock } from '@blocksuite/affine-block-surface';
|
||||
|
||||
import type { Connectable } from '../../../_common/utils/index.js';
|
||||
import type { EdgelessRootBlockComponent } from '../index.js';
|
||||
import { isConnectable, isNoteBlock } from './query.js';
|
||||
import { isConnectable } from './query.js';
|
||||
|
||||
/**
|
||||
* Use deleteElementsV2 instead.
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
type FrameBlockModel,
|
||||
type ImageBlockModel,
|
||||
MindmapElementModel,
|
||||
type NoteBlockModel,
|
||||
ShapeElementModel,
|
||||
TextElementModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
@@ -46,12 +45,6 @@ export function isMindmapNode(
|
||||
return element?.group instanceof MindmapElementModel;
|
||||
}
|
||||
|
||||
export function isNoteBlock(
|
||||
element: BlockModel | BlockSuite.EdgelessModel | null
|
||||
): element is NoteBlockModel {
|
||||
return !!element && 'flavour' in element && element.flavour === 'affine:note';
|
||||
}
|
||||
|
||||
export function isEdgelessTextBlock(
|
||||
element: BlockModel | BlockSuite.EdgelessModel | null
|
||||
): element is EdgelessTextBlockModel {
|
||||
|
||||
Reference in New Issue
Block a user