@yuzhouu/canvas-kit 0.1.7 → 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 (183) hide show
  1. package/README.md +5 -1
  2. package/_vendor/canvas-core/editor/commands.d.ts +10 -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 +13 -4
  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/canvasRender.d.ts +2 -0
  34. package/_vendor/plugin-arrow/{editor.d.ts → editorRuntime.d.ts} +2 -2
  35. package/_vendor/plugin-arrow/index.d.ts +2 -2
  36. package/_vendor/plugin-draw/canvasRender.d.ts +2 -0
  37. package/_vendor/plugin-draw/{editor.d.ts → editorRuntime.d.ts} +2 -2
  38. package/_vendor/plugin-draw/index.d.ts +2 -2
  39. package/_vendor/plugin-eraser/canvasRender.d.ts +2 -0
  40. package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -0
  41. package/_vendor/plugin-eraser/index.d.ts +2 -2
  42. package/_vendor/plugin-frame/{canvas.d.ts → canvasRender.d.ts} +2 -2
  43. package/_vendor/plugin-frame/{editor.d.ts → editorRuntime.d.ts} +2 -2
  44. package/_vendor/plugin-frame/index.d.ts +2 -2
  45. package/_vendor/plugin-geo/{canvas.d.ts → canvasRender.d.ts} +2 -2
  46. package/_vendor/plugin-geo/{editor.d.ts → editorRuntime.d.ts} +2 -2
  47. package/_vendor/plugin-geo/geoGeometry.d.ts +19 -3
  48. package/_vendor/plugin-geo/index.d.ts +2 -2
  49. package/_vendor/plugin-geo/types.d.ts +1 -0
  50. package/_vendor/plugin-group/{canvas.d.ts → canvasRender.d.ts} +2 -2
  51. package/_vendor/plugin-group/{editor.d.ts → editorRuntime.d.ts} +2 -2
  52. package/_vendor/plugin-group/index.d.ts +2 -2
  53. package/_vendor/plugin-image/{editor.d.ts → actionIds.d.ts} +0 -8
  54. package/_vendor/plugin-image/canvasRender.d.ts +2 -0
  55. package/_vendor/plugin-image/cropRuntime.d.ts +2 -0
  56. package/_vendor/plugin-image/editorRuntime.d.ts +5 -0
  57. package/_vendor/plugin-image/imageHostActionContract.d.ts +2 -0
  58. package/_vendor/plugin-image/imageShapeUtil.d.ts +2 -1
  59. package/_vendor/plugin-image/imageSvgExporter.d.ts +6 -0
  60. package/_vendor/plugin-image/index.d.ts +8 -4
  61. package/_vendor/plugin-image/runtimeShared.d.ts +5 -0
  62. package/_vendor/plugin-image/smudge.d.ts +56 -0
  63. package/_vendor/plugin-image/smudgeInteractions.d.ts +2 -0
  64. package/_vendor/plugin-image/smudgeRuntime.d.ts +2 -0
  65. package/_vendor/plugin-image/styleRuntime.d.ts +17 -0
  66. package/_vendor/plugin-image/toolbarRuntime.d.ts +3 -0
  67. package/_vendor/plugin-image/types.d.ts +16 -1
  68. package/_vendor/plugin-laser/canvasRender.d.ts +2 -0
  69. package/_vendor/plugin-laser/editorRuntime.d.ts +2 -0
  70. package/_vendor/plugin-laser/index.d.ts +2 -2
  71. package/_vendor/plugin-text/canvasRender.d.ts +5 -0
  72. package/_vendor/plugin-text/editorRuntime.d.ts +5 -0
  73. package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +14 -0
  74. package/_vendor/plugin-text/host/richTextRendering.d.ts +9 -1
  75. package/_vendor/plugin-text/index.d.ts +2 -0
  76. package/_vendor/plugin-text/richTextLinks.d.ts +3 -0
  77. package/_vendor/plugin-text/richTextUtils.d.ts +2 -1
  78. package/browser/indexedDb.d.ts +10 -0
  79. package/browser/persistence.d.ts +2 -4
  80. package/builtins/controller/createBuiltInCanvasController.d.ts +1 -1
  81. package/builtins/controller/layerController.d.ts +1 -1
  82. package/builtins/controller/shapeCreationController.d.ts +6 -2
  83. package/builtins/index.d.ts +1 -1
  84. package/chrome/toolbar/CanvasKitWheelCapture.d.ts +2 -0
  85. package/chrome/{FloatingSelectionToolbarPageSpace.d.ts → toolbar/FloatingSelectionToolbarPageSpace.d.ts} +1 -1
  86. package/{core/features → chrome}/toolbar/toolbarLabels.d.ts +1 -1
  87. package/chrome/{bindings → toolbar}/useToolbarSurfaces.d.ts +2 -2
  88. package/chrome/types.d.ts +12 -8
  89. package/chrome/useCanvasKitChromeContext.d.ts +6 -4
  90. package/chrome/{bindings/useCanvasKitLayerTree.d.ts → useCanvasKitLayerTree.d.ts} +1 -1
  91. package/chrome/{bindings/useContextMenuSurface.d.ts → useContextMenuSurface.d.ts} +3 -3
  92. package/chrome/useHistoryControls.d.ts +12 -0
  93. package/chrome/usePageControls.d.ts +16 -0
  94. package/chrome/{bindings/useSvgExport.d.ts → useSvgExport.d.ts} +2 -2
  95. package/chrome/useZoomControls.d.ts +9 -0
  96. package/controller/canvasKitController.d.ts +10 -7
  97. package/core/api/apiRegistry.d.ts +12 -0
  98. package/core/index.d.ts +4 -19
  99. package/core/{controller → product-controller}/canvasProductController.d.ts +17 -4
  100. package/core/product-controller/index.d.ts +2 -0
  101. package/core/runtime/productDefinition.d.ts +5 -4
  102. package/core/runtime/productHost.d.ts +5 -2
  103. package/{core/features/actions/canvasActionContext.d.ts → features/actions/actionRuntime.d.ts} +7 -1
  104. package/{core/features → features}/clipboard/clipboardContextMenuContributions.d.ts +1 -1
  105. package/features/clipboard/clipboardContribution.d.ts +11 -0
  106. package/features/clipboard/clipboardHostExtension.d.ts +2 -0
  107. package/{core/features → features}/clipboard/clipboardService.d.ts +3 -3
  108. package/features/context-menu/contextMenuRuntime.d.ts +13 -0
  109. package/{core/features → features}/export/svgExport.d.ts +1 -1
  110. package/features/image/asset/imageAssetService.d.ts +11 -0
  111. package/features/image/{imageBlobStore.d.ts → asset/imageBlobStore.d.ts} +3 -2
  112. package/features/image/asset/imageFileHelpers.d.ts +49 -0
  113. package/features/image/{svgImageAssetInliner.d.ts → asset/svgImageAssetInliner.d.ts} +1 -1
  114. package/features/image/controller/imageProductController.d.ts +27 -0
  115. package/features/image/imageHostExtension.d.ts +10 -5
  116. package/features/image/{ImageImportController.d.ts → import/ImageImportController.d.ts} +3 -3
  117. package/features/image/{useImageImport.d.ts → import/useImageImport.d.ts} +3 -4
  118. package/features/image/index.d.ts +17 -15
  119. package/features/image/smudge/imageSmudgeHostActions.d.ts +10 -0
  120. package/features/image/smudge/imageSmudgeTypes.d.ts +24 -0
  121. package/features/image/toolbar/imageHostActions.d.ts +69 -0
  122. package/features/image/{imageToolbarHostBridge.d.ts → toolbar/imageToolbarHostBridge.d.ts} +2 -2
  123. package/features/keyboard/keyboardShortcutHostExtension.d.ts +2 -0
  124. package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +6 -0
  125. package/{react → features/persistence}/CanvasKitPersistenceNotice.d.ts +1 -1
  126. package/features/persistence/persistenceHostExtension.d.ts +2 -0
  127. package/{core/features/actions/canvasActions.d.ts → features/selection/selectionActions.d.ts} +3 -9
  128. package/{core/features/toolbar → features/selection}/selectionContextMenuContributions.d.ts +1 -1
  129. package/features/selection/selectionHostExtension.d.ts +2 -0
  130. package/features/selection/selectionToolbarContributions.d.ts +2 -0
  131. package/features/tool/toolActions.d.ts +2 -0
  132. package/{core/features/toolbar → features/tool}/toolContextMenuContributions.d.ts +1 -1
  133. package/features/tool/toolHostExtension.d.ts +2 -0
  134. package/features/tool/toolToolbarContributions.d.ts +2 -0
  135. package/features/view/viewActions.d.ts +5 -0
  136. package/{core/features/context-menu → features/view}/viewContextMenuContributions.d.ts +1 -1
  137. package/features/view/viewHostExtension.d.ts +2 -0
  138. package/host/defaultHostExtensions.d.ts +2 -0
  139. package/index.d.ts +12 -7
  140. package/index.mjs +96 -76
  141. package/package.json +1 -1
  142. package/product/canvasKitProduct.d.ts +8 -7
  143. package/react/useCanvasKitController.d.ts +1 -1
  144. package/react/useCanvasKitRuntime.d.ts +1 -1
  145. package/runtime/canvasKitHostContracts.d.ts +135 -0
  146. package/runtime/canvasKitHostFeatureHooks.d.ts +12 -0
  147. package/runtime/canvasKitRuntime.d.ts +8 -6
  148. package/runtime/canvasKitRuntimePlan.d.ts +50 -0
  149. package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +0 -6
  150. package/_vendor/canvas-react/host/pluginHost.d.ts +0 -2
  151. package/_vendor/canvas-react/host/pluginHostManifest.d.ts +0 -2
  152. package/_vendor/canvas-react/host/pluginHostRuntime.d.ts +0 -3
  153. package/_vendor/canvas-react/host/pluginHostTypes.d.ts +0 -102
  154. package/_vendor/canvas-react/host/pluginHostValidation.d.ts +0 -11
  155. package/_vendor/plugin-arrow/canvas.d.ts +0 -2
  156. package/_vendor/plugin-draw/canvas.d.ts +0 -2
  157. package/_vendor/plugin-eraser/canvas.d.ts +0 -2
  158. package/_vendor/plugin-eraser/editor.d.ts +0 -2
  159. package/_vendor/plugin-image/canvas.d.ts +0 -2
  160. package/_vendor/plugin-laser/canvas.d.ts +0 -2
  161. package/_vendor/plugin-laser/editor.d.ts +0 -2
  162. package/_vendor/plugin-text/canvas.d.ts +0 -5
  163. package/_vendor/plugin-text/editor.d.ts +0 -5
  164. package/chrome/bindings/useCanvasKitChromeControls.d.ts +0 -27
  165. package/core/controller/featureControllerRegistry.d.ts +0 -12
  166. package/core/controller/index.d.ts +0 -4
  167. package/core/features/clipboard/clipboardContribution.d.ts +0 -19
  168. package/core/features/context-menu/contextMenuActions.d.ts +0 -12
  169. package/core/features/context-menu/contextMenuContext.d.ts +0 -6
  170. package/core/features/context-menu/contextMenuContribution.d.ts +0 -4
  171. package/core/features/hostActionIds.d.ts +0 -1
  172. package/core/features/toolbar/toolbarContribution.d.ts +0 -4
  173. package/core/runtime/productContributions.d.ts +0 -9
  174. package/features/image/imageAssetService.d.ts +0 -7
  175. package/features/image/imageFileHelpers.d.ts +0 -35
  176. package/features/image/imageHostActions.d.ts +0 -36
  177. package/features/image/imageProductController.d.ts +0 -22
  178. package/features/image/imageProductToolbarActions.d.ts +0 -2
  179. package/react/useCanvasKitKeyboardShortcuts.d.ts +0 -6
  180. package/runtime/canvasKitHostExtensions.d.ts +0 -19
  181. package/runtime/canvasKitRuntimeInitializer.d.ts +0 -11
  182. /package/chrome/{CanvasKitFloatingToolbarLayer.d.ts → toolbar/CanvasKitFloatingToolbarLayer.d.ts} +0 -0
  183. /package/core/{controller → product-controller}/productLayerTree.d.ts +0 -0
