@yuzhouu/canvas-kit 0.1.3 → 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 → bindingUtil.d.ts} +1 -1
- package/_vendor/canvas-core/bindings/{BindingUtilRegistry.d.ts → bindingUtilRegistry.d.ts} +1 -1
- package/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
- package/_vendor/canvas-core/editor/clipboard.d.ts +2 -2
- package/_vendor/canvas-core/editor/commands.d.ts +6 -1
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/edgeScroll.d.ts +1 -1
- package/_vendor/canvas-core/editor/{Editor.d.ts → editor.d.ts} +46 -51
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +5 -5
- package/_vendor/canvas-core/editor/editorSelectionTransforms.d.ts +2 -2
- package/_vendor/canvas-core/editor/events.d.ts +1 -1
- package/_vendor/canvas-core/editor/{HistoryManager.d.ts → historyManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/index.d.ts +10 -7
- package/_vendor/canvas-core/editor/interactions.d.ts +2 -2
- package/_vendor/canvas-core/editor/internal.d.ts +1 -1
- package/_vendor/canvas-core/editor/managers/{BindingManager.d.ts → bindingManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{CameraManager.d.ts → cameraManager.d.ts} +2 -2
- package/_vendor/canvas-core/editor/managers/{ClipboardManager.d.ts → clipboardManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{DocumentSnapshotManager.d.ts → documentSnapshotManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{InputsManager.d.ts → inputsManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{InteractionTransientManager.d.ts → interactionTransientManager.d.ts} +13 -10
- package/_vendor/canvas-core/editor/managers/{QueryManager.d.ts → queryManager.d.ts} +7 -6
- package/_vendor/canvas-core/editor/managers/{RenderWindowManager.d.ts → renderWindowManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/selectionGeometry.d.ts +5 -5
- package/_vendor/canvas-core/editor/managers/{SelectionLayoutManager.d.ts → selectionLayoutManager.d.ts} +2 -2
- package/_vendor/canvas-core/editor/managers/{SelectionManager.d.ts → selectionManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{SelectionOverlayManager.d.ts → selectionOverlayManager.d.ts} +4 -3
- package/_vendor/canvas-core/editor/managers/{ShapeEditingManager.d.ts → shapeEditingManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{ShapeGeometryManager.d.ts → shapeGeometryManager.d.ts} +5 -5
- package/_vendor/canvas-core/editor/managers/{ShapeHierarchyManager.d.ts → shapeHierarchyManager.d.ts} +3 -6
- package/_vendor/canvas-core/editor/managers/shapeOrder.d.ts +1 -1
- package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +1 -1
- package/_vendor/canvas-core/editor/managers/shortcutManager.d.ts +56 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +2 -2
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -2
- package/_vendor/canvas-core/editor/managers/snapIndicators.d.ts +2 -2
- package/_vendor/canvas-core/editor/managers/{SnapManager.d.ts → snapManager.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/{SnapSnapshotBuilder.d.ts → snapSnapshotBuilder.d.ts} +1 -1
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +2 -2
- package/_vendor/canvas-core/editor/managers/{SpatialIndexManager.d.ts → spatialIndexManager.d.ts} +4 -4
- package/_vendor/canvas-core/editor/managers/{ToolManager.d.ts → toolManager.d.ts} +4 -5
- package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +4 -4
- package/_vendor/canvas-core/editor/renderWindow.d.ts +1 -1
- package/_vendor/canvas-core/editor/resizeGeometry.d.ts +2 -2
- package/_vendor/canvas-core/editor/selection.d.ts +26 -19
- package/_vendor/canvas-core/editor/selectionHandleInteractions.d.ts +1 -1
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +7 -5
- package/_vendor/canvas-core/editor/{StateNode.d.ts → stateNode.d.ts} +1 -1
- package/_vendor/canvas-core/exports/integrity.d.ts +1 -1
- package/_vendor/canvas-core/exports/svg.d.ts +6 -2
- package/_vendor/canvas-core/geometry/{Box.d.ts → box.d.ts} +1 -1
- package/_vendor/canvas-core/geometry/{Ellipse2d.d.ts → ellipse2d.d.ts} +3 -3
- package/_vendor/canvas-core/geometry/{Geometry2d.d.ts → geometry2d.d.ts} +2 -2
- package/_vendor/canvas-core/geometry/index.d.ts +7 -7
- package/_vendor/canvas-core/geometry/{Mat.d.ts → mat.d.ts} +1 -1
- package/_vendor/canvas-core/geometry/{Polyline2d.d.ts → polyline2d.d.ts} +3 -3
- package/_vendor/canvas-core/geometry/{Rectangle2d.d.ts → rectangle2d.d.ts} +3 -3
- package/_vendor/canvas-core/geometry/segments.d.ts +1 -1
- package/_vendor/canvas-core/index.d.ts +33 -31
- package/_vendor/canvas-core/plugins/{types.d.ts → editorPlugin.d.ts} +10 -9
- package/_vendor/canvas-core/plugins/index.d.ts +1 -1
- package/_vendor/canvas-core/schema/snapshotSupport.d.ts +43 -0
- package/_vendor/canvas-core/schema/snapshots.d.ts +6 -2
- package/_vendor/canvas-core/shapes/capabilities.d.ts +1 -1
- package/_vendor/canvas-core/shapes/colors.d.ts +26 -0
- package/_vendor/canvas-core/shapes/{ShapeUtil.d.ts → shapeUtil.d.ts} +22 -9
- package/_vendor/canvas-core/shapes/{ShapeUtilRegistry.d.ts → shapeUtilRegistry.d.ts} +1 -1
- package/_vendor/canvas-core/surfaces/actions.d.ts +35 -0
- package/_vendor/canvas-core/{contextMenu.d.ts → surfaces/contextMenu.d.ts} +11 -9
- package/_vendor/canvas-core/{toolbar.d.ts → surfaces/toolbar.d.ts} +17 -38
- package/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/index.d.ts +2 -2
- package/_vendor/canvas-core/tools/select/selectContainment.d.ts +5 -4
- package/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +3 -3
- package/_vendor/canvas-core/tools/select/states/{BrushingState.d.ts → brushingState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{DraggingSelectionHandleInteractionState.d.ts → draggingSelectionHandleInteractionState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{IdleState.d.ts → idleState.d.ts} +2 -2
- package/_vendor/canvas-core/tools/select/states/index.d.ts +11 -11
- package/_vendor/canvas-core/tools/select/states/{PointingCanvasState.d.ts → pointingCanvasState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{PointingResizeHandleState.d.ts → pointingResizeHandleState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{PointingRotateHandleState.d.ts → pointingRotateHandleState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{PointingSelectionHandleInteractionState.d.ts → pointingSelectionHandleInteractionState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{PointingShapeState.d.ts → pointingShapeState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{ResizingState.d.ts → resizingState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{RotatingState.d.ts → rotatingState.d.ts} +3 -3
- package/_vendor/canvas-core/tools/select/states/{SelectStateNode.d.ts → selectStateNode.d.ts} +2 -2
- package/_vendor/canvas-core/tools/select/states/{TranslatingState.d.ts → translatingState.d.ts} +5 -4
- package/_vendor/canvas-react/components/CanvasView.d.ts +7 -4
- package/_vendor/canvas-react/components/PageSpace.d.ts +1 -1
- package/_vendor/canvas-react/components/ShapeLayer.d.ts +4 -1
- package/_vendor/canvas-react/components/index.d.ts +0 -2
- 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/host/canvasOverlayRegistryContext.d.ts +3 -0
- package/_vendor/{canvas-plugin-api/index.d.ts → canvas-react/host/canvasPlugin.d.ts} +24 -8
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +3 -3
- package/_vendor/canvas-react/host/domEventGuards.d.ts +1 -1
- package/_vendor/{canvas-plugin-api/feature.d.ts → canvas-react/host/extension.d.ts} +3 -3
- package/_vendor/canvas-react/host/index.d.ts +8 -3
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +18 -0
- package/_vendor/canvas-react/host/pluginHost.d.ts +2 -93
- 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 +1 -1
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +7 -7
- package/_vendor/canvas-react/index.d.ts +2 -1
- package/_vendor/plugin-arrow/arrowBindingAnchors.d.ts +5 -0
- package/_vendor/plugin-arrow/arrowBindingGeometry.d.ts +28 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +24 -0
- package/_vendor/plugin-arrow/{ArrowShapeUtil.d.ts → arrowShapeUtil.d.ts} +5 -4
- package/_vendor/plugin-arrow/arrowTerminalBindingResolver.d.ts +5 -6
- package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +4 -4
- package/_vendor/plugin-arrow/canvas.d.ts +1 -1
- package/_vendor/plugin-arrow/{core.d.ts → editor.d.ts} +2 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -2
- package/_vendor/plugin-arrow/index.d.ts +6 -5
- package/_vendor/plugin-arrow/types.d.ts +2 -2
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +4 -2
- package/_vendor/plugin-draw/canvas.d.ts +1 -1
- package/_vendor/plugin-draw/drawHitTest.d.ts +2 -2
- package/_vendor/plugin-draw/editor.d.ts +7 -0
- package/_vendor/plugin-draw/feature.d.ts +2 -2
- package/_vendor/plugin-draw/index.d.ts +3 -3
- package/_vendor/plugin-draw/types.d.ts +3 -3
- package/_vendor/plugin-eraser/canvas.d.ts +1 -1
- package/_vendor/plugin-eraser/editor.d.ts +2 -0
- package/_vendor/plugin-eraser/feature.d.ts +2 -2
- package/_vendor/plugin-eraser/index.d.ts +2 -2
- package/_vendor/plugin-frame/canvas.d.ts +4 -3
- package/_vendor/plugin-frame/editor.d.ts +7 -0
- package/_vendor/plugin-frame/feature.d.ts +2 -2
- package/_vendor/plugin-frame/{FrameShapeUtil.d.ts → frameShapeUtil.d.ts} +4 -3
- package/_vendor/plugin-frame/{FrameTool.d.ts → frameTool.d.ts} +1 -1
- package/_vendor/plugin-frame/index.d.ts +4 -4
- package/_vendor/plugin-geo/canvas.d.ts +6 -4
- package/_vendor/plugin-geo/editor.d.ts +7 -0
- package/_vendor/plugin-geo/feature.d.ts +2 -2
- package/_vendor/plugin-geo/geoGeometry.d.ts +8 -0
- package/_vendor/plugin-geo/{GeoTools.d.ts → geoTools.d.ts} +9 -0
- package/_vendor/plugin-geo/index.d.ts +4 -4
- package/_vendor/plugin-geo/types.d.ts +6 -4
- package/_vendor/plugin-group/canvas.d.ts +5 -5
- package/_vendor/plugin-group/editor.d.ts +7 -0
- package/_vendor/plugin-group/feature.d.ts +2 -2
- package/_vendor/plugin-group/index.d.ts +3 -3
- package/_vendor/plugin-image/canvas.d.ts +1 -1
- package/_vendor/plugin-image/{core.d.ts → editor.d.ts} +3 -3
- package/_vendor/plugin-image/feature.d.ts +2 -2
- package/_vendor/plugin-image/{ImageShapeUtil.d.ts → imageShapeUtil.d.ts} +2 -1
- package/_vendor/plugin-image/index.d.ts +2 -2
- package/_vendor/plugin-laser/canvas.d.ts +1 -1
- package/_vendor/plugin-laser/editor.d.ts +2 -0
- package/_vendor/plugin-laser/feature.d.ts +2 -2
- package/_vendor/plugin-laser/index.d.ts +2 -2
- package/_vendor/plugin-text/canvas.d.ts +1 -1
- package/_vendor/plugin-text/editor.d.ts +2 -0
- package/_vendor/plugin-text/feature.d.ts +2 -2
- package/_vendor/plugin-text/host/RichTextToolbar.d.ts +3 -1
- package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +7 -0
- package/_vendor/plugin-text/textShapeSvgExporter.d.ts +6 -0
- package/_vendor/plugin-text/textTypes.d.ts +2 -2
- package/_vendor/store/index.d.ts +1 -1
- package/_vendor/store/{Store.d.ts → store.d.ts} +7 -1
- package/browser/localSnapshotRestore.d.ts +13 -0
- package/{_vendor/canvas-product-react/persistence/localSnapshotPersistence.d.ts → browser/persistence.d.ts} +16 -10
- 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/{_vendor/canvas-product-react/api/canvasProductApi.d.ts → core/controller/canvasProductController.d.ts} +11 -21
- 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/{_vendor/canvas-product-react/capabilities → core/features}/clipboard/clipboardService.d.ts +3 -2
- 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/{_vendor/canvas-product-react/capabilities/export/useSvgExport.d.ts → core/features/export/svgExport.d.ts} +11 -7
- 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/{_vendor/canvas-product-react → core}/runtime/productServices.d.ts +1 -2
- package/{_vendor/plugin-image-product-react → features/image}/ImageImportController.d.ts +2 -2
- package/{_vendor/plugin-image-product-react → features/image}/imageAssetService.d.ts +2 -2
- package/{_vendor/plugin-image-product-react → features/image}/imageBlobStore.d.ts +1 -1
- package/features/image/imageFileHelpers.d.ts +35 -0
- package/{_vendor/plugin-image-product-react → features/image}/imageHostActions.d.ts +13 -12
- 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/{_vendor/plugin-image-product-react → features/image}/imageToolbarHostBridge.d.ts +2 -2
- package/{_vendor/plugin-image-product-react → features/image}/index.d.ts +4 -5
- package/{_vendor/plugin-image-product-react → features/image}/svgImageAssetInliner.d.ts +1 -1
- package/{_vendor/plugin-image-product-react → features/image}/useImageImport.d.ts +5 -4
- package/index.css +1 -2
- package/index.d.ts +12 -14
- 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/{product/useCanvasClipboardShortcuts.d.ts → react/useCanvasKitKeyboardShortcuts.d.ts} +1 -1
- 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/arrow/arrowBindingHelpers.d.ts +0 -28
- package/_vendor/canvas-core/tools/hand/HandTool.d.ts +0 -5
- package/_vendor/canvas-core/tools/select/SelectTool.d.ts +0 -5
- package/_vendor/canvas-product-react/api/apiRegistry.d.ts +0 -12
- package/_vendor/canvas-product-react/api/index.d.ts +0 -4
- package/_vendor/canvas-product-react/capabilities/clipboard/systemClipboard.d.ts +0 -16
- package/_vendor/canvas-product-react/capabilities/context-menu/systemContextMenu.d.ts +0 -17
- package/_vendor/canvas-product-react/capabilities/context-menu/useContextMenuSurface.d.ts +0 -12
- package/_vendor/canvas-product-react/capabilities/history/useHistoryControls.d.ts +0 -8
- package/_vendor/canvas-product-react/capabilities/pages/usePageControls.d.ts +0 -12
- package/_vendor/canvas-product-react/capabilities/toolbar/systemToolbar.d.ts +0 -32
- package/_vendor/canvas-product-react/capabilities/toolbar/useToolbarSurfaces.d.ts +0 -19
- package/_vendor/canvas-product-react/capabilities/zoom/useZoomControls.d.ts +0 -9
- package/_vendor/canvas-product-react/index.d.ts +0 -24
- package/_vendor/canvas-product-react/persistence/index.d.ts +0 -2
- package/_vendor/canvas-product-react/runtime/CanvasProductRoot.d.ts +0 -4
- package/_vendor/canvas-product-react/runtime/productDefinition.d.ts +0 -45
- package/_vendor/plugin-draw/core.d.ts +0 -7
- package/_vendor/plugin-eraser/core.d.ts +0 -2
- package/_vendor/plugin-frame/core.d.ts +0 -7
- package/_vendor/plugin-geo/core.d.ts +0 -7
- package/_vendor/plugin-group/core.d.ts +0 -7
- package/_vendor/plugin-image-product-react/imageProductApi.d.ts +0 -21
- package/_vendor/plugin-image-product-react/imageToolbarRuntime.d.ts +0 -2
- package/_vendor/plugin-image-product-react/snapshotGuards.d.ts +0 -1
- package/_vendor/plugin-laser/core.d.ts +0 -2
- package/_vendor/plugin-text/TextShapeSvgExporter.d.ts +0 -6
- package/_vendor/plugin-text/core.d.ts +0 -2
- package/api/canvasKitApi.d.ts +0 -29
- 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-CxN5NN6u.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-R17_x8HU.mjs +0 -44
- package/standard.mjs +0 -1
- /package/_vendor/canvas-core/editor/managers/{SideEffectManager.d.ts → sideEffectManager.d.ts} +0 -0
- /package/_vendor/canvas-core/geometry/{Vec.d.ts → vec.d.ts} +0 -0
- /package/_vendor/canvas-react/host/{CanvasRendererRegistryContext.d.ts → canvasRendererRegistryContext.d.ts} +0 -0
- /package/_vendor/plugin-arrow/{ArrowBindingUtil.d.ts → arrowBindingUtil.d.ts} +0 -0
- /package/_vendor/plugin-arrow/{ArrowTool.d.ts → arrowTool.d.ts} +0 -0
- /package/_vendor/plugin-draw/{DrawShapeUtil.d.ts → drawShapeUtil.d.ts} +0 -0
- /package/_vendor/plugin-draw/{DrawTool.d.ts → drawTool.d.ts} +0 -0
- /package/_vendor/plugin-eraser/{EraserTool.d.ts → eraserTool.d.ts} +0 -0
- /package/_vendor/plugin-geo/{GeoShapeUtil.d.ts → geoShapeUtil.d.ts} +0 -0
- /package/_vendor/plugin-group/{GroupShapeUtil.d.ts → groupShapeUtil.d.ts} +0 -0
- /package/_vendor/plugin-laser/{LaserTool.d.ts → laserTool.d.ts} +0 -0
- /package/_vendor/plugin-text/{ArrowLabelBindingUtil.d.ts → arrowLabelBindingUtil.d.ts} +0 -0
- /package/_vendor/plugin-text/{GeoLabelBindingUtil.d.ts → geoLabelBindingUtil.d.ts} +0 -0
- /package/_vendor/plugin-text/{TextShapeUtil.d.ts → textShapeUtil.d.ts} +0 -0
- /package/_vendor/plugin-text/{TextTool.d.ts → textTool.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuzhouu/canvas-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Land canvas packaged as an all-in-one React canvas kit and typed API surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
@@ -15,16 +15,6 @@
|
|
|
15
15
|
"import": "./index.mjs",
|
|
16
16
|
"default": "./index.mjs"
|
|
17
17
|
},
|
|
18
|
-
"./product": {
|
|
19
|
-
"types": "./product/index.d.ts",
|
|
20
|
-
"import": "./product.mjs",
|
|
21
|
-
"default": "./product.mjs"
|
|
22
|
-
},
|
|
23
|
-
"./standard": {
|
|
24
|
-
"types": "./standard/index.d.ts",
|
|
25
|
-
"import": "./standard.mjs",
|
|
26
|
-
"default": "./standard.mjs"
|
|
27
|
-
},
|
|
28
18
|
"./style.css": "./index.css",
|
|
29
19
|
"./package.json": "./package.json"
|
|
30
20
|
},
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { CanvasPluginHostRuntime, LandExtension } from "../_vendor/canvas-react/host/index";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { CanvasProductRuntimeInitializer, ProductAssetResolverService, ProductPersistenceAdapter, ProductServiceFactory, ProductServiceToken } from "../core";
|
|
4
|
+
import type { CanvasKitBaseController, CanvasKitController } from "../controller/canvasKitController";
|
|
5
|
+
import type { CanvasKitChromeContext } from "../chrome/types";
|
|
6
|
+
import { type CanvasKitHostExtension } from "../runtime/canvasKitHostExtensions";
|
|
7
|
+
export declare const CANVAS_KIT_STORAGE_NAMESPACE = "land.canvasKit";
|
|
8
|
+
declare const CANVAS_KIT_PRODUCT_BRAND: unique symbol;
|
|
9
|
+
export type CanvasKitChromeRenderer<TController extends CanvasKitBaseController = CanvasKitController> = (context: CanvasKitChromeContext<TController>) => ReactNode;
|
|
10
|
+
export type CanvasKitDocumentSeed<TController extends CanvasKitBaseController = CanvasKitController> = (controller: TController) => void;
|
|
11
|
+
export interface CanvasKitExtensionOptions {
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
draw?: boolean;
|
|
14
|
+
eraser?: boolean;
|
|
15
|
+
frame?: boolean;
|
|
16
|
+
geo?: boolean;
|
|
17
|
+
group?: boolean;
|
|
18
|
+
image?: boolean;
|
|
19
|
+
laser?: boolean;
|
|
20
|
+
text?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface CanvasKitProductOptions<TController extends CanvasKitBaseController = CanvasKitController> {
|
|
23
|
+
id?: string;
|
|
24
|
+
chrome?: CanvasKitChromeRenderer<TController>;
|
|
25
|
+
exposeControllerOnWindow?: boolean;
|
|
26
|
+
onControllerDispose?: () => void;
|
|
27
|
+
onControllerReady?: (controller: TController) => void;
|
|
28
|
+
persistence?: ProductPersistenceAdapter | null;
|
|
29
|
+
seedDocument?: CanvasKitDocumentSeed<TController>;
|
|
30
|
+
shouldSkipStoredSnapshots?: () => boolean;
|
|
31
|
+
builtInExtensions?: CanvasKitExtensionOptions;
|
|
32
|
+
storageNamespace?: string;
|
|
33
|
+
warnOnPluginRegistrationConflicts?: boolean;
|
|
34
|
+
windowKey?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ResolvedCanvasKitConfig<TController extends CanvasKitBaseController = CanvasKitController> {
|
|
37
|
+
renderChrome?: CanvasKitChromeRenderer<TController>;
|
|
38
|
+
exposeControllerOnWindow: boolean;
|
|
39
|
+
onControllerDispose?: () => void;
|
|
40
|
+
onControllerReady?: (controller: TController) => void;
|
|
41
|
+
windowKey: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CanvasKitProduct<TController extends CanvasKitBaseController = CanvasKitController> {
|
|
44
|
+
readonly [CANVAS_KIT_PRODUCT_BRAND]: TController;
|
|
45
|
+
}
|
|
46
|
+
export interface ResolvedCanvasKitProduct<TController extends CanvasKitBaseController = CanvasKitController> extends CanvasKitProduct<TController> {
|
|
47
|
+
readonly assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
48
|
+
readonly canvasExtensions: readonly LandExtension[];
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly config: ResolvedCanvasKitConfig<TController>;
|
|
51
|
+
readonly hostExtensions: readonly CanvasKitHostExtension[];
|
|
52
|
+
readonly initializeRuntime: CanvasProductRuntimeInitializer<CanvasPluginHostRuntime>;
|
|
53
|
+
readonly persistence: ProductPersistenceAdapter | null;
|
|
54
|
+
readonly serviceFactories: readonly ProductServiceFactory<unknown>[];
|
|
55
|
+
readonly shouldSkipStoredSnapshots?: () => boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function defineCanvasKit<TController extends CanvasKitBaseController = CanvasKitController>(options?: CanvasKitProductOptions<TController>): CanvasKitProduct<TController>;
|
|
58
|
+
export declare function asResolvedCanvasKitProduct<TController extends CanvasKitBaseController = CanvasKitController>(product: CanvasKitProduct<TController>): ResolvedCanvasKitProduct<TController>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CanvasKitController, CanvasKitBaseController } from "../controller/canvasKitController";
|
|
2
|
+
import type { CanvasKitProduct } from "../product/canvasKitProduct";
|
|
3
|
+
export declare function CanvasKitRoot<TController extends CanvasKitBaseController = CanvasKitController>({ product, }: {
|
|
4
|
+
product: CanvasKitProduct<TController>;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CanvasKitController, type CanvasKitControllerRuntimeContext, type CanvasKitBaseController } from "../controller/canvasKitController";
|
|
2
|
+
import type { ResolvedCanvasKitConfig } from "../product/canvasKitProduct";
|
|
3
|
+
export declare function useCanvasKitController<TController extends CanvasKitBaseController = CanvasKitController>({ featureControllers, config, editor, pluginHostRuntime, productId, services, }: CanvasKitControllerRuntimeContext & {
|
|
4
|
+
config: ResolvedCanvasKitConfig<TController>;
|
|
5
|
+
}): TController;
|
package/{product/useCanvasClipboardShortcuts.d.ts → react/useCanvasKitKeyboardShortcuts.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
2
|
import type { CanvasPluginHostRuntime } from "../_vendor/canvas-react/host/index";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function useCanvasKitKeyboardShortcuts({ editor, pluginHostRuntime, }: {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
6
6
|
}): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CanvasKitController, CanvasKitBaseController } from "../controller/canvasKitController";
|
|
2
|
+
import { type CanvasKitProduct } from "../product/canvasKitProduct";
|
|
3
|
+
import { type CanvasKitRuntime } from "../runtime/canvasKitRuntime";
|
|
4
|
+
export declare function useCanvasKitRuntime<TController extends CanvasKitBaseController = CanvasKitController>(product: CanvasKitProduct<TController>): CanvasKitRuntime<TController> | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CanvasKitController, CanvasKitBaseController } from "../controller/canvasKitController";
|
|
2
|
+
import type { CanvasKitPersistenceControls } from "../chrome/types";
|
|
3
|
+
import type { CanvasKitRuntime } from "../runtime/canvasKitRuntime";
|
|
4
|
+
interface CanvasKitStartup {
|
|
5
|
+
isReady: boolean;
|
|
6
|
+
persistence: CanvasKitPersistenceControls;
|
|
7
|
+
}
|
|
8
|
+
export declare function useCanvasKitStartup<TController extends CanvasKitBaseController = CanvasKitController>(runtime: CanvasKitRuntime<TController> | null): CanvasKitStartup;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { CanvasActionContext, Editor } from "../_vendor/canvas-core/index";
|
|
3
|
+
import type { CanvasPluginHostRuntime } from "../_vendor/canvas-react/host/index";
|
|
4
|
+
import { type CanvasProductRuntimeContribution, type ProductAssetResolverService, type ProductServiceFactory, type ProductServiceRegistry, type ProductServiceToken, type SvgAssetInliner } from "../core";
|
|
5
|
+
export interface CanvasKitHostExtension extends CanvasProductRuntimeContribution<CanvasPluginHostRuntime> {
|
|
6
|
+
canShowToolbarDuringEditing?: (context: CanvasActionContext) => boolean;
|
|
7
|
+
createSvgAssetInliners?: (services: ProductServiceRegistry) => readonly SvgAssetInliner[];
|
|
8
|
+
renderController?: (input: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
services: ProductServiceRegistry;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function createCanvasKitHostExtensions({ flushSnapshot, image, }: {
|
|
14
|
+
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
15
|
+
image: boolean;
|
|
16
|
+
}): readonly CanvasKitHostExtension[];
|
|
17
|
+
export declare function getCanvasKitHostExtensionSvgAssetInliners(hostExtensions: readonly CanvasKitHostExtension[], services: ProductServiceRegistry): readonly SvgAssetInliner[];
|
|
18
|
+
export declare function getCanvasKitHostExtensionServiceFactories(hostExtensions: readonly CanvasKitHostExtension[]): readonly ProductServiceFactory<unknown>[];
|
|
19
|
+
export declare function getCanvasKitHostExtensionAssetResolverTokens(hostExtensions: readonly CanvasKitHostExtension[]): readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasPluginHostRuntime } from "../_vendor/canvas-react/host/index";
|
|
3
|
+
import { type ProductAssetResolverService, type ProductFeatureControllerRegistryRuntime, type ProductPersistenceAdapter, type ProductServiceRegistryRuntime, type ProductServiceToken } from "../core";
|
|
4
|
+
import type { CanvasKitController, CanvasKitBaseController } from "../controller/canvasKitController";
|
|
5
|
+
import type { ResolvedCanvasKitConfig, ResolvedCanvasKitProduct } from "../product/canvasKitProduct";
|
|
6
|
+
import type { CanvasKitHostExtension } from "./canvasKitHostExtensions";
|
|
7
|
+
export interface CanvasKitRuntime<TController extends CanvasKitBaseController = CanvasKitController> {
|
|
8
|
+
assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
9
|
+
config: ResolvedCanvasKitConfig<TController>;
|
|
10
|
+
editor: Editor;
|
|
11
|
+
featureControllers: ProductFeatureControllerRegistryRuntime;
|
|
12
|
+
hostExtensions: readonly CanvasKitHostExtension[];
|
|
13
|
+
persistence: ProductPersistenceAdapter | null;
|
|
14
|
+
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
15
|
+
productId: string;
|
|
16
|
+
services: ProductServiceRegistryRuntime;
|
|
17
|
+
shouldSkipStoredSnapshots?: () => boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function createCanvasKitRuntime<TController extends CanvasKitBaseController = CanvasKitController>(product: ResolvedCanvasKitProduct<TController>): CanvasKitRuntime<TController>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CanvasActionContext } from "../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasKitBaseController } from "../controller/canvasKitController";
|
|
3
|
+
import type { CanvasProductRuntimeInitializer } from "../core";
|
|
4
|
+
import type { CanvasKitHostExtension } from "./canvasKitHostExtensions";
|
|
5
|
+
import type { CanvasKitRuntime } from "./canvasKitRuntime";
|
|
6
|
+
export declare function createCanvasKitRuntimeInitializer<TController extends CanvasKitBaseController>({ hostExtensions, seedDocument, warnOnPluginRegistrationConflicts, }: {
|
|
7
|
+
hostExtensions: readonly CanvasKitHostExtension[];
|
|
8
|
+
seedDocument?: (controller: TController) => void;
|
|
9
|
+
warnOnPluginRegistrationConflicts: boolean;
|
|
10
|
+
}): CanvasProductRuntimeInitializer<CanvasKitRuntime["pluginHostRuntime"]>;
|
|
11
|
+
export declare function canShowCanvasKitToolbarDuringEditing(hostExtensions: readonly CanvasKitHostExtension[], context: CanvasActionContext): boolean;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Vec } from "../../geometry/Vec";
|
|
2
|
-
import type { Editor } from "../../editor/Editor";
|
|
3
|
-
import type { ArrowBindingPreviewState } from "../../editor/selection";
|
|
4
|
-
import type { ShapeId } from "../../schema/records";
|
|
5
|
-
export interface ConnectionPoint {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
}
|
|
9
|
-
export type ConnectionTerminal = "start" | "end";
|
|
10
|
-
export interface ArrowBindingTargetInput {
|
|
11
|
-
targetShapeId: ShapeId;
|
|
12
|
-
normalizedAnchor: ConnectionPoint;
|
|
13
|
-
}
|
|
14
|
-
export interface ResolvedArrowTerminalBinding {
|
|
15
|
-
pagePoint: Vec;
|
|
16
|
-
binding: ArrowBindingTargetInput | null;
|
|
17
|
-
preview: ArrowBindingPreviewState | null;
|
|
18
|
-
}
|
|
19
|
-
export interface ArrowTerminalBindingResolverInput {
|
|
20
|
-
terminal: ConnectionTerminal;
|
|
21
|
-
rawPagePoint: Vec;
|
|
22
|
-
oppositePagePoint: Vec;
|
|
23
|
-
excludeShapeId?: ShapeId;
|
|
24
|
-
ignoreTargets?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export type ArrowTerminalBindingResolver = (editor: Editor, input: ArrowTerminalBindingResolverInput) => ResolvedArrowTerminalBinding;
|
|
27
|
-
export declare function getFreeArrowTerminalBinding({ rawPagePoint, }: ArrowTerminalBindingResolverInput): ResolvedArrowTerminalBinding;
|
|
28
|
-
export declare function resolveArrowTerminalBindingAtPoint(editor: Editor, input: ArrowTerminalBindingResolverInput): ResolvedArrowTerminalBinding;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ProductApiToken<TApi> {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly __api?: TApi;
|
|
4
|
-
}
|
|
5
|
-
export interface ProductApiRegistry {
|
|
6
|
-
get<TApi>(token: ProductApiToken<TApi>): TApi | null;
|
|
7
|
-
}
|
|
8
|
-
export interface ProductApiRegistryRuntime extends ProductApiRegistry {
|
|
9
|
-
register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
|
|
10
|
-
}
|
|
11
|
-
export declare function createProductApiToken<TApi>(id: string): ProductApiToken<TApi>;
|
|
12
|
-
export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { createProductApiRegistry, createProductApiToken, } from "./apiRegistry";
|
|
2
|
-
export type { ProductApiRegistry, ProductApiRegistryRuntime, ProductApiToken, } from "./apiRegistry";
|
|
3
|
-
export { createCanvasProductApi, useCanvasProductApi, useCanvasProductApiLifecycle, } from "./canvasProductApi";
|
|
4
|
-
export type { CanvasProductApi, CanvasProductApiContext, CanvasProductApiLifecycleOptions, CanvasProductApiOptions, CanvasProductApiSnapshot, CanvasProductLayerActionState, CanvasProductLayerNode, CanvasProductLayerPlacement, CanvasProductLayerPlacementFailureReason, CanvasProductLayerPlacementResult, CanvasProductPageRef, CanvasProductSessionPageState, CanvasProductSessionSnapshot, CanvasProductShapeRef, } from "./canvasProductApi";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { CanvasPluginHostRuntime } from "../../../canvas-react/host/index";
|
|
2
|
-
import type { CanvasProductRuntimeSetupContext } from "../../runtime/productDefinition";
|
|
3
|
-
import type { ProductServiceRegistry } from "../../runtime/productServices";
|
|
4
|
-
import { type CanvasClipboardService } from "./clipboardService";
|
|
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 SYSTEM_SELECTION_DUPLICATE_ACTION_ID = "system.selection.duplicate";
|
|
10
|
-
export declare const SYSTEM_SELECTION_SELECT_ALL_ACTION_ID = "system.selection.select-all";
|
|
11
|
-
export declare function registerSystemClipboardRuntime({ pluginHostRuntime, productId, services, }: CanvasProductRuntimeSetupContext): void;
|
|
12
|
-
export declare function registerSystemClipboardActions({ pluginHostRuntime, services, }: {
|
|
13
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
14
|
-
services: ProductServiceRegistry;
|
|
15
|
-
}): void;
|
|
16
|
-
export declare function getCanvasClipboardService(services: ProductServiceRegistry): CanvasClipboardService | null;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ContextMenuContext, type ContextMenuContributionTarget, type ContextMenuTarget, type Editor, type ToolbarActionValue } from "../../../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginHostRuntime } from "../../../canvas-react/host/index";
|
|
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 registerSystemContextMenuContributions(pluginHostRuntime: CanvasPluginHostRuntime): void;
|
|
7
|
-
export declare function createContextMenuContext({ editor, menu, }: {
|
|
8
|
-
editor: Editor;
|
|
9
|
-
menu: ContextMenuContext["menu"];
|
|
10
|
-
}): ContextMenuContext;
|
|
11
|
-
export declare function getContextMenuContributionTarget(target: ContextMenuTarget, editor: Editor): ContextMenuContributionTarget;
|
|
12
|
-
export declare function runContextMenuAction({ actionId, context, pluginHostRuntime, value, }: {
|
|
13
|
-
actionId: string;
|
|
14
|
-
context: ContextMenuContext;
|
|
15
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
16
|
-
value?: ToolbarActionValue;
|
|
17
|
-
}): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ContextMenuContext, ContextMenuOpenSnapshot, ContextMenuSection, Editor } from "../../../canvas-core/index";
|
|
2
|
-
import type { CanvasPluginHostRuntime } from "../../../canvas-react/host/index";
|
|
3
|
-
export interface ContextMenuSurface {
|
|
4
|
-
context: ContextMenuContext | null;
|
|
5
|
-
openSnapshot: ContextMenuOpenSnapshot | null;
|
|
6
|
-
sections: readonly ContextMenuSection[];
|
|
7
|
-
}
|
|
8
|
-
export declare function useContextMenuSurface({ editor, openSnapshot, pluginHostRuntime, }: {
|
|
9
|
-
editor: Editor;
|
|
10
|
-
openSnapshot: ContextMenuOpenSnapshot | null;
|
|
11
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
12
|
-
}): ContextMenuSurface;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Editor, PageId, PageRecord } from "../../../canvas-core/index";
|
|
2
|
-
export interface PageControls {
|
|
3
|
-
pages: readonly PageRecord[];
|
|
4
|
-
currentPage: PageRecord | null;
|
|
5
|
-
currentPageId: PageId;
|
|
6
|
-
canDeleteCurrentPage: boolean;
|
|
7
|
-
createPage(): void;
|
|
8
|
-
deleteCurrentPage(): void;
|
|
9
|
-
renameCurrentPage(nextName: string): void;
|
|
10
|
-
selectPage(pageId: PageId): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function usePageControls(editor: Editor): PageControls;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type Editor, type ToolbarContext, type ToolbarGroup } from "../../../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginHostRuntime } from "../../../canvas-react/host/index";
|
|
3
|
-
export declare const SYSTEM_SELECTION_DELETE_ACTION_ID = "system.selection.delete";
|
|
4
|
-
export declare const SYSTEM_SELECTION_GROUP_ACTION_ID = "system.selection.group";
|
|
5
|
-
export declare const SYSTEM_SELECTION_UNGROUP_ACTION_ID = "system.selection.ungroup";
|
|
6
|
-
export declare function registerSystemToolbarContributions(pluginHostRuntime: CanvasPluginHostRuntime): void;
|
|
7
|
-
export declare function createToolbarContext({ editor, toolState, selectionState, }: {
|
|
8
|
-
editor: Editor;
|
|
9
|
-
toolState: {
|
|
10
|
-
activeToolId: string;
|
|
11
|
-
isToolLocked: boolean;
|
|
12
|
-
};
|
|
13
|
-
selectionState: {
|
|
14
|
-
count: number;
|
|
15
|
-
singleShapeType: ToolbarContext["selection"]["singleShapeType"];
|
|
16
|
-
commonShapeType: ToolbarContext["selection"]["commonShapeType"];
|
|
17
|
-
canResetSelectionRotation: boolean;
|
|
18
|
-
isMixedFrameAndPointHandleSelection: boolean;
|
|
19
|
-
};
|
|
20
|
-
}): ToolbarContext;
|
|
21
|
-
export declare function getActiveToolLabel(groups: readonly ToolbarGroup[], activeToolId: string): string;
|
|
22
|
-
export declare function getSelectionToolbarTitle({ commonShapeType, count, isMixedFrameAndPointHandleSelection, singleShapeType, }: {
|
|
23
|
-
commonShapeType: string | null;
|
|
24
|
-
count: number;
|
|
25
|
-
isMixedFrameAndPointHandleSelection: boolean;
|
|
26
|
-
singleShapeType: string | null;
|
|
27
|
-
}): string;
|
|
28
|
-
export declare function runToolbarAction({ context, pluginHostRuntime, actionId, }: {
|
|
29
|
-
context: ToolbarContext;
|
|
30
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
31
|
-
actionId: string;
|
|
32
|
-
}): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Editor, ToolbarContext, ToolbarGroup } from "../../../canvas-core/index";
|
|
2
|
-
import type { CanvasPluginHostRuntime } from "../../../canvas-react/host/index";
|
|
3
|
-
export interface ToolbarSurfaces {
|
|
4
|
-
context: ToolbarContext;
|
|
5
|
-
activeToolId: string;
|
|
6
|
-
activeToolLabel: string;
|
|
7
|
-
isToolLocked: boolean;
|
|
8
|
-
selectionCount: number;
|
|
9
|
-
hasMixedSelectionRotation: boolean;
|
|
10
|
-
toolChromeToolbarGroups: readonly ToolbarGroup[];
|
|
11
|
-
contextToolbarGroups: readonly ToolbarGroup[];
|
|
12
|
-
contextToolbarTitle: string;
|
|
13
|
-
showContextToolbar: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function useToolbarSurfaces({ canShowContextToolbarDuringEditing, editor, pluginHostRuntime, }: {
|
|
16
|
-
canShowContextToolbarDuringEditing?: (context: ToolbarContext) => boolean;
|
|
17
|
-
editor: Editor;
|
|
18
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
19
|
-
}): ToolbarSurfaces;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Editor } from "../../../canvas-core/index";
|
|
2
|
-
export interface ZoomControlsState {
|
|
3
|
-
zoom: number;
|
|
4
|
-
label: string;
|
|
5
|
-
zoomIn(): void;
|
|
6
|
-
zoomOut(): void;
|
|
7
|
-
resetZoom(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare function useZoomControls(editor: Editor): ZoomControlsState;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export { CanvasProductRoot } from "./runtime/CanvasProductRoot";
|
|
2
|
-
export { defineCanvasProduct } from "./runtime/productDefinition";
|
|
3
|
-
export { createProductApiRegistry, createProductApiToken, } from "./api/apiRegistry";
|
|
4
|
-
export { createProductServiceRegistry, createProductServiceToken, requireProductService, } from "./runtime/productServices";
|
|
5
|
-
export type { CanvasProductDefinition, CanvasProductShellProps, CanvasProductRuntimeSetup, CanvasProductRuntimeSetupContext, CreateCanvasProductEditorOptions, ProductPersistenceAdapter, } from "./runtime/productDefinition";
|
|
6
|
-
export type { ProductAssetResolverService, ProductServiceFactory, ProductServiceFactoryContext, ProductServiceRegistry, ProductServiceRegistryRuntime, ProductServiceToken, } from "./runtime/productServices";
|
|
7
|
-
export type { ProductApiRegistry, ProductApiRegistryRuntime, ProductApiToken, } from "./api/apiRegistry";
|
|
8
|
-
export { SYSTEM_SELECTION_DELETE_ACTION_ID, SYSTEM_SELECTION_GROUP_ACTION_ID, SYSTEM_SELECTION_UNGROUP_ACTION_ID, createToolbarContext, getActiveToolLabel, getSelectionToolbarTitle, registerSystemToolbarContributions, runToolbarAction, } from "./capabilities/toolbar/systemToolbar";
|
|
9
|
-
export { SYSTEM_VIEW_RESET_ZOOM_ACTION_ID, SYSTEM_VIEW_ZOOM_IN_ACTION_ID, SYSTEM_VIEW_ZOOM_OUT_ACTION_ID, createContextMenuContext, getContextMenuContributionTarget, registerSystemContextMenuContributions, runContextMenuAction, } from "./capabilities/context-menu/systemContextMenu";
|
|
10
|
-
export { useContextMenuSurface } from "./capabilities/context-menu/useContextMenuSurface";
|
|
11
|
-
export type { ContextMenuSurface } from "./capabilities/context-menu/useContextMenuSurface";
|
|
12
|
-
export { canvasClipboardServiceToken, memoryCanvasClipboardService, } from "./capabilities/clipboard/clipboardService";
|
|
13
|
-
export type { CanvasClipboardService } from "./capabilities/clipboard/clipboardService";
|
|
14
|
-
export { SYSTEM_CLIPBOARD_COPY_ACTION_ID, SYSTEM_CLIPBOARD_CUT_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_AT_POINT_ACTION_ID, SYSTEM_SELECTION_DUPLICATE_ACTION_ID, SYSTEM_SELECTION_SELECT_ALL_ACTION_ID, getCanvasClipboardService, registerSystemClipboardActions, registerSystemClipboardRuntime, } from "./capabilities/clipboard/systemClipboard";
|
|
15
|
-
export { useHistoryControls } from "./capabilities/history/useHistoryControls";
|
|
16
|
-
export type { HistoryControls } from "./capabilities/history/useHistoryControls";
|
|
17
|
-
export { usePageControls } from "./capabilities/pages/usePageControls";
|
|
18
|
-
export type { PageControls } from "./capabilities/pages/usePageControls";
|
|
19
|
-
export { useSvgExport } from "./capabilities/export/useSvgExport";
|
|
20
|
-
export type { ExportStatus, SvgAssetInliner, SvgExportControls, SvgExportResult, } from "./capabilities/export/useSvgExport";
|
|
21
|
-
export { useToolbarSurfaces } from "./capabilities/toolbar/useToolbarSurfaces";
|
|
22
|
-
export type { ToolbarSurfaces } from "./capabilities/toolbar/useToolbarSurfaces";
|
|
23
|
-
export { useZoomControls } from "./capabilities/zoom/useZoomControls";
|
|
24
|
-
export type { ZoomControlsState } from "./capabilities/zoom/useZoomControls";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { LAND_DOCUMENT_INDEXEDDB_NAME, LAND_DOCUMENT_INDEXEDDB_STORE, LAND_DOCUMENT_INDEXEDDB_VERSION, LAND_DOCUMENT_STORAGE_KEY, LAND_IMAGE_BLOB_INDEXEDDB_STORE, LAND_SESSION_STORAGE_KEY, PersistenceManager, createLocalSnapshotPersistence, persistEditorSnapshot, readPersistedDocumentSnapshot, readPersistedEditorSnapshots, readPersistedSessionSnapshot, } from "./localSnapshotPersistence";
|
|
2
|
-
export type { LocalSnapshotPersistenceOptions, PersistedEditorSnapshots, } from "./localSnapshotPersistence";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, ReactNode } from "react";
|
|
2
|
-
import type { AssetId, ContextMenuOpenSnapshot, Editor, LandCorePlugin } from "../../canvas-core/index";
|
|
3
|
-
import type { LandExtension } from "../../canvas-plugin-api/index";
|
|
4
|
-
import type { CanvasPluginHostRuntime } from "../../canvas-react/host/index";
|
|
5
|
-
import type { ProductApiRegistry, ProductApiRegistryRuntime } from "../api/apiRegistry";
|
|
6
|
-
import type { ProductAssetResolverService, ProductServiceFactory, ProductServiceRegistry, ProductServiceRegistryRuntime, ProductServiceToken } from "./productServices";
|
|
7
|
-
export interface ProductPersistenceAdapter {
|
|
8
|
-
restore?(editor: Editor): Promise<void>;
|
|
9
|
-
start?(editor: Editor): () => void;
|
|
10
|
-
}
|
|
11
|
-
export interface CreateCanvasProductEditorOptions {
|
|
12
|
-
corePlugins: readonly LandCorePlugin[];
|
|
13
|
-
resolveAssetUrl?: (assetId: AssetId) => string | null;
|
|
14
|
-
}
|
|
15
|
-
export interface CanvasProductRuntimeSetupContext {
|
|
16
|
-
productId: string;
|
|
17
|
-
apiRegistry: ProductApiRegistryRuntime;
|
|
18
|
-
editor: Editor;
|
|
19
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
20
|
-
services: ProductServiceRegistryRuntime;
|
|
21
|
-
}
|
|
22
|
-
export type CanvasProductRuntimeSetup = (context: CanvasProductRuntimeSetupContext) => void;
|
|
23
|
-
export interface CanvasProductShellProps {
|
|
24
|
-
product: CanvasProductDefinition;
|
|
25
|
-
editor: Editor;
|
|
26
|
-
pluginHostRuntime: CanvasPluginHostRuntime;
|
|
27
|
-
apiRegistry: ProductApiRegistry;
|
|
28
|
-
services: ProductServiceRegistry;
|
|
29
|
-
canvas: ReactNode | null;
|
|
30
|
-
contextMenuOpenSnapshot: ContextMenuOpenSnapshot | null;
|
|
31
|
-
onContextMenuOpenChange: (snapshot: ContextMenuOpenSnapshot | null) => void;
|
|
32
|
-
isReady: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface CanvasProductDefinition {
|
|
35
|
-
id: string;
|
|
36
|
-
extensions: readonly LandExtension[];
|
|
37
|
-
createEditor(options: CreateCanvasProductEditorOptions): Editor;
|
|
38
|
-
Shell: ComponentType<CanvasProductShellProps>;
|
|
39
|
-
runtimeSetups?: readonly CanvasProductRuntimeSetup[];
|
|
40
|
-
services?: readonly ProductServiceFactory<unknown>[];
|
|
41
|
-
assetResolverTokens?: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
42
|
-
persistence?: ProductPersistenceAdapter | null;
|
|
43
|
-
shouldSkipStoredSnapshots?: () => boolean;
|
|
44
|
-
}
|
|
45
|
-
export declare function defineCanvasProduct(definition: CanvasProductDefinition): CanvasProductDefinition;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type LandCorePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
|
-
import { type DrawShapeRecord } from "./types";
|
|
3
|
-
export declare class DrawShapeSvgExporter implements ShapeSvgExporter<DrawShapeRecord> {
|
|
4
|
-
readonly type: "draw";
|
|
5
|
-
toSvg(shape: DrawShapeRecord): SvgNode | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function createDrawCorePlugin(): LandCorePlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type LandCorePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
|
-
import { type FrameShapeRecord } from "./FrameShapeUtil";
|
|
3
|
-
export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShapeRecord> {
|
|
4
|
-
readonly type: "frame";
|
|
5
|
-
toSvg(shape: FrameShapeRecord): SvgNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function createFrameCorePlugin(): LandCorePlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type LandCorePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
|
-
import { type GeoShapeRecord } from "./types";
|
|
3
|
-
export declare class GeoShapeSvgExporter implements ShapeSvgExporter<GeoShapeRecord> {
|
|
4
|
-
readonly type: "geo";
|
|
5
|
-
toSvg(shape: GeoShapeRecord): SvgNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function createGeoCorePlugin(): LandCorePlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type LandCorePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
|
-
import { type GroupShapeRecord } from "./GroupShapeUtil";
|
|
3
|
-
export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShapeRecord> {
|
|
4
|
-
readonly type: "group";
|
|
5
|
-
toSvg(_shape: GroupShapeRecord): SvgNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function createGroupCorePlugin(): LandCorePlugin;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Editor, ShapeId, Vec } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasProductRuntimeSetup } from "../canvas-product-react/index";
|
|
3
|
-
import { type ImageImportSource } from "./imageHostActions";
|
|
4
|
-
export interface ImageInsertInput {
|
|
5
|
-
file: File;
|
|
6
|
-
pagePoint?: Vec;
|
|
7
|
-
source?: ImageImportSource;
|
|
8
|
-
}
|
|
9
|
-
export interface ImageReplaceInput {
|
|
10
|
-
file: File;
|
|
11
|
-
}
|
|
12
|
-
export interface ImageProductApi {
|
|
13
|
-
insertImage(input: ImageInsertInput): Promise<ShapeId | null>;
|
|
14
|
-
replaceSelectedImage(input: ImageReplaceInput): Promise<boolean>;
|
|
15
|
-
downloadSelectedImageOriginal(): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export declare const imageProductApiToken: import("../canvas-product-react/index").ProductApiToken<ImageProductApi>;
|
|
18
|
-
export interface ImageProductApiRuntimeOptions {
|
|
19
|
-
persistEditorSnapshot?: (editor: Editor) => Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
export declare function registerImageProductApi({ persistEditorSnapshot, }?: ImageProductApiRuntimeOptions): CanvasProductRuntimeSetup;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function hasLegacyImageDataUrlSnapshot(snapshot: unknown): boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
|
-
import type { TextShapeRecord } from "./textTypes";
|
|
3
|
-
export declare class TextShapeSvgExporter implements ShapeSvgExporter<TextShapeRecord> {
|
|
4
|
-
readonly type: "text";
|
|
5
|
-
toSvg(shape: TextShapeRecord): SvgNode | null;
|
|
6
|
-
}
|
package/api/canvasKitApi.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type CanvasProductApiOptions, type CanvasProductApiContext, type CanvasProductSessionSnapshot } from "../_vendor/canvas-product-react/api/index";
|
|
2
|
-
import { type StandardCanvasApi, type StandardCanvasApiSnapshot, type StandardCanvasFrameInput, type StandardCanvasShapeInput, type StandardCanvasTextInput } from "../standard";
|
|
3
|
-
import { type ImageProductApi } from "../_vendor/plugin-image-product-react/index";
|
|
4
|
-
export type CanvasKitShapeInput = StandardCanvasShapeInput;
|
|
5
|
-
export type CanvasKitTextInput = StandardCanvasTextInput;
|
|
6
|
-
export type CanvasKitFrameInput = StandardCanvasFrameInput;
|
|
7
|
-
export declare const CANVAS_KIT_TOOL_IDS: readonly ["select", "hand", "rectangle", "ellipse", "diamond", "arrow", "draw", "text", "frame", "eraser", "laser"];
|
|
8
|
-
export type CanvasKitToolId = (typeof CANVAS_KIT_TOOL_IDS)[number];
|
|
9
|
-
export interface CanvasKitApiSnapshot extends StandardCanvasApiSnapshot<CanvasKitToolId> {
|
|
10
|
-
productId: "canvas-kit";
|
|
11
|
-
session: CanvasProductSessionSnapshot<CanvasKitToolId>;
|
|
12
|
-
}
|
|
13
|
-
export interface CanvasKitApi extends StandardCanvasApi<CanvasKitToolId> {
|
|
14
|
-
image: ImageProductApi | null;
|
|
15
|
-
snapshot(): CanvasKitApiSnapshot;
|
|
16
|
-
}
|
|
17
|
-
export interface CanvasKitApiOptions<TToolId extends string = CanvasKitToolId> extends CanvasProductApiContext {
|
|
18
|
-
assertToolId?: (toolId: string) => asserts toolId is TToolId;
|
|
19
|
-
}
|
|
20
|
-
export type CanvasKitApiWithTools<TToolId extends string> = StandardCanvasApi<TToolId> & {
|
|
21
|
-
image: ImageProductApi | null;
|
|
22
|
-
};
|
|
23
|
-
declare global {
|
|
24
|
-
interface Window {
|
|
25
|
-
landCanvasKit?: CanvasKitApi;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export declare function createCanvasKitApi(context: CanvasKitApiOptions<CanvasKitToolId>): CanvasKitApi;
|
|
29
|
-
export declare function createCanvasKitApiWithTools<TToolId extends string>(context: CanvasProductApiOptions<TToolId>): CanvasKitApiWithTools<TToolId>;
|
package/product/Shell.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import type { CanvasProductShellProps } from "../_vendor/canvas-product-react/index";
|
|
3
|
-
import { type CanvasProductApiContext } from "../_vendor/canvas-product-react/api/index";
|
|
4
|
-
import type { StandardCanvasApi } from "../standard";
|
|
5
|
-
import type { CanvasKitApi } from "../api/canvasKitApi";
|
|
6
|
-
import { type CanvasKitChromeContext } from "./chromeContext";
|
|
7
|
-
import { persistCanvasKitEditorSnapshot } from "./persistence";
|
|
8
|
-
export type CanvasKitChromeRenderer<TApi extends StandardCanvasApi = CanvasKitApi> = (context: CanvasKitChromeContext<TApi>) => ReactNode;
|
|
9
|
-
export type CanvasKitApiFactory<TApi extends StandardCanvasApi = CanvasKitApi> = (context: CanvasProductApiContext) => TApi;
|
|
10
|
-
export type CanvasKitShellProps<TApi extends StandardCanvasApi = CanvasKitApi> = CanvasProductShellProps & {
|
|
11
|
-
chrome?: CanvasKitChromeRenderer<TApi>;
|
|
12
|
-
createApi?: CanvasKitApiFactory<TApi>;
|
|
13
|
-
exposeApiOnWindow?: boolean;
|
|
14
|
-
onApiDispose?: () => void;
|
|
15
|
-
onApiReady?: (api: TApi) => void;
|
|
16
|
-
persistEditorSnapshot?: typeof persistCanvasKitEditorSnapshot;
|
|
17
|
-
windowKey?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function CanvasKitShell<TApi extends StandardCanvasApi = CanvasKitApi>(props: CanvasKitShellProps<TApi>): import("react/jsx-runtime").JSX.Element;
|