@yuzhouu/canvas-kit 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/README.md +95 -40
  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/capability.d.ts +10 -0
  35. package/_vendor/canvas-plugin-sdk/index.d.ts +2 -6
  36. package/_vendor/canvas-plugin-sdk/plugin.d.ts +18 -28
  37. package/_vendor/canvas-plugin-sdk/setupExtension.d.ts +5 -0
  38. package/_vendor/canvas-product-contracts/actionRegistry.d.ts +4 -0
  39. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/actions.d.ts +14 -3
  40. package/_vendor/canvas-product-contracts/capability.d.ts +8 -0
  41. package/_vendor/canvas-product-contracts/chrome.d.ts +53 -0
  42. package/_vendor/canvas-product-contracts/chromeRegistry.d.ts +9 -0
  43. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/contextMenu.d.ts +4 -0
  44. package/_vendor/canvas-product-contracts/contextMenuRegistry.d.ts +4 -0
  45. package/_vendor/canvas-product-contracts/exportRegistry.d.ts +6 -0
  46. package/_vendor/canvas-product-contracts/exports.d.ts +27 -0
  47. package/_vendor/canvas-product-contracts/importRegistry.d.ts +7 -0
  48. package/_vendor/canvas-product-contracts/imports.d.ts +39 -0
  49. package/_vendor/canvas-product-contracts/index.d.ts +15 -0
  50. package/_vendor/canvas-product-contracts/productApi.d.ts +29 -0
  51. package/_vendor/canvas-product-contracts/services.d.ts +21 -0
  52. package/_vendor/{canvas-plugin-sdk → canvas-product-contracts}/toolbar.d.ts +23 -4
  53. package/_vendor/canvas-product-contracts/toolbarRegistry.d.ts +9 -0
  54. package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +15 -4
  55. package/_vendor/canvas-react/host/index.d.ts +2 -2
  56. package/_vendor/plugin-arrow/api.d.ts +33 -0
  57. package/_vendor/plugin-arrow/arrowGeometry.d.ts +2 -1
  58. package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
  59. package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +2 -1
  60. package/_vendor/plugin-arrow/editorRuntime.d.ts +0 -2
  61. package/_vendor/plugin-arrow/feature.d.ts +2 -2
  62. package/_vendor/plugin-arrow/index.d.ts +4 -1
  63. package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
  64. package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
  65. package/_vendor/plugin-draw/drawPath.d.ts +7 -1
  66. package/_vendor/plugin-draw/editorRuntime.d.ts +1 -3
  67. package/_vendor/plugin-draw/feature.d.ts +2 -2
  68. package/_vendor/plugin-draw/index.d.ts +2 -1
  69. package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
  70. package/_vendor/plugin-eraser/editorRuntime.d.ts +1 -3
  71. package/_vendor/plugin-eraser/feature.d.ts +2 -2
  72. package/_vendor/plugin-eraser/index.d.ts +2 -1
  73. package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
  74. package/_vendor/plugin-frame/api.d.ts +19 -0
  75. package/_vendor/plugin-frame/canvasRender.d.ts +3 -3
  76. package/_vendor/plugin-frame/editorRuntime.d.ts +0 -2
  77. package/_vendor/plugin-frame/feature.d.ts +2 -2
  78. package/_vendor/plugin-frame/frameShapeUtil.d.ts +8 -0
  79. package/_vendor/plugin-frame/index.d.ts +4 -1
  80. package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
  81. package/_vendor/plugin-geo/api.d.ts +27 -0
  82. package/_vendor/plugin-geo/canvasRender.d.ts +3 -3
  83. package/_vendor/plugin-geo/editorRuntime.d.ts +1 -3
  84. package/_vendor/plugin-geo/feature.d.ts +2 -2
  85. package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  86. package/_vendor/plugin-geo/geoTools.d.ts +1 -1
  87. package/_vendor/plugin-geo/index.d.ts +7 -4
  88. package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
  89. package/_vendor/plugin-geo/types.d.ts +5 -1
  90. package/_vendor/plugin-group/canvasRender.d.ts +1 -2
  91. package/_vendor/plugin-group/editorRuntime.d.ts +0 -2
  92. package/_vendor/plugin-group/feature.d.ts +2 -2
  93. package/_vendor/plugin-group/groupContributions.d.ts +1 -1
  94. package/_vendor/plugin-group/index.d.ts +2 -1
  95. package/_vendor/plugin-group/productRuntime.d.ts +2 -0
  96. package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
  97. package/_vendor/plugin-image/editorRuntime.d.ts +0 -4
  98. package/_vendor/plugin-image/feature.d.ts +2 -2
  99. package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
  100. package/_vendor/plugin-image/index.d.ts +2 -1
  101. package/_vendor/plugin-image/productRuntime.d.ts +4 -0
  102. package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
  103. package/_vendor/plugin-image/smudgeRuntime.d.ts +1 -1
  104. package/_vendor/plugin-image/styleRuntime.d.ts +6 -1
  105. package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
  106. package/_vendor/plugin-laser/editorRuntime.d.ts +1 -3
  107. package/_vendor/plugin-laser/feature.d.ts +2 -2
  108. package/_vendor/plugin-laser/index.d.ts +2 -1
  109. package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
  110. package/_vendor/plugin-path/PathShapeRenderer.d.ts +5 -2
  111. package/_vendor/plugin-path/editorRuntime.d.ts +1 -15
  112. package/_vendor/plugin-path/feature.d.ts +2 -2
  113. package/_vendor/plugin-path/index.d.ts +2 -1
  114. package/_vendor/plugin-path/pathHistory.d.ts +13 -0
  115. package/_vendor/plugin-path/pathShapeUtil.d.ts +3 -1
  116. package/_vendor/plugin-path/pathTool.d.ts +3 -0
  117. package/_vendor/plugin-path/productRuntime.d.ts +15 -0
  118. package/_vendor/plugin-runtime-clipboard/capability.d.ts +1 -0
  119. package/{features/clipboard/clipboardContribution.d.ts → _vendor/plugin-runtime-clipboard/clipboardActions.d.ts} +1 -7
  120. package/{features/clipboard → _vendor/plugin-runtime-clipboard}/clipboardService.d.ts +3 -3
  121. package/_vendor/plugin-runtime-clipboard/index.d.ts +4 -0
  122. package/_vendor/plugin-runtime-clipboard/plugin.d.ts +1 -0
  123. package/_vendor/plugin-runtime-export/blobDataUrl.d.ts +1 -0
  124. package/_vendor/plugin-runtime-export/canvasExportApi.d.ts +43 -0
  125. package/_vendor/plugin-runtime-export/index.d.ts +8 -0
  126. package/_vendor/plugin-runtime-export/plugin.d.ts +5 -0
  127. package/_vendor/plugin-runtime-export/pngExport.d.ts +15 -0
  128. package/{features/export → _vendor/plugin-runtime-export}/svgExport.d.ts +9 -2
  129. package/_vendor/plugin-text/api.d.ts +20 -0
  130. package/_vendor/plugin-text/capabilities.d.ts +2 -0
  131. package/_vendor/plugin-text/editorRuntime.d.ts +2 -8
  132. package/_vendor/plugin-text/feature.d.ts +1 -1
  133. package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +0 -2
  134. package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +1 -1
  135. package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
  136. package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -1
  137. package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
  138. package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
  139. package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
  140. package/_vendor/plugin-text/index.d.ts +7 -3
  141. package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
  142. package/_vendor/plugin-text/productRuntime.d.ts +6 -0
  143. package/_vendor/plugin-text/richTextUtils.d.ts +3 -2
  144. package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +4 -0
  145. package/_vendor/plugin-text/textFormatting.d.ts +2 -0
  146. package/_vendor/plugin-text/textLabelHelpers.d.ts +23 -2
  147. package/_vendor/plugin-text/textShapeUtil.d.ts +5 -2
  148. package/_vendor/plugin-text/textTypes.d.ts +1 -0
  149. package/_vendor/signals/core.d.ts +1 -0
  150. package/_vendor/signals/index.d.ts +1 -1
  151. package/_vendor/store/history.d.ts +1 -1
  152. package/_vendor/store/store.d.ts +2 -0
  153. package/browser/indexedDb.d.ts +10 -10
  154. package/browser/persistence.d.ts +4 -25
  155. package/chrome/floating/useCanvasKitFloatingPosition.d.ts +1 -1
  156. package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
  157. package/chrome/toolbar/mergeToolbarGroups.d.ts +8 -0
  158. package/chrome/toolbar/toolbarLabels.d.ts +1 -1
  159. package/chrome/toolbar/useToolbarSurfaces.d.ts +9 -10
  160. package/chrome/types.d.ts +12 -9
  161. package/chrome/useCanvasKitChromeContext.d.ts +4 -7
  162. package/chrome/useChromeSurfaces.d.ts +12 -0
  163. package/chrome/useContextMenuSurface.d.ts +1 -1
  164. package/controller/canvasKitController.d.ts +4 -11
  165. package/core/index.d.ts +3 -4
  166. package/core/product-controller/canvasProductController.d.ts +40 -11
  167. package/core/product-controller/index.d.ts +1 -1
  168. package/core/runtime/productServices.d.ts +5 -19
  169. package/core/runtime/runtimeContracts.d.ts +3 -3
  170. package/features/context-menu/contextMenuRuntime.d.ts +1 -1
  171. package/features/image/asset/imageAssetService.d.ts +2 -3
  172. package/features/image/asset/imageBlobStore.d.ts +1 -0
  173. package/features/image/asset/imageFileHelpers.d.ts +0 -6
  174. package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
  175. package/features/image/controller/imageProductController.d.ts +2 -2
  176. package/features/image/imageHostPlugin.d.ts +1 -0
  177. package/features/image/import/ImageImportController.d.ts +3 -1
  178. package/features/image/index.d.ts +1 -3
  179. package/features/image/smudge/imageSmudgeHostActions.d.ts +1 -1
  180. package/features/image/toolbar/imageHostActions.d.ts +8 -9
  181. package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
  182. package/features/text/{textProductPlugin.d.ts → textHostPlugin.d.ts} +1 -1
  183. package/features/text/textSvgAssetInliner.d.ts +3 -0
  184. package/features/text/textSvgAssetPlugin.d.ts +2 -0
  185. package/index.css +1 -1
  186. package/index.d.ts +31 -19
  187. package/index.mjs +88 -84
  188. package/package.json +2 -2
  189. package/plugins/runtime/import-host/CanvasImportHost.d.ts +4 -0
  190. package/plugins/runtime/import-host/capability.d.ts +1 -0
  191. package/plugins/runtime/import-host/index.d.ts +2 -0
  192. package/plugins/runtime/import-host/plugin.d.ts +1 -0
  193. package/plugins/runtime/keyboard-shortcuts/index.d.ts +1 -0
  194. package/plugins/runtime/keyboard-shortcuts/plugin.d.ts +1 -0
  195. package/plugins/runtime/keyboard-shortcuts/useCanvasKeyboardShortcuts.d.ts +8 -0
  196. package/plugins/runtime/tool-actions/capability.d.ts +1 -0
  197. package/plugins/runtime/tool-actions/index.d.ts +2 -0
  198. package/plugins/runtime/tool-actions/plugin.d.ts +1 -0
  199. package/plugins/runtime/tool-actions/toolActions.d.ts +2 -0
  200. package/plugins/standard/clipboard/chrome.d.ts +2 -0
  201. package/plugins/standard/clipboard/contextMenu.d.ts +2 -0
  202. package/plugins/standard/clipboard/plugin.d.ts +1 -0
  203. package/plugins/standard/clipboard/shortcuts.d.ts +5 -0
  204. package/plugins/standard/createStandardCanvasKitPlugins.d.ts +15 -0
  205. package/{features/selection/selectionActions.d.ts → plugins/standard/selection/actions.d.ts} +4 -2
  206. package/plugins/standard/selection/chrome.d.ts +2 -0
  207. package/plugins/standard/selection/contextMenu.d.ts +2 -0
  208. package/plugins/standard/selection/plugin.d.ts +1 -0
  209. package/plugins/standard/selection/toolbar.d.ts +2 -0
  210. package/plugins/standard/tool-ui/contextMenu.d.ts +2 -0
  211. package/plugins/standard/tool-ui/plugin.d.ts +1 -0
  212. package/plugins/standard/tool-ui/toolbar.d.ts +2 -0
  213. package/{features/view/viewActions.d.ts → plugins/standard/view/actions.d.ts} +1 -1
  214. package/plugins/standard/view/chrome.d.ts +2 -0
  215. package/plugins/standard/view/contextMenu.d.ts +2 -0
  216. package/plugins/standard/view/plugin.d.ts +1 -0
  217. package/{features/actions/actionRuntime.d.ts → runtime/canvasKitActionContext.d.ts} +3 -2
  218. package/runtime/canvasKitCommandExecutor.d.ts +1 -1
  219. package/runtime/canvasKitPluginContracts.d.ts +29 -76
  220. package/runtime/canvasKitPluginLifecycle.d.ts +32 -0
  221. package/runtime/canvasKitPluginSetup.d.ts +34 -0
  222. package/runtime/canvasKitPluginUi.d.ts +35 -0
  223. package/runtime/canvasKitResourceScope.d.ts +5 -0
  224. package/runtime/canvasKitRuntime.d.ts +9 -7
  225. package/runtime/canvasKitRuntimeContracts.d.ts +2 -5
  226. package/runtime/canvasPluginGraph.d.ts +15 -0
  227. package/runtime/persistenceCoordinator.d.ts +33 -0
  228. package/runtime/registries/actionRegistry.d.ts +5 -0
  229. package/runtime/registries/chromeRegistry.d.ts +2 -0
  230. package/runtime/registries/contextMenuRegistry.d.ts +5 -0
  231. package/runtime/registries/exportRegistry.d.ts +2 -0
  232. package/runtime/registries/importRegistry.d.ts +2 -0
  233. package/runtime/registries/index.d.ts +7 -0
  234. package/runtime/registries/productApiRegistry.d.ts +5 -0
  235. package/runtime/registries/toolbarRegistry.d.ts +5 -0
  236. package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +0 -7
  237. package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +0 -11
  238. package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +0 -19
  239. package/_vendor/plugin-packaging/canvasRender.d.ts +0 -2
  240. package/_vendor/plugin-packaging/editorRuntime.d.ts +0 -2
  241. package/_vendor/plugin-packaging/feature.d.ts +0 -2
  242. package/_vendor/plugin-packaging/index.d.ts +0 -17
  243. package/_vendor/plugin-packaging/packagingArtwork.d.ts +0 -5
  244. package/_vendor/plugin-packaging/packagingDxf.d.ts +0 -9
  245. package/_vendor/plugin-packaging/packagingGeometry.d.ts +0 -74
  246. package/_vendor/plugin-packaging/packagingInteractions.d.ts +0 -2
  247. package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +0 -25
  248. package/_vendor/plugin-packaging/packagingRuntime.d.ts +0 -11
  249. package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +0 -34
  250. package/_vendor/plugin-packaging/packagingStyle.d.ts +0 -10
  251. package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +0 -7
  252. package/_vendor/plugin-packaging/productRuntime.d.ts +0 -2
  253. package/_vendor/plugin-packaging/types.d.ts +0 -168
  254. package/_vendor/plugin-packaging/validation.d.ts +0 -3
  255. package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -47
  256. package/builtins/controller/createBuiltInCanvasController.d.ts +0 -18
  257. package/builtins/controller/layerController.d.ts +0 -9
  258. package/builtins/controller/packagingController.d.ts +0 -71
  259. package/builtins/controller/shapeCreationController.d.ts +0 -83
  260. package/builtins/index.d.ts +0 -7
  261. package/builtins/plugins.d.ts +0 -16
  262. package/chrome/useSvgExport.d.ts +0 -15
  263. package/core/api/apiRegistry.d.ts +0 -12
  264. package/es-DocrZgUh.mjs +0 -2
  265. package/features/clipboard/clipboardContextMenuContributions.d.ts +0 -2
  266. package/features/clipboard/clipboardPlugin.d.ts +0 -1
  267. package/features/image/imageProductPlugin.d.ts +0 -1
  268. package/features/image/import/useImageImport.d.ts +0 -16
  269. package/features/keyboard/keyboardShortcutPlugin.d.ts +0 -1
  270. package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -8
  271. package/features/selection/selectionContextMenuContributions.d.ts +0 -2
  272. package/features/selection/selectionPlugin.d.ts +0 -1
  273. package/features/selection/selectionToolbarContributions.d.ts +0 -2
  274. package/features/tool/toolActions.d.ts +0 -2
  275. package/features/tool/toolContextMenuContributions.d.ts +0 -2
  276. package/features/tool/toolPlugin.d.ts +0 -1
  277. package/features/tool/toolToolbarContributions.d.ts +0 -2
  278. package/features/view/viewContextMenuContributions.d.ts +0 -2
  279. package/features/view/viewPlugin.d.ts +0 -1
  280. package/product/standardCanvasKitPlugins.d.ts +0 -4
  281. package/runtime/canvasKitPlugins.d.ts +0 -33
