@yuzhouu/canvas-kit 0.1.11 → 0.1.13

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 (229) hide show
  1. package/README.md +47 -13
  2. package/_vendor/canvas-core/bindings/bindingUtil.d.ts +1 -0
  3. package/_vendor/canvas-core/editor/clipboard.d.ts +1 -1
  4. package/_vendor/canvas-core/editor/commands.d.ts +0 -2
  5. package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +4 -0
  6. package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +3 -4
  7. package/_vendor/canvas-core/editor/resizeGeometry.d.ts +20 -0
  8. package/_vendor/canvas-core/editor/selectionResizeCapabilities.d.ts +2 -0
  9. package/_vendor/canvas-core/geometry/mat.d.ts +2 -3
  10. package/_vendor/canvas-core/index.d.ts +4 -2
  11. package/_vendor/canvas-core/schema/records.d.ts +0 -1
  12. package/_vendor/canvas-core/schema/snapshots.d.ts +2 -2
  13. package/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  14. package/_vendor/canvas-core/shapes/shapeUtil.d.ts +3 -3
  15. package/_vendor/canvas-plugin-sdk/capability.d.ts +0 -6
  16. package/_vendor/canvas-plugin-sdk/index.d.ts +1 -16
  17. package/_vendor/canvas-plugin-sdk/plugin.d.ts +5 -52
  18. package/_vendor/canvas-plugin-sdk/setupExtension.d.ts +5 -0
  19. package/_vendor/canvas-product-contracts/actionRegistry.d.ts +4 -0
  20. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/actions.d.ts +10 -16
  21. package/_vendor/canvas-product-contracts/capability.d.ts +8 -0
  22. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/chrome.d.ts +1 -0
  23. package/_vendor/canvas-product-contracts/chromeRegistry.d.ts +9 -0
  24. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/contextMenu.d.ts +4 -0
  25. package/_vendor/canvas-product-contracts/contextMenuRegistry.d.ts +4 -0
  26. package/_vendor/canvas-product-contracts/exportRegistry.d.ts +6 -0
  27. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/exports.d.ts +1 -0
  28. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/importRegistry.d.ts +1 -4
  29. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/imports.d.ts +1 -0
  30. package/_vendor/canvas-product-contracts/index.d.ts +15 -0
  31. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/productApi.d.ts +6 -5
  32. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/services.d.ts +2 -1
  33. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/toolbar.d.ts +3 -6
  34. package/_vendor/canvas-product-contracts/toolbarRegistry.d.ts +9 -0
  35. package/_vendor/plugin-arrow/api.d.ts +2 -2
  36. package/_vendor/plugin-frame/api.d.ts +2 -2
  37. package/_vendor/plugin-geo/api.d.ts +2 -2
  38. package/_vendor/plugin-group/groupContributions.d.ts +1 -1
  39. package/_vendor/plugin-group/productRuntime.d.ts +1 -1
  40. package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
  41. package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
  42. package/_vendor/plugin-image/productRuntime.d.ts +1 -1
  43. package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
  44. package/_vendor/plugin-image/smudgeRuntime.d.ts +1 -1
  45. package/_vendor/plugin-image/styleRuntime.d.ts +1 -1
  46. package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
  47. package/_vendor/plugin-runtime-clipboard/capability.d.ts +1 -0
  48. package/_vendor/{plugin-builtin-clipboard/clipboardContribution.d.ts → plugin-runtime-clipboard/clipboardActions.d.ts} +1 -6
  49. package/_vendor/{plugin-builtin-clipboard → plugin-runtime-clipboard}/clipboardService.d.ts +2 -2
  50. package/_vendor/plugin-runtime-clipboard/index.d.ts +4 -0
  51. package/_vendor/plugin-runtime-clipboard/plugin.d.ts +1 -0
  52. package/_vendor/{plugin-builtin-export → plugin-runtime-export}/canvasExportApi.d.ts +2 -2
  53. package/_vendor/{plugin-builtin-export → plugin-runtime-export}/index.d.ts +1 -1
  54. package/_vendor/{plugin-builtin-export → plugin-runtime-export}/plugin.d.ts +1 -1
  55. package/_vendor/plugin-text/api.d.ts +2 -2
  56. package/_vendor/plugin-text/feature.d.ts +1 -1
  57. package/_vendor/plugin-text/textShapeHelpers.d.ts +0 -1
  58. package/browser/persistence.d.ts +1 -1
  59. package/canvasKitTools.d.ts +3 -0
  60. package/chrome/contextMenuRuntime.d.ts +7 -0
  61. package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +1 -1
  62. package/chrome/toolbar/mergeToolbarGroups.d.ts +8 -0
  63. package/chrome/toolbar/toolbarLabels.d.ts +1 -1
  64. package/chrome/toolbar/useToolbarSurfaces.d.ts +1 -1
  65. package/chrome/types.d.ts +7 -8
  66. package/chrome/useCanvasKitChromeContext.d.ts +7 -7
  67. package/chrome/useCanvasKitLayerTree.d.ts +3 -2
  68. package/chrome/useChromeSurfaces.d.ts +1 -1
  69. package/chrome/useContextMenuSurface.d.ts +1 -1
  70. package/chrome/useHistoryControls.d.ts +3 -3
  71. package/chrome/usePageControls.d.ts +8 -8
  72. package/chrome/useZoomControls.d.ts +5 -1
  73. package/commands/command.d.ts +11 -0
  74. package/commands/commandTokens.d.ts +61 -0
  75. package/commands/documentCommands.d.ts +2 -0
  76. package/commands/historyCommands.d.ts +3 -0
  77. package/commands/index.d.ts +11 -0
  78. package/commands/layerCommands.d.ts +20 -0
  79. package/commands/pageCommands.d.ts +12 -0
  80. package/commands/selectionCommands.d.ts +12 -0
  81. package/commands/shapeCommands.d.ts +8 -0
  82. package/commands/toolCommands.d.ts +2 -0
  83. package/commands/viewCommands.d.ts +10 -0
  84. package/contracts/canvasProductControllerContracts.d.ts +32 -0
  85. package/{core/product-controller → controller}/canvasProductController.d.ts +27 -55
  86. package/controller/index.d.ts +3 -0
  87. package/{core/product-controller/productLayerTree.d.ts → controller/layerTree.d.ts} +1 -1
  88. package/index.d.ts +31 -27
  89. package/index.mjs +88 -111
  90. package/package.json +2 -2
  91. package/plugins/host/image/api/imageHostApi.d.ts +11 -0
  92. package/plugins/host/image/api/imageHostApiContract.d.ts +60 -0
  93. package/{features → plugins/host}/image/asset/imageAssetService.d.ts +3 -2
  94. package/{features → plugins/host}/image/asset/imageBlobStore.d.ts +2 -2
  95. package/{features → plugins/host}/image/asset/imageFileHelpers.d.ts +1 -1
  96. package/{features → plugins/host}/image/asset/svgImageAssetInliner.d.ts +1 -1
  97. package/{features → plugins/host}/image/import/ImageImportController.d.ts +2 -2
  98. package/{features → plugins/host}/image/index.d.ts +4 -4
  99. package/plugins/host/image/plugin.d.ts +1 -0
  100. package/{features → plugins/host}/image/smudge/imageSmudgeHostActions.d.ts +3 -3
  101. package/{features → plugins/host}/image/toolbar/imageHostActions.d.ts +8 -24
  102. package/{features → plugins/host}/image/toolbar/imageToolbarHostBridge.d.ts +2 -2
  103. package/{features → plugins/host}/text/link/TextLinkHoverPopover.d.ts +1 -1
  104. package/plugins/host/text/textHostPlugin.d.ts +5 -0
  105. package/plugins/host/text/textSvgAssetInliner.d.ts +3 -0
  106. package/plugins/host/text/textSvgAssetPlugin.d.ts +2 -0
  107. package/{_vendor/plugin-builtin-import-host → plugins/runtime/import-host}/CanvasImportHost.d.ts +2 -1
  108. package/plugins/runtime/import-host/capability.d.ts +1 -0
  109. package/plugins/runtime/import-host/plugin.d.ts +1 -0
  110. package/plugins/runtime/keyboard-shortcuts/index.d.ts +1 -0
  111. package/plugins/runtime/keyboard-shortcuts/plugin.d.ts +1 -0
  112. package/plugins/runtime/keyboard-shortcuts/useCanvasKeyboardShortcuts.d.ts +6 -0
  113. package/plugins/runtime/tool-actions/capability.d.ts +1 -0
  114. package/{_vendor/plugin-builtin-tool-actions → plugins/runtime/tool-actions}/index.d.ts +1 -1
  115. package/plugins/runtime/tool-actions/plugin.d.ts +1 -0
  116. package/plugins/runtime/tool-actions/toolActions.d.ts +2 -0
  117. package/plugins/standard/clipboard/chrome.d.ts +2 -0
  118. package/plugins/standard/clipboard/contextMenu.d.ts +2 -0
  119. package/plugins/standard/clipboard/plugin.d.ts +1 -0
  120. package/plugins/standard/clipboard/shortcuts.d.ts +5 -0
  121. package/plugins/{standardCanvasKitPlugins.d.ts → standard/createStandardCanvasKitPlugins.d.ts} +2 -3
  122. package/plugins/standard/selection/actions.d.ts +21 -0
  123. package/plugins/standard/selection/chrome.d.ts +2 -0
  124. package/plugins/standard/selection/contextMenu.d.ts +2 -0
  125. package/plugins/standard/selection/plugin.d.ts +1 -0
  126. package/plugins/standard/selection/toolbar.d.ts +2 -0
  127. package/plugins/standard/tool-ui/contextMenu.d.ts +2 -0
  128. package/plugins/standard/tool-ui/plugin.d.ts +1 -0
  129. package/plugins/standard/tool-ui/toolbar.d.ts +2 -0
  130. package/plugins/standard/view/actions.d.ts +5 -0
  131. package/plugins/standard/view/chrome.d.ts +2 -0
  132. package/plugins/standard/view/contextMenu.d.ts +2 -0
  133. package/plugins/standard/view/plugin.d.ts +1 -0
  134. package/react/CanvasKitRoot.d.ts +3 -2
  135. package/react/useCanvasProductControllerLifecycle.d.ts +9 -0
  136. package/runtime/canvasKitActionContext.d.ts +17 -0
  137. package/runtime/canvasKitActionExecutor.d.ts +12 -0
  138. package/runtime/canvasKitCommandExecutor.d.ts +12 -3
  139. package/runtime/canvasKitPluginContracts.d.ts +13 -19
  140. package/{_vendor/canvas-plugin-sdk/lifecycle.d.ts → runtime/canvasKitPluginLifecycle.d.ts} +6 -5
  141. package/runtime/canvasKitPluginSetup.d.ts +9 -6
  142. package/{_vendor/canvas-plugin-sdk/pluginUi.d.ts → runtime/canvasKitPluginUi.d.ts} +5 -5
  143. package/runtime/canvasKitRuntime.d.ts +14 -5
  144. package/runtime/canvasKitRuntimeContracts.d.ts +8 -7
  145. package/runtime/canvasPluginGraph.d.ts +15 -0
  146. package/runtime/createCanvasKitCommandAction.d.ts +10 -0
  147. package/runtime/createCanvasKitEditor.d.ts +7 -0
  148. package/{core/runtime/runtimeContracts.d.ts → runtime/persistenceContracts.d.ts} +1 -6
  149. package/runtime/persistenceCoordinator.d.ts +1 -1
  150. package/{core/runtime/productAssets.d.ts → runtime/productAssetResolvers.d.ts} +11 -2
  151. package/runtime/productServiceRegistry.d.ts +8 -0
  152. package/runtime/registries/actionRegistry.d.ts +5 -0
  153. package/runtime/registries/chromeRegistry.d.ts +2 -0
  154. package/runtime/registries/contextMenuRegistry.d.ts +5 -0
  155. package/runtime/registries/exportRegistry.d.ts +2 -0
  156. package/runtime/registries/importRegistry.d.ts +2 -0
  157. package/runtime/registries/index.d.ts +7 -0
  158. package/runtime/registries/productApiRegistry.d.ts +5 -0
  159. package/runtime/registries/toolbarRegistry.d.ts +5 -0
  160. package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +0 -7
  161. package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +0 -15
  162. package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +0 -11
  163. package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +0 -9
  164. package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +0 -18
  165. package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +0 -2
  166. package/_vendor/plugin-builtin-clipboard/clipboardContextMenuContributions.d.ts +0 -2
  167. package/_vendor/plugin-builtin-clipboard/index.d.ts +0 -3
  168. package/_vendor/plugin-builtin-clipboard/plugin.d.ts +0 -1
  169. package/_vendor/plugin-builtin-import-host/capability.d.ts +0 -1
  170. package/_vendor/plugin-builtin-import-host/plugin.d.ts +0 -1
  171. package/_vendor/plugin-builtin-tool-actions/capability.d.ts +0 -1
  172. package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +0 -1
  173. package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +0 -2
  174. package/_vendor/plugin-connector/canvasRender.d.ts +0 -2
  175. package/_vendor/plugin-connector/connectorBindingUtil.d.ts +0 -28
  176. package/_vendor/plugin-connector/connectorBindings.d.ts +0 -8
  177. package/_vendor/plugin-connector/connectorGeometry.d.ts +0 -70
  178. package/_vendor/plugin-connector/connectorHandles.d.ts +0 -12
  179. package/_vendor/plugin-connector/connectorInteractions.d.ts +0 -3
  180. package/_vendor/plugin-connector/connectorMarker.d.ts +0 -7
  181. package/_vendor/plugin-connector/connectorModel.d.ts +0 -43
  182. package/_vendor/plugin-connector/connectorPortInteraction.d.ts +0 -13
  183. package/_vendor/plugin-connector/connectorPorts.d.ts +0 -23
  184. package/_vendor/plugin-connector/connectorRuntime.d.ts +0 -62
  185. package/_vendor/plugin-connector/connectorShapeUtil.d.ts +0 -29
  186. package/_vendor/plugin-connector/connectorTool.d.ts +0 -4
  187. package/_vendor/plugin-connector/constants.d.ts +0 -17
  188. package/_vendor/plugin-connector/editorRuntime.d.ts +0 -7
  189. package/_vendor/plugin-connector/feature.d.ts +0 -4
  190. package/_vendor/plugin-connector/index.d.ts +0 -18
  191. package/_vendor/plugin-connector/orthogonalRoute.d.ts +0 -9
  192. package/_vendor/plugin-connector/productRuntime.d.ts +0 -2
  193. package/_vendor/plugin-connector/quickConnect.d.ts +0 -28
  194. package/_vendor/plugin-connector/types.d.ts +0 -51
  195. package/_vendor/plugin-packaging/api.d.ts +0 -74
  196. package/_vendor/plugin-packaging/canvasRender.d.ts +0 -2
  197. package/_vendor/plugin-packaging/editorRuntime.d.ts +0 -2
  198. package/_vendor/plugin-packaging/feature.d.ts +0 -2
  199. package/_vendor/plugin-packaging/index.d.ts +0 -19
  200. package/_vendor/plugin-packaging/packagingArtwork.d.ts +0 -5
  201. package/_vendor/plugin-packaging/packagingDxf.d.ts +0 -9
  202. package/_vendor/plugin-packaging/packagingGeometry.d.ts +0 -74
  203. package/_vendor/plugin-packaging/packagingInteractions.d.ts +0 -2
  204. package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +0 -25
  205. package/_vendor/plugin-packaging/packagingRuntime.d.ts +0 -11
  206. package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +0 -34
  207. package/_vendor/plugin-packaging/packagingStyle.d.ts +0 -10
  208. package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +0 -7
  209. package/_vendor/plugin-packaging/productRuntime.d.ts +0 -2
  210. package/_vendor/plugin-packaging/types.d.ts +0 -168
  211. package/_vendor/plugin-packaging/validation.d.ts +0 -3
  212. package/controller/canvasKitController.d.ts +0 -28
  213. package/core/index.d.ts +0 -7
  214. package/core/product-controller/index.d.ts +0 -2
  215. package/core/runtime/productEditor.d.ts +0 -3
  216. package/core/runtime/productServices.d.ts +0 -20
  217. package/es-DocrZgUh.mjs +0 -2
  218. package/features/context-menu/contextMenuRuntime.d.ts +0 -13
  219. package/features/image/controller/imageProductController.d.ts +0 -27
  220. package/features/image/imageHostPlugin.d.ts +0 -1
  221. package/features/image/smudge/imageSmudgeTypes.d.ts +0 -25
  222. package/features/text/textHostPlugin.d.ts +0 -5
  223. package/features/text/textSvgAssetInliner.d.ts +0 -3
  224. package/features/text/textSvgAssetPlugin.d.ts +0 -2
  225. package/react/useCanvasKitControllerLifecycle.d.ts +0 -8
  226. /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/blobDataUrl.d.ts +0 -0
  227. /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/pngExport.d.ts +0 -0
  228. /package/_vendor/{plugin-builtin-export → plugin-runtime-export}/svgExport.d.ts +0 -0
  229. /package/{_vendor/plugin-builtin-import-host → plugins/runtime/import-host}/index.d.ts +0 -0