@@ -1,12 +1,17 @@
1
- import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection, LandEditorPlugin } from "../../canvas-core/index";
1
+ import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection, LandEditorRuntimePlugin } from "../../canvas-core/index";
2
2
  export declare class CanvasContextMenuRegistry {
3
3
  private readonly contributions;
4
+ private readonly contributionsByTarget;
5
+ private readonly contributionIndexes;
4
6
  private readonly duplicateContributionIds;
7
+ private nextContributionIndex;
5
8
  registerContribution(contribution: ContextMenuContribution, options?: {
6
9
  replace?: boolean;
7
10
  }): void;
8
- registerEditorPlugins(plugins: readonly LandEditorPlugin[]): void;
11
+ registerEditorRuntimePlugins(plugins: readonly LandEditorRuntimePlugin[]): void;
9
12
  getDuplicateContributionIds(): string[];
10
13
  getSections(target: ContextMenuContributionTarget, context: ContextMenuContext): ContextMenuSection[];
14
+ private addToIndex;
15
+ private removeFromIndex;
11
16
  }
12
- export declare function createCanvasContextMenuRegistry(plugins?: readonly LandEditorPlugin[]): CanvasContextMenuRegistry;
17
+ export declare function createCanvasContextMenuRegistry(plugins?: readonly LandEditorRuntimePlugin[]): CanvasContextMenuRegistry;
@@ -1,11 +1,11 @@
1
- import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type LandCanvasPlugin } from "./canvasPlugin";
1
+ import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type LandCanvasRenderPlugin } from "./canvasRenderPlugin";
2
2
  export declare class CanvasDomEventGuardRegistry {
3
3
  private readonly guards;
4
4
  private readonly registeredGuardIds;
5
5
  register(guard: CanvasDomEventGuard): void;
6
- registerCanvasPlugins(plugins: readonly LandCanvasPlugin[]): void;
6
+ registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
7
7
  getGuards(): readonly CanvasDomEventGuard[];
8
8
  handle(input: CanvasDomEventGuardInput): "continue" | "handled";
9
9
  getCursor(input: CanvasDomEventGuardCursorInput): string | undefined;
10
10
  }
