@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,5 +1,6 @@
|
|
|
1
1
|
import { type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type RefObject } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Editor, type ShapeEditingSession } from "../../canvas-core/index";
|
|
3
|
+
import type { CanvasContextMenuRequest } from "../contextMenuRequest";
|
|
3
4
|
import type { CanvasDomEventGuardRegistry } from "../host/domEventGuards";
|
|
4
5
|
export interface CanvasDomEventHandlers {
|
|
5
6
|
onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
@@ -10,13 +11,13 @@ export interface CanvasDomEventState {
|
|
|
10
11
|
containerRef: RefObject<HTMLDivElement | null>;
|
|
11
12
|
handlers: CanvasDomEventHandlers;
|
|
12
13
|
isPointerActive: boolean;
|
|
13
|
-
|
|
14
|
+
isCameraPanning: boolean;
|
|
14
15
|
surfaceCursor: string | undefined;
|
|
15
16
|
}
|
|
16
17
|
export declare function useCanvasDomEvents({ activeDomEventGuards, activeToolId, editor, onContextMenuRequest, shapeEditingSession, }: {
|
|
17
18
|
activeDomEventGuards: CanvasDomEventGuardRegistry;
|
|
18
19
|
activeToolId: string;
|
|
19
20
|
editor: Editor;
|
|
20
|
-
onContextMenuRequest?: (
|
|
21
|
+
onContextMenuRequest?: (request: CanvasContextMenuRequest) => void;
|
|
21
22
|
shapeEditingSession: ShapeEditingSession | null;
|
|
22
23
|
}): CanvasDomEventState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ShapeId, ShapeRecordBase, Vec } from "../canvas-core/index";
|
|
2
|
+
export type CanvasContextMenuTarget = {
|
|
3
|
+
type: "canvas";
|
|
4
|
+
} | {
|
|
5
|
+
type: "shape";
|
|
6
|
+
shapeId: ShapeId;
|
|
7
|
+
shapeType: ShapeRecordBase["type"];
|
|
8
|
+
selected: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
type: "selection";
|
|
11
|
+
selectedShapeIds: readonly ShapeId[];
|
|
12
|
+
};
|
|
13
|
+
export interface CanvasContextMenuRequest {
|
|
14
|
+
anchor: {
|
|
15
|
+
screenPoint: Vec;
|
|
16
|
+
pagePoint: Vec;
|
|
17
|
+
};
|
|
18
|
+
target: CanvasContextMenuTarget;
|
|
19
|
+
}
|
|
@@ -12,6 +12,7 @@ export declare function getShapeStrokeForHover(stroke: ShapeColor, isHovered: bo
|
|
|
12
12
|
export interface RegisteredShapeRenderer<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
13
13
|
type: S["type"];
|
|
14
14
|
component: ComponentType<ShapeRendererProps<S>>;
|
|
15
|
+
foregroundComponent?: ComponentType<ShapeRendererProps<S>>;
|
|
15
16
|
}
|
|
16
17
|
export type AnyRegisteredShapeRenderer = RegisteredShapeRenderer<any>;
|
|
17
18
|
export interface SelectionCustomHandleRendererProps<H extends SelectionCustomHandle = SelectionCustomHandle> {
|
|
@@ -40,6 +41,10 @@ export interface CanvasRenderPluginProvider {
|
|
|
40
41
|
children: ReactNode;
|
|
41
42
|
}>;
|
|
42
43
|
}
|
|
44
|
+
export interface ShapeOpacityModifier {
|
|
45
|
+
id: string;
|
|
46
|
+
getOpacity(editor: Editor, shapeId: ShapeRecordBase["id"]): number;
|
|
47
|
+
}
|
|
43
48
|
export type CanvasDomEventGuardName = "pointer_down" | "pointer_move" | "pointer_up" | "pointer_cancel" | "wheel" | "key_down" | "key_up";
|
|
44
49
|
export type CanvasDomEventGuardDecision = "continue" | "handled";
|
|
45
50
|
export interface CanvasDomEventGuardInput {
|
|
@@ -62,7 +67,7 @@ export interface CanvasDomEventGuard {
|
|
|
62
67
|
handle(input: CanvasDomEventGuardInput): CanvasDomEventGuardDecision;
|
|
63
68
|
getCursor?(input: CanvasDomEventGuardCursorInput): string | undefined;
|
|
64
69
|
}
|
|
65
|
-
export interface
|
|
70
|
+
export interface CanvasRenderPlugin {
|
|
66
71
|
id: string;
|
|
67
72
|
shapeRenderers?: readonly AnyRegisteredShapeRenderer[];
|
|
68
73
|
canvasOverlays?: readonly CanvasOverlayContribution[];
|
|
@@ -70,4 +75,5 @@ export interface LandCanvasRenderPlugin {
|
|
|
70
75
|
domEventGuards?: readonly CanvasDomEventGuard[];
|
|
71
76
|
canvasProviders?: readonly CanvasRenderPluginProvider[];
|
|
72
77
|
canvasComponents?: readonly CanvasRenderPluginComponent[];
|
|
78
|
+
shapeOpacityModifiers?: readonly ShapeOpacityModifier[];
|
|
73
79
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CanvasRenderPlugin, CanvasRenderPluginComponent, CanvasRenderPluginProvider } from "./canvasRenderPlugin";
|
|
2
|
+
import { type CanvasDomEventGuardRegistry } from "./domEventGuards";
|
|
3
|
+
import { type CanvasOverlayRegistry } from "./overlayRegistry";
|
|
4
|
+
import { type CanvasRendererRegistry } from "./rendererRegistry";
|
|
5
|
+
export interface CanvasRenderRuntime {
|
|
6
|
+
plugins: readonly CanvasRenderPlugin[];
|
|
7
|
+
canvasProviders: readonly CanvasRenderPluginProvider[];
|
|
8
|
+
canvasComponents: readonly CanvasRenderPluginComponent[];
|
|
9
|
+
rendererRegistry: CanvasRendererRegistry;
|
|
10
|
+
overlayRegistry: CanvasOverlayRegistry;
|
|
11
|
+
domEventGuardRegistry: CanvasDomEventGuardRegistry;
|
|
12
|
+
}
|
|
13
|
+
export declare function createCanvasRenderRuntime(plugins: readonly CanvasRenderPlugin[]): CanvasRenderRuntime;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type
|
|
1
|
+
import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type CanvasRenderPlugin } from "./canvasRenderPlugin";
|
|
2
2
|
export declare class CanvasDomEventGuardRegistry {
|
|
3
3
|
private readonly guards;
|
|
4
4
|
private readonly registeredGuardIds;
|
|
5
5
|
register(guard: CanvasDomEventGuard): void;
|
|
6
|
-
registerCanvasRenderPlugins(plugins: readonly
|
|
6
|
+
registerCanvasRenderPlugins(plugins: readonly CanvasRenderPlugin[]): void;
|
|
7
7
|
getGuards(): readonly CanvasDomEventGuard[];
|
|
8
8
|
handle(input: CanvasDomEventGuardInput): "continue" | "handled";
|
|
9
9
|
getCursor(input: CanvasDomEventGuardCursorInput): string | undefined;
|
|
10
10
|
}
|
|
11
|
-
export declare function createCanvasDomEventGuardRegistry(plugins?: readonly
|
|
11
|
+
export declare function createCanvasDomEventGuardRegistry(plugins?: readonly CanvasRenderPlugin[]): CanvasDomEventGuardRegistry;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
export { CanvasActionRegistry, createCanvasActionRegistry, } from "./actionRegistry";
|
|
2
1
|
export { CanvasRendererRegistryContext, useCanvasRendererRegistry, } from "./canvasRendererRegistryContext";
|
|
3
2
|
export { CanvasOverlayRegistryContext, useCanvasOverlayRegistry, } from "./canvasOverlayRegistryContext";
|
|
4
3
|
export { CanvasDomEventGuardRegistry, createCanvasDomEventGuardRegistry, } from "./domEventGuards";
|
|
5
4
|
export { CanvasOverlayRegistry, createCanvasOverlayRegistry, } from "./overlayRegistry";
|
|
6
5
|
export { CanvasRendererRegistry, createCanvasRendererRegistry, } from "./rendererRegistry";
|
|
7
|
-
export {
|
|
8
|
-
export { CanvasContextMenuRegistry, createCanvasContextMenuRegistry, } from "./contextMenuRegistry";
|
|
9
|
-
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPluginProvider, LandCanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeRendererProps, } from "./canvasRenderPlugin";
|
|
6
|
+
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPluginProvider, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
10
7
|
export { getShapeStrokeForHover, SHAPE_HOVER_STROKE, } from "./canvasRenderPlugin";
|
|
11
|
-
export {
|
|
12
|
-
export type { ConfigurableLandExtension, LandExtension, LandExtensionConfig, LandExtensionOptionsInput, LandFeatureBundle, ResolvedLandExtension, } from "./extension";
|
|
13
|
-
export { createCanvasRenderPluginHostRuntime } from "./canvasRenderPluginHost";
|
|
14
|
-
export type { CanvasRenderPluginHostManifestContextMenuContributionEntry, CanvasRenderPluginHostManifestEntry, CanvasRenderPluginHostManifestToolbarContributionEntry, CanvasRenderPluginHostRuntime, CanvasRenderPluginHostShapeValidationSummary, CanvasRenderPluginHostSource, CanvasRenderPluginHostValidationIssue, CanvasRenderPluginHostValidationIssueSeverity, CanvasRenderPluginHostValidationSummary, CanvasRenderPluginHostVerdict, CreateCanvasRenderPluginHostRuntimeOptions, } from "./canvasRenderPluginHost";
|
|
8
|
+
export { createCanvasRenderRuntime, type CanvasRenderRuntime, } from "./canvasRenderRuntime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SelectionCustomHandle } from "../../canvas-core/index";
|
|
2
|
-
import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer,
|
|
2
|
+
import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer } from "./canvasRenderPlugin";
|
|
3
3
|
export declare class CanvasOverlayRegistry {
|
|
4
4
|
private readonly selectionCustomHandleRenderers;
|
|
5
5
|
private readonly canvasOverlays;
|
|
@@ -13,6 +13,6 @@ export declare class CanvasOverlayRegistry {
|
|
|
13
13
|
getSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): AnyRegisteredSelectionCustomHandleRenderer | null;
|
|
14
14
|
hasSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): boolean;
|
|
15
15
|
getRegisteredSelectionCustomHandleTypes(): SelectionCustomHandle["type"][];
|
|
16
|
-
registerCanvasRenderPlugins(plugins: readonly
|
|
16
|
+
registerCanvasRenderPlugins(plugins: readonly CanvasRenderPlugin[]): void;
|
|
17
17
|
}
|
|
18
|
-
export declare function createCanvasOverlayRegistry(plugins?: readonly
|
|
18
|
+
export declare function createCanvasOverlayRegistry(plugins?: readonly CanvasRenderPlugin[]): CanvasOverlayRegistry;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
-
import type { AnyRegisteredShapeRenderer,
|
|
1
|
+
import type { Editor, ShapeId, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { AnyRegisteredShapeRenderer, CanvasRenderPlugin, RegisteredShapeRenderer } from "./canvasRenderPlugin";
|
|
3
3
|
export declare class CanvasRendererRegistry {
|
|
4
4
|
private readonly registry;
|
|
5
5
|
private readonly registeredPluginIds;
|
|
6
|
+
private readonly shapeOpacityModifiers;
|
|
7
|
+
private readonly shapeOpacityModifierIds;
|
|
6
8
|
registerShapeRenderer<S extends ShapeRecordBase>(renderer: RegisteredShapeRenderer<S>): void;
|
|
7
9
|
getShapeRenderer(type: ShapeRecordBase["type"]): AnyRegisteredShapeRenderer | null;
|
|
8
10
|
hasShapeRenderer(type: ShapeRecordBase["type"]): boolean;
|
|
9
11
|
getRegisteredShapeTypes(): ShapeRecordBase["type"][];
|
|
10
|
-
registerCanvasRenderPlugins(plugins: readonly
|
|
12
|
+
registerCanvasRenderPlugins(plugins: readonly CanvasRenderPlugin[]): void;
|
|
13
|
+
getShapeOpacity(editor: Editor, shapeId: ShapeId): number;
|
|
11
14
|
}
|
|
12
|
-
export declare function createCanvasRendererRegistry(plugins?: readonly
|
|
15
|
+
export declare function createCanvasRendererRegistry(plugins?: readonly CanvasRenderPlugin[]): CanvasRendererRegistry;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Canvas, PageSpace } from "./components";
|
|
2
|
+
export type { CanvasContextMenuRequest, CanvasContextMenuTarget, } from "./contextMenuRequest";
|
|
2
3
|
export { CANVAS_SURFACE_DATA_UI, CANVAS_SURFACE_SELECTOR, forwardWheelEventToCanvasSurface, getCanvasSurfaceElement, getCanvasSurfaceElementForNode, getCanvasSurfacePagePoint, getCanvasSurfaceScreenPoint, getEditableEventTarget, isEditableEventTarget, } from "./dom";
|
|
3
4
|
export { useEditor, EditorContext } from "./hooks/useEditor";
|
|
4
5
|
export { useValue } from "./hooks/useValue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box, Vec } from "../canvas-core/index";
|
|
1
|
+
import { Box, Vec, type Editor } from "../canvas-core/index";
|
|
2
2
|
import type { ArrowShapeProps, ArrowShapeRecord, ArrowTerminal } from "./types";
|
|
3
3
|
export declare const ARROW_CURVE_EPSILON = 0.000001;
|
|
4
4
|
export interface ArrowInfoTerminal {
|
|
@@ -37,10 +37,12 @@ export interface ArrowArcInfo {
|
|
|
37
37
|
size: number;
|
|
38
38
|
length: number;
|
|
39
39
|
}
|
|
40
|
-
export declare function
|
|
40
|
+
export declare function getPageSpaceShapeArrowTerminalPoint(shape: ArrowShapeRecord, terminal: ArrowTerminal): Vec;
|
|
41
|
+
export declare function getArrowTerminalPagePoint(editor: Editor, shape: ArrowShapeRecord, terminal: ArrowTerminal): Vec;
|
|
41
42
|
export declare function getOppositeArrowTerminal(terminal: ArrowTerminal): ArrowTerminal;
|
|
42
|
-
export declare function
|
|
43
|
-
export declare function
|
|
43
|
+
export declare function withPageSpaceShapeArrowPoints(shape: ArrowShapeRecord, start: Vec, end: Vec): ArrowShapeRecord;
|
|
44
|
+
export declare function withArrowPagePoints(editor: Editor, shape: ArrowShapeRecord, startPagePoint: Vec, endPagePoint: Vec): ArrowShapeRecord | null;
|
|
45
|
+
export declare function setArrowTerminalPagePoint(editor: Editor, shape: ArrowShapeRecord, terminal: ArrowTerminal, pagePoint: Vec): ArrowShapeRecord | null;
|
|
44
46
|
export declare function normalizeArrowShapePoints(start: Vec, end: Vec): Pick<ArrowShapeProps, "w" | "h" | "start" | "end"> & {
|
|
45
47
|
x: number;
|
|
46
48
|
y: number;
|
|
@@ -4,16 +4,18 @@ export declare class ArrowShapeUtil extends ShapeUtil<ArrowShapeRecord> {
|
|
|
4
4
|
readonly type: "arrow";
|
|
5
5
|
getDefaultProps(): ArrowShapeProps;
|
|
6
6
|
validateProps(props: unknown): ArrowShapeProps;
|
|
7
|
-
|
|
7
|
+
getPositionedBounds(shape: ArrowShapeRecord): Box;
|
|
8
8
|
getPointHitTestBounds(shape: ArrowShapeRecord, input?: ShapeGeometryInput): Box;
|
|
9
9
|
getLocalBounds(shape: ArrowShapeRecord): Box;
|
|
10
10
|
getExportBounds(shape: ArrowShapeRecord): Box;
|
|
11
|
-
repairLoadedShape(
|
|
11
|
+
repairLoadedShape(_shape: ArrowShapeRecord): ArrowShapeRecord | null;
|
|
12
12
|
updateSelectionPagePoints(shape: ArrowShapeRecord, input: ShapeSelectionPagePointsInput): ShapeUpdate;
|
|
13
13
|
isWrappedByBrush(shape: ArrowShapeRecord, input: ShapeBrushWrapInput): boolean;
|
|
14
14
|
getSelectionPagePoints(shape: ArrowShapeRecord): ShapeSelectionPagePoints;
|
|
15
|
+
getSelectionPageMiddlePoint(shape: ArrowShapeRecord): Vec;
|
|
15
16
|
contributesToSelectionFrame(_shape: ArrowShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
16
|
-
|
|
17
|
+
canUseSelectionResizeHandles(_shape: ArrowShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
18
|
+
canUseSelectionRotateHandle(_shape: ArrowShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
17
19
|
canStartTranslateFromSelectionBounds(_shape: ArrowShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
18
20
|
getSelectionHandleAnchors(shape: ArrowShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
|
|
19
21
|
getSelectionOverlayInfo(shape: ArrowShapeRecord, input: ShapeSelectionOverlayInfoInput): ShapeSelectionOverlayInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vec, type ChangeSource, type Editor, type
|
|
1
|
+
import { Vec, type ChangeSource, type Editor, type ResolvedTerminalBinding, type ShapeId, type ShapeParentId, type TerminalBindingTargetInput } from "../canvas-core/index";
|
|
2
2
|
import { type ArrowShapeRecord, type ArrowShapeProps, type ArrowTerminal } from "./types";
|
|
3
3
|
export interface CreateArrowInput {
|
|
4
4
|
startPagePoint: Vec;
|
|
@@ -6,7 +6,7 @@ export interface CreateArrowInput {
|
|
|
6
6
|
startBinding?: TerminalBindingTargetInput | null;
|
|
7
7
|
endBinding?: TerminalBindingTargetInput | null;
|
|
8
8
|
props?: Partial<ArrowShapeProps>;
|
|
9
|
-
parentId?:
|
|
9
|
+
parentId?: ShapeParentId;
|
|
10
10
|
meta?: Record<string, unknown>;
|
|
11
11
|
}
|
|
12
12
|
export declare function createArrow(editor: Editor, input: CreateArrowInput, source?: ChangeSource): ArrowShapeRecord;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function createArrowCanvasRenderPlugin():
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
+
export declare function createArrowCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
3
|
import type { ArrowShapeRecord } from "./types";
|
|
3
4
|
export declare class ArrowShapeSvgExporter implements ShapeSvgExporter<ArrowShapeRecord> {
|
|
4
5
|
readonly type: "arrow";
|
|
5
6
|
toSvg(shape: ArrowShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function createArrowEditorPlugin(): EditorPlugin;
|
|
9
|
+
export declare function createArrowProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Arrow: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createArrowProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Arrow: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createArrowProductContribution>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { ArrowBindingUtil } from "./arrowBindingUtil";
|
|
2
2
|
export { ArrowShapeUtil } from "./arrowShapeUtil";
|
|
3
3
|
export { ArrowTool } from "./arrowTool";
|
|
4
|
-
export { ArrowShapeSvgExporter,
|
|
4
|
+
export { ArrowShapeSvgExporter, createArrowEditorPlugin, createArrowProductContribution } from "./editorRuntime";
|
|
5
5
|
export { createArrowCanvasRenderPlugin } from "./canvasRender";
|
|
6
|
-
export { Arrow
|
|
6
|
+
export { Arrow } from "./feature";
|
|
7
7
|
export { isArrowBindingRecord, isArrowShapeRecord, type ArrowBindingProps, type ArrowBindingRecord, type ArrowPoint, type ArrowShapeProps, type ArrowShapeRecord, type ArrowTerminal, } from "./types";
|
|
8
8
|
export { getArrowBindingAnchorPagePoint, resolveArrowBindingPagePoint, } from "./arrowBindingAnchors";
|
|
9
9
|
export { resolveArrowTerminalBindingAtPoint, resolveArrowTerminalBindingAtStartPoint, resolveArrowTerminalBindingForArrow, } from "./arrowTerminalBindingResolver";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function createDrawCanvasRenderPlugin():
|
|
1
|
+
import type { CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
+
export declare function createDrawCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
@@ -6,7 +6,6 @@ export { getDrawPointGeometry, getDrawSegmentGeometry };
|
|
|
6
6
|
export type { DrawShapeGeometry, DrawShapeSamplingStats, } from "./drawShapeGeometry";
|
|
7
7
|
type DrawLocalGeometryCacheKey = Pick<DrawShapeRecord, "props">;
|
|
8
8
|
type DrawPositionedGeometryCacheKey = Pick<DrawShapeRecord, "x" | "y" | "props">;
|
|
9
|
-
type DrawPageGeometryCacheKey = Pick<DrawShapeRecord, "x" | "y" | "rotation" | "scaleX" | "scaleY" | "props">;
|
|
10
9
|
export interface DrawShapeDiagnostics extends DrawShapeSamplingStats {
|
|
11
10
|
hasPath: boolean;
|
|
12
11
|
hasSelectionPath: boolean;
|
|
@@ -29,15 +28,13 @@ export interface NormalizedDrawShape {
|
|
|
29
28
|
export declare function getDrawShapeLocalGeometry(shape: DrawLocalGeometryCacheKey): DrawShapeGeometry;
|
|
30
29
|
export declare function normalizeDrawShapeFromSegmentSet(segments: readonly DrawShapeSegment[], strokeWidth: number, isPen?: boolean, isClosed?: boolean): NormalizedDrawShape;
|
|
31
30
|
export declare function normalizeDrawShapeFromPointSet(points: readonly DrawShapePoint[], strokeWidth: number, isPen?: boolean, isClosed?: boolean): NormalizedDrawShape;
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
31
|
+
export declare function normalizeDrawShapeFromPoints(pagePoints: readonly DrawShapePoint[], strokeWidth: number, isPen?: boolean, isClosed?: boolean): NormalizedDrawShape;
|
|
32
|
+
export declare function normalizeDrawShapeFromSegments(pageSegments: readonly DrawShapeSegment[], strokeWidth: number, isPen?: boolean, isClosed?: boolean): NormalizedDrawShape;
|
|
34
33
|
export declare function getDrawShapePositionedSegments(shape: Pick<DrawShapeRecord, "x" | "y" | "props">): DrawShapeSegment[];
|
|
35
34
|
export declare function getDrawShapePositionedPoints(shape: Pick<DrawShapeRecord, "x" | "y" | "props">): DrawShapePoint[];
|
|
36
35
|
export declare function getDrawShapePositionedGeometry(shape: DrawPositionedGeometryCacheKey): DrawShapeGeometry;
|
|
37
|
-
export declare function
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function normalizeTransformedDrawShape(shape: DrawShapeRecord): NormalizedDrawShape;
|
|
40
|
-
export declare function getDrawShapePageGeometry(shape: DrawPageGeometryCacheKey): DrawShapeGeometry;
|
|
36
|
+
export declare function getDrawShapeParentPoints(shape: DrawShapeRecord): DrawShapePoint[];
|
|
37
|
+
export declare function getDrawShapeParentSegments(shape: DrawShapeRecord): DrawShapeSegment[];
|
|
41
38
|
export declare function resizeDrawShapeToSelectionBounds(shape: DrawShapeRecord, input: DrawSelectionResizeInput): NormalizedDrawShape;
|
|
42
39
|
export declare function flipDrawShapeInSelectionBounds(shape: DrawShapeRecord, input: DrawSelectionFlipInput): NormalizedDrawShape;
|
|
43
40
|
export declare function resizeDrawShapeToPageBounds(shape: Pick<DrawShapeRecord, "x" | "y" | "props">, nextPageBounds: Box): NormalizedDrawShape;
|
|
@@ -4,7 +4,7 @@ export declare class DrawShapeUtil extends ShapeUtil<DrawShapeRecord> {
|
|
|
4
4
|
readonly type: "draw";
|
|
5
5
|
getDefaultProps(): DrawShapeProps;
|
|
6
6
|
validateProps(props: unknown): DrawShapeProps;
|
|
7
|
-
|
|
7
|
+
getPositionedBounds(shape: DrawShapeRecord): Box;
|
|
8
8
|
getLocalBounds(shape: DrawShapeRecord): Box;
|
|
9
9
|
getRenderBounds(shape: DrawShapeRecord): Box;
|
|
10
10
|
getExportBounds(shape: DrawShapeRecord): Box;
|
|
@@ -18,5 +18,5 @@ export declare class DrawShapeUtil extends ShapeUtil<DrawShapeRecord> {
|
|
|
18
18
|
getPositionedOutlineVertices(shape: DrawShapeRecord): Vec[];
|
|
19
19
|
hitTest(shape: DrawShapeRecord, positionedPoint: Vec): boolean;
|
|
20
20
|
hitTestLineSegment(shape: DrawShapeRecord, input: ShapeLineSegmentHitTestInput): boolean;
|
|
21
|
-
repairLoadedShape(
|
|
21
|
+
repairLoadedShape(_shape: DrawShapeRecord): DrawShapeRecord | null;
|
|
22
22
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
3
|
import { type DrawShapeRecord } from "./types";
|
|
3
4
|
export declare class DrawShapeSvgExporter implements ShapeSvgExporter<DrawShapeRecord> {
|
|
4
5
|
readonly type: "draw";
|
|
5
6
|
toSvg(shape: DrawShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function createDrawEditorPlugin(): EditorPlugin;
|
|
9
|
+
export declare function createDrawProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Draw: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createDrawProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Draw: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createDrawProductContribution>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { DrawTool } from "./drawTool";
|
|
2
2
|
export { DrawShapeUtil } from "./drawShapeUtil";
|
|
3
|
-
export { DrawShapeSvgExporter,
|
|
3
|
+
export { DrawShapeSvgExporter, createDrawEditorPlugin, createDrawProductContribution } from "./editorRuntime";
|
|
4
4
|
export { DrawShapeSvg } from "./DrawShapeRenderer";
|
|
5
5
|
export { createDrawCanvasRenderPlugin } from "./canvasRender";
|
|
6
|
-
export { Draw
|
|
7
|
-
export { flipDrawShapeInSelectionBounds, getDrawShapeDiagnostics,
|
|
6
|
+
export { Draw } from "./feature";
|
|
7
|
+
export { flipDrawShapeInSelectionBounds, getDrawShapeDiagnostics, getDrawShapeParentSegments, getDrawShapeParentPoints, } from "./drawGeometry";
|
|
8
8
|
export { interpolateDrawShapeRecords } from "./drawInterpolation";
|
|
9
9
|
export type { DrawShapePoint, DrawShapeProps, DrawShapeRecord, DrawShapeSegment, } from "./types";
|
|
10
10
|
export { isDrawShapeRecord } from "./types";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function createEraserCanvasRenderPlugin():
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
+
export declare function createEraserCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin } from "../canvas-core/index";
|
|
3
|
+
export declare function createEraserEditorPlugin(): EditorPlugin;
|
|
4
|
+
export declare function createEraserProductContribution(): CanvasProductContribution;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Editor, type ShapeId, type Vec } from "../canvas-core/index";
|
|
2
|
+
import { type Signal } from "../signals/index";
|
|
3
|
+
export interface EraserRuntime {
|
|
4
|
+
readonly erasingShapeIdsSignal: Signal<readonly ShapeId[]>;
|
|
5
|
+
readonly trailSignal: Signal<readonly Vec[]>;
|
|
6
|
+
readonly trailActiveSignal: Signal<boolean>;
|
|
7
|
+
setPreview(shapeIds: readonly ShapeId[], trail: readonly Vec[]): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare const eraserRuntimeToken: import("../canvas-core/index").EditorRuntimeToken<EraserRuntime>;
|
|
11
|
+
export declare function createEraserRuntime(editor: Editor): EraserRuntime;
|
|
12
|
+
export declare function getEraserRuntime(editor: Editor): EraserRuntime;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Eraser: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createEraserProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Eraser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createEraserProductContribution>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { EraserTool } from "./eraserTool";
|
|
2
2
|
export { createEraserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { createEraserEditorPlugin, createEraserProductContribution } from "./editorRuntime";
|
|
4
|
+
export { getEraserRuntime } from "./eraserRuntime";
|
|
5
|
+
export { Eraser } from "./feature";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
2
|
import type { FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
interface FrameShapeSvgProps {
|
|
4
4
|
shape: FrameShapeRecord;
|
|
5
5
|
isHovered?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function createFrameCanvasRenderPlugin():
|
|
7
|
+
export declare function createFrameCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
8
8
|
export declare function FrameShapeSvg({ shape, isHovered }: FrameShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgNode, type SvgExportContext } from "../canvas-core/index";
|
|
2
3
|
import { type FrameShapeRecord } from "./frameShapeUtil";
|
|
3
4
|
export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShapeRecord> {
|
|
4
5
|
readonly type: "frame";
|
|
5
6
|
toSvg(shape: FrameShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function createFrameEditorPlugin(): EditorPlugin;
|
|
9
|
+
export declare function createFrameProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Frame: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createFrameProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Frame: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createFrameProductContribution>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box, ShapeUtil, Vec, type ShapeColor, type ShapeBrushSelectInput, type ShapeLineSegmentHitTestInput, type ShapeRecordBase } from "../canvas-core/index";
|
|
1
|
+
import { Box, ShapeUtil, Vec, type ShapeColor, type ShapeBrushSelectInput, type ShapeLineSegmentHitTestInput, type ShapeRecordBase, type ShapeSelectionResizeCapabilityInput } from "../canvas-core/index";
|
|
2
2
|
export interface FrameShapeProps {
|
|
3
3
|
w: number;
|
|
4
4
|
h: number;
|
|
@@ -12,10 +12,12 @@ export declare class FrameShapeUtil extends ShapeUtil<FrameShapeRecord> {
|
|
|
12
12
|
readonly type: "frame";
|
|
13
13
|
getDefaultProps(): FrameShapeProps;
|
|
14
14
|
validateProps(props: unknown): FrameShapeProps;
|
|
15
|
-
|
|
15
|
+
getLocalBounds(shape: FrameShapeRecord): Box;
|
|
16
16
|
getPointHitTestBounds(shape: FrameShapeRecord): Box;
|
|
17
17
|
canReceiveChildren(_shape: FrameShapeRecord): boolean;
|
|
18
|
+
canSnapChildrenToSelf(_shape: FrameShapeRecord): boolean;
|
|
18
19
|
canReceiveTerminalBinding(_shape: FrameShapeRecord): boolean;
|
|
20
|
+
getSelectionResizeHandleIds(_shape: FrameShapeRecord, _input: ShapeSelectionResizeCapabilityInput): readonly ["top_left", "top_right", "bottom_right", "bottom_left"];
|
|
19
21
|
shouldRotateDescendants(_shape: FrameShapeRecord): boolean;
|
|
20
22
|
getChildClipLocalBounds(shape: FrameShapeRecord): Box | null;
|
|
21
23
|
canSelectByBrush(shape: FrameShapeRecord, input: ShapeBrushSelectInput): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FrameShapeUtil } from "./frameShapeUtil";
|
|
2
2
|
export type { FrameShapeProps, FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
export { FrameTool } from "./frameTool";
|
|
4
|
-
export { FrameShapeSvgExporter,
|
|
4
|
+
export { FrameShapeSvgExporter, createFrameEditorPlugin, createFrameProductContribution } from "./editorRuntime";
|
|
5
5
|
export { createFrameCanvasRenderPlugin } from "./canvasRender";
|
|
6
|
-
export { Frame
|
|
6
|
+
export { Frame } from "./feature";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ShapeColor } from "../canvas-core/index";
|
|
2
|
-
import { type
|
|
2
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
3
3
|
import type { GeoShapeRecord } from "./types";
|
|
4
4
|
interface GeoShapeSvgProps {
|
|
5
5
|
shape: GeoShapeRecord;
|
|
@@ -8,6 +8,6 @@ interface GeoShapeSvgProps {
|
|
|
8
8
|
stroke?: ShapeColor;
|
|
9
9
|
strokeWidth?: number;
|
|
10
10
|
}
|
|
11
|
-
export declare function createGeoCanvasRenderPlugin():
|
|
11
|
+
export declare function createGeoCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
12
12
|
export declare function GeoShapeSvg({ shape, fill, isHovered, stroke, strokeWidth, }: GeoShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
3
|
import { type GeoShapeRecord } from "./types";
|
|
3
4
|
export declare class GeoShapeSvgExporter implements ShapeSvgExporter<GeoShapeRecord> {
|
|
4
5
|
readonly type: "geo";
|
|
5
6
|
toSvg(shape: GeoShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function createGeoEditorPlugin(): EditorPlugin;
|
|
9
|
+
export declare function createGeoProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Geo: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createGeoProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Geo: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createGeoProductContribution>;
|
|
@@ -4,7 +4,7 @@ export declare class GeoShapeUtil extends ShapeUtil<GeoShapeRecord> {
|
|
|
4
4
|
readonly type: "geo";
|
|
5
5
|
getDefaultProps(): GeoShapeProps;
|
|
6
6
|
validateProps(props: unknown): GeoShapeProps;
|
|
7
|
-
|
|
7
|
+
getLocalBounds(shape: GeoShapeRecord): Box;
|
|
8
8
|
canReceiveTerminalBinding(_shape: GeoShapeRecord): boolean;
|
|
9
9
|
getPositionedOutlineVertices(shape: GeoShapeRecord): Vec[];
|
|
10
10
|
getHandleSnapGeometry(shape: GeoShapeRecord): ShapeHandleSnapGeometry;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DiamondTool, EllipseTool, HexagonTool, RectangleTool, StarTool, TriangleTool, } from "./geoTools";
|
|
2
2
|
export { GeoShapeUtil } from "./geoShapeUtil";
|
|
3
|
-
export { GeoShapeSvgExporter,
|
|
3
|
+
export { GeoShapeSvgExporter, createGeoEditorPlugin, createGeoProductContribution } from "./editorRuntime";
|
|
4
4
|
export { GeoShapeSvg, createGeoCanvasRenderPlugin } from "./canvasRender";
|
|
5
|
-
export { Geo
|
|
5
|
+
export { Geo } from "./feature";
|
|
6
6
|
export type { GeoShapeKind, GeoShapeProps, GeoShapeRecord } from "./types";
|
|
7
7
|
export { GEO_SHAPE_KINDS, isGeoShapeKind, isGeoShapeRecord } from "./types";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
2
|
import type { GroupShapeRecord } from "./groupShapeUtil";
|
|
3
3
|
interface GroupShapeSvgProps {
|
|
4
4
|
shape: GroupShapeRecord;
|
|
5
5
|
isHovered?: boolean;
|
|
6
6
|
isSelected?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare function createGroupCanvasRenderPlugin():
|
|
8
|
+
export declare function createGroupCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
9
9
|
export declare function GroupShapeSvg({ shape, isHovered, isSelected, }: GroupShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
3
|
import { type GroupShapeRecord } from "./groupShapeUtil";
|
|
3
4
|
export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShapeRecord> {
|
|
4
5
|
readonly type: "group";
|
|
5
6
|
toSvg(_shape: GroupShapeRecord): SvgNode;
|
|
6
7
|
}
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function createGroupEditorPlugin(): EditorPlugin;
|
|
9
|
+
export declare function createGroupProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Group: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createGroupProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Group: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createGroupProductContribution>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CanvasAction, type ContextMenuContribution, type ToolbarContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
export declare const GROUP_SELECTION_ACTION_ID = "group.selection.group";
|
|
3
|
+
export declare const UNGROUP_SELECTION_ACTION_ID = "group.selection.ungroup";
|
|
4
|
+
export declare const groupSelectionAction: CanvasAction;
|
|
5
|
+
export declare const ungroupSelectionAction: CanvasAction;
|
|
6
|
+
export declare const groupToolbarContribution: ToolbarContribution;
|
|
7
|
+
export declare const groupContextMenuContribution: ContextMenuContribution;
|