@@ -11,6 +11,7 @@ export declare class SelectionOverlayManager {
11
11
  readonly frameGeometrySignal: Signal<SelectionOverlayFrameGeometryState | null>;
12
12
  readonly companionFrameGeometriesSignal: Signal<SelectionOverlayFrameGeometryState[]>;
13
13
  readonly pathSignal: Signal<string | null>;
14
+ readonly pageClipPathSignal: Signal<string | null>;
14
15
  readonly bindingSegmentsSignal: Signal<SelectionBindingSegment[]>;
15
16
  readonly frameStyleSignal: Signal<SelectionOverlayFrameStyleState>;
16
17
  readonly frameSignal: Signal<SelectionOverlayFrameState | null>;
@@ -13,6 +13,7 @@ export declare class ShapeEditingManager {
13
13
  private readonly entryRequestAtom;
14
14
  readonly entryRequestSignal: Signal<ShapeEditingEntryRequest | null>;
15
15
  private nextEntryRequestId;
16
+ private operation;
16
17
  constructor(editor: Editor);
17
18
  canEditShape(shapeOrId: ShapeRecord | ShapeId | null | undefined): boolean;
18
19
  start(input: StartEditingShapeInput, source?: ChangeSource): ShapeEditingSession | null;
@@ -21,9 +22,12 @@ export declare class ShapeEditingManager {
21
22
  setComposition(isComposing: boolean, source?: ChangeSource): void;
22
23
  consumeEntryRequest(requestId: number): void;
23
24
  removeShapeIds(ids: ShapeId[], source?: ChangeSource): void;
25
+ prepareForShapeRemoval(ids: readonly ShapeId[], source?: ChangeSource): void;
24
26
  end(options: {
25
27
  runEditEnd: boolean;
26
28
  source: ChangeSource;
27
29
  }): void;
30
+ cancelOperation(): void;
31
+ private commitOperation;
28
32
  private publishEntryRequest;
29
33
  }
@@ -49,6 +49,7 @@ export declare class ShapeHierarchyManager {
49
49
  getShapeIdsForSelectionRotation(shapeIds: Iterable<ShapeId>): ShapeId[];
50
50
  getSelectionTransformTargetShapes(): ShapeRecord[];
51
51
  canResizeSelection(): boolean;
52
+ canFlipSelection(): boolean;
52
53
  canRotateSelection(): boolean;
53
54
  getSelectionResizeTargetShapes(): ShapeRecord[];
54
55
  getSelectionRotationTargetShapes(): ShapeRecord[];
@@ -2,10 +2,12 @@ import { Box } from "../../geometry/box";
2
2
  import { Vec } from "../../geometry/vec";
3
3
  import type { ShapeId } from "../../schema/records";
4
4
  import type { SelectionResizeHandleId } from "../selection";
5
- import type { ResizeSnapInput, SnapAxis, SnapNode, SnapPointIndex, SnapPoint } from "./snapTypes";
5
+ import type { ResizeSnapInput, SnapAxis, SnapNode, SnapPointIndex, SnapPoint, SnapPointKind } from "./snapTypes";
6
6
  export interface PointSnapPair {
7
7
  selectionPoint: Vec;
8
+ selectionPointKind?: SnapPointKind;
8
9
  candidatePoint: Vec;
10
+ candidatePointKind?: SnapPointKind;
9
11
  candidatePointId: string;
10
12
  candidateNodeId: ShapeId;
11
13
  }
@@ -36,6 +38,7 @@ export type AxisSnap = PointAxisSnap | GapAxisSnap;
36
38
  export interface PointSnapOptions {
37
39
  previousCandidatePointIds?: ReadonlySet<string>;
38
40
  releaseThreshold?: number;
41
+ selectionPointKinds?: readonly (SnapPointKind | undefined)[];
39
42
  switchDistance?: number;
40
43
  stats?: PointSnapStats;
41
44
  }
@@ -1,7 +1,8 @@
1
1
  import { Box } from "../../geometry/box";
2
2
  import { Vec } from "../../geometry/vec";
3
- import type { SnapAxis } from "./snapTypes";
3
+ import type { SnapAxis, SnapPointKind } from "./snapTypes";
4
4
  export declare const EPSILON = 1e-8;
5
+ export declare const BOX_SNAP_POINT_KINDS: readonly SnapPointKind[];
5
6
  export declare function areVecsEqual(left: Vec, right: Vec): boolean;
6
7
  export declare function getBoxSnapPoints(bounds: Box): Vec[];
7
8
  export declare function getAxisValue(point: Vec, axis: SnapAxis): number;
@@ -0,0 +1,74 @@
1
+ import { type ChangeSource, type RecordsDiff } from "../../store/index";
2
+ import { type DocumentRecord } from "../schema/records";
3
+ import type { DocumentSnapshot, SessionSnapshot } from "../schema/snapshots";
4
+ import type { Editor } from "./editor";
5
+ export type EditorOperationHistory = "record" | "ignore";
6
+ export interface EditorOperationOptions {
7
+ kind: string;
8
+ label?: string;
9
+ source?: ChangeSource;
10
+ history?: EditorOperationHistory;
11
+ }
12
+ export interface EditorCommit {
13
+ id: string;
14
+ revision: number;
15
+ kind: string;
16
+ label: string;
17
+ source: ChangeSource;
18
+ history: EditorOperationHistory;
19
+ diff: RecordsDiff<DocumentRecord>;
20
+ snapshot: DocumentSnapshot;
21
+ sessionSnapshot: SessionSnapshot;
22
+ }
23
+ export interface EditorOperation {
24
+ readonly id: string;
25
+ readonly kind: string;
26
+ readonly source: ChangeSource;
27
+ readonly isActive: boolean;
28
+ commit(): EditorCommit | null;
29
+ cancel(): void;
30
+ }
31
+ interface EditorOperationState {
32
+ id: string;
33
+ kind: string;
34
+ label: string;
35
+ source: ChangeSource;
36
+ history: EditorOperationHistory;
37
+ parent: EditorOperationState | null;
38
+ diff: RecordsDiff<DocumentRecord>;
39
+ status: "active" | "committed" | "cancelled";
40
+ handle: EditorOperationHandle;
41
+ }
42
+ type CommitListener = (commit: EditorCommit) => void;
43
+ declare class EditorOperationHandle implements EditorOperation {
44
+ private readonly manager;
45
+ readonly state: EditorOperationState;
46
+ constructor(manager: EditorOperationManager, state: EditorOperationState);
47
+ get id(): string;
48
+ get kind(): string;
49
+ get source(): ChangeSource;
50
+ get isActive(): boolean;
51
+ commit(): EditorCommit | null;
52
+ cancel(): void;
53
+ }
54
+ export declare class EditorOperationManager {
55
+ private readonly editor;
56
+ private readonly stack;
57
+ private readonly commitListeners;
58
+ private readonly commitQueue;
59
+ private nextOperationId;
60
+ private revision;
61
+ private isPublishing;
62
+ constructor(editor: Editor);
63
+ begin(options: EditorOperationOptions): EditorOperation;
64
+ run<T>(options: EditorOperationOptions, fn: () => T): T;
65
+ getActive(): EditorOperation | null;
66
+ subscribe(listener: CommitListener): () => void;
67
+ commit(state: EditorOperationState): EditorCommit | null;
68
+ cancel(state: EditorOperationState): void;
69
+ private handleStoreChange;
70
+ private getActiveState;
71
+ private assertTopActive;
72
+ private enqueueCommit;
73
+ }
74
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Vec } from "../geometry/vec";
2
2
  import type { ShapeId, ShapeRecord } from "../schema/records";
3
- import type { ShapeSelectionHandleAnchors } from "../shapes/shapeUtil";
3
+ import type { ShapeSelectionHandleAnchors, ShapeSelectionPathStyle } from "../shapes/shapeUtil";
4
4
  import { type SelectionBindingMiddleHandle, type SelectionBindingSegment, type SelectionBindingTerminalHandle, type SelectionCustomHandle, type SelectionFrame, type SelectionOverlayFrameGeometryState, type SelectionOverlayFrameState, type SelectionOverlayFrameStyleState, type SelectionOverlayHandleAnchorsState, type SelectionOverlayHandleCountsState, type SelectionOverlayHandlesState, type SelectionResizeHandle, type SelectionResizeHandleId, type SelectionRotateHandle } from "./selection";
5
5
  export interface SelectedShapeOverlayItem {
6
6
  id: ShapeId;
@@ -9,6 +9,8 @@ export interface SelectedShapeOverlayItem {
9
9
  endPagePoint: Vec | null;
10
10
  middlePagePoint: Vec | null;
11
11
  path: string | null;
12
+ pathStyle: ShapeSelectionPathStyle | null;
13
+ pageClipPath: string | null;
12
14
  bindingSegments: readonly SelectionBindingSegment[];
13
15
  }
14
16
  export interface SelectionHandleState {
@@ -1,7 +1,7 @@
1
1
  import { Box } from "../geometry/box";
2
2
  import type { Editor } from "../editor/editor";
3
3
  import type { AssetId, ShapeId, ShapeRecordBase } from "../schema/records";
4
- import { type ShapeColor, type ThemeColorTokenName } from "../shapes/colors";
4
+ import { type ShapeColor, type ThemeColorResolver } from "../shapes/colors";
5
5
  export type SvgAttributeValue = string | number | boolean | null | undefined;
6
6
  export interface SvgElementNode {
7
7
  tag: string;
@@ -16,7 +16,6 @@ export interface SvgExportContext {
16
16
  resolveAssetUrl(assetId: AssetId): string | null;
17
17
  resolveColor(color: ShapeColor): string;
18
18
  }
19
- export type SvgThemeColorResolver = (token: ThemeColorTokenName, fallback: string) => string;
20
19
  export interface ShapeSvgExporter<S extends ShapeRecordBase = ShapeRecordBase> {
21
20
  type: S["type"];
22
21
  toSvg(shape: S, context: SvgExportContext): SvgNode | null;
@@ -25,7 +24,7 @@ export interface ShapeSvgExporter<S extends ShapeRecordBase = ShapeRecordBase> {
25
24
  export interface SvgExportOptions {
26
25
  padding?: number;
27
26
  background?: string;
28
- resolveThemeColor?: SvgThemeColorResolver;
27
+ resolveThemeColor?: ThemeColorResolver;
29
28
  }
30
29
  export interface SvgExportResult {
31
30
  svg: string;
@@ -0,0 +1,8 @@
1
+ import { Box } from "./box";
2
+ import { Mat } from "./mat";
3
+ import { Vec } from "./vec";
4
+ export declare function getShapeContentClipPath({ outputBounds, cutoutLocalPolygons, localToOutput, }: {
5
+ outputBounds: Box;
6
+ cutoutLocalPolygons: readonly (readonly Vec[])[];
7
+ localToOutput?: Mat;
8
+ }): string | null;
@@ -1,7 +1,9 @@
1
1
  export { Editor } from "./editor/editor";
2
2
  export { createEditorWithPlugins, type CreateEditorWithPluginsOptions, } from "./editor/createEditorWithPlugins";
3
3
  export { HistoryManager, type HistoryScope, type HistoryScopeState, type HistoryState, } from "./editor/historyManager";
4
+ export { EditorOperationManager, type EditorCommit, type EditorOperation, type EditorOperationHistory, type EditorOperationOptions, } from "./editor/operationManager";
4
5
  export { doesLineSegmentIntersectPolygon, distanceBetweenSegments, distanceToSegment, getPolygonsBounds, isPointInPolygon, isPointInPolygons, isValidPolygon, nearestPointOnSegment, segmentsIntersect, } from "./geometry";
6
+ export { getShapeContentClipPath } from "./geometry/contentCutout";
5
7
  export { getShapeGeometry, getShapeExportBounds, getShapeExportPageBounds, getShapeExportToPageTransform, getShapeLocalBounds, getShapeLocalToPageTransform, getShapeTransformFieldsFromMatrix, getShapePositionedOutlineVertices, getShapePositionedToPageTransform, getShapePageBounds, getShapePageCenter, getShapePageCorners, getShapePageOutlineVertices, pagePointToShapePositionedPoint, positionedShapePointToPagePoint, getShapeRenderBounds, getShapeRenderToPageTransform, } from "./editor/queries/shapeTransforms";
6
8
  export type { ShapeGeometry, ShapeTransformDecompositionOptions, ShapeTransformFields, } from "./editor/queries/shapeTransforms";
7
9
  export type { BindingPreviewState, GapSnapIndicatorGapState, GapSnapIndicatorState, PointSnapIndicatorState, SnapIndicatorState, SelectionBindingSegment, TerminalBindingGuideState, SelectionBindingMiddleHandle, SelectionBindingMiddleHandleAnchor, SelectionBindingTerminalHandle, SelectionBindingTerminalHandleAnchor, SelectionCustomHandle, SelectionCustomHandleAnchor, SelectionHandle, SelectionOverlayFrameState, SelectionOverlayFrameGeometryState, SelectionOverlayFrameStyleState, SelectionOverlayHandleAnchorsState, SelectionOverlayHandleCountsState, SelectionOverlayHandlesState, SelectionOverlayState, SelectionResizeHandle, SelectionResizeHandleAnchor, SelectionResizeHandleId, SelectionResizeMode, SelectionRotateHandle, SelectionRotateHandleAnchor, SelectionRotateHandleId, SelectionMirrorAxis, } from "./editor/selection";
@@ -10,12 +12,14 @@ export { getAnchoredSelectionResizeLocalBounds, getAspectRatioLockedSelectionRes
10
12
  export { InteractionHandlerRegistry } from "./editor/interactions";
11
13
  export { SelectionHandleInteractionRegistry } from "./editor/selectionHandleInteractions";
12
14
  export { ShortcutManager, formatKeyboardShortcut, normalizeKeyboardShortcut, } from "./editor/managers/shortcutManager";
13
- export type { EditorEventInteractionDecision, EditorEventInteractionHandler, LandInteractionHandler, SelectionHandleInteractionHandler, SelectionHandleInteractionInput, SelectionHandleInteractionSession, SelectionHandleInteractionUpdateResult, } from "./editor/interactions";
15
+ export type { EditorEventInteractionDecision, EditorEventInteractionHandler, LandInteractionHandler, PointerDragInteractionSession, PointerDragInteractionUpdateResult, SelectionHandleInteractionHandler, SelectionHandleInteractionInput, SelectionHandleInteractionSession, SelectionHandleInteractionUpdateResult, ShapePointerInteractionHandler, ShapePointerInteractionInput, } from "./editor/interactions";
14
16
  export type { EditorKeyboardShortcutCommand, KeyboardShortcutBinding, KeyboardShortcutChord, KeyboardShortcutEventLike, KeyboardShortcutInput, KeyboardShortcutTarget, } from "./editor/managers/shortcutManager";
15
17
  export type { ContainerBoundsQueryOptions, EditorPageState, EditorOverlayDebugState, EditorRenderHostDebugState, EditorSelectionMetadata, EditorSelectionState, LayerOrderDirection, LayerOrderEdge, ReparentShapePlacementInput, ReparentShapePlacementFailureReason, ReparentShapePlacementResult, ShapeSiblingOrderDirection, ShapeSiblingOrderEdge, ShapeSiblingOrderState, ShapeGroupState, ShapeSelectionSiblingOrderState, ShapePropsPatch, EditorToolState, EditorShapeEditingState, } from "./editor/editor";
16
18
  export type { ShapeContainment } from "./editor/managers/queryManager";
17
19
  export type { ShapeAtPointOptions, ShapeLineSegmentHitTestOptions, SpatialQueryOptions, } from "./editor/managers/spatialIndexManager";
18
20
  export type { TerminalBindingTargetInput, ConnectionPoint, ConnectionTerminal, TerminalBindingResolver, TerminalBindingResolverInput, ResolvedTerminalBinding, } from "./bindings/terminalBinding";
21
+ export { DEFAULT_TERMINAL_BINDING_PORTS, getResolvedShapeTerminalBindingPort, getResolvedShapeTerminalBindingPorts, } from "./bindings/terminalPorts";
22
+ export type { ResolvedShapeTerminalBindingPort, ShapeTerminalBindingPort, TerminalBindingPortId, } from "./bindings/terminalPorts";
19
23
  export type { EditorCommandOptions, EditorCommands, CreateAssetInput, CreateBindingInput, CreatePageInput, MovePageInput, RenamePageInput, ReparentShapesInput, CreateShapeInput, SetCameraInput, ShapeUpdate, StartEditingShapeInput, UpdateAssetInput, UpdateBindingInput, UpdateDocumentMetaInput, UpdatePageMetaInput, } from "./editor/commands";
20
24
  export { reparentShapeToContainingParent } from "./editor/commands";
21
25
  export { isEditorClipboardPayload, } from "./editor/clipboard";
@@ -25,25 +29,25 @@ export type { ChangeSource, RecordUpdate, RecordsDiff, ScopedStoreRecord, StoreR
25
29
  export { SnapshotParseError, parseDocumentSnapshot, parseSessionSnapshot, } from "./schema/snapshots";
26
30
  export type { DocumentSnapshot, SessionSnapshot } from "./schema/snapshots";
27
31
  export { ShapeUtil } from "./shapes/shapeUtil";
28
- export type { ShapeBoundsSnapGeometry, ShapeBrushSelectInput, ShapeBrushWrapInput, ShapeBindingPointInput, ShapeBindingTargetHitTestInput, ShapeChildPlacementInput, ShapeChildVisibilityInput, ShapeEditEndInput, ShapeEditEndResult, ShapeGeometryInput, ShapeGroupingInput, ShapeHandleSnapContext, ShapeHandleSnapGeometry, ShapeLineSegmentHitTestInput, ShapePointHitTestInput, ShapeSnapPoint, ShapeSnapPointKind, ShapeSelectionHandleAnchorInput, ShapeSelectionHandleAnchors, ShapeSelectionFrameInput, ShapeSelectionFlipAxis, ShapeSelectionFlipInput, ShapeSelectionOverlayInfo, ShapeSelectionOverlayInfoInput, ShapeSelectionPagePoints, ShapeSelectionPagePointsInput, ShapeSelectionResizeInput, ShapeSelectionResizeCapabilityInput, ShapeSelectionResizeModesInput, ShapeSelectionTransformCapabilityInput, ShapeSelectionTranslateInput, } from "./shapes/shapeUtil";
32
+ export type { ShapeBoundsSnapGeometry, ShapeBrushSelectInput, ShapeBrushWrapInput, ShapeClipboardCopyInput, ShapeBindingPointInput, ShapeBindingTargetHitTestInput, ShapeChildPlacementInput, ShapeChildVisibilityInput, ShapeEditEndInput, ShapeEditEndResult, ShapeGeometryInput, ShapeGroupingInput, ShapeHandleSnapContext, ShapeHandleSnapGeometry, ShapeHoverTargetInput, ShapeLineSegmentHitTestInput, ShapeLabelPathGeometry, ShapeLabelPathNearestPositionOptions, ShapePointHitTestInput, ShapeSnapPoint, ShapeSnapPointKind, ShapeTerminalBindingOutline, ShapeSelectionHandleAnchorInput, ShapeSelectionHandleAnchors, ShapeSelectionFrameInput, ShapeSelectionFlipAxis, ShapeSelectionFlipInput, ShapeSelectionOverlayInfo, ShapeSelectionOverlayInfoInput, ShapeSelectionPathStyle, ShapeSelectionPagePoints, ShapeSelectionPagePointsInput, ShapeSelectionResizeInput, ShapeSelectionResizeCapabilityInput, ShapeSelectionResizeModesInput, ShapeSelectionTransformCapabilityInput, ShapeSelectionTranslateInput, } from "./shapes/shapeUtil";
29
33
  export type { HandleSnapContext, HandleSnapInput, HandleSnapMode, HandleSnapResult, HandleSnapSnapshot, HandleSnapSnapshotInput, ResizeSnapInput, ResizeSnapResult, ResizeSnapSnapshot, SnapAxis, SnapCoordinateSpace, SnapPointIndex, SnapPointIndexEntry, SnapPointKind, TranslateSnapInput, TranslateSnapResult, TranslateSnapSnapshot, } from "./editor/managers/snapTypes";
30
34
  export { ShapeUtilRegistry } from "./shapes/shapeUtilRegistry";
31
35
  export { resolveTerminalBindingAtPoint, } from "./bindings/terminalBinding";
32
36
  export { ShapeSvgExporterRegistry, exportShapesToSvgString, renderSvgNode, } from "./exports/svg";
33
- export type { ShapeSvgExporter, SvgAttributeValue, SvgElementNode, SvgExportContext, SvgExportOptions, SvgExportResult, SvgExportSkipReason, SvgExportSkippedShape, SvgThemeColorResolver, SvgNode, } from "./exports/svg";
37
+ export type { ShapeSvgExporter, SvgAttributeValue, SvgElementNode, SvgExportContext, SvgExportOptions, SvgExportResult, SvgExportSkipReason, SvgExportSkippedShape, SvgNode, } from "./exports/svg";
34
38
  export { getExportIntegrityReport, repairExportIntegrity, } from "./exports/integrity";
35
39
  export type { ExportIntegrityIssue, ExportIntegrityIssueKind, ExportIntegrityRepairResult, ExportIntegrityReport, } from "./exports/integrity";
36
40
  export { getShapeCapabilityManifest } from "./shapes/capabilities";
37
41
  export type { ShapeCapabilityDefinition, ShapeCapabilityManifest, ShapeCapabilityManifestEntry, ShapeCapabilitySupport, } from "./shapes/capabilities";
38
42
  export { BindingUtil } from "./bindings/bindingUtil";
39
- export type { BindingSelectionCompanionFrameContext, BindingUtilEffect, } from "./bindings/bindingUtil";
43
+ export type { BindingSelectionCompanionFrameContext, BindingTargetShapeContentCutoutContext, BindingUtilEffect, } from "./bindings/bindingUtil";
40
44
  export { BindingUtilRegistry } from "./bindings/bindingUtilRegistry";
41
45
  export { StateNode } from "./editor/stateNode";
42
46
  export { getEdgeScrollDelta } from "./editor/edgeScroll";
43
47
  export { HandTool } from "./tools/hand/handTool";
44
48
  export { SelectTool } from "./tools/select/selectTool";
45
49
  export { LAND_DEFAULT_THEME_COLOR_FALLBACKS, LAND_THEME_COLOR_SLOTS, LAND_THEME_COLOR_TOKEN_BY_SLOT, areShapeColorsEqual, createCustomShapeColor, createThemeShapeColor, getThemeColorTokenName, isCustomShapeColorRef, isShapeColor, isThemeShapeColorRef, isTransparentShapeColor, normalizeShapeColor, resolveShapeColor, shapeColorToCssColor, } from "./shapes/colors";
46
- export type { CustomShapeColorRef, ShapeColor, ThemeColorSlot, ThemeColorTokenName, ThemeShapeColorRef, } from "./shapes/colors";
50
+ export type { CustomShapeColorRef, ShapeColor, ThemeColorSlot, ThemeColorResolver, ThemeColorTokenName, ThemeShapeColorRef, } from "./shapes/colors";
47
51
  export { getEditorOptionsFromPlugins, setupEditorPlugins, type EditorPlugin, createEditorRuntimeToken, EditorRuntimeRegistry, type EditorRuntimeToken, } from "./plugins";
48
52
  export { DEFAULT_CAMERA, DEFAULT_DOCUMENT_ID, DEFAULT_PAGE_ID, DEFAULT_SESSION_ID, createDefaultDocument, createDefaultPage, createDefaultSession, isAssetRecord, isBindingRecord, isDocumentRecord, isDocumentMetadataRecord, isPageRecord, isSessionRecord, isShapeRecord, type AssetId, type AssetRecord, type AssetRecordBase, type BaseRecord, type BindingId, type BindingRecordBase, type BindingRecord, type Camera, type DocumentId, type DocumentMetadataRecord, type DocumentRecord, type EditorRecord, type PageCameraById, type PageId, type PageSelectionById, type PageRecord, type RecordScope, type SessionRecord, type ShapeId, type ShapeParentId, type ShapeRecordBase, type ShapeRecord, type ShapeEditingEntryRequest, type ShapeEditingEntryMode, type ShapeEditingPoint, type ShapeEditingSession, } from "./schema/records";
49
53
  export { Vec } from "./geometry/vec";
@@ -1,6 +1,7 @@
1
1
  export declare const LAND_THEME_COLOR_SLOTS: readonly ["fill-blue", "fill-green", "fill-red", "fill-amber", "fill-white", "fill-slate", "stroke-blue", "stroke-green", "stroke-red", "stroke-orange", "stroke-slate", "stroke-muted", "text-slate", "text-blue", "text-green", "text-red"];
2
2
  export type ThemeColorSlot = (typeof LAND_THEME_COLOR_SLOTS)[number];
3
3
  export type ThemeColorTokenName = `--land-shape-${ThemeColorSlot}`;
4
+ export type ThemeColorResolver = (token: ThemeColorTokenName, fallback: string) => string;
4
5
  export interface ThemeShapeColorRef {
5
6
  kind: "theme";
6
7
  slot: ThemeColorSlot;
@@ -20,6 +21,6 @@ export declare function isShapeColor(value: unknown): value is ShapeColor;
20
21
  export declare function getThemeColorTokenName(slot: ThemeColorSlot): ThemeColorTokenName;
21
22
  export declare function normalizeShapeColor(value: unknown, fallback: ShapeColor): ShapeColor;
22
23
  export declare function shapeColorToCssColor(color: ShapeColor): string;
23
- export declare function resolveShapeColor(color: ShapeColor, resolveThemeColor?: (token: ThemeColorTokenName, fallback: string) => string): string;
24
+ export declare function resolveShapeColor(color: ShapeColor, resolveThemeColor?: ThemeColorResolver): string;
24
25
  export declare function isTransparentShapeColor(color: ShapeColor): boolean;
25
26
  export declare function areShapeColorsEqual(left: ShapeColor | null | undefined, right: ShapeColor | null | undefined): boolean;
@@ -6,6 +6,7 @@ import type { CreateShapeInput, ShapeUpdate } from "../editor/commands";
6
6
  import { type SelectionMirrorAxis } from "../editor/selection";
7
7
  import type { SelectionBindingMiddleHandleAnchor, SelectionBindingSegment, SelectionBindingTerminalHandleAnchor, SelectionCustomHandleAnchor, SelectionHandle, SelectionResizeHandleId, SelectionResizeMode } from "../editor/selection";
8
8
  import type { ShapeId, ShapeParentId, ShapeRecordBase } from "../schema/records";
9
+ import { type ShapeTerminalBindingPort } from "../bindings/terminalPorts";
9
10
  export interface ShapeEditEndResult {
10
11
  deleteShapeIds?: ShapeId[];
11
12
  }
@@ -34,6 +35,8 @@ export interface ShapeSelectionResizeCapabilityInput {
34
35
  }
35
36
  export interface ShapeSelectionTransformCapabilityInput {
36
37
  editor: Editor;
38
+ /** Set by aggregate capability checks; omitted by frame-only queries. */
39
+ isOnlyAffectedShape?: boolean;
37
40
  }
38
41
  export interface ShapeSelectionResizeModesInput extends ShapeSelectionResizeCapabilityInput {
39
42
  handleId: SelectionResizeHandleId;
@@ -76,6 +79,10 @@ export interface ShapeLineSegmentHitTestInput {
76
79
  export interface ShapeGeometryInput {
77
80
  editor: Editor;
78
81
  }
82
+ export interface ShapeClipboardCopyInput {
83
+ editor: Editor;
84
+ copiedShapeIds: ReadonlySet<ShapeId>;
85
+ }
79
86
  export interface ShapeChildVisibilityInput {
80
87
  editor: Editor;
81
88
  }
@@ -89,6 +96,10 @@ export interface ShapePointHitTestInput extends ShapeGeometryInput {
89
96
  }
90
97
  export interface ShapeBindingTargetHitTestInput extends ShapePointHitTestInput {
91
98
  }
99
+ export interface ShapeTerminalBindingOutline {
100
+ points: readonly Vec[];
101
+ closed: boolean;
102
+ }
92
103
  export type ShapeSnapPointKind = "corner" | "edge_midpoint" | "center" | "custom";
93
104
  export interface ShapeSnapPoint {
94
105
  point: Vec;
@@ -114,23 +125,50 @@ export interface ShapeSelectionHandleAnchorInput {
114
125
  editor: Editor;
115
126
  }
116
127
  export type ShapeSelectionFrameInput = ShapeSelectionTransformCapabilityInput;
128
+ export interface ShapeHoverTargetInput {
129
+ editor: Editor;
130
+ }
117
131
  export interface ShapeSelectionTranslateInput {
118
132
  editor: Editor;
119
133
  }
120
134
  export interface ShapeSelectionOverlayInfoInput {
121
135
  editor: Editor;
122
136
  }
137
+ export interface ShapeLabelPathNearestPositionOptions {
138
+ hintPosition?: number;
139
+ }
140
+ /**
141
+ * A page-space path that can host a bound label. Positions are normalized by
142
+ * the owner-defined path measure so labels preserve their relative placement
143
+ * when the owner geometry changes.
144
+ */
145
+ export interface ShapeLabelPathGeometry {
146
+ length: number;
147
+ defaultPosition: number;
148
+ getPointAt(position: number): Vec;
149
+ getNearestPosition(point: Vec, options?: ShapeLabelPathNearestPositionOptions): number;
150
+ }
123
151
  export interface ShapeSelectionHandleAnchors {
124
152
  terminalHandleAnchors: readonly SelectionBindingTerminalHandleAnchor[];
125
153
  middleHandleAnchors: readonly SelectionBindingMiddleHandleAnchor[];
126
154
  customHandleAnchors?: readonly SelectionCustomHandleAnchor[];
127
155
  }
156
+ export interface ShapeSelectionPathStyle {
157
+ localPath: string;
158
+ localDecorationPaths: readonly string[];
159
+ localBounds: Box;
160
+ localToPage: Mat;
161
+ strokeWidth: number;
162
+ strokeDasharray?: string;
163
+ }
128
164
  export interface ShapeSelectionOverlayInfo {
129
165
  usesSelectionPathOverlay: boolean;
130
166
  startPagePoint: Vec | null;
131
167
  endPagePoint: Vec | null;
132
168
  middlePagePoint: Vec | null;
133
169
  path: string | null;
170
+ pathStyle: ShapeSelectionPathStyle | null;
171
+ pageClipPath?: string | null;
134
172
  bindingSegments?: readonly SelectionBindingSegment[];
135
173
  }
136
174
  export declare abstract class ShapeUtil<S extends ShapeRecordBase = ShapeRecordBase> {
@@ -156,10 +194,14 @@ export declare abstract class ShapeUtil<S extends ShapeRecordBase = ShapeRecordB
156
194
  getSelectionPageMiddlePoint(_shape: S): Vec | null;
157
195
  contributesToSelectionFrame(_shape: S, _input: ShapeSelectionFrameInput): boolean;
158
196
  canParticipateInSelectionResize(_shape: S, _input: ShapeSelectionTransformCapabilityInput): boolean;
197
+ canParticipateInSelectionFlip(shape: S, input: ShapeSelectionTransformCapabilityInput): boolean;
159
198
  canParticipateInSelectionRotation(_shape: S, _input: ShapeSelectionTransformCapabilityInput): boolean;
160
199
  canUseSelectionResizeHandles(shape: S, input: ShapeSelectionFrameInput): boolean;
161
200
  canUseSelectionRotateHandle(shape: S, input: ShapeSelectionFrameInput): boolean;
201
+ canParticipateInSelectionTranslation(_shape: S, _input: ShapeSelectionTranslateInput): boolean;
162
202
  getSelectionTargetId(shape: S, _input: ShapeSelectionFrameInput): ShapeId;
203
+ getHoverTargetId(shape: S, _input: ShapeHoverTargetInput): ShapeId;
204
+ getHoverDecorationTargetId(shape: S, _input: ShapeHoverTargetInput): ShapeId;
163
205
  getTranslateTargetId(shape: S, _input: ShapeSelectionTranslateInput): ShapeId;
164
206
  isSelectionTransformContainer(_shape: S): boolean;
165
207
  shouldRotateDescendants(shape: S): boolean;
@@ -170,7 +212,7 @@ export declare abstract class ShapeUtil<S extends ShapeRecordBase = ShapeRecordB
170
212
  canUngroupChildren(_shape: S): boolean;
171
213
  getGroupingShapeCreateInput(_input: ShapeGroupingInput): CreateShapeInput | null;
172
214
  canStartTranslateFromSelectionBounds(_shape: S, _input: ShapeSelectionFrameInput): boolean;
173
- canSnap(_shape: S): boolean;
215
+ canSnap(_shape: S, _input?: ShapeGeometryInput): boolean;
174
216
  canSnapChildrenToSelf(_shape: S): boolean;
175
217
  getBoundsSnapGeometry(_shape: S): ShapeBoundsSnapGeometry;
176
218
  getHandleSnapGeometry(shape: S): ShapeHandleSnapGeometry;
@@ -178,6 +220,7 @@ export declare abstract class ShapeUtil<S extends ShapeRecordBase = ShapeRecordB
178
220
  getSelectionFramePositionedOutlineVertices(_shape: S, _input: ShapeSelectionFrameInput): Vec[] | null;
179
221
  getSelectionHandleAnchors(_shape: S, _input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
180
222
  getSelectionOverlayInfo(_shape: S, _input: ShapeSelectionOverlayInfoInput): ShapeSelectionOverlayInfo;
223
+ getLabelPathGeometry(_shape: S, _input: ShapeSelectionOverlayInfoInput): ShapeLabelPathGeometry | null;
181
224
  isWrappedByBrush(_shape: S, input: ShapeBrushWrapInput): boolean;
182
225
  canSelectByBrush(shape: S, input: ShapeBrushSelectInput): boolean;
183
226
  getLocalToPageTransform(shape: S): Mat;
@@ -189,6 +232,9 @@ export declare abstract class ShapeUtil<S extends ShapeRecordBase = ShapeRecordB
189
232
  canAutomaticallyReceiveChildren(shape: S): boolean;
190
233
  canBeDirectlyBrushSelected(_shape: S): boolean;
191
234
  canReceiveTerminalBinding(_shape: S, _input?: ShapeGeometryInput): boolean;
235
+ getTerminalBindingPorts(shape: S, input: ShapeGeometryInput): readonly ShapeTerminalBindingPort[];
236
+ getTerminalBindingOutlines(shape: S, input: ShapeGeometryInput): readonly ShapeTerminalBindingOutline[];
237
+ canCopyToClipboard(_shape: S, _input: ShapeClipboardCopyInput): boolean;
192
238
  repairLoadedShape(_shape: S): S | null;
193
239
  onEditEnd(_shape: S, _input: ShapeEditEndInput): ShapeEditEndResult | void;
194
240
  hitTest(shape: S, positionedPoint: Vec, _input?: ShapePointHitTestInput): boolean;
@@ -5,7 +5,8 @@ import type { ShapeUpdate } from "../../editor/commands";
5
5
  import type { Editor } from "../../editor/editor";
6
6
  import type { PointerEditorEvent, TickEditorEvent } from "../../editor/events";
7
7
  import type { SelectionResizeHandleId, SelectionResizeMode, SelectionResizePointShapeSnapshot, SelectionResizeShapeSnapshot, SelectionRotationTransform, SelectionRotatePointShapeSnapshot, SelectionRotateShapeSnapshot } from "../../editor/selection";
8
- import type { HandleSnapSnapshot, ResizeSnapSnapshot, TranslateSnapSnapshot } from "../../editor/managers/snapTypes";
8
+ import type { HandleSnapMode, HandleSnapSnapshot, ResizeSnapSnapshot, TranslateSnapSnapshot } from "../../editor/managers/snapTypes";
9
+ import type { PointerDragInteractionSession } from "../../editor/interactions";
9
10
  import type { SelectionHandleInteractionSession } from "../../editor/selectionHandleInteractions";
10
11
  import type { ShapeId, ShapeRecord } from "../../schema/records";
11
12
  export declare const DRAG_START_DISTANCE = 3;
@@ -38,6 +39,7 @@ export interface PointingShapeInfo {
38
39
  wasSelected: boolean;
39
40
  fromSelectionBounds: boolean;
40
41
  quickClickSelectionTargetId: ShapeId | null;
42
+ dragSession: PointerDragInteractionSession | null;
41
43
  }
42
44
  export interface TranslatingShapeSnapshot {
43
45
  id: ShapeId;
@@ -107,7 +109,12 @@ export interface PointingSelectionHandleInteractionInfo {
107
109
  session: SelectionHandleInteractionSession;
108
110
  snapSnapshot: HandleSnapSnapshot | null;
109
111
  }
110
- export interface DraggingSelectionHandleInteractionInfo extends PointingSelectionHandleInteractionInfo {
112
+ export interface DraggingPluginInteractionInfo {
113
+ originPagePoint: Vec;
114
+ previousSelection: ShapeId[];
115
+ session: PointerDragInteractionSession;
116
+ snapMode: HandleSnapMode;
117
+ snapSnapshot: HandleSnapSnapshot | null;
111
118
  lastPagePointX: number;
112
119
  lastPagePointY: number;
113
120
  lastShiftKey: boolean;
@@ -1,15 +1,16 @@
1
1
  import type { Editor } from "../../../editor/editor";
2
2
  import { StateNode } from "../../../editor/stateNode";
3
3
  import type { CancelEditorEvent, PointerEditorEvent } from "../../../editor/events";
4
- import { type DraggingSelectionHandleInteractionInfo } from "../selectToolHelpers";
4
+ import { type DraggingPluginInteractionInfo } from "../selectToolHelpers";
5
5
  import { DraggingStateNode, type DragApplyInput } from "./selectStateNode";
6
- export declare class DraggingSelectionHandleInteractionState extends DraggingStateNode<DraggingSelectionHandleInteractionInfo> {
6
+ export declare class DraggingPluginInteractionState extends DraggingStateNode<DraggingPluginInteractionInfo> {
7
7
  protected readonly tickMode: "apply_after_scroll";
8
8
  constructor(editor: Editor, parent: StateNode);
9
- protected getHistoryMark(info: DraggingSelectionHandleInteractionInfo): string;
9
+ protected getOperationKind(info: DraggingPluginInteractionInfo): string;
10
+ protected onDragStart(): void;
10
11
  protected onPointerUp(event: PointerEditorEvent): void;
11
12
  protected onCancel(event: CancelEditorEvent): void;
12
13
  protected onInfoExit(): void;
13
- protected apply({ pagePoint, shiftKey, altKey, accelKey }: DragApplyInput): void;
14
+ protected apply({ pagePoint, shiftKey, altKey, accelKey, }: DragApplyInput): void;
14
15
  private complete;
15
16
  }
@@ -1,5 +1,5 @@
1
1
  export { BrushingState } from "./brushingState";
2
- export { DraggingSelectionHandleInteractionState } from "./draggingSelectionHandleInteractionState";
2
+ export { DraggingPluginInteractionState } from "./draggingPluginInteractionState";
3
3
  export { IdleState } from "./idleState";
4
4
  export { PointingCanvasState } from "./pointingCanvasState";
5
5
  export { PointingResizeHandleState } from "./pointingResizeHandleState";
@@ -1,11 +1,11 @@
1
1
  import type { Editor } from "../../../editor/editor";
2
- import type { CancelEditorEvent } from "../../../editor/events";
2
+ import type { CancelEditorEvent, PointerEditorEvent } from "../../../editor/events";
3
3
  import { StateNode } from "../../../editor/stateNode";
4
4
  import { type PointingSelectionHandleInteractionInfo } from "../selectToolHelpers";
5
5
  import { PointingStateNode } from "./selectStateNode";
6
6
  export declare class PointingSelectionHandleInteractionState extends PointingStateNode<PointingSelectionHandleInteractionInfo> {
7
7
  constructor(editor: Editor, parent: StateNode);
8
8
  protected onDragThresholdExceeded(): void;
9
- protected onPointerUp(): void;
9
+ protected onPointerUp(event: PointerEditorEvent): void;
10
10
  protected onCancel(event: CancelEditorEvent): void;
11
11
  }
@@ -6,7 +6,7 @@ import { PointingStateNode } from "./selectStateNode";
6
6
  export declare class PointingShapeState extends PointingStateNode<PointingShapeInfo> {
7
7
  constructor(editor: Editor, parent: StateNode);
8
8
  protected onInfoEnter(): void;
9
- protected onDragThresholdExceeded(): void;
9
+ protected onDragThresholdExceeded(event: PointerEditorEvent): void;
10
10
  protected onPointerUp(event: PointerEditorEvent): void;
11
11
  protected onCancel(): void;
12
12
  }
@@ -5,7 +5,7 @@ import { DraggingStateNode, type DragApplyInput } from "./selectStateNode";
5
5
  export declare class ResizingState extends DraggingStateNode<ResizingInfo> {
6
6
  protected readonly tickMode: "apply_after_scroll_or_without_screen_point";
7
7
  constructor(editor: Editor, parent: StateNode);
8
- protected getHistoryMark(): string;
8
+ protected getOperationKind(): string;
9
9
  protected onDragStart(): void;
10
10
  protected onPointerUp(): void;
11
11
  protected onCancel(): void;
@@ -5,7 +5,7 @@ import { DraggingStateNode, type DragApplyInput } from "./selectStateNode";
5
5
  export declare class RotatingState extends DraggingStateNode<RotatingInfo> {
6
6
  protected readonly tickMode: "apply_after_scroll";
7
7
  constructor(editor: Editor, parent: StateNode);
8
- protected getHistoryMark(): string;
8
+ protected getOperationKind(): string;
9
9
  protected onPointerUp(): void;
10
10
  protected onCancel(): void;
11
11
  protected apply({ pagePoint, shiftKey, accelKey }: DragApplyInput): void;
@@ -2,6 +2,7 @@ import type { Vec } from "../../../geometry/vec";
2
2
  import { StateNode } from "../../../editor/stateNode";
3
3
  import type { PointerEditorEvent, TickEditorEvent } from "../../../editor/events";
4
4
  import { type EdgeScrollTickMode } from "../selectToolHelpers";
5
+ import type { EditorOperation } from "../../../editor/operationManager";
5
6
  /**
6
7
  * Base for every select-tool state that carries a transient `info` payload.
7
8
  * Centralises the identical `info` lifecycle (assign on enter, clear on exit)
@@ -43,10 +44,11 @@ export interface DragApplyInput {
43
44
  * completion/cancellation and any extra cleanup.
44
45
  */
45
46
  export declare abstract class DraggingStateNode<T> extends InfoStateNode<T> {
47
+ protected operation: EditorOperation | null;
46
48
  /** Edge-scroll behaviour for this gesture's tick handling. */
47
49
  protected abstract readonly tickMode: EdgeScrollTickMode;
48
- /** History mark to open on enter (constant or derived from `info`). */
49
- protected abstract getHistoryMark(info: T): string;
50
+ /** Stable operation kind for this gesture. */
51
+ protected abstract getOperationKind(info: T): string;
50
52
  /** Apply one drag sample. Implementations must guard on `this.info`. */
51
53
  protected abstract apply(input: DragApplyInput): void;
52
54
  protected onInfoEnter(): void;
@@ -57,4 +59,6 @@ export declare abstract class DraggingStateNode<T> extends InfoStateNode<T> {
57
59
  protected onKeyDown(): void;
58
60
  protected onKeyUp(): void;
59
61
  protected applyFromInputs(): void;
62
+ protected commitOperation(): void;
63
+ protected cancelOperation(): void;
60
64
  }
@@ -6,7 +6,7 @@ import { DraggingStateNode, type DragApplyInput } from "./selectStateNode";
6
6
  export declare class TranslatingState extends DraggingStateNode<TranslatingInfo> {
7
7
  protected readonly tickMode: "always_apply";
8
8
  constructor(editor: Editor, parent: StateNode);
9
- protected getHistoryMark(): string;
9
+ protected getOperationKind(): string;
10
10
  protected onDragStart(): void;
11
11
  protected onPointerUp(event: PointerEditorEvent): void;
12
12
  protected onCancel(): void;
@@ -0,0 +1,10 @@
1
+ export type CanvasPluginCapabilityKind = "api" | "service" | "value";
2
+ export interface CanvasPluginCapabilityToken<TValue = unknown, TKind extends CanvasPluginCapabilityKind = CanvasPluginCapabilityKind> {
3
+ readonly id: string;
4
+ readonly kind: TKind;
5
+ readonly __value?: TValue;
6
+ }
7
+ export interface CanvasPluginValueToken<TValue> extends CanvasPluginCapabilityToken<TValue, "value"> {
8
+ }
9
+ export declare function createCanvasPluginValueToken<TValue>(id: string): CanvasPluginValueToken<TValue>;
10
+ export declare function isCanvasPluginCapabilityToken(value: unknown): value is CanvasPluginCapabilityToken;
@@ -1,7 +1,3 @@
1
- export * from "./actions";
2
- export * from "./actionRegistry";
3
- export * from "./contextMenu";
4
- export * from "./contextMenuRegistry";
1
+ export * from "./capability";
5
2
  export * from "./plugin";
6
- export * from "./toolbar";
7
- export * from "./toolbarRegistry";
3
+ export * from "./setupExtension";