11
- export declare function createCanvasDomEventGuardRegistry(plugins?: readonly LandCanvasPlugin[]): CanvasDomEventGuardRegistry;
11
+ export declare function createCanvasDomEventGuardRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasDomEventGuardRegistry;
@@ -1,10 +1,10 @@
1
- import type { LandEditorPlugin, ShapeRecordBase } from "../../canvas-core/index";
2
- import type { LandCanvasPlugin } from "./canvasPlugin";
1
+ import type { LandEditorRuntimePlugin, ShapeRecordBase } from "../../canvas-core/index";
2
+ import type { LandCanvasRenderPlugin } from "./canvasRenderPlugin";
3
3
  type LandExtensionOptions = Record<string, unknown>;
4
4
  export interface LandFeatureBundle {
5
5
  id: string;
6
- editorPlugins: readonly LandEditorPlugin[];
7
- canvasPlugins: readonly LandCanvasPlugin[];
6
+ editorRuntimePlugins: readonly LandEditorRuntimePlugin[];
7
+ canvasRenderPlugins: readonly LandCanvasRenderPlugin[];
8
8
  shapeTypes: readonly ShapeRecordBase["type"][];
9
9
  }
10
10
  export interface LandExtension {
@@ -1,3 +1,4 @@
1
+ export { CanvasActionRegistry, createCanvasActionRegistry, } from "./actionRegistry";
1
2
  export { CanvasRendererRegistryContext, useCanvasRendererRegistry, } from "./canvasRendererRegistryContext";
2
3
  export { CanvasOverlayRegistryContext, useCanvasOverlayRegistry, } from "./canvasOverlayRegistryContext";
3
4
  export { CanvasDomEventGuardRegistry, createCanvasDomEventGuardRegistry, } from "./domEventGuards";
@@ -5,9 +6,9 @@ export { CanvasOverlayRegistry, createCanvasOverlayRegistry, } from "./overlayRe
5
6
  export { CanvasRendererRegistry, createCanvasRendererRegistry, } from "./rendererRegistry";
6
7
  export { CanvasToolbarRegistry, createCanvasToolbarRegistry, } from "./toolbarRegistry";
7
8
  export { CanvasContextMenuRegistry, createCanvasContextMenuRegistry, } from "./contextMenuRegistry";
8
- export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasPluginComponent, CanvasPluginProvider, LandCanvasPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeRendererProps, } from "./canvasPlugin";
9
- export { getShapeStrokeForHover, SHAPE_HOVER_STROKE, } from "./canvasPlugin";
9
+ export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPluginProvider, LandCanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeRendererProps, } from "./canvasRenderPlugin";
10
+ export { getShapeStrokeForHover, SHAPE_HOVER_STROKE, } from "./canvasRenderPlugin";
10
11
  export { defineLandExtension, resolveLandExtensions, } from "./extension";
