@yuzhouu/canvas-kit 0.1.6 → 0.1.8

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.
Files changed (186) hide show
  1. package/README.md +5 -1
  2. package/_vendor/canvas-core/editor/commands.d.ts +11 -1
  3. package/_vendor/canvas-core/editor/createEditorWithRuntimePlugins.d.ts +6 -0
  4. package/_vendor/canvas-core/editor/editor.d.ts +6 -1
  5. package/_vendor/canvas-core/editor/index.d.ts +1 -1
  6. package/_vendor/canvas-core/editor/managers/documentSnapshotManager.d.ts +1 -1
  7. package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +34 -4
  8. package/_vendor/canvas-core/editor/managers/snapManager.d.ts +7 -0
  9. package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +15 -0
  10. package/_vendor/canvas-core/editor/middleMousePanInteraction.d.ts +2 -0
  11. package/_vendor/canvas-core/index.d.ts +6 -6
  12. package/_vendor/canvas-core/plugins/{editorPlugin.d.ts → editorRuntimePlugin.d.ts} +3 -3
  13. package/_vendor/canvas-core/plugins/index.d.ts +1 -1
  14. package/_vendor/canvas-core/schema/records.d.ts +10 -1
  15. package/_vendor/canvas-core/shapes/shapeUtil.d.ts +14 -5
  16. package/_vendor/canvas-core/shapes/types.d.ts +2 -2
  17. package/_vendor/canvas-react/components/CanvasView.d.ts +3 -3
  18. package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +2 -0
  19. package/_vendor/canvas-react/host/actionRegistry.d.ts +15 -0
  20. package/_vendor/canvas-react/host/{canvasPlugin.d.ts → canvasRenderPlugin.d.ts} +5 -5
  21. package/_vendor/canvas-react/host/canvasRenderPluginHost.d.ts +2 -0
  22. package/_vendor/canvas-react/host/canvasRenderPluginHostManifest.d.ts +2 -0
  23. package/_vendor/canvas-react/host/canvasRenderPluginHostRuntime.d.ts +3 -0
  24. package/_vendor/canvas-react/host/canvasRenderPluginHostTypes.d.ts +104 -0
  25. package/_vendor/canvas-react/host/canvasRenderPluginHostValidation.d.ts +11 -0
  26. package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +8 -3
  27. package/_vendor/canvas-react/host/domEventGuards.d.ts +3 -3
  28. package/_vendor/canvas-react/host/extension.d.ts +4 -4
  29. package/_vendor/canvas-react/host/index.d.ts +5 -4
  30. package/_vendor/canvas-react/host/overlayRegistry.d.ts +3 -3
  31. package/_vendor/canvas-react/host/rendererRegistry.d.ts +3 -3
  32. package/_vendor/canvas-react/host/toolbarRegistry.d.ts +9 -13
  33. package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +4 -3
  34. package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +1 -0
  35. package/_vendor/plugin-arrow/canvasRender.d.ts +2 -0
  36. package/_vendor/plugin-arrow/{editor.d.ts → editorRuntime.d.ts} +2 -2
  37. package/_vendor/plugin-arrow/index.d.ts +2 -2
  38. package/_vendor/plugin-draw/canvasRender.d.ts +2 -0
  39. package/_vendor/plugin-draw/{editor.d.ts → editorRuntime.d.ts} +2 -2
  40. package/_vendor/plugin-draw/index.d.ts +2 -2
  41. package/_vendor/plugin-eraser/canvasRender.d.ts +2 -0
  42. package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -0
  43. package/_vendor/plugin-eraser/index.d.ts +2 -2
  44. package/_vendor/plugin-frame/{canvas.d.ts → canvasRender.d.ts} +2 -2
  45. package/_vendor/plugin-frame/{editor.d.ts → editorRuntime.d.ts} +2 -2
  46. package/_vendor/plugin-frame/index.d.ts +2 -2
  47. package/_vendor/plugin-geo/{canvas.d.ts → canvasRender.d.ts} +2 -2
  48. package/_vendor/plugin-geo/{editor.d.ts → editorRuntime.d.ts} +2 -2
  49. package/_vendor/plugin-geo/geoGeometry.d.ts +19 -3
  50. package/_vendor/plugin-geo/index.d.ts +2 -2
  51. package/_vendor/plugin-geo/types.d.ts +1 -0
  52. package/_vendor/plugin-group/{canvas.d.ts → canvasRender.d.ts} +2 -2
  53. package/_vendor/plugin-group/{editor.d.ts → editorRuntime.d.ts} +2 -2
  54. package/_vendor/plugin-group/index.d.ts +2 -2
  55. package/_vendor/plugin-image/{editor.d.ts → actionIds.d.ts} +1 -8
  56. package/_vendor/plugin-image/canvasRender.d.ts +2 -0
  57. package/_vendor/plugin-image/cornerRadius.d.ts +6 -0
  58. package/_vendor/plugin-image/cropRuntime.d.ts +2 -0
  59. package/_vendor/plugin-image/editorRuntime.d.ts +5 -0
  60. package/_vendor/plugin-image/imageHostActionContract.d.ts +2 -0
  61. package/_vendor/plugin-image/imageShapeUtil.d.ts +2 -1
  62. package/_vendor/plugin-image/imageSvgExporter.d.ts +6 -0
  63. package/_vendor/plugin-image/index.d.ts +8 -4
  64. package/_vendor/plugin-image/runtimeShared.d.ts +5 -0
  65. package/_vendor/plugin-image/smudge.d.ts +56 -0
  66. package/_vendor/plugin-image/smudgeInteractions.d.ts +2 -0
  67. package/_vendor/plugin-image/smudgeRuntime.d.ts +2 -0
  68. package/_vendor/plugin-image/styleRuntime.d.ts +17 -0
  69. package/_vendor/plugin-image/toolbarRuntime.d.ts +3 -0
  70. package/_vendor/plugin-image/types.d.ts +17 -1
  71. package/_vendor/plugin-laser/canvasRender.d.ts +2 -0
  72. package/_vendor/plugin-laser/editorRuntime.d.ts +2 -0
  73. package/_vendor/plugin-laser/index.d.ts +2 -2
  74. package/_vendor/plugin-text/canvasRender.d.ts +5 -0
  75. package/_vendor/plugin-text/editorRuntime.d.ts +5 -0
  76. package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +14 -0
  77. package/_vendor/plugin-text/host/richTextRendering.d.ts +9 -1
  78. package/_vendor/plugin-text/index.d.ts +2 -0
  79. package/_vendor/plugin-text/richTextLinks.d.ts +3 -0
  80. package/_vendor/plugin-text/richTextUtils.d.ts +2 -1
  81. package/browser/indexedDb.d.ts +10 -0
  82. package/browser/persistence.d.ts +2 -4
  83. package/builtins/controller/createBuiltInCanvasController.d.ts +1 -1
  84. package/builtins/controller/layerController.d.ts +1 -1
  85. package/builtins/controller/shapeCreationController.d.ts +9 -2
  86. package/builtins/index.d.ts +1 -1
  87. package/chrome/toolbar/CanvasKitWheelCapture.d.ts +2 -0
  88. package/chrome/{FloatingSelectionToolbarPageSpace.d.ts → toolbar/FloatingSelectionToolbarPageSpace.d.ts} +1 -1
  89. package/{core/features → chrome}/toolbar/toolbarLabels.d.ts +1 -1
  90. package/chrome/{bindings → toolbar}/useToolbarSurfaces.d.ts +2 -2
  91. package/chrome/types.d.ts +12 -8
  92. package/chrome/useCanvasKitChromeContext.d.ts +6 -4
  93. package/chrome/{bindings/useCanvasKitLayerTree.d.ts → useCanvasKitLayerTree.d.ts} +1 -1
  94. package/chrome/{bindings/useContextMenuSurface.d.ts → useContextMenuSurface.d.ts} +3 -3
  95. package/chrome/useHistoryControls.d.ts +12 -0
  96. package/chrome/usePageControls.d.ts +16 -0
  97. package/chrome/{bindings/useSvgExport.d.ts → useSvgExport.d.ts} +2 -2
  98. package/chrome/useZoomControls.d.ts +9 -0
  99. package/controller/canvasKitController.d.ts +10 -7
  100. package/core/api/apiRegistry.d.ts +12 -0
  101. package/core/index.d.ts +4 -19
  102. package/core/{controller → product-controller}/canvasProductController.d.ts +53 -4
  103. package/core/product-controller/index.d.ts +2 -0
  104. package/core/runtime/productDefinition.d.ts +5 -4
  105. package/core/runtime/productHost.d.ts +5 -2
  106. package/{core/features/actions/canvasActionContext.d.ts → features/actions/actionRuntime.d.ts} +7 -1
  107. package/{core/features → features}/clipboard/clipboardContextMenuContributions.d.ts +1 -1
  108. package/features/clipboard/clipboardContribution.d.ts +11 -0
  109. package/features/clipboard/clipboardHostExtension.d.ts +2 -0
  110. package/{core/features → features}/clipboard/clipboardService.d.ts +3 -3
  111. package/features/context-menu/contextMenuRuntime.d.ts +13 -0
  112. package/{core/features → features}/export/svgExport.d.ts +1 -1
  113. package/features/image/asset/imageAssetService.d.ts +11 -0
  114. package/features/image/{imageBlobStore.d.ts → asset/imageBlobStore.d.ts} +3 -2
  115. package/features/image/asset/imageFileHelpers.d.ts +49 -0
  116. package/features/image/{svgImageAssetInliner.d.ts → asset/svgImageAssetInliner.d.ts} +1 -1
  117. package/features/image/controller/imageProductController.d.ts +27 -0
  118. package/features/image/imageHostExtension.d.ts +10 -5
  119. package/features/image/{ImageImportController.d.ts → import/ImageImportController.d.ts} +3 -3
  120. package/features/image/{useImageImport.d.ts → import/useImageImport.d.ts} +3 -4
  121. package/features/image/index.d.ts +17 -15
  122. package/features/image/smudge/imageSmudgeHostActions.d.ts +10 -0
  123. package/features/image/smudge/imageSmudgeTypes.d.ts +24 -0
  124. package/features/image/toolbar/imageHostActions.d.ts +69 -0
  125. package/features/image/{imageToolbarHostBridge.d.ts → toolbar/imageToolbarHostBridge.d.ts} +2 -2
  126. package/features/keyboard/keyboardShortcutHostExtension.d.ts +2 -0
  127. package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +6 -0
  128. package/{react → features/persistence}/CanvasKitPersistenceNotice.d.ts +1 -1
  129. package/features/persistence/persistenceHostExtension.d.ts +2 -0
  130. package/{core/features/actions/canvasActions.d.ts → features/selection/selectionActions.d.ts} +3 -9
  131. package/{core/features/toolbar → features/selection}/selectionContextMenuContributions.d.ts +1 -1
  132. package/features/selection/selectionHostExtension.d.ts +2 -0
  133. package/features/selection/selectionToolbarContributions.d.ts +2 -0
  134. package/features/tool/toolActions.d.ts +2 -0
  135. package/{core/features/toolbar → features/tool}/toolContextMenuContributions.d.ts +1 -1
  136. package/features/tool/toolHostExtension.d.ts +2 -0
  137. package/features/tool/toolToolbarContributions.d.ts +2 -0
  138. package/features/view/viewActions.d.ts +5 -0
  139. package/{core/features/context-menu → features/view}/viewContextMenuContributions.d.ts +1 -1
  140. package/features/view/viewHostExtension.d.ts +2 -0
  141. package/host/defaultHostExtensions.d.ts +2 -0
  142. package/index.d.ts +13 -7
  143. package/index.mjs +96 -74
  144. package/package.json +1 -1
  145. package/product/canvasKitProduct.d.ts +8 -7
  146. package/react/useCanvasKitController.d.ts +1 -1
  147. package/react/useCanvasKitRuntime.d.ts +1 -1
  148. package/runtime/canvasKitHostContracts.d.ts +135 -0
  149. package/runtime/canvasKitHostFeatureHooks.d.ts +12 -0
  150. package/runtime/canvasKitRuntime.d.ts +8 -6
  151. package/runtime/canvasKitRuntimePlan.d.ts +50 -0
  152. package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +0 -6
  153. package/_vendor/canvas-react/host/pluginHost.d.ts +0 -2
  154. package/_vendor/canvas-react/host/pluginHostManifest.d.ts +0 -2
  155. package/_vendor/canvas-react/host/pluginHostRuntime.d.ts +0 -3
  156. package/_vendor/canvas-react/host/pluginHostTypes.d.ts +0 -102
  157. package/_vendor/canvas-react/host/pluginHostValidation.d.ts +0 -11
  158. package/_vendor/plugin-arrow/canvas.d.ts +0 -2
  159. package/_vendor/plugin-draw/canvas.d.ts +0 -2
  160. package/_vendor/plugin-eraser/canvas.d.ts +0 -2
  161. package/_vendor/plugin-eraser/editor.d.ts +0 -2
  162. package/_vendor/plugin-image/canvas.d.ts +0 -2
  163. package/_vendor/plugin-laser/canvas.d.ts +0 -2
  164. package/_vendor/plugin-laser/editor.d.ts +0 -2
  165. package/_vendor/plugin-text/canvas.d.ts +0 -5
  166. package/_vendor/plugin-text/editor.d.ts +0 -5
  167. package/chrome/bindings/useCanvasKitChromeControls.d.ts +0 -27
  168. package/core/controller/featureControllerRegistry.d.ts +0 -12
  169. package/core/controller/index.d.ts +0 -4
  170. package/core/features/clipboard/clipboardContribution.d.ts +0 -19
  171. package/core/features/context-menu/contextMenuActions.d.ts +0 -12
  172. package/core/features/context-menu/contextMenuContext.d.ts +0 -6
  173. package/core/features/context-menu/contextMenuContribution.d.ts +0 -4
  174. package/core/features/hostActionIds.d.ts +0 -1
  175. package/core/features/toolbar/toolbarContribution.d.ts +0 -4
  176. package/core/runtime/productContributions.d.ts +0 -9
  177. package/features/image/imageAssetService.d.ts +0 -7
  178. package/features/image/imageFileHelpers.d.ts +0 -35
  179. package/features/image/imageHostActions.d.ts +0 -36
  180. package/features/image/imageProductController.d.ts +0 -22
  181. package/features/image/imageProductToolbarActions.d.ts +0 -2
  182. package/react/useCanvasKitKeyboardShortcuts.d.ts +0 -6
  183. package/runtime/canvasKitHostExtensions.d.ts +0 -19
  184. package/runtime/canvasKitRuntimeInitializer.d.ts +0 -11
  185. /package/chrome/{CanvasKitFloatingToolbarLayer.d.ts → toolbar/CanvasKitFloatingToolbarLayer.d.ts} +0 -0
  186. /package/core/{controller → product-controller}/productLayerTree.d.ts +0 -0
