@yuzhouu/canvas-kit 0.1.9 → 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 +22 -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 +6 -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/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,16 +1,35 @@
|
|
|
1
|
-
import { Box, ShapeUtil, type Vec, type ShapeRecordBase } from "../canvas-core/index";
|
|
1
|
+
import { Box, ShapeUtil, type Vec, type ShapeLineSegmentHitTestInput, type ShapeGroupingInput, type ShapeRecordBase } from "../canvas-core/index";
|
|
2
2
|
export interface GroupShapeProps {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** Intrinsic width of the group's parent-local frame. */
|
|
4
|
+
readonly w: number;
|
|
5
|
+
/** Intrinsic height of the group's parent-local frame. */
|
|
6
|
+
readonly h: number;
|
|
5
7
|
}
|
|
6
8
|
export type GroupShapeRecord = ShapeRecordBase<"group", GroupShapeProps>;
|
|
7
9
|
export declare class GroupShapeUtil extends ShapeUtil<GroupShapeRecord> {
|
|
8
10
|
readonly type: "group";
|
|
11
|
+
getGroupingShapeCreateInput({ parentId, parentLocalBounds, }: ShapeGroupingInput): {
|
|
12
|
+
type: "group";
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
parentId: import("../canvas-core/index").ShapeParentId;
|
|
16
|
+
props: {
|
|
17
|
+
w: number;
|
|
18
|
+
h: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
9
21
|
getDefaultProps(): GroupShapeProps;
|
|
10
22
|
validateProps(props: unknown): GroupShapeProps;
|
|
11
|
-
|
|
23
|
+
getLocalBounds(shape: GroupShapeRecord): Box;
|
|
12
24
|
hitTest(_shape: GroupShapeRecord, _positionedPoint: Vec): boolean;
|
|
13
|
-
|
|
25
|
+
hitTestLineSegment(_shape: GroupShapeRecord, _input: ShapeLineSegmentHitTestInput): boolean;
|
|
26
|
+
isSelectionTransformContainer(_shape: GroupShapeRecord): boolean;
|
|
14
27
|
canUngroupChildren(_shape: GroupShapeRecord): boolean;
|
|
28
|
+
shouldResizeDescendants(_shape: GroupShapeRecord): boolean;
|
|
29
|
+
getResizeToFitDescendantsProps(shape: GroupShapeRecord, descendantBounds: Box): GroupShapeProps;
|
|
30
|
+
getMinimumChildCount(_shape: GroupShapeRecord): number;
|
|
31
|
+
contributesToExportBounds(_shape: GroupShapeRecord): boolean;
|
|
15
32
|
canReceiveChildren(_shape: GroupShapeRecord): boolean;
|
|
33
|
+
canAutomaticallyReceiveChildren(_shape: GroupShapeRecord): boolean;
|
|
34
|
+
canBeDirectlyBrushSelected(_shape: GroupShapeRecord): boolean;
|
|
16
35
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { GroupShapeUtil } from "./groupShapeUtil";
|
|
2
2
|
export type { GroupShapeProps, GroupShapeRecord } from "./groupShapeUtil";
|
|
3
|
-
export { GroupShapeSvgExporter,
|
|
3
|
+
export { GroupShapeSvgExporter, createGroupEditorPlugin, createGroupProductContribution } from "./editorRuntime";
|
|
4
4
|
export { createGroupCanvasRenderPlugin } from "./canvasRender";
|
|
5
|
-
export { Group
|
|
5
|
+
export { Group } from "./feature";
|
|
6
|
+
export { groupContextMenuContribution, GROUP_SELECTION_ACTION_ID, groupSelectionAction, groupToolbarContribution, UNGROUP_SELECTION_ACTION_ID, ungroupSelectionAction, } from "./groupContributions";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function createImageCanvasRenderPlugin():
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
+
export declare function createImageCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasAction } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function createImageCropCanvasActions(): CanvasAction[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type Editor } from "../canvas-core/index";
|
|
1
2
|
import type { ImageShapeRecord } from "./types";
|
|
2
|
-
export declare function rememberImageCropSessionBaseline(shape: ImageShapeRecord): void;
|
|
3
|
-
export declare function getImageCropSessionBaseline(shapeId: ImageShapeRecord["id"]): ImageShapeRecord | null;
|
|
4
|
-
export declare function clearImageCropSessionBaseline(shapeId: ImageShapeRecord["id"]): void;
|
|
3
|
+
export declare function rememberImageCropSessionBaseline(editor: Editor, shape: ImageShapeRecord): void;
|
|
4
|
+
export declare function getImageCropSessionBaseline(editor: Editor, shapeId: ImageShapeRecord["id"]): ImageShapeRecord | null;
|
|
5
|
+
export declare function clearImageCropSessionBaseline(editor: Editor, shapeId: ImageShapeRecord["id"]): void;
|
|
6
|
+
export declare function setupImageCropSessionLifecycle(editor: Editor): () => void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
|
+
import type { EditorPlugin } from "../canvas-core/index";
|
|
2
3
|
export { IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, } from "./actionIds";
|
|
3
4
|
export { ImageShapeSvgExporter } from "./imageSvgExporter";
|
|
4
5
|
export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
|
|
5
|
-
export declare function
|
|
6
|
+
export declare function createImageEditorPlugin(): EditorPlugin;
|
|
7
|
+
export declare function createImageProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Image: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createImageProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Image: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createImageProductContribution>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasAction } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function createImageHostToolbarActionContract(actionId: string): CanvasAction;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Box, ShapeUtil, type ShapeEditEndInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type
|
|
1
|
+
import { Box, ShapeUtil, type ShapeEditEndInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionResizeModesInput } from "../canvas-core/index";
|
|
2
2
|
import type { ImageShapeProps, ImageShapeRecord } from "./types";
|
|
3
3
|
export declare class ImageShapeUtil extends ShapeUtil<ImageShapeRecord> {
|
|
4
4
|
readonly type: "image";
|
|
5
5
|
getDefaultProps(): ImageShapeProps;
|
|
6
6
|
validateProps(props: unknown): ImageShapeProps;
|
|
7
|
-
|
|
7
|
+
getLocalBounds(shape: ImageShapeRecord): Box;
|
|
8
8
|
canReceiveTerminalBinding(_shape: ImageShapeRecord): boolean;
|
|
9
|
-
|
|
9
|
+
getAllowedSelectionResizeModes(_shape: ImageShapeRecord, _input: ShapeSelectionResizeModesInput): readonly ["aspect_ratio_locked"];
|
|
10
10
|
canEdit(_shape: ImageShapeRecord): boolean;
|
|
11
11
|
onEditEnd(shape: ImageShapeRecord, input: ShapeEditEndInput): void;
|
|
12
12
|
getSelectionHandleAnchors(shape: ImageShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter,
|
|
1
|
+
export { IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter, createImageEditorPlugin, createImageProductContribution, isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./editorRuntime";
|
|
2
2
|
export { createImageCanvasRenderPlugin } from "./canvasRender";
|
|
3
3
|
export { createImageCropInteractionHandler, createImageCropSelectionHandleInteractionHandler, } from "./cropInteractions";
|
|
4
4
|
export { createImageSmudgeInteractionHandler } from "./smudgeInteractions";
|
|
5
5
|
export { getImageCropModeMarkId, getImageCropRectOrDefault, } from "./crop";
|
|
6
6
|
export type { ImageCropRect } from "./crop";
|
|
7
|
-
export { DEFAULT_IMAGE_SMUDGE_BRUSH_COLOR, DEFAULT_IMAGE_SMUDGE_BRUSH_SIZE, IMAGE_SMUDGE_BRUSH_COLOR_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_BRUSH_SIZE_MAX, IMAGE_SMUDGE_BRUSH_SIZE_MIN, IMAGE_SMUDGE_BRUSH_SIZE_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_TOOLBAR_ACTION_ID, cancelImageSmudgeSession, cancelImageSmudgeSessionIfActive, cloneImageSmudgeStrokes, completeImageSmudgeSession, getActiveImageSmudgeSession, getImageSmudgeModeMarkId, isImageSmudgeModeForShape, isImageSmudgeToolbarActionId, registerImageSmudgeConfirmHandler, requestImageSmudgeConfirm, startImageSmudgeSession, updateImageSmudgeBrush, } from "./smudge";
|
|
8
|
-
export type { ImageSmudgeBrush, ImageSmudgeStroke, ImageSmudgeStrokePoint, } from "./smudge";
|
|
9
|
-
export { Image
|
|
7
|
+
export { DEFAULT_IMAGE_SMUDGE_BRUSH_COLOR, DEFAULT_IMAGE_SMUDGE_BRUSH_SIZE, IMAGE_SMUDGE_BRUSH_COLOR_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_BRUSH_SIZE_MAX, IMAGE_SMUDGE_BRUSH_SIZE_MIN, IMAGE_SMUDGE_BRUSH_SIZE_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_TOOLBAR_ACTION_ID, cancelImageSmudgeSession, cancelImageSmudgeSessionIfActive, cloneImageSmudgeStrokes, completeImageSmudgeSession, getActiveImageSmudgeSession, getImageSmudgeModeMarkId, isImageSmudgeModeForShape, isImageSmudgeToolbarActionId, registerImageSmudgeConfirmHandler, redoImageSmudgeStroke, requestImageSmudgeConfirm, startImageSmudgeSession, undoImageSmudgeStroke, updateImageSmudgeBrush, } from "./smudge";
|
|
8
|
+
export type { ImageSmudgeBrush, ImageSmudgeSessionSnapshot, ImageSmudgeStroke, ImageSmudgeStrokePoint, } from "./smudge";
|
|
9
|
+
export { Image } from "./feature";
|
|
10
10
|
export { ImageShapeUtil } from "./imageShapeUtil";
|
|
11
11
|
export type { ImageAssetProps, ImageAssetRecord, ImageAssetSource, ImageRemoteCopyState, ImageShapeCrop, ImageShapeProps, ImageShapeRecord, } from "./types";
|
|
12
12
|
export { isImageAssetRecord, isImageShapeRecord } from "./types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasActionContext } from "../canvas-plugin-sdk/index";
|
|
2
2
|
import { type ImageShapeRecord } from "./types";
|
|
3
3
|
export declare function getSingleSelectedImageShape(context: CanvasActionContext): ImageShapeRecord | null;
|
|
4
4
|
export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Editor, type ShapeId } from "../canvas-core/index";
|
|
2
2
|
import type { ImageShapeRecord } from "./types";
|
|
3
3
|
export declare const IMAGE_SMUDGE_TOOLBAR_ACTION_ID = "image.smudge";
|
|
4
4
|
export declare const IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID = "image.smudge.cancel";
|
|
@@ -33,6 +33,8 @@ export type ImageSmudgeSessionSnapshot = Readonly<{
|
|
|
33
33
|
shapeId: ShapeId;
|
|
34
34
|
brush: ImageSmudgeBrush;
|
|
35
35
|
strokes: readonly ImageSmudgeStroke[];
|
|
36
|
+
canUndo: boolean;
|
|
37
|
+
canRedo: boolean;
|
|
36
38
|
}>;
|
|
37
39
|
type ImageSmudgeSubscriber = () => void;
|
|
38
40
|
type ImageSmudgeConfirmHandler = (input?: ImageSmudgeConfirmInput) => Promise<unknown>;
|
|
@@ -54,9 +56,11 @@ export declare function getImageSmudgeSessionSnapshot(editor: Editor, shapeId: S
|
|
|
54
56
|
export declare function getActiveImageSmudgeSession(editor: Editor): ImageSmudgeSessionSnapshot | null;
|
|
55
57
|
export declare function subscribeImageSmudgeSession(editor: Editor, subscriber: ImageSmudgeSubscriber): () => void;
|
|
56
58
|
export declare function beginImageSmudgeStroke(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
57
|
-
export declare function addImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
58
59
|
export declare function appendImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
59
60
|
export declare function endImageSmudgeStroke(editor: Editor): void;
|
|
61
|
+
export declare function cancelImageSmudgeStroke(editor: Editor): void;
|
|
62
|
+
export declare function undoImageSmudgeStroke(editor: Editor): boolean;
|
|
63
|
+
export declare function redoImageSmudgeStroke(editor: Editor): boolean;
|
|
60
64
|
export declare function registerImageSmudgeConfirmHandler(editor: Editor, handler: ImageSmudgeConfirmHandler): () => void;
|
|
61
65
|
export declare function requestImageSmudgeConfirm(editor: Editor, input?: ImageSmudgeConfirmInput): Promise<unknown>;
|
|
62
66
|
export declare function cloneImageSmudgeStrokes(strokes: readonly ImageSmudgeStroke[]): ImageSmudgeStroke[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasAction } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function createImageSmudgeCanvasActions(): CanvasAction[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasAction, type ToolbarGroup } from "../canvas-
|
|
1
|
+
import { type CanvasAction, type ToolbarGroup } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function createImageStyleCanvasActions(): CanvasAction[];
|
|
3
3
|
export declare function createImageCornerRadiusToolbarGroup({ dataUiPrefix, id, order, }: {
|
|
4
4
|
dataUiPrefix: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ContextMenuContribution, type ToolbarContribution } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function createImageToolbarContributions(): ToolbarContribution[];
|
|
3
3
|
export declare function createImageContextMenuContributions(): ContextMenuContribution[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function createLaserCanvasRenderPlugin():
|
|
1
|
+
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
+
export declare function createLaserCanvasRenderPlugin(): 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 createLaserEditorPlugin(): EditorPlugin;
|
|
4
|
+
export declare function createLaserProductContribution(): CanvasProductContribution;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const Laser: import("../canvas-react/host/index").ConfigurableLandExtension<Record<string, never>>;
|
|
1
|
+
import { createLaserProductContribution } from "./editorRuntime";
|
|
2
|
+
export declare const Laser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof createLaserProductContribution>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { LaserTool } from "./laserTool";
|
|
2
2
|
export { createLaserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { createLaserEditorPlugin, createLaserProductContribution } from "./editorRuntime";
|
|
4
|
+
export { getLaserRuntime } from "./laserRuntime";
|
|
5
|
+
export { Laser } from "./feature";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Editor, type Vec } from "../canvas-core/index";
|
|
2
|
+
import { type Signal } from "../signals/index";
|
|
3
|
+
export interface LaserTrailState {
|
|
4
|
+
sessionId: number;
|
|
5
|
+
phase: "active" | "ending";
|
|
6
|
+
points: readonly Vec[];
|
|
7
|
+
}
|
|
8
|
+
export interface LaserRuntime {
|
|
9
|
+
readonly trailSignal: Signal<LaserTrailState | null>;
|
|
10
|
+
readonly activeSignal: Signal<boolean>;
|
|
11
|
+
start(): number;
|
|
12
|
+
set(sessionId: number, points: readonly Vec[]): void;
|
|
13
|
+
finish(sessionId: number): void;
|
|
14
|
+
clear(sessionId: number): void;
|
|
15
|
+
}
|
|
16
|
+
export declare const laserRuntimeToken: import("../canvas-core/index").EditorRuntimeToken<LaserRuntime>;
|
|
17
|
+
export declare function createLaserRuntime(): LaserRuntime;
|
|
18
|
+
export declare function getLaserRuntime(editor: Editor): LaserRuntime;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { createPackagingCanvasRenderPlugin } from "./canvasRender";
|
|
2
|
+
export { createPackagingEditorPlugin } from "./editorRuntime";
|
|
3
|
+
export { Packaging } from "./feature";
|
|
4
|
+
export { getPackagingArtworkPlacementMeta, getPackagingArtworkSide, PACKAGING_ARTWORK_SIDE_META_KEY, } from "./packagingArtwork";
|
|
5
|
+
export { applyAffine2d, compilePackagingContour, compilePackagingGeometry, doesPackagingSegmentHitFace, getCompiledPackagingGeometry, getCoveredPackagingFaceIds, getPackagingFaceUv, getPackagingCanvasBoundsMarkPaths, getPackagingStrokeDasharray, hitTestPackagingFace, invertAffine2d, isPointInPackagingFace, } from "./packagingGeometry";
|
|
6
|
+
export type { CompiledPackagingEdge, CompiledPackagingFace, CompiledPackagingContour, CompiledPackagingGeometry, PackagingMultiPolygon, PackagingPolygon, PackagingRing, PackagingSpatialIndex, } from "./packagingGeometry";
|
|
7
|
+
export { getPackagingRuntime, packagingRuntimeToken } from "./packagingRuntime";
|
|
8
|
+
export type { PackagingRuntime } from "./packagingRuntime";
|
|
9
|
+
export { getPackagingFaceFill, getPackagingVisualBounds, PackagingShapeUtil, } from "./packagingShapeUtil";
|
|
10
|
+
export { PackagingShapeSvgExporter } from "./packagingSvgExporter";
|
|
11
|
+
export { parsePackagingDxf } from "./packagingDxf";
|
|
12
|
+
export type { PackagingDxfImportOptions } from "./packagingDxf";
|
|
13
|
+
export { exportPackagingPdf, getPackagingPointsPerUnit, } from "./packagingPdfExporter";
|
|
14
|
+
export type { PackagingPdfExportOptions, PackagingPdfExportResult, } from "./packagingPdfExporter";
|
|
15
|
+
export { createPackagingProductContribution } from "./productRuntime";
|
|
16
|
+
export { clonePackagingDocument, parsePackagingDocument, } from "./validation";
|
|
17
|
+
export type { Affine2d, PackagingBleedContour, PackagingClosedContour, PackagingContourSegment, PackagingCoordinate, PackagingCoordinateSystem, PackagingDirectedEdgeRef, PackagingDocument, PackagingEdge, PackagingEdgeGeometry, PackagingEdgeOperation, PackagingFace, PackagingHoverState, PackagingLoop, PackagingPoint, PackagingPrepress, PackagingSafeZone, PackagingShapeProps, PackagingShapeRecord, PackagingSurface, PackagingSurfaceSide, PackagingSurfaces, PackagingUnit, } from "./types";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ShapeRecordBase } from "../canvas-core/index";
|
|
2
|
+
import type { PackagingSurfaceSide } from "./types";
|
|
3
|
+
export declare const PACKAGING_ARTWORK_SIDE_META_KEY = "land.packaging.artworkSide";
|
|
4
|
+
export declare function getPackagingArtworkSide(shape: ShapeRecordBase): PackagingSurfaceSide | null;
|
|
5
|
+
export declare function getPackagingArtworkPlacementMeta(shape: ShapeRecordBase, side: PackagingSurfaceSide): Record<string, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PackagingDocument, PackagingEdgeOperation } from "./types";
|
|
2
|
+
export interface PackagingDxfImportOptions {
|
|
3
|
+
fileName?: string;
|
|
4
|
+
documentId?: string;
|
|
5
|
+
revision?: string;
|
|
6
|
+
defaultOperation?: PackagingEdgeOperation;
|
|
7
|
+
operationByLayer?: Readonly<Record<string, PackagingEdgeOperation>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function parsePackagingDxf(source: string, options?: PackagingDxfImportOptions): PackagingDocument;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Box, Vec, type ShapeSnapPoint } from "../canvas-core/index";
|
|
2
|
+
import type { Affine2d, PackagingBleedContour, PackagingClosedContour, PackagingDocument, PackagingEdge, PackagingFace, PackagingLoop, PackagingSafeZone, PackagingSurfaceSide } from "./types";
|
|
3
|
+
export type PackagingRing = readonly Vec[];
|
|
4
|
+
export type PackagingPolygon = readonly PackagingRing[];
|
|
5
|
+
export type PackagingMultiPolygon = readonly PackagingPolygon[];
|
|
6
|
+
export interface CompiledPackagingEdge {
|
|
7
|
+
edge: PackagingEdge;
|
|
8
|
+
from: Vec;
|
|
9
|
+
to: Vec;
|
|
10
|
+
path: string;
|
|
11
|
+
bounds: Box;
|
|
12
|
+
midpoint: Vec;
|
|
13
|
+
extrema: readonly Vec[];
|
|
14
|
+
samples: readonly Vec[];
|
|
15
|
+
pointAt(t: number): Vec;
|
|
16
|
+
}
|
|
17
|
+
export interface CompiledPackagingFace {
|
|
18
|
+
face: PackagingFace;
|
|
19
|
+
bounds: Box;
|
|
20
|
+
center: Vec;
|
|
21
|
+
outerPath: string;
|
|
22
|
+
holePaths: readonly string[];
|
|
23
|
+
outer: PackagingRing;
|
|
24
|
+
holes: readonly PackagingRing[];
|
|
25
|
+
outerEdges: readonly CompiledPackagingEdge[];
|
|
26
|
+
holeEdges: readonly (readonly CompiledPackagingEdge[])[];
|
|
27
|
+
}
|
|
28
|
+
export interface CompiledPackagingContour<TSource = unknown> {
|
|
29
|
+
source: TSource;
|
|
30
|
+
path: string;
|
|
31
|
+
samples: readonly Vec[];
|
|
32
|
+
bounds: Box;
|
|
33
|
+
}
|
|
34
|
+
export interface PackagingSpatialIndex {
|
|
35
|
+
searchPoint(point: Vec): string[];
|
|
36
|
+
searchBounds(bounds: Box): string[];
|
|
37
|
+
}
|
|
38
|
+
export interface CompiledPackagingGeometry {
|
|
39
|
+
bounds: Box;
|
|
40
|
+
outerBounds: Box;
|
|
41
|
+
dielineBounds: Box | null;
|
|
42
|
+
pointsById: Map<string, Vec>;
|
|
43
|
+
edgesById: Map<string, CompiledPackagingEdge>;
|
|
44
|
+
facesById: Map<string, CompiledPackagingFace>;
|
|
45
|
+
facePaths: Map<string, string>;
|
|
46
|
+
facePolygons: Map<string, PackagingMultiPolygon>;
|
|
47
|
+
holePaths: Map<string, string[]>;
|
|
48
|
+
edgePaths: Map<string, string>;
|
|
49
|
+
faceCenters: Map<string, Vec>;
|
|
50
|
+
snapPoints: ShapeSnapPoint[];
|
|
51
|
+
spatialIndex: PackagingSpatialIndex;
|
|
52
|
+
holeEdgeIds: ReadonlySet<string>;
|
|
53
|
+
bleedContoursById: Map<string, CompiledPackagingContour<PackagingBleedContour>>;
|
|
54
|
+
safeZonesById: Map<string, CompiledPackagingContour<PackagingSafeZone>>;
|
|
55
|
+
}
|
|
56
|
+
export declare const PACKAGING_SAFE_ZONE_STROKE_DASHARRAY = "1 3";
|
|
57
|
+
export declare function getCompiledPackagingGeometry(document: PackagingDocument, side: PackagingSurfaceSide): CompiledPackagingGeometry;
|
|
58
|
+
export declare function compilePackagingGeometry(document: PackagingDocument, side: PackagingSurfaceSide): CompiledPackagingGeometry;
|
|
59
|
+
export declare function compilePackagingContour(contour: PackagingClosedContour): CompiledPackagingContour<PackagingClosedContour>;
|
|
60
|
+
export declare function compilePackagingContour<TSource>(contour: PackagingClosedContour, source: TSource): CompiledPackagingContour<TSource>;
|
|
61
|
+
export declare function flattenPackagingLoop(loop: PackagingLoop, edgesById: ReadonlyMap<string, CompiledPackagingEdge>): Vec[];
|
|
62
|
+
export declare function getPackagingLoopPath(loop: PackagingLoop, edgesById: ReadonlyMap<string, CompiledPackagingEdge>): string;
|
|
63
|
+
export declare function hitTestPackagingFace(geometry: CompiledPackagingGeometry, localPoint: Vec): CompiledPackagingFace | null;
|
|
64
|
+
export declare function isPointInPackagingFace(point: Vec, face: Pick<CompiledPackagingFace, "outer" | "holes">): boolean;
|
|
65
|
+
export declare function getPackagingFaceUv(face: PackagingFace, localPoint: Vec): Vec | null;
|
|
66
|
+
export declare function getCoveredPackagingFaceIds(geometry: CompiledPackagingGeometry, localOutline: readonly Vec[]): string[];
|
|
67
|
+
export declare function doesPackagingSegmentHitFace(geometry: CompiledPackagingGeometry, localStart: Vec, localEnd: Vec, margin?: number): boolean;
|
|
68
|
+
export declare function getPackagingCanvasBoundsMarkPaths(bounds: Box | null, layout: {
|
|
69
|
+
horizontalLength: number;
|
|
70
|
+
verticalLength: number;
|
|
71
|
+
}): string[];
|
|
72
|
+
export declare function getPackagingStrokeDasharray(operation: PackagingEdge["operation"], lineWidth: number): string;
|
|
73
|
+
export declare function applyAffine2d(matrix: Affine2d, point: Vec): Vec;
|
|
74
|
+
export declare function invertAffine2d(matrix: Affine2d): Affine2d | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PackagingDocument, PackagingSurfaceSide, PackagingUnit } from "./types";
|
|
2
|
+
export interface PackagingPdfExportOptions {
|
|
3
|
+
side?: PackagingSurfaceSide;
|
|
4
|
+
includeBleed?: boolean;
|
|
5
|
+
includeSafeZones?: boolean;
|
|
6
|
+
includeAnnotations?: boolean;
|
|
7
|
+
mirror?: boolean;
|
|
8
|
+
marginInDocumentUnits?: number;
|
|
9
|
+
lineWidthPoints?: number;
|
|
10
|
+
unitlessPointsPerUnit?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PackagingPdfExportResult {
|
|
13
|
+
bytes: Uint8Array;
|
|
14
|
+
filename: string;
|
|
15
|
+
side: PackagingSurfaceSide;
|
|
16
|
+
page: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
unit: PackagingUnit;
|
|
20
|
+
widthPoints: number;
|
|
21
|
+
heightPoints: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare function exportPackagingPdf(input: PackagingDocument, options?: PackagingPdfExportOptions): Promise<PackagingPdfExportResult>;
|
|
25
|
+
export declare function getPackagingPointsPerUnit(unit: PackagingUnit, unitlessPointsPerUnit?: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Editor } from "../canvas-core/index";
|
|
2
|
+
import { type Signal } from "../signals/index";
|
|
3
|
+
import type { PackagingHoverState } from "./types";
|
|
4
|
+
export interface PackagingRuntime {
|
|
5
|
+
readonly hoverSignal: Signal<PackagingHoverState | null>;
|
|
6
|
+
setHover(hover: PackagingHoverState | null): void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const packagingRuntimeToken: import("../canvas-core/index").EditorRuntimeToken<PackagingRuntime>;
|
|
10
|
+
export declare function createPackagingRuntime(): PackagingRuntime;
|
|
11
|
+
export declare function getPackagingRuntime(editor: Editor): PackagingRuntime;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Box, ShapeUtil, Vec, type ShapeBoundsSnapGeometry, type ShapeBrushSelectInput, type ShapeLineSegmentHitTestInput, type ShapePointHitTestInput, type ShapeRecordBase, type ShapeSelectionResizeInput, type ShapeSelectionResizeModesInput, type ShapeSelectionTransformCapabilityInput, type ShapeUpdate } from "../canvas-core/index";
|
|
2
|
+
import { type CompiledPackagingGeometry } from "./packagingGeometry";
|
|
3
|
+
import type { PackagingShapeProps, PackagingShapeRecord } from "./types";
|
|
4
|
+
export declare class PackagingShapeUtil extends ShapeUtil<PackagingShapeRecord> {
|
|
5
|
+
readonly type: "packaging";
|
|
6
|
+
getDefaultProps(): PackagingShapeProps;
|
|
7
|
+
validateProps(props: unknown): PackagingShapeProps;
|
|
8
|
+
getLocalBounds(shape: PackagingShapeRecord): Box;
|
|
9
|
+
getRenderBounds(shape: PackagingShapeRecord): Box;
|
|
10
|
+
getExportBounds(shape: PackagingShapeRecord): Box;
|
|
11
|
+
getChildClipLocalBounds(shape: PackagingShapeRecord): Box | null;
|
|
12
|
+
getChildClipLocalPolygons(shape: PackagingShapeRecord): readonly (readonly Vec[])[] | null;
|
|
13
|
+
getChildExportClipLocalPolygons(shape: PackagingShapeRecord): readonly (readonly Vec[])[] | null;
|
|
14
|
+
getPositionedOutlineVertices(shape: PackagingShapeRecord): Vec[];
|
|
15
|
+
getSelectionFramePositionedOutlineVertices(shape: PackagingShapeRecord): Vec[];
|
|
16
|
+
getBoundsSnapGeometry(shape: PackagingShapeRecord): ShapeBoundsSnapGeometry;
|
|
17
|
+
canReceiveChildren(_shape: PackagingShapeRecord): boolean;
|
|
18
|
+
canReceiveChild(_shape: PackagingShapeRecord, child: ShapeRecordBase): boolean;
|
|
19
|
+
isChildVisible(shape: PackagingShapeRecord, child: ShapeRecordBase): boolean;
|
|
20
|
+
getChildPlacementMeta(shape: PackagingShapeRecord, child: ShapeRecordBase, input: {
|
|
21
|
+
reason: "create" | "reparent";
|
|
22
|
+
}): Record<string, unknown>;
|
|
23
|
+
canSnapChildrenToSelf(_shape: PackagingShapeRecord): boolean;
|
|
24
|
+
shouldRotateDescendants(_shape: PackagingShapeRecord): boolean;
|
|
25
|
+
getAllowedSelectionResizeModes(_shape: PackagingShapeRecord, _input: ShapeSelectionResizeModesInput): readonly ["aspect_ratio_locked"];
|
|
26
|
+
canParticipateInSelectionRotation(_shape: PackagingShapeRecord, _input: ShapeSelectionTransformCapabilityInput): boolean;
|
|
27
|
+
resizeSelectionBounds(shape: PackagingShapeRecord, input: ShapeSelectionResizeInput): ShapeUpdate;
|
|
28
|
+
canSelectByBrush(shape: PackagingShapeRecord, input: ShapeBrushSelectInput): boolean;
|
|
29
|
+
hitTest(shape: PackagingShapeRecord, positionedPoint: Vec, _input?: ShapePointHitTestInput): boolean;
|
|
30
|
+
hitTestLineSegment(shape: PackagingShapeRecord, input: ShapeLineSegmentHitTestInput): boolean;
|
|
31
|
+
private doesBrushIntersectFace;
|
|
32
|
+
}
|
|
33
|
+
export declare function getPackagingVisualBounds(shape: PackagingShapeRecord, geometry?: CompiledPackagingGeometry): Box;
|
|
34
|
+
export declare function getPackagingFaceFill(shape: PackagingShapeRecord, faceId: string): PackagingShapeProps["faceFill"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const PACKAGING_RENDER_STYLE: {
|
|
2
|
+
readonly lineWidth: 0.5;
|
|
3
|
+
readonly holeFill: import("../canvas-core/index").CustomShapeColorRef;
|
|
4
|
+
readonly cutStroke: import("../canvas-core/index").CustomShapeColorRef;
|
|
5
|
+
readonly creaseStroke: import("../canvas-core/index").CustomShapeColorRef;
|
|
6
|
+
readonly bleedStroke: import("../canvas-core/index").CustomShapeColorRef;
|
|
7
|
+
readonly safeZoneStroke: import("../canvas-core/index").CustomShapeColorRef;
|
|
8
|
+
readonly annotationStroke: import("../canvas-core/index").CustomShapeColorRef;
|
|
9
|
+
readonly canvasBoundsMarkColor: import("../canvas-core/index").CustomShapeColorRef;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
|
+
import type { PackagingShapeRecord } from "./types";
|
|
3
|
+
export declare class PackagingShapeSvgExporter implements ShapeSvgExporter<PackagingShapeRecord> {
|
|
4
|
+
readonly type: "packaging";
|
|
5
|
+
toSvg(shape: PackagingShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
|
+
toSvgForeground(shape: PackagingShapeRecord, context: SvgExportContext): SvgNode;
|
|
7
|
+
}
|