@yuzhouu/canvas-kit 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +82 -35
  2. package/_vendor/canvas-core/bindings/bindingUtil.d.ts +15 -0
  3. package/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  4. package/_vendor/canvas-core/editor/bindingReactionScope.d.ts +7 -0
  5. package/_vendor/canvas-core/editor/commands.d.ts +3 -3
  6. package/_vendor/canvas-core/editor/editor.d.ts +20 -5
  7. package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +1 -0
  8. package/_vendor/canvas-core/editor/historyManager.d.ts +2 -5
  9. package/_vendor/canvas-core/editor/interactions.d.ts +33 -9
  10. package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +1 -6
  11. package/_vendor/canvas-core/editor/managers/queryManager.d.ts +13 -0
  12. package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +3 -0
  13. package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
  14. package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
  15. package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +1 -0
  16. package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
  17. package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
  18. package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
  19. package/_vendor/canvas-core/editor/selectionOverlay.d.ts +3 -1
  20. package/_vendor/canvas-core/exports/svg.d.ts +2 -3
  21. package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  22. package/_vendor/canvas-core/index.d.ts +9 -5
  23. package/_vendor/canvas-core/shapes/colors.d.ts +2 -1
  24. package/_vendor/canvas-core/shapes/shapeUtil.d.ts +47 -1
  25. package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +9 -2
  26. package/_vendor/canvas-core/tools/select/states/{draggingSelectionHandleInteractionState.d.ts → draggingPluginInteractionState.d.ts} +5 -4
  27. package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
  28. package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +2 -2
  29. package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
  30. package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
  31. package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
  32. package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
  33. package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
  34. package/_vendor/canvas-plugin-sdk/actions.d.ts +19 -2
  35. package/_vendor/canvas-plugin-sdk/capability.d.ts +16 -0
  36. package/_vendor/canvas-plugin-sdk/chrome.d.ts +52 -0
  37. package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +15 -0
  38. package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +9 -0
  39. package/_vendor/canvas-plugin-sdk/exports.d.ts +26 -0
  40. package/_vendor/canvas-plugin-sdk/importRegistry.d.ts +10 -0
  41. package/_vendor/canvas-plugin-sdk/imports.d.ts +38 -0
  42. package/_vendor/canvas-plugin-sdk/index.d.ts +11 -0
  43. package/_vendor/canvas-plugin-sdk/lifecycle.d.ts +31 -0
  44. package/_vendor/canvas-plugin-sdk/plugin.d.ts +54 -17
  45. package/_vendor/canvas-plugin-sdk/pluginUi.d.ts +37 -0
  46. package/_vendor/canvas-plugin-sdk/productApi.d.ts +28 -0
  47. package/_vendor/canvas-plugin-sdk/services.d.ts +20 -0
  48. package/_vendor/canvas-plugin-sdk/toolbar.d.ts +26 -4
  49. package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +5 -6
  50. package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +15 -4
  51. package/_vendor/canvas-react/host/index.d.ts +2 -2
  52. package/_vendor/plugin-arrow/api.d.ts +33 -0
  53. package/_vendor/plugin-arrow/arrowGeometry.d.ts +2 -1
  54. package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
  55. package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +2 -1
  56. package/_vendor/plugin-arrow/editorRuntime.d.ts +0 -2
  57. package/_vendor/plugin-arrow/feature.d.ts +2 -2
  58. package/_vendor/plugin-arrow/index.d.ts +4 -1
  59. package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
  60. package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +2 -0
  61. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContextMenuContributions.d.ts +1 -1
  62. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContribution.d.ts +2 -3
  63. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardService.d.ts +3 -3
  64. package/_vendor/plugin-builtin-clipboard/index.d.ts +3 -0
  65. package/_vendor/plugin-builtin-clipboard/plugin.d.ts +1 -0
  66. package/_vendor/plugin-builtin-export/blobDataUrl.d.ts +1 -0
  67. package/_vendor/plugin-builtin-export/canvasExportApi.d.ts +43 -0
  68. package/_vendor/plugin-builtin-export/index.d.ts +8 -0
  69. package/_vendor/plugin-builtin-export/plugin.d.ts +5 -0
  70. package/_vendor/plugin-builtin-export/pngExport.d.ts +15 -0
  71. package/{features/export → _vendor/plugin-builtin-export}/svgExport.d.ts +9 -2
  72. package/_vendor/plugin-builtin-import-host/CanvasImportHost.d.ts +3 -0
  73. package/_vendor/plugin-builtin-import-host/capability.d.ts +1 -0
  74. package/_vendor/plugin-builtin-import-host/index.d.ts +2 -0
  75. package/_vendor/plugin-builtin-import-host/plugin.d.ts +1 -0
  76. package/_vendor/plugin-builtin-tool-actions/capability.d.ts +1 -0
  77. package/_vendor/plugin-builtin-tool-actions/index.d.ts +2 -0
  78. package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +1 -0
  79. package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +2 -0
  80. package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
  81. package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
  82. package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
  83. package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
  84. package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
  85. package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
  86. package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
  87. package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
  88. package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
  89. package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
  90. package/_vendor/plugin-connector/connectorRuntime.d.ts +62 -0
  91. package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
  92. package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
  93. package/_vendor/plugin-connector/constants.d.ts +17 -0
  94. package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
  95. package/_vendor/plugin-connector/feature.d.ts +4 -0
  96. package/_vendor/plugin-connector/index.d.ts +18 -0
  97. package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
  98. package/_vendor/plugin-connector/productRuntime.d.ts +2 -0
  99. package/_vendor/plugin-connector/quickConnect.d.ts +28 -0
  100. package/_vendor/plugin-connector/types.d.ts +51 -0
  101. package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
  102. package/_vendor/plugin-draw/drawPath.d.ts +7 -1
  103. package/_vendor/plugin-draw/editorRuntime.d.ts +1 -3
  104. package/_vendor/plugin-draw/feature.d.ts +2 -2
  105. package/_vendor/plugin-draw/index.d.ts +2 -1
  106. package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
  107. package/_vendor/plugin-eraser/editorRuntime.d.ts +1 -3
  108. package/_vendor/plugin-eraser/feature.d.ts +2 -2
  109. package/_vendor/plugin-eraser/index.d.ts +2 -1
  110. package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
  111. package/_vendor/plugin-frame/api.d.ts +19 -0
  112. package/_vendor/plugin-frame/canvasRender.d.ts +3 -3
  113. package/_vendor/plugin-frame/editorRuntime.d.ts +0 -2
  114. package/_vendor/plugin-frame/feature.d.ts +2 -2
  115. package/_vendor/plugin-frame/frameShapeUtil.d.ts +8 -0
  116. package/_vendor/plugin-frame/index.d.ts +4 -1
  117. package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
  118. package/_vendor/plugin-geo/api.d.ts +27 -0
  119. package/_vendor/plugin-geo/canvasRender.d.ts +3 -3
  120. package/_vendor/plugin-geo/editorRuntime.d.ts +1 -3
  121. package/_vendor/plugin-geo/feature.d.ts +2 -2
  122. package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  123. package/_vendor/plugin-geo/geoTools.d.ts +1 -1
  124. package/_vendor/plugin-geo/index.d.ts +7 -4
  125. package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
  126. package/_vendor/plugin-geo/types.d.ts +5 -1
  127. package/_vendor/plugin-group/canvasRender.d.ts +1 -2
  128. package/_vendor/plugin-group/editorRuntime.d.ts +0 -2
  129. package/_vendor/plugin-group/feature.d.ts +2 -2
  130. package/_vendor/plugin-group/index.d.ts +2 -1
  131. package/_vendor/plugin-group/productRuntime.d.ts +2 -0
  132. package/_vendor/plugin-image/editorRuntime.d.ts +0 -4
  133. package/_vendor/plugin-image/feature.d.ts +2 -2
  134. package/_vendor/plugin-image/index.d.ts +2 -1
  135. package/_vendor/plugin-image/productRuntime.d.ts +4 -0
  136. package/_vendor/plugin-image/styleRuntime.d.ts +5 -0
  137. package/_vendor/plugin-laser/editorRuntime.d.ts +1 -3
  138. package/_vendor/plugin-laser/feature.d.ts +2 -2
  139. package/_vendor/plugin-laser/index.d.ts +2 -1
  140. package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
  141. package/{builtins/controller/packagingController.d.ts → _vendor/plugin-packaging/api.d.ts} +13 -10
  142. package/_vendor/plugin-packaging/feature.d.ts +2 -2
  143. package/_vendor/plugin-packaging/index.d.ts +3 -1
  144. package/_vendor/plugin-packaging/productRuntime.d.ts +2 -2
  145. package/_vendor/plugin-path/PathShapeRenderer.d.ts +5 -2
  146. package/_vendor/plugin-path/editorRuntime.d.ts +1 -15
  147. package/_vendor/plugin-path/feature.d.ts +2 -2
  148. package/_vendor/plugin-path/index.d.ts +2 -1
  149. package/_vendor/plugin-path/pathHistory.d.ts +13 -0
  150. package/_vendor/plugin-path/pathShapeUtil.d.ts +3 -1
  151. package/_vendor/plugin-path/pathTool.d.ts +3 -0
  152. package/_vendor/plugin-path/productRuntime.d.ts +15 -0
  153. package/_vendor/plugin-text/api.d.ts +20 -0
  154. package/_vendor/plugin-text/capabilities.d.ts +2 -0
  155. package/_vendor/plugin-text/editorRuntime.d.ts +2 -8
  156. package/_vendor/plugin-text/feature.d.ts +1 -1
  157. package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +0 -2
  158. package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +1 -1
  159. package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
  160. package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -1
  161. package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
  162. package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
  163. package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
  164. package/_vendor/plugin-text/index.d.ts +7 -3
  165. package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
  166. package/_vendor/plugin-text/productRuntime.d.ts +6 -0
  167. package/_vendor/plugin-text/richTextUtils.d.ts +3 -2
  168. package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +4 -0
  169. package/_vendor/plugin-text/textFormatting.d.ts +2 -0
  170. package/_vendor/plugin-text/textLabelHelpers.d.ts +23 -2
  171. package/_vendor/plugin-text/textShapeUtil.d.ts +5 -2
  172. package/_vendor/plugin-text/textTypes.d.ts +1 -0
  173. package/_vendor/signals/core.d.ts +1 -0
  174. package/_vendor/signals/index.d.ts +1 -1
  175. package/_vendor/store/history.d.ts +1 -1
  176. package/_vendor/store/store.d.ts +2 -0
  177. package/browser/indexedDb.d.ts +10 -10
  178. package/browser/persistence.d.ts +4 -25
  179. package/chrome/floating/useCanvasKitFloatingPosition.d.ts +1 -1
  180. package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
  181. package/chrome/toolbar/useToolbarSurfaces.d.ts +9 -10
  182. package/chrome/types.d.ts +11 -8
  183. package/chrome/useCanvasKitChromeContext.d.ts +4 -7
  184. package/chrome/useChromeSurfaces.d.ts +12 -0
  185. package/controller/canvasKitController.d.ts +4 -11
  186. package/core/index.d.ts +3 -4
  187. package/core/product-controller/canvasProductController.d.ts +40 -11
  188. package/core/product-controller/index.d.ts +1 -1
  189. package/core/runtime/productServices.d.ts +5 -19
  190. package/core/runtime/runtimeContracts.d.ts +3 -3
  191. package/features/image/asset/imageAssetService.d.ts +2 -3
  192. package/features/image/asset/imageBlobStore.d.ts +1 -0
  193. package/features/image/asset/imageFileHelpers.d.ts +0 -6
  194. package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
  195. package/features/image/controller/imageProductController.d.ts +2 -2
  196. package/features/image/imageHostPlugin.d.ts +1 -0
  197. package/features/image/import/ImageImportController.d.ts +3 -1
  198. package/features/image/index.d.ts +1 -3
  199. package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
  200. package/features/image/toolbar/imageHostActions.d.ts +7 -8
  201. package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
  202. package/features/text/{textProductPlugin.d.ts → textHostPlugin.d.ts} +1 -1
  203. package/features/text/textSvgAssetInliner.d.ts +3 -0
  204. package/features/text/textSvgAssetPlugin.d.ts +2 -0
  205. package/index.css +1 -1
  206. package/index.d.ts +28 -18
  207. package/index.mjs +111 -84
  208. package/package.json +1 -1
  209. package/plugins/standardCanvasKitPlugins.d.ts +16 -0
  210. package/runtime/canvasKitPluginContracts.d.ts +31 -76
  211. package/runtime/canvasKitPluginSetup.d.ts +32 -0
  212. package/runtime/canvasKitResourceScope.d.ts +5 -0
  213. package/runtime/canvasKitRuntime.d.ts +9 -7
  214. package/runtime/canvasKitRuntimeContracts.d.ts +2 -5
  215. package/runtime/persistenceCoordinator.d.ts +33 -0
  216. package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -47
  217. package/builtins/controller/createBuiltInCanvasController.d.ts +0 -18
  218. package/builtins/controller/layerController.d.ts +0 -9
  219. package/builtins/controller/shapeCreationController.d.ts +0 -83
  220. package/builtins/index.d.ts +0 -7
  221. package/builtins/plugins.d.ts +0 -16
  222. package/chrome/useSvgExport.d.ts +0 -15
  223. package/core/api/apiRegistry.d.ts +0 -12
  224. package/features/actions/actionRuntime.d.ts +0 -16
  225. package/features/clipboard/clipboardPlugin.d.ts +0 -1
  226. package/features/image/imageProductPlugin.d.ts +0 -1
  227. package/features/image/import/useImageImport.d.ts +0 -16
  228. package/features/keyboard/keyboardShortcutPlugin.d.ts +0 -1
  229. package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -8
  230. package/features/selection/selectionActions.d.ts +0 -19
  231. package/features/selection/selectionContextMenuContributions.d.ts +0 -2
  232. package/features/selection/selectionPlugin.d.ts +0 -1
  233. package/features/selection/selectionToolbarContributions.d.ts +0 -2
  234. package/features/tool/toolActions.d.ts +0 -2
  235. package/features/tool/toolContextMenuContributions.d.ts +0 -2
  236. package/features/tool/toolPlugin.d.ts +0 -1
  237. package/features/tool/toolToolbarContributions.d.ts +0 -2
  238. package/features/view/viewActions.d.ts +0 -5
  239. package/features/view/viewContextMenuContributions.d.ts +0 -2
  240. package/features/view/viewPlugin.d.ts +0 -1
  241. package/product/standardCanvasKitPlugins.d.ts +0 -4
  242. package/runtime/canvasKitPlugins.d.ts +0 -33
