mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(editor): remove unused block dependencies (#11959)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated package dependencies to reduce the number of direct dependencies for improved maintainability. No changes to user-facing features or functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -12,19 +12,14 @@
|
||||
"dependencies": {
|
||||
"@blocksuite/affine-block-attachment": "workspace:*",
|
||||
"@blocksuite/affine-block-bookmark": "workspace:*",
|
||||
"@blocksuite/affine-block-data-view": "workspace:*",
|
||||
"@blocksuite/affine-block-database": "workspace:*",
|
||||
"@blocksuite/affine-block-edgeless-text": "workspace:*",
|
||||
"@blocksuite/affine-block-embed": "workspace:*",
|
||||
"@blocksuite/affine-block-frame": "workspace:*",
|
||||
"@blocksuite/affine-block-image": "workspace:*",
|
||||
"@blocksuite/affine-block-latex": "workspace:*",
|
||||
"@blocksuite/affine-block-list": "workspace:*",
|
||||
"@blocksuite/affine-block-note": "workspace:*",
|
||||
"@blocksuite/affine-block-paragraph": "workspace:*",
|
||||
"@blocksuite/affine-block-surface": "workspace:*",
|
||||
"@blocksuite/affine-block-surface-ref": "workspace:*",
|
||||
"@blocksuite/affine-block-table": "workspace:*",
|
||||
"@blocksuite/affine-components": "workspace:*",
|
||||
"@blocksuite/affine-fragment-doc-title": "workspace:*",
|
||||
"@blocksuite/affine-gfx-brush": "workspace:*",
|
||||
@@ -33,12 +28,8 @@
|
||||
"@blocksuite/affine-gfx-mindmap": "workspace:*",
|
||||
"@blocksuite/affine-gfx-note": "workspace:*",
|
||||
"@blocksuite/affine-gfx-shape": "workspace:*",
|
||||
"@blocksuite/affine-gfx-template": "workspace:*",
|
||||
"@blocksuite/affine-gfx-text": "workspace:*",
|
||||
"@blocksuite/affine-inline-latex": "workspace:*",
|
||||
"@blocksuite/affine-inline-link": "workspace:*",
|
||||
"@blocksuite/affine-inline-preset": "workspace:*",
|
||||
"@blocksuite/affine-inline-reference": "workspace:*",
|
||||
"@blocksuite/affine-model": "workspace:*",
|
||||
"@blocksuite/affine-rich-text": "workspace:*",
|
||||
"@blocksuite/affine-shared": "workspace:*",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type * as BrushEffect from '@blocksuite/affine-gfx-brush';
|
||||
import type * as NoteEffect from '@blocksuite/affine-gfx-note';
|
||||
import type * as ShapeEffect from '@blocksuite/affine-gfx-shape';
|
||||
import { TextTool } from '@blocksuite/affine-gfx-text';
|
||||
import { InteractivityManager } from '@blocksuite/std/gfx';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
@@ -11,7 +10,6 @@ import { DefaultTool } from './gfx-tool/default-tool.js';
|
||||
import { EmptyTool } from './gfx-tool/empty-tool.js';
|
||||
import { PanTool } from './gfx-tool/pan-tool.js';
|
||||
import { AltCloneExtension } from './interact-extensions/clone-ext.js';
|
||||
import { DblClickAddEdgelessText } from './interact-extensions/dblclick-add-edgeless-text.js';
|
||||
import { SnapExtension } from './interact-extensions/snap-manager.js';
|
||||
import { EditPropsMiddlewareBuilder } from './middlewares/base.js';
|
||||
import { SnapOverlay } from './utils/snap-manager.js';
|
||||
@@ -24,14 +22,12 @@ declare type _GLOBAL_ =
|
||||
export const EdgelessToolExtension: ExtensionType[] = [
|
||||
DefaultTool,
|
||||
PanTool,
|
||||
TextTool,
|
||||
EmptyTool,
|
||||
];
|
||||
|
||||
export const EdgelessEditExtensions: ExtensionType[] = [
|
||||
InteractivityManager,
|
||||
SnapExtension,
|
||||
DblClickAddEdgelessText,
|
||||
];
|
||||
|
||||
export const EdgelessBuiltInManager: ExtensionType[] = [
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
import {
|
||||
addText,
|
||||
insertEdgelessTextCommand,
|
||||
} from '@blocksuite/affine-gfx-text';
|
||||
import {
|
||||
FeatureFlagService,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
type GfxInteractivityContext,
|
||||
InteractivityExtension,
|
||||
} from '@blocksuite/std/gfx';
|
||||
|
||||
export class DblClickAddEdgelessText extends InteractivityExtension {
|
||||
static override key = 'dbl-click-add-edgeless-text';
|
||||
|
||||
override mounted() {
|
||||
this.event.on('dblclick', (ctx: GfxInteractivityContext) => {
|
||||
const { event: e } = ctx;
|
||||
const textFlag = this.std.store
|
||||
.get(FeatureFlagService)
|
||||
.getFlag('enable_edgeless_text');
|
||||
const picked = this.gfx.getElementByPoint(
|
||||
...this.gfx.viewport.toModelCoord(e.x, e.y)
|
||||
);
|
||||
|
||||
if (picked) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (textFlag) {
|
||||
const [x, y] = this.gfx.viewport.toModelCoord(e.x, e.y);
|
||||
this.std.command.exec(insertEdgelessTextCommand, { x, y });
|
||||
} else {
|
||||
const edgelessView = this.std.view.getBlock(
|
||||
this.std.store.root?.id || ''
|
||||
);
|
||||
|
||||
if (edgelessView) {
|
||||
addText(edgelessView, e);
|
||||
}
|
||||
}
|
||||
|
||||
this.std.getOptional(TelemetryProvider)?.track('CanvasElementAdded', {
|
||||
control: 'canvas:dbclick',
|
||||
page: 'whiteboard editor',
|
||||
module: 'toolbar',
|
||||
segment: 'toolbar',
|
||||
type: 'text',
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -9,19 +9,14 @@
|
||||
"references": [
|
||||
{ "path": "../attachment" },
|
||||
{ "path": "../bookmark" },
|
||||
{ "path": "../data-view" },
|
||||
{ "path": "../database" },
|
||||
{ "path": "../edgeless-text" },
|
||||
{ "path": "../embed" },
|
||||
{ "path": "../frame" },
|
||||
{ "path": "../image" },
|
||||
{ "path": "../latex" },
|
||||
{ "path": "../list" },
|
||||
{ "path": "../note" },
|
||||
{ "path": "../paragraph" },
|
||||
{ "path": "../surface" },
|
||||
{ "path": "../surface-ref" },
|
||||
{ "path": "../table" },
|
||||
{ "path": "../../components" },
|
||||
{ "path": "../../fragments/doc-title" },
|
||||
{ "path": "../../gfx/brush" },
|
||||
@@ -30,12 +25,8 @@
|
||||
{ "path": "../../gfx/mindmap" },
|
||||
{ "path": "../../gfx/note" },
|
||||
{ "path": "../../gfx/shape" },
|
||||
{ "path": "../../gfx/template" },
|
||||
{ "path": "../../gfx/text" },
|
||||
{ "path": "../../inlines/latex" },
|
||||
{ "path": "../../inlines/link" },
|
||||
{ "path": "../../inlines/preset" },
|
||||
{ "path": "../../inlines/reference" },
|
||||
{ "path": "../../model" },
|
||||
{ "path": "../../rich-text" },
|
||||
{ "path": "../../shared" },
|
||||
|
||||
Reference in New Issue
Block a user