@@ -0,0 +1,56 @@
1
+ import type { Editor, ShapeId } from "../canvas-core/index";
2
+ import type { ImageShapeRecord } from "./types";
3
+ export declare const IMAGE_SMUDGE_TOOLBAR_ACTION_ID = "image.smudge";
4
+ export declare const IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID = "image.smudge.cancel";
5
+ export declare const IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID = "image.smudge.confirm";
6
+ export declare const IMAGE_SMUDGE_HISTORY_MARK_PREFIX = "image.smudge:";
7
+ export declare const IMAGE_SMUDGE_MODE_ENTRY_MARK_PREFIX = "image.smudge:edit:";
8
+ export interface ImageSmudgeBrush {
9
+ size: number;
10
+ color?: string;
11
+ opacity?: number;
12
+ }
13
+ export interface ImageSmudgeStrokePoint {
14
+ x: number;
15
+ y: number;
16
+ pressure?: number;
17
+ }
18
+ export interface ImageSmudgeStroke {
19
+ id: string;
20
+ points: ImageSmudgeStrokePoint[];
21
+ brush: ImageSmudgeBrush;
22
+ }
23
+ export interface ImageSmudgeConfirmInput {
24
+ replace?: boolean;
25
+ }
26
+ export type ImageSmudgeSessionSnapshot = Readonly<{
27
+ shapeId: ShapeId;
28
+ brush: ImageSmudgeBrush;
29
+ strokes: readonly ImageSmudgeStroke[];
30
+ }>;
31
+ type ImageSmudgeSubscriber = () => void;
32
+ type ImageSmudgeConfirmHandler = (input?: ImageSmudgeConfirmInput) => Promise<unknown>;
33
+ export declare function getImageSmudgeModeMarkId(shapeId: ShapeId): string;
34
+ export declare function isImageSmudgeModeForShape(shape: ImageShapeRecord, markId: string | null | undefined): boolean;
35
+ export declare function isImageSmudgeToolbarActionId(actionId: string): boolean;
36
+ export declare function normalizeImageSmudgeBrush(brush?: Partial<ImageSmudgeBrush>): ImageSmudgeBrush;
37
+ export declare function startImageSmudgeSession({ brush, editor, shape, }: {
38
+ brush?: Partial<ImageSmudgeBrush>;
39
+ editor: Editor;
40
+ shape: ImageShapeRecord;
41
+ }): boolean;
42
+ export declare function cancelImageSmudgeSession(editor: Editor): void;
43
+ export declare function completeImageSmudgeSession(editor: Editor): void;
44
+ export declare function cancelImageSmudgeSessionIfActive(editor: Editor): boolean;
45
+ export declare function clearImageSmudgeSessionForShape(editor: Editor, shapeId: ShapeId): void;
46
+ export declare function getImageSmudgeSessionSnapshot(editor: Editor, shapeId: ShapeId): ImageSmudgeSessionSnapshot | null;
47
+ export declare function getActiveImageSmudgeSession(editor: Editor): ImageSmudgeSessionSnapshot | null;
48
+ export declare function subscribeImageSmudgeSession(editor: Editor, subscriber: ImageSmudgeSubscriber): () => void;
49
+ export declare function beginImageSmudgeStroke(editor: Editor, point: ImageSmudgeStrokePoint): void;
50
+ export declare function addImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
51
+ export declare function appendImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
52
+ export declare function endImageSmudgeStroke(editor: Editor): void;
53
+ export declare function registerImageSmudgeConfirmHandler(editor: Editor, handler: ImageSmudgeConfirmHandler): () => void;
54
+ export declare function requestImageSmudgeConfirm(editor: Editor, input?: ImageSmudgeConfirmInput): Promise<unknown>;
55
+ export declare function cloneImageSmudgeStrokes(strokes: readonly ImageSmudgeStroke[]): ImageSmudgeStroke[];
56
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type LandInteractionHandler } from "../canvas-core/index";
2
+ export declare function createImageSmudgeInteractionHandler(): LandInteractionHandler;
@@ -0,0 +1,2 @@
1
+ import type { CanvasAction } from "../canvas-core/index";
2
+ export declare function createImageSmudgeCanvasActions(): CanvasAction[];
@@ -0,0 +1,17 @@
1
+ import { type CanvasAction, type ToolbarGroup } from "../canvas-core/index";
2
+ export declare function createImageStyleCanvasActions(): CanvasAction[];
3
+ export declare function createImageCornerRadiusToolbarGroup({ dataUiPrefix, id, order, }: {
4
+ dataUiPrefix: string;
5
+ id: string;
6
+ order: number;
7
+ }): ToolbarGroup;
8
+ export declare function createImageCornerRadiusToolbarItem({ dataUiPrefix, }: {
9
+ dataUiPrefix: string;
10
+ }): {
11
+ kind: "text-input";
12
+ id: string;
13
+ actionId: string;
14
+ label: string;
15
+ placeholder: string;
16
+ dataUi: string;
17
+ };
@@ -0,0 +1,3 @@
1
+ import type { ContextMenuContribution, ToolbarContribution } from "../canvas-core/index";
2
+ export declare function createImageToolbarContributions(): ToolbarContribution[];
3
+ export declare function createImageContextMenuContributions(): ContextMenuContribution[];
@@ -1,9 +1,24 @@
1
1
  import { type AssetId, type AssetRecordBase, type BaseRecord, type ShapeRecordBase } from "../canvas-core/index";