11
12
  export type { ConfigurableLandExtension, LandExtension, LandExtensionConfig, LandExtensionOptionsInput, LandFeatureBundle, ResolvedLandExtension, } from "./extension";
12
- export { createCanvasPluginHostRuntime } from "./pluginHost";
13
- export type { CanvasPluginHostManifestContextMenuContributionEntry, CanvasPluginHostManifestEntry, CanvasPluginHostManifestToolbarContributionEntry, CanvasPluginHostRuntime, CanvasPluginHostShapeValidationSummary, CanvasPluginHostSource, CanvasPluginHostValidationIssue, CanvasPluginHostValidationIssueSeverity, CanvasPluginHostValidationSummary, CanvasPluginHostVerdict, CreateCanvasPluginHostRuntimeOptions, } from "./pluginHost";
13
+ export { createCanvasRenderPluginHostRuntime } from "./canvasRenderPluginHost";
14
+ export type { CanvasRenderPluginHostManifestContextMenuContributionEntry, CanvasRenderPluginHostManifestEntry, CanvasRenderPluginHostManifestToolbarContributionEntry, CanvasRenderPluginHostRuntime, CanvasRenderPluginHostShapeValidationSummary, CanvasRenderPluginHostSource, CanvasRenderPluginHostValidationIssue, CanvasRenderPluginHostValidationIssueSeverity, CanvasRenderPluginHostValidationSummary, CanvasRenderPluginHostVerdict, CreateCanvasRenderPluginHostRuntimeOptions, } from "./canvasRenderPluginHost";
@@ -1,5 +1,5 @@
1
1
  import type { SelectionCustomHandle } from "../../canvas-core/index";
2
- import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer, LandCanvasPlugin, RegisteredSelectionCustomHandleRenderer } from "./canvasPlugin";
2
+ import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer, LandCanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer } from "./canvasRenderPlugin";
3
3
  export declare class CanvasOverlayRegistry {
4
4
  private readonly selectionCustomHandleRenderers;
5
5
  private readonly canvasOverlays;
@@ -13,6 +13,6 @@ export declare class CanvasOverlayRegistry {
13
13
  getSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): AnyRegisteredSelectionCustomHandleRenderer | null;
14
14
  hasSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): boolean;
15
15
  getRegisteredSelectionCustomHandleTypes(): SelectionCustomHandle["type"][];
16
- registerCanvasPlugins(plugins: readonly LandCanvasPlugin[]): void;
16
+ registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
17
17
  }
18
- export declare function createCanvasOverlayRegistry(plugins?: readonly LandCanvasPlugin[]): CanvasOverlayRegistry;
18
+ export declare function createCanvasOverlayRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasOverlayRegistry;
@@ -1,5 +1,5 @@
1
1
  import type { ShapeRecordBase } from "../../canvas-core/index";
