@yuzhouu/canvas-kit 0.1.10 → 0.1.11
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 +82 -35
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +15 -0
- package/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
- package/_vendor/canvas-core/editor/bindingReactionScope.d.ts +7 -0
- package/_vendor/canvas-core/editor/commands.d.ts +3 -3
- package/_vendor/canvas-core/editor/editor.d.ts +20 -5
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +1 -0
- package/_vendor/canvas-core/editor/historyManager.d.ts +2 -5
- package/_vendor/canvas-core/editor/interactions.d.ts +33 -9
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +1 -6
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +13 -0
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +3 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
- package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +3 -1
- package/_vendor/canvas-core/exports/svg.d.ts +2 -3
- package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
- package/_vendor/canvas-core/index.d.ts +9 -5
- package/_vendor/canvas-core/shapes/colors.d.ts +2 -1
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +47 -1
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +9 -2
- package/_vendor/canvas-core/tools/select/states/{draggingSelectionHandleInteractionState.d.ts → draggingPluginInteractionState.d.ts} +5 -4
- package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +2 -2
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
- package/_vendor/canvas-plugin-sdk/actions.d.ts +19 -2
- package/_vendor/canvas-plugin-sdk/capability.d.ts +16 -0
- package/_vendor/canvas-plugin-sdk/chrome.d.ts +52 -0
- package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +15 -0
- package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +9 -0
- package/_vendor/canvas-plugin-sdk/exports.d.ts +26 -0
- package/_vendor/canvas-plugin-sdk/importRegistry.d.ts +10 -0
- package/_vendor/canvas-plugin-sdk/imports.d.ts +38 -0
- package/_vendor/canvas-plugin-sdk/index.d.ts +11 -0
- package/_vendor/canvas-plugin-sdk/lifecycle.d.ts +31 -0
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +54 -17
- package/_vendor/canvas-plugin-sdk/pluginUi.d.ts +37 -0
- package/_vendor/canvas-plugin-sdk/productApi.d.ts +28 -0
- package/_vendor/canvas-plugin-sdk/services.d.ts +20 -0
- package/_vendor/canvas-plugin-sdk/toolbar.d.ts +26 -4
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +5 -6
- package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +15 -4
- package/_vendor/canvas-react/host/index.d.ts +2 -2
- package/_vendor/plugin-arrow/api.d.ts +33 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +2 -1
- package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +2 -1
- package/_vendor/plugin-arrow/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -2
- package/_vendor/plugin-arrow/index.d.ts +4 -1
- package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
- package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +2 -0
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContextMenuContributions.d.ts +1 -1
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContribution.d.ts +2 -3
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardService.d.ts +3 -3
- package/_vendor/plugin-builtin-clipboard/index.d.ts +3 -0
- package/_vendor/plugin-builtin-clipboard/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-export/blobDataUrl.d.ts +1 -0
- package/_vendor/plugin-builtin-export/canvasExportApi.d.ts +43 -0
- package/_vendor/plugin-builtin-export/index.d.ts +8 -0
- package/_vendor/plugin-builtin-export/plugin.d.ts +5 -0
- package/_vendor/plugin-builtin-export/pngExport.d.ts +15 -0
- package/{features/export → _vendor/plugin-builtin-export}/svgExport.d.ts +9 -2
- package/_vendor/plugin-builtin-import-host/CanvasImportHost.d.ts +3 -0
- package/_vendor/plugin-builtin-import-host/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-import-host/index.d.ts +2 -0
- package/_vendor/plugin-builtin-import-host/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/index.d.ts +2 -0
- package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +2 -0
- package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
- package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
- package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
- package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
- package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
- package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
- package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
- package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
- package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
- package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
- package/_vendor/plugin-connector/connectorRuntime.d.ts +62 -0
- package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
- package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
- package/_vendor/plugin-connector/constants.d.ts +17 -0
- package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
- package/_vendor/plugin-connector/feature.d.ts +4 -0
- package/_vendor/plugin-connector/index.d.ts +18 -0
- package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
- package/_vendor/plugin-connector/productRuntime.d.ts +2 -0
- package/_vendor/plugin-connector/quickConnect.d.ts +28 -0
- package/_vendor/plugin-connector/types.d.ts +51 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-draw/drawPath.d.ts +7 -1
- package/_vendor/plugin-draw/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-draw/feature.d.ts +2 -2
- package/_vendor/plugin-draw/index.d.ts +2 -1
- package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
- package/_vendor/plugin-eraser/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-eraser/feature.d.ts +2 -2
- package/_vendor/plugin-eraser/index.d.ts +2 -1
- package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-frame/api.d.ts +19 -0
- package/_vendor/plugin-frame/canvasRender.d.ts +3 -3
- package/_vendor/plugin-frame/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-frame/feature.d.ts +2 -2
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +8 -0
- package/_vendor/plugin-frame/index.d.ts +4 -1
- package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/api.d.ts +27 -0
- package/_vendor/plugin-geo/canvasRender.d.ts +3 -3
- package/_vendor/plugin-geo/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-geo/feature.d.ts +2 -2
- package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
- package/_vendor/plugin-geo/geoTools.d.ts +1 -1
- package/_vendor/plugin-geo/index.d.ts +7 -4
- package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/types.d.ts +5 -1
- package/_vendor/plugin-group/canvasRender.d.ts +1 -2
- package/_vendor/plugin-group/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-group/feature.d.ts +2 -2
- package/_vendor/plugin-group/index.d.ts +2 -1
- package/_vendor/plugin-group/productRuntime.d.ts +2 -0
- package/_vendor/plugin-image/editorRuntime.d.ts +0 -4
- package/_vendor/plugin-image/feature.d.ts +2 -2
- package/_vendor/plugin-image/index.d.ts +2 -1
- package/_vendor/plugin-image/productRuntime.d.ts +4 -0
- package/_vendor/plugin-image/styleRuntime.d.ts +5 -0
- package/_vendor/plugin-laser/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-laser/feature.d.ts +2 -2
- package/_vendor/plugin-laser/index.d.ts +2 -1
- package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
- package/{builtins/controller/packagingController.d.ts → _vendor/plugin-packaging/api.d.ts} +13 -10
- package/_vendor/plugin-packaging/feature.d.ts +2 -2
- package/_vendor/plugin-packaging/index.d.ts +3 -1
- package/_vendor/plugin-packaging/productRuntime.d.ts +2 -2
- package/_vendor/plugin-path/PathShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-path/editorRuntime.d.ts +1 -15
- package/_vendor/plugin-path/feature.d.ts +2 -2
- package/_vendor/plugin-path/index.d.ts +2 -1
- package/_vendor/plugin-path/pathHistory.d.ts +13 -0
- package/_vendor/plugin-path/pathShapeUtil.d.ts +3 -1
- package/_vendor/plugin-path/pathTool.d.ts +3 -0
- package/_vendor/plugin-path/productRuntime.d.ts +15 -0
- package/_vendor/plugin-text/api.d.ts +20 -0
- package/_vendor/plugin-text/capabilities.d.ts +2 -0
- package/_vendor/plugin-text/editorRuntime.d.ts +2 -8
- package/_vendor/plugin-text/feature.d.ts +1 -1
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +0 -2
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +1 -1
- package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -1
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
- package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
- package/_vendor/plugin-text/index.d.ts +7 -3
- package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
- package/_vendor/plugin-text/productRuntime.d.ts +6 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +3 -2
- package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +4 -0
- package/_vendor/plugin-text/textFormatting.d.ts +2 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +23 -2
- package/_vendor/plugin-text/textShapeUtil.d.ts +5 -2
- package/_vendor/plugin-text/textTypes.d.ts +1 -0
- package/_vendor/signals/core.d.ts +1 -0
- package/_vendor/signals/index.d.ts +1 -1
- package/_vendor/store/history.d.ts +1 -1
- package/_vendor/store/store.d.ts +2 -0
- package/browser/indexedDb.d.ts +10 -10
- package/browser/persistence.d.ts +4 -25
- package/chrome/floating/useCanvasKitFloatingPosition.d.ts +1 -1
- package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
- package/chrome/toolbar/useToolbarSurfaces.d.ts +9 -10
- package/chrome/types.d.ts +11 -8
- package/chrome/useCanvasKitChromeContext.d.ts +4 -7
- package/chrome/useChromeSurfaces.d.ts +12 -0
- package/controller/canvasKitController.d.ts +4 -11
- package/core/index.d.ts +3 -4
- package/core/product-controller/canvasProductController.d.ts +40 -11
- package/core/product-controller/index.d.ts +1 -1
- package/core/runtime/productServices.d.ts +5 -19
- package/core/runtime/runtimeContracts.d.ts +3 -3
- package/features/image/asset/imageAssetService.d.ts +2 -3
- package/features/image/asset/imageBlobStore.d.ts +1 -0
- package/features/image/asset/imageFileHelpers.d.ts +0 -6
- package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
- package/features/image/controller/imageProductController.d.ts +2 -2
- package/features/image/imageHostPlugin.d.ts +1 -0
- package/features/image/import/ImageImportController.d.ts +3 -1
- package/features/image/index.d.ts +1 -3
- package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
- package/features/image/toolbar/imageHostActions.d.ts +7 -8
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/text/{textProductPlugin.d.ts → textHostPlugin.d.ts} +1 -1
- package/features/text/textSvgAssetInliner.d.ts +3 -0
- package/features/text/textSvgAssetPlugin.d.ts +2 -0
- package/index.css +1 -1
- package/index.d.ts +28 -18
- package/index.mjs +111 -84
- package/package.json +1 -1
- package/plugins/standardCanvasKitPlugins.d.ts +16 -0
- package/runtime/canvasKitPluginContracts.d.ts +31 -76
- package/runtime/canvasKitPluginSetup.d.ts +32 -0
- package/runtime/canvasKitResourceScope.d.ts +5 -0
- package/runtime/canvasKitRuntime.d.ts +9 -7
- package/runtime/canvasKitRuntimeContracts.d.ts +2 -5
- package/runtime/persistenceCoordinator.d.ts +33 -0
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -47
- package/builtins/controller/createBuiltInCanvasController.d.ts +0 -18
- package/builtins/controller/layerController.d.ts +0 -9
- package/builtins/controller/shapeCreationController.d.ts +0 -83
- package/builtins/index.d.ts +0 -7
- package/builtins/plugins.d.ts +0 -16
- package/chrome/useSvgExport.d.ts +0 -15
- package/core/api/apiRegistry.d.ts +0 -12
- package/features/actions/actionRuntime.d.ts +0 -16
- package/features/clipboard/clipboardPlugin.d.ts +0 -1
- package/features/image/imageProductPlugin.d.ts +0 -1
- package/features/image/import/useImageImport.d.ts +0 -16
- package/features/keyboard/keyboardShortcutPlugin.d.ts +0 -1
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -8
- package/features/selection/selectionActions.d.ts +0 -19
- package/features/selection/selectionContextMenuContributions.d.ts +0 -2
- package/features/selection/selectionPlugin.d.ts +0 -1
- package/features/selection/selectionToolbarContributions.d.ts +0 -2
- package/features/tool/toolActions.d.ts +0 -2
- package/features/tool/toolContextMenuContributions.d.ts +0 -2
- package/features/tool/toolPlugin.d.ts +0 -1
- package/features/tool/toolToolbarContributions.d.ts +0 -2
- package/features/view/viewActions.d.ts +0 -5
- package/features/view/viewContextMenuContributions.d.ts +0 -2
- package/features/view/viewPlugin.d.ts +0 -1
- package/product/standardCanvasKitPlugins.d.ts +0 -4
- package/runtime/canvasKitPlugins.d.ts +0 -33
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type BaseRecord, type BindingRecordBase, type CreateShapeInput, type Editor, type ShapeColor, type ShapeParentId, type ShapeRecord, type ShapeRecordBase, type Vec } from "../canvas-core/index";
|
|
2
|
+
export interface ConnectorPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export type ConnectorTerminal = "start" | "end";
|
|
7
|
+
export type ConnectorRouting = "straight" | "orthogonal" | "curved";
|
|
8
|
+
export type ConnectorStrokeStyle = "solid" | "dashed";
|
|
9
|
+
export type ConnectorHead = "none" | "arrow";
|
|
10
|
+
export interface ConnectorShapeProps {
|
|
11
|
+
w: number;
|
|
12
|
+
h: number;
|
|
13
|
+
start: ConnectorPoint;
|
|
14
|
+
end: ConnectorPoint;
|
|
15
|
+
routing: ConnectorRouting;
|
|
16
|
+
stroke: ShapeColor;
|
|
17
|
+
strokeWidth: number;
|
|
18
|
+
strokeStyle: ConnectorStrokeStyle;
|
|
19
|
+
headStart: ConnectorHead;
|
|
20
|
+
headEnd: ConnectorHead;
|
|
21
|
+
cornerRadius: number;
|
|
22
|
+
curveWaypoints: ConnectorPoint[];
|
|
23
|
+
orthogonalBends: ConnectorPoint[];
|
|
24
|
+
}
|
|
25
|
+
export interface ConnectorShapeRecord extends ShapeRecordBase<"connector", ConnectorShapeProps> {
|
|
26
|
+
type: "connector";
|
|
27
|
+
props: ConnectorShapeProps;
|
|
28
|
+
}
|
|
29
|
+
export interface ConnectorBindingProps {
|
|
30
|
+
terminal: ConnectorTerminal;
|
|
31
|
+
portId: string;
|
|
32
|
+
normalizedAnchor?: ConnectorPoint;
|
|
33
|
+
}
|
|
34
|
+
export interface ConnectorBindingRecord extends BindingRecordBase<"connector", ConnectorBindingProps> {
|
|
35
|
+
type: "connector";
|
|
36
|
+
props: ConnectorBindingProps;
|
|
37
|
+
}
|
|
38
|
+
export interface ConnectorQuickCreateNodeFactory {
|
|
39
|
+
createNode(input: {
|
|
40
|
+
editor: Editor;
|
|
41
|
+
sourceShape: ShapeRecord;
|
|
42
|
+
sourcePortId: string;
|
|
43
|
+
pageCenter: Vec;
|
|
44
|
+
parentId: ShapeParentId;
|
|
45
|
+
}): CreateShapeInput;
|
|
46
|
+
}
|
|
47
|
+
export interface ConnectorPluginOptions {
|
|
48
|
+
quickCreateNodeFactory?: ConnectorQuickCreateNodeFactory;
|
|
49
|
+
}
|
|
50
|
+
export declare function isConnectorShapeRecord(record: BaseRecord | null | undefined): record is ConnectorShapeRecord;
|
|
51
|
+
export declare function isConnectorBindingRecord(record: BaseRecord | null | undefined): record is ConnectorBindingRecord;
|
|
@@ -2,9 +2,12 @@ import { type ShapeColor } from "../canvas-core/index";
|
|
|
2
2
|
import type { DrawShapeRecord } from "./types";
|
|
3
3
|
interface DrawShapeSvgProps {
|
|
4
4
|
shape: DrawShapeRecord;
|
|
5
|
-
isHovered?: boolean;
|
|
6
5
|
stroke?: ShapeColor;
|
|
7
6
|
strokeWidth?: number;
|
|
8
7
|
}
|
|
9
|
-
export declare function DrawShapeSvg({ shape,
|
|
8
|
+
export declare function DrawShapeSvg({ shape, stroke, strokeWidth, }: DrawShapeSvgProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare function DrawShapeHoverSvg({ shape, strokeWidth, }: {
|
|
10
|
+
shape: DrawShapeRecord;
|
|
11
|
+
strokeWidth: number;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
13
|
export {};
|
|
@@ -13,6 +13,10 @@ export interface DrawInputPointGuardOptions {
|
|
|
13
13
|
hardMaxPointCount: number;
|
|
14
14
|
maxDistanceMultiplier: number;
|
|
15
15
|
}
|
|
16
|
+
export interface DrawInputPointGuardState {
|
|
17
|
+
anchorPoint: DrawShapePoint;
|
|
18
|
+
hasProvisionalPoint: boolean;
|
|
19
|
+
}
|
|
16
20
|
export interface DrawPointSamplingResult {
|
|
17
21
|
points: DrawShapePoint[];
|
|
18
22
|
rawPointCount: number;
|
|
@@ -29,7 +33,9 @@ export declare function cloneDrawSegment(segment: DrawShapeSegment): DrawShapeSe
|
|
|
29
33
|
export declare function getFlattenedDrawSegmentPoints(segments: readonly DrawShapeSegment[]): DrawShapePoint[];
|
|
30
34
|
export declare function getDrawSegmentsFromPoints(points: readonly DrawShapePoint[]): DrawShapeSegment[];
|
|
31
35
|
export declare function getDrawInputPointGuardOptions(strokeWidth: number, isPen: boolean): DrawInputPointGuardOptions;
|
|
32
|
-
export declare function appendGuardedDrawPoint(points: DrawShapePoint[], point: DrawShapePoint, options: DrawInputPointGuardOptions
|
|
36
|
+
export declare function appendGuardedDrawPoint(points: DrawShapePoint[], point: DrawShapePoint, options: DrawInputPointGuardOptions, state: DrawInputPointGuardState, appendOptions?: {
|
|
37
|
+
force?: boolean;
|
|
38
|
+
}): DrawInputPointGuardState;
|
|
33
39
|
export declare function sampleDrawPoints(points: readonly DrawShapePoint[], options: DrawPointSamplingOptions): DrawPointSamplingResult;
|
|
34
40
|
export declare function getDrawCenterlinePathFromPoints(points: readonly DrawShapePoint[]): string | null;
|
|
35
41
|
export declare function getClosedDrawCenterlinePathFromPoints(points: readonly DrawShapePoint[]): string | null;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
3
|
-
import {
|
|
2
|
+
import type { DrawShapeRecord } from "./types";
|
|
4
3
|
export declare class DrawShapeSvgExporter implements ShapeSvgExporter<DrawShapeRecord> {
|
|
5
4
|
readonly type: "draw";
|
|
6
5
|
toSvg(shape: DrawShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
7
6
|
}
|
|
8
7
|
export declare function createDrawEditorPlugin(): EditorPlugin;
|
|
9
|
-
export declare function createDrawProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Draw: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupDrawProduct } from "./productRuntime";
|
|
2
|
+
export declare const Draw: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupDrawProduct>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DrawTool } from "./drawTool";
|
|
2
2
|
export { DrawShapeUtil } from "./drawShapeUtil";
|
|
3
|
-
export { DrawShapeSvgExporter, createDrawEditorPlugin
|
|
3
|
+
export { DrawShapeSvgExporter, createDrawEditorPlugin } from "./editorRuntime";
|
|
4
|
+
export { setupDrawProduct } from "./productRuntime";
|
|
4
5
|
export { DrawShapeSvg } from "./DrawShapeRenderer";
|
|
5
6
|
export { createDrawCanvasRenderPlugin } from "./canvasRender";
|
|
6
7
|
export { Draw } from "./feature";
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type EditorPlugin } from "../canvas-core/index";
|
|
1
|
+
import type { EditorPlugin } from "../canvas-core/index";
|
|
3
2
|
export declare function createEraserEditorPlugin(): EditorPlugin;
|
|
4
|
-
export declare function createEraserProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Eraser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupEraserProduct } from "./productRuntime";
|
|
2
|
+
export declare const Eraser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupEraserProduct>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { EraserTool } from "./eraserTool";
|
|
2
2
|
export { createEraserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
-
export { createEraserEditorPlugin
|
|
3
|
+
export { createEraserEditorPlugin } from "./editorRuntime";
|
|
4
|
+
export { setupEraserProduct } from "./productRuntime";
|
|
4
5
|
export { getEraserRuntime } from "./eraserRuntime";
|
|
5
6
|
export { Eraser } from "./feature";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ShapeColor, ShapeId } from "../canvas-core/index";
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-plugin-sdk/index";
|
|
3
|
+
export interface FrameInput {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
w?: number;
|
|
7
|
+
h?: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
fill?: ShapeColor;
|
|
10
|
+
stroke?: ShapeColor;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface FrameApi {
|
|
15
|
+
create(input: FrameInput): CanvasShapeRef<"frame"> | null;
|
|
16
|
+
moveShapesToFrame(ids: ShapeId[], frameId: ShapeId): ShapeId[];
|
|
17
|
+
}
|
|
18
|
+
export declare const frameApiToken: import("../canvas-plugin-sdk/index").ProductApiToken<FrameApi>;
|
|
19
|
+
export declare const framePluginApi: CanvasPluginApi<FrameApi>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
|
-
import type
|
|
2
|
+
import { type FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
interface FrameShapeSvgProps {
|
|
4
4
|
shape: FrameShapeRecord;
|
|
5
|
-
|
|
5
|
+
hideName?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function createFrameCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
8
|
-
export declare function FrameShapeSvg({ shape,
|
|
8
|
+
export declare function FrameShapeSvg({ shape, hideName, }: FrameShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import { type EditorPlugin, type ShapeSvgExporter, type SvgNode, type SvgExportContext } from "../canvas-core/index";
|
|
3
2
|
import { type FrameShapeRecord } from "./frameShapeUtil";
|
|
4
3
|
export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShapeRecord> {
|
|
@@ -6,4 +5,3 @@ export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShap
|
|
|
6
5
|
toSvg(shape: FrameShapeRecord, context: SvgExportContext): SvgNode;
|
|
7
6
|
}
|
|
8
7
|
export declare function createFrameEditorPlugin(): EditorPlugin;
|
|
9
|
-
export declare function createFrameProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Frame: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupFrameProduct } from "./productRuntime";
|
|
2
|
+
export declare const Frame: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupFrameProduct>;
|
|
@@ -8,12 +8,20 @@ export interface FrameShapeProps {
|
|
|
8
8
|
strokeWidth: number;
|
|
9
9
|
}
|
|
10
10
|
export type FrameShapeRecord = ShapeRecordBase<"frame", FrameShapeProps>;
|
|
11
|
+
export declare const FRAME_NAME_BASELINE = -8;
|
|
12
|
+
export declare const FRAME_NAME_FALLBACK = "Frame";
|
|
13
|
+
export declare const FRAME_NAME_FONT_SIZE = 12;
|
|
14
|
+
export declare const FRAME_NAME_RENDER_HEIGHT = 34;
|
|
15
|
+
export declare function getFrameDisplayName(name: string): string;
|
|
16
|
+
export declare function getFrameRenderBounds(shape: FrameShapeRecord): Box;
|
|
11
17
|
export declare class FrameShapeUtil extends ShapeUtil<FrameShapeRecord> {
|
|
12
18
|
readonly type: "frame";
|
|
13
19
|
getDefaultProps(): FrameShapeProps;
|
|
14
20
|
validateProps(props: unknown): FrameShapeProps;
|
|
15
21
|
getLocalBounds(shape: FrameShapeRecord): Box;
|
|
22
|
+
getRenderBounds(shape: FrameShapeRecord): Box;
|
|
16
23
|
getPointHitTestBounds(shape: FrameShapeRecord): Box;
|
|
24
|
+
canEdit(_shape: FrameShapeRecord): boolean;
|
|
17
25
|
canReceiveChildren(_shape: FrameShapeRecord): boolean;
|
|
18
26
|
canSnapChildrenToSelf(_shape: FrameShapeRecord): boolean;
|
|
19
27
|
canReceiveTerminalBinding(_shape: FrameShapeRecord): boolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { FrameShapeUtil } from "./frameShapeUtil";
|
|
2
|
+
export { frameApiToken } from "./api";
|
|
3
|
+
export type { FrameApi, FrameInput } from "./api";
|
|
2
4
|
export type { FrameShapeProps, FrameShapeRecord } from "./frameShapeUtil";
|
|
3
5
|
export { FrameTool } from "./frameTool";
|
|
4
|
-
export { FrameShapeSvgExporter, createFrameEditorPlugin
|
|
6
|
+
export { FrameShapeSvgExporter, createFrameEditorPlugin } from "./editorRuntime";
|
|
7
|
+
export { setupFrameProduct } from "./productRuntime";
|
|
5
8
|
export { createFrameCanvasRenderPlugin } from "./canvasRender";
|
|
6
9
|
export { Frame } from "./feature";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ShapeColor } from "../canvas-core/index";
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-plugin-sdk/index";
|
|
3
|
+
import type { GeoShapeProps } from "./types";
|
|
4
|
+
export interface GeoShapeInput {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
w?: number;
|
|
8
|
+
h?: number;
|
|
9
|
+
fill?: ShapeColor;
|
|
10
|
+
stroke?: ShapeColor;
|
|
11
|
+
strokeStyle?: GeoShapeProps["strokeStyle"];
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
meta?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface GeoRectangleInput extends GeoShapeInput {
|
|
16
|
+
cornerRadiusPercent?: GeoShapeProps["cornerRadiusPercent"];
|
|
17
|
+
}
|
|
18
|
+
export interface GeoApi {
|
|
19
|
+
createRectangle(input: GeoRectangleInput): CanvasShapeRef<"geo"> | null;
|
|
20
|
+
createEllipse(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
21
|
+
createRhombus(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
22
|
+
createTriangle(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
23
|
+
createHexagon(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
24
|
+
createStar(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
25
|
+
}
|
|
26
|
+
export declare const geoApiToken: import("../canvas-plugin-sdk/index").ProductApiToken<GeoApi>;
|
|
27
|
+
export declare const geoPluginApi: CanvasPluginApi<GeoApi>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type ShapeColor } from "../canvas-core/index";
|
|
2
2
|
import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
3
|
-
import type { GeoShapeRecord } from "./types";
|
|
3
|
+
import type { GeoShapeRecord, GeoStrokeStyle } from "./types";
|
|
4
4
|
interface GeoShapeSvgProps {
|
|
5
5
|
shape: GeoShapeRecord;
|
|
6
6
|
fill?: ShapeColor;
|
|
7
|
-
isHovered?: boolean;
|
|
8
7
|
stroke?: ShapeColor;
|
|
8
|
+
strokeStyle?: GeoStrokeStyle;
|
|
9
9
|
strokeWidth?: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function createGeoCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
12
|
-
export declare function GeoShapeSvg({ shape, fill,
|
|
12
|
+
export declare function GeoShapeSvg({ shape, fill, stroke, strokeStyle, strokeWidth, }: GeoShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
3
|
-
import {
|
|
2
|
+
import type { GeoShapeRecord } from "./types";
|
|
4
3
|
export declare class GeoShapeSvgExporter implements ShapeSvgExporter<GeoShapeRecord> {
|
|
5
4
|
readonly type: "geo";
|
|
6
5
|
toSvg(shape: GeoShapeRecord, context: SvgExportContext): SvgNode;
|
|
7
6
|
}
|
|
8
7
|
export declare function createGeoEditorPlugin(): EditorPlugin;
|
|
9
|
-
export declare function createGeoProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Geo: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupGeoProduct } from "./productRuntime";
|
|
2
|
+
export declare const Geo: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupGeoProduct>;
|
|
@@ -12,7 +12,7 @@ export declare class RectangleTool extends BoxGeoTool {
|
|
|
12
12
|
export declare class EllipseTool extends BoxGeoTool {
|
|
13
13
|
constructor(editor: Editor);
|
|
14
14
|
}
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class RhombusTool extends BoxGeoTool {
|
|
16
16
|
constructor(editor: Editor);
|
|
17
17
|
}
|
|
18
18
|
export declare class TriangleTool extends BoxGeoTool {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { EllipseTool, HexagonTool, RectangleTool, RhombusTool, StarTool, TriangleTool, } from "./geoTools";
|
|
2
|
+
export { geoApiToken } from "./api";
|
|
3
|
+
export type { GeoApi, GeoRectangleInput, GeoShapeInput, } from "./api";
|
|
2
4
|
export { GeoShapeUtil } from "./geoShapeUtil";
|
|
3
|
-
export { GeoShapeSvgExporter, createGeoEditorPlugin
|
|
5
|
+
export { GeoShapeSvgExporter, createGeoEditorPlugin } from "./editorRuntime";
|
|
6
|
+
export { setupGeoProduct } from "./productRuntime";
|
|
4
7
|
export { GeoShapeSvg, createGeoCanvasRenderPlugin } from "./canvasRender";
|
|
5
8
|
export { Geo } from "./feature";
|
|
6
|
-
export type { GeoShapeKind, GeoShapeProps, GeoShapeRecord } from "./types";
|
|
7
|
-
export { GEO_SHAPE_KINDS, isGeoShapeKind, isGeoShapeRecord } from "./types";
|
|
9
|
+
export type { GeoShapeKind, GeoShapeProps, GeoShapeRecord, GeoStrokeStyle, } from "./types";
|
|
10
|
+
export { GEO_SHAPE_KINDS, GEO_STROKE_STYLES, isGeoShapeKind, isGeoShapeRecord, isGeoStrokeStyle, } from "./types";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type ShapeColor, type BaseRecord, type ShapeRecordBase } from "../canvas-core/index";
|
|
2
|
-
export declare const GEO_SHAPE_KINDS: readonly ["rectangle", "ellipse", "
|
|
2
|
+
export declare const GEO_SHAPE_KINDS: readonly ["rectangle", "ellipse", "rhombus", "triangle", "hexagon", "star"];
|
|
3
3
|
export type GeoShapeKind = (typeof GEO_SHAPE_KINDS)[number];
|
|
4
|
+
export declare const GEO_STROKE_STYLES: readonly ["solid", "dashed", "dotted", "none"];
|
|
5
|
+
export type GeoStrokeStyle = (typeof GEO_STROKE_STYLES)[number];
|
|
4
6
|
export interface GeoShapeProps {
|
|
5
7
|
w: number;
|
|
6
8
|
h: number;
|
|
7
9
|
geo: GeoShapeKind;
|
|
8
10
|
fill: ShapeColor;
|
|
9
11
|
stroke: ShapeColor;
|
|
12
|
+
strokeStyle: GeoStrokeStyle;
|
|
10
13
|
strokeWidth: number;
|
|
11
14
|
cornerRadiusPercent: number;
|
|
12
15
|
}
|
|
@@ -16,3 +19,4 @@ export interface GeoShapeRecord extends ShapeRecordBase<"geo", GeoShapeProps> {
|
|
|
16
19
|
}
|
|
17
20
|
export declare function isGeoShapeRecord(record: BaseRecord | null | undefined): record is GeoShapeRecord;
|
|
18
21
|
export declare function isGeoShapeKind(value: unknown): value is GeoShapeKind;
|
|
22
|
+
export declare function isGeoStrokeStyle(value: unknown): value is GeoStrokeStyle;
|
|
@@ -2,9 +2,8 @@ import { type CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
|
2
2
|
import type { GroupShapeRecord } from "./groupShapeUtil";
|
|
3
3
|
interface GroupShapeSvgProps {
|
|
4
4
|
shape: GroupShapeRecord;
|
|
5
|
-
isHovered?: boolean;
|
|
6
5
|
isSelected?: boolean;
|
|
7
6
|
}
|
|
8
7
|
export declare function createGroupCanvasRenderPlugin(): CanvasRenderPlugin;
|
|
9
|
-
export declare function GroupShapeSvg({ shape,
|
|
8
|
+
export declare function GroupShapeSvg({ shape, isSelected, }: GroupShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import { type EditorPlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
3
2
|
import { type GroupShapeRecord } from "./groupShapeUtil";
|
|
4
3
|
export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShapeRecord> {
|
|
@@ -6,4 +5,3 @@ export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShap
|
|
|
6
5
|
toSvg(_shape: GroupShapeRecord): SvgNode;
|
|
7
6
|
}
|
|
8
7
|
export declare function createGroupEditorPlugin(): EditorPlugin;
|
|
9
|
-
export declare function createGroupProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Group: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupGroupProduct } from "./productRuntime";
|
|
2
|
+
export declare const Group: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupGroupProduct>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { GroupShapeUtil } from "./groupShapeUtil";
|
|
2
2
|
export type { GroupShapeProps, GroupShapeRecord } from "./groupShapeUtil";
|
|
3
|
-
export { GroupShapeSvgExporter, createGroupEditorPlugin
|
|
3
|
+
export { GroupShapeSvgExporter, createGroupEditorPlugin } from "./editorRuntime";
|
|
4
|
+
export { setupGroupProduct } from "./productRuntime";
|
|
4
5
|
export { createGroupCanvasRenderPlugin } from "./canvasRender";
|
|
5
6
|
export { Group } from "./feature";
|
|
6
7
|
export { groupContextMenuContribution, GROUP_SELECTION_ACTION_ID, groupSelectionAction, groupToolbarContribution, UNGROUP_SELECTION_ACTION_ID, ungroupSelectionAction, } from "./groupContributions";
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import type { EditorPlugin } from "../canvas-core/index";
|
|
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";
|
|
4
2
|
export { ImageShapeSvgExporter } from "./imageSvgExporter";
|
|
5
|
-
export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
|
|
6
3
|
export declare function createImageEditorPlugin(): EditorPlugin;
|
|
7
|
-
export declare function createImageProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Image: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupImageProduct } from "./productRuntime";
|
|
2
|
+
export declare const Image: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupImageProduct>;
|
|
@@ -1,4 +1,5 @@
|
|
|
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,
|
|
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, isImageCropToolbarSession, isImageSmudgeToolbarSession, setupImageProduct, } from "./productRuntime";
|
|
2
|
+
export { ImageShapeSvgExporter, createImageEditorPlugin, } from "./editorRuntime";
|
|
2
3
|
export { createImageCanvasRenderPlugin } from "./canvasRender";
|
|
3
4
|
export { createImageCropInteractionHandler, createImageCropSelectionHandleInteractionHandler, } from "./cropInteractions";
|
|
4
5
|
export { createImageSmudgeInteractionHandler } from "./smudgeInteractions";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
|
|
2
|
+
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
|
+
export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
|
|
4
|
+
export declare function setupImageProduct(context: CanvasPluginSetupContext): void;
|
|
@@ -12,6 +12,11 @@ export declare function createImageCornerRadiusToolbarItem({ dataUiPrefix, }: {
|
|
|
12
12
|
id: string;
|
|
13
13
|
actionId: string;
|
|
14
14
|
label: string;
|
|
15
|
+
icon: string;
|
|
15
16
|
placeholder: string;
|
|
17
|
+
suffix: string;
|
|
18
|
+
validate: typeof isValidImageCornerRadiusToolbarValue;
|
|
16
19
|
dataUi: string;
|
|
17
20
|
};
|
|
21
|
+
declare function isValidImageCornerRadiusToolbarValue(value: string): boolean;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type EditorPlugin } from "../canvas-core/index";
|
|
1
|
+
import type { EditorPlugin } from "../canvas-core/index";
|
|
3
2
|
export declare function createLaserEditorPlugin(): EditorPlugin;
|
|
4
|
-
export declare function createLaserProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Laser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupLaserProduct } from "./productRuntime";
|
|
2
|
+
export declare const Laser: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupLaserProduct>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { LaserTool } from "./laserTool";
|
|
2
2
|
export { createLaserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
-
export { createLaserEditorPlugin
|
|
3
|
+
export { createLaserEditorPlugin } from "./editorRuntime";
|
|
4
|
+
export { setupLaserProduct } from "./productRuntime";
|
|
4
5
|
export { getLaserRuntime } from "./laserRuntime";
|
|
5
6
|
export { Laser } from "./feature";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import type
|
|
4
|
-
|
|
1
|
+
import { type PageId, type ShapeColor, type ShapeId } from "../canvas-core/index";
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-plugin-sdk/index";
|
|
3
|
+
import { type PackagingPdfExportOptions, type PackagingPdfExportResult } from "./packagingPdfExporter";
|
|
4
|
+
import { type PackagingDxfImportOptions } from "./packagingDxf";
|
|
5
|
+
import type { PackagingDocument, PackagingSurfaceSide } from "./types";
|
|
6
|
+
export interface PackagingInput {
|
|
5
7
|
x: number;
|
|
6
8
|
y: number;
|
|
7
9
|
document: PackagingDocument;
|
|
@@ -15,7 +17,7 @@ export interface CanvasKitPackagingInput {
|
|
|
15
17
|
showCanvasBoundsMarks?: boolean;
|
|
16
18
|
meta?: Record<string, unknown>;
|
|
17
19
|
}
|
|
18
|
-
export interface
|
|
20
|
+
export interface PackagingDxfImportInput {
|
|
19
21
|
source: string;
|
|
20
22
|
fileName?: string;
|
|
21
23
|
pagePoint?: {
|
|
@@ -24,14 +26,14 @@ export interface CanvasKitPackagingDxfImportInput {
|
|
|
24
26
|
};
|
|
25
27
|
options?: Omit<PackagingDxfImportOptions, "fileName">;
|
|
26
28
|
}
|
|
27
|
-
export interface
|
|
28
|
-
create(input:
|
|
29
|
-
importDxf(input:
|
|
29
|
+
export interface PackagingApi {
|
|
30
|
+
create(input: PackagingInput): CanvasShapeRef<"packaging"> | null;
|
|
31
|
+
importDxf(input: PackagingDxfImportInput): CanvasShapeRef<"packaging"> | null;
|
|
30
32
|
updateDocument(input: {
|
|
31
33
|
packagingId: ShapeId;
|
|
32
34
|
document: PackagingDocument;
|
|
33
35
|
expectedRevision?: string;
|
|
34
|
-
}):
|
|
36
|
+
}): CanvasShapeRef<"packaging"> | null;
|
|
35
37
|
getDocument(packagingId: ShapeId): PackagingDocument | null;
|
|
36
38
|
exportPdf(input: {
|
|
37
39
|
packagingId: ShapeId;
|
|
@@ -68,4 +70,5 @@ export interface PackagingController {
|
|
|
68
70
|
shapeId: ShapeId;
|
|
69
71
|
}): string[];
|
|
70
72
|
}
|
|
71
|
-
export declare
|
|
73
|
+
export declare const packagingApiToken: import("../canvas-plugin-sdk/index").ProductApiToken<PackagingApi>;
|
|
74
|
+
export declare const packagingPluginApi: CanvasPluginApi<PackagingApi>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Packaging:
|
|
1
|
+
import { setupPackagingProduct } from "./productRuntime";
|
|
2
|
+
export declare const Packaging: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupPackagingProduct>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { createPackagingCanvasRenderPlugin } from "./canvasRender";
|
|
2
2
|
export { createPackagingEditorPlugin } from "./editorRuntime";
|
|
3
3
|
export { Packaging } from "./feature";
|
|
4
|
+
export { packagingApiToken } from "./api";
|
|
5
|
+
export type { PackagingApi, PackagingDxfImportInput, PackagingInput, } from "./api";
|
|
4
6
|
export { getPackagingArtworkPlacementMeta, getPackagingArtworkSide, PACKAGING_ARTWORK_SIDE_META_KEY, } from "./packagingArtwork";
|
|
5
7
|
export { applyAffine2d, compilePackagingContour, compilePackagingGeometry, doesPackagingSegmentHitFace, getCompiledPackagingGeometry, getCoveredPackagingFaceIds, getPackagingFaceUv, getPackagingCanvasBoundsMarkPaths, getPackagingStrokeDasharray, hitTestPackagingFace, invertAffine2d, isPointInPackagingFace, } from "./packagingGeometry";
|
|
6
8
|
export type { CompiledPackagingEdge, CompiledPackagingFace, CompiledPackagingContour, CompiledPackagingGeometry, PackagingMultiPolygon, PackagingPolygon, PackagingRing, PackagingSpatialIndex, } from "./packagingGeometry";
|
|
@@ -12,6 +14,6 @@ export { parsePackagingDxf } from "./packagingDxf";
|
|
|
12
14
|
export type { PackagingDxfImportOptions } from "./packagingDxf";
|
|
13
15
|
export { exportPackagingPdf, getPackagingPointsPerUnit, } from "./packagingPdfExporter";
|
|
14
16
|
export type { PackagingPdfExportOptions, PackagingPdfExportResult, } from "./packagingPdfExporter";
|
|
15
|
-
export {
|
|
17
|
+
export { setupPackagingProduct } from "./productRuntime";
|
|
16
18
|
export { clonePackagingDocument, parsePackagingDocument, } from "./validation";
|
|
17
19
|
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";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function
|
|
1
|
+
import { type CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
|
|
2
|
+
export declare function setupPackagingProduct(context: CanvasPluginSetupContext): void;
|
|
@@ -2,11 +2,14 @@ import { type ShapeColor, type ShapeEditingSession } from "../canvas-core/index"
|
|
|
2
2
|
import type { PathShapeRecord } from "./types";
|
|
3
3
|
interface PathShapeSvgProps {
|
|
4
4
|
shape: PathShapeRecord;
|
|
5
|
-
isHovered?: boolean;
|
|
6
5
|
shapeEditingSession?: ShapeEditingSession | null;
|
|
7
6
|
fill?: ShapeColor;
|
|
8
7
|
stroke?: ShapeColor;
|
|
9
8
|
strokeWidth?: number;
|
|
10
9
|
}
|
|
11
|
-
export declare function PathShapeSvg({ shape,
|
|
10
|
+
export declare function PathShapeSvg({ shape, shapeEditingSession, fill, stroke, strokeWidth, }: PathShapeSvgProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function PathShapeHoverSvg({ shape, strokeWidth, }: {
|
|
12
|
+
shape: PathShapeRecord;
|
|
13
|
+
strokeWidth: number;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
15
|
export {};
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
import { type CanvasProductContribution } from "../canvas-plugin-sdk/index";
|
|
2
1
|
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
3
|
-
import {
|
|
4
|
-
export declare const PATH_EDIT_TOOLBAR_ACTION_ID = "path.edit";
|
|
5
|
-
export declare const PATH_EDIT_SNAP_ACTION_ID = "path.edit.snap-nodes";
|
|
6
|
-
export declare const PATH_BOOLEAN_UNION_ACTION_ID = "path.boolean.union";
|
|
7
|
-
export declare const PATH_BOOLEAN_SUBTRACT_ACTION_ID = "path.boolean.subtract";
|
|
8
|
-
export declare const PATH_BOOLEAN_INTERSECT_ACTION_ID = "path.boolean.intersect";
|
|
9
|
-
export declare const PATH_BOOLEAN_XOR_ACTION_ID = "path.boolean.xor";
|
|
10
|
-
export declare const PATH_NODE_DELETE_ACTION_ID = "path.node.delete";
|
|
11
|
-
export declare const PATH_NODE_MAKE_CURVE_ACTION_ID = "path.node.make-curve";
|
|
12
|
-
export declare const PATH_NODE_REMOVE_HANDLES_ACTION_ID = "path.node.remove-handles";
|
|
13
|
-
export declare const PATH_NODE_MERGE_ACTION_ID = "path.node.merge";
|
|
14
|
-
export declare const PATH_NODE_JOIN_ACTION_ID = "path.node.join";
|
|
15
|
-
export declare const PATH_NODE_SEPARATE_ACTION_ID = "path.node.separate";
|
|
2
|
+
import type { PathShapeRecord } from "./types";
|
|
16
3
|
export declare class PathShapeSvgExporter implements ShapeSvgExporter<PathShapeRecord> {
|
|
17
4
|
readonly type: "path";
|
|
18
5
|
toSvg(shape: PathShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
19
6
|
}
|
|
20
7
|
export declare function createPathEditorPlugin(): EditorPlugin;
|
|
21
|
-
export declare function createPathProductContribution(): CanvasProductContribution;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const Path: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof
|
|
1
|
+
import { setupPathProduct } from "./productRuntime";
|
|
2
|
+
export declare const Path: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupPathProduct>;
|