@yuzhouu/canvas-kit 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -102
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +8 -0
- package/_vendor/canvas-core/editor/cameraPanSession.d.ts +9 -0
- package/_vendor/canvas-core/editor/canvasPanInteraction.d.ts +2 -0
- package/_vendor/canvas-core/editor/commands.d.ts +15 -3
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/editor.d.ts +24 -26
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +4 -2
- package/_vendor/canvas-core/editor/historyManager.d.ts +22 -1
- package/_vendor/canvas-core/editor/index.d.ts +2 -2
- package/_vendor/canvas-core/editor/interactions.d.ts +10 -1
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/inputsManager.d.ts +3 -0
- package/_vendor/canvas-core/editor/managers/interactionTransientManager.d.ts +0 -26
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +13 -1
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +2 -0
- package/_vendor/canvas-core/editor/managers/shapeGeometryManager.d.ts +3 -2
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +6 -2
- package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +3 -2
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/spatialIndexManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +32 -12
- package/_vendor/canvas-core/editor/selection.d.ts +19 -5
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +4 -3
- package/_vendor/canvas-core/editor/selectionResizeCapabilities.d.ts +9 -0
- package/_vendor/canvas-core/editor/shapeTransformSpace.d.ts +6 -0
- package/_vendor/canvas-core/exports/svg.d.ts +1 -0
- package/_vendor/canvas-core/geometry/index.d.ts +1 -0
- package/_vendor/canvas-core/geometry/mat.d.ts +6 -2
- package/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
- package/_vendor/canvas-core/geometry/vec.d.ts +0 -2
- package/_vendor/canvas-core/index.d.ts +14 -20
- package/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +4 -10
- package/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +19 -0
- package/_vendor/canvas-core/plugins/index.d.ts +2 -1
- package/_vendor/canvas-core/schema/records.d.ts +2 -7
- package/_vendor/canvas-core/schema/snapshots.d.ts +10 -19
- package/_vendor/canvas-core/shapes/colors.d.ts +1 -2
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +52 -14
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +9 -6
- package/_vendor/canvas-core/tools/select/states/draggingSelectionHandleInteractionState.d.ts +3 -3
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +2 -1
- package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +7 -0
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/actions.d.ts +2 -4
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/contextMenu.d.ts +25 -30
- package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +11 -0
- package/_vendor/canvas-plugin-sdk/index.d.ts +7 -0
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +39 -0
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/toolbar.d.ts +32 -1
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +19 -0
- package/_vendor/canvas-react/components/CanvasView.d.ts +2 -2
- package/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
- package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +4 -3
- package/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
- package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +7 -1
- package/_vendor/canvas-react/host/canvasRenderRuntime.d.ts +13 -0
- package/_vendor/canvas-react/host/domEventGuards.d.ts +3 -3
- package/_vendor/canvas-react/host/index.d.ts +2 -8
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +3 -3
- package/_vendor/canvas-react/host/rendererRegistry.d.ts +7 -4
- package/_vendor/canvas-react/index.d.ts +1 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +6 -4
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +5 -3
- package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +2 -2
- package/_vendor/plugin-arrow/canvasRender.d.ts +2 -2
- package/_vendor/plugin-arrow/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -3
- package/_vendor/plugin-arrow/index.d.ts +2 -2
- package/_vendor/plugin-draw/canvasRender.d.ts +2 -2
- package/_vendor/plugin-draw/drawGeometry.d.ts +4 -7
- package/_vendor/plugin-draw/drawShapeUtil.d.ts +2 -2
- package/_vendor/plugin-draw/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-draw/feature.d.ts +2 -3
- package/_vendor/plugin-draw/index.d.ts +3 -3
- package/_vendor/plugin-eraser/canvasRender.d.ts +2 -2
- package/_vendor/plugin-eraser/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-eraser/eraserRuntime.d.ts +12 -0
- package/_vendor/plugin-eraser/feature.d.ts +2 -3
- package/_vendor/plugin-eraser/index.d.ts +3 -2
- package/_vendor/plugin-frame/canvasRender.d.ts +2 -2
- package/_vendor/plugin-frame/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-frame/feature.d.ts +2 -3
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +4 -2
- package/_vendor/plugin-frame/index.d.ts +2 -2
- package/_vendor/plugin-geo/canvasRender.d.ts +2 -2
- package/_vendor/plugin-geo/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-geo/feature.d.ts +2 -3
- package/_vendor/plugin-geo/geoShapeUtil.d.ts +1 -1
- package/_vendor/plugin-geo/index.d.ts +2 -2
- package/_vendor/plugin-group/canvasRender.d.ts +2 -2
- package/_vendor/plugin-group/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-group/feature.d.ts +2 -3
- package/_vendor/plugin-group/groupContributions.d.ts +7 -0
- package/_vendor/plugin-group/groupShapeUtil.d.ts +24 -5
- package/_vendor/plugin-group/index.d.ts +3 -2
- package/_vendor/plugin-image/canvasRender.d.ts +2 -2
- package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
- package/_vendor/plugin-image/cropSession.d.ts +5 -3
- package/_vendor/plugin-image/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-image/feature.d.ts +2 -3
- package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
- package/_vendor/plugin-image/imageShapeUtil.d.ts +3 -3
- package/_vendor/plugin-image/index.d.ts +4 -4
- package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
- package/_vendor/plugin-image/smudge.d.ts +13 -2
- package/_vendor/plugin-image/smudgeRuntime.d.ts +1 -1
- package/_vendor/plugin-image/styleRuntime.d.ts +1 -1
- package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
- package/_vendor/plugin-laser/canvasRender.d.ts +2 -2
- package/_vendor/plugin-laser/editorRuntime.d.ts +4 -2
- package/_vendor/plugin-laser/feature.d.ts +2 -3
- package/_vendor/plugin-laser/index.d.ts +3 -2
- package/_vendor/plugin-laser/laserRuntime.d.ts +18 -0
- package/_vendor/plugin-packaging/canvasRender.d.ts +2 -0
- package/_vendor/plugin-packaging/editorRuntime.d.ts +2 -0
- package/_vendor/plugin-packaging/feature.d.ts +2 -0
- package/_vendor/plugin-packaging/index.d.ts +17 -0
- package/_vendor/plugin-packaging/packagingArtwork.d.ts +5 -0
- package/_vendor/plugin-packaging/packagingDxf.d.ts +9 -0
- package/_vendor/plugin-packaging/packagingGeometry.d.ts +74 -0
- package/_vendor/plugin-packaging/packagingInteractions.d.ts +2 -0
- package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +25 -0
- package/_vendor/plugin-packaging/packagingRuntime.d.ts +11 -0
- package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +34 -0
- package/_vendor/plugin-packaging/packagingStyle.d.ts +10 -0
- package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +7 -0
- package/_vendor/plugin-packaging/productRuntime.d.ts +2 -0
- package/_vendor/plugin-packaging/types.d.ts +168 -0
- package/_vendor/plugin-packaging/validation.d.ts +3 -0
- package/_vendor/plugin-path/PathDraftOverlay.d.ts +1 -0
- package/_vendor/plugin-path/PathEditInsertPreviewOverlay.d.ts +1 -0
- package/_vendor/plugin-path/PathShapeRenderer.d.ts +12 -0
- package/_vendor/plugin-path/canvasRender.d.ts +2 -0
- package/_vendor/plugin-path/editorRuntime.d.ts +21 -0
- package/_vendor/plugin-path/feature.d.ts +2 -0
- package/_vendor/plugin-path/index.d.ts +7 -0
- package/_vendor/plugin-path/pathBoolean.d.ts +13 -0
- package/_vendor/plugin-path/pathDraft.d.ts +10 -0
- package/_vendor/plugin-path/pathEditPreview.d.ts +11 -0
- package/_vendor/plugin-path/pathEditSelection.d.ts +24 -0
- package/_vendor/plugin-path/pathEditSnap.d.ts +6 -0
- package/_vendor/plugin-path/pathGeometry.d.ts +74 -0
- package/_vendor/plugin-path/pathHandles.d.ts +18 -0
- package/_vendor/plugin-path/pathInteractions.d.ts +7 -0
- package/_vendor/plugin-path/pathShapeUtil.d.ts +28 -0
- package/_vendor/plugin-path/pathSvg.d.ts +3 -0
- package/_vendor/plugin-path/pathTool.d.ts +39 -0
- package/_vendor/plugin-path/types.d.ts +36 -0
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +6 -1
- package/_vendor/plugin-text/canvasRender.d.ts +6 -3
- package/_vendor/plugin-text/editorRuntime.d.ts +9 -3
- package/_vendor/plugin-text/feature.d.ts +4 -4
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +6 -1
- package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +4 -1
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +5 -2
- package/_vendor/plugin-text/host/richTextRendering.d.ts +0 -1
- package/_vendor/plugin-text/host/textFormattingApi.d.ts +16 -0
- package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +3 -1
- package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +4 -1
- package/_vendor/plugin-text/index.d.ts +7 -4
- package/_vendor/plugin-text/richTextUtils.d.ts +6 -0
- package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +8 -0
- package/_vendor/plugin-text/textFonts.d.ts +6 -3
- package/_vendor/plugin-text/textFormatting.d.ts +45 -0
- package/_vendor/plugin-text/textFormattingSession.d.ts +6 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +9 -4
- package/_vendor/plugin-text/textLinkPopoverPresentation.d.ts +18 -0
- package/_vendor/plugin-text/textShapeHelpers.d.ts +1 -0
- package/_vendor/plugin-text/textShapeUtil.d.ts +5 -4
- package/_vendor/signals/effect.d.ts +0 -4
- package/_vendor/signals/index.d.ts +1 -1
- package/_vendor/store/store.d.ts +4 -0
- package/browser/persistence.d.ts +5 -16
- package/builtins/controller/createBuiltInCanvasController.d.ts +2 -0
- package/builtins/controller/packagingController.d.ts +71 -0
- package/builtins/index.d.ts +4 -2
- package/builtins/plugins.d.ts +16 -0
- package/chrome/floating/CanvasKitFloatingPortal.d.ts +6 -0
- package/chrome/floating/useCanvasKitFloatingPosition.d.ts +11 -0
- package/chrome/toolbar/CanvasKitFloatingToolbarLayer.d.ts +1 -1
- package/chrome/toolbar/toolbarLabels.d.ts +1 -1
- package/chrome/toolbar/useToolbarSurfaces.d.ts +6 -10
- package/chrome/types.d.ts +5 -10
- package/chrome/useCanvasKitChromeContext.d.ts +13 -13
- package/chrome/useContextMenuSurface.d.ts +4 -4
- package/chrome/useHistoryControls.d.ts +3 -3
- package/chrome/usePageControls.d.ts +3 -3
- package/controller/canvasKitController.d.ts +5 -9
- package/core/index.d.ts +1 -2
- package/core/product-controller/canvasProductController.d.ts +2 -1
- package/core/runtime/productAssets.d.ts +4 -2
- package/core/runtime/productEditor.d.ts +1 -1
- package/core/runtime/productServices.d.ts +6 -2
- package/core/runtime/runtimeContracts.d.ts +17 -0
- package/es-DocrZgUh.mjs +2 -0
- package/features/actions/actionRuntime.d.ts +2 -7
- package/features/clipboard/clipboardContextMenuContributions.d.ts +1 -1
- package/features/clipboard/clipboardContribution.d.ts +2 -1
- package/features/clipboard/clipboardPlugin.d.ts +1 -0
- package/features/clipboard/clipboardService.d.ts +1 -1
- package/features/context-menu/contextMenuRuntime.d.ts +4 -4
- package/features/image/asset/imageAssetService.d.ts +1 -1
- package/features/image/asset/imageBlobStore.d.ts +6 -2
- package/features/image/controller/imageProductController.d.ts +1 -1
- package/features/image/imageProductPlugin.d.ts +1 -0
- package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
- package/features/image/smudge/imageSmudgeTypes.d.ts +1 -0
- package/features/image/toolbar/imageHostActions.d.ts +13 -2
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/keyboard/keyboardShortcutPlugin.d.ts +1 -0
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +5 -3
- package/features/selection/selectionActions.d.ts +2 -3
- package/features/selection/selectionContextMenuContributions.d.ts +1 -1
- package/features/selection/selectionPlugin.d.ts +1 -0
- package/features/selection/selectionToolbarContributions.d.ts +1 -1
- package/features/text/link/TextLinkHoverPopover.d.ts +6 -0
- package/features/text/textProductPlugin.d.ts +5 -0
- package/features/tool/toolActions.d.ts +1 -1
- package/features/tool/toolContextMenuContributions.d.ts +1 -1
- package/features/tool/toolPlugin.d.ts +1 -0
- package/features/tool/toolToolbarContributions.d.ts +1 -1
- package/features/view/viewActions.d.ts +1 -1
- package/features/view/viewContextMenuContributions.d.ts +1 -1
- package/features/view/viewPlugin.d.ts +1 -0
- package/index.css +1 -1
- package/index.d.ts +23 -9
- package/index.mjs +84 -96
- package/package.json +12 -9
- package/product/standardCanvasKitPlugins.d.ts +4 -0
- package/react/CanvasKitRoot.d.ts +10 -5
- package/react/useCanvasKitControllerLifecycle.d.ts +8 -0
- package/react/useCanvasKitRuntime.d.ts +2 -4
- package/runtime/canvasKitCommandExecutor.d.ts +13 -0
- package/runtime/canvasKitPluginContracts.d.ts +79 -0
- package/runtime/canvasKitPlugins.d.ts +33 -0
- package/runtime/canvasKitRuntime.d.ts +46 -19
- package/runtime/canvasKitRuntimeContracts.d.ts +37 -0
- package/_vendor/canvas-core/editor/createEditorWithRuntimePlugins.d.ts +0 -6
- package/_vendor/canvas-core/editor/middleMousePanInteraction.d.ts +0 -2
- package/_vendor/canvas-core/schema/snapshotSupport.d.ts +0 -43
- package/_vendor/canvas-react/host/actionRegistry.d.ts +0 -15
- package/_vendor/canvas-react/host/canvasRenderPluginHost.d.ts +0 -2
- package/_vendor/canvas-react/host/canvasRenderPluginHostManifest.d.ts +0 -2
- package/_vendor/canvas-react/host/canvasRenderPluginHostRuntime.d.ts +0 -3
- package/_vendor/canvas-react/host/canvasRenderPluginHostTypes.d.ts +0 -104
- package/_vendor/canvas-react/host/canvasRenderPluginHostValidation.d.ts +0 -11
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +0 -17
- package/_vendor/canvas-react/host/extension.d.ts +0 -37
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +0 -20
- package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +0 -14
- package/_vendor/plugin-text/host/RichTextToolbar.d.ts +0 -8
- package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +0 -7
- package/browser/localSnapshotRestore.d.ts +0 -13
- package/builtins/extensions.d.ts +0 -18
- package/core/runtime/productDefinition.d.ts +0 -33
- package/core/runtime/productHost.d.ts +0 -20
- package/features/clipboard/clipboardHostExtension.d.ts +0 -2
- package/features/image/imageHostExtension.d.ts +0 -10
- package/features/keyboard/keyboardShortcutHostExtension.d.ts +0 -2
- package/features/persistence/CanvasKitPersistenceNotice.d.ts +0 -4
- package/features/persistence/persistenceHostExtension.d.ts +0 -2
- package/features/selection/selectionHostExtension.d.ts +0 -2
- package/features/tool/toolHostExtension.d.ts +0 -2
- package/features/view/viewHostExtension.d.ts +0 -2
- package/host/defaultHostExtensions.d.ts +0 -2
- package/product/canvasKitProduct.d.ts +0 -51
- package/react/useCanvasKitController.d.ts +0 -5
- package/react/useCanvasKitStartup.d.ts +0 -9
- package/runtime/canvasKitHostContracts.d.ts +0 -135
- package/runtime/canvasKitHostFeatureHooks.d.ts +0 -12
- package/runtime/canvasKitRuntimePlan.d.ts +0 -50
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Editor } from "./editor";
|
|
2
|
-
export {
|
|
2
|
+
export { createEditorWithPlugins, type CreateEditorWithPluginsOptions, } from "./createEditorWithPlugins";
|
|
3
3
|
export { StateNode } from "./stateNode";
|
|
4
|
-
export { HistoryManager } from "./historyManager";
|
|
4
|
+
export { HistoryManager, type HistoryScope, type HistoryScopeState, type HistoryState, } from "./historyManager";
|
|
5
5
|
export { InputsManager } from "./managers/inputsManager";
|
|
6
6
|
export { QueryManager } from "./managers/queryManager";
|
|
7
7
|
export { ShortcutManager, formatKeyboardShortcut, normalizeKeyboardShortcut, } from "./managers/shortcutManager";
|
|
@@ -2,7 +2,7 @@ import type { ChangeSource } from "../../store/index";
|
|
|
2
2
|
import type { Vec } from "../geometry/vec";
|
|
3
3
|
import type { ShapeId, ShapeRecord } from "../schema/records";
|
|
4
4
|
import type { Editor } from "./editor";
|
|
5
|
-
import type { EditorEvent } from "./events";
|
|
5
|
+
import type { CancelEditorEvent, EditorEvent } from "./events";
|
|
6
6
|
import type { SelectionHandle } from "./selection";
|
|
7
7
|
import type { HandleSnapContext, HandleSnapMode } from "./managers/snapTypes";
|
|
8
8
|
export interface SelectionHandleInteractionInput {
|
|
@@ -18,6 +18,14 @@ export interface SelectionHandleInteractionSession {
|
|
|
18
18
|
readonly allowSelfSnap?: boolean;
|
|
19
19
|
readonly excludedSnapShapeIds?: readonly ShapeId[];
|
|
20
20
|
readonly shouldClearBindingPreviewOnExit?: boolean;
|
|
21
|
+
onClick?(input: {
|
|
22
|
+
editor: Editor;
|
|
23
|
+
source: ChangeSource;
|
|
24
|
+
}): void;
|
|
25
|
+
onCancel?(input: {
|
|
26
|
+
editor: Editor;
|
|
27
|
+
reason: CancelEditorEvent["reason"];
|
|
28
|
+
}): void;
|
|
21
29
|
update(input: {
|
|
22
30
|
editor: Editor;
|
|
23
31
|
pagePoint: Vec;
|
|
@@ -47,5 +55,6 @@ export declare class InteractionHandlerRegistry {
|
|
|
47
55
|
register(handler: LandInteractionHandler): void;
|
|
48
56
|
getHandlers(): readonly LandInteractionHandler[];
|
|
49
57
|
handleEvent(editor: Editor, event: EditorEvent): EditorEventInteractionDecision;
|
|
58
|
+
broadcastEvent(editor: Editor, event: EditorEvent): void;
|
|
50
59
|
createSelectionHandleSession(editor: Editor, input: SelectionHandleInteractionInput): SelectionHandleInteractionSession | null;
|
|
51
60
|
}
|
|
@@ -19,6 +19,7 @@ export declare class BindingManager {
|
|
|
19
19
|
handleShapeChanges(changes: ShapeChangeEntry[], source: ChangeSource, options?: {
|
|
20
20
|
skipBindingIds?: ReadonlySet<BindingId>;
|
|
21
21
|
}): void;
|
|
22
|
+
getShapeHierarchyRootId(shapeId: ShapeId): ShapeId;
|
|
22
23
|
cleanupBindingsForDeletedShapes(ids: ShapeId[], source: ChangeSource): void;
|
|
23
24
|
cleanupBindings(ids: BindingId[], source: ChangeSource): void;
|
|
24
25
|
private applyEffect;
|
|
@@ -25,6 +25,8 @@ export interface InputsState {
|
|
|
25
25
|
accelKey: boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare class InputsManager {
|
|
28
|
+
readonly pressedKeyCodes: import("../../../signals/index").Atom<ReadonlySet<string>>;
|
|
29
|
+
readonly isSpacePressed: import("../../../signals/index").Computed<boolean>;
|
|
28
30
|
readonly state: import("../../../signals/index").Atom<InputsState>;
|
|
29
31
|
setCurrentPointerPoint(input: {
|
|
30
32
|
timestamp: number;
|
|
@@ -40,5 +42,6 @@ export declare class InputsManager {
|
|
|
40
42
|
resetPointer(): void;
|
|
41
43
|
private handlePointerEvent;
|
|
42
44
|
private handleKeyboardEvent;
|
|
45
|
+
private resetKeyboard;
|
|
43
46
|
private handleWheelEvent;
|
|
44
47
|
}
|
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
import { type Signal } from "../../../signals/index";
|
|
2
2
|
import { type TerminalBindingResolver, type TerminalBindingResolverInput, type ResolvedTerminalBinding } from "../../bindings/terminalBinding";
|
|
3
3
|
import type { Box } from "../../geometry/box";
|
|
4
|
-
import type { Vec } from "../../geometry/vec";
|
|
5
4
|
import type { ShapeId } from "../../schema/records";
|
|
6
5
|
import type { Editor } from "../editor";
|
|
7
6
|
import type { BindingPreviewState, SnapIndicatorState, TerminalBindingGuideState } from "../selection";
|
|
8
|
-
export interface LaserTrailState {
|
|
9
|
-
sessionId: number;
|
|
10
|
-
phase: "active" | "ending";
|
|
11
|
-
points: Vec[];
|
|
12
|
-
}
|
|
13
7
|
export declare class InteractionTransientManager {
|
|
14
8
|
private readonly editor;
|
|
15
9
|
private readonly _brushBoxSignal;
|
|
16
10
|
readonly brushBoxSignal: Signal<Box | null>;
|
|
17
11
|
readonly brushBoxActiveSignal: import("../../../signals/index").Computed<boolean>;
|
|
18
|
-
private readonly _erasingShapeIdsSignal;
|
|
19
|
-
readonly erasingShapeIdsSignal: Signal<ShapeId[]>;
|
|
20
|
-
readonly erasingShapeIdsActiveSignal: import("../../../signals/index").Computed<boolean>;
|
|
21
|
-
private readonly _eraserTrailSignal;
|
|
22
|
-
readonly eraserTrailSignal: Signal<Vec[]>;
|
|
23
|
-
readonly eraserTrailActiveSignal: import("../../../signals/index").Computed<boolean>;
|
|
24
|
-
private readonly _laserTrailSignal;
|
|
25
|
-
readonly laserTrailSignal: Signal<LaserTrailState | null>;
|
|
26
|
-
readonly laserTrailActiveSignal: import("../../../signals/index").Computed<boolean>;
|
|
27
|
-
private nextLaserSessionId;
|
|
28
12
|
private readonly _bindingPreviewSignal;
|
|
29
13
|
readonly bindingPreviewSignal: Signal<BindingPreviewState | null>;
|
|
30
14
|
readonly bindingPreviewActiveSignal: import("../../../signals/index").Computed<boolean>;
|
|
@@ -39,16 +23,6 @@ export declare class InteractionTransientManager {
|
|
|
39
23
|
private terminalBindingResolver;
|
|
40
24
|
constructor(editor: Editor);
|
|
41
25
|
setBrushBox(brushBox: Box | null): void;
|
|
42
|
-
getErasingShapeIds(): ShapeId[];
|
|
43
|
-
setErasingShapeIds(shapeIds: readonly ShapeId[]): void;
|
|
44
|
-
clearErasingShapeIds(): void;
|
|
45
|
-
getEraserTrail(): Vec[];
|
|
46
|
-
setEraserTrail(points: readonly Vec[]): void;
|
|
47
|
-
clearEraserTrail(): void;
|
|
48
|
-
startLaserTrail(): number;
|
|
49
|
-
setLaserTrail(sessionId: number, points: readonly Vec[]): void;
|
|
50
|
-
finishLaserTrail(sessionId: number): void;
|
|
51
|
-
clearLaserTrail(sessionId: number): void;
|
|
52
26
|
setBindingPreview(preview: BindingPreviewState | null): void;
|
|
53
27
|
setTerminalBindingGuides(guides: readonly TerminalBindingGuideState[] | null): void;
|
|
54
28
|
setDropTargetShapeId(shapeId: ShapeId | null): void;
|
|
@@ -8,11 +8,17 @@ import { type ShapeGeometry } from "../queries/shapeTransforms";
|
|
|
8
8
|
import { type QueryState } from "./queryState";
|
|
9
9
|
import { type SelectionGeometrySnapshot } from "./selectionGeometry";
|
|
10
10
|
export type ShapeContainment = "inside" | "intersecting" | "outside";
|
|
11
|
+
export interface ShapeHierarchySnapshotEntry {
|
|
12
|
+
id: ShapeId;
|
|
13
|
+
parentId: ShapeParentId;
|
|
14
|
+
type: ShapeRecord["type"];
|
|
15
|
+
}
|
|
11
16
|
export declare class QueryManager {
|
|
12
17
|
private readonly editor;
|
|
13
18
|
readonly stateSignal: Signal<QueryState>;
|
|
14
19
|
readonly currentPageShapeIdsSignal: Signal<ShapeId[]>;
|
|
15
20
|
readonly currentPageShapesSignal: Signal<ShapeRecord[]>;
|
|
21
|
+
readonly currentPageShapeHierarchySignal: Signal<ShapeHierarchySnapshotEntry[]>;
|
|
16
22
|
readonly selectionGeometrySignal: Signal<SelectionGeometrySnapshot>;
|
|
17
23
|
readonly selectionPageOutlineVerticesSignal: Signal<Vec[]>;
|
|
18
24
|
readonly selectionPageBoundsSignal: Signal<Box | null>;
|
|
@@ -48,13 +54,19 @@ export declare class QueryManager {
|
|
|
48
54
|
private getShapeIdsForPageSnapshot;
|
|
49
55
|
private getChildShapeIdsSnapshot;
|
|
50
56
|
private handleStoreChange;
|
|
57
|
+
private getShapeLocalToPageTransformSnapshot;
|
|
58
|
+
private getShapeParentToPageTransformSnapshot;
|
|
51
59
|
private getShapeQuerySignals;
|
|
52
60
|
private getShapeGeometrySnapshot;
|
|
53
61
|
getShapePageBoundsSignal(shapeId: ShapeId): Signal<Box | undefined>;
|
|
62
|
+
getShapeLocalToPageTransformSignal(shapeId: ShapeId): Signal<Mat | undefined>;
|
|
54
63
|
getShapeGeometry(shapeId: ShapeId): ShapeGeometry | undefined;
|
|
64
|
+
getShapeLocalToPageTransform(shapeId: ShapeId): Mat | undefined;
|
|
65
|
+
getShapeParentToPageTransform(parentId: ShapeParentId): Mat | undefined;
|
|
66
|
+
getShapePageToParentTransform(parentId: ShapeParentId): Mat | undefined;
|
|
55
67
|
getShapePositionedToPageTransform(shapeId: ShapeId): Mat | undefined;
|
|
56
68
|
getShapePageBounds(shapeId: ShapeId): Box | undefined;
|
|
57
|
-
|
|
69
|
+
getShapePositionedBounds(shapeId: ShapeId): Box | undefined;
|
|
58
70
|
getShapePageCenter(shapeId: ShapeId): Vec | undefined;
|
|
59
71
|
getShapePageCorners(shapeId: ShapeId): Vec[] | undefined;
|
|
60
72
|
getShapePageOutlineVertices(shapeId: ShapeId): Vec[] | undefined;
|
|
@@ -12,7 +12,8 @@ import type { SelectionFrame } from "../selection";
|
|
|
12
12
|
export declare class ShapeGeometryManager {
|
|
13
13
|
private readonly editor;
|
|
14
14
|
constructor(editor: Editor);
|
|
15
|
-
|
|
15
|
+
private computeParentToPageTransform;
|
|
16
|
+
computeShapePositionedBounds(shape: ShapeRecord): Box;
|
|
16
17
|
computeShapeLocalBounds(shape: ShapeRecord): Box;
|
|
17
18
|
computeShapeRenderBounds(shape: ShapeRecord): Box;
|
|
18
19
|
computeShapeExportBounds(shape: ShapeRecord): Box;
|
|
@@ -26,7 +27,7 @@ export declare class ShapeGeometryManager {
|
|
|
26
27
|
computeShapePageCenter(shape: ShapeRecord): Vec;
|
|
27
28
|
computeShapePageCorners(shape: ShapeRecord): Vec[];
|
|
28
29
|
computeShapePageOutlineVertices(shape: ShapeRecord): Vec[];
|
|
29
|
-
|
|
30
|
+
getShapePositionedBounds(shapeId: ShapeId): Box | null;
|
|
30
31
|
getShapePageBounds(shapeId: ShapeId): Box | null;
|
|
31
32
|
getShapeGeometry(shapeId: ShapeId): ShapeGeometry | null;
|
|
32
33
|
getShapePositionedToPageTransform(shapeId: ShapeId): Mat | null;
|
|
@@ -17,6 +17,7 @@ export declare class ShapeHierarchyManager {
|
|
|
17
17
|
getSelectionGroupState(): ShapeGroupState | null;
|
|
18
18
|
canGroupSelection(): boolean;
|
|
19
19
|
private getGroupStateForShapeIds;
|
|
20
|
+
private getGroupingShapeCreateInput;
|
|
20
21
|
private groupShapesFromState;
|
|
21
22
|
canGroupShapes(ids: readonly ShapeId[]): boolean;
|
|
22
23
|
groupShapes(ids: readonly ShapeId[], source?: ChangeSource): ShapeRecord | null;
|
|
@@ -37,7 +38,6 @@ export declare class ShapeHierarchyManager {
|
|
|
37
38
|
moveShapesInParentOrder(ids: readonly ShapeId[], direction: LayerOrderDirection, source?: ChangeSource): boolean;
|
|
38
39
|
moveShapesToParentOrderEdge(ids: readonly ShapeId[], edge: LayerOrderEdge, source?: ChangeSource): boolean;
|
|
39
40
|
moveSelectionWithinParent(direction: ShapeSiblingOrderDirection, source?: ChangeSource): boolean;
|
|
40
|
-
moveShapesToParentPlacement(input: ReparentShapePlacementInput, source?: ChangeSource): boolean;
|
|
41
41
|
moveShapesToParentPlacementResult(input: ReparentShapePlacementInput, source?: ChangeSource): ReparentShapePlacementResult;
|
|
42
42
|
moveSelectionInParentOrder(direction: ShapeSiblingOrderDirection, source?: ChangeSource): boolean;
|
|
43
43
|
moveSelectionToParentOrderEdge(edge: ShapeSiblingOrderEdge, source?: ChangeSource): boolean;
|
|
@@ -48,11 +48,15 @@ export declare class ShapeHierarchyManager {
|
|
|
48
48
|
getShapeIdsForSelectionTransform(shapeIds: Iterable<ShapeId>): ShapeId[];
|
|
49
49
|
getShapeIdsForSelectionRotation(shapeIds: Iterable<ShapeId>): ShapeId[];
|
|
50
50
|
getSelectionTransformTargetShapes(): ShapeRecord[];
|
|
51
|
+
canResizeSelection(): boolean;
|
|
52
|
+
canRotateSelection(): boolean;
|
|
53
|
+
getSelectionResizeTargetShapes(): ShapeRecord[];
|
|
51
54
|
getSelectionRotationTargetShapes(): ShapeRecord[];
|
|
55
|
+
private getSelectionTransformAffectedShapes;
|
|
52
56
|
getShapeExportTraversalIds(shapeIds: Iterable<ShapeId>): ShapeId[];
|
|
53
57
|
getShapeIdsInContainerBounds(containerId: ShapeId, options?: ContainerBoundsQueryOptions): ShapeId[];
|
|
54
58
|
canUseShapeParent(parentId: ShapeParentId, childId?: ShapeId): boolean;
|
|
55
59
|
isShapeOrAncestorInSet(shapeId: ShapeId, ids: ReadonlySet<ShapeId>): boolean;
|
|
56
60
|
isShapeDescendantOf(shapeId: ShapeId, ancestorId: ShapeId): boolean;
|
|
57
|
-
private
|
|
61
|
+
private getOutermostUnlockedShapeIds;
|
|
58
62
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ChangeSource } from "../../../store/index";
|
|
2
|
-
import type { ShapeId, ShapeParentId } from "../../schema/records";
|
|
2
|
+
import type { ShapeId, ShapeParentId, ShapeRecord } from "../../schema/records";
|
|
3
3
|
import type { Editor, ReparentShapePlacementInput, ReparentShapePlacementResult } from "../editor";
|
|
4
|
+
import { type ShapeTransformFields } from "../queries/shapeTransforms";
|
|
4
5
|
export declare function canUseShapeParent(editor: Editor, parentId: ShapeParentId, childId?: ShapeId): boolean;
|
|
5
|
-
export declare function moveShapesToParentPlacement(editor: Editor, input: ReparentShapePlacementInput, source?: ChangeSource): boolean;
|
|
6
6
|
export declare function moveShapesToParentPlacementResult(editor: Editor, input: ReparentShapePlacementInput, source?: ChangeSource): ReparentShapePlacementResult;
|
|
7
|
+
export declare function getReparentedShapeTransformUpdate(editor: Editor, shape: ShapeRecord, parentId: ShapeParentId): ShapeTransformFields | null;
|
|
@@ -26,6 +26,7 @@ export declare class SpatialIndexManager {
|
|
|
26
26
|
getShapeAtPoint(point: Vec, options?: ShapeAtPointOptions): ShapeRecord | null;
|
|
27
27
|
getShapesAtPoint(point: Vec, options?: ShapeAtPointOptions): ShapeRecord[];
|
|
28
28
|
getShapesHitByLineSegment(start: Vec, end: Vec, options?: ShapeLineSegmentHitTestOptions): ShapeRecord[];
|
|
29
|
+
private doesLineSegmentIntersectShapeClip;
|
|
29
30
|
private getPageIndexSignal;
|
|
30
31
|
private getPageIndex;
|
|
31
32
|
}
|
|
@@ -9,19 +9,39 @@ export interface ShapeGeometry {
|
|
|
9
9
|
corners: Vec[];
|
|
10
10
|
outlineVertices: Vec[];
|
|
11
11
|
}
|
|
12
|
+
export interface ShapeTransformFields {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
rotation: number;
|
|
16
|
+
skewX: number;
|
|
17
|
+
scaleX: number;
|
|
18
|
+
scaleY: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ShapeTransformDecompositionOptions {
|
|
21
|
+
epsilon?: number;
|
|
22
|
+
preferredRotation?: number;
|
|
23
|
+
preferredScaleXSign?: number;
|
|
24
|
+
preferredScaleYSign?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Decompose a shape's local-to-parent affine transform into its canonical
|
|
28
|
+
* translate/rotate/skewX/scale record fields. Axis-collapsed transforms remain
|
|
29
|
+
* representable; unsupported rank-one shears return null.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getShapeTransformFieldsFromMatrix(matrix: Mat, localBounds: Box, options?: ShapeTransformDecompositionOptions): ShapeTransformFields | null;
|
|
12
32
|
export declare function getShapeLocalBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
|
|
13
33
|
export declare function getShapeRenderBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
|
|
14
34
|
export declare function getShapeExportBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
|
|
15
|
-
export declare function getShapeLocalToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
16
|
-
export declare function getShapePositionedToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
17
|
-
export declare function getShapeRenderToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
18
|
-
export declare function getShapeExportToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
19
|
-
export declare function getShapePageCenter<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
20
|
-
export declare function positionedShapePointToPagePoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S
|
|
21
|
-
export declare function pagePointToShapePositionedPoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S
|
|
35
|
+
export declare function getShapeLocalToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
|
|
36
|
+
export declare function getShapePositionedToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
|
|
37
|
+
export declare function getShapeRenderToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
|
|
38
|
+
export declare function getShapeExportToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
|
|
39
|
+
export declare function getShapePageCenter<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
|
|
40
|
+
export declare function positionedShapePointToPagePoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
|
|
41
|
+
export declare function pagePointToShapePositionedPoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
|
|
22
42
|
export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Vec[];
|
|
23
|
-
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
24
|
-
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
25
|
-
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
26
|
-
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
27
|
-
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S
|
|
43
|
+
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec[];
|
|
44
|
+
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec[];
|
|
45
|
+
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Box;
|
|
46
|
+
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Box;
|
|
47
|
+
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): ShapeGeometry;
|
|
@@ -3,6 +3,12 @@ import { Vec } from "../geometry/vec";
|
|
|
3
3
|
import type { ConnectionTerminal } from "../bindings/terminalBinding";
|
|
4
4
|
import type { ShapeId, ShapeRecord } from "../schema/records";
|
|
5
5
|
export type SelectionResizeHandleId = "top_left" | "top" | "top_right" | "right" | "bottom_right" | "bottom" | "bottom_left" | "left";
|
|
6
|
+
export declare const SELECTION_RESIZE_HANDLE_IDS: readonly ["top_left", "top", "top_right", "right", "bottom_right", "bottom", "bottom_left", "left"];
|
|
7
|
+
export declare const SELECTION_RESIZE_CORNER_HANDLE_IDS: readonly ["top_left", "top_right", "bottom_right", "bottom_left"];
|
|
8
|
+
export type SelectionResizeMode = "free" | "aspect_ratio_locked";
|
|
9
|
+
export declare const SELECTION_RESIZE_ALL_MODES: readonly ["free", "aspect_ratio_locked"];
|
|
10
|
+
export declare const SELECTION_RESIZE_FREE_ONLY_MODES: readonly ["free"];
|
|
11
|
+
export declare const SELECTION_RESIZE_ASPECT_RATIO_LOCKED_ONLY_MODES: readonly ["aspect_ratio_locked"];
|
|
6
12
|
export type SelectionRotateHandleId = "top_left_rotate" | "top_right_rotate" | "bottom_right_rotate" | "bottom_left_rotate";
|
|
7
13
|
export interface SelectionResizeHandle {
|
|
8
14
|
kind: "resize";
|
|
@@ -71,25 +77,29 @@ export interface SelectionFrame extends SelectionRotationTransform {
|
|
|
71
77
|
}
|
|
72
78
|
export interface SelectionResizeShapeSnapshot {
|
|
73
79
|
shape: ShapeRecord;
|
|
80
|
+
pageShape: ShapeRecord;
|
|
74
81
|
localBounds: Box;
|
|
75
82
|
rotation: number;
|
|
76
83
|
}
|
|
77
84
|
export interface SelectionResizePointShapeSnapshot {
|
|
78
85
|
shape: ShapeRecord;
|
|
86
|
+
pageShape: ShapeRecord;
|
|
79
87
|
startLocalPagePoint: Vec;
|
|
80
88
|
endLocalPagePoint: Vec;
|
|
89
|
+
middleLocalPagePoint: Vec | null;
|
|
81
90
|
}
|
|
82
91
|
export interface SelectionRotateShapeSnapshot {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
y: number;
|
|
92
|
+
shape: ShapeRecord;
|
|
93
|
+
pageShape: ShapeRecord;
|
|
86
94
|
localBounds: Box;
|
|
87
95
|
rotation: number;
|
|
88
96
|
}
|
|
89
97
|
export interface SelectionRotatePointShapeSnapshot {
|
|
90
98
|
shape: ShapeRecord;
|
|
99
|
+
pageShape: ShapeRecord;
|
|
91
100
|
startPagePoint: Vec;
|
|
92
101
|
endPagePoint: Vec;
|
|
102
|
+
middlePagePoint: Vec | null;
|
|
93
103
|
}
|
|
94
104
|
export interface SelectionResizeSnapshot extends SelectionRotationTransform {
|
|
95
105
|
startBounds: Box;
|
|
@@ -221,15 +231,19 @@ export declare function getSelectionLocalBoundsFromPagePoints({ points, transfor
|
|
|
221
231
|
points: readonly Vec[];
|
|
222
232
|
transform: SelectionRotationTransform;
|
|
223
233
|
}): Box | null;
|
|
224
|
-
export declare function getSelectionResizeSnapshot({ shapes, selectionFrame, getShapeSelectionResizePageOutlineVertices, getShapeSelectionPagePoints, }: {
|
|
234
|
+
export declare function getSelectionResizeSnapshot({ shapes, selectionFrame, getShapeSelectionResizePageOutlineVertices, getShapeSelectionPagePoints, getShapeSelectionPageMiddlePoint, getShapePageRecord, }: {
|
|
225
235
|
shapes: ShapeRecord[];
|
|
226
236
|
selectionFrame: SelectionFrame;
|
|
227
237
|
getShapeSelectionResizePageOutlineVertices: (shape: ShapeRecord) => Vec[];
|
|
228
238
|
getShapeSelectionPagePoints: (shape: ShapeRecord) => readonly [Vec, Vec] | null;
|
|
239
|
+
getShapeSelectionPageMiddlePoint: (shape: ShapeRecord) => Vec | null;
|
|
240
|
+
getShapePageRecord: (shape: ShapeRecord) => ShapeRecord;
|
|
229
241
|
}): SelectionResizeSnapshot;
|
|
230
|
-
export declare function getSelectionRotateSnapshot({ shapes, selectionFrame, getShapeLocalBounds, getShapeSelectionPagePoints, }: {
|
|
242
|
+
export declare function getSelectionRotateSnapshot({ shapes, selectionFrame, getShapeLocalBounds, getShapeSelectionPagePoints, getShapeSelectionPageMiddlePoint, getShapePageRecord, }: {
|
|
231
243
|
shapes: ShapeRecord[];
|
|
232
244
|
selectionFrame: SelectionFrame;
|
|
233
245
|
getShapeLocalBounds: (shape: ShapeRecord) => Box;
|
|
234
246
|
getShapeSelectionPagePoints: (shape: ShapeRecord) => readonly [Vec, Vec] | null;
|
|
247
|
+
getShapeSelectionPageMiddlePoint: (shape: ShapeRecord) => Vec | null;
|
|
248
|
+
getShapePageRecord: (shape: ShapeRecord) => ShapeRecord;
|
|
235
249
|
}): SelectionRotateSnapshot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vec } from "../geometry/vec";
|
|
2
2
|
import type { ShapeId, ShapeRecord } from "../schema/records";
|
|
3
3
|
import type { ShapeSelectionHandleAnchors } from "../shapes/shapeUtil";
|
|
4
|
-
import type
|
|
4
|
+
import { type SelectionBindingMiddleHandle, type SelectionBindingSegment, type SelectionBindingTerminalHandle, type SelectionCustomHandle, type SelectionFrame, type SelectionOverlayFrameGeometryState, type SelectionOverlayFrameState, type SelectionOverlayFrameStyleState, type SelectionOverlayHandleAnchorsState, type SelectionOverlayHandleCountsState, type SelectionOverlayHandlesState, type SelectionResizeHandle, type SelectionResizeHandleId, type SelectionRotateHandle } from "./selection";
|
|
5
5
|
export interface SelectedShapeOverlayItem {
|
|
6
6
|
id: ShapeId;
|
|
7
7
|
usesSelectionPathOverlay: boolean;
|
|
@@ -18,6 +18,7 @@ export interface SelectionHandleState {
|
|
|
18
18
|
middleHandles: SelectionBindingMiddleHandle[];
|
|
19
19
|
customHandles: SelectionCustomHandle[];
|
|
20
20
|
}
|
|
21
|
+
export declare function hitTestSelectionResizeBorder(point: Vec, selectionFrame: SelectionFrame, resizeHandles: readonly SelectionResizeHandle[], hitDistance: number): SelectionResizeHandle | null;
|
|
21
22
|
export declare function areSelectedShapeOverlayItemsEqual(a: SelectedShapeOverlayItem[], b: SelectedShapeOverlayItem[]): boolean;
|
|
22
23
|
export declare function areSelectionOverlayFrameStatesEqual(a: SelectionOverlayFrameState | null, b: SelectionOverlayFrameState | null): boolean;
|
|
23
24
|
export declare function areSelectionOverlayFrameGeometryStatesEqual(a: SelectionOverlayFrameGeometryState | null, b: SelectionOverlayFrameGeometryState | null): boolean;
|
|
@@ -27,6 +28,6 @@ export declare function areSelectionOverlayHandlesStatesEqual(a: SelectionOverla
|
|
|
27
28
|
export declare function areSelectionOverlayHandleAnchorsStatesEqual(a: SelectionOverlayHandleAnchorsState | null, b: SelectionOverlayHandleAnchorsState | null): boolean;
|
|
28
29
|
export declare function areSelectionOverlayHandleCountsStatesEqual(a: SelectionOverlayHandleCountsState | null, b: SelectionOverlayHandleCountsState | null): boolean;
|
|
29
30
|
export declare function isSingleSelectionPathOverlay(selectedShapeItems: SelectedShapeOverlayItem[]): boolean;
|
|
30
|
-
export declare function getSelectionHandleAnchorsState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors,
|
|
31
|
+
export declare function getSelectionHandleAnchorsState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionResizeHandles: (shape: ShapeRecord) => boolean, canUseSelectionRotateHandle: (shape: ShapeRecord) => boolean, resizeHandleIds: readonly SelectionResizeHandleId[]): SelectionOverlayHandleAnchorsState;
|
|
31
32
|
export declare function materializeSelectionHandleState(anchors: SelectionOverlayHandleAnchorsState, zoom: number): SelectionHandleState;
|
|
32
|
-
export declare function getSelectionHandleState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors,
|
|
33
|
+
export declare function getSelectionHandleState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionResizeHandles: (shape: ShapeRecord) => boolean, canUseSelectionRotateHandle: (shape: ShapeRecord) => boolean, resizeHandleIds: readonly SelectionResizeHandleId[]): SelectionHandleState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ShapeRecord } from "../schema/records";
|
|
2
|
+
import type { Editor } from "./editor";
|
|
3
|
+
import { type SelectionResizeHandleId, type SelectionResizeMode } from "./selection";
|
|
4
|
+
export declare function areSelectionResizeRotationsCompatible(left: number, right: number): boolean;
|
|
5
|
+
export declare function areSelectionResizeTargetRotationsCompatible(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], selectionRotation: number): boolean;
|
|
6
|
+
export declare function intersectSelectionResizeModes(modeSets: readonly (readonly SelectionResizeMode[])[]): SelectionResizeMode[];
|
|
7
|
+
export declare function getCommonSelectionResizeModesForHandle(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], handleId: SelectionResizeHandleId, selectionRotation: number): SelectionResizeMode[];
|
|
8
|
+
export declare function getCommonSelectionResizeHandleIds(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], selectionRotation: number): SelectionResizeHandleId[];
|
|
9
|
+
export declare function resolveSelectionResizeMode(allowedModes: readonly SelectionResizeMode[], shiftKey: boolean): SelectionResizeMode | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ShapeRecord } from "../schema/records";
|
|
2
|
+
import type { ShapeUpdate } from "./commands";
|
|
3
|
+
import type { Editor } from "./editor";
|
|
4
|
+
export declare function getShapePageSpaceRecord(editor: Editor, shape: ShapeRecord): ShapeRecord;
|
|
5
|
+
export declare function tryGetShapePageSpaceRecord(editor: Editor, shape: ShapeRecord): ShapeRecord | null;
|
|
6
|
+
export declare function getShapeParentLocalUpdateFromPageSpace(editor: Editor, shape: ShapeRecord, pageShape: ShapeRecord, pageUpdate: ShapeUpdate): ShapeUpdate | null;
|
|
@@ -20,6 +20,7 @@ export type SvgThemeColorResolver = (token: ThemeColorTokenName, fallback: strin
|
|
|
20
20
|
export interface ShapeSvgExporter<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
21
21
|
type: S["type"];
|
|
22
22
|
toSvg(shape: S, context: SvgExportContext): SvgNode | null;
|
|
23
|
+
toSvgForeground?(shape: S, context: SvgExportContext): SvgNode | null;
|
|
23
24
|
}
|
|
24
25
|
export interface SvgExportOptions {
|
|
25
26
|
padding?: number;
|
|
@@ -5,4 +5,5 @@ export { Geometry2d } from "./geometry2d";
|
|
|
5
5
|
export { Rectangle2d } from "./rectangle2d";
|
|
6
6
|
export { Ellipse2d } from "./ellipse2d";
|
|
7
7
|
export { Polyline2d } from "./polyline2d";
|
|
8
|
+
export { doesLineSegmentIntersectPolygon, getPolygonsBounds, isPointInPolygon, isPointInPolygons, isValidPolygon, } from "./polygon";
|
|
8
9
|
export { distanceBetweenSegments, distanceToSegment, nearestPointOnSegment, segmentsIntersect, } from "./segments";
|
|
@@ -16,13 +16,17 @@ export declare class Mat {
|
|
|
16
16
|
static Identity(): Mat;
|
|
17
17
|
static Translate(x: number, y: number): Mat;
|
|
18
18
|
static Rotate(angle: number): Mat;
|
|
19
|
+
static SkewX(angle: number): Mat;
|
|
19
20
|
static Scale(sx: number, sy: number): Mat;
|
|
20
21
|
/** Compose: this × other */
|
|
21
22
|
compose(other: Mat): Mat;
|
|
22
23
|
applyToPoint(p: Vec): Vec;
|
|
24
|
+
determinant(): number;
|
|
25
|
+
getMaximumLinearScale(): number;
|
|
26
|
+
tryInvert(epsilon?: number): Mat | null;
|
|
23
27
|
invert(): Mat;
|
|
24
28
|
toCssString(): string;
|
|
25
29
|
toSvgString(): string;
|
|
26
|
-
/** Create a transform for a shape: translate
|
|
27
|
-
static ForShape(x: number, y: number, rotation: number, scaleX?: number, scaleY?: number): Mat;
|
|
30
|
+
/** Create a transform for a shape: translate * rotate * skewX * scale. */
|
|
31
|
+
static ForShape(x: number, y: number, rotation: number, scaleX?: number, scaleY?: number, skewX?: number): Mat;
|
|
28
32
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Box } from "./box";
|
|
2
|
+
import { Vec } from "./vec";
|
|
3
|
+
export declare function isValidPolygon(polygon: readonly Vec[]): boolean;
|
|
4
|
+
export declare function getPolygonsBounds(polygons: readonly (readonly Vec[])[]): Box | null;
|
|
5
|
+
export declare function isPointInPolygon(point: Vec, polygon: readonly Vec[]): boolean;
|
|
6
|
+
export declare function isPointInPolygons(point: Vec, polygons: readonly (readonly Vec[])[]): boolean;
|
|
7
|
+
export declare function doesLineSegmentIntersectPolygon(start: Vec, end: Vec, polygon: readonly Vec[], margin?: number): boolean;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export { Editor } from "./editor/editor";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export type {
|
|
7
|
-
export {
|
|
2
|
+
export { createEditorWithPlugins, type CreateEditorWithPluginsOptions, } from "./editor/createEditorWithPlugins";
|
|
3
|
+
export { HistoryManager, type HistoryScope, type HistoryScopeState, type HistoryState, } from "./editor/historyManager";
|
|
4
|
+
export { doesLineSegmentIntersectPolygon, distanceBetweenSegments, distanceToSegment, getPolygonsBounds, isPointInPolygon, isPointInPolygons, isValidPolygon, nearestPointOnSegment, segmentsIntersect, } from "./geometry";
|
|
5
|
+
export { getShapeGeometry, getShapeExportBounds, getShapeExportPageBounds, getShapeExportToPageTransform, getShapeLocalBounds, getShapeLocalToPageTransform, getShapeTransformFieldsFromMatrix, getShapePositionedOutlineVertices, getShapePositionedToPageTransform, getShapePageBounds, getShapePageCenter, getShapePageCorners, getShapePageOutlineVertices, pagePointToShapePositionedPoint, positionedShapePointToPagePoint, getShapeRenderBounds, getShapeRenderToPageTransform, } from "./editor/queries/shapeTransforms";
|
|
6
|
+
export type { ShapeGeometry, ShapeTransformDecompositionOptions, ShapeTransformFields, } from "./editor/queries/shapeTransforms";
|
|
7
|
+
export type { BindingPreviewState, GapSnapIndicatorGapState, GapSnapIndicatorState, PointSnapIndicatorState, SnapIndicatorState, SelectionBindingSegment, TerminalBindingGuideState, SelectionBindingMiddleHandle, SelectionBindingMiddleHandleAnchor, SelectionBindingTerminalHandle, SelectionBindingTerminalHandleAnchor, SelectionCustomHandle, SelectionCustomHandleAnchor, SelectionHandle, SelectionOverlayFrameState, SelectionOverlayFrameGeometryState, SelectionOverlayFrameStyleState, SelectionOverlayHandleAnchorsState, SelectionOverlayHandleCountsState, SelectionOverlayHandlesState, SelectionOverlayState, SelectionResizeHandle, SelectionResizeHandleAnchor, SelectionResizeHandleId, SelectionResizeMode, SelectionRotateHandle, SelectionRotateHandleAnchor, SelectionRotateHandleId, SelectionMirrorAxis, } from "./editor/selection";
|
|
8
|
+
export { SELECTION_RESIZE_ALL_MODES, SELECTION_RESIZE_ASPECT_RATIO_LOCKED_ONLY_MODES, SELECTION_RESIZE_CORNER_HANDLE_IDS, SELECTION_RESIZE_FREE_ONLY_MODES, SELECTION_RESIZE_HANDLE_IDS, flipSelectionLocalBounds, getSelectionLocalBoundsFromPagePoints, mapSelectionLocalBoundsBetweenBounds, mapSelectionLocalPointBetweenBounds, mirrorSelectionLocalPoint, rotateSelectionPagePoint, selectionLocalPointToPagePoint, selectionPagePointToLocalPoint, } from "./editor/selection";
|
|
8
9
|
export { getAnchoredSelectionResizeLocalBounds, getAspectRatioLockedSelectionResizeBounds, getCenteredSelectionResizeBounds, getConstrainedSelectionResizeBounds, getSelectionResizeBounds, getSelectionResizeScalesFromBounds, isSelectionResizeCorner, normalizeSelectionResizeBoundsFromEdges, selectionResizeHandleMovesBottomEdge, selectionResizeHandleMovesLeftEdge, selectionResizeHandleMovesRightEdge, selectionResizeHandleMovesTopEdge, } from "./editor/resizeGeometry";
|
|
9
10
|
export { InteractionHandlerRegistry } from "./editor/interactions";
|
|
10
11
|
export { SelectionHandleInteractionRegistry } from "./editor/selectionHandleInteractions";
|
|
11
12
|
export { ShortcutManager, formatKeyboardShortcut, normalizeKeyboardShortcut, } from "./editor/managers/shortcutManager";
|
|
12
13
|
export type { EditorEventInteractionDecision, EditorEventInteractionHandler, LandInteractionHandler, SelectionHandleInteractionHandler, SelectionHandleInteractionInput, SelectionHandleInteractionSession, SelectionHandleInteractionUpdateResult, } from "./editor/interactions";
|
|
13
14
|
export type { EditorKeyboardShortcutCommand, KeyboardShortcutBinding, KeyboardShortcutChord, KeyboardShortcutEventLike, KeyboardShortcutInput, KeyboardShortcutTarget, } from "./editor/managers/shortcutManager";
|
|
14
|
-
export type { ContainerBoundsQueryOptions, EditorPageState, EditorOverlayDebugState, EditorRenderHostDebugState, EditorSelectionState, LayerOrderDirection, LayerOrderEdge, ReparentShapePlacementInput, ReparentShapePlacementFailureReason, ReparentShapePlacementResult, ShapeSiblingOrderDirection, ShapeSiblingOrderEdge, ShapeSiblingOrderState, ShapeGroupState, ShapeSelectionSiblingOrderState, ShapePropsPatch, EditorToolState, EditorShapeEditingState, } from "./editor/editor";
|
|
15
|
+
export type { ContainerBoundsQueryOptions, EditorPageState, EditorOverlayDebugState, EditorRenderHostDebugState, EditorSelectionMetadata, EditorSelectionState, LayerOrderDirection, LayerOrderEdge, ReparentShapePlacementInput, ReparentShapePlacementFailureReason, ReparentShapePlacementResult, ShapeSiblingOrderDirection, ShapeSiblingOrderEdge, ShapeSiblingOrderState, ShapeGroupState, ShapeSelectionSiblingOrderState, ShapePropsPatch, EditorToolState, EditorShapeEditingState, } from "./editor/editor";
|
|
15
16
|
export type { ShapeContainment } from "./editor/managers/queryManager";
|
|
16
17
|
export type { ShapeAtPointOptions, ShapeLineSegmentHitTestOptions, SpatialQueryOptions, } from "./editor/managers/spatialIndexManager";
|
|
17
18
|
export type { TerminalBindingTargetInput, ConnectionPoint, ConnectionTerminal, TerminalBindingResolver, TerminalBindingResolverInput, ResolvedTerminalBinding, } from "./bindings/terminalBinding";
|
|
@@ -21,13 +22,10 @@ export { isEditorClipboardPayload, } from "./editor/clipboard";
|
|
|
21
22
|
export type { ClipboardAssetSidecar, DuplicateSelectionInput, EditorClipboardPayload, PasteClipboardPayloadInput, } from "./editor/clipboard";
|
|
22
23
|
export type { EditorEvent, ClickEditorEvent, PointerEditorEvent, KeyboardEditorEvent, WheelEditorEvent, TickEditorEvent, CancelEditorEvent, EditorPointerType, } from "./editor/events";
|
|
23
24
|
export type { ChangeSource, RecordUpdate, RecordsDiff, ScopedStoreRecord, StoreRecord, StoreChange, StoreScopeOf, StoreSnapshot, } from "../store/index";
|
|
24
|
-
export { SnapshotParseError, parseDocumentSnapshot, parseSessionSnapshot,
|
|
25
|
-
export type { DocumentSnapshot, SessionSnapshot
|
|
26
|
-
export { createDocumentSnapshotSupport, filterDocumentSnapshotBySupport, getDocumentSnapshotRequirements, getUnsupportedDocumentSnapshotRequirements, } from "./schema/snapshotSupport";
|
|
27
|
-
export type { DocumentSnapshotRequirements, DocumentSnapshotSupport, FilterDocumentSnapshotBySupportResult, UnsupportedDocumentSnapshotRequirements, } from "./schema/snapshotSupport";
|
|
25
|
+
export { SnapshotParseError, parseDocumentSnapshot, parseSessionSnapshot, } from "./schema/snapshots";
|
|
26
|
+
export type { DocumentSnapshot, SessionSnapshot } from "./schema/snapshots";
|
|
28
27
|
export { ShapeUtil } from "./shapes/shapeUtil";
|
|
29
|
-
export type { ShapeBoundsSnapGeometry, ShapeBrushSelectInput, ShapeBrushWrapInput, ShapeBindingPointInput, ShapeBindingTargetHitTestInput, ShapeEditEndInput, ShapeEditEndResult, ShapeGeometryInput, ShapeHandleSnapContext, ShapeHandleSnapGeometry, ShapeLineSegmentHitTestInput, ShapePointHitTestInput, ShapeSnapPoint, ShapeSnapPointKind, ShapeSelectionHandleAnchorInput, ShapeSelectionHandleAnchors, ShapeSelectionFrameInput, ShapeSelectionFlipAxis, ShapeSelectionFlipInput, ShapeSelectionOverlayInfo, ShapeSelectionOverlayInfoInput, ShapeSelectionPagePoints, ShapeSelectionPagePointsInput,
|
|
30
|
-
export type { LaserTrailState } from "./editor/managers/interactionTransientManager";
|
|
28
|
+
export type { ShapeBoundsSnapGeometry, ShapeBrushSelectInput, ShapeBrushWrapInput, ShapeBindingPointInput, ShapeBindingTargetHitTestInput, ShapeChildPlacementInput, ShapeChildVisibilityInput, ShapeEditEndInput, ShapeEditEndResult, ShapeGeometryInput, ShapeGroupingInput, ShapeHandleSnapContext, ShapeHandleSnapGeometry, ShapeLineSegmentHitTestInput, ShapePointHitTestInput, ShapeSnapPoint, ShapeSnapPointKind, ShapeSelectionHandleAnchorInput, ShapeSelectionHandleAnchors, ShapeSelectionFrameInput, ShapeSelectionFlipAxis, ShapeSelectionFlipInput, ShapeSelectionOverlayInfo, ShapeSelectionOverlayInfoInput, ShapeSelectionPagePoints, ShapeSelectionPagePointsInput, ShapeSelectionResizeInput, ShapeSelectionResizeCapabilityInput, ShapeSelectionResizeModesInput, ShapeSelectionTransformCapabilityInput, ShapeSelectionTranslateInput, } from "./shapes/shapeUtil";
|
|
31
29
|
export type { HandleSnapContext, HandleSnapInput, HandleSnapMode, HandleSnapResult, HandleSnapSnapshot, HandleSnapSnapshotInput, ResizeSnapInput, ResizeSnapResult, ResizeSnapSnapshot, SnapAxis, SnapCoordinateSpace, SnapPointIndex, SnapPointIndexEntry, SnapPointKind, TranslateSnapInput, TranslateSnapResult, TranslateSnapSnapshot, } from "./editor/managers/snapTypes";
|
|
32
30
|
export { ShapeUtilRegistry } from "./shapes/shapeUtilRegistry";
|
|
33
31
|
export { resolveTerminalBindingAtPoint, } from "./bindings/terminalBinding";
|
|
@@ -44,14 +42,10 @@ export { StateNode } from "./editor/stateNode";
|
|
|
44
42
|
export { getEdgeScrollDelta } from "./editor/edgeScroll";
|
|
45
43
|
export { HandTool } from "./tools/hand/handTool";
|
|
46
44
|
export { SelectTool } from "./tools/select/selectTool";
|
|
47
|
-
export { SET_ACTIVE_TOOL_TOOLBAR_ACTION_ID, TOGGLE_TOOL_LOCKED_TOOLBAR_ACTION_ID, } from "./surfaces/toolbar";
|
|
48
45
|
export { LAND_DEFAULT_THEME_COLOR_FALLBACKS, LAND_THEME_COLOR_SLOTS, LAND_THEME_COLOR_TOKEN_BY_SLOT, areShapeColorsEqual, createCustomShapeColor, createThemeShapeColor, getThemeColorTokenName, isCustomShapeColorRef, isShapeColor, isThemeShapeColorRef, isTransparentShapeColor, normalizeShapeColor, resolveShapeColor, shapeColorToCssColor, } from "./shapes/colors";
|
|
49
|
-
export type { CustomShapeColorRef, ShapeColor,
|
|
50
|
-
export
|
|
51
|
-
export {
|
|
52
|
-
export type { CanvasAction, CanvasActionRunInput, CanvasActionValue, CanvasActionContext, CanvasSelectionSnapshot, CanvasToolSnapshot, } from "./surfaces/actions";
|
|
53
|
-
export type { ToolbarBadgeItem, ToolbarButtonItem, ToolbarContribution, ToolbarGroup, ToolbarItem, ToolbarSegmentedItem, ToolbarSegmentedOption, ToolbarSeparatorItem, ToolbarStepperItem, ToolbarStepperOption, ToolbarTextInputItem, ToolbarPlacement, ToolbarSurface, ToolbarSwatchesItem, ToolbarSwatchOption, } from "./surfaces/toolbar";
|
|
54
|
-
export { DEFAULT_CAMERA, DEFAULT_DOCUMENT_ID, DEFAULT_PAGE_ID, DEFAULT_SESSION_ID, createDefaultDocument, createDefaultPage, createDefaultSession, isAnyAssetRecord, isAnyBindingRecord, isAnyShapeRecord, isAssetRecord, isBindingRecord, isDocumentRecord, isDocumentMetadataRecord, isPageRecord, isSessionRecord, isShapeRecord, type AnyBindingRecord, type AnyAssetRecord, type AnyShapeRecord, type AssetId, type AssetRecord, type AssetRecordBase, type BaseRecord, type BindingId, type BindingRecordBase, type BindingRecord, type Camera, type DocumentId, type DocumentMetadataRecord, type DocumentRecord, type EditorRecord, type PageCameraById, type PageId, type PageSelectionById, type PageRecord, type RecordScope, type SessionRecord, type ShapeId, type ShapeParentId, type ShapeRecordBase, type ShapeRecord, type ShapeEditingEntryRequest, type ShapeEditingEntryMode, type ShapeEditingPoint, type ShapeEditingSession, } from "./schema/records";
|
|
46
|
+
export type { CustomShapeColorRef, ShapeColor, ThemeColorSlot, ThemeColorTokenName, ThemeShapeColorRef, } from "./shapes/colors";
|
|
47
|
+
export { getEditorOptionsFromPlugins, setupEditorPlugins, type EditorPlugin, createEditorRuntimeToken, EditorRuntimeRegistry, type EditorRuntimeToken, } from "./plugins";
|
|
48
|
+
export { DEFAULT_CAMERA, DEFAULT_DOCUMENT_ID, DEFAULT_PAGE_ID, DEFAULT_SESSION_ID, createDefaultDocument, createDefaultPage, createDefaultSession, isAssetRecord, isBindingRecord, isDocumentRecord, isDocumentMetadataRecord, isPageRecord, isSessionRecord, isShapeRecord, type AssetId, type AssetRecord, type AssetRecordBase, type BaseRecord, type BindingId, type BindingRecordBase, type BindingRecord, type Camera, type DocumentId, type DocumentMetadataRecord, type DocumentRecord, type EditorRecord, type PageCameraById, type PageId, type PageSelectionById, type PageRecord, type RecordScope, type SessionRecord, type ShapeId, type ShapeParentId, type ShapeRecordBase, type ShapeRecord, type ShapeEditingEntryRequest, type ShapeEditingEntryMode, type ShapeEditingPoint, type ShapeEditingSession, } from "./schema/records";
|
|
55
49
|
export { Vec } from "./geometry/vec";
|
|
56
50
|
export { Box } from "./geometry/box";
|
|
57
51
|
export { Mat } from "./geometry/mat";
|
|
@@ -4,25 +4,19 @@ import type { LandInteractionHandler } from "../editor/interactions";
|
|
|
4
4
|
import type { ShapeSvgExporter } from "../exports/svg";
|
|
5
5
|
import type { ShapeCapabilityDefinition } from "../shapes/capabilities";
|
|
6
6
|
import type { ShapeUtil } from "../shapes/shapeUtil";
|
|
7
|
-
|
|
8
|
-
import type { ContextMenuContribution } from "../surfaces/contextMenu";
|
|
9
|
-
import type { ToolbarContribution } from "../surfaces/toolbar";
|
|
10
|
-
export interface LandEditorRuntimePlugin {
|
|
7
|
+
export interface EditorPlugin {
|
|
11
8
|
id: string;
|
|
12
9
|
shapeCapabilities?: ShapeCapabilityDefinition[];
|
|
13
10
|
shapeUtils?: ShapeUtil[];
|
|
14
11
|
shapeSvgExporters?: ShapeSvgExporter[];
|
|
15
12
|
bindingUtils?: BindingUtil[];
|
|
16
13
|
interactionHandlers?: LandInteractionHandler[];
|
|
17
|
-
|
|
18
|
-
toolbarContributions?: ToolbarContribution[];
|
|
19
|
-
contextMenuContributions?: ContextMenuContribution[];
|
|
20
|
-
setup?(editor: Editor): void;
|
|
14
|
+
setup?(editor: Editor): void | (() => void);
|
|
21
15
|
}
|
|
22
|
-
export declare function
|
|
16
|
+
export declare function getEditorOptionsFromPlugins(plugins: readonly EditorPlugin[]): {
|
|
23
17
|
shapeUtils: ShapeUtil[];
|
|
24
18
|
shapeSvgExporters: ShapeSvgExporter[];
|
|
25
19
|
bindingUtils: BindingUtil[];
|
|
26
20
|
shapeCapabilities: ShapeCapabilityDefinition[];
|
|
27
21
|
};
|
|
28
|
-
export declare function
|
|
22
|
+
export declare function setupEditorPlugins(editor: Editor, plugins: readonly EditorPlugin[]): () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Signal } from "../../signals/index";
|
|
2
|
+
export interface EditorRuntimeToken<TValue> {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly __value?: TValue;
|
|
5
|
+
}
|
|
6
|
+
export declare function createEditorRuntimeToken<TValue>(id: string): EditorRuntimeToken<TValue>;
|
|
7
|
+
export declare class EditorRuntimeRegistry {
|
|
8
|
+
private readonly values;
|
|
9
|
+
private readonly disposers;
|
|
10
|
+
private isDisposed;
|
|
11
|
+
private readonly revision;
|
|
12
|
+
readonly revisionSignal: Signal<number>;
|
|
13
|
+
notify(): void;
|
|
14
|
+
provide<TValue>(token: EditorRuntimeToken<TValue>, value: TValue, dispose?: (value: TValue) => void): TValue;
|
|
15
|
+
get<TValue>(token: EditorRuntimeToken<TValue>): TValue | null;
|
|
16
|
+
require<TValue>(token: EditorRuntimeToken<TValue>): TValue;
|
|
17
|
+
onDispose(dispose: () => void): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { getEditorOptionsFromPlugins, setupEditorPlugins, type EditorPlugin, } from "./editorRuntimePlugin";
|
|
2
|
+
export { createEditorRuntimeToken, EditorRuntimeRegistry, type EditorRuntimeToken, } from "./editorRuntimeRegistry";
|