2
- import type { AnyRegisteredShapeRenderer, LandCanvasPlugin, RegisteredShapeRenderer } from "./canvasPlugin";
2
+ import type { AnyRegisteredShapeRenderer, LandCanvasRenderPlugin, RegisteredShapeRenderer } from "./canvasRenderPlugin";
3
3
  export declare class CanvasRendererRegistry {
4
4
  private readonly registry;
5
5
  private readonly registeredPluginIds;
@@ -7,6 +7,6 @@ export declare class CanvasRendererRegistry {
7
7
  getShapeRenderer(type: ShapeRecordBase["type"]): AnyRegisteredShapeRenderer | null;
8
8
  hasShapeRenderer(type: ShapeRecordBase["type"]): boolean;
9
9
  getRegisteredShapeTypes(): ShapeRecordBase["type"][];
10
- registerCanvasPlugins(plugins: readonly LandCanvasPlugin[]): void;
10
+ registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
11
11
  }
12
- export declare function createCanvasRendererRegistry(plugins?: readonly LandCanvasPlugin[]): CanvasRendererRegistry;
12
+ export declare function createCanvasRendererRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasRendererRegistry;
@@ -1,24 +1,20 @@
1
- import type { LandEditorPlugin, CanvasAction, CanvasActionContext, ToolbarContribution, ToolbarGroup, ToolbarPlacement, ToolbarSurface } from "../../canvas-core/index";
1
+ import type { LandEditorRuntimePlugin, CanvasActionContext, ToolbarContribution, ToolbarGroup, ToolbarPlacement, ToolbarSurface } from "../../canvas-core/index";
2
2
  export declare class CanvasToolbarRegistry {
3
- private readonly actions;
4
3
  private readonly contributions;
5
- private readonly hostActionIds;
6
- private readonly duplicateActionIds;
4
+ private readonly contributionsBySurface;
5
+ private readonly contributionsBySurfaceAndPlacement;
6
+ private readonly contributionIndexes;
7
7
  private readonly duplicateContributionIds;
8
- registerAction(action: CanvasAction, options?: {
9
- replace?: boolean;
10
- }): void;
11
- registerHostAction(action: CanvasAction): void;
8
+ private nextContributionIndex;
12
9
  registerContribution(contribution: ToolbarContribution, options?: {
13
10
  replace?: boolean;
14
11
  }): void;
15
- registerEditorPlugins(plugins: readonly LandEditorPlugin[]): void;
16
- getAction(actionId: string): CanvasAction | null;
17
- getHostActionIds(): string[];
18
- getDuplicateActionIds(): string[];
12
+ registerEditorRuntimePlugins(plugins: readonly LandEditorRuntimePlugin[]): void;
19
13
  getDuplicateContributionIds(): string[];
20
14
  getGroups(surface: ToolbarSurface, context: CanvasActionContext, options?: {
21
15
  placement?: ToolbarPlacement;
22
16
  }): ToolbarGroup[];
17
+ private addToIndexes;
18
+ private removeFromIndexes;
23
19
  }
24
- export declare function createCanvasToolbarRegistry(plugins?: readonly LandEditorPlugin[]): CanvasToolbarRegistry;
20
+ export declare function createCanvasToolbarRegistry(plugins?: readonly LandEditorRuntimePlugin[]): CanvasToolbarRegistry;
@@ -0,0 +1,2 @@
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createArrowCanvasRenderPlugin(): LandCanvasRenderPlugin;
@@ -1,7 +1,7 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
1
+ import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
2
2
  import type { ArrowShapeRecord } from "./types";
3
3
  export declare class ArrowShapeSvgExporter implements ShapeSvgExporter<ArrowShapeRecord> {
4
4
  readonly type: "arrow";
5
5
  toSvg(shape: ArrowShapeRecord, context: SvgExportContext): SvgNode;
6
6
  }
7
- export declare function createArrowEditorPlugin(): LandEditorPlugin;
7
+ export declare function createArrowEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,8 +1,8 @@
1
1
  export { ArrowBindingUtil } from "./arrowBindingUtil";
2
2
  export { ArrowShapeUtil } from "./arrowShapeUtil";
3
3
  export { ArrowTool } from "./arrowTool";
4
- export { ArrowShapeSvgExporter, createArrowEditorPlugin } from "./editor";
5
- export { createArrowCanvasPlugin } from "./canvas";
4
+ export { ArrowShapeSvgExporter, createArrowEditorRuntimePlugin } from "./editorRuntime";
5
+ export { createArrowCanvasRenderPlugin } from "./canvasRender";
6
6
  export { Arrow, createArrowFeatureBundle } from "./feature";
7
7
  export { isArrowBindingRecord, isArrowShapeRecord, type ArrowBindingProps, type ArrowBindingRecord, type ArrowPoint, type ArrowShapeProps, type ArrowShapeRecord, type ArrowTerminal, } from "./types";
8
8
  export { getArrowBindingAnchorPagePoint, resolveArrowBindingPagePoint, } from "./arrowBindingAnchors";
@@ -0,0 +1,2 @@
1
+ import type { LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createDrawCanvasRenderPlugin(): LandCanvasRenderPlugin;
@@ -1,7 +1,7 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
1
+ import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
2
2
  import { type DrawShapeRecord } from "./types";
3
3
  export declare class DrawShapeSvgExporter implements ShapeSvgExporter<DrawShapeRecord> {
4
4
  readonly type: "draw";
5
5
  toSvg(shape: DrawShapeRecord, context: SvgExportContext): SvgNode | null;
6
6
  }
7
- export declare function createDrawEditorPlugin(): LandEditorPlugin;
7
+ export declare function createDrawEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,8 +1,8 @@
1
1
  export { DrawTool } from "./drawTool";
2
2
  export { DrawShapeUtil } from "./drawShapeUtil";
3
- export { DrawShapeSvgExporter, createDrawEditorPlugin } from "./editor";
3
+ export { DrawShapeSvgExporter, createDrawEditorRuntimePlugin } from "./editorRuntime";
4
4
  export { DrawShapeSvg } from "./DrawShapeRenderer";
5
- export { createDrawCanvasPlugin } from "./canvas";
5
+ export { createDrawCanvasRenderPlugin } from "./canvasRender";
6
6
  export { Draw, createDrawFeatureBundle } from "./feature";
7
7
  export { flipDrawShapeInSelectionBounds, getDrawShapeDiagnostics, getDrawShapePageSegments, getDrawShapePagePoints, normalizeTransformedDrawShape, } from "./drawGeometry";
8
8
  export { interpolateDrawShapeRecords } from "./drawInterpolation";
@@ -0,0 +1,2 @@
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createEraserCanvasRenderPlugin(): LandCanvasRenderPlugin;
@@ -0,0 +1,2 @@
1
+ import { type LandEditorRuntimePlugin } from "../canvas-core/index";
2
+ export declare function createEraserEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,4 +1,4 @@
1
1
  export { EraserTool } from "./eraserTool";
2
- export { createEraserCanvasPlugin } from "./canvas";
3
- export { createEraserEditorPlugin } from "./editor";
2
+ export { createEraserCanvasRenderPlugin } from "./canvasRender";
3
+ export { createEraserEditorRuntimePlugin } from "./editorRuntime";
4
4
  export { Eraser, createEraserFeatureBundle } from "./feature";
@@ -1,9 +1,9 @@
1
- import { type LandCanvasPlugin } from "../canvas-react/host/index";
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
2
  import type { FrameShapeRecord } from "./frameShapeUtil";
3
3
  interface FrameShapeSvgProps {
4
4
  shape: FrameShapeRecord;
5
5
  isHovered?: boolean;
6
6
  }
7
- export declare function createFrameCanvasPlugin(): LandCanvasPlugin;
7
+ export declare function createFrameCanvasRenderPlugin(): LandCanvasRenderPlugin;
8
8
  export declare function FrameShapeSvg({ shape, isHovered }: FrameShapeSvgProps): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,7 +1,7 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgNode, type SvgExportContext } from "../canvas-core/index";
1
+ import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgNode, type SvgExportContext } from "../canvas-core/index";
2
2
  import { type FrameShapeRecord } from "./frameShapeUtil";
