@yuzhouu/canvas-kit 0.1.2 → 0.1.4
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 +80 -78
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +45 -0
- package/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
- package/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
- package/_vendor/canvas-core/editor/camera.d.ts +3 -0
- package/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
- package/_vendor/canvas-core/editor/commands.d.ts +131 -0
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/edgeScroll.d.ts +5 -0
- package/_vendor/canvas-core/editor/editor.d.ts +559 -0
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +21 -0
- package/_vendor/canvas-core/editor/editorSelectionTransforms.d.ts +6 -0
- package/_vendor/canvas-core/editor/events.d.ts +71 -0
- package/_vendor/canvas-core/editor/historyManager.d.ts +18 -0
- package/_vendor/canvas-core/editor/index.d.ts +11 -0
- package/_vendor/canvas-core/editor/interactions.d.ts +51 -0
- package/_vendor/canvas-core/editor/internal.d.ts +7 -0
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +27 -0
- package/_vendor/canvas-core/editor/managers/cameraManager.d.ts +39 -0
- package/_vendor/canvas-core/editor/managers/clipboardManager.d.ts +14 -0
- package/_vendor/canvas-core/editor/managers/documentSnapshotManager.d.ts +28 -0
- package/_vendor/canvas-core/editor/managers/inputsManager.d.ts +44 -0
- package/_vendor/canvas-core/editor/managers/interactionTransientManager.d.ts +55 -0
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +77 -0
- package/_vendor/canvas-core/editor/managers/queryState.d.ts +18 -0
- package/_vendor/canvas-core/editor/managers/renderWindowManager.d.ts +25 -0
- package/_vendor/canvas-core/editor/managers/selectionGeometry.d.ts +28 -0
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/selectionManager.d.ts +21 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +24 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/shapeGeometryManager.d.ts +42 -0
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +55 -0
- package/_vendor/canvas-core/editor/managers/shapeOrder.d.ts +14 -0
- package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +6 -0
- package/_vendor/canvas-core/editor/managers/shortcutManager.d.ts +56 -0
- package/_vendor/canvas-core/editor/managers/sideEffectManager.d.ts +23 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +40 -0
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +26 -0
- package/_vendor/canvas-core/editor/managers/snapIndicators.d.ts +22 -0
- package/_vendor/canvas-core/editor/managers/snapManager.d.ts +29 -0
- package/_vendor/canvas-core/editor/managers/snapSnapshotBuilder.d.ts +22 -0
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +98 -0
- package/_vendor/canvas-core/editor/managers/spatialIndexManager.d.ts +30 -0
- package/_vendor/canvas-core/editor/managers/toolManager.d.ts +24 -0
- package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +27 -0
- package/_vendor/canvas-core/editor/renderWindow.d.ts +30 -0
- package/_vendor/canvas-core/editor/resizeGeometry.d.ts +97 -0
- package/_vendor/canvas-core/editor/selection.d.ts +231 -0
- package/_vendor/canvas-core/editor/selectionHandleInteractions.d.ts +11 -0
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +33 -0
- package/_vendor/canvas-core/editor/stateNode.d.ts +31 -0
- package/_vendor/canvas-core/exports/integrity.d.ts +32 -0
- package/_vendor/canvas-core/exports/svg.d.ts +52 -0
- package/_vendor/canvas-core/geometry/box.d.ts +19 -0
- package/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
- package/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
- package/_vendor/canvas-core/geometry/index.d.ts +8 -0
- package/_vendor/canvas-core/geometry/mat.d.ts +28 -0
- package/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
- package/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
- package/_vendor/canvas-core/geometry/segments.d.ts +5 -0
- package/_vendor/canvas-core/geometry/vec.d.ts +37 -0
- package/_vendor/canvas-core/index.d.ts +59 -0
- package/_vendor/canvas-core/plugins/editorPlugin.d.ts +28 -0
- package/_vendor/canvas-core/plugins/index.d.ts +1 -0
- package/_vendor/canvas-core/reactivity.d.ts +4 -0
- package/_vendor/canvas-core/schema/records.d.ts +112 -0
- package/_vendor/canvas-core/schema/snapshotSupport.d.ts +43 -0
- package/_vendor/canvas-core/schema/snapshots.d.ts +31 -0
- package/_vendor/canvas-core/shapes/capabilities.d.ts +25 -0
- package/_vendor/canvas-core/shapes/colors.d.ts +26 -0
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +146 -0
- package/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
- package/_vendor/canvas-core/shapes/types.d.ts +2 -0
- package/_vendor/canvas-core/surfaces/actions.d.ts +35 -0
- package/_vendor/canvas-core/surfaces/contextMenu.d.ts +64 -0
- package/_vendor/canvas-core/surfaces/toolbar.d.ts +96 -0
- package/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/index.d.ts +2 -0
- package/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
- package/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +161 -0
- package/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
- package/_vendor/canvas-core/tools/select/states/draggingSelectionHandleInteractionState.d.ts +15 -0
- package/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
- package/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
- package/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
- package/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +10 -0
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +17 -0
- package/_vendor/canvas-react/components/CanvasView.d.ts +14 -0
- package/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
- package/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
- package/_vendor/canvas-react/components/ShapeLayer.d.ts +4 -0
- package/_vendor/canvas-react/components/index.d.ts +2 -0
- package/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
- package/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
- package/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
- package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +21 -0
- package/_vendor/canvas-react/dom.d.ts +10 -0
- package/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
- package/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
- package/_vendor/canvas-react/host/canvasOverlayRegistryContext.d.ts +3 -0
- package/_vendor/canvas-react/host/canvasPlugin.d.ts +73 -0
- package/_vendor/canvas-react/host/canvasRendererRegistryContext.d.ts +3 -0
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +12 -0
- package/_vendor/canvas-react/host/domEventGuards.d.ts +11 -0
- package/_vendor/canvas-react/host/extension.d.ts +37 -0
- package/_vendor/canvas-react/host/index.d.ts +13 -0
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +18 -0
- package/_vendor/canvas-react/host/pluginHost.d.ts +2 -0
- package/_vendor/canvas-react/host/pluginHostManifest.d.ts +2 -0
- package/_vendor/canvas-react/host/pluginHostRuntime.d.ts +3 -0
- package/_vendor/canvas-react/host/pluginHostTypes.d.ts +102 -0
- package/_vendor/canvas-react/host/pluginHostValidation.d.ts +11 -0
- package/_vendor/canvas-react/host/rendererRegistry.d.ts +12 -0
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +24 -0
- package/_vendor/canvas-react/index.d.ts +4 -0
- package/_vendor/plugin-arrow/arrowBindingAnchors.d.ts +5 -0
- package/_vendor/plugin-arrow/arrowBindingGeometry.d.ts +28 -0
- package/_vendor/plugin-arrow/arrowBindingUtil.d.ts +27 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +74 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +21 -0
- package/_vendor/plugin-arrow/arrowTerminalBindingResolver.d.ts +20 -0
- package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +12 -0
- package/_vendor/plugin-arrow/arrowTool.d.ts +4 -0
- package/_vendor/plugin-arrow/canvas.d.ts +2 -0
- package/_vendor/plugin-arrow/editor.d.ts +7 -0
- package/_vendor/plugin-arrow/feature.d.ts +3 -0
- package/_vendor/plugin-arrow/index.d.ts +12 -0
- package/_vendor/plugin-arrow/selectionHandleInteractions.d.ts +3 -0
- package/_vendor/plugin-arrow/types.d.ts +31 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +10 -0
- package/_vendor/plugin-draw/canvas.d.ts +2 -0
- package/_vendor/plugin-draw/drawGeometry.d.ts +45 -0
- package/_vendor/plugin-draw/drawHitTest.d.ts +11 -0
- package/_vendor/plugin-draw/drawInterpolation.d.ts +5 -0
- package/_vendor/plugin-draw/drawPath.d.ts +37 -0
- package/_vendor/plugin-draw/drawSegments.d.ts +11 -0
- package/_vendor/plugin-draw/drawSelectionTransform.d.ts +18 -0
- package/_vendor/plugin-draw/drawShapeGeometry.d.ts +33 -0
- package/_vendor/plugin-draw/drawShapeUtil.d.ts +21 -0
- package/_vendor/plugin-draw/drawStrokeGeometry.d.ts +17 -0
- package/_vendor/plugin-draw/drawTool.d.ts +6 -0
- package/_vendor/plugin-draw/editor.d.ts +7 -0
- package/_vendor/plugin-draw/feature.d.ts +3 -0
- package/_vendor/plugin-draw/index.d.ts +13 -0
- package/_vendor/plugin-draw/types.d.ts +23 -0
- package/_vendor/plugin-eraser/canvas.d.ts +2 -0
- package/_vendor/plugin-eraser/editor.d.ts +2 -0
- package/_vendor/plugin-eraser/eraserTool.d.ts +5 -0
- package/_vendor/plugin-eraser/feature.d.ts +3 -0
- package/_vendor/plugin-eraser/{index.ts → index.d.ts} +2 -2
- package/_vendor/plugin-frame/canvas.d.ts +9 -0
- package/_vendor/plugin-frame/editor.d.ts +7 -0
- package/_vendor/plugin-frame/feature.d.ts +3 -0
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +23 -0
- package/_vendor/plugin-frame/frameTool.d.ts +6 -0
- package/_vendor/plugin-frame/index.d.ts +6 -0
- package/_vendor/plugin-geo/canvas.d.ts +13 -0
- package/_vendor/plugin-geo/editor.d.ts +7 -0
- package/_vendor/plugin-geo/feature.d.ts +3 -0
- package/_vendor/plugin-geo/geoGeometry.d.ts +8 -0
- package/_vendor/plugin-geo/geoShapeUtil.d.ts +13 -0
- package/_vendor/plugin-geo/geoTools.d.ts +26 -0
- package/_vendor/plugin-geo/index.d.ts +7 -0
- package/_vendor/plugin-geo/types.d.ts +17 -0
- package/_vendor/plugin-group/canvas.d.ts +10 -0
- package/_vendor/plugin-group/editor.d.ts +7 -0
- package/_vendor/plugin-group/feature.d.ts +3 -0
- package/_vendor/plugin-group/groupShapeUtil.d.ts +15 -0
- package/_vendor/plugin-group/index.d.ts +5 -0
- package/_vendor/plugin-image/canvas.d.ts +2 -0
- package/_vendor/plugin-image/crop.d.ts +112 -0
- package/_vendor/plugin-image/cropInteractions.d.ts +3 -0
- package/_vendor/plugin-image/cropSession.d.ts +4 -0
- package/_vendor/plugin-image/editor.d.ts +16 -0
- package/_vendor/plugin-image/feature.d.ts +3 -0
- package/_vendor/plugin-image/imageShapeUtil.d.ts +11 -0
- package/_vendor/plugin-image/index.d.ts +8 -0
- package/_vendor/plugin-image/types.d.ts +37 -0
- package/_vendor/plugin-laser/canvas.d.ts +2 -0
- package/_vendor/plugin-laser/editor.d.ts +2 -0
- package/_vendor/plugin-laser/feature.d.ts +3 -0
- package/_vendor/plugin-laser/{index.ts → index.d.ts} +2 -2
- package/_vendor/plugin-laser/laserTool.d.ts +4 -0
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +42 -0
- package/_vendor/plugin-text/canvas.d.ts +2 -0
- package/_vendor/plugin-text/editor.d.ts +2 -0
- package/_vendor/plugin-text/feature.d.ts +3 -0
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +45 -0
- package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +5 -0
- package/_vendor/plugin-text/host/RichTextToolbar.d.ts +8 -0
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +24 -0
- package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +7 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +3 -0
- package/_vendor/plugin-text/host/textDomSelection.d.ts +7 -0
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +3 -0
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +22 -0
- package/_vendor/plugin-text/host/textFontLoader.d.ts +2 -0
- package/_vendor/plugin-text/host/textMeasurement.d.ts +12 -0
- package/_vendor/plugin-text/host/textMeasurementSync.d.ts +10 -0
- package/_vendor/plugin-text/host/textRangeSelection.d.ts +14 -0
- package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +8 -0
- package/_vendor/plugin-text/host/textShapeSync.d.ts +17 -0
- package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +33 -0
- package/_vendor/plugin-text/index.d.ts +4 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +18 -0
- package/_vendor/plugin-text/textInteractions.d.ts +2 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +44 -0
- package/_vendor/plugin-text/textShapeHelpers.d.ts +21 -0
- package/_vendor/plugin-text/textShapeSvgExporter.d.ts +6 -0
- package/_vendor/plugin-text/textShapeUtil.d.ts +19 -0
- package/_vendor/plugin-text/textStyle.d.ts +9 -0
- package/_vendor/plugin-text/textTool.d.ts +4 -0
- package/_vendor/plugin-text/textTypes.d.ts +28 -0
- package/_vendor/signals/atom.d.ts +9 -0
- package/_vendor/signals/computed.d.ts +11 -0
- package/_vendor/signals/core.d.ts +17 -0
- package/_vendor/signals/effect.d.ts +29 -0
- package/_vendor/signals/types.d.ts +15 -0
- package/_vendor/store/diff.d.ts +9 -0
- package/_vendor/store/history.d.ts +37 -0
- package/_vendor/store/index.d.ts +5 -0
- package/_vendor/store/store.d.ts +32 -0
- package/_vendor/store/types.d.ts +27 -0
- package/browser/localSnapshotRestore.d.ts +13 -0
- package/browser/persistence.d.ts +46 -0
- package/builtins/controller/createBuiltInCanvasController.d.ts +16 -0
- package/builtins/controller/layerController.d.ts +9 -0
- package/builtins/controller/shapeCreationController.d.ts +74 -0
- package/builtins/extensions.d.ts +15 -0
- package/builtins/index.d.ts +5 -0
- package/chrome/CanvasKitFloatingToolbarLayer.d.ts +6 -0
- package/chrome/FloatingSelectionToolbarPageSpace.d.ts +9 -0
- package/chrome/bindings/useCanvasKitChromeControls.d.ts +27 -0
- package/chrome/bindings/useContextMenuSurface.d.ts +12 -0
- package/chrome/bindings/useSvgExport.d.ts +15 -0
- package/chrome/bindings/useToolbarSurfaces.d.ts +26 -0
- package/chrome/types.d.ts +66 -0
- package/chrome/useCanvasKitChromeContext.d.ts +19 -0
- package/controller/canvasKitController.d.ts +36 -0
- package/core/controller/canvasProductController.d.ts +114 -0
- package/core/controller/featureControllerRegistry.d.ts +12 -0
- package/core/controller/index.d.ts +4 -0
- package/core/controller/productLayerTree.d.ts +10 -0
- package/core/features/actions/canvasActionContext.d.ts +15 -0
- package/core/features/actions/canvasActions.d.ts +26 -0
- package/core/features/clipboard/clipboardContextMenuContributions.d.ts +2 -0
- package/core/features/clipboard/clipboardContribution.d.ts +19 -0
- package/core/features/clipboard/clipboardService.d.ts +10 -0
- package/core/features/context-menu/contextMenuActions.d.ts +12 -0
- package/core/features/context-menu/contextMenuContext.d.ts +6 -0
- package/core/features/context-menu/contextMenuContribution.d.ts +4 -0
- package/core/features/context-menu/viewContextMenuContributions.d.ts +2 -0
- package/core/features/export/svgExport.d.ts +33 -0
- package/core/features/hostActionIds.d.ts +1 -0
- package/core/features/toolbar/selectionContextMenuContributions.d.ts +2 -0
- package/core/features/toolbar/toolContextMenuContributions.d.ts +2 -0
- package/core/features/toolbar/toolbarContribution.d.ts +4 -0
- package/core/features/toolbar/toolbarLabels.d.ts +8 -0
- package/core/index.d.ts +23 -0
- package/core/runtime/productAssets.d.ts +18 -0
- package/core/runtime/productContributions.d.ts +9 -0
- package/core/runtime/productDefinition.d.ts +32 -0
- package/core/runtime/productEditor.d.ts +3 -0
- package/core/runtime/productHost.d.ts +17 -0
- package/core/runtime/productServices.d.ts +30 -0
- package/features/image/ImageImportController.d.ts +9 -0
- package/features/image/imageAssetService.d.ts +7 -0
- package/features/image/imageBlobStore.d.ts +25 -0
- package/features/image/imageFileHelpers.d.ts +35 -0
- package/features/image/imageHostActions.d.ts +36 -0
- package/features/image/imageHostExtension.d.ts +5 -0
- package/features/image/imageProductController.d.ts +22 -0
- package/features/image/imageProductToolbarActions.d.ts +2 -0
- package/features/image/imageToolbarHostBridge.d.ts +14 -0
- package/features/image/index.d.ts +15 -0
- package/features/image/svgImageAssetInliner.d.ts +3 -0
- package/features/image/useImageImport.d.ts +17 -0
- package/index.css +1 -2
- package/index.d.ts +12 -15
- package/index.mjs +66 -1
- package/package.json +1 -11
- package/product/canvasKitProduct.d.ts +59 -0
- package/react/CanvasKitPersistenceNotice.d.ts +4 -0
- package/react/CanvasKitRoot.d.ts +5 -0
- package/react/useCanvasKitController.d.ts +5 -0
- package/react/useCanvasKitKeyboardShortcuts.d.ts +6 -0
- package/react/useCanvasKitRuntime.d.ts +4 -0
- package/react/useCanvasKitStartup.d.ts +9 -0
- package/runtime/canvasKitHostExtensions.d.ts +19 -0
- package/runtime/canvasKitRuntime.d.ts +19 -0
- package/runtime/canvasKitRuntimeInitializer.d.ts +11 -0
- package/_vendor/canvas-core/bindings/BindingUtil.ts +0 -92
- package/_vendor/canvas-core/bindings/BindingUtilRegistry.ts +0 -22
- package/_vendor/canvas-core/bindings/arrow/arrowBindingHelpers.ts +0 -52
- package/_vendor/canvas-core/contextMenu.ts +0 -85
- package/_vendor/canvas-core/editor/Editor.ts +0 -2614
- package/_vendor/canvas-core/editor/HistoryManager.ts +0 -83
- package/_vendor/canvas-core/editor/StateNode.ts +0 -162
- package/_vendor/canvas-core/editor/camera.ts +0 -6
- package/_vendor/canvas-core/editor/clipboard.ts +0 -478
- package/_vendor/canvas-core/editor/commands.ts +0 -833
- package/_vendor/canvas-core/editor/edgeScroll.ts +0 -37
- package/_vendor/canvas-core/editor/editorComputedHelpers.ts +0 -257
- package/_vendor/canvas-core/editor/editorSelectionTransforms.ts +0 -116
- package/_vendor/canvas-core/editor/events.ts +0 -93
- package/_vendor/canvas-core/editor/index.ts +0 -12
- package/_vendor/canvas-core/editor/interactions.ts +0 -101
- package/_vendor/canvas-core/editor/internal.ts +0 -22
- package/_vendor/canvas-core/editor/managers/BindingManager.ts +0 -262
- package/_vendor/canvas-core/editor/managers/CameraManager.ts +0 -147
- package/_vendor/canvas-core/editor/managers/ClipboardManager.ts +0 -32
- package/_vendor/canvas-core/editor/managers/DocumentSnapshotManager.ts +0 -256
- package/_vendor/canvas-core/editor/managers/InputsManager.ts +0 -319
- package/_vendor/canvas-core/editor/managers/InteractionTransientManager.ts +0 -218
- package/_vendor/canvas-core/editor/managers/QueryManager.ts +0 -837
- package/_vendor/canvas-core/editor/managers/RenderWindowManager.ts +0 -347
- package/_vendor/canvas-core/editor/managers/SelectionLayoutManager.ts +0 -196
- package/_vendor/canvas-core/editor/managers/SelectionManager.ts +0 -98
- package/_vendor/canvas-core/editor/managers/SelectionOverlayManager.ts +0 -308
- package/_vendor/canvas-core/editor/managers/ShapeEditingManager.ts +0 -226
- package/_vendor/canvas-core/editor/managers/ShapeGeometryManager.ts +0 -162
- package/_vendor/canvas-core/editor/managers/ShapeHierarchyManager.ts +0 -797
- package/_vendor/canvas-core/editor/managers/SideEffectManager.ts +0 -83
- package/_vendor/canvas-core/editor/managers/SnapManager.ts +0 -433
- package/_vendor/canvas-core/editor/managers/SnapSnapshotBuilder.ts +0 -430
- package/_vendor/canvas-core/editor/managers/SpatialIndexManager.ts +0 -354
- package/_vendor/canvas-core/editor/managers/ToolManager.ts +0 -81
- package/_vendor/canvas-core/editor/managers/queryState.ts +0 -583
- package/_vendor/canvas-core/editor/managers/selectionGeometry.ts +0 -287
- package/_vendor/canvas-core/editor/managers/shapeOrder.ts +0 -350
- package/_vendor/canvas-core/editor/managers/shapeReparenting.ts +0 -160
- package/_vendor/canvas-core/editor/managers/snapCalculations.ts +0 -412
- package/_vendor/canvas-core/editor/managers/snapGeometry.ts +0 -202
- package/_vendor/canvas-core/editor/managers/snapIndicators.ts +0 -403
- package/_vendor/canvas-core/editor/managers/snapTypes.ts +0 -122
- package/_vendor/canvas-core/editor/queries/shapeTransforms.ts +0 -171
- package/_vendor/canvas-core/editor/renderWindow.ts +0 -439
- package/_vendor/canvas-core/editor/resizeGeometry.ts +0 -654
- package/_vendor/canvas-core/editor/selection.ts +0 -489
- package/_vendor/canvas-core/editor/selectionHandleInteractions.ts +0 -43
- package/_vendor/canvas-core/editor/selectionOverlay.ts +0 -567
- package/_vendor/canvas-core/exports/integrity.ts +0 -174
- package/_vendor/canvas-core/exports/svg.ts +0 -494
- package/_vendor/canvas-core/geometry/Box.ts +0 -80
- package/_vendor/canvas-core/geometry/Ellipse2d.ts +0 -67
- package/_vendor/canvas-core/geometry/Geometry2d.ts +0 -52
- package/_vendor/canvas-core/geometry/Mat.ts +0 -92
- package/_vendor/canvas-core/geometry/Polyline2d.ts +0 -63
- package/_vendor/canvas-core/geometry/Rectangle2d.ts +0 -64
- package/_vendor/canvas-core/geometry/Vec.ts +0 -123
- package/_vendor/canvas-core/geometry/index.ts +0 -13
- package/_vendor/canvas-core/geometry/segments.ts +0 -65
- package/_vendor/canvas-core/index.ts +0 -391
- package/_vendor/canvas-core/plugins/index.ts +0 -5
- package/_vendor/canvas-core/plugins/types.ts +0 -53
- package/_vendor/canvas-core/reactivity.ts +0 -16
- package/_vendor/canvas-core/schema/records.ts +0 -221
- package/_vendor/canvas-core/schema/snapshots.ts +0 -527
- package/_vendor/canvas-core/shapes/ShapeUtil.ts +0 -516
- package/_vendor/canvas-core/shapes/ShapeUtilRegistry.ts +0 -26
- package/_vendor/canvas-core/shapes/capabilities.ts +0 -67
- package/_vendor/canvas-core/shapes/types.ts +0 -20
- package/_vendor/canvas-core/toolbar.ts +0 -148
- package/_vendor/canvas-core/tools/hand/HandTool.ts +0 -75
- package/_vendor/canvas-core/tools/index.ts +0 -2
- package/_vendor/canvas-core/tools/select/SelectTool.ts +0 -33
- package/_vendor/canvas-core/tools/select/selectContainment.ts +0 -104
- package/_vendor/canvas-core/tools/select/selectToolHelpers.ts +0 -801
- package/_vendor/canvas-core/tools/select/states/BrushingState.ts +0 -145
- package/_vendor/canvas-core/tools/select/states/DraggingSelectionHandleInteractionState.ts +0 -116
- package/_vendor/canvas-core/tools/select/states/IdleState.ts +0 -159
- package/_vendor/canvas-core/tools/select/states/PointingCanvasState.ts +0 -41
- package/_vendor/canvas-core/tools/select/states/PointingResizeHandleState.ts +0 -78
- package/_vendor/canvas-core/tools/select/states/PointingRotateHandleState.ts +0 -64
- package/_vendor/canvas-core/tools/select/states/PointingSelectionHandleInteractionState.ts +0 -34
- package/_vendor/canvas-core/tools/select/states/PointingShapeState.ts +0 -140
- package/_vendor/canvas-core/tools/select/states/ResizingState.ts +0 -171
- package/_vendor/canvas-core/tools/select/states/RotatingState.ts +0 -124
- package/_vendor/canvas-core/tools/select/states/SelectStateNode.ts +0 -128
- package/_vendor/canvas-core/tools/select/states/TranslatingState.ts +0 -139
- package/_vendor/canvas-core/tools/select/states/index.ts +0 -11
- package/_vendor/canvas-plugin-api/feature.ts +0 -204
- package/_vendor/canvas-plugin-api/index.ts +0 -142
- package/_vendor/canvas-product-react/api/apiRegistry.ts +0 -35
- package/_vendor/canvas-product-react/api/canvasProductApi.ts +0 -422
- package/_vendor/canvas-product-react/api/index.ts +0 -31
- package/_vendor/canvas-product-react/capabilities/clipboard/clipboardService.ts +0 -36
- package/_vendor/canvas-product-react/capabilities/clipboard/systemClipboard.ts +0 -245
- package/_vendor/canvas-product-react/capabilities/context-menu/systemContextMenu.ts +0 -396
- package/_vendor/canvas-product-react/capabilities/context-menu/useContextMenuSurface.ts +0 -59
- package/_vendor/canvas-product-react/capabilities/export/useSvgExport.ts +0 -156
- package/_vendor/canvas-product-react/capabilities/history/useHistoryControls.ts +0 -23
- package/_vendor/canvas-product-react/capabilities/pages/usePageControls.ts +0 -41
- package/_vendor/canvas-product-react/capabilities/toolbar/systemToolbar.ts +0 -490
- package/_vendor/canvas-product-react/capabilities/toolbar/useToolbarSurfaces.ts +0 -92
- package/_vendor/canvas-product-react/capabilities/zoom/useZoomControls.ts +0 -27
- package/_vendor/canvas-product-react/index.ts +0 -84
- package/_vendor/canvas-product-react/persistence/index.ts +0 -18
- package/_vendor/canvas-product-react/persistence/localSnapshotPersistence.ts +0 -294
- package/_vendor/canvas-product-react/runtime/CanvasProductRoot.tsx +0 -250
- package/_vendor/canvas-product-react/runtime/productDefinition.ts +0 -72
- package/_vendor/canvas-product-react/runtime/productServices.ts +0 -96
- package/_vendor/canvas-react/components/CanvasView.tsx +0 -796
- package/_vendor/canvas-react/components/OverlayLayer.tsx +0 -879
- package/_vendor/canvas-react/components/PageSpace.tsx +0 -34
- package/_vendor/canvas-react/components/ShapeLayer.tsx +0 -428
- package/_vendor/canvas-react/components/index.ts +0 -4
- package/_vendor/canvas-react/hooks/useEditor.ts +0 -11
- package/_vendor/canvas-react/hooks/useValue.ts +0 -14
- package/_vendor/canvas-react/host/CanvasRendererRegistryContext.tsx +0 -14
- package/_vendor/canvas-react/host/contextMenuRegistry.ts +0 -61
- package/_vendor/canvas-react/host/domEventGuards.ts +0 -61
- package/_vendor/canvas-react/host/index.ts +0 -38
- package/_vendor/canvas-react/host/pluginHost.ts +0 -635
- package/_vendor/canvas-react/host/rendererRegistry.tsx +0 -58
- package/_vendor/canvas-react/host/toolbarRegistry.ts +0 -100
- package/_vendor/canvas-react/index.ts +0 -3
- package/_vendor/plugin-arrow/ArrowBindingUtil.ts +0 -239
- package/_vendor/plugin-arrow/ArrowShapeUtil.ts +0 -311
- package/_vendor/plugin-arrow/ArrowTool.ts +0 -208
- package/_vendor/plugin-arrow/arrowGeometry.ts +0 -441
- package/_vendor/plugin-arrow/arrowTerminalBindingResolver.ts +0 -253
- package/_vendor/plugin-arrow/arrowTerminalCommands.ts +0 -230
- package/_vendor/plugin-arrow/canvas.tsx +0 -92
- package/_vendor/plugin-arrow/core.ts +0 -409
- package/_vendor/plugin-arrow/feature.ts +0 -20
- package/_vendor/plugin-arrow/index.ts +0 -28
- package/_vendor/plugin-arrow/selectionHandleInteractions.ts +0 -154
- package/_vendor/plugin-arrow/types.ts +0 -63
- package/_vendor/plugin-draw/DrawShapeRenderer.tsx +0 -60
- package/_vendor/plugin-draw/DrawShapeUtil.ts +0 -372
- package/_vendor/plugin-draw/DrawTool.ts +0 -444
- package/_vendor/plugin-draw/canvas.tsx +0 -24
- package/_vendor/plugin-draw/core.ts +0 -515
- package/_vendor/plugin-draw/drawGeometry.ts +0 -491
- package/_vendor/plugin-draw/drawHitTest.ts +0 -271
- package/_vendor/plugin-draw/drawInterpolation.ts +0 -250
- package/_vendor/plugin-draw/drawPath.ts +0 -550
- package/_vendor/plugin-draw/drawSegments.ts +0 -106
- package/_vendor/plugin-draw/drawSelectionTransform.ts +0 -67
- package/_vendor/plugin-draw/drawShapeGeometry.ts +0 -307
- package/_vendor/plugin-draw/drawStrokeGeometry.ts +0 -454
- package/_vendor/plugin-draw/feature.ts +0 -20
- package/_vendor/plugin-draw/index.ts +0 -31
- package/_vendor/plugin-draw/types.ts +0 -36
- package/_vendor/plugin-eraser/EraserTool.ts +0 -297
- package/_vendor/plugin-eraser/canvas.tsx +0 -616
- package/_vendor/plugin-eraser/core.ts +0 -49
- package/_vendor/plugin-eraser/feature.ts +0 -20
- package/_vendor/plugin-frame/FrameShapeUtil.ts +0 -173
- package/_vendor/plugin-frame/FrameTool.ts +0 -225
- package/_vendor/plugin-frame/canvas.tsx +0 -75
- package/_vendor/plugin-frame/core.ts +0 -534
- package/_vendor/plugin-frame/feature.ts +0 -20
- package/_vendor/plugin-frame/index.ts +0 -6
- package/_vendor/plugin-geo/GeoShapeUtil.ts +0 -463
- package/_vendor/plugin-geo/GeoTools.ts +0 -247
- package/_vendor/plugin-geo/canvas.tsx +0 -90
- package/_vendor/plugin-geo/core.ts +0 -495
- package/_vendor/plugin-geo/feature.ts +0 -20
- package/_vendor/plugin-geo/index.ts +0 -7
- package/_vendor/plugin-geo/types.ts +0 -27
- package/_vendor/plugin-group/GroupShapeUtil.ts +0 -59
- package/_vendor/plugin-group/canvas.tsx +0 -59
- package/_vendor/plugin-group/core.ts +0 -40
- package/_vendor/plugin-group/feature.ts +0 -20
- package/_vendor/plugin-group/index.ts +0 -5
- package/_vendor/plugin-image/ImageShapeUtil.ts +0 -95
- package/_vendor/plugin-image/canvas.tsx +0 -212
- package/_vendor/plugin-image/core.ts +0 -542
- package/_vendor/plugin-image/crop.ts +0 -770
- package/_vendor/plugin-image/cropInteractions.ts +0 -350
- package/_vendor/plugin-image/cropSession.ts +0 -38
- package/_vendor/plugin-image/feature.ts +0 -20
- package/_vendor/plugin-image/index.ts +0 -29
- package/_vendor/plugin-image/types.ts +0 -55
- package/_vendor/plugin-image-product-react/ImageImportController.tsx +0 -143
- package/_vendor/plugin-image-product-react/imageAssetService.ts +0 -52
- package/_vendor/plugin-image-product-react/imageBlobStore.ts +0 -315
- package/_vendor/plugin-image-product-react/imageHostActions.ts +0 -438
- package/_vendor/plugin-image-product-react/imageProductApi.ts +0 -88
- package/_vendor/plugin-image-product-react/imageToolbarHostBridge.ts +0 -48
- package/_vendor/plugin-image-product-react/imageToolbarRuntime.ts +0 -21
- package/_vendor/plugin-image-product-react/index.ts +0 -60
- package/_vendor/plugin-image-product-react/snapshotGuards.ts +0 -33
- package/_vendor/plugin-image-product-react/svgImageAssetInliner.ts +0 -54
- package/_vendor/plugin-image-product-react/useImageImport.ts +0 -64
- package/_vendor/plugin-laser/LaserTool.ts +0 -154
- package/_vendor/plugin-laser/canvas.tsx +0 -645
- package/_vendor/plugin-laser/core.ts +0 -49
- package/_vendor/plugin-laser/feature.ts +0 -20
- package/_vendor/plugin-text/ArrowLabelBindingUtil.ts +0 -336
- package/_vendor/plugin-text/GeoLabelBindingUtil.ts +0 -391
- package/_vendor/plugin-text/TextShapeSvgExporter.ts +0 -101
- package/_vendor/plugin-text/TextShapeUtil.ts +0 -284
- package/_vendor/plugin-text/TextTool.ts +0 -228
- package/_vendor/plugin-text/canvas.tsx +0 -115
- package/_vendor/plugin-text/core.ts +0 -422
- package/_vendor/plugin-text/feature.ts +0 -20
- package/_vendor/plugin-text/host/RichTextEditingBox.tsx +0 -144
- package/_vendor/plugin-text/host/RichTextToolbar.tsx +0 -266
- package/_vendor/plugin-text/host/TiptapTextEditor.tsx +0 -191
- package/_vendor/plugin-text/host/richTextRendering.tsx +0 -49
- package/_vendor/plugin-text/host/textDomSelection.ts +0 -93
- package/_vendor/plugin-text/host/textEditingBoxStyle.ts +0 -36
- package/_vendor/plugin-text/host/textEntryFocus.ts +0 -307
- package/_vendor/plugin-text/host/textFontLoader.ts +0 -149
- package/_vendor/plugin-text/host/textMeasurement.ts +0 -258
- package/_vendor/plugin-text/host/textMeasurementSync.ts +0 -77
- package/_vendor/plugin-text/host/textRangeSelection.ts +0 -134
- package/_vendor/plugin-text/host/textShapeRendererRuntime.tsx +0 -89
- package/_vendor/plugin-text/host/textShapeSync.ts +0 -173
- package/_vendor/plugin-text/host/tiptapTextEditorController.ts +0 -148
- package/_vendor/plugin-text/index.ts +0 -18
- package/_vendor/plugin-text/richTextUtils.ts +0 -259
- package/_vendor/plugin-text/textInteractions.ts +0 -366
- package/_vendor/plugin-text/textLabelHelpers.ts +0 -235
- package/_vendor/plugin-text/textShapeHelpers.ts +0 -123
- package/_vendor/plugin-text/textStyle.ts +0 -96
- package/_vendor/plugin-text/textTypes.ts +0 -48
- package/_vendor/signals/atom.ts +0 -74
- package/_vendor/signals/computed.ts +0 -132
- package/_vendor/signals/core.ts +0 -130
- package/_vendor/signals/effect.ts +0 -117
- package/_vendor/signals/types.ts +0 -17
- package/_vendor/store/Store.ts +0 -171
- package/_vendor/store/diff.ts +0 -229
- package/_vendor/store/history.ts +0 -177
- package/_vendor/store/index.ts +0 -32
- package/_vendor/store/types.ts +0 -37
- package/api/canvasKitApi.d.ts +0 -29
- package/internal-modules.d.ts +0 -187
- package/product/Shell.d.ts +0 -19
- package/product/chromeContext.d.ts +0 -70
- package/product/createCanvasKitEditor.d.ts +0 -6
- package/product/index.d.ts +0 -7
- package/product/persistence.d.ts +0 -3
- package/product/product.d.ts +0 -22
- package/product/useCanvasClipboardShortcuts.d.ts +0 -6
- package/product-iyBbEPIs.mjs +0 -4
- package/product.mjs +0 -1
- package/standard/extensions.d.ts +0 -1
- package/standard/index.d.ts +0 -3
- package/standard/standardApi.d.ts +0 -91
- package/standard-BmrxwqpJ.mjs +0 -44
- package/standard.mjs +0 -1
- /package/_vendor/signals/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Camera, Editor, LayerOrderDirection, LayerOrderEdge, ReparentShapePlacementFailureReason, ShapeId } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductServiceRegistry } from "../runtime/productServices";
|
|
3
|
+
import type { ProductFeatureControllerRegistry } from "./featureControllerRegistry";
|
|
4
|
+
export interface CanvasProductShapeRef {
|
|
5
|
+
id: ShapeId;
|
|
6
|
+
type: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CanvasProductSessionPageState {
|
|
9
|
+
pageId: string;
|
|
10
|
+
selectedShapeIds: ShapeId[];
|
|
11
|
+
camera: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
z: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface CanvasProductSessionSnapshot<TToolId extends string = string> {
|
|
18
|
+
currentPageId: string;
|
|
19
|
+
activeToolId: TToolId;
|
|
20
|
+
isToolLocked: boolean;
|
|
21
|
+
pages: CanvasProductSessionPageState[];
|
|
22
|
+
}
|
|
23
|
+
export interface CanvasProductControllerSnapshot<TToolId extends string = string> {
|
|
24
|
+
productId: string;
|
|
25
|
+
pageId: string;
|
|
26
|
+
activeToolId: TToolId;
|
|
27
|
+
selectedShapeIds: ShapeId[];
|
|
28
|
+
shapeCount: number;
|
|
29
|
+
session: CanvasProductSessionSnapshot<TToolId>;
|
|
30
|
+
}
|
|
31
|
+
export interface CanvasProductLayerNode {
|
|
32
|
+
id: ShapeId;
|
|
33
|
+
parentId: string;
|
|
34
|
+
pageId: string;
|
|
35
|
+
type: string;
|
|
36
|
+
childIds: ShapeId[];
|
|
37
|
+
siblingIndex: number;
|
|
38
|
+
depth: number;
|
|
39
|
+
displayName: string;
|
|
40
|
+
canReceiveChildren: boolean;
|
|
41
|
+
isHidden: boolean;
|
|
42
|
+
isLocked: boolean;
|
|
43
|
+
isEffectivelyHidden: boolean;
|
|
44
|
+
isEffectivelyLocked: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface CanvasProductLayerPlacement {
|
|
47
|
+
parentId: string;
|
|
48
|
+
beforeId?: ShapeId;
|
|
49
|
+
}
|
|
50
|
+
export type CanvasProductLayerPlacementFailureReason = ReparentShapePlacementFailureReason;
|
|
51
|
+
export type CanvasProductLayerPlacementResult = {
|
|
52
|
+
ok: true;
|
|
53
|
+
movedIds: ShapeId[];
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
reason: CanvasProductLayerPlacementFailureReason;
|
|
57
|
+
};
|
|
58
|
+
export interface CanvasProductLayerActionState {
|
|
59
|
+
canGroup: boolean;
|
|
60
|
+
canUngroup: boolean;
|
|
61
|
+
canMoveBackward: boolean;
|
|
62
|
+
canMoveForward: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface CanvasProductPageRef {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
index: string;
|
|
68
|
+
}
|
|
69
|
+
export interface CanvasProductController<TToolId extends string = string> {
|
|
70
|
+
features: ProductFeatureControllerRegistry;
|
|
71
|
+
snapshot(): CanvasProductControllerSnapshot<TToolId>;
|
|
72
|
+
clearHistory(): void;
|
|
73
|
+
canUndo(): boolean;
|
|
74
|
+
canRedo(): boolean;
|
|
75
|
+
undo(): boolean;
|
|
76
|
+
redo(): boolean;
|
|
77
|
+
select(ids: ShapeId[]): void;
|
|
78
|
+
selectAll(): void;
|
|
79
|
+
deleteSelection(): void;
|
|
80
|
+
deleteShapes(ids: ShapeId[]): void;
|
|
81
|
+
duplicateSelection(): ShapeId[];
|
|
82
|
+
centerOnShape(id: ShapeId): boolean;
|
|
83
|
+
getLayerTree(pageId?: string): CanvasProductLayerNode[];
|
|
84
|
+
getLayerNode(id: ShapeId): CanvasProductLayerNode | null;
|
|
85
|
+
setShapesHidden(ids: ShapeId[], isHidden: boolean): ShapeId[];
|
|
86
|
+
setShapesLocked(ids: ShapeId[], isLocked: boolean): ShapeId[];
|
|
87
|
+
groupShapes(ids: ShapeId[]): ShapeId | null;
|
|
88
|
+
ungroupShapes(ids: ShapeId[]): ShapeId[];
|
|
89
|
+
moveShapesInParentOrder(ids: ShapeId[], direction: LayerOrderDirection): boolean;
|
|
90
|
+
moveShapesToParentOrderEdge(ids: ShapeId[], edge: LayerOrderEdge): boolean;
|
|
91
|
+
moveShapesToLayerPlacement(ids: ShapeId[], placement: CanvasProductLayerPlacement): CanvasProductLayerPlacementResult;
|
|
92
|
+
getLayerActionState(ids: ShapeId[]): CanvasProductLayerActionState;
|
|
93
|
+
setTool(toolId: TToolId): void;
|
|
94
|
+
setCamera(camera: Partial<Camera>, pageId?: string): void;
|
|
95
|
+
resetView(): void;
|
|
96
|
+
getPages(): CanvasProductPageRef[];
|
|
97
|
+
createPage(name?: string): CanvasProductPageRef;
|
|
98
|
+
renamePage(pageId: string, name: string): void;
|
|
99
|
+
deletePage(pageId: string): boolean;
|
|
100
|
+
selectPage(pageId: string): void;
|
|
101
|
+
exportSelectionSvg(): string | null;
|
|
102
|
+
exportPageSvg(): string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface CanvasProductControllerContext {
|
|
105
|
+
editor: Editor;
|
|
106
|
+
services: ProductServiceRegistry;
|
|
107
|
+
pluginHostRuntime: unknown;
|
|
108
|
+
featureControllers: ProductFeatureControllerRegistry;
|
|
109
|
+
productId: string;
|
|
110
|
+
}
|
|
111
|
+
export interface CanvasProductControllerOptions<TToolId extends string = string> extends CanvasProductControllerContext {
|
|
112
|
+
assertToolId: (toolId: string) => asserts toolId is TToolId;
|
|
113
|
+
}
|
|
114
|
+
export declare function createCanvasProductController<TToolId extends string = string>(options: CanvasProductControllerOptions<TToolId>): CanvasProductController<TToolId>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ProductFeatureControllerToken<TController> {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly __controller?: TController;
|
|
4
|
+
}
|
|
5
|
+
export interface ProductFeatureControllerRegistry {
|
|
6
|
+
get<TController>(token: ProductFeatureControllerToken<TController>): TController | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ProductFeatureControllerRegistryRuntime extends ProductFeatureControllerRegistry {
|
|
9
|
+
register<TController>(token: ProductFeatureControllerToken<TController>, controller: TController): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createProductFeatureControllerToken<TController>(id: string): ProductFeatureControllerToken<TController>;
|
|
12
|
+
export declare function createProductFeatureControllerRegistry(): ProductFeatureControllerRegistryRuntime;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createProductFeatureControllerRegistry, createProductFeatureControllerToken, } from "./featureControllerRegistry";
|
|
2
|
+
export type { ProductFeatureControllerRegistry, ProductFeatureControllerRegistryRuntime, ProductFeatureControllerToken, } from "./featureControllerRegistry";
|
|
3
|
+
export { createCanvasProductController } from "./canvasProductController";
|
|
4
|
+
export type { CanvasProductController, CanvasProductControllerContext, CanvasProductControllerOptions, CanvasProductControllerSnapshot, CanvasProductLayerActionState, CanvasProductLayerNode, CanvasProductLayerPlacement, CanvasProductLayerPlacementFailureReason, CanvasProductLayerPlacementResult, CanvasProductPageRef, CanvasProductSessionPageState, CanvasProductSessionSnapshot, CanvasProductShapeRef, } from "./canvasProductController";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Editor, PageId, ShapeId } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { CanvasProductLayerNode } from "./canvasProductController";
|
|
3
|
+
export declare function getCanvasProductLayerTree({ editor, pageId, }: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
pageId?: PageId;
|
|
6
|
+
}): CanvasProductLayerNode[];
|
|
7
|
+
export declare function getCanvasProductLayerNode({ editor, id, }: {
|
|
8
|
+
editor: Editor;
|
|
9
|
+
id: ShapeId;
|
|
10
|
+
}): CanvasProductLayerNode | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Editor, CanvasActionContext } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
export declare function createCanvasActionContext({ editor, toolState, selectionState, }: {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
toolState: {
|
|
5
|
+
activeToolId: string;
|
|
6
|
+
isToolLocked: boolean;
|
|
7
|
+
};
|
|
8
|
+
selectionState: {
|
|
9
|
+
count: number;
|
|
10
|
+
singleShapeType: CanvasActionContext["selection"]["singleShapeType"];
|
|
11
|
+
commonShapeType: CanvasActionContext["selection"]["commonShapeType"];
|
|
12
|
+
canResetSelectionRotation: boolean;
|
|
13
|
+
isMixedFrameAndPointHandleSelection: boolean;
|
|
14
|
+
};
|
|
15
|
+
}): CanvasActionContext;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CanvasAction, type CanvasActionContext, type KeyboardShortcutInput } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductPluginHostRuntime } from "../../runtime/productHost";
|
|
3
|
+
export declare const SYSTEM_SELECTION_DELETE_ACTION_ID = "system.selection.delete";
|
|
4
|
+
export declare const SYSTEM_SELECTION_DUPLICATE_ACTION_ID = "system.selection.duplicate";
|
|
5
|
+
export declare const SYSTEM_SELECTION_GROUP_ACTION_ID = "system.selection.group";
|
|
6
|
+
export declare const SYSTEM_SELECTION_SELECT_ALL_ACTION_ID = "system.selection.select-all";
|
|
7
|
+
export declare const SYSTEM_SELECTION_UNGROUP_ACTION_ID = "system.selection.ungroup";
|
|
8
|
+
export declare const SYSTEM_SELECTION_RESET_ROTATION_ACTION_ID = "system.selection.reset-rotation";
|
|
9
|
+
export declare const SYSTEM_SELECTION_FLIP_HORIZONTAL_ACTION_ID = "system.selection.flip-horizontal";
|
|
10
|
+
export declare const SYSTEM_SELECTION_FLIP_VERTICAL_ACTION_ID = "system.selection.flip-vertical";
|
|
11
|
+
export declare const SYSTEM_SELECTION_SEND_TO_BACK_ACTION_ID = "system.selection.send-to-back";
|
|
12
|
+
export declare const SYSTEM_SELECTION_SEND_BACKWARD_ACTION_ID = "system.selection.send-backward";
|
|
13
|
+
export declare const SYSTEM_SELECTION_BRING_FORWARD_ACTION_ID = "system.selection.bring-forward";
|
|
14
|
+
export declare const SYSTEM_SELECTION_BRING_TO_FRONT_ACTION_ID = "system.selection.bring-to-front";
|
|
15
|
+
export declare const SYSTEM_SELECTION_SET_OPACITY_ACTION_ID = "system.selection.set-opacity";
|
|
16
|
+
export declare const canvasActionShortcuts: readonly {
|
|
17
|
+
actionId: string;
|
|
18
|
+
shortcut: KeyboardShortcutInput;
|
|
19
|
+
}[];
|
|
20
|
+
export declare function runCanvasAction({ context, pluginHostRuntime, actionId, }: {
|
|
21
|
+
context: CanvasActionContext;
|
|
22
|
+
pluginHostRuntime: ProductPluginHostRuntime;
|
|
23
|
+
actionId: string;
|
|
24
|
+
}): void;
|
|
25
|
+
export declare function isSingleSelectedFrameChild(context: CanvasActionContext): boolean;
|
|
26
|
+
export declare const canvasActions: readonly CanvasAction[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Editor, CanvasAction, KeyboardShortcutInput } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import type { CanvasProductRuntimeContribution } from "../../runtime/productContributions";
|
|
3
|
+
import type { ProductPluginHostRuntime } from "../../runtime/productHost";
|
|
4
|
+
import type { ProductServiceRegistry } from "../../runtime/productServices";
|
|
5
|
+
export declare const SYSTEM_CLIPBOARD_COPY_ACTION_ID = "system.clipboard.copy";
|
|
6
|
+
export declare const SYSTEM_CLIPBOARD_CUT_ACTION_ID = "system.clipboard.cut";
|
|
7
|
+
export declare const SYSTEM_CLIPBOARD_PASTE_ACTION_ID = "system.clipboard.paste";
|
|
8
|
+
export declare const SYSTEM_CLIPBOARD_PASTE_AT_POINT_ACTION_ID = "system.clipboard.paste-at-point";
|
|
9
|
+
export declare const clipboardActionShortcuts: readonly {
|
|
10
|
+
actionId: string;
|
|
11
|
+
shortcut: KeyboardShortcutInput;
|
|
12
|
+
}[];
|
|
13
|
+
export declare function createClipboardProductContribution(): CanvasProductRuntimeContribution;
|
|
14
|
+
export declare function registerClipboardActions({ editor, pluginHostRuntime, services, }: {
|
|
15
|
+
editor?: Editor;
|
|
16
|
+
pluginHostRuntime: ProductPluginHostRuntime;
|
|
17
|
+
services: ProductServiceRegistry;
|
|
18
|
+
}): void;
|
|
19
|
+
export declare function createClipboardActions(services: ProductServiceRegistry): readonly CanvasAction[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorClipboardPayload } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import { type ProductServiceFactory, type ProductServiceRegistry } from "../../runtime/productServices";
|
|
3
|
+
export interface CanvasClipboardService {
|
|
4
|
+
write(payload: EditorClipboardPayload): Promise<void>;
|
|
5
|
+
read(): Promise<EditorClipboardPayload | null>;
|
|
6
|
+
getMemoryPayload(): EditorClipboardPayload | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const canvasClipboardServiceToken: import("../..").ProductServiceToken<CanvasClipboardService>;
|
|
9
|
+
export declare function getCanvasClipboardService(services: ProductServiceRegistry): CanvasClipboardService | null;
|
|
10
|
+
export declare function memoryCanvasClipboardService(): ProductServiceFactory<CanvasClipboardService>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ContextMenuContext, CanvasAction, CanvasActionValue } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductPluginHostRuntime } from "../../runtime/productHost";
|
|
3
|
+
export declare const SYSTEM_VIEW_ZOOM_IN_ACTION_ID = "system.view.zoom-in";
|
|
4
|
+
export declare const SYSTEM_VIEW_ZOOM_OUT_ACTION_ID = "system.view.zoom-out";
|
|
5
|
+
export declare const SYSTEM_VIEW_RESET_ZOOM_ACTION_ID = "system.view.reset-zoom";
|
|
6
|
+
export declare function runContextMenuAction({ actionId, context, pluginHostRuntime, value, }: {
|
|
7
|
+
actionId: string;
|
|
8
|
+
context: ContextMenuContext;
|
|
9
|
+
pluginHostRuntime: ProductPluginHostRuntime;
|
|
10
|
+
value?: CanvasActionValue;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare const contextMenuActions: readonly CanvasAction[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContextMenuContext, ContextMenuContributionTarget, ContextMenuTarget, Editor } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
export declare function createContextMenuContext({ editor, menu, }: {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
menu: ContextMenuContext["menu"];
|
|
5
|
+
}): ContextMenuContext;
|
|
6
|
+
export declare function getContextMenuContributionTarget(target: ContextMenuTarget, editor: Editor): ContextMenuContributionTarget;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContextMenuContribution } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import type { CanvasProductRuntimeContribution } from "../../runtime/productContributions";
|
|
3
|
+
export declare const contextMenuContributions: readonly ContextMenuContribution[];
|
|
4
|
+
export declare function createContextMenuProductContribution(): CanvasProductRuntimeContribution;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Editor, ExportIntegrityReport, ShapeCapabilityManifest, ShapeId, SvgExportSkippedShape, SvgThemeColorResolver } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
export interface SvgAssetInliner {
|
|
3
|
+
inline(input: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
exportedShapeIds: readonly ShapeId[];
|
|
6
|
+
svg: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
export type ExportStatus = {
|
|
10
|
+
tone: "success" | "warning" | "error";
|
|
11
|
+
title: string;
|
|
12
|
+
details: string;
|
|
13
|
+
integrity: ExportIntegrityReport;
|
|
14
|
+
capabilityManifest: ShapeCapabilityManifest;
|
|
15
|
+
};
|
|
16
|
+
export interface SvgExportResult {
|
|
17
|
+
status: ExportStatus;
|
|
18
|
+
svg: string | null;
|
|
19
|
+
exportedShapeIds: readonly ShapeId[];
|
|
20
|
+
skippedShapes: readonly SvgExportSkippedShape[];
|
|
21
|
+
}
|
|
22
|
+
export interface SvgExportOptions {
|
|
23
|
+
assetInliners?: readonly SvgAssetInliner[];
|
|
24
|
+
editor: Editor;
|
|
25
|
+
padding?: number;
|
|
26
|
+
resolveThemeColor?: SvgThemeColorResolver;
|
|
27
|
+
shapeIds: readonly ShapeId[];
|
|
28
|
+
}
|
|
29
|
+
export declare function exportEditorSvg({ assetInliners, editor, padding, resolveThemeColor, shapeIds, }: SvgExportOptions): Promise<SvgExportResult>;
|
|
30
|
+
export declare function getSvgExportStatus({ capabilityManifest, integrity, }: {
|
|
31
|
+
capabilityManifest: ShapeCapabilityManifest;
|
|
32
|
+
integrity: ExportIntegrityReport;
|
|
33
|
+
}): ExportStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CANVAS_KIT_HOST_ACTION_IDS: readonly ["editor.tool.set-active-tool", "editor.tool.toggle-locked", "system.clipboard.copy", "system.clipboard.cut", "system.clipboard.paste", "system.clipboard.paste-at-point", "system.selection.duplicate", "system.selection.select-all", "system.selection.delete", "system.selection.group", "system.selection.ungroup", "system.selection.reset-rotation", "system.selection.flip-horizontal", "system.selection.flip-vertical", "system.selection.send-to-back", "system.selection.send-backward", "system.selection.bring-forward", "system.selection.bring-to-front", "system.view.reset-zoom", "system.view.zoom-in", "system.view.zoom-out"];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ToolbarContribution } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import type { CanvasProductRuntimeContribution } from "../../runtime/productContributions";
|
|
3
|
+
export declare const toolbarContributions: readonly ToolbarContribution[];
|
|
4
|
+
export declare function createToolbarProductContribution(): CanvasProductRuntimeContribution;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ToolbarGroup } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
export declare function getActiveToolLabel(groups: readonly ToolbarGroup[], activeToolId: string): string;
|
|
3
|
+
export declare function getSelectionToolbarTitle({ commonShapeType, count, isMixedFrameAndPointHandleSelection, singleShapeType, }: {
|
|
4
|
+
commonShapeType: string | null;
|
|
5
|
+
count: number;
|
|
6
|
+
isMixedFrameAndPointHandleSelection: boolean;
|
|
7
|
+
singleShapeType: string | null;
|
|
8
|
+
}): string;
|
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { createDefaultCanvasProductEditor } from "./runtime/productEditor";
|
|
2
|
+
export { cleanupProductAssetsAfterRestore, preloadProductAssets, resolveProductAssetUrl, } from "./runtime/productAssets";
|
|
3
|
+
export { createProductFeatureControllerRegistry, createProductFeatureControllerToken, } from "./controller/featureControllerRegistry";
|
|
4
|
+
export { createProductServiceRegistry, createProductServiceToken, requireProductService, } from "./runtime/productServices";
|
|
5
|
+
export { CANVAS_KIT_HOST_ACTION_IDS } from "./features/hostActionIds";
|
|
6
|
+
export type { CanvasProductRuntimeInitializer, CanvasProductRuntimeInitializerContext, CreateCanvasProductEditorOptions, ProductPersistenceAdapter, ProductPersistenceRestoreResult, ProductPersistenceStatus, } from "./runtime/productDefinition";
|
|
7
|
+
export type { CanvasProductRuntimeContribution, } from "./runtime/productContributions";
|
|
8
|
+
export type { ProductContextMenuRegistry, ProductPluginHostRuntime, ProductToolbarRegistry, } from "./runtime/productHost";
|
|
9
|
+
export type { ProductAssetResolverService, ProductServiceFactory, ProductServiceFactoryContext, ProductServiceRegistry, ProductServiceRegistryRuntime, ProductServiceToken, } from "./runtime/productServices";
|
|
10
|
+
export type { ProductFeatureControllerRegistry, ProductFeatureControllerRegistryRuntime, ProductFeatureControllerToken, } from "./controller/featureControllerRegistry";
|
|
11
|
+
export { SYSTEM_SELECTION_BRING_FORWARD_ACTION_ID, SYSTEM_SELECTION_BRING_TO_FRONT_ACTION_ID, SYSTEM_SELECTION_DELETE_ACTION_ID, SYSTEM_SELECTION_DUPLICATE_ACTION_ID, SYSTEM_SELECTION_FLIP_HORIZONTAL_ACTION_ID, SYSTEM_SELECTION_FLIP_VERTICAL_ACTION_ID, SYSTEM_SELECTION_GROUP_ACTION_ID, SYSTEM_SELECTION_RESET_ROTATION_ACTION_ID, SYSTEM_SELECTION_SELECT_ALL_ACTION_ID, SYSTEM_SELECTION_SEND_BACKWARD_ACTION_ID, SYSTEM_SELECTION_SEND_TO_BACK_ACTION_ID, SYSTEM_SELECTION_UNGROUP_ACTION_ID, runCanvasAction, } from "./features/actions/canvasActions";
|
|
12
|
+
export { createToolbarProductContribution } from "./features/toolbar/toolbarContribution";
|
|
13
|
+
export { createCanvasActionContext } from "./features/actions/canvasActionContext";
|
|
14
|
+
export { getActiveToolLabel, getSelectionToolbarTitle, } from "./features/toolbar/toolbarLabels";
|
|
15
|
+
export { SYSTEM_VIEW_RESET_ZOOM_ACTION_ID, SYSTEM_VIEW_ZOOM_IN_ACTION_ID, SYSTEM_VIEW_ZOOM_OUT_ACTION_ID, runContextMenuAction, } from "./features/context-menu/contextMenuActions";
|
|
16
|
+
export { createContextMenuProductContribution } from "./features/context-menu/contextMenuContribution";
|
|
17
|
+
export { createContextMenuContext, getContextMenuContributionTarget, } from "./features/context-menu/contextMenuContext";
|
|
18
|
+
export { canvasClipboardServiceToken, memoryCanvasClipboardService, } from "./features/clipboard/clipboardService";
|
|
19
|
+
export type { CanvasClipboardService } from "./features/clipboard/clipboardService";
|
|
20
|
+
export { SYSTEM_CLIPBOARD_COPY_ACTION_ID, SYSTEM_CLIPBOARD_CUT_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_AT_POINT_ACTION_ID, createClipboardProductContribution, registerClipboardActions, } from "./features/clipboard/clipboardContribution";
|
|
21
|
+
export { getCanvasClipboardService, } from "./features/clipboard/clipboardService";
|
|
22
|
+
export { exportEditorSvg, getSvgExportStatus, } from "./features/export/svgExport";
|
|
23
|
+
export type { ExportStatus, SvgAssetInliner, SvgExportOptions, SvgExportResult, } from "./features/export/svgExport";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductAssetResolverService, ProductServiceRegistry, ProductServiceToken } from "./productServices";
|
|
3
|
+
export declare function resolveProductAssetUrl({ assetResolverTokens, assetId, editor, services, }: {
|
|
4
|
+
assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
5
|
+
assetId: AssetId;
|
|
6
|
+
editor: Editor;
|
|
7
|
+
services: ProductServiceRegistry;
|
|
8
|
+
}): string | null;
|
|
9
|
+
export declare function preloadProductAssets({ assetResolverTokens, editor, services, }: {
|
|
10
|
+
assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
11
|
+
editor: Editor;
|
|
12
|
+
services: ProductServiceRegistry;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
export declare function cleanupProductAssetsAfterRestore({ assetResolverTokens, editor, services, }: {
|
|
15
|
+
assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
16
|
+
editor: Editor;
|
|
17
|
+
services: ProductServiceRegistry;
|
|
18
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProductAssetResolverService, ProductServiceFactory, ProductServiceToken } from "./productServices";
|
|
2
|
+
import type { CanvasProductRuntimeInitializer } from "./productDefinition";
|
|
3
|
+
import type { ProductPluginHostRuntime } from "./productHost";
|
|
4
|
+
export interface CanvasProductRuntimeContribution<TPluginHostRuntime extends ProductPluginHostRuntime = ProductPluginHostRuntime> {
|
|
5
|
+
id: string;
|
|
6
|
+
services?: readonly ProductServiceFactory<unknown>[];
|
|
7
|
+
assetResolverTokens?: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
8
|
+
initializeRuntime?: CanvasProductRuntimeInitializer<TPluginHostRuntime>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AssetId, Editor, LandEditorPlugin } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductFeatureControllerRegistryRuntime } from "../controller/featureControllerRegistry";
|
|
3
|
+
import type { ProductPluginHostRuntime } from "./productHost";
|
|
4
|
+
import type { ProductServiceRegistry } from "./productServices";
|
|
5
|
+
export interface ProductPersistenceRestoreResult {
|
|
6
|
+
autoPersistence: "enabled" | "disabled";
|
|
7
|
+
status?: ProductPersistenceStatus | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ProductPersistenceStatus {
|
|
10
|
+
kind: "preserving-unsupported-records";
|
|
11
|
+
preservedRecordCount: number;
|
|
12
|
+
unsupportedBindingTypes: readonly string[];
|
|
13
|
+
unsupportedShapeTypes: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ProductPersistenceAdapter {
|
|
16
|
+
restore?(editor: Editor): Promise<ProductPersistenceRestoreResult | void>;
|
|
17
|
+
start?(editor: Editor): () => void;
|
|
18
|
+
flushSnapshot?(editor: Editor): Promise<void>;
|
|
19
|
+
discardUnsupportedRecords?(editor: Editor): Promise<ProductPersistenceRestoreResult | void>;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateCanvasProductEditorOptions {
|
|
22
|
+
editorPlugins: readonly LandEditorPlugin[];
|
|
23
|
+
resolveAssetUrl?: (assetId: AssetId) => string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface CanvasProductRuntimeInitializerContext<TPluginHostRuntime extends ProductPluginHostRuntime = ProductPluginHostRuntime> {
|
|
26
|
+
productId: string;
|
|
27
|
+
featureControllers: ProductFeatureControllerRegistryRuntime;
|
|
28
|
+
editor: Editor;
|
|
29
|
+
pluginHostRuntime: TPluginHostRuntime;
|
|
30
|
+
services: ProductServiceRegistry;
|
|
31
|
+
}
|
|
32
|
+
export type CanvasProductRuntimeInitializer<TPluginHostRuntime extends ProductPluginHostRuntime = ProductPluginHostRuntime> = (context: CanvasProductRuntimeInitializerContext<TPluginHostRuntime>) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ContextMenuContribution, CanvasAction, ToolbarContribution } from "../../_vendor/canvas-core/index";
|
|
2
|
+
export interface ProductToolbarRegistry {
|
|
3
|
+
registerAction(action: CanvasAction): void;
|
|
4
|
+
registerHostAction(action: CanvasAction): void;
|
|
5
|
+
registerContribution(contribution: ToolbarContribution): void;
|
|
6
|
+
getAction(actionId: string): CanvasAction | null;
|
|
7
|
+
getDuplicateActionIds(): string[];
|
|
8
|
+
getDuplicateContributionIds(): string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ProductContextMenuRegistry {
|
|
11
|
+
registerContribution(contribution: ContextMenuContribution): void;
|
|
12
|
+
getDuplicateContributionIds(): string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ProductPluginHostRuntime {
|
|
15
|
+
toolbarRegistry: ProductToolbarRegistry;
|
|
16
|
+
contextMenuRegistry: ProductContextMenuRegistry;
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
+
export interface ProductServiceToken<TService> {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly __service?: TService;
|
|
5
|
+
}
|
|
6
|
+
export interface ProductServiceFactoryContext {
|
|
7
|
+
productId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ProductServiceFactory<TService> {
|
|
10
|
+
token: ProductServiceToken<TService>;
|
|
11
|
+
create(context: ProductServiceFactoryContext): TService;
|
|
12
|
+
dispose?(service: TService): void;
|
|
13
|
+
}
|
|
14
|
+
export interface ProductServiceRegistry {
|
|
15
|
+
get<TService>(token: ProductServiceToken<TService>): TService | null;
|
|
16
|
+
}
|
|
17
|
+
export interface ProductServiceRegistryRuntime extends ProductServiceRegistry {
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
20
|
+
export interface ProductAssetResolverService {
|
|
21
|
+
resolveAssetUrl(editor: Editor, assetId: AssetId): string | null;
|
|
22
|
+
preloadForEditor?(editor: Editor): Promise<void>;
|
|
23
|
+
cleanupAfterRestore?(editor: Editor): Promise<void> | void;
|
|
24
|
+
}
|
|
25
|
+
export declare function createProductServiceToken<TService>(id: string): ProductServiceToken<TService>;
|
|
26
|
+
export declare function createProductServiceRegistry({ factories, productId, }: {
|
|
27
|
+
factories: readonly ProductServiceFactory<unknown>[];
|
|
28
|
+
productId: string;
|
|
29
|
+
}): ProductServiceRegistryRuntime;
|
|
30
|
+
export declare function requireProductService<TService>(services: ProductServiceRegistry, token: ProductServiceToken<TService>): TService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ImageAssetService } from "./imageAssetService";
|
|
3
|
+
import type { ImageToolbarHostBridge } from "./imageToolbarHostBridge";
|
|
4
|
+
export declare const ImageImportController: import("react").NamedExoticComponent<{
|
|
5
|
+
editor: Editor;
|
|
6
|
+
hostBridge?: ImageToolbarHostBridge;
|
|
7
|
+
imageAssetService: ImageAssetService;
|
|
8
|
+
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ProductAssetResolverService, type ProductServiceFactory } from "../../core";
|
|
2
|
+
import { type ImageObjectUrlStore } from "./imageBlobStore";
|
|
3
|
+
export interface ImageAssetService extends ProductAssetResolverService {
|
|
4
|
+
objectUrls: ImageObjectUrlStore;
|
|
5
|
+
}
|
|
6
|
+
export declare const imageAssetServiceToken: import("../../core").ProductServiceToken<ImageAssetService>;
|
|
7
|
+
export declare function localImageAssetService(): ProductServiceFactory<ImageAssetService>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
+
export interface ImageBlobWriteResult {
|
|
3
|
+
storageKey: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ImageObjectUrlStore {
|
|
6
|
+
preloadForEditor(editor: Editor): Promise<void>;
|
|
7
|
+
preload(storageKey: string): Promise<string | null>;
|
|
8
|
+
resolve(storageKey: string): string | null;
|
|
9
|
+
resolveAssetUrl(editor: Editor, assetId: AssetId): string | null;
|
|
10
|
+
release(storageKey: string): void;
|
|
11
|
+
releaseAll(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function createImageStorageKey(): string;
|
|
14
|
+
export declare function writeImageBlob(blob: Blob): Promise<ImageBlobWriteResult>;
|
|
15
|
+
export declare function readImageBlob(storageKey: string): Promise<Blob | null>;
|
|
16
|
+
export declare function readImageBlobAsDataUrl(storageKey: string): Promise<string | null>;
|
|
17
|
+
export declare function deleteImageBlob(storageKey: string): Promise<void>;
|
|
18
|
+
export declare function getAllImageBlobStorageKeys(): Promise<string[]>;
|
|
19
|
+
export declare function getImageAssetStorageKey(editor: Editor, assetId: AssetId): string | null;
|
|
20
|
+
export declare function getReferencedImageStorageKeys(editor: Editor): Set<string>;
|
|
21
|
+
export declare function cleanupUnreferencedImageBlobs({ editor, objectUrls, }: {
|
|
22
|
+
editor: Editor;
|
|
23
|
+
objectUrls?: ImageObjectUrlStore;
|
|
24
|
+
}): Promise<string[]>;
|
|
25
|
+
export declare function createImageObjectUrlStore(): ImageObjectUrlStore;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import { isEditableEventTarget } from "../../_vendor/canvas-react/index";
|
|
3
|
+
export { isEditableEventTarget };
|
|
4
|
+
export interface LocalImageAssetInput {
|
|
5
|
+
name: string;
|
|
6
|
+
storageKey: string;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
fileSize: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function decodeImageSize(src: string): Promise<{
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function getLocalImageAssetInput(file: File): Promise<LocalImageAssetInput>;
|
|
17
|
+
export declare function fitLocalImageSize({ height, width, }: {
|
|
18
|
+
height: number;
|
|
19
|
+
width: number;
|
|
20
|
+
}): {
|
|
21
|
+
w: number;
|
|
22
|
+
h: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function getFirstImageFile(files: Iterable<File>): File | null;
|
|
25
|
+
export declare function getFirstImageFileFromDataTransfer(dataTransfer: DataTransfer | null): File | null;
|
|
26
|
+
export declare function hasImageFileItem(dataTransfer: DataTransfer | null): boolean;
|
|
27
|
+
export declare function getDropPagePoint(editor: Editor, event: DragEvent): import("../../_vendor/canvas-core/index").Vec;
|
|
28
|
+
export declare function downloadObjectUrl({ filename, url, }: {
|
|
29
|
+
filename: string;
|
|
30
|
+
url: string;
|
|
31
|
+
}): void;
|
|
32
|
+
export declare function downloadBlob({ blob, filename, }: {
|
|
33
|
+
blob: Blob;
|
|
34
|
+
filename: string;
|
|
35
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Editor, type ShapeId, Vec } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductPluginHostRuntime } from "../../core";
|
|
3
|
+
import { type ImageObjectUrlStore } from "./imageBlobStore";
|
|
4
|
+
import type { ImageToolbarHostBridge } from "./imageToolbarHostBridge";
|
|
5
|
+
export { getDropPagePoint, getFirstImageFile, getFirstImageFileFromDataTransfer, hasImageFileItem, isEditableEventTarget, } from "./imageFileHelpers";
|
|
6
|
+
export type ImageImportSource = "file-picker" | "paste" | "drop";
|
|
7
|
+
export interface ImageInsertSize {
|
|
8
|
+
w: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}
|
|
11
|
+
export interface InsertImageFileInput {
|
|
12
|
+
editor: Editor;
|
|
13
|
+
file: File;
|
|
14
|
+
imageObjectUrls: ImageObjectUrlStore;
|
|
15
|
+
pagePoint?: Vec;
|
|
16
|
+
size?: ImageInsertSize;
|
|
17
|
+
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
18
|
+
source: ImageImportSource;
|
|
19
|
+
}
|
|
20
|
+
export interface ReplaceSelectedImageFileInput {
|
|
21
|
+
editor: Editor;
|
|
22
|
+
file: File;
|
|
23
|
+
imageObjectUrls: ImageObjectUrlStore;
|
|
24
|
+
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare function insertImageFileIntoEditor({ editor, file, imageObjectUrls, pagePoint, size: requestedSize, flushSnapshot, source, }: InsertImageFileInput): Promise<ShapeId | null>;
|
|
27
|
+
export declare function replaceSelectedImageFromFile({ editor, file, imageObjectUrls, flushSnapshot, }: ReplaceSelectedImageFileInput): Promise<void>;
|
|
28
|
+
export declare function downloadSelectedImageOriginal({ editor, imageObjectUrls, }: {
|
|
29
|
+
editor: Editor;
|
|
30
|
+
imageObjectUrls: ImageObjectUrlStore;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
export declare function registerImageToolbarActions({ hostBridge, imageObjectUrls, pluginHostRuntime, }: {
|
|
33
|
+
hostBridge: ImageToolbarHostBridge;
|
|
34
|
+
imageObjectUrls: ImageObjectUrlStore;
|
|
35
|
+
pluginHostRuntime: ProductPluginHostRuntime;
|
|
36
|
+
}): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProductPersistenceAdapter } from "../../core";
|
|
2
|
+
import type { CanvasKitHostExtension } from "../../runtime/canvasKitHostExtensions";
|
|
3
|
+
export declare function createImageHostExtension({ flushSnapshot, }: {
|
|
4
|
+
flushSnapshot?: ProductPersistenceAdapter["flushSnapshot"];
|
|
5
|
+
}): CanvasKitHostExtension;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Editor, ShapeId, Vec } from "../../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasProductRuntimeInitializer } from "../../core";
|
|
3
|
+
import { type ImageImportSource, type ImageInsertSize } from "./imageHostActions";
|
|
4
|
+
export interface ImageInsertInput {
|
|
5
|
+
file: File;
|
|
6
|
+
pagePoint?: Vec;
|
|
7
|
+
size?: ImageInsertSize;
|
|
8
|
+
source?: ImageImportSource;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageReplaceInput {
|
|
11
|
+
file: File;
|
|
12
|
+
}
|
|
13
|
+
export interface ImageProductController {
|
|
14
|
+
insertImage(input: ImageInsertInput): Promise<ShapeId | null>;
|
|
15
|
+
replaceSelectedImage(input: ImageReplaceInput): Promise<boolean>;
|
|
16
|
+
downloadSelectedImageOriginal(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const imageProductControllerToken: import("../../core").ProductFeatureControllerToken<ImageProductController>;
|
|
19
|
+
export interface ImageProductControllerRuntimeOptions {
|
|
20
|
+
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function registerImageProductController({ flushSnapshot, }?: ImageProductControllerRuntimeOptions): CanvasProductRuntimeInitializer;
|