@@ -0,0 +1,2 @@
1
+ import { type ChromeContribution } from "../canvas-plugin-sdk/index";
2
+ export declare const clipboardChromeContributions: readonly ChromeContribution[];
@@ -1,2 +1,2 @@
1
- import { type ContextMenuContribution } from "../../_vendor/canvas-plugin-sdk/index";
1
+ import { type ContextMenuContribution } from "../canvas-plugin-sdk/index";
2
2
  export declare const clipboardContextMenuContributions: readonly ContextMenuContribution[];
@@ -1,6 +1,5 @@
1
- import { type CanvasAction } from "../../_vendor/canvas-plugin-sdk/index";
2
- import type { KeyboardShortcutInput } from "../../_vendor/canvas-core/index";
3
- import type { ProductServiceRegistry } from "../../core/runtime/productServices";
1
+ import { type CanvasAction, type ProductServiceRegistry } from "../canvas-plugin-sdk/index";
2
+ import type { KeyboardShortcutInput } from "../canvas-core/index";
4
3
  export declare const SYSTEM_CLIPBOARD_COPY_ACTION_ID = "system.clipboard.copy";
5
4
  export declare const SYSTEM_CLIPBOARD_CUT_ACTION_ID = "system.clipboard.cut";
6
5
  export declare const SYSTEM_CLIPBOARD_PASTE_ACTION_ID = "system.clipboard.paste";
