@yuzhouu/canvas-kit 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +204 -101
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +23 -0
- package/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
- package/_vendor/canvas-core/editor/bindingReactionScope.d.ts +7 -0
- package/_vendor/canvas-core/editor/cameraPanSession.d.ts +9 -0
- package/_vendor/canvas-core/editor/canvasPanInteraction.d.ts +2 -0
- package/_vendor/canvas-core/editor/commands.d.ts +16 -4
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/editor.d.ts +44 -31
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +5 -2
- package/_vendor/canvas-core/editor/historyManager.d.ts +24 -6
- package/_vendor/canvas-core/editor/index.d.ts +2 -2
- package/_vendor/canvas-core/editor/interactions.d.ts +41 -8
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +2 -6
- package/_vendor/canvas-core/editor/managers/inputsManager.d.ts +3 -0
- package/_vendor/canvas-core/editor/managers/interactionTransientManager.d.ts +0 -26
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +26 -1
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +5 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
- package/_vendor/canvas-core/editor/managers/shapeGeometryManager.d.ts +3 -2
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +7 -2
- package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +3 -2
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/spatialIndexManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
- package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +32 -12
- package/_vendor/canvas-core/editor/selection.d.ts +19 -5
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +7 -4
- package/_vendor/canvas-core/editor/selectionResizeCapabilities.d.ts +9 -0
- package/_vendor/canvas-core/editor/shapeTransformSpace.d.ts +6 -0
- package/_vendor/canvas-core/exports/svg.d.ts +3 -3
- package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
- package/_vendor/canvas-core/geometry/index.d.ts +1 -0
- package/_vendor/canvas-core/geometry/mat.d.ts +6 -2
- package/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
- package/_vendor/canvas-core/geometry/vec.d.ts +0 -2
- package/_vendor/canvas-core/index.d.ts +21 -23
- package/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +4 -10
- package/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +19 -0
- package/_vendor/canvas-core/plugins/index.d.ts +2 -1
- package/_vendor/canvas-core/schema/records.d.ts +2 -7
- package/_vendor/canvas-core/schema/snapshots.d.ts +10 -19
- package/_vendor/canvas-core/shapes/colors.d.ts +3 -3
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +97 -13
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +18 -8
- package/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +16 -0
- package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +3 -2
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
- package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +7 -0
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/actions.d.ts +21 -6
- package/_vendor/canvas-plugin-sdk/capability.d.ts +16 -0
- package/_vendor/canvas-plugin-sdk/chrome.d.ts +52 -0
- package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +15 -0
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/contextMenu.d.ts +25 -30
- package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +11 -0
- package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +9 -0
- package/_vendor/canvas-plugin-sdk/exports.d.ts +26 -0
- package/_vendor/canvas-plugin-sdk/importRegistry.d.ts +10 -0
- package/_vendor/canvas-plugin-sdk/imports.d.ts +38 -0
- package/_vendor/canvas-plugin-sdk/index.d.ts +18 -0
- package/_vendor/canvas-plugin-sdk/lifecycle.d.ts +31 -0
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +76 -0
- package/_vendor/canvas-plugin-sdk/pluginUi.d.ts +37 -0
- package/_vendor/canvas-plugin-sdk/productApi.d.ts +28 -0
- package/_vendor/canvas-plugin-sdk/services.d.ts +20 -0
- package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/toolbar.d.ts +48 -5
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +18 -0
- package/_vendor/canvas-react/components/CanvasView.d.ts +2 -2
- package/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
- package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +4 -3
- package/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
- package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +22 -5
- package/_vendor/canvas-react/host/canvasRenderRuntime.d.ts +13 -0
- package/_vendor/canvas-react/host/domEventGuards.d.ts +3 -3
- package/_vendor/canvas-react/host/index.d.ts +3 -9
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +3 -3
- package/_vendor/canvas-react/host/rendererRegistry.d.ts +7 -4
- package/_vendor/canvas-react/index.d.ts +1 -0
- package/_vendor/plugin-arrow/api.d.ts +33 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +7 -4
- package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +7 -4
- package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +2 -2
- package/_vendor/plugin-arrow/canvasRender.d.ts +2 -2
- package/_vendor/plugin-arrow/editorRuntime.d.ts +2 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -3
- package/_vendor/plugin-arrow/index.d.ts +5 -2
- package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
- package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +2 -0
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContextMenuContributions.d.ts +1 -1
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContribution.d.ts +2 -2
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardService.d.ts +3 -3
- package/_vendor/plugin-builtin-clipboard/index.d.ts +3 -0
- package/_vendor/plugin-builtin-clipboard/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-export/blobDataUrl.d.ts +1 -0
- package/_vendor/plugin-builtin-export/canvasExportApi.d.ts +43 -0
- package/_vendor/plugin-builtin-export/index.d.ts +8 -0
- package/_vendor/plugin-builtin-export/plugin.d.ts +5 -0
- package/_vendor/plugin-builtin-export/pngExport.d.ts +15 -0
- package/{features/export → _vendor/plugin-builtin-export}/svgExport.d.ts +9 -2
- package/_vendor/plugin-builtin-import-host/CanvasImportHost.d.ts +3 -0
- package/_vendor/plugin-builtin-import-host/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-import-host/index.d.ts +2 -0
- package/_vendor/plugin-builtin-import-host/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/index.d.ts +2 -0
- package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +2 -0
- package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
- package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
- package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
- package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
- package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
- package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
- package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
- package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
- package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
- package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
- package/_vendor/plugin-connector/connectorRuntime.d.ts +62 -0
- package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
- package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
- package/_vendor/plugin-connector/constants.d.ts +17 -0
- package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
- package/_vendor/plugin-connector/feature.d.ts +4 -0
- package/_vendor/plugin-connector/index.d.ts +18 -0
- package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
- package/_vendor/plugin-connector/productRuntime.d.ts +2 -0
- package/_vendor/plugin-connector/quickConnect.d.ts +28 -0
- package/_vendor/plugin-connector/types.d.ts +51 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-draw/canvasRender.d.ts +2 -2
- package/_vendor/plugin-draw/drawGeometry.d.ts +4 -7
- package/_vendor/plugin-draw/drawPath.d.ts +7 -1
- package/_vendor/plugin-draw/drawShapeUtil.d.ts +2 -2
- package/_vendor/plugin-draw/editorRuntime.d.ts +3 -3
- package/_vendor/plugin-draw/feature.d.ts +2 -3
- package/_vendor/plugin-draw/index.d.ts +4 -3
- package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
- package/_vendor/plugin-eraser/canvasRender.d.ts +2 -2
- package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -2
- package/_vendor/plugin-eraser/eraserRuntime.d.ts +12 -0
- package/_vendor/plugin-eraser/feature.d.ts +2 -3
- package/_vendor/plugin-eraser/index.d.ts +4 -2
- package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-frame/api.d.ts +19 -0
- package/_vendor/plugin-frame/canvasRender.d.ts +5 -5
- package/_vendor/plugin-frame/editorRuntime.d.ts +2 -2
- package/_vendor/plugin-frame/feature.d.ts +2 -3
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +12 -2
- package/_vendor/plugin-frame/index.d.ts +5 -2
- package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/api.d.ts +27 -0
- package/_vendor/plugin-geo/canvasRender.d.ts +5 -5
- package/_vendor/plugin-geo/editorRuntime.d.ts +3 -3
- package/_vendor/plugin-geo/feature.d.ts +2 -3
- package/_vendor/plugin-geo/geoShapeUtil.d.ts +1 -1
- package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
- package/_vendor/plugin-geo/geoTools.d.ts +1 -1
- package/_vendor/plugin-geo/index.d.ts +8 -5
- package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/types.d.ts +5 -1
- package/_vendor/plugin-group/canvasRender.d.ts +3 -4
- package/_vendor/plugin-group/editorRuntime.d.ts +2 -2
- package/_vendor/plugin-group/feature.d.ts +2 -3
- package/_vendor/plugin-group/groupContributions.d.ts +7 -0
- package/_vendor/plugin-group/groupShapeUtil.d.ts +24 -5
- package/_vendor/plugin-group/index.d.ts +4 -2
- package/_vendor/plugin-group/productRuntime.d.ts +2 -0
- package/_vendor/plugin-image/canvasRender.d.ts +2 -2
- package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
- package/_vendor/plugin-image/cropSession.d.ts +5 -3
- package/_vendor/plugin-image/editorRuntime.d.ts +2 -4
- package/_vendor/plugin-image/feature.d.ts +2 -3
- package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
- package/_vendor/plugin-image/imageShapeUtil.d.ts +3 -3
- package/_vendor/plugin-image/index.d.ts +5 -4
- package/_vendor/plugin-image/productRuntime.d.ts +4 -0
- package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
- package/_vendor/plugin-image/smudge.d.ts +6 -2
- package/_vendor/plugin-image/smudgeRuntime.d.ts +1 -1
- package/_vendor/plugin-image/styleRuntime.d.ts +6 -1
- package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
- package/_vendor/plugin-laser/canvasRender.d.ts +2 -2
- package/_vendor/plugin-laser/editorRuntime.d.ts +2 -2
- package/_vendor/plugin-laser/feature.d.ts +2 -3
- package/_vendor/plugin-laser/index.d.ts +4 -2
- package/_vendor/plugin-laser/laserRuntime.d.ts +18 -0
- package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-packaging/api.d.ts +74 -0
- package/_vendor/plugin-packaging/canvasRender.d.ts +2 -0
- package/_vendor/plugin-packaging/editorRuntime.d.ts +2 -0
- package/_vendor/plugin-packaging/feature.d.ts +2 -0
- package/_vendor/plugin-packaging/index.d.ts +19 -0
- package/_vendor/plugin-packaging/packagingArtwork.d.ts +5 -0
- package/_vendor/plugin-packaging/packagingDxf.d.ts +9 -0
- package/_vendor/plugin-packaging/packagingGeometry.d.ts +74 -0
- package/_vendor/plugin-packaging/packagingInteractions.d.ts +2 -0
- package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +25 -0
- package/_vendor/plugin-packaging/packagingRuntime.d.ts +11 -0
- package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +34 -0
- package/_vendor/plugin-packaging/packagingStyle.d.ts +10 -0
- package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +7 -0
- package/_vendor/plugin-packaging/productRuntime.d.ts +2 -0
- package/_vendor/plugin-packaging/types.d.ts +168 -0
- package/_vendor/plugin-packaging/validation.d.ts +3 -0
- package/_vendor/plugin-path/PathDraftOverlay.d.ts +1 -0
- package/_vendor/plugin-path/PathEditInsertPreviewOverlay.d.ts +1 -0
- package/_vendor/plugin-path/PathShapeRenderer.d.ts +15 -0
- package/_vendor/plugin-path/canvasRender.d.ts +2 -0
- package/_vendor/plugin-path/editorRuntime.d.ts +7 -0
- package/_vendor/plugin-path/feature.d.ts +2 -0
- package/_vendor/plugin-path/index.d.ts +8 -0
- package/_vendor/plugin-path/pathBoolean.d.ts +13 -0
- package/_vendor/plugin-path/pathDraft.d.ts +10 -0
- package/_vendor/plugin-path/pathEditPreview.d.ts +11 -0
- package/_vendor/plugin-path/pathEditSelection.d.ts +24 -0
- package/_vendor/plugin-path/pathEditSnap.d.ts +6 -0
- package/_vendor/plugin-path/pathGeometry.d.ts +74 -0
- package/_vendor/plugin-path/pathHandles.d.ts +18 -0
- package/_vendor/plugin-path/pathHistory.d.ts +13 -0
- package/_vendor/plugin-path/pathInteractions.d.ts +7 -0
- package/_vendor/plugin-path/pathShapeUtil.d.ts +30 -0
- package/_vendor/plugin-path/pathSvg.d.ts +3 -0
- package/_vendor/plugin-path/pathTool.d.ts +42 -0
- package/_vendor/plugin-path/productRuntime.d.ts +15 -0
- package/_vendor/plugin-path/types.d.ts +36 -0
- package/_vendor/plugin-text/api.d.ts +20 -0
- package/_vendor/plugin-text/canvasRender.d.ts +6 -3
- package/_vendor/plugin-text/capabilities.d.ts +2 -0
- package/_vendor/plugin-text/editorRuntime.d.ts +3 -3
- package/_vendor/plugin-text/feature.d.ts +4 -4
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +6 -3
- package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +4 -1
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +6 -3
- package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -2
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
- package/_vendor/plugin-text/host/textFormattingApi.d.ts +16 -0
- package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
- package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +3 -1
- package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +4 -1
- package/_vendor/plugin-text/index.d.ts +11 -4
- package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
- package/_vendor/plugin-text/productRuntime.d.ts +6 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +9 -2
- package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +12 -0
- package/_vendor/plugin-text/textFonts.d.ts +6 -3
- package/_vendor/plugin-text/textFormatting.d.ts +47 -0
- package/_vendor/plugin-text/textFormattingSession.d.ts +6 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +32 -6
- package/_vendor/plugin-text/textLinkPopoverPresentation.d.ts +18 -0
- package/_vendor/plugin-text/textShapeHelpers.d.ts +1 -0
- package/_vendor/plugin-text/textShapeUtil.d.ts +9 -5
- package/_vendor/plugin-text/textTypes.d.ts +1 -0
- package/_vendor/signals/core.d.ts +1 -0
- package/_vendor/signals/effect.d.ts +0 -4
- package/_vendor/signals/index.d.ts +2 -2
- package/_vendor/store/history.d.ts +1 -1
- package/_vendor/store/store.d.ts +6 -0
- package/browser/indexedDb.d.ts +10 -10
- package/browser/persistence.d.ts +6 -38
- package/chrome/floating/CanvasKitFloatingPortal.d.ts +6 -0
- package/chrome/floating/useCanvasKitFloatingPosition.d.ts +11 -0
- package/chrome/toolbar/CanvasKitFloatingToolbarLayer.d.ts +1 -1
- package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
- package/chrome/toolbar/toolbarLabels.d.ts +1 -1
- package/chrome/toolbar/useToolbarSurfaces.d.ts +11 -16
- package/chrome/types.d.ts +15 -17
- package/chrome/useCanvasKitChromeContext.d.ts +12 -15
- package/chrome/useChromeSurfaces.d.ts +12 -0
- package/chrome/useContextMenuSurface.d.ts +4 -4
- package/chrome/useHistoryControls.d.ts +3 -3
- package/chrome/usePageControls.d.ts +3 -3
- package/controller/canvasKitController.d.ts +5 -16
- package/core/index.d.ts +4 -6
- package/core/product-controller/canvasProductController.d.ts +42 -12
- package/core/product-controller/index.d.ts +1 -1
- package/core/runtime/productAssets.d.ts +4 -2
- package/core/runtime/productEditor.d.ts +1 -1
- package/core/runtime/productServices.d.ts +11 -21
- package/core/runtime/runtimeContracts.d.ts +17 -0
- package/es-DocrZgUh.mjs +2 -0
- package/features/context-menu/contextMenuRuntime.d.ts +4 -4
- package/features/image/asset/imageAssetService.d.ts +2 -3
- package/features/image/asset/imageBlobStore.d.ts +7 -2
- package/features/image/asset/imageFileHelpers.d.ts +0 -6
- package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
- package/features/image/controller/imageProductController.d.ts +2 -2
- package/features/image/imageHostPlugin.d.ts +1 -0
- package/features/image/import/ImageImportController.d.ts +3 -1
- package/features/image/index.d.ts +1 -3
- package/features/image/smudge/imageSmudgeHostActions.d.ts +2 -2
- package/features/image/toolbar/imageHostActions.d.ts +17 -7
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/text/link/TextLinkHoverPopover.d.ts +6 -0
- package/features/text/textHostPlugin.d.ts +5 -0
- package/features/text/textSvgAssetInliner.d.ts +3 -0
- package/features/text/textSvgAssetPlugin.d.ts +2 -0
- package/index.css +1 -1
- package/index.d.ts +36 -12
- package/index.mjs +111 -96
- package/package.json +12 -9
- package/plugins/standardCanvasKitPlugins.d.ts +16 -0
- package/react/CanvasKitRoot.d.ts +10 -5
- package/react/useCanvasKitControllerLifecycle.d.ts +8 -0
- package/react/useCanvasKitRuntime.d.ts +2 -4
- package/runtime/canvasKitCommandExecutor.d.ts +13 -0
- package/runtime/canvasKitPluginContracts.d.ts +34 -0
- package/runtime/canvasKitPluginSetup.d.ts +32 -0
- package/runtime/canvasKitResourceScope.d.ts +5 -0
- package/runtime/canvasKitRuntime.d.ts +48 -19
- package/runtime/canvasKitRuntimeContracts.d.ts +34 -0
- package/runtime/persistenceCoordinator.d.ts +33 -0
- package/_vendor/canvas-core/editor/createEditorWithRuntimePlugins.d.ts +0 -6
- package/_vendor/canvas-core/editor/middleMousePanInteraction.d.ts +0 -2
- package/_vendor/canvas-core/schema/snapshotSupport.d.ts +0 -43
- package/_vendor/canvas-core/tools/select/states/draggingSelectionHandleInteractionState.d.ts +0 -15
- package/_vendor/canvas-react/host/actionRegistry.d.ts +0 -15
- package/_vendor/canvas-react/host/canvasRenderPluginHost.d.ts +0 -2
- package/_vendor/canvas-react/host/canvasRenderPluginHostManifest.d.ts +0 -2
- package/_vendor/canvas-react/host/canvasRenderPluginHostRuntime.d.ts +0 -3
- package/_vendor/canvas-react/host/canvasRenderPluginHostTypes.d.ts +0 -104
- package/_vendor/canvas-react/host/canvasRenderPluginHostValidation.d.ts +0 -11
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +0 -17
- package/_vendor/canvas-react/host/extension.d.ts +0 -37
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +0 -20
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -42
- package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +0 -14
- package/_vendor/plugin-text/host/RichTextToolbar.d.ts +0 -8
- package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +0 -7
- package/browser/localSnapshotRestore.d.ts +0 -13
- package/builtins/controller/createBuiltInCanvasController.d.ts +0 -16
- package/builtins/controller/layerController.d.ts +0 -9
- package/builtins/controller/shapeCreationController.d.ts +0 -83
- package/builtins/extensions.d.ts +0 -18
- package/builtins/index.d.ts +0 -5
- package/chrome/useSvgExport.d.ts +0 -15
- package/core/api/apiRegistry.d.ts +0 -12
- package/core/runtime/productDefinition.d.ts +0 -33
- package/core/runtime/productHost.d.ts +0 -20
- package/features/actions/actionRuntime.d.ts +0 -21
- package/features/clipboard/clipboardHostExtension.d.ts +0 -2
- package/features/image/imageHostExtension.d.ts +0 -10
- package/features/image/import/useImageImport.d.ts +0 -16
- package/features/keyboard/keyboardShortcutHostExtension.d.ts +0 -2
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -6
- package/features/persistence/CanvasKitPersistenceNotice.d.ts +0 -4
- package/features/persistence/persistenceHostExtension.d.ts +0 -2
- package/features/selection/selectionActions.d.ts +0 -20
- package/features/selection/selectionContextMenuContributions.d.ts +0 -2
- package/features/selection/selectionHostExtension.d.ts +0 -2
- package/features/selection/selectionToolbarContributions.d.ts +0 -2
- package/features/tool/toolActions.d.ts +0 -2
- package/features/tool/toolContextMenuContributions.d.ts +0 -2
- package/features/tool/toolHostExtension.d.ts +0 -2
- package/features/tool/toolToolbarContributions.d.ts +0 -2
- package/features/view/viewActions.d.ts +0 -5
- package/features/view/viewContextMenuContributions.d.ts +0 -2
- package/features/view/viewHostExtension.d.ts +0 -2
- package/host/defaultHostExtensions.d.ts +0 -2
- package/product/canvasKitProduct.d.ts +0 -51
- package/react/useCanvasKitController.d.ts +0 -5
- package/react/useCanvasKitStartup.d.ts +0 -9
- package/runtime/canvasKitHostContracts.d.ts +0 -135
- package/runtime/canvasKitHostFeatureHooks.d.ts +0 -12
- package/runtime/canvasKitRuntimePlan.d.ts +0 -50
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RichTextDocument } from "./textTypes";
|
|
2
|
+
export type ShapeWideTextInlineFormat = "bold" | "italic" | "strike" | "underline";
|
|
3
|
+
export type ShapeWideTextStyleProperty = "color" | "font" | "size" | "textAlign";
|
|
4
|
+
export type ShapeWideTextFormatState = boolean | "mixed";
|
|
5
|
+
export type ShapeWideTextBackgroundColorState = string | "mixed" | null;
|
|
6
|
+
export declare function getShapeWideTextFormatState(richText: RichTextDocument, format: ShapeWideTextInlineFormat): ShapeWideTextFormatState;
|
|
7
|
+
export declare function setShapeWideTextFormat(richText: RichTextDocument, format: ShapeWideTextInlineFormat, enabled: boolean): RichTextDocument;
|
|
8
|
+
export declare function getShapeWideTextBackgroundColor(richText: RichTextDocument): ShapeWideTextBackgroundColorState;
|
|
9
|
+
export declare function setShapeWideTextBackgroundColor(richText: RichTextDocument, backgroundColor: string | null): RichTextDocument;
|
|
10
|
+
export declare function fillMissingShapeWideTextBackgroundColor(richText: RichTextDocument, backgroundColor: string): RichTextDocument;
|
|
11
|
+
export declare function clearShapeWideTextStyleOverride(richText: RichTextDocument, property: ShapeWideTextStyleProperty): RichTextDocument;
|
|
12
|
+
export declare function clearShapeWideTextFormatting(richText: RichTextDocument): RichTextDocument;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TextShapeFont } from "./textTypes";
|
|
2
|
+
import type { TextTiptapEditorChangeHandler } from "./textFormatting";
|
|
2
3
|
export declare const DEFAULT_TEXT_FONT: "default";
|
|
3
4
|
export declare const DEFAULT_TEXT_FONT_LABEL = "Default";
|
|
4
5
|
export interface TextSystemFontSource {
|
|
@@ -32,15 +33,17 @@ export interface TextFontCatalog {
|
|
|
32
33
|
readonly fontOptions: readonly TextFontDefinition[];
|
|
33
34
|
readonly fontsById: ReadonlyMap<TextShapeFont, TextFontDefinition>;
|
|
34
35
|
}
|
|
35
|
-
export type
|
|
36
|
+
export type TextPluginOptions = {
|
|
36
37
|
defaultFont: TextFontDefinition;
|
|
37
38
|
defaultFontLabel: string;
|
|
38
39
|
fonts: readonly TextFontDefinition[];
|
|
40
|
+
formattingToolbar?: boolean;
|
|
41
|
+
onTiptapEditorChange?: TextTiptapEditorChangeHandler;
|
|
39
42
|
};
|
|
40
43
|
export declare const HOST_TEXT_FONT: TextFontDefinition;
|
|
41
|
-
export declare function
|
|
44
|
+
export declare function createDefaultTextPluginOptions(): TextPluginOptions;
|
|
42
45
|
export declare function createDefaultTextFontCatalog(): TextFontCatalog;
|
|
43
|
-
export declare function createTextFontCatalog(options: Readonly<
|
|
46
|
+
export declare function createTextFontCatalog(options: Readonly<TextPluginOptions>): TextFontCatalog;
|
|
44
47
|
export declare function isUsableFontId(value: unknown): value is TextShapeFont;
|
|
45
48
|
export declare function isTextFontInCatalog(fontCatalog: TextFontCatalog, font: unknown): font is TextShapeFont;
|
|
46
49
|
export declare function resolveTextFont(fontCatalog: TextFontCatalog, font: TextShapeFont): TextFontDefinition;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ShapeId } from "../canvas-core/index";
|
|
2
|
+
import type { Editor as TiptapEditor } from "@tiptap/core";
|
|
3
|
+
import type { TextShapeAlign, TextShapeFont, TextShapeSize } from "./textTypes";
|
|
4
|
+
export type TextFormattingMixed = "mixed";
|
|
5
|
+
export type TextFormattingValue<T> = T | TextFormattingMixed | null;
|
|
6
|
+
export type TextFormattingTarget = "selection" | "shape";
|
|
7
|
+
export type TextInlineFormat = "bold" | "italic" | "strike" | "underline";
|
|
8
|
+
export interface TextFormattingSnapshot {
|
|
9
|
+
shapeId: ShapeId;
|
|
10
|
+
target: TextFormattingTarget;
|
|
11
|
+
bold: boolean | TextFormattingMixed;
|
|
12
|
+
italic: boolean | TextFormattingMixed;
|
|
13
|
+
strike: boolean | TextFormattingMixed;
|
|
14
|
+
underline: boolean | TextFormattingMixed;
|
|
15
|
+
color: TextFormattingValue<string>;
|
|
16
|
+
backgroundColor: TextFormattingValue<string>;
|
|
17
|
+
font: TextFormattingValue<TextShapeFont>;
|
|
18
|
+
size: TextFormattingValue<TextShapeSize>;
|
|
19
|
+
textAlign: TextFormattingValue<TextShapeAlign>;
|
|
20
|
+
linkHref: TextFormattingValue<string>;
|
|
21
|
+
canSetLink: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface TextFormattingApi {
|
|
24
|
+
readonly shapeId: ShapeId;
|
|
25
|
+
getSnapshot(): TextFormattingSnapshot | null;
|
|
26
|
+
subscribe(listener: () => void): () => void;
|
|
27
|
+
focus(): void;
|
|
28
|
+
toggle(format: TextInlineFormat): boolean;
|
|
29
|
+
setColor(color: string | null): boolean;
|
|
30
|
+
setBackgroundColor(color: string | null): boolean;
|
|
31
|
+
setFont(font: TextShapeFont | null): boolean;
|
|
32
|
+
setSize(size: TextShapeSize | null): boolean;
|
|
33
|
+
setTextAlign(align: TextShapeAlign): boolean;
|
|
34
|
+
setLink(href: string | null): boolean;
|
|
35
|
+
clearFormatting(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Escape hatch for extensions that need native Tiptap commands. Prefer the
|
|
38
|
+
* semantic methods above so shape defaults, sanitization, and rendering stay
|
|
39
|
+
* synchronized.
|
|
40
|
+
*/
|
|
41
|
+
getUnsafeTiptapEditor(): TiptapEditor | null;
|
|
42
|
+
}
|
|
43
|
+
export interface TextTiptapEditorHandle {
|
|
44
|
+
readonly shapeId: ShapeId;
|
|
45
|
+
readonly formatting: TextFormattingApi;
|
|
46
|
+
}
|
|
47
|
+
export type TextTiptapEditorChangeHandler = (handle: TextTiptapEditorHandle | null) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Editor } from "../canvas-core/index";
|
|
2
|
+
import type { TextFormattingApi, TextFormattingSnapshot } from "./textFormatting";
|
|
3
|
+
export declare function activateTextFormattingSession(editor: Editor, api: TextFormattingApi): () => void;
|
|
4
|
+
export declare function getActiveTextFormattingApi(editor: Editor): TextFormattingApi | null;
|
|
5
|
+
export declare function getActiveTextFormattingSnapshot(editor: Editor): TextFormattingSnapshot | null;
|
|
6
|
+
export declare function subscribeToTextFormattingSession(editor: Editor, listener: () => void): () => void;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Editor, type ShapeId, type ShapeParentId, type ShapeRecord, type ShapeTransformFields } from "../canvas-core/index";
|
|
2
2
|
import type { TextShapeProps, TextShapeRecord } from "./textTypes";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PATH_LABEL_BINDING_TYPE = "path-label";
|
|
4
4
|
export declare const GEO_LABEL_BINDING_TYPE = "geo-label";
|
|
5
|
-
export
|
|
5
|
+
export declare const PATH_LABEL_MAX_WIDTH = 120;
|
|
6
|
+
export declare const PATH_LABEL_MIN_WIDTH = 24;
|
|
7
|
+
export declare const PATH_LABEL_PADDING = 4.25;
|
|
8
|
+
export declare const GEO_LABEL_MIN_WIDTH = 16;
|
|
9
|
+
export declare const GEO_LABEL_PADDING = 16;
|
|
10
|
+
export type TextLabelBindingType = typeof PATH_LABEL_BINDING_TYPE | typeof GEO_LABEL_BINDING_TYPE;
|
|
6
11
|
export interface TextLabelBehavior {
|
|
7
12
|
selectionTarget: "label" | "owner";
|
|
13
|
+
hoverTarget: "label" | "owner";
|
|
14
|
+
hoverDecorationTarget: "label" | "owner";
|
|
8
15
|
translateTarget: "label" | "owner";
|
|
16
|
+
canSnap: boolean;
|
|
17
|
+
canReceiveTerminalBinding: boolean;
|
|
9
18
|
contributesToSelectionFrame: boolean;
|
|
10
|
-
|
|
19
|
+
canUseSelectionResizeHandles: boolean;
|
|
20
|
+
canUseSelectionRotateHandle: boolean;
|
|
11
21
|
canPlaceCaretWhenOwnerSelected: boolean;
|
|
12
22
|
showsCompanionFrameWhenOwnerSelected: boolean;
|
|
13
23
|
}
|
|
@@ -17,6 +27,12 @@ export interface TextLabelTargetInfo {
|
|
|
17
27
|
bindingType: TextLabelBindingType;
|
|
18
28
|
behavior: TextLabelBehavior;
|
|
19
29
|
}
|
|
30
|
+
export interface TextLabelLayoutConstraints {
|
|
31
|
+
minWidth: number;
|
|
32
|
+
maxWidth: number;
|
|
33
|
+
paddingInline: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function getTextLabelPaddingInline(constraints: TextLabelLayoutConstraints | null, width: number): number;
|
|
20
36
|
export interface TextLabelCreateOptions {
|
|
21
37
|
bindingType: TextLabelBindingType;
|
|
22
38
|
owner: ShapeRecord;
|
|
@@ -27,14 +43,24 @@ export interface TextLabelCreateOptions {
|
|
|
27
43
|
};
|
|
28
44
|
bindingProps?: Record<string, unknown>;
|
|
29
45
|
}
|
|
46
|
+
export type TextLabelPageLayout = TextLabelCreateOptions["layout"];
|
|
47
|
+
export declare function getTextLabelOwnerPageRotation(editor: Editor, owner: ShapeRecord): number;
|
|
48
|
+
export declare function getTextLabelParentLocalTransform(editor: Editor, label: TextShapeRecord, targetParentId: ShapeParentId, pageLayout: TextLabelPageLayout): ShapeTransformFields | null;
|
|
30
49
|
export declare function getTextLabelShapeForOwner(editor: Editor, ownerId: ShapeId, bindingType: TextLabelBindingType): TextShapeRecord | null;
|
|
31
|
-
export declare function createBoundTextLabelShape(editor: Editor, options: TextLabelCreateOptions): TextShapeRecord;
|
|
50
|
+
export declare function createBoundTextLabelShape(editor: Editor, options: TextLabelCreateOptions): TextShapeRecord | null;
|
|
32
51
|
export declare function getTextLabelTargetInfo(editor: Editor, shapeId: ShapeId): TextLabelTargetInfo | null;
|
|
52
|
+
export declare function getTextLabelLayoutConstraintsForOwner(editor: Editor, label: TextShapeRecord, owner: ShapeRecord, bindingType: TextLabelBindingType): TextLabelLayoutConstraints;
|
|
53
|
+
export declare function getTextLabelLayoutConstraints(editor: Editor, label: TextShapeRecord): TextLabelLayoutConstraints | null;
|
|
33
54
|
export declare function getTextLabelBehavior(bindingType: TextLabelBindingType): TextLabelBehavior;
|
|
34
55
|
export declare function getTextLabelSelectionTargetId(editor: Editor, shapeId: ShapeId): ShapeId | null;
|
|
56
|
+
export declare function getTextLabelHoverTargetId(editor: Editor, shapeId: ShapeId): ShapeId | null;
|
|
57
|
+
export declare function getTextLabelHoverDecorationTargetId(editor: Editor, shapeId: ShapeId): ShapeId | null;
|
|
35
58
|
export declare function getTextLabelTranslateTargetId(editor: Editor, shapeId: ShapeId): ShapeId | null;
|
|
59
|
+
export declare function textLabelCanReceiveTerminalBinding(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
60
|
+
export declare function textLabelCanSnap(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
36
61
|
export declare function textLabelContributesToSelectionFrame(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
37
|
-
export declare function
|
|
62
|
+
export declare function textLabelCanUseSelectionResizeHandles(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
63
|
+
export declare function textLabelCanUseSelectionRotateHandle(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
38
64
|
export declare function textLabelShowsCompanionFrameWhenOwnerSelected(editor: Editor, shapeId: ShapeId): boolean | null;
|
|
39
65
|
export declare function canPlaceCaretInTextShapeFromSelection(editor: Editor, shapeId: ShapeId): boolean;
|
|
40
66
|
export declare function startEditingTextLabel(editor: Editor, label: TextShapeRecord, options: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export interface TextLinkPopoverPresenterProps {
|
|
3
|
+
anchorElement: HTMLElement;
|
|
4
|
+
href: string;
|
|
5
|
+
onOpen(): void;
|
|
6
|
+
onPopoverPointerEnter(): void;
|
|
7
|
+
onPopoverPointerLeave(): void;
|
|
8
|
+
}
|
|
9
|
+
export type TextLinkPopoverPresenter = ComponentType<TextLinkPopoverPresenterProps>;
|
|
10
|
+
export declare function TextLinkPopoverPresenterProvider({ children, presenter, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
presenter: TextLinkPopoverPresenter | null;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useTextLinkPopoverPresenter(): TextLinkPopoverPresenter | null;
|
|
15
|
+
export declare function shouldShowTextLinkPopover({ isEditing, isOnlySelected, }: {
|
|
16
|
+
isEditing: boolean;
|
|
17
|
+
isOnlySelected: boolean;
|
|
18
|
+
}): boolean;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { Box, ShapeUtil, type ShapeId, type ShapeEditEndResult, type
|
|
1
|
+
import { Box, ShapeUtil, type ShapeId, type ShapeEditEndResult, type ShapeGeometryInput, type ShapeHoverTargetInput, type ShapeSelectionFrameInput, type ShapeSelectionResizeInput, type ShapeSelectionResizeModesInput, type ShapeSelectionTranslateInput, type ShapeUpdate } from "../canvas-core/index";
|
|
2
2
|
import { type TextShapeProps, type TextShapeRecord } from "./textTypes";
|
|
3
3
|
export declare class TextShapeUtil extends ShapeUtil<TextShapeRecord> {
|
|
4
4
|
readonly type: "text";
|
|
5
5
|
getDefaultProps(): TextShapeProps;
|
|
6
6
|
validateProps(props: unknown): TextShapeProps;
|
|
7
|
-
|
|
7
|
+
getPositionedBounds(shape: TextShapeRecord): Box;
|
|
8
8
|
getLocalBounds(shape: TextShapeRecord): Box;
|
|
9
9
|
getRenderBounds(shape: TextShapeRecord): Box;
|
|
10
10
|
getExportBounds(shape: TextShapeRecord): Box;
|
|
11
|
-
|
|
11
|
+
canSnap(shape: TextShapeRecord, input?: ShapeGeometryInput): boolean;
|
|
12
|
+
canReceiveTerminalBinding(shape: TextShapeRecord, input?: ShapeGeometryInput): boolean;
|
|
12
13
|
canEdit(_shape: TextShapeRecord): boolean;
|
|
13
14
|
contributesToSelectionFrame(shape: TextShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
14
|
-
|
|
15
|
+
canUseSelectionResizeHandles(shape: TextShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
16
|
+
canUseSelectionRotateHandle(shape: TextShapeRecord, input: ShapeSelectionFrameInput): boolean;
|
|
15
17
|
getSelectionTargetId(shape: TextShapeRecord, input: ShapeSelectionFrameInput): ShapeId;
|
|
18
|
+
getHoverTargetId(shape: TextShapeRecord, input: ShapeHoverTargetInput): ShapeId;
|
|
19
|
+
getHoverDecorationTargetId(shape: TextShapeRecord, input: ShapeHoverTargetInput): ShapeId;
|
|
16
20
|
getTranslateTargetId(shape: TextShapeRecord, input: ShapeSelectionTranslateInput): ShapeId;
|
|
17
21
|
resizeSelectionBounds(shape: TextShapeRecord, input: ShapeSelectionResizeInput): ShapeUpdate;
|
|
18
|
-
|
|
22
|
+
getAllowedSelectionResizeModes(_shape: TextShapeRecord, input: ShapeSelectionResizeModesInput): readonly ["free"] | readonly ["aspect_ratio_locked"];
|
|
19
23
|
onEditEnd(shape: TextShapeRecord): ShapeEditEndResult | void;
|
|
20
24
|
}
|
|
@@ -7,6 +7,7 @@ interface Transaction {
|
|
|
7
7
|
export declare function getCurrentTransaction(): Transaction | null;
|
|
8
8
|
export declare function transact(fn: () => void): void;
|
|
9
9
|
export declare function noteInitialValue(atom: _Atom<any>, previousValue: any): void;
|
|
10
|
+
export declare function isComputingSignal(): boolean;
|
|
10
11
|
export declare function startCapture(child: Child): void;
|
|
11
12
|
export declare function stopCapture(): Set<Signal<any>>;
|
|
12
13
|
export declare function maybeCaptureParent(parent: Signal<any>): void;
|
|
@@ -23,7 +23,3 @@ export declare class EffectScheduler {
|
|
|
23
23
|
* Returns a cleanup function to stop the effect.
|
|
24
24
|
*/
|
|
25
25
|
export declare function effect(name: string, fn: () => void, opts?: EffectSchedulerOptions): () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Alias: react() — same as effect()
|
|
28
|
-
*/
|
|
29
|
-
export declare function react(name: string, fn: () => void, opts?: EffectSchedulerOptions): () => void;
|
|
@@ -2,8 +2,8 @@ export { atom, isAtom } from "./atom";
|
|
|
2
2
|
export type { Atom } from "./atom";
|
|
3
3
|
export { computed, isComputed, UNINITIALIZED } from "./computed";
|
|
4
4
|
export type { Computed } from "./computed";
|
|
5
|
-
export { effect,
|
|
5
|
+
export { effect, EffectScheduler } from "./effect";
|
|
6
6
|
export type { EffectSchedulerOptions } from "./effect";
|
|
7
|
-
export { transact, getGlobalEpoch } from "./core";
|
|
7
|
+
export { transact, getGlobalEpoch, isComputingSignal, } from "./core";
|
|
8
8
|
export { RESET_VALUE } from "./types";
|
|
9
9
|
export type { Signal, Child } from "./types";
|
|
@@ -27,7 +27,7 @@ export declare class StoreHistoryBuffer<TRecord extends StoreRecord = StoreRecor
|
|
|
27
27
|
readonly state: Signal<StoreHistoryState>;
|
|
28
28
|
clear(): void;
|
|
29
29
|
mark(id: string): void;
|
|
30
|
-
append(diff: RecordsDiff<TRecord
|
|
30
|
+
append(diff: RecordsDiff<TRecord>, label?: string): void;
|
|
31
31
|
bailToMark(id: string): RecordsDiff<TRecord> | null;
|
|
32
32
|
squashToMark(id: string, label?: string): StoreHistoryEntry<TRecord> | null;
|
|
33
33
|
undo(): StoreHistoryEntry<TRecord> | null;
|
package/_vendor/store/store.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ type StoreListener<TRecord extends StoreRecord> = (change: StoreChange<TRecord>)
|
|
|
4
4
|
type ScopedRecord<TRecord extends StoreRecord> = Extract<TRecord, ScopedStoreRecord>;
|
|
5
5
|
export declare class Store<TRecord extends StoreRecord = StoreRecord> {
|
|
6
6
|
readonly recordsSignal: Atom<Map<string, TRecord>>;
|
|
7
|
+
private readonly draftRevisionSignal;
|
|
7
8
|
private readonly recordSignals;
|
|
8
9
|
private readonly listeners;
|
|
9
10
|
private transactionDepth;
|
|
@@ -11,6 +12,8 @@ export declare class Store<TRecord extends StoreRecord = StoreRecord> {
|
|
|
11
12
|
private pendingSource;
|
|
12
13
|
constructor(initialRecords: TRecord[]);
|
|
13
14
|
get(id: string): TRecord | undefined;
|
|
15
|
+
getActiveAtomicOperationRevision(): number | null;
|
|
16
|
+
getActiveAtomicOperationSnapshot(): TRecord[];
|
|
14
17
|
/**
|
|
15
18
|
* Per-record reactive read that still respects draft records during atomic
|
|
16
19
|
* mutations. Use this inside computed values instead of wrapping `get(id)`.
|
|
@@ -22,11 +25,14 @@ export declare class Store<TRecord extends StoreRecord = StoreRecord> {
|
|
|
22
25
|
}>>;
|
|
23
26
|
listen(listener: StoreListener<TRecord>): () => void;
|
|
24
27
|
atomic(fn: () => void, source?: ChangeSource): void;
|
|
28
|
+
private runAtomic;
|
|
25
29
|
put(records: TRecord[], source?: ChangeSource): void;
|
|
26
30
|
remove(ids: string[], source?: ChangeSource): void;
|
|
27
31
|
replaceAll(records: TRecord[], source?: ChangeSource): void;
|
|
28
32
|
applyDiff<TChangeRecord extends TRecord>(diff: RecordsDiff<TChangeRecord>, source?: ChangeSource): void;
|
|
29
33
|
private getMutableRecords;
|
|
30
34
|
private getReadableRecords;
|
|
35
|
+
private bumpDraftRevision;
|
|
36
|
+
private notifyListeners;
|
|
31
37
|
}
|
|
32
38
|
export {};
|
package/browser/indexedDb.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
1
|
+
export declare const CANVAS_KIT_INDEXEDDB_NAME = "canvas-kit.persistence";
|
|
2
|
+
export declare const CANVAS_KIT_SNAPSHOT_STORE = "snapshots";
|
|
3
|
+
export declare const CANVAS_KIT_IMAGE_BLOB_STORE = "imageBlobs";
|
|
4
|
+
export declare const CANVAS_KIT_INDEXEDDB_VERSION = 2;
|
|
5
|
+
export declare function openCanvasKitDatabase(): Promise<IDBDatabase | null>;
|
|
6
|
+
export declare function readCanvasKitStoreValue(storeName: string, key: IDBValidKey): Promise<unknown | null>;
|
|
7
|
+
export declare function readCanvasKitStoreValues(storeName: string, keys: readonly IDBValidKey[]): Promise<readonly unknown[] | null>;
|
|
8
|
+
export declare function writeCanvasKitStoreValues(storeName: string, entries: readonly (readonly [IDBValidKey, unknown])[]): Promise<void>;
|
|
9
|
+
export declare function deleteCanvasKitStoreValue(storeName: string, key: IDBValidKey): Promise<void>;
|
|
10
|
+
export declare function getAllCanvasKitStoreKeys(storeName: string): Promise<IDBValidKey[] | null>;
|
package/browser/persistence.d.ts
CHANGED
|
@@ -1,44 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export declare const LAND_SESSION_STORAGE_KEY = "land.canvas.session";
|
|
7
|
-
export { LAND_DOCUMENT_INDEXEDDB_NAME, LAND_DOCUMENT_INDEXEDDB_STORE, LAND_DOCUMENT_INDEXEDDB_VERSION, LAND_IMAGE_BLOB_INDEXEDDB_STORE, };
|
|
1
|
+
import type { ProductPersistenceAdapter, ProductPersistenceLoadResult } from "../core/runtime/runtimeContracts";
|
|
2
|
+
import { CANVAS_KIT_IMAGE_BLOB_STORE, CANVAS_KIT_INDEXEDDB_NAME, CANVAS_KIT_INDEXEDDB_VERSION, CANVAS_KIT_SNAPSHOT_STORE } from "./indexedDb";
|
|
3
|
+
export declare const CANVAS_KIT_DOCUMENT_STORAGE_KEY = "canvas-kit.document";
|
|
4
|
+
export declare const CANVAS_KIT_SESSION_STORAGE_KEY = "canvas-kit.session";
|
|
5
|
+
export { CANVAS_KIT_IMAGE_BLOB_STORE, CANVAS_KIT_INDEXEDDB_NAME, CANVAS_KIT_INDEXEDDB_VERSION, CANVAS_KIT_SNAPSHOT_STORE, };
|
|
8
6
|
export interface LocalSnapshotPersistenceOptions {
|
|
9
7
|
storageNamespace?: string;
|
|
10
8
|
}
|
|
11
9
|
export declare function createLocalSnapshotPersistence(options?: LocalSnapshotPersistenceOptions): ProductPersistenceAdapter;
|
|
12
|
-
export declare
|
|
13
|
-
private readonly editor;
|
|
14
|
-
private static readonly SAVE_DELAY_MS;
|
|
15
|
-
private readonly getDocumentSnapshot;
|
|
16
|
-
private readonly options;
|
|
17
|
-
private unsubscribe;
|
|
18
|
-
private saveTimeoutId;
|
|
19
|
-
private hasPendingSave;
|
|
20
|
-
private isSaving;
|
|
21
|
-
private saveAgainAfterCurrentSave;
|
|
22
|
-
constructor(editor: Editor, { getDocumentSnapshot, options, }?: {
|
|
23
|
-
getDocumentSnapshot?: () => StoreSnapshot<{
|
|
24
|
-
id: string;
|
|
25
|
-
}>;
|
|
26
|
-
options?: LocalSnapshotPersistenceOptions;
|
|
27
|
-
});
|
|
28
|
-
start(): void;
|
|
29
|
-
stop(): void;
|
|
30
|
-
flush(): void;
|
|
31
|
-
private save;
|
|
32
|
-
private scheduleSave;
|
|
33
|
-
private cancelScheduledSave;
|
|
34
|
-
private readonly flushWhenHidden;
|
|
35
|
-
private readonly flushWhenPageIsLeaving;
|
|
36
|
-
}
|
|
37
|
-
export declare function persistEditorSnapshot(editor: Editor, options?: LocalSnapshotPersistenceOptions, { documentSnapshot, }?: {
|
|
38
|
-
documentSnapshot?: StoreSnapshot<{
|
|
39
|
-
id: string;
|
|
40
|
-
}>;
|
|
41
|
-
}): Promise<void>;
|
|
42
|
-
export declare function readPersistedEditorSnapshots(options?: LocalSnapshotPersistenceOptions): Promise<PersistedEditorSnapshots>;
|
|
10
|
+
export declare function readPersistedEditorSnapshots(options?: LocalSnapshotPersistenceOptions): Promise<ProductPersistenceLoadResult>;
|
|
43
11
|
export declare function readPersistedDocumentSnapshot(): Promise<unknown | null>;
|
|
44
12
|
export declare function readPersistedSessionSnapshot(): Promise<unknown | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function CanvasKitFloatingPortalProvider({ children, }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function CanvasKitFloatingPortalHost(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function useCanvasKitFloatingPortalTarget(): HTMLDivElement | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type Placement, type ReferenceElement } from "@floating-ui/dom";
|
|
3
|
+
import { type Editor } from "../../_vendor/canvas-core/index";
|
|
4
|
+
export declare function useCanvasKitFloatingPosition({ editor, fallbackPlacements, floatingRef, getReferenceElement, offset, placement, }: {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
fallbackPlacements: readonly Placement[];
|
|
7
|
+
floatingRef: RefObject<HTMLElement | null>;
|
|
8
|
+
getReferenceElement(): ReferenceElement | null;
|
|
9
|
+
offset?: number;
|
|
10
|
+
placement: Placement;
|
|
11
|
+
}): void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function FloatingSelectionToolbarPageSpace({ children, className, dataUi, offset,
|
|
2
|
+
import type { CanvasActionContext } from "../../_vendor/canvas-plugin-sdk/index";
|
|
3
|
+
export declare function FloatingSelectionToolbarPageSpace({ children, className, context, dataUi, horizontalAlign, offset, visible, }: {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
|
+
context: CanvasActionContext;
|
|
6
7
|
dataUi?: string;
|
|
8
|
+
horizontalAlign?: "center" | "start";
|
|
7
9
|
offset?: number;
|
|
8
|
-
|
|
10
|
+
visible?: boolean;
|
|
9
11
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolbarGroup } from "../../_vendor/canvas-
|
|
1
|
+
import { type ToolbarGroup } from "../../_vendor/canvas-plugin-sdk/index";
|
|
2
2
|
export declare function getActiveToolLabel(groups: readonly ToolbarGroup[], activeToolId: string): string;
|
|
3
3
|
export declare function getSelectionToolbarTitle({ commonShapeType, count, isMixedFrameAndPointHandleSelection, singleShapeType, }: {
|
|
4
4
|
commonShapeType: string | null;
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
export interface FloatingSelectionToolbarPageAnchor {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
}
|
|
1
|
+
import { type CanvasActionContext, type CanvasToolbarRegistry, type ToolbarChannel, type ToolbarGroup, type ToolbarSurface } from "../../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import { type Editor } from "../../_vendor/canvas-core/index";
|
|
7
3
|
export interface ToolbarSurfaces {
|
|
8
4
|
context: CanvasActionContext;
|
|
5
|
+
channels: readonly ToolbarChannel[];
|
|
6
|
+
getGroups(channel: ToolbarChannel): readonly ToolbarGroup[];
|
|
7
|
+
isSurfaceActive(surface: ToolbarSurface): boolean;
|
|
9
8
|
activeToolId: string;
|
|
10
9
|
activeToolLabel: string;
|
|
11
10
|
isToolLocked: boolean;
|
|
11
|
+
isEditing: boolean;
|
|
12
|
+
canShowPropertiesDuringEditing: boolean;
|
|
12
13
|
selectionCount: number;
|
|
13
14
|
hasMixedSelectionRotation: boolean;
|
|
14
|
-
|
|
15
|
-
contextToolbarGroups: readonly ToolbarGroup[];
|
|
16
|
-
floatingSelectionToolbarGroups: readonly ToolbarGroup[];
|
|
17
|
-
floatingSelectionToolbarPageAnchor: FloatingSelectionToolbarPageAnchor | null;
|
|
18
|
-
contextToolbarTitle: string;
|
|
19
|
-
showContextToolbar: boolean;
|
|
20
|
-
showFloatingSelectionToolbar: boolean;
|
|
15
|
+
selectionLabel: string;
|
|
21
16
|
}
|
|
22
|
-
export declare function useToolbarSurfaces({
|
|
23
|
-
|
|
17
|
+
export declare function useToolbarSurfaces({ canShowPropertiesDuringEditing, editor, toolbarRegistry, }: {
|
|
18
|
+
canShowPropertiesDuringEditing?: (context: CanvasActionContext) => boolean;
|
|
24
19
|
editor: Editor;
|
|
25
|
-
|
|
20
|
+
toolbarRegistry: CanvasToolbarRegistry;
|
|
26
21
|
}): ToolbarSurfaces;
|
package/chrome/types.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import { type ActiveContextMenu, type CanvasActionContext, type CanvasActionValue } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import type { CanvasKitBaseController, CanvasKitController } from "../controller/canvasKitController";
|
|
3
|
+
import type { CanvasProductLayerNode } from "../core";
|
|
4
|
+
import type { EditorSelectionMetadata, ShapeId } from "../_vendor/canvas-core/index";
|
|
4
5
|
import type { HistoryControls } from "./useHistoryControls";
|
|
5
6
|
import type { PageControls } from "./usePageControls";
|
|
6
7
|
import type { ZoomControlsState } from "./useZoomControls";
|
|
7
8
|
import type { ContextMenuSurface } from "./useContextMenuSurface";
|
|
8
|
-
import type {
|
|
9
|
+
import type { CanvasExportApi } from "../_vendor/plugin-builtin-export/index";
|
|
9
10
|
import type { ToolbarSurfaces } from "./toolbar/useToolbarSurfaces";
|
|
10
|
-
import type {
|
|
11
|
-
export type {
|
|
11
|
+
import type { ChromeSurfaces } from "./useChromeSurfaces";
|
|
12
|
+
export type { EditorSelectionMetadata, EditorSelectionState, ShapeId, } from "../_vendor/canvas-core/index";
|
|
13
|
+
export type { CanvasActionContext, CanvasActionValue, ChromeCommandItem, ChromeItem, ChromeSection, ContextMenuCommandItem, ContextMenuItem, ContextMenuSection, ToolbarGroup, ToolbarItem, } from "../_vendor/canvas-plugin-sdk/index";
|
|
12
14
|
export type { HistoryControls } from "./useHistoryControls";
|
|
13
15
|
export type { PageControls } from "./usePageControls";
|
|
14
16
|
export type { ZoomControlsState } from "./useZoomControls";
|
|
15
17
|
export type { ContextMenuSurface } from "./useContextMenuSurface";
|
|
16
|
-
export type { SvgExportControls, } from "./useSvgExport";
|
|
17
18
|
export type { ToolbarSurfaces, } from "./toolbar/useToolbarSurfaces";
|
|
18
|
-
export type
|
|
19
|
+
export type { ChromeSurfaces } from "./useChromeSurfaces";
|
|
20
|
+
export type CanvasKitLayerNode = CanvasProductLayerNode;
|
|
19
21
|
export interface CanvasKitToolbarActionState {
|
|
20
22
|
value: CanvasActionValue | undefined;
|
|
21
23
|
isEnabled: boolean;
|
|
@@ -36,27 +38,23 @@ export interface CanvasKitGridControls {
|
|
|
36
38
|
isVisible: boolean;
|
|
37
39
|
setIsVisible(isVisible: boolean): void;
|
|
38
40
|
}
|
|
39
|
-
export interface CanvasKitPersistenceControls {
|
|
40
|
-
discardUnsupportedRecords: (() => Promise<void>) | null;
|
|
41
|
-
isDiscardingUnsupportedRecords: boolean;
|
|
42
|
-
status: ProductPersistenceStatus | null;
|
|
43
|
-
}
|
|
44
41
|
export interface CanvasKitLayerTreeSource {
|
|
45
|
-
getSnapshot(pageId?: string): readonly
|
|
42
|
+
getSnapshot(pageId?: string): readonly CanvasProductLayerNode[];
|
|
46
43
|
subscribe(onStoreChange: () => void): () => void;
|
|
47
44
|
}
|
|
48
45
|
export interface CanvasKitChromeContext<TController extends CanvasKitBaseController = CanvasKitController> {
|
|
49
46
|
controller: TController;
|
|
47
|
+
chromeSurfaces: ChromeSurfaces;
|
|
50
48
|
contextMenu: CanvasKitContextMenuState;
|
|
51
49
|
currentPageId: string;
|
|
52
50
|
currentPageShapeIds: readonly ShapeId[];
|
|
51
|
+
sessionMeta: Readonly<Record<string, unknown>>;
|
|
53
52
|
history: HistoryControls;
|
|
54
53
|
layerTree: CanvasKitLayerTreeSource;
|
|
55
54
|
pages: PageControls;
|
|
56
|
-
selection:
|
|
55
|
+
selection: EditorSelectionMetadata;
|
|
57
56
|
selectedShapeIds: readonly ShapeId[];
|
|
58
|
-
|
|
59
|
-
svgExport: SvgExportControls;
|
|
57
|
+
exportApi: CanvasExportApi;
|
|
60
58
|
toolbarRuntime: CanvasKitToolbarRuntime;
|
|
61
59
|
toolbarSurfaces: ToolbarSurfaces;
|
|
62
60
|
grid: CanvasKitGridControls;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type ActiveContextMenu, type CanvasActionContext, type CanvasActionRegistry, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasToolbarRegistry } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import { type Editor } from "../_vendor/canvas-core/index";
|
|
3
3
|
import type { CanvasKitBaseController } from "../controller/canvasKitController";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
import type { CanvasKitChromeContext, CanvasKitGridControls, CanvasKitPersistenceControls } from "./types";
|
|
8
|
-
export declare function useCanvasKitChromeContext<TController extends CanvasKitBaseController>({ apis, controller, activeContextMenu, chromeSlots, editor, grid, hostFeatures, onActiveContextMenuChange, persistence, pluginHostRuntime, services, themeRootRef, }: {
|
|
9
|
-
apis: ProductApiRegistry;
|
|
4
|
+
import type { ExecuteCanvasKitCommand } from "../runtime/canvasKitCommandExecutor";
|
|
5
|
+
import type { CanvasKitChromeContext, CanvasKitGridControls } from "./types";
|
|
6
|
+
export declare function useCanvasKitChromeContext<TController extends CanvasKitBaseController>({ controller, activeContextMenu, grid, onActiveContextMenuChange, actionRegistry, canShowPropertiesDuringEditing, chromeRegistry, contextMenuRegistry, editor, executeCommand, toolbarRegistry, }: {
|
|
10
7
|
controller: TController;
|
|
11
8
|
activeContextMenu: ActiveContextMenu | null;
|
|
12
|
-
chromeSlots: readonly CanvasKitChromeSlot<string, unknown>[];
|
|
13
|
-
editor: CanvasKitRuntime["editor"];
|
|
14
9
|
grid: CanvasKitGridControls;
|
|
15
|
-
hostFeatures: readonly CanvasKitHostFeature[];
|
|
16
10
|
onActiveContextMenuChange: (activeContextMenu: ActiveContextMenu | null) => void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
actionRegistry: CanvasActionRegistry;
|
|
12
|
+
canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
|
|
13
|
+
chromeRegistry: CanvasChromeRegistry;
|
|
14
|
+
contextMenuRegistry: CanvasContextMenuRegistry;
|
|
15
|
+
editor: Editor;
|
|
16
|
+
executeCommand: ExecuteCanvasKitCommand;
|
|
17
|
+
toolbarRegistry: CanvasToolbarRegistry;
|
|
21
18
|
}): CanvasKitChromeContext<TController>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CanvasActionContext, CanvasChromeRegistry, ChromeChannel, ChromeSection } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
3
|
+
export interface ChromeSurfaces {
|
|
4
|
+
context: CanvasActionContext;
|
|
5
|
+
channels: readonly ChromeChannel[];
|
|
6
|
+
getSections(channel: ChromeChannel): readonly ChromeSection[];
|
|
7
|
+
}
|
|
8
|
+
export declare function useChromeSurfaces({ context, editor, registry, }: {
|
|
9
|
+
context: CanvasActionContext;
|
|
10
|
+
editor: Editor;
|
|
11
|
+
registry: CanvasChromeRegistry;
|
|
12
|
+
}): ChromeSurfaces;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
1
|
+
import { type ActiveContextMenu, type CanvasContextMenuRegistry, type ContextMenuContext, type ContextMenuSection } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
3
3
|
export interface ContextMenuSurface {
|
|
4
4
|
context: ContextMenuContext | null;
|
|
5
5
|
activeContextMenu: ActiveContextMenu | null;
|
|
6
6
|
sections: readonly ContextMenuSection[];
|
|
7
7
|
}
|
|
8
|
-
export declare function useContextMenuSurface({ editor, activeContextMenu,
|
|
8
|
+
export declare function useContextMenuSurface({ editor, activeContextMenu, contextMenuRegistry, }: {
|
|
9
9
|
editor: Editor;
|
|
10
10
|
activeContextMenu: ActiveContextMenu | null;
|
|
11
|
-
|
|
11
|
+
contextMenuRegistry: CanvasContextMenuRegistry;
|
|
12
12
|
}): ContextMenuSurface;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExecuteCanvasKitCommand } from "../runtime/canvasKitCommandExecutor";
|
|
3
3
|
export interface HistoryControls {
|
|
4
4
|
canUndo: boolean;
|
|
5
5
|
canRedo: boolean;
|
|
6
6
|
undo(): void;
|
|
7
7
|
redo(): void;
|
|
8
8
|
}
|
|
9
|
-
export declare function useHistoryControls({ editor,
|
|
9
|
+
export declare function useHistoryControls({ editor, executeCommand, }: {
|
|
10
10
|
editor: Editor;
|
|
11
|
-
|
|
11
|
+
executeCommand: ExecuteCanvasKitCommand;
|
|
12
12
|
}): HistoryControls;
|