@@ -1,8 +1,11 @@
1
- import { createCanvasActionRegistry, type CanvasActionContext, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasPlugin as SdkCanvasPlugin, type CanvasToolbarRegistry, type ProductApiRegistry } from "../_vendor/canvas-plugin-sdk/index";
1
+ import { type CanvasPlugin as SdkCanvasPlugin } from "../_vendor/canvas-plugin-sdk/index";
2
+ import { type CanvasActionContext, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry, type ProductApiRegistry, type ProductServiceToken } from "../_vendor/canvas-product-contracts/index";
2
3
  import type { Editor } from "../_vendor/canvas-core/index";
3
- import type { ProductAssetResolverService, ProductServiceRegistryRuntime, ProductServiceToken } from "../core";
4
- import type { SvgAssetInliner } from "../_vendor/plugin-builtin-export/index";
5
- import type { CanvasKitPluginSetup, CanvasKitPluginPersistence, CanvasPluginBeforeCommand, CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginProvider } from "./canvasKitPluginContracts";
4
+ import type { ProductAssetResolverService } from "./productAssetResolvers";
5
+ import type { ProductServiceRegistryRuntime } from "./productServiceRegistry";
6
+ import type { SvgAssetInliner } from "../_vendor/plugin-runtime-export/index";
7
+ import type { CanvasPluginBeforeCommand, CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginPersistence, CanvasPluginProvider, CanvasPluginSetup } from "./canvasKitPluginContracts";
8
+ import { createCanvasActionRegistry } from "./registries";
6
9
  export interface CanvasKitPluginSetupResult {
7
10
  readonly actionRegistry: ReturnType<typeof createCanvasActionRegistry>;
8
11
  readonly apis: ProductApiRegistry;
@@ -18,14 +21,14 @@ export interface CanvasKitPluginSetupResult {
18
21
  canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
19
22
  }
20
23
  export interface CanvasKitPluginSetupSession {
21
- install(plugin: SdkCanvasPlugin<CanvasKitPluginSetup>): void;
24
+ install(plugin: SdkCanvasPlugin<CanvasPluginSetup>): void;
22
25
  seal(): CanvasKitPluginSetupResult;
23
26
  }
24
27
  export declare function createCanvasKitPluginSetupSession({ assetResolverTokens, defer, editor, persistence, productId, services, svgAssetInliners, }: {
25
28
  assetResolverTokens: ProductServiceToken<ProductAssetResolverService>[];
26
29
  defer(dispose: () => void): void;
27
30
  editor: Editor;
28
- persistence: CanvasKitPluginPersistence | null;
31
+ persistence: CanvasPluginPersistence | null;
29
32
  productId: string;
30
33
  services: ProductServiceRegistryRuntime;
31
34
  svgAssetInliners: SvgAssetInliner[];
@@ -1,9 +1,7 @@
1
- import type { Editor } from "../canvas-core/index";
1
+ import type { Editor } from "../_vendor/canvas-core/index";
2
+ import { type CanvasActionContext, type CanvasActionRegistry, type CanvasImportRegistry, type ProductServiceRegistry } from "../_vendor/canvas-product-contracts/index";
2
3
  import type { ComponentType, ReactNode } from "react";
3
- import type { CanvasActionContext } from "./actions";
4
- import type { CanvasActionRegistry } from "./actionRegistry";
5
- import type { CanvasImportRegistry } from "./importRegistry";
6
- import type { ProductServiceRegistry } from "./services";
4
+ import type { ExecuteCanvasKitAction } from "./canvasKitActionExecutor";
7
5
  export interface CanvasCommandInput<TResult> {
8
6
  commandId: string;
9
7
  context?: CanvasActionContext;
@@ -13,6 +11,7 @@ export type ExecuteCanvasCommand = <TResult>(input: CanvasCommandInput<TResult>)
13
11
  export interface CanvasPluginComponentProps {
14
12
  actionRegistry: CanvasActionRegistry;
15
13
  editor: Editor;
14
+ executeAction: ExecuteCanvasKitAction;
16
15
  executeCommand: ExecuteCanvasCommand;
17
16
  getHostElement(): HTMLElement | null;
18
17
  imports: CanvasImportRegistry;
@@ -35,3 +34,4 @@ export interface CanvasPluginUiSetup {
35
34
  addProviders(...providers: readonly CanvasPluginProvider[]): void;
36
35
  allowPropertiesDuringEditing(predicate: (context: CanvasActionContext) => boolean): void;
37
36
  }
37
+ export declare const canvasKitUiExtension: import("../_vendor/canvas-plugin-sdk/index").CanvasPluginSetupExtension<CanvasPluginUiSetup>;
@@ -1,9 +1,13 @@
1
1
  import type { Editor } from "../_vendor/canvas-core/index";
2
- import { type CanvasActionContext, type CanvasActionRegistry, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry } from "../_vendor/canvas-plugin-sdk/index";
2
+ import { type CanvasActionContext, type CanvasActionRegistry, type CanvasChromeRegistry, type CanvasContextMenuRegistry, type CanvasImportRegistry, type CanvasToolbarRegistry, type ProductServiceToken } from "../_vendor/canvas-product-contracts/index";
3
3
  import { type CanvasRenderRuntime } from "../_vendor/canvas-react/host/index";
4
- import { type ProductAssetResolverService, type ProductPersistenceAdapter, type ProductServiceRegistryRuntime, type ProductServiceToken } from "../core";
5
- import { type CanvasKitController } from "../controller/canvasKitController";
4
+ import { type CanvasProductController } from "../controller";
5
+ import { type ProductAssetResolverService } from "./productAssetResolvers";
6
+ import type { ProductPersistenceAdapter } from "./persistenceContracts";
7
+ import { type ProductServiceRegistryRuntime } from "./productServiceRegistry";
8
+ import { type CanvasKitToolId } from "../canvasKitTools";
6
9
  import { createCanvasKitCommandExecutor } from "./canvasKitCommandExecutor";
10
+ import { createCanvasKitActionExecutor } from "./canvasKitActionExecutor";
7
11
  import type { CanvasPluginBeforeReady, CanvasPluginComponent, CanvasPluginProvider } from "./canvasKitPluginContracts";
8
12
  import { PersistenceCoordinator } from "./persistenceCoordinator";
9
13
  import { type CanvasKitResourceScope } from "./canvasKitResourceScope";
@@ -16,7 +20,10 @@ export interface CanvasKitRuntimeInternals {
16
20
  readonly beforeReadyHooks: readonly CanvasPluginBeforeReady[];
17
21
  readonly cleanDocumentSnapshot: unknown;
18
22
  readonly cleanSessionSnapshot: unknown;
19
- readonly controller: CanvasKitController;
23
+ readonly commandBootstrap: {
24
+ active: boolean;
25
+ };
26
+ readonly controller: CanvasProductController<CanvasKitToolId>;
20
27
  readonly editor: Editor;
21
28
  mountedOwner: object | null;
22
29
  readonly persistence: ProductPersistenceAdapter | null;
@@ -30,13 +37,15 @@ export interface CanvasKitRuntimeInternals {
30
37
  readonly toolbarRegistry: CanvasToolbarRegistry;
31
38
  readonly contextMenuRegistry: CanvasContextMenuRegistry;
32
39
  readonly importRegistry: CanvasImportRegistry;
33
- readonly executeCommand: ReturnType<typeof createCanvasKitCommandExecutor>;
40
+ readonly executeAction: ReturnType<typeof createCanvasKitActionExecutor>;
41
+ readonly executeCommand: ReturnType<typeof createCanvasKitCommandExecutor>["executeAction"];
34
42
  readonly providers: readonly CanvasPluginProvider[];
35
43
  readonly components: readonly CanvasPluginComponent[];
36
44
  readonly chrome?: CanvasKitChromeRenderer;
37
45
  canShowPropertiesDuringEditing(context: CanvasActionContext): boolean;
38
46
  };
39
47
  readonly seedDocument?: CanvasKitDocumentSeed;
48
+ readonly seedController: CanvasProductController<CanvasKitToolId>;
40
49
  readonly services: ProductServiceRegistryRuntime;
41
50
  readonly shouldSkipStoredSnapshots?: () => boolean;
42
51
  startPromise: Promise<CanvasKitStartupResult> | null;
@@ -1,11 +1,13 @@
1
1
  import type { ReactNode } from "react";
2
- import type { ProductPersistenceAdapter } from "../core";
2
+ import type { CanvasProductController } from "../controller";
3
+ import type { ProductPersistenceAdapter } from "./persistenceContracts";
3
4
  import type { CanvasKitChromeContext } from "../chrome/types";
4
- import type { CanvasKitController } from "../controller/canvasKitController";
5
+ import type { CanvasKitToolId } from "../canvasKitTools";
5
6
  import type { CanvasPluginInput } from "./canvasKitPluginContracts";
6
- import type { CanvasPluginStartupResult } from "../_vendor/canvas-plugin-sdk/index";
7
- export type CanvasKitChromeRenderer = (context: CanvasKitChromeContext<CanvasKitController>) => ReactNode;
8
- export type CanvasKitDocumentSeed = (controller: CanvasKitController) => void;
7
+ import type { CanvasKitStartupResult } from "./canvasKitPluginLifecycle";
8
+ export type { CanvasKitStartupResult } from "./canvasKitPluginLifecycle";
9
+ export type CanvasKitChromeRenderer = (context: CanvasKitChromeContext<CanvasKitToolId>) => ReactNode;
10
+ export type CanvasKitDocumentSeed = (controller: CanvasProductController<CanvasKitToolId>) => void;
9
11
  export interface CanvasKitRuntimeOptions {
10
12
  id?: string;
11
13
  chrome?: CanvasKitChromeRenderer;
@@ -16,9 +18,8 @@ export interface CanvasKitRuntimeOptions {
16
18
  plugins?: readonly CanvasPluginInput[];
17
19
  storageNamespace?: string;
18
20
  }
19
- export type CanvasKitStartupResult = CanvasPluginStartupResult;
20
21
  export interface CanvasKitRuntime {
21
- readonly controller: CanvasKitController;
22
+ readonly controller: CanvasProductController<CanvasKitToolId>;
22
23
  start(): Promise<CanvasKitStartupResult>;
23
24
  dispose(): void;
24
25
  }
@@ -0,0 +1,15 @@
1
+ import type { EditorPlugin, ShapeRecordBase } from "../_vendor/canvas-core/index";
2
+ import type { CanvasRenderPlugin } from "../_vendor/canvas-react/host/index";
3
+ import { type CanvasPlugin, type CanvasPluginCapabilityToken, type CanvasPluginInput } from "../_vendor/canvas-plugin-sdk/index";
4
+ type CanvasPluginSetupLike = (context: never) => unknown;
5
+ export interface CompiledCanvasPlugins<TSetup extends CanvasPluginSetupLike> {
6
+ readonly plugins: readonly CanvasPlugin<TSetup>[];
7
+ readonly pluginIds: readonly string[];
8
+ readonly editorPlugins: readonly EditorPlugin[];
9
+ readonly renderPlugins: readonly CanvasRenderPlugin[];
10
+ readonly shapeTypes: readonly ShapeRecordBase["type"][];
11
+ }
12
+ export declare function compileCanvasPlugins<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): CompiledCanvasPlugins<TSetup>;
13
+ export declare function assertValidCanvasPluginGraph<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): void;
14
+ export declare function hasCanvasPluginCapabilityProvider<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[], token: CanvasPluginCapabilityToken): boolean;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CanvasAction, CanvasActionRunInput, CanvasActionValue } from "../_vendor/canvas-product-contracts/index";
2
+ import type { CanvasKitCommand } from "../commands";
3
+ import type { CanvasKitCommandExecutor } from "./canvasKitCommandExecutor";
4
+ type CanvasActionBehavior<TValue extends CanvasActionValue> = Omit<CanvasAction<TValue>, "id" | "run">;
5
+ export declare function createVoidCanvasKitCommandAction<TValue extends CanvasActionValue = CanvasActionValue>(command: CanvasKitCommand<[], unknown>, behavior?: CanvasActionBehavior<TValue>): CanvasAction<TValue>;
6
+ export declare function createCanvasKitCommandAction<TArgs extends readonly unknown[], TValue extends CanvasActionValue = CanvasActionValue>(command: CanvasKitCommand<TArgs, unknown>, behavior: CanvasActionBehavior<TValue> & {
7
+ toCommandArgs(input: CanvasActionRunInput<TValue>): TArgs | null;
8
+ }): CanvasAction<TValue>;
9
+ export declare function executeCanvasKitCommandAction(executor: CanvasKitCommandExecutor, action: CanvasAction, input: CanvasActionRunInput<CanvasActionValue>): boolean | null;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type AssetId, type Editor, type EditorPlugin } from "../_vendor/canvas-core/index";
2
+ export interface CreateCanvasKitEditorOptions {
3
+ editorPlugins: readonly EditorPlugin[];
4
+ documentMeta?: Record<string, unknown>;
5
+ resolveAssetUrl?: (assetId: AssetId) => string | null;
6
+ }
7
+ export declare function createCanvasKitEditor(options: CreateCanvasKitEditorOptions): Editor;
@@ -1,4 +1,4 @@
1
- import type { AssetId, DocumentSnapshot, EditorPlugin, SessionSnapshot } from "../../_vendor/canvas-core/index";
1
+ import type { DocumentSnapshot, SessionSnapshot } from "../_vendor/canvas-core/index";
2
2
  export interface ProductPersistenceLoadResult {
3
3
  documentSnapshot: unknown | null;
4
4
  sessionSnapshot: unknown | null;
@@ -10,8 +10,3 @@ export interface ProductPersistenceAdapter {
10
10
  saveDocument?(snapshot: DocumentSnapshot): Promise<void>;
11
11
  saveSession?(snapshot: SessionSnapshot): Promise<void>;
12
12
  }
13
- export interface CreateCanvasProductEditorOptions {
14
- editorPlugins: readonly EditorPlugin[];
15
- documentMeta?: Record<string, unknown>;
16
- resolveAssetUrl?: (assetId: AssetId) => string | null;
17
- }
@@ -1,5 +1,5 @@
1
1
  import type { Editor } from "../_vendor/canvas-core/index";
2
- import type { ProductPersistenceAdapter } from "../core/runtime/runtimeContracts";
2
+ import type { ProductPersistenceAdapter } from "./persistenceContracts";
3
3
  export declare class PersistenceCoordinator {
4
4
  private readonly editor;
5
5
  private readonly adapter;
@@ -1,5 +1,14 @@
1
- import type { AssetId, Editor } from "../../_vendor/canvas-core/index";
2
- import type { ProductAssetResolverService, ProductServiceRegistry, ProductServiceToken } from "./productServices";
1
+ import type { AssetId, Editor } from "../_vendor/canvas-core/index";
2
+ import type { ProductServiceRegistry, ProductServiceToken } from "../_vendor/canvas-product-contracts/index";
3
+ export interface ProductAssetResolverService {
4
+ resolveAssetUrl(editor: Editor, assetId: AssetId): string | null;
5
+ preloadForEditor?(editor: Editor, options: {
6
+ signal: AbortSignal;
7
+ }): Promise<void>;
8
+ cleanupAfterRestore?(editor: Editor, options: {
9
+ signal: AbortSignal;
10
+ }): Promise<void> | void;
11
+ }
3
12
  export declare function resolveProductAssetUrl({ assetResolverTokens, assetId, editor, services, }: {
4
13
  assetResolverTokens: readonly ProductServiceToken<ProductAssetResolverService>[];
5
14
  assetId: AssetId;
@@ -0,0 +1,8 @@
1
+ import { type ProductServiceFactory, type ProductServiceSetup } from "../_vendor/canvas-product-contracts/index";
2
+ export interface ProductServiceRegistryRuntime extends ProductServiceSetup {
3
+ dispose(): void;
4
+ }
5
+ export declare function createProductServiceRegistry({ factories, productId, }: {
6
+ factories?: readonly ProductServiceFactory<unknown>[];
7
+ productId: string;
8
+ }): ProductServiceRegistryRuntime;
@@ -0,0 +1,5 @@
1
+ import { type CanvasAction, type CanvasActionRegistry } from "../../_vendor/canvas-product-contracts/index";
2
+ export interface CanvasActionRegistryRuntime extends CanvasActionRegistry {
3
+ registerAction(action: CanvasAction): void;
4
+ }
5
+ export declare function createCanvasActionRegistry(actions?: readonly CanvasAction[]): CanvasActionRegistryRuntime;
@@ -0,0 +1,2 @@
1
+ import { type CanvasChromeRegistry, type ChromeContribution } from "../../_vendor/canvas-product-contracts/index";
2
+ export declare function createCanvasChromeRegistry(contributions?: readonly ChromeContribution[]): CanvasChromeRegistry;
@@ -0,0 +1,5 @@
1
+ import { type CanvasContextMenuRegistry, type ContextMenuContribution } from "../../_vendor/canvas-product-contracts/index";
2
+ export interface CanvasContextMenuRegistryRuntime extends CanvasContextMenuRegistry {
3
+ registerContribution(contribution: ContextMenuContribution): void;
4
+ }
5
+ export declare function createCanvasContextMenuRegistry(contributions?: readonly ContextMenuContribution[]): CanvasContextMenuRegistryRuntime;
@@ -0,0 +1,2 @@
1
+ import { type CanvasExportContribution, type CanvasExportRegistry } from "../../_vendor/canvas-product-contracts/index";
2
+ export declare function createCanvasExportRegistry(contributions?: readonly CanvasExportContribution[]): CanvasExportRegistry;
@@ -0,0 +1,2 @@
1
+ import { type CanvasImportContribution, type CanvasImportRegistry } from "../../_vendor/canvas-product-contracts/index";
2
+ export declare function createCanvasImportRegistry(contributions?: readonly CanvasImportContribution[]): CanvasImportRegistry;
@@ -0,0 +1,7 @@
1
+ export * from "./actionRegistry";
2
+ export * from "./chromeRegistry";
3
+ export * from "./contextMenuRegistry";
4
+ export * from "./exportRegistry";
5
+ export * from "./importRegistry";
6
+ export * from "./productApiRegistry";
7
+ export * from "./toolbarRegistry";
@@ -0,0 +1,5 @@
1
+ import { type ProductApiRegistry, type ProductApiToken } from "../../_vendor/canvas-product-contracts/index";
2
+ export interface ProductApiRegistryRuntime extends ProductApiRegistry {
3
+ register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
4
+ }
5
+ export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
@@ -0,0 +1,5 @@
1
+ import { type CanvasToolbarRegistry, type ToolbarContribution } from "../../_vendor/canvas-product-contracts/index";
2
+ export interface CanvasToolbarRegistryRuntime extends CanvasToolbarRegistry {
3
+ registerContribution(contribution: ToolbarContribution): void;
4
+ }
5
+ export declare function createCanvasToolbarRegistry(contributions?: readonly ToolbarContribution[]): CanvasToolbarRegistryRuntime;
@@ -1,7 +0,0 @@
1
- import type { CanvasAction } from "./actions";
2
- export declare class CanvasActionRegistry {
3
- private readonly actions;
4
- registerAction(action: CanvasAction): void;
5
- getAction(actionId: string): CanvasAction | null;
6
- }
7
- export declare function createCanvasActionRegistry(actions?: readonly CanvasAction[]): CanvasActionRegistry;
@@ -1,15 +0,0 @@
1
- import type { Editor } from "../canvas-core/index";
2
- import type { CanvasActionContext } from "./actions";
3
- import type { ChromeChannel, ChromeContribution, ChromeSection } from "./chrome";
4
- export declare class CanvasChromeRegistry {
5
- private readonly contributions;
6
- private readonly channels;
7
- private readonly contributionsByChannel;
8
- private stateRevision;
9
- constructor(contributions?: readonly ChromeContribution[]);
10
- getChannels(): readonly ChromeChannel[];
11
- getStateRevision(): number;
12
- subscribeToState(editor: Editor, listener: () => void): () => void;
13
- getSections(channel: ChromeChannel, context: CanvasActionContext): ChromeSection[];
14
- }
15
- export declare function createCanvasChromeRegistry(contributions?: readonly ChromeContribution[]): CanvasChromeRegistry;
@@ -1,11 +0,0 @@
1
- import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection } from "./contextMenu";
2
- export declare class CanvasContextMenuRegistry {
3
- private readonly contributions;
4
- private readonly contributionsByTarget;
5
- private readonly contributionIndexes;
6
- private nextContributionIndex;
7
- registerContribution(contribution: ContextMenuContribution): void;
8
- getSections(target: ContextMenuContributionTarget, context: ContextMenuContext): ContextMenuSection[];
9
- private addToIndex;
10
- }
11
- export declare function createCanvasContextMenuRegistry(contributions?: readonly ContextMenuContribution[]): CanvasContextMenuRegistry;
@@ -1,9 +0,0 @@
1
- import type { CanvasExportArtifact, CanvasExportContribution, CanvasExportFormat, CanvasExportProviderInput } from "./exports";
2
- export declare class CanvasExportRegistry {
3
- private readonly contributionsByFormat;
4
- constructor(contributions?: readonly CanvasExportContribution[]);
5
- getFormats(): readonly CanvasExportFormat[];
6
- hasFormat(format: string): boolean;
7
- export(format: string, input: CanvasExportProviderInput): Promise<CanvasExportArtifact>;
8
- }
9
- export declare function createCanvasExportRegistry(contributions?: readonly CanvasExportContribution[]): CanvasExportRegistry;
@@ -1,18 +0,0 @@
1
- import type { Editor } from "../canvas-core/index";
2
- import type { CanvasActionContext } from "./actions";
3
- import type { ToolbarChannel, ToolbarContribution, ToolbarGroup } from "./toolbar";
4
- export declare class CanvasToolbarRegistry {
5
- private readonly contributions;
6
- private readonly channels;
7
- private readonly contributionsByChannel;
8
- private readonly contributionIndexes;
9
- private nextContributionIndex;
10
- private stateRevision;
11
- registerContribution(contribution: ToolbarContribution): void;
12
- getStateRevision(): number;
13
- subscribeToState(editor: Editor, listener: () => void): () => void;
14
- getGroups(channel: ToolbarChannel, context: CanvasActionContext): ToolbarGroup[];
15
- getChannels(): readonly ToolbarChannel[];
16
- private addToIndexes;
17
- }
18
- export declare function createCanvasToolbarRegistry(contributions?: readonly ToolbarContribution[]): CanvasToolbarRegistry;
@@ -1,2 +0,0 @@
1
- import { type ChromeContribution } from "../canvas-plugin-sdk/index";
2
- export declare const clipboardChromeContributions: readonly ChromeContribution[];
@@ -1,2 +0,0 @@
1
- import { type ContextMenuContribution } from "../canvas-plugin-sdk/index";
2
- export declare const clipboardContextMenuContributions: readonly ContextMenuContribution[];
@@ -1,3 +0,0 @@
1
- export { ClipboardPlugin } from "./plugin";
2
- export * from "./clipboardContribution";
3
- export * from "./clipboardService";
@@ -1 +0,0 @@
1
- export declare const ClipboardPlugin: import("../canvas-plugin-sdk/index").CanvasPlugin<(context: import("../canvas-plugin-sdk/index").CanvasPluginSetupContext<import("../canvas-plugin-sdk/index").CanvasPluginApiContext>) => void>;
@@ -1 +0,0 @@
1
- export declare const canvasImportHostCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<boolean>;
@@ -1 +0,0 @@
1
- export declare const ImportHostPlugin: import("../canvas-plugin-sdk/index").CanvasPlugin<(context: import("../canvas-plugin-sdk/index").CanvasPluginSetupContext<import("../canvas-plugin-sdk/index").CanvasPluginApiContext>) => void>;
@@ -1 +0,0 @@
1
- export declare const canvasToolActionsCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<true>;
@@ -1 +0,0 @@
1
- export declare const BuiltinToolActionsPlugin: import("../canvas-plugin-sdk/index").CanvasPlugin<(context: import("../canvas-plugin-sdk/index").CanvasPluginSetupContext<import("../canvas-plugin-sdk/index").CanvasPluginApiContext>) => void>;
@@ -1,2 +0,0 @@
1
- import { type CanvasAction } from "../canvas-plugin-sdk/index";
2
- export declare const toolActions: readonly CanvasAction[];
@@ -1,2 +0,0 @@
1
- import { type CanvasRenderPlugin } from "../canvas-react/host/index";
2
- export declare function createConnectorCanvasRenderPlugin(): CanvasRenderPlugin;
@@ -1,28 +0,0 @@
1
- import { BindingUtil, type BindingUtilEffect, type Editor, type ShapeRecord } from "../canvas-core/index";
2
- import { type ConnectorBindingRecord } from "./types";
3
- export declare class ConnectorBindingUtil extends BindingUtil<ConnectorBindingRecord> {
4
- readonly type: "connector";
5
- getDefaultProps(): ConnectorBindingRecord["props"];
6
- validateProps(props: unknown): ConnectorBindingRecord["props"];
7
- canBind(editor: Editor, binding: ConnectorBindingRecord, context: {
8
- fromShape: ShapeRecord;
9
- toShape: ShapeRecord;
10
- }): boolean;
11
- getExclusiveBindingKey(binding: ConnectorBindingRecord): string;
12
- onBindingCreate(editor: Editor, binding: ConnectorBindingRecord): void | BindingUtilEffect;
13
- onBindingUpdate(editor: Editor, _before: ConnectorBindingRecord, after: ConnectorBindingRecord): void | BindingUtilEffect;
14
- onBindingLoad(editor: Editor, binding: ConnectorBindingRecord): void | BindingUtilEffect;
15
- onAfterShapeChange(editor: Editor, binding: ConnectorBindingRecord, context: {
16
- role: "from" | "to";
17
- }): void | BindingUtilEffect;
18
- onBeforeDeleteShape(editor: Editor, binding: ConnectorBindingRecord, context: {
19
- role: "from" | "to";
20
- }): BindingUtilEffect;
21
- onBeforeDeleteBinding(editor: Editor, binding: ConnectorBindingRecord): BindingUtilEffect;
22
- getExportShapeIds(_editor: Editor, binding: ConnectorBindingRecord): ShapeRecord["id"][];
23
- getGeometryDependentShapeIds(_editor: Editor, binding: ConnectorBindingRecord, context: {
24
- role: "from" | "to";
25
- }): ShapeRecord["id"][];
26
- private getSyncEffect;
27
- private getDetachEffect;
28
- }
@@ -1,8 +0,0 @@
1
- import type { Editor, ShapeId } from "../canvas-core/index";
2
- import { type ConnectorBindingRecord } from "./types";
3
- export interface ConnectorTerminalBindings {
4
- start: ConnectorBindingRecord | null;
5
- end: ConnectorBindingRecord | null;
6
- }
7
- export declare function getConnectorTerminalBindings(editor: Editor, connectorId: ShapeId): ConnectorTerminalBindings;
8
- export declare function getConnectorBindings(editor: Editor, connectorId: ShapeId): ConnectorBindingRecord[];
@@ -1,70 +0,0 @@
1
- import { Box, Vec, type Editor, type Mat, type ShapeLabelPathGeometry } from "../canvas-core/index";
2
- import type { ConnectorHead, ConnectorRouting, ConnectorShapeRecord } from "./types";
3
- export interface ConnectorLineSegment {
4
- type: "line";
5
- start: Vec;
6
- end: Vec;
7
- }
8
- export interface ConnectorCubicSegment {
9
- type: "cubic";
10
- start: Vec;
11
- control1: Vec;
12
- control2: Vec;
13
- end: Vec;
14
- }
15
- export interface ConnectorQuadraticSegment {
16
- type: "quadratic";
17
- start: Vec;
18
- control: Vec;
19
- end: Vec;
20
- }
21
- export type ConnectorSegment = ConnectorLineSegment | ConnectorQuadraticSegment | ConnectorCubicSegment;
22
- export declare function getConnectorSegmentPoint(segment: ConnectorSegment, t: number): Vec;
23
- export declare function getConnectorLabelPathGeometry(info: ConnectorInfo): ShapeLabelPathGeometry;
24
- export interface ConnectorInfo {
25
- path: string;
26
- startPagePoint: Vec;
27
- endPagePoint: Vec;
28
- startTangent: Vec;
29
- endTangent: Vec;
30
- startArrowScale: number;
31
- endArrowScale: number;
32
- pageBounds: Box;
33
- segments: readonly ConnectorSegment[];
34
- markerSegments: readonly ConnectorLineSegment[];
35
- points: readonly Vec[];
36
- routePoints: readonly Vec[];
37
- }
38
- export interface ConnectorTerminalOffsetInput {
39
- point: Vec;
40
- direction: Vec;
41
- along: number;
42
- perpendicular: number;
43
- }
44
- export type ConnectorTerminalOffsetMapper = (input: ConnectorTerminalOffsetInput) => Vec;
45
- export interface ConnectorTerminalGeometry {
46
- point: Vec;
47
- outwardNormal: Vec;
48
- obstacleId?: string;
49
- obstacleBounds?: Box;
50
- }
51
- export declare function createConnectorTerminalOffsetMapper(localToGeometry: Mat): ConnectorTerminalOffsetMapper;
52
- export declare function getResolvedConnectorPageInfo(editor: Editor, shape: ConnectorShapeRecord): ConnectorInfo;
53
- export declare function getResolvedConnectorLocalInfo(editor: Editor, shape: ConnectorShapeRecord): ConnectorInfo;
54
- export declare function getConnectorInfo({ start, end, routing, cornerRadius, headStart, headEnd, strokeWidth, terminalOffsetMapper, curveWaypoints, orthogonalBends, }: {
55
- start: ConnectorTerminalGeometry;
56
- end: ConnectorTerminalGeometry;
57
- routing: ConnectorRouting;
58
- cornerRadius: number;
59
- headStart?: ConnectorHead;
60
- headEnd?: ConnectorHead;
61
- strokeWidth?: number;
62
- terminalOffsetMapper?: ConnectorTerminalOffsetMapper;
63
- curveWaypoints?: readonly Vec[];
64
- orthogonalBends?: readonly Vec[];
65
- }): ConnectorInfo;
66
- export declare function mapConnectorInfo(info: ConnectorInfo, transform: {
67
- applyToPoint(point: Vec): Vec;
68
- }): ConnectorInfo;
69
- export declare function getConnectorMarkerSegmentsPath(segments: readonly ConnectorLineSegment[]): string;
70
- export declare function compactOrthogonalPoints(points: readonly Vec[]): Vec[];
@@ -1,12 +0,0 @@
1
- export declare const CONNECTOR_CURVE_WAYPOINT_HANDLE_TYPE = "connector.curve-waypoint";
2
- export declare const CONNECTOR_CURVE_INSERT_HANDLE_TYPE = "connector.curve-insert";
3
- export declare const CONNECTOR_ORTHOGONAL_SEGMENT_HANDLE_TYPE = "connector.orthogonal-segment";
4
- export type ConnectorOrthogonalSegmentAxis = "horizontal" | "vertical";
5
- export declare function createConnectorCurveWaypointHandleId(index: number): string;
6
- export declare function createConnectorCurveInsertHandleId(index: number): string;
7
- export declare function createConnectorOrthogonalSegmentHandleId(index: number, axis: ConnectorOrthogonalSegmentAxis): string;
8
- export declare function parseConnectorIndexedHandleId(id: string, prefix: "waypoint" | "segment"): number | null;
9
- export declare function parseConnectorOrthogonalSegmentHandleId(id: string): {
10
- index: number;
11
- axis: ConnectorOrthogonalSegmentAxis;
12
- } | null;
@@ -1,3 +0,0 @@
1
- import { type LandInteractionHandler } from "../canvas-core/index";
2
- import { type ConnectorQuickCreateNodeFactory } from "./types";
3
- export declare function createConnectorInteractionHandler(quickCreateNodeFactory: ConnectorQuickCreateNodeFactory): LandInteractionHandler;
@@ -1,7 +0,0 @@
1
- import type { ConnectorTerminal } from "./types";
2
- export declare const CONNECTOR_ARROW_TERMINAL_PADDING = 3;
3
- export declare function getConnectorArrowMagnification(strokeWidth: number): number;
4
- export declare function getConnectorArrowLength(strokeWidth: number): number;
5
- export declare function getConnectorArrowGlyphLength(strokeWidth: number): number;
6
- export declare function getConnectorMarkerRefX(terminal: ConnectorTerminal, strokeWidth: number, scale?: number): number;
7
- export declare function getConnectorMarkerPath(terminal: ConnectorTerminal, strokeWidth: number, scale?: number): string;
@@ -1,43 +0,0 @@
1
- import { Box, Vec, type ChangeSource, type Editor, type ResolvedShapeTerminalBindingPort, type ShapeId, type ShapeParentId, type ShapeRecord } from "../canvas-core/index";
2
- import { type ConnectorTerminalGeometry } from "./connectorGeometry";
3
- import { type ConnectorPortAttachment } from "./connectorPorts";
4
- import { type ConnectorShapeProps, type ConnectorShapeRecord, type ConnectorTerminal } from "./types";
5
- export interface ConnectorEndpointInput {
6
- shape: ShapeRecord;
7
- port: ResolvedShapeTerminalBindingPort;
8
- }
9
- export interface ConnectorBoundEndpoint {
10
- kind: "bound";
11
- shapeId: ShapeId;
12
- attachment: ConnectorPortAttachment;
13
- }
14
- export type ConnectorDraftEndpoint = {
15
- kind: "free";
16
- pagePoint: Vec;
17
- } | ConnectorBoundEndpoint;
18
- export interface ResolvedConnectorDraftEndpoint {
19
- draft: ConnectorDraftEndpoint;
20
- pagePoint: Vec;
21
- shape: ShapeRecord | null;
22
- port: ResolvedShapeTerminalBindingPort | null;
23
- obstacleBounds?: Box;
24
- }
25
- export type ConnectorCreationInvalidReason = "missing_endpoint" | "locked_source" | "cross_page" | "same_attachment" | "duplicate" | "invalid_parent";
26
- export interface CommitConnectorCreationInput {
27
- start: ConnectorDraftEndpoint;
28
- end: ConnectorDraftEndpoint;
29
- props?: Partial<ConnectorShapeProps>;
30
- selectionAfter?: "connector" | "none" | readonly ShapeId[];
31
- }
32
- export declare function createConnectorBoundEndpoint(shapeId: ShapeId, port: ResolvedShapeTerminalBindingPort): ConnectorBoundEndpoint;
33
- export declare function resolveConnectorDraftEndpoint(editor: Editor, draft: ConnectorDraftEndpoint): ResolvedConnectorDraftEndpoint | null;
34
- export declare function getConnectorCreationInvalidReason(editor: Editor, startDraft: ConnectorDraftEndpoint, endDraft: ConnectorDraftEndpoint, excludeConnectorId?: ShapeId): ConnectorCreationInvalidReason | null;
35
- export declare function commitConnectorCreation(editor: Editor, input: CommitConnectorCreationInput, source?: ChangeSource): ConnectorShapeRecord | null;
36
- export declare function getSyncedConnectorShape(editor: Editor, shape: ConnectorShapeRecord): ConnectorShapeRecord | null;
37
- export declare function setConnectorTerminalPagePoint(editor: Editor, shape: ConnectorShapeRecord, terminal: ConnectorTerminal, pagePoint: Vec): ConnectorShapeRecord | null;
38
- export declare function getConnectorDraftTerminalGeometry(endpoint: ResolvedConnectorDraftEndpoint, opposite: ResolvedConnectorDraftEndpoint, terminal: ConnectorTerminal): ConnectorTerminalGeometry;
39
- export declare function hasDirectedConnector(editor: Editor, sourceShapeId: ShapeId, sourcePortId: string, targetShapeId: ShapeId, targetPortId: string, excludeConnectorId?: ShapeId): boolean;
40
- export declare function areSameConnectorEndpointIds(leftShapeId: ShapeId, leftPortId: string, rightShapeId: ShapeId, rightPortId: string): boolean;
41
- export declare function getConnectorParentId(editor: Editor, startShape: ShapeRecord, endShape: ShapeRecord): ShapeParentId | null;
42
- export declare function resolveConnectorDraftParentId(editor: Editor, start: ResolvedConnectorDraftEndpoint, end: ResolvedConnectorDraftEndpoint): ShapeParentId | null;
43
- export declare function areConnectorShapesEquivalent(left: ConnectorShapeRecord, right: ConnectorShapeRecord): boolean;
@@ -1,13 +0,0 @@
1
- import { type Editor, type ResolvedShapeTerminalBindingPort, type ShapeId, type ShapeRecord, type Vec } from "../canvas-core/index";
2
- export interface ConnectorPortInteractionState {
3
- visibleShapes: readonly ShapeRecord[];
4
- sourceShapeIds: ReadonlySet<ShapeId>;
5
- targetShapeId: ShapeId | null;
6
- highlightedPortId: string | null;
7
- }
8
- export declare function getConnectorPortInteractionState(editor: Editor): ConnectorPortInteractionState;
9
- export declare function getVisibleConnectorSourcePortAtPoint(editor: Editor, pagePoint: Vec): {
10
- shape: ShapeRecord;
11
- port: ResolvedShapeTerminalBindingPort;
12
- } | null;
13
- export declare function getConnectorHoverShapeAtPoint(editor: Editor, pagePoint: Vec): ShapeRecord | null;
@@ -1,23 +0,0 @@
1
- import { Vec, type Editor, type ResolvedShapeTerminalBindingPort, type ShapeRecord } from "../canvas-core/index";
2
- import type { ConnectorBindingProps, ConnectorPoint, ConnectorTerminal } from "./types";
3
- export type ConnectorPortAttachment = {
4
- kind: "port";
5
- portId: string;
6
- } | {
7
- kind: "border";
8
- normalizedAnchor: ConnectorPoint;
9
- };
10
- export interface ConnectorBorderPortHit {
11
- port: ResolvedShapeTerminalBindingPort;
12
- borderDistance: number;
13
- }
14
- export interface ConnectorPageBindingOutline {
15
- points: readonly Vec[];
16
- closed: boolean;
17
- }
18
- export declare function getConnectorPageBindingOutlines(editor: Editor, shape: ShapeRecord): ConnectorPageBindingOutline[];
19
- export declare function getConnectorBorderPortAtPoint(editor: Editor, shape: ShapeRecord, pagePoint: Vec, midpointSnapRadius: number): ConnectorBorderPortHit | null;
20
- export declare function getResolvedConnectorBindingPort(editor: Editor, shape: ShapeRecord, props: Pick<ConnectorBindingProps, "portId" | "normalizedAnchor">): ResolvedShapeTerminalBindingPort | null;
21
- export declare function getConnectorPortAttachment(port: ResolvedShapeTerminalBindingPort): ConnectorPortAttachment;
22
- export declare function getResolvedConnectorAttachmentPort(editor: Editor, shape: ShapeRecord, attachment: ConnectorPortAttachment): ResolvedShapeTerminalBindingPort | null;
23
- export declare function getConnectorBindingProps(terminal: ConnectorTerminal, port: ResolvedShapeTerminalBindingPort): ConnectorBindingProps & Record<string, unknown>;