@@ -1,10 +1,10 @@
1
- import type { EditorClipboardPayload } from "../../_vendor/canvas-core/index";
2
- import { type ProductServiceFactory, type ProductServiceRegistry } from "../../core/runtime/productServices";
1
+ import type { EditorClipboardPayload } from "../canvas-core/index";
2
+ import { type ProductServiceFactory, type ProductServiceRegistry } from "../canvas-plugin-sdk/index";
3
3
  export interface CanvasClipboardService {
4
4
  write(payload: EditorClipboardPayload): Promise<void>;
5
5
  read(): Promise<EditorClipboardPayload | null>;
6
6
  getMemoryPayload(): EditorClipboardPayload | null;
7
7
  }
8
- export declare const canvasClipboardServiceToken: import("../..").ProductServiceToken<CanvasClipboardService>;
8
+ export declare const canvasClipboardServiceToken: import("../canvas-plugin-sdk/index").ProductServiceToken<CanvasClipboardService>;
9
9
  export declare function getCanvasClipboardService(services: ProductServiceRegistry): CanvasClipboardService | null;
10
10
  export declare function memoryCanvasClipboardService(): ProductServiceFactory<CanvasClipboardService>;
@@ -0,0 +1,3 @@
1
+ export { ClipboardPlugin } from "./plugin";
2
+ export * from "./clipboardContribution";
3
+ export * from "./clipboardService";
@@ -0,0 +1 @@
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>;
@@ -0,0 +1 @@
1
+ export declare function readBlobAsDataUrl(blob: Blob): Promise<string | null>;
@@ -0,0 +1,43 @@
1
+ import type { Editor, ShapeId, ThemeColorResolver } from "../canvas-core/index";
2
+ import { type CanvasExportArtifact, type CanvasExportContribution, type CanvasExportFormat, type CanvasExportRegistry } from "../canvas-plugin-sdk/index";
3
+ import { type PngExportResult } from "./pngExport";
4
+ import { type SvgAssetInliner, type SvgExportResult } from "./svgExport";
5
+ export type CanvasExportTarget = {
6
+ scope: "page" | "selection";
7
+ shapeIds?: never;
8
+ } | {
9
+ scope?: never;
10
+ shapeIds: readonly ShapeId[];
11
+ };
12
+ export interface CanvasExportAppearance {
13
+ readonly resolveThemeColor?: ThemeColorResolver;
14
+ }
15
+ export type CanvasSvgExportInput = CanvasExportTarget & {
16
+ appearance?: CanvasExportAppearance;
17
+ padding?: number;
18
+ };
19
+ export type CanvasPngExportInput = CanvasSvgExportInput & {
20
+ background?: string;
21
+ pixelRatio?: number;
22
+ };
23
+ export type CanvasGenericExportInput = CanvasExportTarget & {
24
+ format: string;
25
+ options?: unknown;
26
+ };
27
+ export interface CanvasExportApi {
28
+ getFormats(): readonly CanvasExportFormat[];
29
+ export(input: CanvasGenericExportInput): Promise<CanvasExportArtifact>;
30
+ exportPng(input: CanvasPngExportInput): Promise<PngExportResult>;
31
+ exportSvg(input: CanvasSvgExportInput): Promise<SvgExportResult>;
32
+ }
33
+ export declare const canvasExportApiToken: import("../canvas-plugin-sdk/index").ProductApiToken<CanvasExportApi>;
34
+ export declare function createCanvasExportApi({ editor, exportRegistry, }: {
35
+ editor: Editor;
36
+ exportRegistry: CanvasExportRegistry;
37
+ }): CanvasExportApi;
38
+ export declare function createSvgExportContribution({ assetInliners, }: {
39
+ assetInliners: readonly SvgAssetInliner[];
40
+ }): CanvasExportContribution;
41
+ export declare function createPngExportContribution({ assetInliners, }: {
42
+ assetInliners: readonly SvgAssetInliner[];
43
+ }): CanvasExportContribution;
@@ -0,0 +1,8 @@
1
+ export { readBlobAsDataUrl } from "./blobDataUrl";
2
+ export { canvasExportApiToken, createCanvasExportApi, createPngExportContribution, createSvgExportContribution, } from "./canvasExportApi";
3
+ export type { CanvasExportAppearance, CanvasExportApi, CanvasGenericExportInput, CanvasExportTarget, CanvasPngExportInput, CanvasSvgExportInput, } from "./canvasExportApi";
4
+ export { exportEditorPng, } from "./pngExport";
5
+ export type { PngExportOptions, PngExportResult, } from "./pngExport";
6
+ export { createBuiltinCanvasExportPlugin } from "./plugin";
7
+ export { exportEditorSvg, } from "./svgExport";
8
+ export type { ExportStatus, SvgAssetInliner, SvgExportOptions, SvgExportResult, } from "./svgExport";
@@ -0,0 +1,5 @@
1
+ import type { SvgAssetInliner } from "./svgExport";
2
+ import { type CanvasPlugin } from "../canvas-plugin-sdk/index";
3
+ export declare function createBuiltinCanvasExportPlugin({ svgAssetInliners, }: {
4
+ svgAssetInliners: SvgAssetInliner[];
5
+ }): CanvasPlugin;
@@ -0,0 +1,15 @@
1
+ import type { ShapeId, SvgExportSkippedShape } from "../canvas-core/index";
2
+ import { type ExportStatus, type SvgExportOptions } from "./svgExport";
3
+ export interface PngExportOptions extends SvgExportOptions {
4
+ background?: string;
5
+ pixelRatio?: number;
6
+ }
7
+ export interface PngExportResult {
8
+ status: ExportStatus;
9
+ blob: Blob | null;
10
+ width: number | null;
11
+ height: number | null;
12
+ exportedShapeIds: readonly ShapeId[];
13
+ skippedShapes: readonly SvgExportSkippedShape[];
14
+ }
15
+ export declare function exportEditorPng({ background, pixelRatio, ...svgOptions }: PngExportOptions): Promise<PngExportResult>;
@@ -1,7 +1,12 @@
1
- import type { Editor, ExportIntegrityReport, ShapeCapabilityManifest, ShapeId, SvgExportSkippedShape, SvgThemeColorResolver } from "../../_vendor/canvas-core/index";
1
+ import type { Editor, ExportIntegrityReport, ShapeCapabilityManifest, ShapeId, ShapeRecord, SvgExportSkippedShape, ThemeColorResolver } from "../canvas-core/index";
2
2
  export interface SvgAssetInliner {
3
+ prepare?(input: {
4
+ editor: Editor;
5
+ requestedShapeIds: readonly ShapeId[];
6
+ }): Promise<void>;
3
7
  inline(input: {
4
8
  editor: Editor;
9
+ exportedShapes: readonly ShapeRecord[];
5
10
  exportedShapeIds: readonly ShapeId[];
6
11
  svg: string;
7
12
  }): Promise<string>;
@@ -16,6 +21,8 @@ export type ExportStatus = {
16
21
  export interface SvgExportResult {
17
22
  status: ExportStatus;
18
23
  svg: string | null;
24
+ width: number | null;
25
+ height: number | null;
19
26
  exportedShapeIds: readonly ShapeId[];
20
27
  skippedShapes: readonly SvgExportSkippedShape[];
21
28
  }
@@ -23,7 +30,7 @@ export interface SvgExportOptions {
23
30
  assetInliners?: readonly SvgAssetInliner[];
24
31
  editor: Editor;
25
32
  padding?: number;
26
- resolveThemeColor?: SvgThemeColorResolver;
33
+ resolveThemeColor?: ThemeColorResolver;
27
34
  shapeIds: readonly ShapeId[];
28
35
  }
29
36
  export declare function exportEditorSvg({ assetInliners, editor, padding, resolveThemeColor, shapeIds, }: SvgExportOptions): Promise<SvgExportResult>;
@@ -0,0 +1,3 @@
1
+ import type { CanvasImportPreview, CanvasPluginComponentProps } from "../canvas-plugin-sdk/index";
2
+ export declare function CanvasImportHost({ editor, getHostElement, imports, }: CanvasPluginComponentProps): null;
3
+ export declare function getImportPreview(dataTransfer: DataTransfer | null): CanvasImportPreview;
@@ -0,0 +1 @@
1
+ export declare const canvasImportHostCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<boolean>;
@@ -0,0 +1,2 @@
1
+ export { canvasImportHostCapability } from "./capability";
2
+ export { ImportHostPlugin } from "./plugin";
@@ -0,0 +1 @@
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>;
@@ -0,0 +1 @@
1
+ export declare const canvasToolActionsCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<true>;
@@ -0,0 +1,2 @@
1
+ export { canvasToolActionsCapability } from "./capability";
2
+ export { BuiltinToolActionsPlugin } from "./plugin";
@@ -0,0 +1 @@
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>;
@@ -0,0 +1,2 @@
1
+ import { type CanvasAction } from "../canvas-plugin-sdk/index";
2
+ export declare const toolActions: readonly CanvasAction[];
@@ -0,0 +1,2 @@
1
+ import { type CanvasRenderPlugin } from "../canvas-react/host/index";
2
+ export declare function createConnectorCanvasRenderPlugin(): CanvasRenderPlugin;
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,8 @@
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[];
@@ -0,0 +1,70 @@
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[];
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,3 @@
1
+ import { type LandInteractionHandler } from "../canvas-core/index";
2
+ import { type ConnectorQuickCreateNodeFactory } from "./types";
3
+ export declare function createConnectorInteractionHandler(quickCreateNodeFactory: ConnectorQuickCreateNodeFactory): LandInteractionHandler;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,43 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,23 @@
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>;
@@ -0,0 +1,62 @@
1
+ import { type Box, type Editor, type Mat, type CancelEditorEvent, type ShapeColor, type ShapeId, type Vec } from "../canvas-core/index";
2
+ import { type Signal } from "../signals/index";
3
+ import type { ConnectorHead, ConnectorQuickCreateNodeFactory, ConnectorRouting, ConnectorStrokeStyle, ConnectorTerminal } from "./types";
4
+ import type { ConnectorCreationInvalidReason, ConnectorDraftEndpoint } from "./connectorModel";
5
+ export interface ConnectorPreviewGeometry {
6
+ routing: ConnectorRouting;
7
+ cornerRadius: number;
8
+ headStart: ConnectorHead;
9
+ headEnd: ConnectorHead;
10
+ stroke: ShapeColor;
11
+ strokeWidth: number;
12
+ strokeStyle: ConnectorStrokeStyle;
13
+ curveWaypoints: readonly Vec[];
14
+ orthogonalBends: readonly Vec[];
15
+ localToPageTransform: Mat;
16
+ }
17
+ export interface ConnectorPreviewEndpoint {
18
+ draft: ConnectorDraftEndpoint;
19
+ pagePoint: Vec;
20
+ pageOutwardNormal: Vec;
21
+ shapeId: ShapeId | null;
22
+ portId: string | null;
23
+ obstacleBounds?: Box;
24
+ }
25
+ interface ConnectorInteractionPreviewBase {
26
+ start: ConnectorPreviewEndpoint;
27
+ end: ConnectorPreviewEndpoint;
28
+ isDragging: boolean;
29
+ movingTerminal: ConnectorTerminal;
30
+ geometry: ConnectorPreviewGeometry;
31
+ }
32
+ export interface ConnectorCreationPreview extends ConnectorInteractionPreviewBase {
33
+ kind: "create";
34
+ origin: "canvas" | "port";
35
+ invalidReason: ConnectorCreationInvalidReason | null;
36
+ }
37
+ export interface ConnectorRebindPreview extends ConnectorInteractionPreviewBase {
38
+ kind: "rebind";
39
+ }
40
+ export type ConnectorInteractionPreview = ConnectorCreationPreview | ConnectorRebindPreview;
41
+ export interface ConnectorPointerSession {
42
+ pointerId: number;
43
+ originScreenPoint: Vec;
44
+ readonly preview: ConnectorCreationPreview;
45
+ update(screenPoint: Vec, pagePoint: Vec, accelKey: boolean): void;
46
+ complete(screenPoint: Vec, pagePoint: Vec, accelKey: boolean): void;
47
+ cancel(reason?: CancelEditorEvent["reason"]): void;
48
+ }
49
+ export interface ConnectorRuntime {
50
+ readonly previewSignal: Signal<ConnectorInteractionPreview | null>;
51
+ readonly quickCreateNodeFactory: ConnectorQuickCreateNodeFactory;
52
+ readonly selectionHandlesHiddenSignal: Signal<boolean>;
53
+ readonly pointerSession: ConnectorPointerSession | null;
54
+ setPointerSession(session: ConnectorPointerSession | null): void;
55
+ setPreview(preview: ConnectorInteractionPreview | null): void;
56
+ setSelectionHandlesHidden(hidden: boolean): void;
57
+ dispose(): void;
58
+ }
59
+ export declare const connectorRuntimeToken: import("../canvas-core/index").EditorRuntimeToken<ConnectorRuntime>;
60
+ export declare function createConnectorRuntime(editor: Editor, quickCreateNodeFactory: ConnectorQuickCreateNodeFactory): ConnectorRuntime;
61
+ export declare function getConnectorRuntime(editor: Editor): ConnectorRuntime;
62
+ export {};
@@ -0,0 +1,29 @@
1
+ import { Box, ShapeUtil, Vec, type ShapeBrushWrapInput, type ShapeGeometryInput, type ShapeLineSegmentHitTestInput, type ShapeLabelPathGeometry, type ShapePointHitTestInput, type ShapeSelectionFrameInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionOverlayInfo, type ShapeSelectionOverlayInfoInput, type ShapeSelectionResizeInput, type ShapeSelectionTransformCapabilityInput, type ShapeUpdate } from "../canvas-core/index";
2
+ import type { ConnectorShapeProps, ConnectorShapeRecord } from "./types";
3
+ export declare class ConnectorShapeUtil extends ShapeUtil<ConnectorShapeRecord> {
4
+ readonly type: "connector";
5
+ getDefaultProps(): ConnectorShapeProps;
6
+ validateProps(props: unknown): ConnectorShapeProps;
7
+ getLocalBounds(shape: ConnectorShapeRecord): Box;
8
+ getPointHitTestBounds(shape: ConnectorShapeRecord, input?: ShapeGeometryInput): Box;
9
+ canSnap(): boolean;
10
+ canParticipateInSelectionResize(_shape: ConnectorShapeRecord, input: ShapeSelectionTransformCapabilityInput): boolean;
11
+ resizeSelectionBounds(shape: ConnectorShapeRecord, input: ShapeSelectionResizeInput): ShapeUpdate;
12
+ canParticipateInSelectionFlip(): boolean;
13
+ canParticipateInSelectionRotation(): boolean;
14
+ canParticipateInSelectionTranslation(): boolean;
15
+ contributesToSelectionFrame(_shape: ConnectorShapeRecord, _input: ShapeSelectionFrameInput): boolean;
16
+ canUseSelectionResizeHandles(_shape: ConnectorShapeRecord, input: ShapeSelectionFrameInput): boolean;
17
+ canUseSelectionRotateHandle(_shape: ConnectorShapeRecord, input: ShapeSelectionFrameInput): boolean;
18
+ canStartTranslateFromSelectionBounds(_shape: ConnectorShapeRecord, input: ShapeSelectionFrameInput): boolean;
19
+ getSelectionHandleAnchors(shape: ConnectorShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
20
+ getSelectionOverlayInfo(shape: ConnectorShapeRecord, input: ShapeSelectionOverlayInfoInput): ShapeSelectionOverlayInfo;
21
+ getLabelPathGeometry(shape: ConnectorShapeRecord, input: ShapeSelectionOverlayInfoInput): ShapeLabelPathGeometry;
22
+ canCopyToClipboard(shape: ConnectorShapeRecord, input: {
23
+ editor: ShapeSelectionOverlayInfoInput["editor"];
24
+ copiedShapeIds: ReadonlySet<ConnectorShapeRecord["id"]>;
25
+ }): boolean;
26
+ isWrappedByBrush(shape: ConnectorShapeRecord, input: ShapeBrushWrapInput): boolean;
27
+ hitTest(shape: ConnectorShapeRecord, point: Vec, input?: ShapePointHitTestInput): boolean;
28
+ hitTestLineSegment(shape: ConnectorShapeRecord, input: ShapeLineSegmentHitTestInput): boolean;
29
+ }
@@ -0,0 +1,4 @@
1
+ import { StateNode, type Editor } from "../canvas-core/index";
2
+ export declare class ConnectorTool extends StateNode {
3
+ constructor(editor: Editor);
4
+ }
@@ -0,0 +1,17 @@
1
+ export declare const CONNECTOR_ORTHOGONAL_STUB_PAGE = 36;
2
+ export declare const CONNECTOR_ORTHOGONAL_OBSTACLE_CLEARANCE_PAGE = 36;
3
+ export declare const CONNECTOR_PORT_VISUAL_RADIUS_SCREEN = 4;
4
+ export declare const CONNECTOR_PORT_HOVER_RADIUS_SCREEN = 12;
5
+ export declare const CONNECTOR_PORT_HOVER_GAP_SCREEN = 8;
6
+ export declare const CONNECTOR_PORT_HOVER_ICON_SCREEN = 15;
7
+ export declare const CONNECTOR_PORT_HIT_RADIUS_SCREEN = 12;
8
+ export declare const CONNECTOR_PORT_VISUAL_OFFSET_SCREEN: number;
9
+ export declare const CONNECTOR_LINE_HIT_RADIUS_SCREEN = 12;
10
+ export declare const CONNECTOR_CLICK_DRAG_THRESHOLD_SCREEN = 4;
11
+ export declare const CONNECTOR_ORTHOGONAL_TERMINAL_SNAP_SCREEN = 8;
12
+ export declare const CONNECTOR_ORTHOGONAL_SEGMENT_SNAP_SCREEN = 8;
13
+ export declare const CONNECTOR_QUICK_CONNECT_DISTANCE_PAGE = 320;
14
+ export declare const CONNECTOR_QUICK_CONNECT_CROSS_AXIS_PAGE = 160;
15
+ export declare const CONNECTOR_QUICK_CREATE_GAP_PAGE = 96;
16
+ export declare const CONNECTOR_QUICK_CREATE_CROSS_GAP_PAGE = 48;
17
+ export declare const CONNECTOR_DASH_ARRAY = "8 6";
@@ -0,0 +1,7 @@
1
+ import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
2
+ import type { ConnectorQuickCreateNodeFactory, ConnectorShapeRecord } from "./types";
3
+ export declare class ConnectorShapeSvgExporter implements ShapeSvgExporter<ConnectorShapeRecord> {
4
+ readonly type: "connector";
5
+ toSvg(shape: ConnectorShapeRecord, context: SvgExportContext): SvgNode;
6
+ }
7
+ export declare function createConnectorEditorPlugin(quickCreateNodeFactory: ConnectorQuickCreateNodeFactory): EditorPlugin;
@@ -0,0 +1,4 @@
1
+ import { setupConnectorProduct } from "./productRuntime";
2
+ import type { ConnectorPluginOptions } from "./types";
3
+ export declare function createConnectorPlugin(options?: ConnectorPluginOptions): import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupConnectorProduct>;
4
+ export declare const Connector: import("../canvas-plugin-sdk/index").CanvasPlugin<typeof setupConnectorProduct>;
@@ -0,0 +1,18 @@
1
+ export { Connector, createConnectorPlugin } from "./feature";
2
+ export { ConnectorShapeUtil } from "./connectorShapeUtil";
3
+ export { ConnectorBindingUtil } from "./connectorBindingUtil";
4
+ export { ConnectorTool } from "./connectorTool";
5
+ export { ConnectorShapeSvgExporter, createConnectorEditorPlugin, } from "./editorRuntime";
6
+ export { setupConnectorProduct } from "./productRuntime";
7
+ export { createConnectorCanvasRenderPlugin } from "./canvasRender";
8
+ export { createConnectorTerminalOffsetMapper, getConnectorSegmentPoint, getConnectorInfo, getResolvedConnectorLocalInfo, getResolvedConnectorPageInfo, } from "./connectorGeometry";
9
+ export * from "./connectorHandles";
10
+ export type { ConnectorInfo, ConnectorSegment, ConnectorTerminalOffsetInput, ConnectorTerminalOffsetMapper, ConnectorTerminalGeometry, } from "./connectorGeometry";
11
+ export { CONNECTOR_ARROW_TERMINAL_PADDING, getConnectorArrowGlyphLength, getConnectorArrowLength, getConnectorArrowMagnification, getConnectorMarkerPath, getConnectorMarkerRefX, } from "./connectorMarker";
12
+ export { commitConnectorCreation, createConnectorBoundEndpoint, getConnectorCreationInvalidReason, getConnectorParentId, resolveConnectorDraftEndpoint, resolveConnectorDraftParentId, hasDirectedConnector, setConnectorTerminalPagePoint, } from "./connectorModel";
13
+ export type { CommitConnectorCreationInput, ConnectorBoundEndpoint, ConnectorCreationInvalidReason, ConnectorDraftEndpoint, ResolvedConnectorDraftEndpoint, } from "./connectorModel";
14
+ export { chooseFacingPort, createDefaultConnectorQuickCreateNodeFactory, findQuickConnectTargets, getConnectorVisualPortPoint, getNearestConnectorPortAtPoint, quickConnectFromPort, } from "./quickConnect";
15
+ export { getConnectorPortInteractionState, getVisibleConnectorSourcePortAtPoint, } from "./connectorPortInteraction";
16
+ export * from "./constants";
17
+ export type { ConnectorBindingProps, ConnectorBindingRecord, ConnectorHead, ConnectorPluginOptions, ConnectorPoint, ConnectorQuickCreateNodeFactory, ConnectorRouting, ConnectorShapeProps, ConnectorShapeRecord, ConnectorStrokeStyle, ConnectorTerminal, } from "./types";
18
+ export { isConnectorBindingRecord, isConnectorShapeRecord, } from "./types";
@@ -0,0 +1,9 @@
1
+ import { Box, Vec } from "../canvas-core/index";
2
+ interface RouteTerminal {
3
+ point: Vec;
4
+ direction: Vec;
5
+ obstacleId?: string;
6
+ obstacleBounds?: Box;
7
+ }
8
+ export declare function getOrthogonalRoutePoints(start: RouteTerminal, end: RouteTerminal): Vec[];
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
2
+ export declare function setupConnectorProduct(context: CanvasPluginSetupContext): void;
@@ -0,0 +1,28 @@
1
+ import { Vec, type CreateShapeInput, type Editor, type ResolvedShapeTerminalBindingPort, type ShapeId, type ShapeRecord } from "../canvas-core/index";
2
+ import { type ConnectorQuickCreateNodeFactory, type ConnectorShapeProps } from "./types";
3
+ export interface ConnectorPortTarget {
4
+ shape: ShapeRecord;
5
+ port: ResolvedShapeTerminalBindingPort;
6
+ }
7
+ export type ConnectorQuickConnectPlan = {
8
+ kind: "connect";
9
+ target: ConnectorPortTarget;
10
+ } | {
11
+ kind: "create";
12
+ nodeInput: CreateShapeInput;
13
+ previewShape: ShapeRecord;
14
+ targetPort: ResolvedShapeTerminalBindingPort;
15
+ };
16
+ export declare function getConnectorVisualPortPoint(port: ResolvedShapeTerminalBindingPort, zoom: number): Vec;
17
+ export declare function getConnectorPortHitDistance(port: ResolvedShapeTerminalBindingPort, pagePoint: Vec, zoom: number): number;
18
+ export declare function getNearestConnectorPortAtPoint(editor: Editor, pagePoint: Vec, options?: {
19
+ allowInteriorShapeId?: ShapeId;
20
+ excludeShapeIds?: ReadonlySet<ShapeId>;
21
+ mode?: "source" | "target";
22
+ pageId?: ReturnType<Editor["getShapePageId"]>;
23
+ }): ConnectorPortTarget | null;
24
+ export declare function quickConnectFromPort(editor: Editor, source: ConnectorPortTarget, factory: ConnectorQuickCreateNodeFactory, props: ConnectorShapeProps): boolean;
25
+ export declare function getConnectorQuickConnectPlan(editor: Editor, source: ConnectorPortTarget, factory: ConnectorQuickCreateNodeFactory): ConnectorQuickConnectPlan | null;
26
+ export declare function findQuickConnectTargets(editor: Editor, source: ConnectorPortTarget): ConnectorPortTarget[];
27
+ export declare function chooseFacingPort(editor: Editor, shape: ShapeRecord, sourcePagePoint: Vec): ResolvedShapeTerminalBindingPort | null;
28
+ export declare function createDefaultConnectorQuickCreateNodeFactory(): ConnectorQuickCreateNodeFactory;