3
3
  export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShapeRecord> {
4
4
  readonly type: "frame";
5
5
  toSvg(shape: FrameShapeRecord, context: SvgExportContext): SvgNode;
6
6
  }
7
- export declare function createFrameEditorPlugin(): LandEditorPlugin;
7
+ export declare function createFrameEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,6 +1,6 @@
1
1
  export { FrameShapeUtil } from "./frameShapeUtil";
2
2
  export type { FrameShapeProps, FrameShapeRecord } from "./frameShapeUtil";
3
3
  export { FrameTool } from "./frameTool";
4
- export { FrameShapeSvgExporter, createFrameEditorPlugin } from "./editor";
5
- export { createFrameCanvasPlugin } from "./canvas";
4
+ export { FrameShapeSvgExporter, createFrameEditorRuntimePlugin } from "./editorRuntime";
5
+ export { createFrameCanvasRenderPlugin } from "./canvasRender";
6
6
  export { Frame, createFrameFeatureBundle } from "./feature";
@@ -1,5 +1,5 @@
1
1
  import { type ShapeColor } from "../canvas-core/index";
2
- import { type LandCanvasPlugin } from "../canvas-react/host/index";
2
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
3
3
  import type { GeoShapeRecord } from "./types";
4
4
  interface GeoShapeSvgProps {
5
5
  shape: GeoShapeRecord;
@@ -8,6 +8,6 @@ interface GeoShapeSvgProps {
8
8
  stroke?: ShapeColor;
9
9
  strokeWidth?: number;
10
10
  }
11
- export declare function createGeoCanvasPlugin(): LandCanvasPlugin;
11
+ export declare function createGeoCanvasRenderPlugin(): LandCanvasRenderPlugin;
12
12
  export declare function GeoShapeSvg({ shape, fill, isHovered, stroke, strokeWidth, }: GeoShapeSvgProps): import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -1,7 +1,7 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
1
+ import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
2
2
  import { type GeoShapeRecord } from "./types";
3
3
  export declare class GeoShapeSvgExporter implements ShapeSvgExporter<GeoShapeRecord> {
4
4
  readonly type: "geo";
5
5
  toSvg(shape: GeoShapeRecord, context: SvgExportContext): SvgNode;
6
6
  }
7
- export declare function createGeoEditorPlugin(): LandEditorPlugin;
7
+ export declare function createGeoEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,8 +1,24 @@
1
1
  import { Box, Vec } from "../canvas-core/index";
2
2
  import type { GeoShapeKind } from "./types";
3
3
  export declare const GEO_ELLIPSE_SEGMENTS = 32;
4
- export declare function getGeoOutlinePoints(bounds: Box, geo: GeoShapeKind): Vec[];
4
+ export declare const GEO_RECTANGLE_DEFAULT_CORNER_RADIUS_PERCENT = 12;
5
+ export declare const GEO_RECTANGLE_MAX_CORNER_RADIUS_PERCENT = 50;
6
+ export declare const GEO_RECTANGLE_CORNER_SEGMENTS = 4;
7
+ export declare function getGeoOutlinePoints(bounds: Box, geo: GeoShapeKind, options?: {
8
+ cornerRadiusPercent?: unknown;
9
+ }): Vec[];
5
10
  export declare function getGeoEllipsePoints(bounds: Box, segments?: number): Vec[];
6
- export declare function getGeoPolygonPoints(bounds: Box, geo: Exclude<GeoShapeKind, "ellipse">): Vec[];
7
- export declare function getGeoPolygonPoints(bounds: Box, geo: GeoShapeKind): Vec[];
11
+ export declare function normalizeGeoRectangleCornerRadiusPercent(value: unknown, fallback?: number): number;
12
+ export declare function getGeoRectangleCornerRadius({ cornerRadiusPercent, h, w, }: {
13
+ cornerRadiusPercent?: unknown;
14
+ h: number;
15
+ w: number;
16
+ }): number;
17
+ export declare function getGeoRoundedRectanglePoints(bounds: Box, radius?: number, segments?: number): Vec[];
18
+ export declare function getGeoPolygonPoints(bounds: Box, geo: Exclude<GeoShapeKind, "ellipse">, options?: {
19
+ cornerRadiusPercent?: unknown;
20
+ }): Vec[];
21
+ export declare function getGeoPolygonPoints(bounds: Box, geo: GeoShapeKind, options?: {
22
+ cornerRadiusPercent?: unknown;
23
+ }): Vec[];
8
24
  export declare function isPointInPolygon(point: Vec, points: readonly Vec[]): boolean;
@@ -1,7 +1,7 @@
1
1
  export { DiamondTool, EllipseTool, HexagonTool, RectangleTool, StarTool, TriangleTool, } from "./geoTools";
2
2
  export { GeoShapeUtil } from "./geoShapeUtil";
3
- export { GeoShapeSvgExporter, createGeoEditorPlugin } from "./editor";
4
- export { GeoShapeSvg, createGeoCanvasPlugin } from "./canvas";
3
+ export { GeoShapeSvgExporter, createGeoEditorRuntimePlugin } from "./editorRuntime";
4
+ export { GeoShapeSvg, createGeoCanvasRenderPlugin } from "./canvasRender";
5
5
  export { Geo, createGeoFeatureBundle } from "./feature";
6
6
  export type { GeoShapeKind, GeoShapeProps, GeoShapeRecord } from "./types";
7
7
  export { GEO_SHAPE_KINDS, isGeoShapeKind, isGeoShapeRecord } from "./types";
@@ -8,6 +8,7 @@ export interface GeoShapeProps {
8
8
  fill: ShapeColor;
9
9
  stroke: ShapeColor;
10
10
  strokeWidth: number;
11
+ cornerRadiusPercent: number;
11
12
  }
12
13
  export interface GeoShapeRecord extends ShapeRecordBase<"geo", GeoShapeProps> {
13
14
  type: "geo";
@@ -1,10 +1,10 @@
1
- import { type LandCanvasPlugin } from "../canvas-react/host/index";
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
2
  import type { GroupShapeRecord } from "./groupShapeUtil";
3
3
  interface GroupShapeSvgProps {
4
4
  shape: GroupShapeRecord;
5
5
  isHovered?: boolean;
6
6
  isSelected?: boolean;
7
7
  }
8
- export declare function createGroupCanvasPlugin(): LandCanvasPlugin;
8
+ export declare function createGroupCanvasRenderPlugin(): LandCanvasRenderPlugin;
9
9
  export declare function GroupShapeSvg({ shape, isHovered, isSelected, }: GroupShapeSvgProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,7 +1,7 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
1
+ import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
2
2
  import { type GroupShapeRecord } from "./groupShapeUtil";
3
3
  export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShapeRecord> {
4
4
  readonly type: "group";
5
5
  toSvg(_shape: GroupShapeRecord): SvgNode;
6
6
  }
7
- export declare function createGroupEditorPlugin(): LandEditorPlugin;
7
+ export declare function createGroupEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -1,5 +1,5 @@
1
1
  export { GroupShapeUtil } from "./groupShapeUtil";
2
2
  export type { GroupShapeProps, GroupShapeRecord } from "./groupShapeUtil";
3
- export { GroupShapeSvgExporter, createGroupEditorPlugin } from "./editor";
4
- export { createGroupCanvasPlugin } from "./canvas";
3
+ export { GroupShapeSvgExporter, createGroupEditorRuntimePlugin } from "./editorRuntime";
4
+ export { createGroupCanvasRenderPlugin } from "./canvasRender";
5
5
  export { Group, createGroupFeatureBundle } from "./feature";
@@ -1,5 +1,3 @@
1
- import { type LandEditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode, type CanvasActionContext } from "../canvas-core/index";
2
- import { type ImageShapeRecord } from "./types";
3
1
  export declare const IMAGE_REPLACE_TOOLBAR_ACTION_ID = "image.replace";
4
2
  export declare const IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID = "image.download-original";
5
3
  export declare const IMAGE_INSERT_TOOLBAR_ACTION_ID = "image.insert";
@@ -9,9 +7,3 @@ export declare const IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID = "image.crop.zoom";
9
7
  export declare const IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID = "image.crop.aspect-ratio";
10
8
  export declare const IMAGE_CROP_RESET_TOOLBAR_ACTION_ID = "image.crop.reset";
11
9
  export declare const IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID = "image.corner-radius";
12
- export declare class ImageShapeSvgExporter implements ShapeSvgExporter<ImageShapeRecord> {
13
- readonly type: "image";
14
- toSvg(shape: ImageShapeRecord, context: SvgExportContext): SvgNode | null;
15
- }
16
- export declare function createImageEditorPlugin(): LandEditorPlugin;
17
- export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
@@ -0,0 +1,2 @@
1
+ import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createImageCanvasRenderPlugin(): LandCanvasRenderPlugin;
@@ -0,0 +1,2 @@
1
+ import type { CanvasAction } from "../canvas-core/index";
2
+ export declare function createImageCropCanvasActions(): CanvasAction[];
@@ -0,0 +1,5 @@
1
+ import type { LandEditorRuntimePlugin } from "../canvas-core/index";
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
+ export { ImageShapeSvgExporter } from "./imageSvgExporter";
4
+ export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
5
+ export declare function createImageEditorRuntimePlugin(): LandEditorRuntimePlugin;
@@ -0,0 +1,2 @@
1
+ import type { CanvasAction } from "../canvas-core/index";
2
+ export declare function createImageHostToolbarActionContract(actionId: string): CanvasAction;
@@ -1,4 +1,4 @@
1
- import { Box, ShapeUtil, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionResizeAspectRatioLockInput } from "../canvas-core/index";
1
+ import { Box, ShapeUtil, type ShapeEditEndInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionResizeAspectRatioLockInput } from "../canvas-core/index";
2
2
  import type { ImageShapeProps, ImageShapeRecord } from "./types";
3
3
  export declare class ImageShapeUtil extends ShapeUtil<ImageShapeRecord> {
4
4
  readonly type: "image";
@@ -8,5 +8,6 @@ export declare class ImageShapeUtil extends ShapeUtil<ImageShapeRecord> {
8
8
  canReceiveTerminalBinding(_shape: ImageShapeRecord): boolean;
9
9
  getSelectionResizeAspectRatioLock(_shape: ImageShapeRecord, input: ShapeSelectionResizeAspectRatioLockInput): boolean | null;
10
10
  canEdit(_shape: ImageShapeRecord): boolean;
11
+ onEditEnd(shape: ImageShapeRecord, input: ShapeEditEndInput): void;
11
12
  getSelectionHandleAnchors(shape: ImageShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
12
13
  }
@@ -0,0 +1,6 @@
1
+ import type { ShapeSvgExporter, SvgExportContext, SvgNode } from "../canvas-core/index";
2
+ import type { ImageShapeRecord } from "./types";
3
+ export declare class ImageShapeSvgExporter implements ShapeSvgExporter<ImageShapeRecord> {
4
+ readonly type: "image";
5
+ toSvg(shape: ImageShapeRecord, context: SvgExportContext): SvgNode | null;
6
+ }
@@ -1,8 +1,12 @@
1
- export { 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_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter, createImageEditorPlugin, isImageCropToolbarSession, } from "./editor";
2
- export { createImageCanvasPlugin } from "./canvas";
1
+ export { 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_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter, createImageEditorRuntimePlugin, isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./editorRuntime";
2
+ export { createImageCanvasRenderPlugin } from "./canvasRender";
3
3
  export { createImageCropInteractionHandler, createImageCropSelectionHandleInteractionHandler, } from "./cropInteractions";
4
- export { getImageCropModeMarkId } from "./crop";
4
+ export { createImageSmudgeInteractionHandler } from "./smudgeInteractions";
5
+ export { getImageCropModeMarkId, getImageCropRectOrDefault, } from "./crop";
6
+ export type { ImageCropRect } from "./crop";
7
+ export { IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_TOOLBAR_ACTION_ID, cancelImageSmudgeSession, cancelImageSmudgeSessionIfActive, cloneImageSmudgeStrokes, completeImageSmudgeSession, getActiveImageSmudgeSession, getImageSmudgeModeMarkId, isImageSmudgeModeForShape, isImageSmudgeToolbarActionId, registerImageSmudgeConfirmHandler, requestImageSmudgeConfirm, startImageSmudgeSession, } from "./smudge";
8
+ export type { ImageSmudgeBrush, ImageSmudgeStroke, ImageSmudgeStrokePoint, } from "./smudge";
5
9
  export { Image, createImageFeatureBundle } from "./feature";
6
10
  export { ImageShapeUtil } from "./imageShapeUtil";
7
- export type { ImageAssetProps, ImageAssetRecord, ImageShapeCrop, ImageShapeProps, ImageShapeRecord, } from "./types";
11
+ export type { ImageAssetProps, ImageAssetRecord, ImageAssetSource, ImageRemoteCopyState, ImageShapeCrop, ImageShapeProps, ImageShapeRecord, } from "./types";
8
12
  export { isImageAssetRecord, isImageShapeRecord } from "./types";
@@ -0,0 +1,5 @@
1
+ import type { CanvasActionContext } from "../canvas-core/index";
2
+ import { type ImageShapeRecord } from "./types";
3
+ export declare function getSingleSelectedImageShape(context: CanvasActionContext): ImageShapeRecord | null;
4
+ export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
5
+ export declare function isImageSmudgeToolbarSession(context: CanvasActionContext): boolean;
@@ -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;
@@ -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;