@yuzhouu/canvas-kit 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -35
- package/_vendor/canvas-core/bindings/bindingUtil.d.ts +15 -0
- package/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
- package/_vendor/canvas-core/editor/bindingReactionScope.d.ts +7 -0
- package/_vendor/canvas-core/editor/commands.d.ts +3 -3
- package/_vendor/canvas-core/editor/editor.d.ts +20 -5
- package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +1 -0
- package/_vendor/canvas-core/editor/historyManager.d.ts +2 -5
- package/_vendor/canvas-core/editor/interactions.d.ts +33 -9
- package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +1 -6
- package/_vendor/canvas-core/editor/managers/queryManager.d.ts +13 -0
- package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +3 -0
- package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
- package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +1 -0
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
- package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
- package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
- package/_vendor/canvas-core/editor/selectionOverlay.d.ts +3 -1
- package/_vendor/canvas-core/exports/svg.d.ts +2 -3
- package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
- package/_vendor/canvas-core/index.d.ts +9 -5
- package/_vendor/canvas-core/shapes/colors.d.ts +2 -1
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +47 -1
- package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +9 -2
- package/_vendor/canvas-core/tools/select/states/{draggingSelectionHandleInteractionState.d.ts → draggingPluginInteractionState.d.ts} +5 -4
- package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +2 -2
- package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
- package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
- package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
- package/_vendor/canvas-plugin-sdk/actions.d.ts +19 -2
- package/_vendor/canvas-plugin-sdk/capability.d.ts +16 -0
- package/_vendor/canvas-plugin-sdk/chrome.d.ts +52 -0
- package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +15 -0
- package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +9 -0
- package/_vendor/canvas-plugin-sdk/exports.d.ts +26 -0
- package/_vendor/canvas-plugin-sdk/importRegistry.d.ts +10 -0
- package/_vendor/canvas-plugin-sdk/imports.d.ts +38 -0
- package/_vendor/canvas-plugin-sdk/index.d.ts +11 -0
- package/_vendor/canvas-plugin-sdk/lifecycle.d.ts +31 -0
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +54 -17
- package/_vendor/canvas-plugin-sdk/pluginUi.d.ts +37 -0
- package/_vendor/canvas-plugin-sdk/productApi.d.ts +28 -0
- package/_vendor/canvas-plugin-sdk/services.d.ts +20 -0
- package/_vendor/canvas-plugin-sdk/toolbar.d.ts +26 -4
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +5 -6
- package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +15 -4
- package/_vendor/canvas-react/host/index.d.ts +2 -2
- package/_vendor/plugin-arrow/api.d.ts +33 -0
- package/_vendor/plugin-arrow/arrowGeometry.d.ts +2 -1
- package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
- package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +2 -1
- package/_vendor/plugin-arrow/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-arrow/feature.d.ts +2 -2
- package/_vendor/plugin-arrow/index.d.ts +4 -1
- package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
- package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +2 -0
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContextMenuContributions.d.ts +1 -1
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContribution.d.ts +2 -3
- package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardService.d.ts +3 -3
- package/_vendor/plugin-builtin-clipboard/index.d.ts +3 -0
- package/_vendor/plugin-builtin-clipboard/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-export/blobDataUrl.d.ts +1 -0
- package/_vendor/plugin-builtin-export/canvasExportApi.d.ts +43 -0
- package/_vendor/plugin-builtin-export/index.d.ts +8 -0
- package/_vendor/plugin-builtin-export/plugin.d.ts +5 -0
- package/_vendor/plugin-builtin-export/pngExport.d.ts +15 -0
- package/{features/export → _vendor/plugin-builtin-export}/svgExport.d.ts +9 -2
- package/_vendor/plugin-builtin-import-host/CanvasImportHost.d.ts +3 -0
- package/_vendor/plugin-builtin-import-host/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-import-host/index.d.ts +2 -0
- package/_vendor/plugin-builtin-import-host/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/capability.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/index.d.ts +2 -0
- package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +1 -0
- package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +2 -0
- package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
- package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
- package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
- package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
- package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
- package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
- package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
- package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
- package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
- package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
- package/_vendor/plugin-connector/connectorRuntime.d.ts +62 -0
- package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
- package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
- package/_vendor/plugin-connector/constants.d.ts +17 -0
- package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
- package/_vendor/plugin-connector/feature.d.ts +4 -0
- package/_vendor/plugin-connector/index.d.ts +18 -0
- package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
- package/_vendor/plugin-connector/productRuntime.d.ts +2 -0
- package/_vendor/plugin-connector/quickConnect.d.ts +28 -0
- package/_vendor/plugin-connector/types.d.ts +51 -0
- package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-draw/drawPath.d.ts +7 -1
- package/_vendor/plugin-draw/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-draw/feature.d.ts +2 -2
- package/_vendor/plugin-draw/index.d.ts +2 -1
- package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
- package/_vendor/plugin-eraser/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-eraser/feature.d.ts +2 -2
- package/_vendor/plugin-eraser/index.d.ts +2 -1
- package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
- package/_vendor/plugin-frame/api.d.ts +19 -0
- package/_vendor/plugin-frame/canvasRender.d.ts +3 -3
- package/_vendor/plugin-frame/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-frame/feature.d.ts +2 -2
- package/_vendor/plugin-frame/frameShapeUtil.d.ts +8 -0
- package/_vendor/plugin-frame/index.d.ts +4 -1
- package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/api.d.ts +27 -0
- package/_vendor/plugin-geo/canvasRender.d.ts +3 -3
- package/_vendor/plugin-geo/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-geo/feature.d.ts +2 -2
- package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
- package/_vendor/plugin-geo/geoTools.d.ts +1 -1
- package/_vendor/plugin-geo/index.d.ts +7 -4
- package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
- package/_vendor/plugin-geo/types.d.ts +5 -1
- package/_vendor/plugin-group/canvasRender.d.ts +1 -2
- package/_vendor/plugin-group/editorRuntime.d.ts +0 -2
- package/_vendor/plugin-group/feature.d.ts +2 -2
- package/_vendor/plugin-group/index.d.ts +2 -1
- package/_vendor/plugin-group/productRuntime.d.ts +2 -0
- package/_vendor/plugin-image/editorRuntime.d.ts +0 -4
- package/_vendor/plugin-image/feature.d.ts +2 -2
- package/_vendor/plugin-image/index.d.ts +2 -1
- package/_vendor/plugin-image/productRuntime.d.ts +4 -0
- package/_vendor/plugin-image/styleRuntime.d.ts +5 -0
- package/_vendor/plugin-laser/editorRuntime.d.ts +1 -3
- package/_vendor/plugin-laser/feature.d.ts +2 -2
- package/_vendor/plugin-laser/index.d.ts +2 -1
- package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
- package/{builtins/controller/packagingController.d.ts → _vendor/plugin-packaging/api.d.ts} +13 -10
- package/_vendor/plugin-packaging/feature.d.ts +2 -2
- package/_vendor/plugin-packaging/index.d.ts +3 -1
- package/_vendor/plugin-packaging/productRuntime.d.ts +2 -2
- package/_vendor/plugin-path/PathShapeRenderer.d.ts +5 -2
- package/_vendor/plugin-path/editorRuntime.d.ts +1 -15
- package/_vendor/plugin-path/feature.d.ts +2 -2
- package/_vendor/plugin-path/index.d.ts +2 -1
- package/_vendor/plugin-path/pathHistory.d.ts +13 -0
- package/_vendor/plugin-path/pathShapeUtil.d.ts +3 -1
- package/_vendor/plugin-path/pathTool.d.ts +3 -0
- package/_vendor/plugin-path/productRuntime.d.ts +15 -0
- package/_vendor/plugin-text/api.d.ts +20 -0
- package/_vendor/plugin-text/capabilities.d.ts +2 -0
- package/_vendor/plugin-text/editorRuntime.d.ts +2 -8
- package/_vendor/plugin-text/feature.d.ts +1 -1
- package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +0 -2
- package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +1 -1
- package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -1
- package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
- package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
- package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
- package/_vendor/plugin-text/index.d.ts +7 -3
- package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
- package/_vendor/plugin-text/productRuntime.d.ts +6 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +3 -2
- package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +4 -0
- package/_vendor/plugin-text/textFormatting.d.ts +2 -0
- package/_vendor/plugin-text/textLabelHelpers.d.ts +23 -2
- package/_vendor/plugin-text/textShapeUtil.d.ts +5 -2
- package/_vendor/plugin-text/textTypes.d.ts +1 -0
- package/_vendor/signals/core.d.ts +1 -0
- package/_vendor/signals/index.d.ts +1 -1
- package/_vendor/store/history.d.ts +1 -1
- package/_vendor/store/store.d.ts +2 -0
- package/browser/indexedDb.d.ts +10 -10
- package/browser/persistence.d.ts +4 -25
- package/chrome/floating/useCanvasKitFloatingPosition.d.ts +1 -1
- package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
- package/chrome/toolbar/useToolbarSurfaces.d.ts +9 -10
- package/chrome/types.d.ts +11 -8
- package/chrome/useCanvasKitChromeContext.d.ts +4 -7
- package/chrome/useChromeSurfaces.d.ts +12 -0
- package/controller/canvasKitController.d.ts +4 -11
- package/core/index.d.ts +3 -4
- package/core/product-controller/canvasProductController.d.ts +40 -11
- package/core/product-controller/index.d.ts +1 -1
- package/core/runtime/productServices.d.ts +5 -19
- package/core/runtime/runtimeContracts.d.ts +3 -3
- package/features/image/asset/imageAssetService.d.ts +2 -3
- package/features/image/asset/imageBlobStore.d.ts +1 -0
- package/features/image/asset/imageFileHelpers.d.ts +0 -6
- package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
- package/features/image/controller/imageProductController.d.ts +2 -2
- package/features/image/imageHostPlugin.d.ts +1 -0
- package/features/image/import/ImageImportController.d.ts +3 -1
- package/features/image/index.d.ts +1 -3
- package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
- package/features/image/toolbar/imageHostActions.d.ts +7 -8
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/text/{textProductPlugin.d.ts → textHostPlugin.d.ts} +1 -1
- package/features/text/textSvgAssetInliner.d.ts +3 -0
- package/features/text/textSvgAssetPlugin.d.ts +2 -0
- package/index.css +1 -1
- package/index.d.ts +28 -18
- package/index.mjs +111 -84
- package/package.json +1 -1
- package/plugins/standardCanvasKitPlugins.d.ts +16 -0
- package/runtime/canvasKitPluginContracts.d.ts +31 -76
- package/runtime/canvasKitPluginSetup.d.ts +32 -0
- package/runtime/canvasKitResourceScope.d.ts +5 -0
- package/runtime/canvasKitRuntime.d.ts +9 -7
- package/runtime/canvasKitRuntimeContracts.d.ts +2 -5
- package/runtime/persistenceCoordinator.d.ts +33 -0
- package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -47
- package/builtins/controller/createBuiltInCanvasController.d.ts +0 -18
- package/builtins/controller/layerController.d.ts +0 -9
- package/builtins/controller/shapeCreationController.d.ts +0 -83
- package/builtins/index.d.ts +0 -7
- package/builtins/plugins.d.ts +0 -16
- package/chrome/useSvgExport.d.ts +0 -15
- package/core/api/apiRegistry.d.ts +0 -12
- package/features/actions/actionRuntime.d.ts +0 -16
- package/features/clipboard/clipboardPlugin.d.ts +0 -1
- package/features/image/imageProductPlugin.d.ts +0 -1
- package/features/image/import/useImageImport.d.ts +0 -16
- package/features/keyboard/keyboardShortcutPlugin.d.ts +0 -1
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -8
- package/features/selection/selectionActions.d.ts +0 -19
- package/features/selection/selectionContextMenuContributions.d.ts +0 -2
- package/features/selection/selectionPlugin.d.ts +0 -1
- package/features/selection/selectionToolbarContributions.d.ts +0 -2
- package/features/tool/toolActions.d.ts +0 -2
- package/features/tool/toolContextMenuContributions.d.ts +0 -2
- package/features/tool/toolPlugin.d.ts +0 -1
- package/features/tool/toolToolbarContributions.d.ts +0 -2
- package/features/view/viewActions.d.ts +0 -5
- package/features/view/viewContextMenuContributions.d.ts +0 -2
- package/features/view/viewPlugin.d.ts +0 -1
- package/product/standardCanvasKitPlugins.d.ts +0 -4
- package/runtime/canvasKitPlugins.d.ts +0 -33
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TextPluginOptions } from "../_vendor/plugin-text/index";
|
|
2
|
+
import type { CanvasPlugin } from "../runtime/canvasKitPluginContracts";
|
|
3
|
+
export interface CanvasKitStandardPluginOptions {
|
|
4
|
+
arrow?: boolean;
|
|
5
|
+
connector?: boolean;
|
|
6
|
+
draw?: boolean;
|
|
7
|
+
eraser?: boolean;
|
|
8
|
+
frame?: boolean;
|
|
9
|
+
geo?: boolean;
|
|
10
|
+
group?: boolean;
|
|
11
|
+
image?: boolean;
|
|
12
|
+
laser?: boolean;
|
|
13
|
+
path?: boolean;
|
|
14
|
+
text?: boolean | Partial<TextPluginOptions>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createStandardCanvasKitPlugins(options?: CanvasKitStandardPluginOptions): readonly CanvasPlugin[];
|
|
@@ -1,79 +1,34 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import type { ExecuteCanvasKitCommand } from "./canvasKitCommandExecutor";
|
|
7
|
-
import type { CanvasKitStartupResult } from "./canvasKitRuntimeContracts";
|
|
8
|
-
export interface CanvasProductFactoryContext {
|
|
9
|
-
persistence: ProductPersistenceAdapter | null;
|
|
1
|
+
import { type CanvasPluginBeforeCommand as SdkCanvasPluginBeforeCommand, type CanvasPluginBeforeCommandContext as SdkCanvasPluginBeforeCommandContext, type CanvasPluginBeforeReady as SdkCanvasPluginBeforeReady, type CanvasPluginBeforeReadyContext as SdkCanvasPluginBeforeReadyContext, type CanvasPluginComponent as SdkCanvasPluginComponent, type CanvasPluginComponentProps as SdkCanvasPluginComponentProps, type CanvasPluginProvider as SdkCanvasPluginProvider, type CanvasPluginLifecycleSetup as SdkCanvasPluginLifecycleSetup, type CanvasPluginPersistence as SdkCanvasPluginPersistence, type CanvasPluginUiSetup as SdkCanvasPluginUiSetup, type CanvasPluginApi as SdkCanvasPluginApi, type CanvasPluginApiContext, type CanvasPlugin as SdkCanvasPlugin, type CanvasPluginDefinition as SdkCanvasPluginDefinition, type CanvasPluginSetup as SdkCanvasPluginSetup, type CanvasPluginSetupContext as SdkCanvasPluginSetupContext } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import type { ProductAssetResolverService, ProductServiceRegistry, ProductServiceToken } from "../core";
|
|
3
|
+
import type { SvgAssetInliner } from "../_vendor/plugin-builtin-export/index";
|
|
4
|
+
export type CanvasPluginApi<TApi> = SdkCanvasPluginApi<TApi, CanvasPluginContext>;
|
|
5
|
+
export interface CanvasPluginContext extends CanvasPluginApiContext {
|
|
10
6
|
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
7
|
services: ProductServiceRegistry;
|
|
46
8
|
}
|
|
47
|
-
export interface
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}>;
|
|
74
|
-
}
|
|
75
|
-
export interface CanvasPluginComponent {
|
|
76
|
-
id: string;
|
|
77
|
-
order?: number;
|
|
78
|
-
component: ComponentType<CanvasPluginComponentProps>;
|
|
79
|
-
}
|
|
9
|
+
export interface CanvasKitPluginAssetSetup {
|
|
10
|
+
addResolver(token: ProductServiceToken<ProductAssetResolverService>): void;
|
|
11
|
+
addSvgInliners(...inliners: readonly SvgAssetInliner[]): void;
|
|
12
|
+
}
|
|
13
|
+
export type CanvasKitPluginLifecycleSetup = SdkCanvasPluginLifecycleSetup;
|
|
14
|
+
export type CanvasKitPluginUiSetup = SdkCanvasPluginUiSetup;
|
|
15
|
+
export type CanvasKitPluginPersistence = SdkCanvasPluginPersistence;
|
|
16
|
+
export interface CanvasKitPluginSetupContext extends SdkCanvasPluginSetupContext<CanvasPluginContext> {
|
|
17
|
+
readonly assets: CanvasKitPluginAssetSetup;
|
|
18
|
+
}
|
|
19
|
+
export type CanvasKitPluginSetup = SdkCanvasPluginSetup<CanvasKitPluginSetupContext>;
|
|
20
|
+
export type CanvasPlugin = Omit<SdkCanvasPlugin<CanvasKitPluginSetup>, "editor" | "render" | "setup"> & {
|
|
21
|
+
readonly editor?: unknown;
|
|
22
|
+
readonly render?: unknown;
|
|
23
|
+
readonly setup?: (...args: never[]) => unknown;
|
|
24
|
+
};
|
|
25
|
+
export type CanvasPluginDefinition = SdkCanvasPluginDefinition<CanvasKitPluginSetup>;
|
|
26
|
+
export type CanvasPluginInput = CanvasPlugin | readonly CanvasPluginInput[];
|
|
27
|
+
export declare function defineCanvasPlugin(plugin: CanvasPluginDefinition): CanvasPlugin;
|
|
28
|
+
export type CanvasPluginBeforeReadyContext = SdkCanvasPluginBeforeReadyContext;
|
|
29
|
+
export type CanvasPluginBeforeCommandContext = SdkCanvasPluginBeforeCommandContext;
|
|
30
|
+
export type CanvasPluginBeforeReady = SdkCanvasPluginBeforeReady;
|
|
31
|
+
export type CanvasPluginBeforeCommand = SdkCanvasPluginBeforeCommand;
|
|
32
|
+
export type CanvasPluginComponentProps = SdkCanvasPluginComponentProps;
|
|
33
|
+
export type CanvasPluginProvider = SdkCanvasPluginProvider;
|
|
34
|
+
export type CanvasPluginComponent = SdkCanvasPluginComponent;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createCanvasActionRegistry, type CanvasActionContext, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasPlugin as SdkCanvasPlugin, type CanvasToolbarRegistry, type ProductApiRegistry } from "../_vendor/canvas-plugin-sdk/index";
|
|
2
|
+
import type { Editor } from "../_vendor/canvas-core/index";
|
|
3
|
+
import type { ProductAssetResolverService, ProductServiceRegistryRuntime, ProductServiceToken } from "../core";
|
|
4
|
+
import type { SvgAssetInliner } from "../_vendor/plugin-builtin-export/index";
|
|
5
|
+
import type { CanvasKitPluginSetup, CanvasKitPluginPersistence, CanvasPluginBeforeCommand, CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginProvider } from "./canvasKitPluginContracts";
|
|
6
|
+
export interface CanvasKitPluginSetupResult {
|
|
7
|
+
readonly actionRegistry: ReturnType<typeof createCanvasActionRegistry>;
|
|
8
|
+
readonly apis: ProductApiRegistry;
|
|
9
|
+
readonly assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
|
|
10
|
+
readonly beforeCommandHooks: readonly CanvasPluginBeforeCommand[];
|
|
11
|
+
readonly beforeReadyHooks: readonly CanvasPluginBeforeReady[];
|
|
12
|
+
readonly components: readonly CanvasPluginComponent[];
|
|
13
|
+
readonly chromeRegistry: CanvasChromeRegistry;
|
|
14
|
+
readonly contextMenuRegistry: CanvasContextMenuRegistry;
|
|
15
|
+
readonly importRegistry: CanvasImportRegistry;
|
|
16
|
+
readonly providers: readonly CanvasPluginProvider[];
|
|
17
|
+
readonly toolbarRegistry: CanvasToolbarRegistry;
|
|
18
|
+
canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface CanvasKitPluginSetupSession {
|
|
21
|
+
install(plugin: SdkCanvasPlugin<CanvasKitPluginSetup>): void;
|
|
22
|
+
seal(): CanvasKitPluginSetupResult;
|
|
23
|
+
}
|
|
24
|
+
export declare function createCanvasKitPluginSetupSession({ assetResolverTokens, defer, editor, persistence, productId, services, svgAssetInliners, }: {
|
|
25
|
+
assetResolverTokens: ProductServiceToken<ProductAssetResolverService>[];
|
|
26
|
+
defer(dispose: () => void): void;
|
|
27
|
+
editor: Editor;
|
|
28
|
+
persistence: CanvasKitPluginPersistence | null;
|
|
29
|
+
productId: string;
|
|
30
|
+
services: ProductServiceRegistryRuntime;
|
|
31
|
+
svgAssetInliners: SvgAssetInliner[];
|
|
32
|
+
}): CanvasKitPluginSetupSession;
|
|
@@ -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-plugin-sdk/index";
|
|
2
|
+
import { type CanvasActionContext, type CanvasActionRegistry, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry } from "../_vendor/canvas-plugin-sdk/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 "../_vendor/canvas-plugin-sdk/index";
|
|
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,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
|
+
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BindingUtil, type BindingRecordBase, type BindingUtilEffect, type BindingSelectionCompanionFrameContext, type Editor, type SelectionOverlayFrameGeometryState, type ShapeRecord } from "../canvas-core/index";
|
|
2
|
-
import { ARROW_LABEL_BINDING_TYPE } from "./textLabelHelpers";
|
|
3
|
-
import type { TextShapeRecord } from "./textTypes";
|
|
4
|
-
export declare const ARROW_LABEL_WIDTH = 120;
|
|
5
|
-
export declare const ARROW_LABEL_MIN_WIDTH = 24;
|
|
6
|
-
export declare const ARROW_LABEL_INDEX_SUFFIX = ".label";
|
|
7
|
-
export interface ArrowLabelBindingProps {
|
|
8
|
-
labelPosition: number;
|
|
9
|
-
}
|
|
10
|
-
export interface ArrowLabelBindingRecord extends BindingRecordBase<typeof ARROW_LABEL_BINDING_TYPE, ArrowLabelBindingProps> {
|
|
11
|
-
type: typeof ARROW_LABEL_BINDING_TYPE;
|
|
12
|
-
props: ArrowLabelBindingProps;
|
|
13
|
-
}
|
|
14
|
-
export declare class ArrowLabelBindingUtil extends BindingUtil<ArrowLabelBindingRecord> {
|
|
15
|
-
readonly type = "arrow-label";
|
|
16
|
-
getDefaultProps(): ArrowLabelBindingProps;
|
|
17
|
-
validateProps(props: unknown): ArrowLabelBindingProps;
|
|
18
|
-
canBind(_editor: Editor, binding: ArrowLabelBindingRecord, context: {
|
|
19
|
-
fromShape: ShapeRecord;
|
|
20
|
-
toShape: ShapeRecord;
|
|
21
|
-
}): boolean;
|
|
22
|
-
canUseShapeHierarchy(_binding: ArrowLabelBindingRecord, context: {
|
|
23
|
-
fromShape: ShapeRecord;
|
|
24
|
-
toShape: ShapeRecord;
|
|
25
|
-
}): boolean;
|
|
26
|
-
getExclusiveBindingKey(binding: ArrowLabelBindingRecord): string;
|
|
27
|
-
onBindingCreate(editor: Editor, binding: ArrowLabelBindingRecord): BindingUtilEffect | void;
|
|
28
|
-
onBindingUpdate(editor: Editor, _before: ArrowLabelBindingRecord, after: ArrowLabelBindingRecord): BindingUtilEffect | void;
|
|
29
|
-
onBindingLoad(editor: Editor, binding: ArrowLabelBindingRecord): BindingUtilEffect | void;
|
|
30
|
-
getGeometryDependentShapeIds(_editor: Editor, binding: ArrowLabelBindingRecord, context: {
|
|
31
|
-
role: "from" | "to";
|
|
32
|
-
}): ShapeRecord["id"][];
|
|
33
|
-
onAfterShapeChange(editor: Editor, binding: ArrowLabelBindingRecord, _context: {
|
|
34
|
-
role: "from" | "to";
|
|
35
|
-
}): BindingUtilEffect | void;
|
|
36
|
-
onBeforeDeleteShape(_editor: Editor, binding: ArrowLabelBindingRecord, context: {
|
|
37
|
-
role: "from" | "to";
|
|
38
|
-
}): BindingUtilEffect | void;
|
|
39
|
-
onBeforeDeleteBinding(_editor: Editor, binding: ArrowLabelBindingRecord): BindingUtilEffect | void;
|
|
40
|
-
getExportShapeIds(_editor: Editor, binding: ArrowLabelBindingRecord): TextShapeRecord["id"][];
|
|
41
|
-
getShapeHierarchyRootId(binding: ArrowLabelBindingRecord, shapeId: ShapeRecord["id"]): ShapeRecord["id"] | null;
|
|
42
|
-
getSelectionCompanionFrameGeometries(editor: Editor, binding: ArrowLabelBindingRecord, context: BindingSelectionCompanionFrameContext): SelectionOverlayFrameGeometryState[];
|
|
43
|
-
private syncLabelPosition;
|
|
44
|
-
}
|
|
45
|
-
export declare function getArrowLabelLayout(editor: Editor, label: TextShapeRecord, owner: ShapeRecord): Pick<TextShapeRecord, "x" | "y" | "rotation"> & {
|
|
46
|
-
props: Pick<TextShapeRecord["props"], "w">;
|
|
47
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ShapeId } from "../../_vendor/canvas-core/index";
|
|
2
|
-
import type { CanvasProductController, CanvasProductControllerSnapshot, CanvasProductControllerOptions, CanvasProductSessionSnapshot } from "../../core/product-controller";
|
|
3
|
-
import { type BuiltInCanvasShapeCreationControllers } from "./shapeCreationController";
|
|
4
|
-
import { type BuiltInCanvasLayerNode } from "./layerController";
|
|
5
|
-
import { type PackagingController } from "./packagingController";
|
|
6
|
-
export interface BuiltInCanvasControllerSnapshot<TToolId extends string = string> extends CanvasProductControllerSnapshot<TToolId> {
|
|
7
|
-
productId: string;
|
|
8
|
-
session: CanvasProductSessionSnapshot<TToolId>;
|
|
9
|
-
}
|
|
10
|
-
export interface BuiltInCanvasController<TToolId extends string = string> extends CanvasProductController<TToolId>, BuiltInCanvasShapeCreationControllers {
|
|
11
|
-
packaging: PackagingController | null;
|
|
12
|
-
snapshot(): BuiltInCanvasControllerSnapshot<TToolId>;
|
|
13
|
-
getLayerTree(pageId?: string): BuiltInCanvasLayerNode[];
|
|
14
|
-
getLayerNode(id: ShapeId): BuiltInCanvasLayerNode | null;
|
|
15
|
-
}
|
|
16
|
-
export declare function createBuiltInCanvasController<TToolId extends string = string>(options: CanvasProductControllerOptions<TToolId>): BuiltInCanvasController<TToolId>;
|
|
17
|
-
export declare function useBuiltInCanvasController<TToolId extends string = string>(options: CanvasProductControllerOptions<TToolId>): BuiltInCanvasController<TToolId>;
|
|
18
|
-
export type { BuiltInCanvasLayerNode } from "./layerController";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
-
import type { GeoShapeKind } from "../../_vendor/plugin-geo/index";
|
|
3
|
-
import type { CanvasProductLayerNode } from "../../core/product-controller";
|
|
4
|
-
export interface BuiltInCanvasLayerNode extends CanvasProductLayerNode {
|
|
5
|
-
geoKind?: GeoShapeKind;
|
|
6
|
-
imageAssetId?: AssetId | null;
|
|
7
|
-
imageThumbnailSrc?: string | null;
|
|
8
|
-
}
|
|
9
|
-
export declare function withBuiltInLayerNames(editor: Editor, node: CanvasProductLayerNode): BuiltInCanvasLayerNode;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { Editor, ShapeColor, ShapeId } from "../../_vendor/canvas-core/index";
|
|
2
|
-
import { type ArrowShapeProps } from "../../_vendor/plugin-arrow/index";
|
|
3
|
-
import type { GeoShapeProps } from "../../_vendor/plugin-geo/index";
|
|
4
|
-
import { type TextShapeProps } from "../../_vendor/plugin-text/index";
|
|
5
|
-
import type { CanvasProductShapeRef } from "../../core/product-controller";
|
|
6
|
-
export interface BuiltInCanvasShapeInput {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
w?: number;
|
|
10
|
-
h?: number;
|
|
11
|
-
fill?: ShapeColor;
|
|
12
|
-
stroke?: ShapeColor;
|
|
13
|
-
strokeWidth?: number;
|
|
14
|
-
meta?: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
export interface BuiltInCanvasRectangleInput extends BuiltInCanvasShapeInput {
|
|
17
|
-
cornerRadiusPercent?: GeoShapeProps["cornerRadiusPercent"];
|
|
18
|
-
}
|
|
19
|
-
export interface BuiltInCanvasTextInput {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
text: string;
|
|
23
|
-
w?: number;
|
|
24
|
-
h?: number;
|
|
25
|
-
font?: TextShapeProps["font"];
|
|
26
|
-
color?: ShapeColor;
|
|
27
|
-
size?: TextShapeProps["size"];
|
|
28
|
-
textAlign?: TextShapeProps["textAlign"];
|
|
29
|
-
meta?: Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
export interface BuiltInCanvasFrameInput extends BuiltInCanvasShapeInput {
|
|
32
|
-
name?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface BuiltInCanvasArrowBindingInput {
|
|
35
|
-
targetShapeId: ShapeId;
|
|
36
|
-
normalizedAnchor: {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export interface BuiltInCanvasArrowInput {
|
|
42
|
-
start: {
|
|
43
|
-
x: number;
|
|
44
|
-
y: number;
|
|
45
|
-
};
|
|
46
|
-
end: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
};
|
|
50
|
-
bend?: number;
|
|
51
|
-
stroke?: ShapeColor;
|
|
52
|
-
strokeWidth?: number;
|
|
53
|
-
headStart?: ArrowShapeProps["headStart"];
|
|
54
|
-
headEnd?: ArrowShapeProps["headEnd"];
|
|
55
|
-
startBinding?: BuiltInCanvasArrowBindingInput | null;
|
|
56
|
-
endBinding?: BuiltInCanvasArrowBindingInput | null;
|
|
57
|
-
meta?: Record<string, unknown>;
|
|
58
|
-
}
|
|
59
|
-
export interface BuiltInGeoController {
|
|
60
|
-
createRectangle(input: BuiltInCanvasRectangleInput): CanvasProductShapeRef | null;
|
|
61
|
-
createEllipse(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
|
|
62
|
-
createDiamond(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
|
|
63
|
-
createTriangle(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
|
|
64
|
-
createHexagon(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
|
|
65
|
-
createStar(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
|
|
66
|
-
}
|
|
67
|
-
export interface BuiltInTextController {
|
|
68
|
-
create(input: BuiltInCanvasTextInput): CanvasProductShapeRef | null;
|
|
69
|
-
}
|
|
70
|
-
export interface BuiltInFrameController {
|
|
71
|
-
create(input: BuiltInCanvasFrameInput): CanvasProductShapeRef | null;
|
|
72
|
-
moveShapesToFrame(ids: ShapeId[], frameId: ShapeId): ShapeId[];
|
|
73
|
-
}
|
|
74
|
-
export interface BuiltInArrowController {
|
|
75
|
-
create(input: BuiltInCanvasArrowInput): CanvasProductShapeRef | null;
|
|
76
|
-
}
|
|
77
|
-
export interface BuiltInCanvasShapeCreationControllers {
|
|
78
|
-
arrow: BuiltInArrowController;
|
|
79
|
-
geo: BuiltInGeoController;
|
|
80
|
-
text: BuiltInTextController;
|
|
81
|
-
frame: BuiltInFrameController;
|
|
82
|
-
}
|
|
83
|
-
export declare function createBuiltInShapeCreationControllers(editor: Editor): BuiltInCanvasShapeCreationControllers;
|
package/builtins/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { builtInCanvasPlugins, createBuiltInCanvasPlugins, } from "./plugins";
|
|
2
|
-
export type { BuiltInCanvasPlugin, BuiltInCanvasPluginOptions, } from "./plugins";
|
|
3
|
-
export { createBuiltInCanvasController, useBuiltInCanvasController, } from "./controller/createBuiltInCanvasController";
|
|
4
|
-
export type { BuiltInCanvasController, BuiltInCanvasControllerSnapshot, BuiltInCanvasLayerNode, } from "./controller/createBuiltInCanvasController";
|
|
5
|
-
export type { BuiltInArrowController, BuiltInCanvasArrowBindingInput, BuiltInCanvasArrowInput, BuiltInCanvasFrameInput, BuiltInCanvasRectangleInput, BuiltInCanvasShapeCreationControllers, BuiltInCanvasShapeInput, BuiltInCanvasTextInput, BuiltInFrameController, BuiltInGeoController, BuiltInTextController, } from "./controller/shapeCreationController";
|
|
6
|
-
export { createPackagingController } from "./controller/packagingController";
|
|
7
|
-
export type { CanvasKitPackagingDxfImportInput, CanvasKitPackagingInput, PackagingController, } from "./controller/packagingController";
|
package/builtins/plugins.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type TextPluginOptions } from "../_vendor/plugin-text/index";
|
|
2
|
-
export interface BuiltInCanvasPluginOptions {
|
|
3
|
-
arrow?: boolean;
|
|
4
|
-
draw?: boolean;
|
|
5
|
-
eraser?: boolean;
|
|
6
|
-
frame?: boolean;
|
|
7
|
-
geo?: boolean;
|
|
8
|
-
group?: boolean;
|
|
9
|
-
image?: boolean;
|
|
10
|
-
laser?: boolean;
|
|
11
|
-
path?: boolean;
|
|
12
|
-
text?: boolean | Partial<TextPluginOptions>;
|
|
13
|
-
}
|
|
14
|
-
export declare const builtInCanvasPlugins: readonly [import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-geo/index").createGeoProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-draw/index").createDrawProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-arrow/index").createArrowProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-eraser/index").createEraserProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-laser/index").createLaserProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-path/index").createPathProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-image/index").createImageProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<import("../_vendor/canvas-plugin-sdk/index").CanvasProductFactory>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-frame/index").createFrameProductContribution>, import("../_vendor/canvas-plugin-sdk/index").CanvasPlugin<typeof import("../_vendor/plugin-group/index").createGroupProductContribution>];
|
|
15
|
-
export type BuiltInCanvasPlugin = (typeof builtInCanvasPlugins)[number];
|
|
16
|
-
export declare function createBuiltInCanvasPlugins(options?: BuiltInCanvasPluginOptions): readonly BuiltInCanvasPlugin[];
|
package/chrome/useSvgExport.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type RefObject } from "react";
|
|
2
|
-
import type { Editor, ShapeId } from "../_vendor/canvas-core/index";
|
|
3
|
-
import { type ExportStatus as ProductExportStatus, type SvgAssetInliner as ProductSvgAssetInliner, type SvgExportResult as ProductSvgExportResult } from "../features/export/svgExport";
|
|
4
|
-
export type ExportStatus = ProductExportStatus;
|
|
5
|
-
export type SvgAssetInliner = ProductSvgAssetInliner;
|
|
6
|
-
export type SvgExportResult = ProductSvgExportResult;
|
|
7
|
-
export interface SvgExportControls {
|
|
8
|
-
status: ExportStatus | null;
|
|
9
|
-
exportSvg(shapeIds: readonly ShapeId[]): Promise<SvgExportResult>;
|
|
10
|
-
}
|
|
11
|
-
export declare function useSvgExport({ assetInliners, editor, themeRootRef, }: {
|
|
12
|
-
assetInliners?: readonly SvgAssetInliner[];
|
|
13
|
-
editor: Editor;
|
|
14
|
-
themeRootRef?: RefObject<HTMLElement | null>;
|
|
15
|
-
}): SvgExportControls;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ProductApiToken<TApi> {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly __api?: TApi;
|
|
4
|
-
}
|
|
5
|
-
export interface ProductApiRegistry {
|
|
6
|
-
get<TApi>(token: ProductApiToken<TApi>): TApi | null;
|
|
7
|
-
}
|
|
8
|
-
export interface ProductApiRegistryRuntime extends ProductApiRegistry {
|
|
9
|
-
register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
|
|
10
|
-
}
|
|
11
|
-
export declare function createProductApiToken<TApi>(id: string): ProductApiToken<TApi>;
|
|
12
|
-
export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type CanvasActionContext } from "../../_vendor/canvas-plugin-sdk/index";
|
|
2
|
-
import type { Editor } from "../../_vendor/canvas-core/index";
|
|
3
|
-
export declare function createCanvasActionContext({ editor, toolState, selectionState, }: {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
toolState: {
|
|
6
|
-
activeToolId: string;
|
|
7
|
-
isToolLocked: boolean;
|
|
8
|
-
};
|
|
9
|
-
selectionState: {
|
|
10
|
-
count: number;
|
|
11
|
-
singleShapeType: CanvasActionContext["selection"]["singleShapeType"];
|
|
12
|
-
commonShapeType: CanvasActionContext["selection"]["commonShapeType"];
|
|
13
|
-
canResetSelectionRotation: boolean;
|
|
14
|
-
isMixedFrameAndPointHandleSelection: boolean;
|
|
15
|
-
};
|
|
16
|
-
}): CanvasActionContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ClipboardProductPlugin: import("../..").CanvasPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ImageProductPlugin: import("../..").CanvasPlugin;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Editor, ShapeId, Vec } from "../../../_vendor/canvas-core/index";
|
|
2
|
-
import { type ImageInsertSize } from "../toolbar/imageHostActions";
|
|
3
|
-
import type { ImageAssetService } from "../asset/imageAssetService";
|
|
4
|
-
export interface ImageImportControls {
|
|
5
|
-
insertImageFromFile(input: {
|
|
6
|
-
file: File;
|
|
7
|
-
pagePoint?: Vec;
|
|
8
|
-
size?: ImageInsertSize;
|
|
9
|
-
}): Promise<ShapeId | null>;
|
|
10
|
-
replaceSelectedImage(file: File): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
export declare function useImageImport({ editor, imageAssetService, flushSnapshot, }: {
|
|
13
|
-
editor: Editor;
|
|
14
|
-
imageAssetService: ImageAssetService;
|
|
15
|
-
flushSnapshot?: (editor: Editor) => Promise<void>;
|
|
16
|
-
}): ImageImportControls;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const KeyboardShortcutProductPlugin: import("../..").CanvasPlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Editor } from "../../_vendor/canvas-core/index";
|
|
2
|
-
import type { CanvasActionRegistry } from "../../_vendor/canvas-plugin-sdk/index";
|
|
3
|
-
import type { ExecuteCanvasKitCommand } from "../../runtime/canvasKitCommandExecutor";
|
|
4
|
-
export declare function useCanvasKitKeyboardShortcuts({ actionRegistry, editor, executeCommand, }: {
|
|
5
|
-
actionRegistry: CanvasActionRegistry;
|
|
6
|
-
editor: Editor;
|
|
7
|
-
executeCommand: ExecuteCanvasKitCommand;
|
|
8
|
-
}): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type CanvasAction, type CanvasActionContext } from "../../_vendor/canvas-plugin-sdk/index";
|
|
2
|
-
import type { KeyboardShortcutInput } from "../../_vendor/canvas-core/index";
|
|
3
|
-
export declare const SYSTEM_SELECTION_DELETE_ACTION_ID = "system.selection.delete";
|
|
4
|
-
export declare const SYSTEM_SELECTION_DUPLICATE_ACTION_ID = "system.selection.duplicate";
|
|
5
|
-
export declare const SYSTEM_SELECTION_SELECT_ALL_ACTION_ID = "system.selection.select-all";
|
|
6
|
-
export declare const SYSTEM_SELECTION_RESET_ROTATION_ACTION_ID = "system.selection.reset-rotation";
|
|
7
|
-
export declare const SYSTEM_SELECTION_FLIP_HORIZONTAL_ACTION_ID = "system.selection.flip-horizontal";
|
|
8
|
-
export declare const SYSTEM_SELECTION_FLIP_VERTICAL_ACTION_ID = "system.selection.flip-vertical";
|
|
9
|
-
export declare const SYSTEM_SELECTION_SEND_TO_BACK_ACTION_ID = "system.selection.send-to-back";
|
|
10
|
-
export declare const SYSTEM_SELECTION_SEND_BACKWARD_ACTION_ID = "system.selection.send-backward";
|
|
11
|
-
export declare const SYSTEM_SELECTION_BRING_FORWARD_ACTION_ID = "system.selection.bring-forward";
|
|
12
|
-
export declare const SYSTEM_SELECTION_BRING_TO_FRONT_ACTION_ID = "system.selection.bring-to-front";
|
|
13
|
-
export declare const SYSTEM_SELECTION_SET_OPACITY_ACTION_ID = "system.selection.set-opacity";
|
|
14
|
-
export declare const selectionActionShortcuts: readonly {
|
|
15
|
-
actionId: string;
|
|
16
|
-
shortcut: KeyboardShortcutInput;
|
|
17
|
-
}[];
|
|
18
|
-
export declare function isSingleSelectedFrameChild(context: CanvasActionContext): boolean;
|
|
19
|
-
export declare const selectionActions: readonly CanvasAction[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SelectionProductPlugin: import("../..").CanvasPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ToolProductPlugin: import("../..").CanvasPlugin;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type CanvasAction } from "../../_vendor/canvas-plugin-sdk/index";
|
|
2
|
-
export declare const SYSTEM_VIEW_ZOOM_IN_ACTION_ID = "system.view.zoom-in";
|
|
3
|
-
export declare const SYSTEM_VIEW_ZOOM_OUT_ACTION_ID = "system.view.zoom-out";
|
|
4
|
-
export declare const SYSTEM_VIEW_RESET_ZOOM_ACTION_ID = "system.view.reset-zoom";
|
|
5
|
-
export declare const viewActions: readonly CanvasAction[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ViewProductPlugin: import("../..").CanvasPlugin;
|