@yuzhouu/canvas-kit 0.1.10 → 0.1.12
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 +95 -40
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +15 -0
- package/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
- package/_vendor/canvas-core/editor/bindingReactionScope.d.ts +7 -0
- package/_vendor/canvas-core/editor/commands.d.ts +3 -3
- package/_vendor/canvas-core/editor/editor.d.ts +20 -5
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +1 -0
- package/_vendor/canvas-core/editor/historyManager.d.ts +2 -5
- package/_vendor/canvas-core/editor/interactions.d.ts +33 -9
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +1 -6
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +13 -0
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +3 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
- package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +3 -1
- package/_vendor/canvas-core/exports/svg.d.ts +2 -3
- package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
- package/_vendor/canvas-core/index.d.ts +9 -5
- package/_vendor/canvas-core/shapes/colors.d.ts +2 -1
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +47 -1
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +9 -2
- package/_vendor/canvas-core/tools/select/states/{draggingSelectionHandleInteractionState.d.ts → draggingPluginInteractionState.d.ts} +5 -4
- package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +2 -2
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
- package/_vendor/canvas-plugin-sdk/capability.d.ts +10 -0
- package/_vendor/canvas-plugin-sdk/index.d.ts +2 -6
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +18 -28
- package/_vendor/canvas-plugin-sdk/setupExtension.d.ts +5 -0
- package/_vendor/canvas-product-contracts/actionRegistry.d.ts +4 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/actions.d.ts +14 -3
- package/_vendor/canvas-product-contracts/capability.d.ts +8 -0
- package/_vendor/canvas-product-contracts/chrome.d.ts +53 -0
- package/_vendor/canvas-product-contracts/chromeRegistry.d.ts +9 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/contextMenu.d.ts +4 -0
- package/_vendor/canvas-product-contracts/contextMenuRegistry.d.ts +4 -0
- package/_vendor/canvas-product-contracts/exportRegistry.d.ts +6 -0
- package/_vendor/canvas-product-contracts/exports.d.ts +27 -0
- package/_vendor/canvas-product-contracts/importRegistry.d.ts +7 -0
- package/_vendor/canvas-product-contracts/imports.d.ts +39 -0
- package/_vendor/canvas-product-contracts/index.d.ts +15 -0
- package/_vendor/canvas-product-contracts/productApi.d.ts +29 -0
- package/_vendor/canvas-product-contracts/services.d.ts +21 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/toolbar.d.ts +23 -4
- package/_vendor/canvas-product-contracts/toolbarRegistry.d.ts +9 -0
- package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +15 -4
- package/_vendor/canvas-react/host/index.d.ts +2 -2
- package/_vendor/plugin-arrow/api.d.ts +33 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +2 -1
- package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +2 -1
- package/_vendor/plugin-arrow/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -2
- package/_vendor/plugin-arrow/index.d.ts +4 -1
- package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-draw/drawPath.d.ts +7 -1
- package/_vendor/plugin-draw/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-draw/feature.d.ts +2 -2
- package/_vendor/plugin-draw/index.d.ts +2 -1
- package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
- package/_vendor/plugin-eraser/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-eraser/feature.d.ts +2 -2
- package/_vendor/plugin-eraser/index.d.ts +2 -1
- package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-frame/api.d.ts +19 -0
- package/_vendor/plugin-frame/canvasRender.d.ts +3 -3
- package/_vendor/plugin-frame/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-frame/feature.d.ts +2 -2
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +8 -0
- package/_vendor/plugin-frame/index.d.ts +4 -1
- package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/api.d.ts +27 -0
- package/_vendor/plugin-geo/canvasRender.d.ts +3 -3
- package/_vendor/plugin-geo/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-geo/feature.d.ts +2 -2
- package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
- package/_vendor/plugin-geo/geoTools.d.ts +1 -1
- package/_vendor/plugin-geo/index.d.ts +7 -4
- package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/types.d.ts +5 -1
- package/_vendor/plugin-group/canvasRender.d.ts +1 -2
- package/_vendor/plugin-group/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-group/feature.d.ts +2 -2
- package/_vendor/plugin-group/groupContributions.d.ts +1 -1
- package/_vendor/plugin-group/index.d.ts +2 -1
- package/_vendor/plugin-group/productRuntime.d.ts +2 -0
- package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
- package/_vendor/plugin-image/editorRuntime.d.ts +0 -4
- package/_vendor/plugin-image/feature.d.ts +2 -2
- package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
- package/_vendor/plugin-image/index.d.ts +2 -1
- package/_vendor/plugin-image/productRuntime.d.ts +4 -0
- package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
- 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/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-laser/feature.d.ts +2 -2
- package/_vendor/plugin-laser/index.d.ts +2 -1
- package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-path/PathShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-path/editorRuntime.d.ts +1 -15
- package/_vendor/plugin-path/feature.d.ts +2 -2
- package/_vendor/plugin-path/index.d.ts +2 -1
- package/_vendor/plugin-path/pathHistory.d.ts +13 -0
- package/_vendor/plugin-path/pathShapeUtil.d.ts +3 -1
- package/_vendor/plugin-path/pathTool.d.ts +3 -0
- package/_vendor/plugin-path/productRuntime.d.ts +15 -0
- package/_vendor/plugin-runtime-clipboard/capability.d.ts +1 -0
- package/{features/clipboard/clipboardContribution.d.ts → _vendor/plugin-runtime-clipboard/clipboardActions.d.ts} +1 -7
- package/{features/clipboard → _vendor/plugin-runtime-clipboard}/clipboardService.d.ts +3 -3
- package/_vendor/plugin-runtime-clipboard/index.d.ts +4 -0
- package/_vendor/plugin-runtime-clipboard/plugin.d.ts +1 -0
- package/_vendor/plugin-runtime-export/blobDataUrl.d.ts +1 -0
- package/_vendor/plugin-runtime-export/canvasExportApi.d.ts +43 -0
- package/_vendor/plugin-runtime-export/index.d.ts +8 -0
- package/_vendor/plugin-runtime-export/plugin.d.ts +5 -0
- package/_vendor/plugin-runtime-export/pngExport.d.ts +15 -0
- package/{features/export → _vendor/plugin-runtime-export}/svgExport.d.ts +9 -2
- package/_vendor/plugin-text/api.d.ts +20 -0
- package/_vendor/plugin-text/capabilities.d.ts +2 -0
- package/_vendor/plugin-text/editorRuntime.d.ts +2 -8
- package/_vendor/plugin-text/feature.d.ts +1 -1
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +0 -2
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +1 -1
- package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -1
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
- package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
- package/_vendor/plugin-text/index.d.ts +7 -3
- package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
- package/_vendor/plugin-text/productRuntime.d.ts +6 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +3 -2
- package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +4 -0
- package/_vendor/plugin-text/textFormatting.d.ts +2 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +23 -2
- package/_vendor/plugin-text/textShapeUtil.d.ts +5 -2
- package/_vendor/plugin-text/textTypes.d.ts +1 -0
- package/_vendor/signals/core.d.ts +1 -0
- package/_vendor/signals/index.d.ts +1 -1
- package/_vendor/store/history.d.ts +1 -1
- package/_vendor/store/store.d.ts +2 -0
- package/browser/indexedDb.d.ts +10 -10
- package/browser/persistence.d.ts +4 -25
- package/chrome/floating/useCanvasKitFloatingPosition.d.ts +1 -1
- package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
- package/chrome/toolbar/mergeToolbarGroups.d.ts +8 -0
- package/chrome/toolbar/toolbarLabels.d.ts +1 -1
- package/chrome/toolbar/useToolbarSurfaces.d.ts +9 -10
- package/chrome/types.d.ts +12 -9
- package/chrome/useCanvasKitChromeContext.d.ts +4 -7
- package/chrome/useChromeSurfaces.d.ts +12 -0
- package/chrome/useContextMenuSurface.d.ts +1 -1
- package/controller/canvasKitController.d.ts +4 -11
- package/core/index.d.ts +3 -4
- package/core/product-controller/canvasProductController.d.ts +40 -11
- package/core/product-controller/index.d.ts +1 -1
- package/core/runtime/productServices.d.ts +5 -19
- package/core/runtime/runtimeContracts.d.ts +3 -3
- package/features/context-menu/contextMenuRuntime.d.ts +1 -1
- package/features/image/asset/imageAssetService.d.ts +2 -3
- package/features/image/asset/imageBlobStore.d.ts +1 -0
- package/features/image/asset/imageFileHelpers.d.ts +0 -6
- package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
- package/features/image/controller/imageProductController.d.ts +2 -2
- package/features/image/imageHostPlugin.d.ts +1 -0
- package/features/image/import/ImageImportController.d.ts +3 -1
- package/features/image/index.d.ts +1 -3
- package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
- package/features/image/toolbar/imageHostActions.d.ts +8 -9
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/text/{textProductPlugin.d.ts → textHostPlugin.d.ts} +1 -1
- package/features/text/textSvgAssetInliner.d.ts +3 -0
- package/features/text/textSvgAssetPlugin.d.ts +2 -0
- package/index.css +1 -1
- package/index.d.ts +31 -19
- package/index.mjs +88 -84
- package/package.json +2 -2
- package/plugins/runtime/import-host/CanvasImportHost.d.ts +4 -0
- package/plugins/runtime/import-host/capability.d.ts +1 -0
- package/plugins/runtime/import-host/index.d.ts +2 -0
- package/plugins/runtime/import-host/plugin.d.ts +1 -0
- package/plugins/runtime/keyboard-shortcuts/index.d.ts +1 -0
- package/plugins/runtime/keyboard-shortcuts/plugin.d.ts +1 -0
- package/plugins/runtime/keyboard-shortcuts/useCanvasKeyboardShortcuts.d.ts +8 -0
- package/plugins/runtime/tool-actions/capability.d.ts +1 -0
- package/plugins/runtime/tool-actions/index.d.ts +2 -0
- package/plugins/runtime/tool-actions/plugin.d.ts +1 -0
- package/plugins/runtime/tool-actions/toolActions.d.ts +2 -0
- package/plugins/standard/clipboard/chrome.d.ts +2 -0
- package/plugins/standard/clipboard/contextMenu.d.ts +2 -0
- package/plugins/standard/clipboard/plugin.d.ts +1 -0
- package/plugins/standard/clipboard/shortcuts.d.ts +5 -0
- package/plugins/standard/createStandardCanvasKitPlugins.d.ts +15 -0
- package/{features/selection/selectionActions.d.ts → plugins/standard/selection/actions.d.ts} +4 -2
- package/plugins/standard/selection/chrome.d.ts +2 -0
- package/plugins/standard/selection/contextMenu.d.ts +2 -0
- package/plugins/standard/selection/plugin.d.ts +1 -0
- package/plugins/standard/selection/toolbar.d.ts +2 -0
- package/plugins/standard/tool-ui/contextMenu.d.ts +2 -0
- package/plugins/standard/tool-ui/plugin.d.ts +1 -0
- package/plugins/standard/tool-ui/toolbar.d.ts +2 -0
- package/{features/view/viewActions.d.ts → plugins/standard/view/actions.d.ts} +1 -1
- package/plugins/standard/view/chrome.d.ts +2 -0
- package/plugins/standard/view/contextMenu.d.ts +2 -0
- package/plugins/standard/view/plugin.d.ts +1 -0
- package/{features/actions/actionRuntime.d.ts → runtime/canvasKitActionContext.d.ts} +3 -2
- package/runtime/canvasKitCommandExecutor.d.ts +1 -1
- package/runtime/canvasKitPluginContracts.d.ts +29 -76
- package/runtime/canvasKitPluginLifecycle.d.ts +32 -0
- package/runtime/canvasKitPluginSetup.d.ts +34 -0
- package/runtime/canvasKitPluginUi.d.ts +35 -0
- package/runtime/canvasKitResourceScope.d.ts +5 -0
- package/runtime/canvasKitRuntime.d.ts +9 -7
- package/runtime/canvasKitRuntimeContracts.d.ts +2 -5
- package/runtime/canvasPluginGraph.d.ts +15 -0
- package/runtime/persistenceCoordinator.d.ts +33 -0
- package/runtime/registries/actionRegistry.d.ts +5 -0
- package/runtime/registries/chromeRegistry.d.ts +2 -0
- package/runtime/registries/contextMenuRegistry.d.ts +5 -0
- package/runtime/registries/exportRegistry.d.ts +2 -0
- package/runtime/registries/importRegistry.d.ts +2 -0
- package/runtime/registries/index.d.ts +7 -0
- package/runtime/registries/productApiRegistry.d.ts +5 -0
- package/runtime/registries/toolbarRegistry.d.ts +5 -0
- package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +0 -7
- package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +0 -11
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +0 -19
- package/_vendor/plugin-packaging/canvasRender.d.ts +0 -2
- package/_vendor/plugin-packaging/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-packaging/feature.d.ts +0 -2
- package/_vendor/plugin-packaging/index.d.ts +0 -17
- package/_vendor/plugin-packaging/packagingArtwork.d.ts +0 -5
- package/_vendor/plugin-packaging/packagingDxf.d.ts +0 -9
- package/_vendor/plugin-packaging/packagingGeometry.d.ts +0 -74
- package/_vendor/plugin-packaging/packagingInteractions.d.ts +0 -2
- package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +0 -25
- package/_vendor/plugin-packaging/packagingRuntime.d.ts +0 -11
- package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +0 -34
- package/_vendor/plugin-packaging/packagingStyle.d.ts +0 -10
- package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +0 -7
- package/_vendor/plugin-packaging/productRuntime.d.ts +0 -2
- package/_vendor/plugin-packaging/types.d.ts +0 -168
- package/_vendor/plugin-packaging/validation.d.ts +0 -3
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -47
- package/builtins/controller/createBuiltInCanvasController.d.ts +0 -18
- package/builtins/controller/layerController.d.ts +0 -9
- package/builtins/controller/packagingController.d.ts +0 -71
- package/builtins/controller/shapeCreationController.d.ts +0 -83
- package/builtins/index.d.ts +0 -7
- package/builtins/plugins.d.ts +0 -16
- package/chrome/useSvgExport.d.ts +0 -15
- package/core/api/apiRegistry.d.ts +0 -12
- package/es-DocrZgUh.mjs +0 -2
- package/features/clipboard/clipboardContextMenuContributions.d.ts +0 -2
- package/features/clipboard/clipboardPlugin.d.ts +0 -1
- package/features/image/imageProductPlugin.d.ts +0 -1
- package/features/image/import/useImageImport.d.ts +0 -16
- package/features/keyboard/keyboardShortcutPlugin.d.ts +0 -1
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -8
- package/features/selection/selectionContextMenuContributions.d.ts +0 -2
- package/features/selection/selectionPlugin.d.ts +0 -1
- package/features/selection/selectionToolbarContributions.d.ts +0 -2
- package/features/tool/toolActions.d.ts +0 -2
- package/features/tool/toolContextMenuContributions.d.ts +0 -2
- package/features/tool/toolPlugin.d.ts +0 -1
- package/features/tool/toolToolbarContributions.d.ts +0 -2
- package/features/view/viewContextMenuContributions.d.ts +0 -2
- package/features/view/viewPlugin.d.ts +0 -1
- package/product/standardCanvasKitPlugins.d.ts +0 -4
- package/runtime/canvasKitPlugins.d.ts +0 -33
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuzhouu/canvas-kit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Land canvas
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "Extensible Land canvas runtime, standard React product profile, and typed API surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
7
7
|
"module": "./index.mjs",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CanvasImportPreview } from "../../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
import type { CanvasPluginComponentProps } from "../../../runtime/canvasKitPluginContracts";
|
|
3
|
+
export declare function CanvasImportHost({ editor, getHostElement, imports, }: CanvasPluginComponentProps): null;
|
|
4
|
+
export declare function getImportPreview(dataTransfer: DataTransfer | null): CanvasImportPreview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const canvasImportHostCapability: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginValueToken<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ImportHostPlugin: import("../../..").CanvasPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { KeyboardShortcutHostPlugin } from "./plugin";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const KeyboardShortcutHostPlugin: import("../../..").CanvasPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Editor } from "../../../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasActionRegistry } from "../../../_vendor/canvas-product-contracts/index";
|
|
3
|
+
import type { ExecuteCanvasCommand } from "../../../runtime/canvasKitPluginUi";
|
|
4
|
+
export declare function useCanvasKeyboardShortcuts({ actionRegistry, editor, executeCommand, }: {
|
|
5
|
+
actionRegistry: CanvasActionRegistry;
|
|
6
|
+
editor: Editor;
|
|
7
|
+
executeCommand: ExecuteCanvasCommand;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const canvasToolActionsCapability: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginValueToken<true>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DefaultToolActionsPlugin: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPlugin<(context: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StandardClipboardPlugin: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPlugin<(context: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TextPluginOptions } from "../../_vendor/plugin-text/index";
|
|
2
|
+
import type { CanvasPlugin } from "../../runtime/canvasKitPluginContracts";
|
|
3
|
+
export interface CanvasKitStandardPluginOptions {
|
|
4
|
+
arrow?: boolean;
|
|
5
|
+
draw?: boolean;
|
|
6
|
+
eraser?: boolean;
|
|
7
|
+
frame?: boolean;
|
|
8
|
+
geo?: boolean;
|
|
9
|
+
group?: boolean;
|
|
10
|
+
image?: boolean;
|
|
11
|
+
laser?: boolean;
|
|
12
|
+
path?: boolean;
|
|
13
|
+
text?: boolean | Partial<TextPluginOptions>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createStandardCanvasKitPlugins(options?: CanvasKitStandardPluginOptions): readonly CanvasPlugin[];
|
package/{features/selection/selectionActions.d.ts → plugins/standard/selection/actions.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type CanvasAction, type CanvasActionContext } from "
|
|
2
|
-
import type { KeyboardShortcutInput } from "
|
|
1
|
+
import { type CanvasAction, type CanvasActionContext } from "../../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
import type { KeyboardShortcutInput } from "../../../_vendor/canvas-core/index";
|
|
3
3
|
export declare const SYSTEM_SELECTION_DELETE_ACTION_ID = "system.selection.delete";
|
|
4
4
|
export declare const SYSTEM_SELECTION_DUPLICATE_ACTION_ID = "system.selection.duplicate";
|
|
5
5
|
export declare const SYSTEM_SELECTION_SELECT_ALL_ACTION_ID = "system.selection.select-all";
|
|
@@ -11,6 +11,8 @@ export declare const SYSTEM_SELECTION_SEND_BACKWARD_ACTION_ID = "system.selectio
|
|
|
11
11
|
export declare const SYSTEM_SELECTION_BRING_FORWARD_ACTION_ID = "system.selection.bring-forward";
|
|
12
12
|
export declare const SYSTEM_SELECTION_BRING_TO_FRONT_ACTION_ID = "system.selection.bring-to-front";
|
|
13
13
|
export declare const SYSTEM_SELECTION_SET_OPACITY_ACTION_ID = "system.selection.set-opacity";
|
|
14
|
+
export declare const SYSTEM_SELECTION_ALIGN_ACTION_ID = "system.selection.align";
|
|
15
|
+
export declare const SYSTEM_SELECTION_DISTRIBUTE_ACTION_ID = "system.selection.distribute";
|
|
14
16
|
export declare const selectionActionShortcuts: readonly {
|
|
15
17
|
actionId: string;
|
|
16
18
|
shortcut: KeyboardShortcutInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StandardSelectionPlugin: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPlugin<(context: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StandardToolUiPlugin: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPlugin<(context: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasAction } from "
|
|
1
|
+
import { type CanvasAction } from "../../../_vendor/canvas-product-contracts/index";
|
|
2
2
|
export declare const SYSTEM_VIEW_ZOOM_IN_ACTION_ID = "system.view.zoom-in";
|
|
3
3
|
export declare const SYSTEM_VIEW_ZOOM_OUT_ACTION_ID = "system.view.zoom-out";
|
|
4
4
|
export declare const SYSTEM_VIEW_RESET_ZOOM_ACTION_ID = "system.view.reset-zoom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StandardViewPlugin: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPlugin<(context: import("../../../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasActionContext } from "../_vendor/canvas-product-contracts/index";
|
|
3
3
|
export declare function createCanvasActionContext({ editor, toolState, selectionState, }: {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
toolState: {
|
|
@@ -10,6 +10,7 @@ export declare function createCanvasActionContext({ editor, toolState, selection
|
|
|
10
10
|
count: number;
|
|
11
11
|
singleShapeType: CanvasActionContext["selection"]["singleShapeType"];
|
|
12
12
|
commonShapeType: CanvasActionContext["selection"]["commonShapeType"];
|
|
13
|
+
canFlipSelection: boolean;
|
|
13
14
|
canResetSelectionRotation: boolean;
|
|
14
15
|
isMixedFrameAndPointHandleSelection: boolean;
|
|
15
16
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasActionContext } from "../_vendor/canvas-product-contracts/index";
|
|
2
2
|
import type { Editor } from "../_vendor/canvas-core/index";
|
|
3
3
|
import type { CanvasPluginBeforeCommand } from "./canvasKitPluginContracts";
|
|
4
4
|
export interface CanvasKitCommandInput<TResult> {
|
|
@@ -1,79 +1,32 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
1
|
+
import { type CanvasPlugin as SdkCanvasPlugin, type CanvasPluginDefinition as SdkCanvasPluginDefinition, type CanvasPluginSetup as SdkCanvasPluginSetup, type CanvasPluginSetupContext as SdkCanvasPluginSetupContext, type CanvasPluginSetupExtension } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import { type CanvasPluginApi as SdkCanvasPluginApi, type CanvasPluginApiContext, type CanvasPluginApiSetup } from "../_vendor/canvas-product-contracts/index";
|
|
3
|
+
import type { ProductAssetResolverService, ProductServiceRegistry, ProductServiceToken } from "../core";
|
|
4
|
+
import type { SvgAssetInliner } from "../_vendor/plugin-runtime-export/index";
|
|
5
|
+
export type { CanvasPluginBeforeCommand, CanvasPluginBeforeCommandContext, CanvasPluginBeforeReady, CanvasPluginBeforeReadyContext, CanvasPluginLifecycleSetup, CanvasPluginPersistence, } from "./canvasKitPluginLifecycle";
|
|
6
|
+
export { canvasKitLifecycleExtension, canvasKitPersistenceExtension, } from "./canvasKitPluginLifecycle";
|
|
7
|
+
export type { CanvasPluginComponent, CanvasPluginComponentProps, CanvasPluginProvider, CanvasPluginUiSetup, } from "./canvasKitPluginUi";
|
|
8
|
+
export { canvasKitUiExtension } from "./canvasKitPluginUi";
|
|
9
|
+
export type CanvasPluginApi<TApi> = SdkCanvasPluginApi<TApi, CanvasPluginContext>;
|
|
10
|
+
export interface CanvasPluginContext extends CanvasPluginApiContext {
|
|
10
11
|
productId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CanvasProductContribution extends BaseCanvasProductContribution {
|
|
13
|
-
services?: readonly ProductServiceFactory<unknown>[];
|
|
14
|
-
createActions?: (context: CanvasActionFactoryContext) => readonly CanvasAction[];
|
|
15
|
-
apis?: readonly CanvasPluginApi<unknown>[];
|
|
16
|
-
setup?(context: CanvasPluginContext): void | (() => void);
|
|
17
|
-
beforeReady?: CanvasPluginBeforeReady;
|
|
18
|
-
beforeCommand?: CanvasPluginBeforeCommand;
|
|
19
|
-
providers?: readonly CanvasPluginProvider[];
|
|
20
|
-
components?: readonly CanvasPluginComponent[];
|
|
21
|
-
assetResolverTokens?: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
22
|
-
svgAssetInliners?: (context: CanvasPluginSvgAssetInlinerContext) => readonly SvgAssetInliner[];
|
|
23
|
-
canShowToolbarDuringEditing?: (context: CanvasActionContext) => boolean;
|
|
24
|
-
}
|
|
25
|
-
export type CanvasProductFactory = (context: CanvasProductFactoryContext) => CanvasProductContribution;
|
|
26
|
-
export type CanvasPlugin = SdkCanvasPlugin<CanvasProductFactory>;
|
|
27
|
-
export type CanvasPluginInput = SdkCanvasPluginInput<CanvasProductFactory>;
|
|
28
|
-
export declare function defineCanvasPlugin(plugin: CanvasPlugin): CanvasPlugin;
|
|
29
|
-
export interface CanvasActionFactoryContext {
|
|
30
|
-
productId: string;
|
|
31
|
-
services: ProductServiceRegistry;
|
|
32
|
-
}
|
|
33
|
-
export interface CanvasPluginApi<TApi> {
|
|
34
|
-
token: ProductApiToken<TApi>;
|
|
35
|
-
create(context: CanvasPluginContext): TApi | null;
|
|
36
|
-
}
|
|
37
|
-
export interface CanvasPluginContext {
|
|
38
|
-
apis: ProductApiRegistry;
|
|
39
|
-
editor: Editor;
|
|
40
|
-
productId: string;
|
|
41
|
-
services: ProductServiceRegistry;
|
|
42
|
-
}
|
|
43
|
-
export interface CanvasPluginSvgAssetInlinerContext {
|
|
44
|
-
editor: Editor;
|
|
45
12
|
services: ProductServiceRegistry;
|
|
46
13
|
}
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
services: ProductServiceRegistry;
|
|
67
|
-
}
|
|
68
|
-
export interface CanvasPluginProvider {
|
|
69
|
-
id: string;
|
|
70
|
-
order?: number;
|
|
71
|
-
component: ComponentType<{
|
|
72
|
-
children: ReactNode;
|
|
73
|
-
}>;
|
|
74
|
-
}
|
|
75
|
-
export interface CanvasPluginComponent {
|
|
76
|
-
id: string;
|
|
77
|
-
order?: number;
|
|
78
|
-
component: ComponentType<CanvasPluginComponentProps>;
|
|
79
|
-
}
|
|
14
|
+
export declare const canvasKitApisExtension: CanvasPluginSetupExtension<CanvasPluginApiSetup<CanvasPluginContext>>;
|
|
15
|
+
export interface CanvasKitPluginAssetSetup {
|
|
16
|
+
addResolver(token: ProductServiceToken<ProductAssetResolverService>): void;
|
|
17
|
+
addSvgInliners(...inliners: readonly SvgAssetInliner[]): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const canvasKitAssetsExtension: CanvasPluginSetupExtension<CanvasKitPluginAssetSetup>;
|
|
20
|
+
export type CanvasKitPluginLifecycleSetup = import("./canvasKitPluginLifecycle").CanvasPluginLifecycleSetup;
|
|
21
|
+
export type CanvasKitPluginUiSetup = import("./canvasKitPluginUi").CanvasPluginUiSetup;
|
|
22
|
+
export type CanvasKitPluginPersistence = import("./canvasKitPluginLifecycle").CanvasPluginPersistence;
|
|
23
|
+
export type CanvasKitPluginSetupContext = SdkCanvasPluginSetupContext;
|
|
24
|
+
export type CanvasKitPluginSetup = SdkCanvasPluginSetup<CanvasKitPluginSetupContext>;
|
|
25
|
+
export type CanvasPlugin = Omit<SdkCanvasPlugin<CanvasKitPluginSetup>, "editor" | "render" | "setup"> & {
|
|
26
|
+
readonly editor?: unknown;
|
|
27
|
+
readonly render?: unknown;
|
|
28
|
+
readonly setup?: (...args: never[]) => unknown;
|
|
29
|
+
};
|
|
30
|
+
export type CanvasPluginDefinition = SdkCanvasPluginDefinition<CanvasKitPluginSetup>;
|
|
31
|
+
export type CanvasPluginInput = CanvasPlugin | readonly CanvasPluginInput[];
|
|
32
|
+
export declare function defineCanvasPlugin(plugin: CanvasPluginDefinition): CanvasPlugin;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasActionContext, type ProductServiceRegistry } from "../_vendor/canvas-product-contracts/index";
|
|
3
|
+
export interface CanvasPluginPersistence {
|
|
4
|
+
flush(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface CanvasPluginStartupResult {
|
|
7
|
+
documentSource: "restored" | "seeded" | "empty";
|
|
8
|
+
sessionRestored: boolean;
|
|
9
|
+
warnings: readonly unknown[];
|
|
10
|
+
}
|
|
11
|
+
export interface CanvasPluginBeforeReadyContext {
|
|
12
|
+
editor: Editor;
|
|
13
|
+
persistence: CanvasPluginPersistence | null;
|
|
14
|
+
productId: string;
|
|
15
|
+
signal: AbortSignal;
|
|
16
|
+
startup: CanvasPluginStartupResult;
|
|
17
|
+
services: ProductServiceRegistry;
|
|
18
|
+
}
|
|
19
|
+
export interface CanvasPluginBeforeCommandContext {
|
|
20
|
+
commandId: string;
|
|
21
|
+
context?: CanvasActionContext;
|
|
22
|
+
editor: Editor;
|
|
23
|
+
}
|
|
24
|
+
export type CanvasPluginBeforeReady = (context: CanvasPluginBeforeReadyContext) => Promise<void> | void;
|
|
25
|
+
export type CanvasPluginBeforeCommand = (context: CanvasPluginBeforeCommandContext) => void;
|
|
26
|
+
export interface CanvasPluginLifecycleSetup {
|
|
27
|
+
beforeCommand(hook: CanvasPluginBeforeCommand): void;
|
|
28
|
+
beforeReady(hook: CanvasPluginBeforeReady): void;
|
|
29
|
+
defer(dispose: () => void): void;
|
|
30
|
+
}
|
|
31
|
+
export declare const canvasKitLifecycleExtension: import("../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginLifecycleSetup>;
|
|
32
|
+
export declare const canvasKitPersistenceExtension: import("../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginPersistence | null>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CanvasPlugin as SdkCanvasPlugin } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import { type CanvasActionContext, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry, type ProductApiRegistry } from "../_vendor/canvas-product-contracts/index";
|
|
3
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
4
|
+
import type { ProductAssetResolverService, ProductServiceRegistryRuntime, ProductServiceToken } from "../core";
|
|
5
|
+
import type { SvgAssetInliner } from "../_vendor/plugin-runtime-export/index";
|
|
6
|
+
import type { CanvasKitPluginSetup, CanvasKitPluginPersistence, CanvasPluginBeforeCommand, CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginProvider } from "./canvasKitPluginContracts";
|
|
7
|
+
import { createCanvasActionRegistry } from "./registries";
|
|
8
|
+
export interface CanvasKitPluginSetupResult {
|
|
9
|
+
readonly actionRegistry: ReturnType<typeof createCanvasActionRegistry>;
|
|
10
|
+
readonly apis: ProductApiRegistry;
|
|
11
|
+
readonly assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
12
|
+
readonly beforeCommandHooks: readonly CanvasPluginBeforeCommand[];
|
|
13
|
+
readonly beforeReadyHooks: readonly CanvasPluginBeforeReady[];
|
|
14
|
+
readonly components: readonly CanvasPluginComponent[];
|
|
15
|
+
readonly chromeRegistry: CanvasChromeRegistry;
|
|
16
|
+
readonly contextMenuRegistry: CanvasContextMenuRegistry;
|
|
17
|
+
readonly importRegistry: CanvasImportRegistry;
|
|
18
|
+
readonly providers: readonly CanvasPluginProvider[];
|
|
19
|
+
readonly toolbarRegistry: CanvasToolbarRegistry;
|
|
20
|
+
canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface CanvasKitPluginSetupSession {
|
|
23
|
+
install(plugin: SdkCanvasPlugin<CanvasKitPluginSetup>): void;
|
|
24
|
+
seal(): CanvasKitPluginSetupResult;
|
|
25
|
+
}
|
|
26
|
+
export declare function createCanvasKitPluginSetupSession({ assetResolverTokens, defer, editor, persistence, productId, services, svgAssetInliners, }: {
|
|
27
|
+
assetResolverTokens: ProductServiceToken<ProductAssetResolverService>[];
|
|
28
|
+
defer(dispose: () => void): void;
|
|
29
|
+
editor: Editor;
|
|
30
|
+
persistence: CanvasKitPluginPersistence | null;
|
|
31
|
+
productId: string;
|
|
32
|
+
services: ProductServiceRegistryRuntime;
|
|
33
|
+
svgAssetInliners: SvgAssetInliner[];
|
|
34
|
+
}): CanvasKitPluginSetupSession;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasActionContext, type CanvasActionRegistry, type CanvasImportRegistry, type ProductServiceRegistry } from "../_vendor/canvas-product-contracts/index";
|
|
3
|
+
import type { ComponentType, ReactNode } from "react";
|
|
4
|
+
export interface CanvasCommandInput<TResult> {
|
|
5
|
+
commandId: string;
|
|
6
|
+
context?: CanvasActionContext;
|
|
7
|
+
run(): TResult;
|
|
8
|
+
}
|
|
9
|
+
export type ExecuteCanvasCommand = <TResult>(input: CanvasCommandInput<TResult>) => TResult;
|
|
10
|
+
export interface CanvasPluginComponentProps {
|
|
11
|
+
actionRegistry: CanvasActionRegistry;
|
|
12
|
+
editor: Editor;
|
|
13
|
+
executeCommand: ExecuteCanvasCommand;
|
|
14
|
+
getHostElement(): HTMLElement | null;
|
|
15
|
+
imports: CanvasImportRegistry;
|
|
16
|
+
services: ProductServiceRegistry;
|
|
17
|
+
}
|
|
18
|
+
export interface CanvasPluginProvider {
|
|
19
|
+
id: string;
|
|
20
|
+
order?: number;
|
|
21
|
+
component: ComponentType<{
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface CanvasPluginComponent {
|
|
26
|
+
id: string;
|
|
27
|
+
order?: number;
|
|
28
|
+
component: ComponentType<CanvasPluginComponentProps>;
|
|
29
|
+
}
|
|
30
|
+
export interface CanvasPluginUiSetup {
|
|
31
|
+
addComponents(...components: readonly CanvasPluginComponent[]): void;
|
|
32
|
+
addProviders(...providers: readonly CanvasPluginProvider[]): void;
|
|
33
|
+
allowPropertiesDuringEditing(predicate: (context: CanvasActionContext) => boolean): void;
|
|
34
|
+
}
|
|
35
|
+
export declare const canvasKitUiExtension: import("../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginUiSetup>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
-
import { type CanvasActionContext, type CanvasActionRegistry, type CanvasContextMenuRegistry, type CanvasToolbarRegistry } from "../_vendor/canvas-
|
|
2
|
+
import { type CanvasActionContext, type CanvasActionRegistry, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry } from "../_vendor/canvas-product-contracts/index";
|
|
3
3
|
import { type CanvasRenderRuntime } from "../_vendor/canvas-react/host/index";
|
|
4
4
|
import { type ProductAssetResolverService, type ProductPersistenceAdapter, type ProductServiceRegistryRuntime, type ProductServiceToken } from "../core";
|
|
5
|
-
import type { SvgAssetInliner } from "../features/export/svgExport";
|
|
6
5
|
import { type CanvasKitController } from "../controller/canvasKitController";
|
|
7
6
|
import { createCanvasKitCommandExecutor } from "./canvasKitCommandExecutor";
|
|
8
7
|
import type { CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginProvider } from "./canvasKitPluginContracts";
|
|
8
|
+
import { PersistenceCoordinator } from "./persistenceCoordinator";
|
|
9
|
+
import { type CanvasKitResourceScope } from "./canvasKitResourceScope";
|
|
9
10
|
import type { CanvasKitChromeRenderer, CanvasKitDocumentSeed, CanvasKitRuntime, CanvasKitRuntimeOptions, CanvasKitStartupResult } from "./canvasKitRuntimeContracts";
|
|
10
11
|
export declare const CANVAS_KIT_STORAGE_NAMESPACE = "land.canvasKit";
|
|
11
12
|
type CanvasKitRuntimeLifecycleState = "created" | "starting" | "ready" | "failed" | "disposing" | "disposed";
|
|
@@ -17,26 +18,27 @@ export interface CanvasKitRuntimeInternals {
|
|
|
17
18
|
readonly cleanSessionSnapshot: unknown;
|
|
18
19
|
readonly controller: CanvasKitController;
|
|
19
20
|
readonly editor: Editor;
|
|
20
|
-
|
|
21
|
+
mountedOwner: object | null;
|
|
21
22
|
readonly persistence: ProductPersistenceAdapter | null;
|
|
23
|
+
readonly persistenceCoordinator: PersistenceCoordinator | null;
|
|
22
24
|
readonly productId: string;
|
|
25
|
+
readonly resources: CanvasKitResourceScope;
|
|
23
26
|
readonly render: {
|
|
24
27
|
readonly canvasRuntime: CanvasRenderRuntime;
|
|
25
28
|
readonly actionRegistry: CanvasActionRegistry;
|
|
29
|
+
readonly chromeRegistry: CanvasChromeRegistry;
|
|
26
30
|
readonly toolbarRegistry: CanvasToolbarRegistry;
|
|
27
31
|
readonly contextMenuRegistry: CanvasContextMenuRegistry;
|
|
32
|
+
readonly importRegistry: CanvasImportRegistry;
|
|
28
33
|
readonly executeCommand: ReturnType<typeof createCanvasKitCommandExecutor>;
|
|
29
34
|
readonly providers: readonly CanvasPluginProvider[];
|
|
30
35
|
readonly components: readonly CanvasPluginComponent[];
|
|
31
36
|
readonly chrome?: CanvasKitChromeRenderer;
|
|
32
|
-
|
|
33
|
-
canShowToolbarDuringEditing(context: CanvasActionContext): boolean;
|
|
37
|
+
canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
|
|
34
38
|
};
|
|
35
39
|
readonly seedDocument?: CanvasKitDocumentSeed;
|
|
36
40
|
readonly services: ProductServiceRegistryRuntime;
|
|
37
41
|
readonly shouldSkipStoredSnapshots?: () => boolean;
|
|
38
|
-
mountedOwner: object | null;
|
|
39
|
-
persistenceStop: (() => void) | null;
|
|
40
42
|
startPromise: Promise<CanvasKitStartupResult> | null;
|
|
41
43
|
state: CanvasKitRuntimeLifecycleState;
|
|
42
44
|
}
|
|
@@ -3,6 +3,7 @@ import type { ProductPersistenceAdapter } from "../core";
|
|
|
3
3
|
import type { CanvasKitChromeContext } from "../chrome/types";
|
|
4
4
|
import type { CanvasKitController } from "../controller/canvasKitController";
|
|
5
5
|
import type { CanvasPluginInput } from "./canvasKitPluginContracts";
|
|
6
|
+
import type { CanvasPluginStartupResult } from "./canvasKitPluginLifecycle";
|
|
6
7
|
export type CanvasKitChromeRenderer = (context: CanvasKitChromeContext<CanvasKitController>) => ReactNode;
|
|
7
8
|
export type CanvasKitDocumentSeed = (controller: CanvasKitController) => void;
|
|
8
9
|
export interface CanvasKitRuntimeOptions {
|
|
@@ -15,11 +16,7 @@ export interface CanvasKitRuntimeOptions {
|
|
|
15
16
|
plugins?: readonly CanvasPluginInput[];
|
|
16
17
|
storageNamespace?: string;
|
|
17
18
|
}
|
|
18
|
-
export
|
|
19
|
-
documentSource: "restored" | "seeded" | "empty";
|
|
20
|
-
sessionRestored: boolean;
|
|
21
|
-
warnings: readonly unknown[];
|
|
22
|
-
}
|
|
19
|
+
export type CanvasKitStartupResult = CanvasPluginStartupResult;
|
|
23
20
|
export interface CanvasKitRuntime {
|
|
24
21
|
readonly controller: CanvasKitController;
|
|
25
22
|
start(): Promise<CanvasKitStartupResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EditorPlugin, ShapeRecordBase } from "../_vendor/canvas-core/index";
|
|
2
|
+
import type { CanvasRenderPlugin } from "../_vendor/canvas-react/host/index";
|
|
3
|
+
import { type CanvasPlugin, type CanvasPluginCapabilityToken, type CanvasPluginInput } from "../_vendor/canvas-plugin-sdk/index";
|
|
4
|
+
type CanvasPluginSetupLike = (context: never) => unknown;
|
|
5
|
+
export interface CompiledCanvasPlugins<TSetup extends CanvasPluginSetupLike> {
|
|
6
|
+
readonly plugins: readonly CanvasPlugin<TSetup>[];
|
|
7
|
+
readonly pluginIds: readonly string[];
|
|
8
|
+
readonly editorPlugins: readonly EditorPlugin[];
|
|
9
|
+
readonly renderPlugins: readonly CanvasRenderPlugin[];
|
|
10
|
+
readonly shapeTypes: readonly ShapeRecordBase["type"][];
|
|
11
|
+
}
|
|
12
|
+
export declare function compileCanvasPlugins<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): CompiledCanvasPlugins<TSetup>;
|
|
13
|
+
export declare function assertValidCanvasPluginGraph<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): void;
|
|
14
|
+
export declare function hasCanvasPluginCapabilityProvider<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[], token: CanvasPluginCapabilityToken): boolean;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
2
|
+
import type { ProductPersistenceAdapter } from "../core/runtime/runtimeContracts";
|
|
3
|
+
export declare class PersistenceCoordinator {
|
|
4
|
+
private readonly editor;
|
|
5
|
+
private readonly adapter;
|
|
6
|
+
private unsubscribeDocument;
|
|
7
|
+
private unsubscribeSession;
|
|
8
|
+
private documentTimer;
|
|
9
|
+
private sessionTimer;
|
|
10
|
+
private pendingDocument;
|
|
11
|
+
private pendingSession;
|
|
12
|
+
private documentVersion;
|
|
13
|
+
private sessionVersion;
|
|
14
|
+
private documentRetryCount;
|
|
15
|
+
private sessionRetryCount;
|
|
16
|
+
private writeChain;
|
|
17
|
+
private isRunning;
|
|
18
|
+
constructor(editor: Editor, adapter: ProductPersistenceAdapter);
|
|
19
|
+
start(): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
flush(): Promise<void>;
|
|
22
|
+
private savePendingDocument;
|
|
23
|
+
private savePendingSession;
|
|
24
|
+
private queueWrite;
|
|
25
|
+
private scheduleDocumentSave;
|
|
26
|
+
private scheduleSessionSave;
|
|
27
|
+
private scheduleDocumentRetry;
|
|
28
|
+
private scheduleSessionRetry;
|
|
29
|
+
private cancelDocumentTimer;
|
|
30
|
+
private cancelSessionTimer;
|
|
31
|
+
private readonly flushWhenHidden;
|
|
32
|
+
private readonly flushWhenPageIsLeaving;
|
|
33
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CanvasAction, type CanvasActionRegistry } from "../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
export interface CanvasActionRegistryRuntime extends CanvasActionRegistry {
|
|
3
|
+
registerAction(action: CanvasAction): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createCanvasActionRegistry(actions?: readonly CanvasAction[]): CanvasActionRegistryRuntime;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CanvasContextMenuRegistry, type ContextMenuContribution } from "../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
export interface CanvasContextMenuRegistryRuntime extends CanvasContextMenuRegistry {
|
|
3
|
+
registerContribution(contribution: ContextMenuContribution): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createCanvasContextMenuRegistry(contributions?: readonly ContextMenuContribution[]): CanvasContextMenuRegistryRuntime;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProductApiRegistry, type ProductApiToken } from "../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
export interface ProductApiRegistryRuntime extends ProductApiRegistry {
|
|
3
|
+
register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CanvasToolbarRegistry, type ToolbarContribution } from "../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
export interface CanvasToolbarRegistryRuntime extends CanvasToolbarRegistry {
|
|
3
|
+
registerContribution(contribution: ToolbarContribution): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createCanvasToolbarRegistry(contributions?: readonly ToolbarContribution[]): CanvasToolbarRegistryRuntime;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CanvasAction } from "./actions";
|
|
2
|
-
export declare class CanvasActionRegistry {
|
|
3
|
-
private readonly actions;
|
|
4
|
-
registerAction(action: CanvasAction): void;
|
|
5
|
-
getAction(actionId: string): CanvasAction | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function createCanvasActionRegistry(actions?: readonly CanvasAction[]): CanvasActionRegistry;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection } from "./contextMenu";
|
|
2
|
-
export declare class CanvasContextMenuRegistry {
|
|
3
|
-
private readonly contributions;
|
|
4
|
-
private readonly contributionsByTarget;
|
|
5
|
-
private readonly contributionIndexes;
|
|
6
|
-
private nextContributionIndex;
|
|
7
|
-
registerContribution(contribution: ContextMenuContribution): void;
|
|
8
|
-
getSections(target: ContextMenuContributionTarget, context: ContextMenuContext): ContextMenuSection[];
|
|
9
|
-
private addToIndex;
|
|
10
|
-
}
|
|
11
|
-
export declare function createCanvasContextMenuRegistry(contributions?: readonly ContextMenuContribution[]): CanvasContextMenuRegistry;
|