2
+ export type ImageRemoteCopyState = {
3
+ status: "pending-local-copy";
4
+ } | {
5
+ status: "copy-failed";
6
+ errorMessage?: string;
7
+ };
8
+ export type ImageAssetSource = {
9
+ kind: "local";
10
+ storageKey: string;
11
+ originalUrl?: string;
12
+ } | {
13
+ kind: "remote";
14
+ url: string;
15
+ copyState?: ImageRemoteCopyState;
16
+ };
2
17
  export interface ImageAssetProps {
3
18
  w: number;
4
19
  h: number;
5
20
  name: string;
6
- storageKey: string;
21
+ source: ImageAssetSource;
7
22
  mimeType: string | null;
8
23
  fileSize?: number;
9
24
  isAnimated: boolean;
@@ -27,6 +42,7 @@ export interface ImageShapeProps {
27
42
  h: number;
28
43
  assetId: AssetId | null;
29
44
  crop: ImageShapeCrop | null;
45
+ cornerRadius: number;
30
46
  altText: string;
31
47
  }
32
48
  export interface ImageShapeRecord extends ShapeRecordBase<"image", ImageShapeProps> {
@@ -0,0 +1,2 @@
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createLaserCanvasRenderPlugin(): LandCanvasRenderPlugin;
@@ -0,0 +1,2 @@
1
+ import { type LandEditorRuntimePlugin } from "../canvas-core/index";
2
+ export declare function createLaserEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,4 +1,4 @@
1
1
  export { LaserTool } from "./laserTool";
2
- export { createLaserCanvasPlugin } from "./canvas";
3
- export { createLaserEditorPlugin } from "./editor";
2
+ export { createLaserCanvasRenderPlugin } from "./canvasRender";
3
+ export { createLaserEditorRuntimePlugin } from "./editorRuntime";
4
4
  export { Laser, createLaserFeatureBundle } from "./feature";
@@ -0,0 +1,5 @@
1
+ import { type TextFontCatalog } from "./textFonts";
2
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
3
+ export declare function createTextCanvasRenderPlugin({ fontCatalog, }?: {
4
+ fontCatalog?: TextFontCatalog;
5
+ }): LandCanvasRenderPlugin;
@@ -0,0 +1,5 @@
1
+ import { type LandEditorRuntimePlugin } from "../canvas-core/index";
2
+ import { type TextFontCatalog } from "./textFonts";
3
+ export declare function createTextEditorRuntimePlugin({ fontCatalog, }?: {
4
+ fontCatalog?: TextFontCatalog;
5
+ }): LandEditorRuntimePlugin;
@@ -0,0 +1,14 @@
1
+ export interface RichTextLinkHoverState {
2
+ href: string;
3
+ path: readonly number[];
4
+ rect: DOMRect;
5
+ }
6
+ export declare function RichTextLinkPopover({ link, onApply, onKeepVisible, onClear, }: {
7
+ link: RichTextLinkHoverState | null;
8
+ onApply(input: {
9
+ path: readonly number[];
10
+ href: string | null;
11
+ }): void;
12
+ onKeepVisible(): void;
13
+ onClear(): void;
14
+ }): import("react").ReactPortal | null;
@@ -1,3 +1,11 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { RichTextDocument } from "../textTypes";
3
- export declare function renderRichTextDocument(richText: RichTextDocument): ReactNode;
3
+ export interface RichTextRenderLinkHandlers {
4
+ onPointerEnter?(input: {
5
+ href: string;
6
+ path: readonly number[];
7
+ element: HTMLSpanElement;
8
+ }): void;
9
+ onPointerLeave?(): void;
10
+ }
11
+ export declare function renderRichTextDocument(richText: RichTextDocument, linkHandlers?: RichTextRenderLinkHandlers): ReactNode;
@@ -1,4 +1,6 @@
1
1
  export { Text, createTextFeatureBundle } from "./feature";
2
+ export { createTextEditorRuntimePlugin } from "./editorRuntime";
3
+ export { createTextCanvasRenderPlugin } from "./canvasRender";
2
4
  export { DEFAULT_TEXT_FONT, HOST_TEXT_FONT, createDefaultTextFontCatalog, createDefaultTextExtensionOptions, } from "./textFonts";
3
5
  export { createRichTextFromPlainText, getPlainTextFromRichText, validateRichTextDocument, } from "./richTextUtils";
4
6
  export { isTextShapeRecord, updateTextShapeRichText, } from "./textShapeHelpers";
@@ -0,0 +1,3 @@
1
+ export declare function normalizeRichTextLinkHref(value: string): string | null;
2
+ export declare function isAllowedRichTextLinkHref(value: string): boolean;
3
+ export declare function openRichTextLink(href: string): void;
@@ -7,7 +7,7 @@ export type RichTextTextNode = JSONContent & {
7
7
  export interface RichTextMarkStyle {
8
8
  fontWeight?: number;
9
9
  fontStyle?: "italic";
10
- textDecorationLine?: "line-through";
10
+ textDecorationLine?: string;
11
11
  }
12
12
  export declare function createRichTextFromPlainText(text: string): RichTextDocument;
13
13
  export declare function getPlainTextFromRichText(richTextDocument: RichTextDocument): string;
@@ -16,3 +16,4 @@ export declare function renderRichTextDocumentToHtml(richText: RichTextDocument)
16
16
  export declare function isRichTextTextNode(node: JSONContent): node is RichTextTextNode;
17
17
  export declare function getRichTextTextNodeStyle(node: RichTextTextNode): string | undefined;
18
18
  export declare function getRichTextMarkStyle(marks: JSONContent["marks"]): RichTextMarkStyle | undefined;
19
+ export declare function getRichTextLinkHref(marks: JSONContent["marks"]): string | undefined;
@@ -0,0 +1,10 @@
1
+ export declare const LAND_DOCUMENT_INDEXEDDB_NAME = "land.canvas.persistence";
2
+ export declare const LAND_DOCUMENT_INDEXEDDB_STORE = "snapshots";
3
+ export declare const LAND_IMAGE_BLOB_INDEXEDDB_STORE = "imageBlobs";
4
+ export declare const LAND_DOCUMENT_INDEXEDDB_VERSION = 2;
5
+ export declare function openLandCanvasDatabase(): Promise<IDBDatabase | null>;
6
+ export declare function readLandCanvasStoreValue(storeName: string, key: IDBValidKey): Promise<unknown | null>;
7
+ export declare function readLandCanvasStoreValues(storeName: string, keys: readonly IDBValidKey[]): Promise<readonly unknown[] | null>;
8
+ export declare function writeLandCanvasStoreValues(storeName: string, entries: readonly (readonly [IDBValidKey, unknown])[]): Promise<void>;
9
+ export declare function deleteLandCanvasStoreValue(storeName: string, key: IDBValidKey): Promise<void>;
10
+ export declare function getAllLandCanvasStoreKeys(storeName: string): Promise<IDBValidKey[] | null>;
@@ -1,12 +1,10 @@
1
1
  import type { Editor, StoreSnapshot } from "../_vendor/canvas-core/index";
2
2
  import type { ProductPersistenceAdapter } from "../core/runtime/productDefinition";
3
3
  import { type PersistedEditorSnapshots } from "./localSnapshotRestore";
4
- export declare const LAND_DOCUMENT_INDEXEDDB_NAME = "land.canvas.persistence";
5
- export declare const LAND_DOCUMENT_INDEXEDDB_STORE = "snapshots";
6
- export declare const LAND_IMAGE_BLOB_INDEXEDDB_STORE = "imageBlobs";
4
+ import { LAND_DOCUMENT_INDEXEDDB_NAME, LAND_DOCUMENT_INDEXEDDB_STORE, LAND_DOCUMENT_INDEXEDDB_VERSION, LAND_IMAGE_BLOB_INDEXEDDB_STORE } from "./indexedDb";
7
5
  export declare const LAND_DOCUMENT_STORAGE_KEY = "land.canvas.document";
8
6
  export declare const LAND_SESSION_STORAGE_KEY = "land.canvas.session";
9
- export declare const LAND_DOCUMENT_INDEXEDDB_VERSION = 2;
7
+ export { LAND_DOCUMENT_INDEXEDDB_NAME, LAND_DOCUMENT_INDEXEDDB_STORE, LAND_DOCUMENT_INDEXEDDB_VERSION, LAND_IMAGE_BLOB_INDEXEDDB_STORE, };
10
8
  export interface LocalSnapshotPersistenceOptions {
11
9
  storageNamespace?: string;
12
10
  }
@@ -1,5 +1,5 @@
1
1
  import type { ShapeId } from "../../_vendor/canvas-core/index";
2
- import type { CanvasProductController, CanvasProductControllerSnapshot, CanvasProductControllerOptions, CanvasProductSessionSnapshot } from "../../core/controller";
2
+ import type { CanvasProductController, CanvasProductControllerSnapshot, CanvasProductControllerOptions, CanvasProductSessionSnapshot } from "../../core/product-controller";
3
3
  import { type BuiltInCanvasShapeCreationControllers } from "./shapeCreationController";
4
4
  import { type BuiltInCanvasLayerNode } from "./layerController";
5
5
  export interface BuiltInCanvasControllerSnapshot<TToolId extends string = string> extends CanvasProductControllerSnapshot<TToolId> {
@@ -1,6 +1,6 @@
1
1
  import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
2
2
  import type { GeoShapeKind } from "../../_vendor/plugin-geo/index";
3
- import type { CanvasProductLayerNode } from "../../core/controller";
3
+ import type { CanvasProductLayerNode } from "../../core/product-controller";
4
4
  export interface BuiltInCanvasLayerNode extends CanvasProductLayerNode {
5
5
  geoKind?: GeoShapeKind;
6
6
  imageAssetId?: AssetId | null;
@@ -1,7 +1,8 @@
1
1
  import type { Editor, ShapeColor, ShapeId } from "../../_vendor/canvas-core/index";
2
2
  import { type ArrowShapeProps } from "../../_vendor/plugin-arrow/index";
3
+ import type { GeoShapeProps } from "../../_vendor/plugin-geo/index";
3
4
  import { type TextShapeProps } from "../../_vendor/plugin-text/index";
4
- import type { CanvasProductShapeRef } from "../../core/controller";
5
+ import type { CanvasProductShapeRef } from "../../core/product-controller";
5
6
  export interface BuiltInCanvasShapeInput {
6
7
  x: number;
7
8
  y: number;
@@ -10,6 +11,10 @@ export interface BuiltInCanvasShapeInput {
10
11
  fill?: ShapeColor;
11
12
  stroke?: ShapeColor;
12
13
  strokeWidth?: number;
14
+ meta?: Record<string, unknown>;
15
+ }
16
+ export interface BuiltInCanvasRectangleInput extends BuiltInCanvasShapeInput {
17
+ cornerRadiusPercent?: GeoShapeProps["cornerRadiusPercent"];
13
18
  }
14
19
  export interface BuiltInCanvasTextInput {
15
20
  x: number;
@@ -21,6 +26,7 @@ export interface BuiltInCanvasTextInput {
21
26
  color?: ShapeColor;
22
27
  size?: TextShapeProps["size"];
23
28
  textAlign?: TextShapeProps["textAlign"];
29
+ meta?: Record<string, unknown>;
24
30
  }
25
31
  export interface BuiltInCanvasFrameInput extends BuiltInCanvasShapeInput {
26
32
  name?: string;
@@ -48,9 +54,10 @@ export interface BuiltInCanvasArrowInput {
48
54
  headEnd?: ArrowShapeProps["headEnd"];
49
55
  startBinding?: BuiltInCanvasArrowBindingInput | null;
50
56
  endBinding?: BuiltInCanvasArrowBindingInput | null;
57
+ meta?: Record<string, unknown>;
51
58
  }
52
59
  export interface BuiltInGeoController {
53
- createRectangle(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
60
+ createRectangle(input: BuiltInCanvasRectangleInput): CanvasProductShapeRef | null;
54
61
  createEllipse(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
55
62
  createDiamond(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
56
63
  createTriangle(input: BuiltInCanvasShapeInput): CanvasProductShapeRef | null;
@@ -2,4 +2,4 @@ export { builtInCanvasExtensions, createBuiltInCanvasExtensions, hasBuiltInCanva
2
2
  export type { BuiltInCanvasExtension, BuiltInCanvasExtensionOptions, } from "./extensions";
3
3
  export { createBuiltInCanvasController, useBuiltInCanvasController, } from "./controller/createBuiltInCanvasController";
4
4
  export type { BuiltInCanvasController, BuiltInCanvasControllerSnapshot, BuiltInCanvasLayerNode, } from "./controller/createBuiltInCanvasController";
5
- export type { BuiltInArrowController, BuiltInCanvasArrowBindingInput, BuiltInCanvasArrowInput, BuiltInCanvasFrameInput, BuiltInCanvasShapeCreationControllers, BuiltInCanvasShapeInput, BuiltInCanvasTextInput, BuiltInFrameController, BuiltInGeoController, BuiltInTextController, } from "./controller/shapeCreationController";
5
+ export type { BuiltInArrowController, BuiltInCanvasArrowBindingInput, BuiltInCanvasArrowInput, BuiltInCanvasFrameInput, BuiltInCanvasRectangleInput, BuiltInCanvasShapeCreationControllers, BuiltInCanvasShapeInput, BuiltInCanvasTextInput, BuiltInFrameController, BuiltInGeoController, BuiltInTextController, } from "./controller/shapeCreationController";
@@ -0,0 +1,2 @@
1
+ import { type RefObject } from "react";
2
+ export declare function useCanvasKitWheelCapture(ref: RefObject<HTMLElement | null>): void;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import type { ToolbarSurfaces } from "./bindings/useToolbarSurfaces";
2
+ import type { ToolbarSurfaces } from "./useToolbarSurfaces";
3
3
  export declare function FloatingSelectionToolbarPageSpace({ children, className, dataUi, offset, surfaces, }: {
4
4
  children: ReactNode;
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- import { type ToolbarGroup } from "../../../_vendor/canvas-core/index";
1
+ import { type ToolbarGroup } from "../../_vendor/canvas-core/index";
2
2
  export declare function getActiveToolLabel(groups: readonly ToolbarGroup[], activeToolId: string): string;
3
3
  export declare function getSelectionToolbarTitle({ commonShapeType, count, isMixedFrameAndPointHandleSelection, singleShapeType, }: {
4
4
  commonShapeType: string | null;
@@ -1,5 +1,5 @@
1
1
  import type { Editor, CanvasActionContext, ToolbarGroup } from "../../_vendor/canvas-core/index";
2
- import type { CanvasPluginHostRuntime } from "../../_vendor/canvas-react/host/index";
2
+ import type { CanvasRenderPluginHostRuntime } from "../../_vendor/canvas-react/host/index";
3
3
  export interface FloatingSelectionToolbarPageAnchor {
4
4
  x: number;
5
5
  y: number;
@@ -22,5 +22,5 @@ export interface ToolbarSurfaces {
22
22
  export declare function useToolbarSurfaces({ canShowContextToolbarDuringEditing, editor, pluginHostRuntime, }: {
23
23
  canShowContextToolbarDuringEditing?: (context: CanvasActionContext) => boolean;
24
24
  editor: Editor;
25
- pluginHostRuntime: CanvasPluginHostRuntime;
25
+ pluginHostRuntime: CanvasRenderPluginHostRuntime;
26
26
  }): ToolbarSurfaces;
package/chrome/types.d.ts CHANGED
@@ -1,16 +1,20 @@
1
1
  import type { CanvasKitController, CanvasKitBaseController } from "../controller/canvasKitController";
2
2
  import type { BuiltInCanvasLayerNode } from "../builtins";
3
3
  import type { ActiveContextMenu, EditorSelectionState, ShapeId, CanvasActionValue, CanvasActionContext } from "../_vendor/canvas-core/index";
4
- import type { HistoryControls, PageControls, ZoomControlsState } from "./bindings/useCanvasKitChromeControls";
5
- import type { ContextMenuSurface } from "./bindings/useContextMenuSurface";
6
- import type { SvgExportControls } from "./bindings/useSvgExport";
7
- import type { ToolbarSurfaces } from "./bindings/useToolbarSurfaces";
4
+ import type { HistoryControls } from "./useHistoryControls";
5
+ import type { PageControls } from "./usePageControls";
6
+ import type { ZoomControlsState } from "./useZoomControls";
7
+ import type { ContextMenuSurface } from "./useContextMenuSurface";
8
+ import type { SvgExportControls } from "./useSvgExport";
9
+ import type { ToolbarSurfaces } from "./toolbar/useToolbarSurfaces";
8
10
  import type { ProductPersistenceStatus } from "../core";
9
11
  export type { ContextMenuCommandItem, ContextMenuItem, ContextMenuSection, EditorSelectionState, ShapeId, CanvasActionValue, CanvasActionContext, ToolbarGroup, ToolbarItem, } from "../_vendor/canvas-core/index";
10
- export type { HistoryControls, PageControls, ZoomControlsState, } from "./bindings/useCanvasKitChromeControls";
11
- export type { ContextMenuSurface } from "./bindings/useContextMenuSurface";
12
- export type { SvgExportControls, } from "./bindings/useSvgExport";
13
- export type { ToolbarSurfaces, } from "./bindings/useToolbarSurfaces";
12
+ export type { HistoryControls } from "./useHistoryControls";
13
+ export type { PageControls } from "./usePageControls";
14
+ export type { ZoomControlsState } from "./useZoomControls";
15
+ export type { ContextMenuSurface } from "./useContextMenuSurface";
16
+ export type { SvgExportControls, } from "./useSvgExport";
17
+ export type { ToolbarSurfaces, } from "./toolbar/useToolbarSurfaces";
14
18
  export type CanvasKitLayerNode = BuiltInCanvasLayerNode;
15
19
  export interface CanvasKitToolbarActionState {
16
20
  value: CanvasActionValue | undefined;
@@ -2,15 +2,17 @@ import { type RefObject } from "react";
2
2
  import { type ActiveContextMenu } from "../_vendor/canvas-core/index";
3
3
  import type { CanvasKitBaseController } from "../controller/canvasKitController";
4
4
  import type { CanvasKitRuntime } from "../runtime/canvasKitRuntime";
5
- import type { CanvasKitHostExtension } from "../runtime/canvasKitHostExtensions";
6
- import type { ProductServiceRegistry } from "../core";
5
+ import type { CanvasKitChromeSlot, CanvasKitHostFeature } from "../runtime/canvasKitHostContracts";
6
+ import type { ProductApiRegistry, ProductServiceRegistry } from "../core";
7
7
  import type { CanvasKitChromeContext, CanvasKitGridControls, CanvasKitPersistenceControls } from "./types";
8
- export declare function useCanvasKitChromeContext<TController extends CanvasKitBaseController>({ controller, activeContextMenu, editor, grid, hostExtensions, onActiveContextMenuChange, persistence, pluginHostRuntime, services, themeRootRef, }: {
8
+ export declare function useCanvasKitChromeContext<TController extends CanvasKitBaseController>({ apis, controller, activeContextMenu, chromeSlots, editor, grid, hostFeatures, onActiveContextMenuChange, persistence, pluginHostRuntime, services, themeRootRef, }: {
9
+ apis: ProductApiRegistry;
9
10
  controller: TController;
10
11
  activeContextMenu: ActiveContextMenu | null;
12
+ chromeSlots: readonly CanvasKitChromeSlot<string, unknown>[];
11
13
  editor: CanvasKitRuntime["editor"];
12
14
  grid: CanvasKitGridControls;
13
- hostExtensions: readonly CanvasKitHostExtension[];
15
+ hostFeatures: readonly CanvasKitHostFeature[];
14
16
  onActiveContextMenuChange: (activeContextMenu: ActiveContextMenu | null) => void;
15
17
  persistence: CanvasKitPersistenceControls;
16
18
  pluginHostRuntime: CanvasKitRuntime["pluginHostRuntime"];
@@ -1,4 +1,4 @@
1
- import type { CanvasKitLayerTreeSource, CanvasKitLayerNode } from "../types";
1
+ import type { CanvasKitLayerTreeSource, CanvasKitLayerNode } from "./types";
2
2
  export declare function useCanvasKitLayerTree(source: CanvasKitLayerTreeSource, options?: {
3
3
  enabled?: boolean;
4
4
  pageId?: string;
@@ -1,5 +1,5 @@
1
- import type { ContextMenuContext, ActiveContextMenu, ContextMenuSection, Editor } from "../../_vendor/canvas-core/index";
2
- import type { CanvasPluginHostRuntime } from "../../_vendor/canvas-react/host/index";
1
+ import type { ContextMenuContext, ActiveContextMenu, ContextMenuSection, Editor } from "../_vendor/canvas-core/index";
2
+ import type { CanvasRenderPluginHostRuntime } from "../_vendor/canvas-react/host/index";
3
3
  export interface ContextMenuSurface {
4
4
  context: ContextMenuContext | null;
5
5
  activeContextMenu: ActiveContextMenu | null;
@@ -8,5 +8,5 @@ export interface ContextMenuSurface {
8
8
  export declare function useContextMenuSurface({ editor, activeContextMenu, pluginHostRuntime, }: {
9
9
  editor: Editor;
10
10
  activeContextMenu: ActiveContextMenu | null;
11
- pluginHostRuntime: CanvasPluginHostRuntime;
11
+ pluginHostRuntime: CanvasRenderPluginHostRuntime;
12
12
  }): ContextMenuSurface;
@@ -0,0 +1,12 @@
1
+ import type { Editor } from "../_vendor/canvas-core/index";
2
+ import type { CanvasKitHostFeature } from "../runtime/canvasKitHostContracts";
3
+ export interface HistoryControls {
4
+ canUndo: boolean;
5
+ canRedo: boolean;
6
+ undo(): void;
7
+ redo(): void;
8
+ }
9
+ export declare function useHistoryControls({ editor, hostFeatures, }: {
10
+ editor: Editor;
11
+ hostFeatures: readonly CanvasKitHostFeature[];
12
+ }): HistoryControls;
@@ -0,0 +1,16 @@
1
+ import type { Editor, PageId, PageRecord } from "../_vendor/canvas-core/index";
2
+ import type { CanvasKitHostFeature } from "../runtime/canvasKitHostContracts";
3
+ export interface PageControls {
4
+ pages: readonly PageRecord[];
5
+ currentPage: PageRecord | null;
6
+ currentPageId: PageId;
7
+ canDeleteCurrentPage: boolean;
8
+ createPage(): void;
9
+ deleteCurrentPage(): void;
10
+ renameCurrentPage(nextName: string): void;
11
+ selectPage(pageId: PageId): void;
12
+ }
13
+ export declare function usePageControls({ editor, hostFeatures, }: {
14
+ editor: Editor;
15
+ hostFeatures: readonly CanvasKitHostFeature[];
16
+ }): PageControls;
@@ -1,6 +1,6 @@
1
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 "../../core";
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
4
  export type ExportStatus = ProductExportStatus;
5
5
  export type SvgAssetInliner = ProductSvgAssetInliner;
6
6
  export type SvgExportResult = ProductSvgExportResult;
@@ -0,0 +1,9 @@
1
+ import type { Editor } from "../_vendor/canvas-core/index";
2
+ export interface ZoomControlsState {
3
+ zoom: number;
4
+ label: string;
5
+ zoomIn(): void;
6
+ zoomOut(): void;
7
+ resetZoom(): void;
8
+ }
9
+ export declare function useZoomControls(editor: Editor): ZoomControlsState;
@@ -1,24 +1,27 @@
1
- import { type CanvasProductController, type CanvasProductControllerContext, type CanvasProductSessionSnapshot } from "../core/controller";
2
- import type { CanvasPluginHostRuntime } from "../_vendor/canvas-react/host/index";
3
- import { type BuiltInCanvasController, type BuiltInCanvasControllerSnapshot, type BuiltInCanvasFrameInput, type BuiltInCanvasShapeInput, type BuiltInCanvasTextInput } from "../builtins";
4
- import { type ImageProductController } from "../features/image";
1
+ import { type CanvasProductController, type CanvasProductControllerContext, type CanvasProductSessionSnapshot } from "../core/product-controller";
2
+ import type { CanvasRenderPluginHostRuntime } from "../_vendor/canvas-react/host/index";
3
+ import { type BuiltInCanvasController, type BuiltInCanvasControllerSnapshot, type BuiltInCanvasFrameInput, type BuiltInCanvasRectangleInput, type BuiltInCanvasShapeInput, type BuiltInCanvasTextInput } from "../builtins";
4
+ import type { CanvasKitControllerSlot } from "../runtime/canvasKitHostContracts";
5
5
  export type CanvasKitShapeInput = BuiltInCanvasShapeInput;
6
+ export type CanvasKitRectangleInput = BuiltInCanvasRectangleInput;
6
7
  export type CanvasKitTextInput = BuiltInCanvasTextInput;
7
8
  export type CanvasKitFrameInput = BuiltInCanvasFrameInput;
8
9
  export interface CanvasKitBaseController<TToolId extends string = string> extends CanvasProductController<TToolId> {
9
10
  }
11
+ export interface CanvasKitControllerSlots {
12
+ }
10
13
  export declare const CANVAS_KIT_TOOL_IDS: readonly ["select", "hand", "rectangle", "ellipse", "diamond", "triangle", "hexagon", "star", "arrow", "draw", "path", "text", "frame", "eraser", "laser"];
11
14
  export type CanvasKitToolId = (typeof CANVAS_KIT_TOOL_IDS)[number];
12
15
  export interface CanvasKitControllerSnapshot<TToolId extends string = CanvasKitToolId> extends BuiltInCanvasControllerSnapshot<TToolId> {
13
16
  productId: string;
14
17
  session: CanvasProductSessionSnapshot<TToolId>;
15
18
  }
16
- export interface CanvasKitController<TToolId extends string = CanvasKitToolId> extends BuiltInCanvasController<TToolId> {
17
- image: ImageProductController | null;
19
+ export interface CanvasKitController<TToolId extends string = CanvasKitToolId> extends BuiltInCanvasController<TToolId>, CanvasKitControllerSlots {
18
20
  snapshot(): CanvasKitControllerSnapshot<TToolId>;
19
21
  }
20
22
  export interface CanvasKitControllerRuntimeContext extends Omit<CanvasProductControllerContext, "pluginHostRuntime"> {
21
- pluginHostRuntime: CanvasPluginHostRuntime;
23
+ controllerSlots: readonly CanvasKitControllerSlot<string, unknown>[];
24
+ pluginHostRuntime: CanvasRenderPluginHostRuntime;
22
25
  }
23
26
  export interface CanvasKitControllerOptions<TToolId extends string = CanvasKitToolId> extends CanvasKitControllerRuntimeContext {
24
27
  assertToolId?: (toolId: string) => asserts toolId is TToolId;
@@ -0,0 +1,12 @@
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;
package/core/index.d.ts CHANGED
@@ -1,24 +1,9 @@
1
1
  export { createDefaultCanvasProductEditor } from "./runtime/productEditor";
2
2
  export { cleanupProductAssetsAfterRestore, preloadProductAssets, resolveProductAssetUrl, } from "./runtime/productAssets";
3
- export { createProductFeatureControllerRegistry, createProductFeatureControllerToken, } from "./controller/featureControllerRegistry";
3
+ export { createProductApiRegistry, createProductApiToken, } from "./api/apiRegistry";
4
4
  export { createProductServiceRegistry, createProductServiceToken, requireProductService, } from "./runtime/productServices";
5
- export { CANVAS_KIT_HOST_ACTION_IDS } from "./features/hostActionIds";
6
5
  export type { CanvasProductRuntimeInitializer, CanvasProductRuntimeInitializerContext, CreateCanvasProductEditorOptions, ProductPersistenceAdapter, ProductPersistenceRestoreResult, ProductPersistenceStatus, } from "./runtime/productDefinition";
7
- export type { CanvasProductRuntimeContribution, } from "./runtime/productContributions";
8
- export type { ProductContextMenuRegistry, ProductPluginHostRuntime, ProductToolbarRegistry, } from "./runtime/productHost";
6
+ export type { ProductActionRegistry, ProductContextMenuRegistry, ProductPluginHostRuntime, ProductToolbarRegistry, } from "./runtime/productHost";
9
7
  export type { ProductAssetResolverService, ProductServiceFactory, ProductServiceFactoryContext, ProductServiceRegistry, ProductServiceRegistryRuntime, ProductServiceToken, } from "./runtime/productServices";
10
- export type { ProductFeatureControllerRegistry, ProductFeatureControllerRegistryRuntime, ProductFeatureControllerToken, } from "./controller/featureControllerRegistry";
11
- export type { CanvasProductControllerChange, CanvasProductControllerChangeKey, CanvasProductControllerChangeListener, } from "./controller";
12
- export { SYSTEM_SELECTION_BRING_FORWARD_ACTION_ID, SYSTEM_SELECTION_BRING_TO_FRONT_ACTION_ID, SYSTEM_SELECTION_DELETE_ACTION_ID, SYSTEM_SELECTION_DUPLICATE_ACTION_ID, SYSTEM_SELECTION_FLIP_HORIZONTAL_ACTION_ID, SYSTEM_SELECTION_FLIP_VERTICAL_ACTION_ID, SYSTEM_SELECTION_GROUP_ACTION_ID, SYSTEM_SELECTION_RESET_ROTATION_ACTION_ID, SYSTEM_SELECTION_SELECT_ALL_ACTION_ID, SYSTEM_SELECTION_SEND_BACKWARD_ACTION_ID, SYSTEM_SELECTION_SEND_TO_BACK_ACTION_ID, SYSTEM_SELECTION_UNGROUP_ACTION_ID, runCanvasAction, } from "./features/actions/canvasActions";
13
- export { createToolbarProductContribution } from "./features/toolbar/toolbarContribution";
14
- export { createCanvasActionContext } from "./features/actions/canvasActionContext";
15
- export { getActiveToolLabel, getSelectionToolbarTitle, } from "./features/toolbar/toolbarLabels";
16
- export { SYSTEM_VIEW_RESET_ZOOM_ACTION_ID, SYSTEM_VIEW_ZOOM_IN_ACTION_ID, SYSTEM_VIEW_ZOOM_OUT_ACTION_ID, runContextMenuAction, } from "./features/context-menu/contextMenuActions";
17
- export { createContextMenuProductContribution } from "./features/context-menu/contextMenuContribution";
18
- export { createContextMenuContext, getContextMenuContributionTarget, } from "./features/context-menu/contextMenuContext";
19
- export { canvasClipboardServiceToken, memoryCanvasClipboardService, } from "./features/clipboard/clipboardService";
20
- export type { CanvasClipboardService } from "./features/clipboard/clipboardService";
21
- export { SYSTEM_CLIPBOARD_COPY_ACTION_ID, SYSTEM_CLIPBOARD_CUT_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_ACTION_ID, SYSTEM_CLIPBOARD_PASTE_AT_POINT_ACTION_ID, createClipboardProductContribution, registerClipboardActions, } from "./features/clipboard/clipboardContribution";
22
- export { getCanvasClipboardService, } from "./features/clipboard/clipboardService";
23
- export { exportEditorSvg, getSvgExportStatus, } from "./features/export/svgExport";
24
- export type { ExportStatus, SvgAssetInliner, SvgExportOptions, SvgExportResult, } from "./features/export/svgExport";
8
+ export type { ProductApiRegistry, ProductApiRegistryRuntime, ProductApiToken, } from "./api/apiRegistry";
9
+ export type { CanvasProductControllerChange, CanvasProductControllerChangeKey, CanvasProductControllerChangeListener, CanvasProductCreatePageInput, CanvasProductDocumentRef, CanvasProductShapeData, CanvasProductShapeUpdate, } from "./product-controller";