@yuzhouu/canvas-kit 0.1.11 → 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 +20 -12
- package/_vendor/canvas-plugin-sdk/capability.d.ts +0 -6
- package/_vendor/canvas-plugin-sdk/index.d.ts +1 -16
- package/_vendor/canvas-plugin-sdk/plugin.d.ts +5 -52
- 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 +10 -16
- package/_vendor/canvas-product-contracts/capability.d.ts +8 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/chrome.d.ts +1 -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-plugin-sdk → canvas-product-contracts}/exports.d.ts +1 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/importRegistry.d.ts +1 -4
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/imports.d.ts +1 -0
- package/_vendor/canvas-product-contracts/index.d.ts +15 -0
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/productApi.d.ts +6 -5
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/services.d.ts +2 -1
- package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/toolbar.d.ts +3 -6
- package/_vendor/canvas-product-contracts/toolbarRegistry.d.ts +9 -0
- package/_vendor/plugin-arrow/api.d.ts +2 -2
- package/_vendor/plugin-frame/api.d.ts +2 -2
- package/_vendor/plugin-geo/api.d.ts +2 -2
- package/_vendor/plugin-group/groupContributions.d.ts +1 -1
- package/_vendor/plugin-group/productRuntime.d.ts +1 -1
- package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
- package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
- package/_vendor/plugin-image/productRuntime.d.ts +1 -1
- 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 +1 -1
- package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
- package/_vendor/plugin-runtime-clipboard/capability.d.ts +1 -0
- package/_vendor/{plugin-builtin-clipboard/clipboardContribution.d.ts → plugin-runtime-clipboard/clipboardActions.d.ts} +1 -6
- package/_vendor/{plugin-builtin-clipboard → plugin-runtime-clipboard}/clipboardService.d.ts +2 -2
- package/_vendor/plugin-runtime-clipboard/index.d.ts +4 -0
- package/_vendor/plugin-runtime-clipboard/plugin.d.ts +1 -0
- package/_vendor/{plugin-builtin-export → plugin-runtime-export}/canvasExportApi.d.ts +2 -2
- package/_vendor/{plugin-builtin-export → plugin-runtime-export}/index.d.ts +1 -1
- package/_vendor/{plugin-builtin-export → plugin-runtime-export}/plugin.d.ts +1 -1
- package/_vendor/plugin-text/api.d.ts +2 -2
- package/_vendor/plugin-text/feature.d.ts +1 -1
- package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +1 -1
- package/chrome/toolbar/mergeToolbarGroups.d.ts +8 -0
- package/chrome/toolbar/toolbarLabels.d.ts +1 -1
- package/chrome/toolbar/useToolbarSurfaces.d.ts +1 -1
- package/chrome/types.d.ts +3 -3
- package/chrome/useCanvasKitChromeContext.d.ts +1 -1
- package/chrome/useChromeSurfaces.d.ts +1 -1
- package/chrome/useContextMenuSurface.d.ts +1 -1
- package/core/product-controller/canvasProductController.d.ts +1 -1
- package/core/runtime/productServices.d.ts +1 -1
- package/features/context-menu/contextMenuRuntime.d.ts +1 -1
- package/features/image/asset/imageAssetService.d.ts +1 -1
- package/features/image/asset/imageBlobStore.d.ts +1 -1
- package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
- package/features/image/controller/imageProductController.d.ts +1 -1
- package/features/image/import/ImageImportController.d.ts +1 -1
- package/features/image/toolbar/imageHostActions.d.ts +1 -1
- package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
- package/features/text/textSvgAssetInliner.d.ts +1 -1
- package/index.d.ts +16 -14
- package/index.mjs +88 -111
- package/package.json +2 -2
- package/{_vendor/plugin-builtin-import-host → plugins/runtime/import-host}/CanvasImportHost.d.ts +2 -1
- package/plugins/runtime/import-host/capability.d.ts +1 -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/{_vendor/plugin-builtin-tool-actions → plugins/runtime/tool-actions}/index.d.ts +1 -1
- 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/{standardCanvasKitPlugins.d.ts → standard/createStandardCanvasKitPlugins.d.ts} +2 -3
- package/plugins/standard/selection/actions.d.ts +21 -0
- 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/plugins/standard/view/actions.d.ts +5 -0
- 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/runtime/canvasKitActionContext.d.ts +17 -0
- package/runtime/canvasKitCommandExecutor.d.ts +1 -1
- package/runtime/canvasKitPluginContracts.d.ts +13 -15
- package/{_vendor/canvas-plugin-sdk/lifecycle.d.ts → runtime/canvasKitPluginLifecycle.d.ts} +4 -3
- package/runtime/canvasKitPluginSetup.d.ts +4 -2
- package/{_vendor/canvas-plugin-sdk/pluginUi.d.ts → runtime/canvasKitPluginUi.d.ts} +3 -5
- package/runtime/canvasKitRuntime.d.ts +1 -1
- package/runtime/canvasKitRuntimeContracts.d.ts +1 -1
- package/runtime/canvasPluginGraph.d.ts +15 -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/chromeRegistry.d.ts +0 -15
- package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +0 -11
- package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +0 -9
- package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +0 -18
- package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +0 -2
- package/_vendor/plugin-builtin-clipboard/clipboardContextMenuContributions.d.ts +0 -2
- package/_vendor/plugin-builtin-clipboard/index.d.ts +0 -3
- package/_vendor/plugin-builtin-clipboard/plugin.d.ts +0 -1
- package/_vendor/plugin-builtin-import-host/capability.d.ts +0 -1
- package/_vendor/plugin-builtin-import-host/plugin.d.ts +0 -1
- package/_vendor/plugin-builtin-tool-actions/capability.d.ts +0 -1
- package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +0 -1
- package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +0 -2
- package/_vendor/plugin-connector/canvasRender.d.ts +0 -2
- package/_vendor/plugin-connector/connectorBindingUtil.d.ts +0 -28
- package/_vendor/plugin-connector/connectorBindings.d.ts +0 -8
- package/_vendor/plugin-connector/connectorGeometry.d.ts +0 -70
- package/_vendor/plugin-connector/connectorHandles.d.ts +0 -12
- package/_vendor/plugin-connector/connectorInteractions.d.ts +0 -3
- package/_vendor/plugin-connector/connectorMarker.d.ts +0 -7
- package/_vendor/plugin-connector/connectorModel.d.ts +0 -43
- package/_vendor/plugin-connector/connectorPortInteraction.d.ts +0 -13
- package/_vendor/plugin-connector/connectorPorts.d.ts +0 -23
- package/_vendor/plugin-connector/connectorRuntime.d.ts +0 -62
- package/_vendor/plugin-connector/connectorShapeUtil.d.ts +0 -29
- package/_vendor/plugin-connector/connectorTool.d.ts +0 -4
- package/_vendor/plugin-connector/constants.d.ts +0 -17
- package/_vendor/plugin-connector/editorRuntime.d.ts +0 -7
- package/_vendor/plugin-connector/feature.d.ts +0 -4
- package/_vendor/plugin-connector/index.d.ts +0 -18
- package/_vendor/plugin-connector/orthogonalRoute.d.ts +0 -9
- package/_vendor/plugin-connector/productRuntime.d.ts +0 -2
- package/_vendor/plugin-connector/quickConnect.d.ts +0 -28
- package/_vendor/plugin-connector/types.d.ts +0 -51
- package/_vendor/plugin-packaging/api.d.ts +0 -74
- 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 -19
- 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/es-DocrZgUh.mjs +0 -2
- /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/blobDataUrl.d.ts +0 -0
- /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/pngExport.d.ts +0 -0
- /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/svgExport.d.ts +0 -0
- /package/{_vendor/plugin-builtin-import-host → plugins/runtime/import-host}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -81,12 +81,18 @@ belong on `CanvasKitRoot`. Export appearance is supplied to each export request;
|
|
|
81
81
|
it is not stored on the Root or Runtime.
|
|
82
82
|
|
|
83
83
|
`plugins` is the complete caller-supplied plugin graph. Before compiling it,
|
|
84
|
-
CanvasKit adds
|
|
85
|
-
export API only when the graph does not already
|
|
86
|
-
capability token. A plugin that provides
|
|
87
|
-
`
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
CanvasKit adds Runtime default providers for clipboard behavior, import host,
|
|
85
|
+
generic tool actions, and the export API only when the graph does not already
|
|
86
|
+
provide the corresponding capability token. A plugin that provides
|
|
87
|
+
`canvasClipboardRuntimeCapability`, `canvasToolActionsCapability`, or
|
|
88
|
+
`canvasExportApiToken` therefore replaces that default implementation. Runtime
|
|
89
|
+
defaults and caller plugins use the same `CanvasPlugin` contract and compile
|
|
90
|
+
into one dependency graph.
|
|
91
|
+
|
|
92
|
+
CanvasKit-specific import, keyboard, and tool-action defaults live with the
|
|
93
|
+
composition root under `src/plugins/runtime`. Reusable clipboard and export
|
|
94
|
+
capabilities remain independent Runtime plugin packages. Physical ownership
|
|
95
|
+
does not change capability replacement semantics.
|
|
90
96
|
|
|
91
97
|
## Startup result
|
|
92
98
|
|
|
@@ -180,18 +186,20 @@ Nested arrays are groups only; they do not need IDs and are flattened in declara
|
|
|
180
186
|
|
|
181
187
|
Runtime creation compiles the graph, creates Editor and the Runtime resource owner, runs each setup once in dependency order, then seals all registries. Sealing validates duplicate IDs and action references, materializes registered APIs, and prevents later registration.
|
|
182
188
|
|
|
183
|
-
Packaging
|
|
184
|
-
|
|
189
|
+
Connector and Packaging are composed outside CanvasKit and are intentionally
|
|
190
|
+
absent from the standard plugin profile. Products that need them depend on their
|
|
191
|
+
plugin packages and add them explicitly:
|
|
185
192
|
|
|
186
193
|
```ts
|
|
187
194
|
import {
|
|
188
|
-
Packaging,
|
|
189
195
|
createStandardCanvasKitPlugins,
|
|
190
196
|
type CanvasKitRuntimeOptions,
|
|
191
197
|
} from "@land/canvas-kit";
|
|
198
|
+
import { Connector } from "@land/plugin-connector";
|
|
199
|
+
import { Packaging } from "@land/plugin-packaging";
|
|
192
200
|
|
|
193
201
|
const options: CanvasKitRuntimeOptions = {
|
|
194
|
-
plugins: [createStandardCanvasKitPlugins(), Packaging],
|
|
202
|
+
plugins: [Connector, createStandardCanvasKitPlugins(), Packaging],
|
|
195
203
|
};
|
|
196
204
|
```
|
|
197
205
|
|
|
@@ -206,14 +214,14 @@ const options: CanvasKitRuntimeOptions = {
|
|
|
206
214
|
`setup` returns nothing. Every owned resource registers cleanup through `lifecycle.defer()`, which gives Runtime one cleanup protocol and reverse-order resource stack. `beforeReady` runs serially during `start()` after restore/seed and asset preparation. `beforeCommand` is a repeatable interceptor executed by the Runtime-bound command executor.
|
|
207
215
|
|
|
208
216
|
The set-active-tool and tool-lock actions are provided by the replaceable
|
|
209
|
-
|
|
217
|
+
Runtime default for `canvasToolActionsCapability`, so shape toolbar plugins do
|
|
210
218
|
not depend on the standard profile installing a Tool action provider.
|
|
211
219
|
Components share one props contract and render between Canvas and chrome; there
|
|
212
220
|
are no component slots.
|
|
213
221
|
|
|
214
222
|
## Public controller
|
|
215
223
|
|
|
216
|
-
External code should work through `runtime.controller` or the controller supplied to `onControllerReady`. The controller exposes document, selection, page, tool, camera, layer, history, export,
|
|
224
|
+
External code should work through `runtime.controller` or the controller supplied to `onControllerReady`. The controller exposes document, selection, page, tool, camera, layer, history, export, standard shape creation, and registered API operations without exposing the raw store.
|
|
217
225
|
|
|
218
226
|
### Export API
|
|
219
227
|
|
|
@@ -6,11 +6,5 @@ export interface CanvasPluginCapabilityToken<TValue = unknown, TKind extends Can
|
|
|
6
6
|
}
|
|
7
7
|
export interface CanvasPluginValueToken<TValue> extends CanvasPluginCapabilityToken<TValue, "value"> {
|
|
8
8
|
}
|
|
9
|
-
export interface CanvasPluginCapabilityRegistry {
|
|
10
|
-
get<TValue>(token: CanvasPluginValueToken<TValue>): TValue | null;
|
|
11
|
-
}
|
|
12
|
-
export interface CanvasPluginCapabilitySetup extends CanvasPluginCapabilityRegistry {
|
|
13
|
-
provide<TValue>(token: CanvasPluginValueToken<TValue>, value: TValue): void;
|
|
14
|
-
}
|
|
15
9
|
export declare function createCanvasPluginValueToken<TValue>(id: string): CanvasPluginValueToken<TValue>;
|
|
16
10
|
export declare function isCanvasPluginCapabilityToken(value: unknown): value is CanvasPluginCapabilityToken;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
export * from "./actions";
|
|
2
|
-
export * from "./actionRegistry";
|
|
3
1
|
export * from "./capability";
|
|
4
|
-
export * from "./chrome";
|
|
5
|
-
export * from "./chromeRegistry";
|
|
6
|
-
export * from "./contextMenu";
|
|
7
|
-
export * from "./contextMenuRegistry";
|
|
8
|
-
export * from "./exports";
|
|
9
|
-
export * from "./exportRegistry";
|
|
10
|
-
export * from "./imports";
|
|
11
|
-
export * from "./importRegistry";
|
|
12
|
-
export * from "./lifecycle";
|
|
13
2
|
export * from "./plugin";
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./productApi";
|
|
16
|
-
export * from "./services";
|
|
17
|
-
export * from "./toolbar";
|
|
18
|
-
export * from "./toolbarRegistry";
|
|
3
|
+
export * from "./setupExtension";
|
|
@@ -1,48 +1,11 @@
|
|
|
1
|
-
import type { EditorPlugin, Editor
|
|
1
|
+
import type { EditorPlugin, Editor } from "../canvas-core/index";
|
|
2
2
|
import type { CanvasRenderPlugin } from "../canvas-react/host/index";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
import type { CanvasPluginImportSetup } from "./imports";
|
|
7
|
-
import type { CanvasPluginExportSetup } from "./exports";
|
|
8
|
-
import type { CanvasPluginLifecycleSetup, CanvasPluginPersistence } from "./lifecycle";
|
|
9
|
-
import type { CanvasPluginUiSetup } from "./pluginUi";
|
|
10
|
-
import type { ProductServiceSetup } from "./services";
|
|
11
|
-
import type { ToolbarContribution } from "./toolbar";
|
|
12
|
-
import type { CanvasPluginApi, CanvasPluginApiContext } from "./productApi";
|
|
13
|
-
import { type CanvasPluginCapabilitySetup, type CanvasPluginCapabilityToken } from "./capability";
|
|
14
|
-
export interface CanvasActionShortcut {
|
|
15
|
-
actionId: string;
|
|
16
|
-
shortcut: KeyboardShortcutInput;
|
|
17
|
-
}
|
|
18
|
-
export interface CanvasPluginActionSetup {
|
|
19
|
-
add(...actions: readonly CanvasAction[]): void;
|
|
20
|
-
addShortcuts(...shortcuts: readonly CanvasActionShortcut[]): void;
|
|
21
|
-
}
|
|
22
|
-
export interface CanvasPluginToolbarSetup {
|
|
23
|
-
add(...contributions: readonly ToolbarContribution[]): void;
|
|
24
|
-
}
|
|
25
|
-
export interface CanvasPluginContextMenuSetup {
|
|
26
|
-
add(...contributions: readonly ContextMenuContribution[]): void;
|
|
27
|
-
}
|
|
28
|
-
export interface CanvasPluginApiSetup<TApiContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
|
|
29
|
-
add<TApi>(api: CanvasPluginApi<TApi, TApiContext>): void;
|
|
30
|
-
}
|
|
31
|
-
export interface CanvasPluginSetupContext<TApiContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
|
|
32
|
-
readonly actions: CanvasPluginActionSetup;
|
|
33
|
-
readonly apis: CanvasPluginApiSetup<TApiContext>;
|
|
34
|
-
readonly capabilities: CanvasPluginCapabilitySetup;
|
|
35
|
-
readonly chrome: CanvasPluginChromeSetup;
|
|
36
|
-
readonly contextMenu: CanvasPluginContextMenuSetup;
|
|
3
|
+
import type { CanvasPluginCapabilityToken } from "./capability";
|
|
4
|
+
import type { CanvasPluginSetupExtension } from "./setupExtension";
|
|
5
|
+
export interface CanvasPluginSetupContext {
|
|
37
6
|
readonly editor: Editor;
|
|
38
|
-
readonly exports: CanvasPluginExportSetup;
|
|
39
|
-
readonly imports: CanvasPluginImportSetup;
|
|
40
|
-
readonly lifecycle: CanvasPluginLifecycleSetup;
|
|
41
|
-
readonly persistence: CanvasPluginPersistence | null;
|
|
42
7
|
readonly productId: string;
|
|
43
|
-
|
|
44
|
-
readonly toolbar: CanvasPluginToolbarSetup;
|
|
45
|
-
readonly ui: CanvasPluginUiSetup;
|
|
8
|
+
get<TValue>(extension: CanvasPluginSetupExtension<TValue>): TValue;
|
|
46
9
|
}
|
|
47
10
|
export type CanvasPluginSetup<TContext extends CanvasPluginSetupContext = CanvasPluginSetupContext> = (context: TContext) => void;
|
|
48
11
|
type CanvasPluginSetupLike = (context: never) => unknown;
|
|
@@ -62,15 +25,5 @@ export interface CanvasPluginDefinition<TSetup extends CanvasPluginSetupLike = C
|
|
|
62
25
|
export interface CanvasPlugin<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> extends CanvasPluginDefinition<TSetup>, CanvasPluginReference {
|
|
63
26
|
}
|
|
64
27
|
export type CanvasPluginInput<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> = CanvasPlugin<TSetup> | readonly CanvasPluginInput<TSetup>[];
|
|
65
|
-
export interface CompiledCanvasPlugins<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> {
|
|
66
|
-
readonly plugins: readonly CanvasPlugin<TSetup>[];
|
|
67
|
-
readonly pluginIds: readonly string[];
|
|
68
|
-
readonly editorPlugins: readonly EditorPlugin[];
|
|
69
|
-
readonly renderPlugins: readonly CanvasRenderPlugin[];
|
|
70
|
-
readonly shapeTypes: readonly ShapeRecordBase["type"][];
|
|
71
|
-
}
|
|
72
28
|
export declare function defineCanvasPlugin<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup>(plugin: CanvasPluginDefinition<TSetup>): CanvasPlugin<TSetup>;
|
|
73
|
-
export declare function compileCanvasPlugins<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): CompiledCanvasPlugins<TSetup>;
|
|
74
|
-
export declare function assertValidCanvasPluginGraph<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): void;
|
|
75
|
-
export declare function hasCanvasPluginCapabilityProvider<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[], token: CanvasPluginCapabilityToken): boolean;
|
|
76
29
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Editor, ShapeColor, ShapeId, ShapeRecordBase } from "../canvas-core/index";
|
|
1
|
+
import type { Editor, KeyboardShortcutInput, ShapeColor, ShapeId, ShapeRecordBase } from "../canvas-core/index";
|
|
2
2
|
export interface CanvasSelectionSnapshot {
|
|
3
3
|
selectedShapeIds: readonly ShapeId[];
|
|
4
4
|
selectedShapes: readonly ShapeRecordBase[];
|
|
@@ -32,19 +32,13 @@ export interface CanvasAction<TValue extends CanvasActionValue = CanvasActionVal
|
|
|
32
32
|
getValue?(context: CanvasActionContext): TValue;
|
|
33
33
|
run(input: CanvasActionRunInput<TValue>): void;
|
|
34
34
|
}
|
|
35
|
+
export interface CanvasActionShortcut {
|
|
36
|
+
actionId: string;
|
|
37
|
+
shortcut: KeyboardShortcutInput;
|
|
38
|
+
}
|
|
39
|
+
export interface CanvasPluginActionSetup {
|
|
40
|
+
add(...actions: readonly CanvasAction[]): void;
|
|
41
|
+
addShortcuts(...shortcuts: readonly CanvasActionShortcut[]): void;
|
|
42
|
+
}
|
|
43
|
+
export declare const canvasActionsExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginActionSetup>;
|
|
35
44
|
export declare function resolveCanvasActionAvailability(action: CanvasAction, context: CanvasActionContext): CanvasActionAvailability;
|
|
36
|
-
export declare function createCanvasActionContext({ editor, toolState, selectionState, }: {
|
|
37
|
-
editor: Editor;
|
|
38
|
-
toolState: {
|
|
39
|
-
activeToolId: string;
|
|
40
|
-
isToolLocked: boolean;
|
|
41
|
-
};
|
|
42
|
-
selectionState: {
|
|
43
|
-
count: number;
|
|
44
|
-
singleShapeType: CanvasActionContext["selection"]["singleShapeType"];
|
|
45
|
-
commonShapeType: CanvasActionContext["selection"]["commonShapeType"];
|
|
46
|
-
canFlipSelection: boolean;
|
|
47
|
-
canResetSelectionRotation: boolean;
|
|
48
|
-
isMixedFrameAndPointHandleSelection: boolean;
|
|
49
|
-
};
|
|
50
|
-
}): CanvasActionContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CanvasPluginValueToken } from "../canvas-plugin-sdk/index";
|
|
2
|
+
export interface CanvasPluginCapabilityRegistry {
|
|
3
|
+
get<TValue>(token: CanvasPluginValueToken<TValue>): TValue | null;
|
|
4
|
+
}
|
|
5
|
+
export interface CanvasPluginCapabilitySetup extends CanvasPluginCapabilityRegistry {
|
|
6
|
+
provide<TValue>(token: CanvasPluginValueToken<TValue>, value: TValue): void;
|
|
7
|
+
}
|
|
8
|
+
export declare const canvasCapabilitiesExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginCapabilitySetup>;
|
|
@@ -50,3 +50,4 @@ export interface ChromeContribution {
|
|
|
50
50
|
export interface CanvasPluginChromeSetup {
|
|
51
51
|
add(...contributions: readonly ChromeContribution[]): void;
|
|
52
52
|
}
|
|
53
|
+
export declare const canvasChromeExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginChromeSetup>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from "../canvas-core/index";
|
|
2
|
+
import type { CanvasActionContext } from "./actions";
|
|
3
|
+
import type { ChromeChannel, ChromeSection } from "./chrome";
|
|
4
|
+
export interface CanvasChromeRegistry {
|
|
5
|
+
getChannels(): readonly ChromeChannel[];
|
|
6
|
+
getStateRevision(): number;
|
|
7
|
+
subscribeToState(editor: Editor, listener: () => void): () => void;
|
|
8
|
+
getSections(channel: ChromeChannel, context: CanvasActionContext): ChromeSection[];
|
|
9
|
+
}
|
|
@@ -57,3 +57,7 @@ export interface ContextMenuContribution {
|
|
|
57
57
|
when?(context: ContextMenuContext): boolean;
|
|
58
58
|
getSections(context: ContextMenuContext): readonly ContextMenuSection[];
|
|
59
59
|
}
|
|
60
|
+
export interface CanvasPluginContextMenuSetup {
|
|
61
|
+
add(...contributions: readonly ContextMenuContribution[]): void;
|
|
62
|
+
}
|
|
63
|
+
export declare const canvasContextMenuExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginContextMenuSetup>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CanvasExportArtifact, CanvasExportFormat, CanvasExportProviderInput } from "./exports";
|
|
2
|
+
export interface CanvasExportRegistry {
|
|
3
|
+
getFormats(): readonly CanvasExportFormat[];
|
|
4
|
+
hasFormat(format: string): boolean;
|
|
5
|
+
export(format: string, input: CanvasExportProviderInput): Promise<CanvasExportArtifact>;
|
|
6
|
+
}
|
|
@@ -24,3 +24,4 @@ export interface CanvasExportContribution extends CanvasExportFormat {
|
|
|
24
24
|
export interface CanvasPluginExportSetup {
|
|
25
25
|
add(...contributions: readonly CanvasExportContribution[]): void;
|
|
26
26
|
}
|
|
27
|
+
export declare const canvasExportsExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginExportSetup>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { CanvasImportContext, CanvasImportContribution, CanvasImportPreview, CanvasImportRequest, CanvasImportResult } from "./imports";
|
|
2
|
-
export
|
|
3
|
-
private readonly contributions;
|
|
4
|
-
constructor(contributions?: readonly CanvasImportContribution[]);
|
|
2
|
+
export interface CanvasImportRegistry {
|
|
5
3
|
getContributions(): readonly CanvasImportContribution[];
|
|
6
4
|
canImport(request: CanvasImportRequest): boolean;
|
|
7
5
|
canImportPreview(preview: CanvasImportPreview): boolean;
|
|
8
6
|
import(request: CanvasImportRequest, context: CanvasImportContext): Promise<CanvasImportResult>;
|
|
9
7
|
}
|
|
10
|
-
export declare function createCanvasImportRegistry(contributions?: readonly CanvasImportContribution[]): CanvasImportRegistry;
|
|
@@ -36,3 +36,4 @@ export interface CanvasImportContribution {
|
|
|
36
36
|
export interface CanvasPluginImportSetup {
|
|
37
37
|
add(...contributions: readonly CanvasImportContribution[]): void;
|
|
38
38
|
}
|
|
39
|
+
export declare const canvasImportsExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginImportSetup>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./actions";
|
|
2
|
+
export * from "./actionRegistry";
|
|
3
|
+
export * from "./capability";
|
|
4
|
+
export * from "./chrome";
|
|
5
|
+
export * from "./chromeRegistry";
|
|
6
|
+
export * from "./contextMenu";
|
|
7
|
+
export * from "./contextMenuRegistry";
|
|
8
|
+
export * from "./exports";
|
|
9
|
+
export * from "./exportRegistry";
|
|
10
|
+
export * from "./imports";
|
|
11
|
+
export * from "./importRegistry";
|
|
12
|
+
export * from "./productApi";
|
|
13
|
+
export * from "./services";
|
|
14
|
+
export * from "./toolbar";
|
|
15
|
+
export * from "./toolbarRegistry";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Editor, ShapeId } from "../canvas-core/index";
|
|
2
|
-
import
|
|
2
|
+
import { type CanvasPluginCapabilityToken } from "../canvas-plugin-sdk/index";
|
|
3
|
+
import type { CanvasPluginCapabilityRegistry } from "./capability";
|
|
3
4
|
import type { CanvasExportRegistry } from "./exportRegistry";
|
|
4
5
|
export interface ProductApiToken<TApi> extends CanvasPluginCapabilityToken<TApi, "api"> {
|
|
5
6
|
readonly __api?: TApi;
|
|
@@ -7,9 +8,6 @@ export interface ProductApiToken<TApi> extends CanvasPluginCapabilityToken<TApi,
|
|
|
7
8
|
export interface ProductApiRegistry {
|
|
8
9
|
get<TApi>(token: ProductApiToken<TApi>): TApi | null;
|
|
9
10
|
}
|
|
10
|
-
export interface ProductApiRegistryRuntime extends ProductApiRegistry {
|
|
11
|
-
register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
|
|
12
|
-
}
|
|
13
11
|
export interface CanvasShapeRef<TType extends string = string> {
|
|
14
12
|
id: ShapeId;
|
|
15
13
|
type: TType;
|
|
@@ -24,5 +22,8 @@ export interface CanvasPluginApi<TApi, TContext extends CanvasPluginApiContext =
|
|
|
24
22
|
token: ProductApiToken<TApi>;
|
|
25
23
|
create(context: TContext): TApi | null;
|
|
26
24
|
}
|
|
25
|
+
export interface CanvasPluginApiSetup<TContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
|
|
26
|
+
add<TApi>(api: CanvasPluginApi<TApi, TContext>): void;
|
|
27
|
+
}
|
|
28
|
+
export declare const canvasApisExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginApiSetup<CanvasPluginApiContext>>;
|
|
27
29
|
export declare function createProductApiToken<TApi>(id: string): ProductApiToken<TApi>;
|
|
28
|
-
export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasPluginCapabilityToken } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export interface ProductServiceToken<TService> extends CanvasPluginCapabilityToken<TService, "service"> {
|
|
3
3
|
readonly __service?: TService;
|
|
4
4
|
}
|
|
@@ -16,5 +16,6 @@ export interface ProductServiceRegistry {
|
|
|
16
16
|
export interface ProductServiceSetup extends ProductServiceRegistry {
|
|
17
17
|
add<TService>(factory: ProductServiceFactory<TService>): TService;
|
|
18
18
|
}
|
|
19
|
+
export declare const canvasServicesExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<ProductServiceSetup>;
|
|
19
20
|
export declare function createProductServiceToken<TService>(id: string): ProductServiceToken<TService>;
|
|
20
21
|
export declare function requireProductService<TService>(services: ProductServiceRegistry, token: ProductServiceToken<TService>): TService;
|
|
@@ -140,10 +140,7 @@ export interface ToolbarContribution {
|
|
|
140
140
|
when?(context: CanvasActionContext): boolean;
|
|
141
141
|
getGroups(context: CanvasActionContext): readonly ToolbarGroup[];
|
|
142
142
|
}
|
|
143
|
-
export interface
|
|
144
|
-
|
|
145
|
-
groupIdPrefix?: string;
|
|
143
|
+
export interface CanvasPluginToolbarSetup {
|
|
144
|
+
add(...contributions: readonly ToolbarContribution[]): void;
|
|
146
145
|
}
|
|
147
|
-
export declare
|
|
148
|
-
dedupeActionIdsAcrossSources?: boolean;
|
|
149
|
-
}): ToolbarGroup[];
|
|
146
|
+
export declare const canvasToolbarExtension: import("../canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginToolbarSetup>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from "../canvas-core/index";
|
|
2
|
+
import type { CanvasActionContext } from "./actions";
|
|
3
|
+
import type { ToolbarChannel, ToolbarGroup } from "./toolbar";
|
|
4
|
+
export interface CanvasToolbarRegistry {
|
|
5
|
+
getStateRevision(): number;
|
|
6
|
+
subscribeToState(editor: Editor, listener: () => void): () => void;
|
|
7
|
+
getGroups(channel: ToolbarChannel, context: CanvasActionContext): ToolbarGroup[];
|
|
8
|
+
getChannels(): readonly ToolbarChannel[];
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ShapeColor, type ShapeId } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-product-contracts/index";
|
|
3
3
|
import type { ArrowShapeProps } from "./types";
|
|
4
4
|
export interface ArrowBindingInput {
|
|
5
5
|
targetShapeId: ShapeId;
|
|
@@ -29,5 +29,5 @@ export interface ArrowInput {
|
|
|
29
29
|
export interface ArrowApi {
|
|
30
30
|
create(input: ArrowInput): CanvasShapeRef<"arrow"> | null;
|
|
31
31
|
}
|
|
32
|
-
export declare const arrowApiToken: import("../canvas-
|
|
32
|
+
export declare const arrowApiToken: import("../canvas-product-contracts/index").ProductApiToken<ArrowApi>;
|
|
33
33
|
export declare const arrowPluginApi: CanvasPluginApi<ArrowApi>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShapeColor, ShapeId } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-product-contracts/index";
|
|
3
3
|
export interface FrameInput {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
@@ -15,5 +15,5 @@ export interface FrameApi {
|
|
|
15
15
|
create(input: FrameInput): CanvasShapeRef<"frame"> | null;
|
|
16
16
|
moveShapesToFrame(ids: ShapeId[], frameId: ShapeId): ShapeId[];
|
|
17
17
|
}
|
|
18
|
-
export declare const frameApiToken: import("../canvas-
|
|
18
|
+
export declare const frameApiToken: import("../canvas-product-contracts/index").ProductApiToken<FrameApi>;
|
|
19
19
|
export declare const framePluginApi: CanvasPluginApi<FrameApi>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShapeColor } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-product-contracts/index";
|
|
3
3
|
import type { GeoShapeProps } from "./types";
|
|
4
4
|
export interface GeoShapeInput {
|
|
5
5
|
x: number;
|
|
@@ -23,5 +23,5 @@ export interface GeoApi {
|
|
|
23
23
|
createHexagon(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
24
24
|
createStar(input: GeoShapeInput): CanvasShapeRef<"geo"> | null;
|
|
25
25
|
}
|
|
26
|
-
export declare const geoApiToken: import("../canvas-
|
|
26
|
+
export declare const geoApiToken: import("../canvas-product-contracts/index").ProductApiToken<GeoApi>;
|
|
27
27
|
export declare const geoPluginApi: CanvasPluginApi<GeoApi>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasAction, type ContextMenuContribution, type ToolbarContribution } from "../canvas-
|
|
1
|
+
import { type CanvasAction, type ContextMenuContribution, type ToolbarContribution } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare const GROUP_SELECTION_ACTION_ID = "group.selection.group";
|
|
3
3
|
export declare const UNGROUP_SELECTION_ACTION_ID = "group.selection.ungroup";
|
|
4
4
|
export declare const groupSelectionAction: CanvasAction;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export declare function setupGroupProduct(context: CanvasPluginSetupContext): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CanvasAction } from "../canvas-
|
|
1
|
+
import { type CanvasAction } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare function createImageCropCanvasActions(): CanvasAction[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CanvasAction } from "../canvas-
|
|
1
|
+
import { type CanvasAction } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare function createImageHostToolbarActionContract(actionId: string): CanvasAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
|
|
2
2
|
export { IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, } from "./actionIds";
|
|
3
3
|
export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
|
|
4
4
|
export declare function setupImageProduct(context: CanvasPluginSetupContext): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasActionContext } from "../canvas-
|
|
1
|
+
import { type CanvasActionContext } from "../canvas-product-contracts/index";
|
|
2
2
|
import { type ImageShapeRecord } from "./types";
|
|
3
3
|
export declare function getSingleSelectedImageShape(context: CanvasActionContext): ImageShapeRecord | null;
|
|
4
4
|
export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CanvasAction } from "../canvas-
|
|
1
|
+
import { type CanvasAction } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare function createImageSmudgeCanvasActions(): CanvasAction[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasAction, type ToolbarGroup } from "../canvas-
|
|
1
|
+
import { type CanvasAction, type ToolbarGroup } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare function createImageStyleCanvasActions(): CanvasAction[];
|
|
3
3
|
export declare function createImageCornerRadiusToolbarGroup({ dataUiPrefix, id, order, }: {
|
|
4
4
|
dataUiPrefix: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type ContextMenuContribution, type ToolbarContribution } from "../canvas-
|
|
1
|
+
import { type ContextMenuContribution, type ToolbarContribution } from "../canvas-product-contracts/index";
|
|
2
2
|
export declare function createImageToolbarContributions(): ToolbarContribution[];
|
|
3
3
|
export declare function createImageContextMenuContributions(): ContextMenuContribution[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const canvasClipboardRuntimeCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<true>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { type CanvasAction, type ProductServiceRegistry } from "../canvas-
|
|
2
|
-
import type { KeyboardShortcutInput } from "../canvas-core/index";
|
|
1
|
+
import { type CanvasAction, type ProductServiceRegistry } from "../canvas-product-contracts/index";
|
|
3
2
|
export declare const SYSTEM_CLIPBOARD_COPY_ACTION_ID = "system.clipboard.copy";
|
|
4
3
|
export declare const SYSTEM_CLIPBOARD_CUT_ACTION_ID = "system.clipboard.cut";
|
|
5
4
|
export declare const SYSTEM_CLIPBOARD_PASTE_ACTION_ID = "system.clipboard.paste";
|
|
6
5
|
export declare const SYSTEM_CLIPBOARD_PASTE_AT_POINT_ACTION_ID = "system.clipboard.paste-at-point";
|
|
7
|
-
export declare const clipboardActionShortcuts: readonly {
|
|
8
|
-
actionId: string;
|
|
9
|
-
shortcut: KeyboardShortcutInput;
|
|
10
|
-
}[];
|
|
11
6
|
export declare function createClipboardActions(services: ProductServiceRegistry): readonly CanvasAction[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EditorClipboardPayload } from "../canvas-core/index";
|
|
2
|
-
import { type ProductServiceFactory, type ProductServiceRegistry } from "../canvas-
|
|
2
|
+
import { type ProductServiceFactory, type ProductServiceRegistry } from "../canvas-product-contracts/index";
|
|
3
3
|
export interface CanvasClipboardService {
|
|
4
4
|
write(payload: EditorClipboardPayload): Promise<void>;
|
|
5
5
|
read(): Promise<EditorClipboardPayload | null>;
|
|
6
6
|
getMemoryPayload(): EditorClipboardPayload | null;
|
|
7
7
|
}
|
|
8
|
-
export declare const canvasClipboardServiceToken: import("../canvas-
|
|
8
|
+
export declare const canvasClipboardServiceToken: import("../canvas-product-contracts/index").ProductServiceToken<CanvasClipboardService>;
|
|
9
9
|
export declare function getCanvasClipboardService(services: ProductServiceRegistry): CanvasClipboardService | null;
|
|
10
10
|
export declare function memoryCanvasClipboardService(): ProductServiceFactory<CanvasClipboardService>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DefaultClipboardRuntimePlugin: import("../canvas-plugin-sdk/index").CanvasPlugin<(context: import("../canvas-plugin-sdk/index").CanvasPluginSetupContext) => void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor, ShapeId, ThemeColorResolver } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasExportArtifact, type CanvasExportContribution, type CanvasExportFormat, type CanvasExportRegistry } from "../canvas-
|
|
2
|
+
import { type CanvasExportArtifact, type CanvasExportContribution, type CanvasExportFormat, type CanvasExportRegistry } from "../canvas-product-contracts/index";
|
|
3
3
|
import { type PngExportResult } from "./pngExport";
|
|
4
4
|
import { type SvgAssetInliner, type SvgExportResult } from "./svgExport";
|
|
5
5
|
export type CanvasExportTarget = {
|
|
@@ -30,7 +30,7 @@ export interface CanvasExportApi {
|
|
|
30
30
|
exportPng(input: CanvasPngExportInput): Promise<PngExportResult>;
|
|
31
31
|
exportSvg(input: CanvasSvgExportInput): Promise<SvgExportResult>;
|
|
32
32
|
}
|
|
33
|
-
export declare const canvasExportApiToken: import("../canvas-
|
|
33
|
+
export declare const canvasExportApiToken: import("../canvas-product-contracts/index").ProductApiToken<CanvasExportApi>;
|
|
34
34
|
export declare function createCanvasExportApi({ editor, exportRegistry, }: {
|
|
35
35
|
editor: Editor;
|
|
36
36
|
exportRegistry: CanvasExportRegistry;
|
|
@@ -3,6 +3,6 @@ export { canvasExportApiToken, createCanvasExportApi, createPngExportContributio
|
|
|
3
3
|
export type { CanvasExportAppearance, CanvasExportApi, CanvasGenericExportInput, CanvasExportTarget, CanvasPngExportInput, CanvasSvgExportInput, } from "./canvasExportApi";
|
|
4
4
|
export { exportEditorPng, } from "./pngExport";
|
|
5
5
|
export type { PngExportOptions, PngExportResult, } from "./pngExport";
|
|
6
|
-
export {
|
|
6
|
+
export { createDefaultCanvasExportPlugin } from "./plugin";
|
|
7
7
|
export { exportEditorSvg, } from "./svgExport";
|
|
8
8
|
export type { ExportStatus, SvgAssetInliner, SvgExportOptions, SvgExportResult, } from "./svgExport";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SvgAssetInliner } from "./svgExport";
|
|
2
2
|
import { type CanvasPlugin } from "../canvas-plugin-sdk/index";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function createDefaultCanvasExportPlugin({ svgAssetInliners, }: {
|
|
4
4
|
svgAssetInliners: SvgAssetInliner[];
|
|
5
5
|
}): CanvasPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShapeColor } from "../canvas-core/index";
|
|
2
|
-
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-
|
|
2
|
+
import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-product-contracts/index";
|
|
3
3
|
import type { TextShapeProps } from "./textTypes";
|
|
4
4
|
export interface TextInput {
|
|
5
5
|
x: number;
|
|
@@ -16,5 +16,5 @@ export interface TextInput {
|
|
|
16
16
|
export interface TextApi {
|
|
17
17
|
create(input: TextInput): CanvasShapeRef<"text"> | null;
|
|
18
18
|
}
|
|
19
|
-
export declare const textApiToken: import("../canvas-
|
|
19
|
+
export declare const textApiToken: import("../canvas-product-contracts/index").ProductApiToken<TextApi>;
|
|
20
20
|
export declare const textPluginApi: CanvasPluginApi<TextApi>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type CanvasPlugin } from "../canvas-plugin-sdk/index";
|
|
2
2
|
import { type TextPluginOptions } from "./textFonts";
|
|
3
3
|
export declare function createTextPlugin(options?: Readonly<Partial<TextPluginOptions>>): CanvasPlugin;
|
|
4
|
-
export declare const Text: CanvasPlugin<import("../canvas-plugin-sdk/index").CanvasPluginSetup<import("../canvas-plugin-sdk/index").CanvasPluginSetupContext
|
|
4
|
+
export declare const Text: CanvasPlugin<import("../canvas-plugin-sdk/index").CanvasPluginSetup<import("../canvas-plugin-sdk/index").CanvasPluginSetupContext>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type CanvasActionContext } from "../../_vendor/canvas-product-contracts/index";
|
|
3
3
|
export declare function FloatingSelectionToolbarPageSpace({ children, className, context, dataUi, horizontalAlign, offset, visible, }: {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ToolbarGroup } from "../../_vendor/canvas-product-contracts/index";
|
|
2
|
+
export interface ToolbarGroupSource {
|
|
3
|
+
groups: readonly ToolbarGroup[];
|
|
4
|
+
groupIdPrefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function mergeToolbarGroups(sources: readonly ToolbarGroupSource[], options?: {
|
|
7
|
+
dedupeActionIdsAcrossSources?: boolean;
|
|
8
|
+
}): ToolbarGroup[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolbarGroup } from "../../_vendor/canvas-
|
|
1
|
+
import { type ToolbarGroup } from "../../_vendor/canvas-product-contracts/index";
|
|
2
2
|
export declare function getActiveToolLabel(groups: readonly ToolbarGroup[], activeToolId: string): string;
|
|
3
3
|
export declare function getSelectionToolbarTitle({ commonShapeType, count, isMixedFrameAndPointHandleSelection, singleShapeType, }: {
|
|
4
4
|
commonShapeType: string | null;
|