mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
@@ -4,7 +4,10 @@ import {
|
||||
} from '@blocksuite/affine-ext-loader';
|
||||
|
||||
import { effects } from './effects';
|
||||
import { FrameHighlightManager } from './frame-highlight-manager';
|
||||
import { FrameBlockSpec } from './frame-spec';
|
||||
import { FrameTool } from './frame-tool';
|
||||
import { PresentTool } from './preset-tool';
|
||||
|
||||
export class FrameViewExtension extends ViewExtensionProvider {
|
||||
override name = 'affine-frame-block';
|
||||
@@ -17,5 +20,10 @@ export class FrameViewExtension extends ViewExtensionProvider {
|
||||
override setup(context: ViewExtensionContext): void {
|
||||
super.setup(context);
|
||||
context.register(FrameBlockSpec);
|
||||
if (this.isEdgeless(context.scope)) {
|
||||
context.register(FrameHighlightManager);
|
||||
context.register(FrameTool);
|
||||
context.register(PresentTool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,6 @@ import {
|
||||
MindmapElementRendererExtension,
|
||||
MindMapView,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import {
|
||||
HighlighterElementRendererExtension,
|
||||
ShapeElementRendererExtension,
|
||||
ShapeElementView,
|
||||
} from '@blocksuite/affine-gfx-shape';
|
||||
import {
|
||||
TextElementRendererExtension,
|
||||
TextElementView,
|
||||
@@ -56,12 +51,9 @@ const EdgelessElementViews = [
|
||||
MindMapView,
|
||||
GroupElementView,
|
||||
TextElementView,
|
||||
ShapeElementView,
|
||||
];
|
||||
|
||||
export const EdgelessElementRendererExtension: ExtensionType[] = [
|
||||
HighlighterElementRendererExtension,
|
||||
ShapeElementRendererExtension,
|
||||
TextElementRendererExtension,
|
||||
ConnectorElementRendererExtension,
|
||||
GroupElementRendererExtension,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { frameQuickTool } from '@blocksuite/affine-block-frame';
|
||||
import { connectorQuickTool } from '@blocksuite/affine-gfx-connector';
|
||||
import { mindMapSeniorTool } from '@blocksuite/affine-gfx-mindmap';
|
||||
import { shapeSeniorTool } from '@blocksuite/affine-gfx-shape';
|
||||
import { templateSeniorTool } from '@blocksuite/affine-gfx-template';
|
||||
import { QuickToolExtension } from '@blocksuite/affine-widget-edgeless-toolbar';
|
||||
import { html } from 'lit';
|
||||
@@ -33,8 +32,4 @@ export const quickTools = [
|
||||
linkQuickTool,
|
||||
];
|
||||
|
||||
export const seniorTools = [
|
||||
shapeSeniorTool,
|
||||
mindMapSeniorTool,
|
||||
templateSeniorTool,
|
||||
];
|
||||
export const seniorTools = [mindMapSeniorTool, templateSeniorTool];
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
import {
|
||||
FrameHighlightManager,
|
||||
FrameTool,
|
||||
PresentTool,
|
||||
} from '@blocksuite/affine-block-frame';
|
||||
import { ConnectionOverlay } from '@blocksuite/affine-block-surface';
|
||||
import type * as BrushEffect from '@blocksuite/affine-gfx-brush';
|
||||
import {
|
||||
@@ -14,7 +9,7 @@ import {
|
||||
MindMapIndicatorOverlay,
|
||||
} from '@blocksuite/affine-gfx-mindmap';
|
||||
import type * as NoteEffect from '@blocksuite/affine-gfx-note';
|
||||
import { ShapeTool } from '@blocksuite/affine-gfx-shape';
|
||||
import type * as ShapeEffect from '@blocksuite/affine-gfx-shape';
|
||||
import { TemplateTool } from '@blocksuite/affine-gfx-template';
|
||||
import { TextTool } from '@blocksuite/affine-gfx-text';
|
||||
import { InteractivityManager } from '@blocksuite/std/gfx';
|
||||
@@ -31,18 +26,18 @@ import { SnapExtension } from './interact-extensions/snap-manager.js';
|
||||
import { EditPropsMiddlewareBuilder } from './middlewares/base.js';
|
||||
import { SnapOverlay } from './utils/snap-manager.js';
|
||||
|
||||
declare type _GLOBAL_ = typeof NoteEffect | typeof BrushEffect;
|
||||
declare type _GLOBAL_ =
|
||||
| typeof NoteEffect
|
||||
| typeof BrushEffect
|
||||
| typeof ShapeEffect;
|
||||
|
||||
export const EdgelessToolExtension: ExtensionType[] = [
|
||||
DefaultTool,
|
||||
PanTool,
|
||||
TextTool,
|
||||
ShapeTool,
|
||||
ConnectorTool,
|
||||
TemplateTool,
|
||||
EmptyTool,
|
||||
FrameTool,
|
||||
PresentTool,
|
||||
];
|
||||
|
||||
export const EdgelessEditExtensions: ExtensionType[] = [
|
||||
@@ -50,7 +45,6 @@ export const EdgelessEditExtensions: ExtensionType[] = [
|
||||
ConnectorFilter,
|
||||
SnapExtension,
|
||||
MindMapDragExtension,
|
||||
FrameHighlightManager,
|
||||
DblClickAddEdgelessText,
|
||||
];
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { effects as gfxConnectorEffects } from '@blocksuite/affine-gfx-connector/effects';
|
||||
import { effects as gfxGroupEffects } from '@blocksuite/affine-gfx-group/effects';
|
||||
import { effects as gfxMindmapEffects } from '@blocksuite/affine-gfx-mindmap/effects';
|
||||
import { effects as gfxShapeEffects } from '@blocksuite/affine-gfx-shape/effects';
|
||||
import { effects as gfxTemplateEffects } from '@blocksuite/affine-gfx-template/effects';
|
||||
import { effects as gfxCanvasTextEffects } from '@blocksuite/affine-gfx-text/effects';
|
||||
import { effects as widgetEdgelessToolbarEffects } from '@blocksuite/affine-widget-edgeless-toolbar/effects';
|
||||
@@ -77,7 +76,6 @@ function registerRootComponents() {
|
||||
|
||||
function registerGfxEffects() {
|
||||
gfxCanvasTextEffects();
|
||||
gfxShapeEffects();
|
||||
gfxConnectorEffects();
|
||||
gfxMindmapEffects();
|
||||
gfxGroupEffects();
|
||||
|
||||
Reference in New Issue
Block a user