refactor(editor): extract edgeless legacy slots (#9363)
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export * from './crud-extension';
|
||||
export * from './legacy-slot-extension';
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { FrameBlockModel } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { Slot } from '@blocksuite/global/utils';
|
||||
|
||||
export const EdgelessLegacySlotIdentifier = createIdentifier<{
|
||||
readonlyUpdated: Slot<boolean>;
|
||||
navigatorSettingUpdated: Slot<{
|
||||
hideToolbar?: boolean;
|
||||
blackBackground?: boolean;
|
||||
fillScreen?: boolean;
|
||||
}>;
|
||||
navigatorFrameChanged: Slot<FrameBlockModel>;
|
||||
fullScreenToggled: Slot;
|
||||
|
||||
elementResizeStart: Slot;
|
||||
elementResizeEnd: Slot;
|
||||
toggleNoteSlicer: Slot;
|
||||
|
||||
toolbarLocked: Slot<boolean>;
|
||||
}>('AffineEdgelessLegacySlotService');
|
||||
|
||||
export const EdgelessLegacySlotExtension: ExtensionType = {
|
||||
setup: di => {
|
||||
di.addImpl(EdgelessLegacySlotIdentifier, () => ({
|
||||
readonlyUpdated: new Slot<boolean>(),
|
||||
navigatorSettingUpdated: new Slot<{
|
||||
hideToolbar?: boolean;
|
||||
blackBackground?: boolean;
|
||||
fillScreen?: boolean;
|
||||
}>(),
|
||||
navigatorFrameChanged: new Slot<FrameBlockModel>(),
|
||||
fullScreenToggled: new Slot(),
|
||||
elementResizeStart: new Slot(),
|
||||
elementResizeEnd: new Slot(),
|
||||
toggleNoteSlicer: new Slot(),
|
||||
toolbarLocked: new Slot<boolean>(),
|
||||
}));
|
||||
},
|
||||
};
|
||||
@@ -10,11 +10,14 @@ import { literal } from 'lit/static-html.js';
|
||||
import {
|
||||
EdgelessSurfaceBlockAdapterExtensions,
|
||||
SurfaceBlockAdapterExtensions,
|
||||
} from './adapters/extension.js';
|
||||
import { commands } from './commands/index.js';
|
||||
import { EdgelessCRUDExtension } from './extensions/crud-extension.js';
|
||||
import { SurfaceBlockService } from './surface-service.js';
|
||||
import { MindMapView } from './view/mindmap.js';
|
||||
} from './adapters/extension';
|
||||
import { commands } from './commands';
|
||||
import {
|
||||
EdgelessCRUDExtension,
|
||||
EdgelessLegacySlotExtension,
|
||||
} from './extensions';
|
||||
import { SurfaceBlockService } from './surface-service';
|
||||
import { MindMapView } from './view/mindmap';
|
||||
|
||||
const CommonSurfaceBlockSpec: ExtensionType[] = [
|
||||
FlavourExtension('affine:surface'),
|
||||
@@ -23,6 +26,7 @@ const CommonSurfaceBlockSpec: ExtensionType[] = [
|
||||
HighlightSelectionExtension,
|
||||
MindMapView,
|
||||
EdgelessCRUDExtension,
|
||||
EdgelessLegacySlotExtension,
|
||||
];
|
||||
|
||||
export const PageSurfaceBlockSpec: ExtensionType[] = [
|
||||
|
||||
@@ -64,8 +64,8 @@ export interface ResolvedOptions extends Options {
|
||||
preserveVertices: boolean;
|
||||
}
|
||||
|
||||
export declare type OpType = 'move' | 'bcurveTo' | 'lineTo';
|
||||
export declare type OpSetType = 'path' | 'fillPath' | 'fillSketch';
|
||||
export type OpType = 'move' | 'bcurveTo' | 'lineTo';
|
||||
export type OpSetType = 'path' | 'fillPath' | 'fillSketch';
|
||||
|
||||
export interface Op {
|
||||
op: OpType;
|
||||
|
||||
Reference in New Issue
Block a user