@yuzhouu/canvas-kit 0.1.9 → 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 (375) hide show
  1. package/README.md +204 -101
  2. package/_vendor/canvas-core/bindings/bindingUtil.d.ts +23 -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/cameraPanSession.d.ts +9 -0
  6. package/_vendor/canvas-core/editor/canvasPanInteraction.d.ts +2 -0
  7. package/_vendor/canvas-core/editor/commands.d.ts +16 -4
  8. package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +6 -0
  9. package/_vendor/canvas-core/editor/editor.d.ts +44 -31
  10. package/_vendor/canvas-core/editor/editorComputedHelpers.d.ts +5 -2
  11. package/_vendor/canvas-core/editor/historyManager.d.ts +24 -6
  12. package/_vendor/canvas-core/editor/index.d.ts +2 -2
  13. package/_vendor/canvas-core/editor/interactions.d.ts +41 -8
  14. package/_vendor/canvas-core/editor/managers/bindingManager.d.ts +2 -6
  15. package/_vendor/canvas-core/editor/managers/inputsManager.d.ts +3 -0
  16. package/_vendor/canvas-core/editor/managers/interactionTransientManager.d.ts +0 -26
  17. package/_vendor/canvas-core/editor/managers/queryManager.d.ts +26 -1
  18. package/_vendor/canvas-core/editor/managers/selectionLayoutManager.d.ts +5 -0
  19. package/_vendor/canvas-core/editor/managers/selectionOverlayManager.d.ts +1 -0
  20. package/_vendor/canvas-core/editor/managers/shapeEditingManager.d.ts +4 -0
  21. package/_vendor/canvas-core/editor/managers/shapeGeometryManager.d.ts +3 -2
  22. package/_vendor/canvas-core/editor/managers/shapeHierarchyManager.d.ts +7 -2
  23. package/_vendor/canvas-core/editor/managers/shapeReparenting.d.ts +3 -2
  24. package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +4 -1
  25. package/_vendor/canvas-core/editor/managers/snapGeometry.d.ts +2 -1
  26. package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +1 -0
  27. package/_vendor/canvas-core/editor/managers/spatialIndexManager.d.ts +1 -0
  28. package/_vendor/canvas-core/editor/operationManager.d.ts +74 -0
  29. package/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +32 -12
  30. package/_vendor/canvas-core/editor/selection.d.ts +19 -5
  31. package/_vendor/canvas-core/editor/selectionOverlay.d.ts +7 -4
  32. package/_vendor/canvas-core/editor/selectionResizeCapabilities.d.ts +9 -0
  33. package/_vendor/canvas-core/editor/shapeTransformSpace.d.ts +6 -0
  34. package/_vendor/canvas-core/exports/svg.d.ts +3 -3
  35. package/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  36. package/_vendor/canvas-core/geometry/index.d.ts +1 -0
  37. package/_vendor/canvas-core/geometry/mat.d.ts +6 -2
  38. package/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  39. package/_vendor/canvas-core/geometry/vec.d.ts +0 -2
  40. package/_vendor/canvas-core/index.d.ts +21 -23
  41. package/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +4 -10
  42. package/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +19 -0
  43. package/_vendor/canvas-core/plugins/index.d.ts +2 -1
  44. package/_vendor/canvas-core/schema/records.d.ts +2 -7
  45. package/_vendor/canvas-core/schema/snapshots.d.ts +10 -19
  46. package/_vendor/canvas-core/shapes/colors.d.ts +3 -3
  47. package/_vendor/canvas-core/shapes/shapeUtil.d.ts +97 -13
  48. package/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +18 -8
  49. package/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +16 -0
  50. package/_vendor/canvas-core/tools/select/states/index.d.ts +1 -1
  51. package/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +3 -2
  52. package/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +1 -1
  53. package/_vendor/canvas-core/tools/select/states/resizingState.d.ts +1 -1
  54. package/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +1 -1
  55. package/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +6 -2
  56. package/_vendor/canvas-core/tools/select/states/translatingState.d.ts +1 -1
  57. package/_vendor/canvas-plugin-sdk/actionRegistry.d.ts +7 -0
  58. package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/actions.d.ts +21 -6
  59. package/_vendor/canvas-plugin-sdk/capability.d.ts +16 -0
  60. package/_vendor/canvas-plugin-sdk/chrome.d.ts +52 -0
  61. package/_vendor/canvas-plugin-sdk/chromeRegistry.d.ts +15 -0
  62. package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/contextMenu.d.ts +25 -30
  63. package/_vendor/canvas-plugin-sdk/contextMenuRegistry.d.ts +11 -0
  64. package/_vendor/canvas-plugin-sdk/exportRegistry.d.ts +9 -0
  65. package/_vendor/canvas-plugin-sdk/exports.d.ts +26 -0
  66. package/_vendor/canvas-plugin-sdk/importRegistry.d.ts +10 -0
  67. package/_vendor/canvas-plugin-sdk/imports.d.ts +38 -0
  68. package/_vendor/canvas-plugin-sdk/index.d.ts +18 -0
  69. package/_vendor/canvas-plugin-sdk/lifecycle.d.ts +31 -0
  70. package/_vendor/canvas-plugin-sdk/plugin.d.ts +76 -0
  71. package/_vendor/canvas-plugin-sdk/pluginUi.d.ts +37 -0
  72. package/_vendor/canvas-plugin-sdk/productApi.d.ts +28 -0
  73. package/_vendor/canvas-plugin-sdk/services.d.ts +20 -0
  74. package/_vendor/{canvas-core/surfaces → canvas-plugin-sdk}/toolbar.d.ts +48 -5
  75. package/_vendor/canvas-plugin-sdk/toolbarRegistry.d.ts +18 -0
  76. package/_vendor/canvas-react/components/CanvasView.d.ts +2 -2
  77. package/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  78. package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +4 -3
  79. package/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  80. package/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +22 -5
  81. package/_vendor/canvas-react/host/canvasRenderRuntime.d.ts +13 -0
  82. package/_vendor/canvas-react/host/domEventGuards.d.ts +3 -3
  83. package/_vendor/canvas-react/host/index.d.ts +3 -9
  84. package/_vendor/canvas-react/host/overlayRegistry.d.ts +3 -3
  85. package/_vendor/canvas-react/host/rendererRegistry.d.ts +7 -4
  86. package/_vendor/canvas-react/index.d.ts +1 -0
  87. package/_vendor/plugin-arrow/api.d.ts +33 -0
  88. package/_vendor/plugin-arrow/arrowGeometry.d.ts +7 -4
  89. package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
  90. package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +7 -4
  91. package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +2 -2
  92. package/_vendor/plugin-arrow/canvasRender.d.ts +2 -2
  93. package/_vendor/plugin-arrow/editorRuntime.d.ts +2 -2
  94. package/_vendor/plugin-arrow/feature.d.ts +2 -3
  95. package/_vendor/plugin-arrow/index.d.ts +5 -2
  96. package/_vendor/plugin-arrow/productRuntime.d.ts +2 -0
  97. package/_vendor/plugin-builtin-clipboard/clipboardChromeContributions.d.ts +2 -0
  98. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContextMenuContributions.d.ts +1 -1
  99. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardContribution.d.ts +2 -2
  100. package/{features/clipboard → _vendor/plugin-builtin-clipboard}/clipboardService.d.ts +3 -3
  101. package/_vendor/plugin-builtin-clipboard/index.d.ts +3 -0
  102. package/_vendor/plugin-builtin-clipboard/plugin.d.ts +1 -0
  103. package/_vendor/plugin-builtin-export/blobDataUrl.d.ts +1 -0
  104. package/_vendor/plugin-builtin-export/canvasExportApi.d.ts +43 -0
  105. package/_vendor/plugin-builtin-export/index.d.ts +8 -0
  106. package/_vendor/plugin-builtin-export/plugin.d.ts +5 -0
  107. package/_vendor/plugin-builtin-export/pngExport.d.ts +15 -0
  108. package/{features/export → _vendor/plugin-builtin-export}/svgExport.d.ts +9 -2
  109. package/_vendor/plugin-builtin-import-host/CanvasImportHost.d.ts +3 -0
  110. package/_vendor/plugin-builtin-import-host/capability.d.ts +1 -0
  111. package/_vendor/plugin-builtin-import-host/index.d.ts +2 -0
  112. package/_vendor/plugin-builtin-import-host/plugin.d.ts +1 -0
  113. package/_vendor/plugin-builtin-tool-actions/capability.d.ts +1 -0
  114. package/_vendor/plugin-builtin-tool-actions/index.d.ts +2 -0
  115. package/_vendor/plugin-builtin-tool-actions/plugin.d.ts +1 -0
  116. package/_vendor/plugin-builtin-tool-actions/toolActions.d.ts +2 -0
  117. package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
  118. package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
  119. package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
  120. package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
  121. package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
  122. package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
  123. package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
  124. package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
  125. package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
  126. package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
  127. package/_vendor/plugin-connector/connectorRuntime.d.ts +62 -0
  128. package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
  129. package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
  130. package/_vendor/plugin-connector/constants.d.ts +17 -0
  131. package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
  132. package/_vendor/plugin-connector/feature.d.ts +4 -0
  133. package/_vendor/plugin-connector/index.d.ts +18 -0
  134. package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
  135. package/_vendor/plugin-connector/productRuntime.d.ts +2 -0
  136. package/_vendor/plugin-connector/quickConnect.d.ts +28 -0
  137. package/_vendor/plugin-connector/types.d.ts +51 -0
  138. package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +5 -2
  139. package/_vendor/plugin-draw/canvasRender.d.ts +2 -2
  140. package/_vendor/plugin-draw/drawGeometry.d.ts +4 -7
  141. package/_vendor/plugin-draw/drawPath.d.ts +7 -1
  142. package/_vendor/plugin-draw/drawShapeUtil.d.ts +2 -2
  143. package/_vendor/plugin-draw/editorRuntime.d.ts +3 -3
  144. package/_vendor/plugin-draw/feature.d.ts +2 -3
  145. package/_vendor/plugin-draw/index.d.ts +4 -3
  146. package/_vendor/plugin-draw/productRuntime.d.ts +2 -0
  147. package/_vendor/plugin-eraser/canvasRender.d.ts +2 -2
  148. package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -2
  149. package/_vendor/plugin-eraser/eraserRuntime.d.ts +12 -0
  150. package/_vendor/plugin-eraser/feature.d.ts +2 -3
  151. package/_vendor/plugin-eraser/index.d.ts +4 -2
  152. package/_vendor/plugin-eraser/productRuntime.d.ts +2 -0
  153. package/_vendor/plugin-frame/api.d.ts +19 -0
  154. package/_vendor/plugin-frame/canvasRender.d.ts +5 -5
  155. package/_vendor/plugin-frame/editorRuntime.d.ts +2 -2
  156. package/_vendor/plugin-frame/feature.d.ts +2 -3
  157. package/_vendor/plugin-frame/frameShapeUtil.d.ts +12 -2
  158. package/_vendor/plugin-frame/index.d.ts +5 -2
  159. package/_vendor/plugin-frame/productRuntime.d.ts +2 -0
  160. package/_vendor/plugin-geo/api.d.ts +27 -0
  161. package/_vendor/plugin-geo/canvasRender.d.ts +5 -5
  162. package/_vendor/plugin-geo/editorRuntime.d.ts +3 -3
  163. package/_vendor/plugin-geo/feature.d.ts +2 -3
  164. package/_vendor/plugin-geo/geoShapeUtil.d.ts +1 -1
  165. package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  166. package/_vendor/plugin-geo/geoTools.d.ts +1 -1
  167. package/_vendor/plugin-geo/index.d.ts +8 -5
  168. package/_vendor/plugin-geo/productRuntime.d.ts +2 -0
  169. package/_vendor/plugin-geo/types.d.ts +5 -1
  170. package/_vendor/plugin-group/canvasRender.d.ts +3 -4
  171. package/_vendor/plugin-group/editorRuntime.d.ts +2 -2
  172. package/_vendor/plugin-group/feature.d.ts +2 -3
  173. package/_vendor/plugin-group/groupContributions.d.ts +7 -0
  174. package/_vendor/plugin-group/groupShapeUtil.d.ts +24 -5
  175. package/_vendor/plugin-group/index.d.ts +4 -2
  176. package/_vendor/plugin-group/productRuntime.d.ts +2 -0
  177. package/_vendor/plugin-image/canvasRender.d.ts +2 -2
  178. package/_vendor/plugin-image/cropRuntime.d.ts +1 -1
  179. package/_vendor/plugin-image/cropSession.d.ts +5 -3
  180. package/_vendor/plugin-image/editorRuntime.d.ts +2 -4
  181. package/_vendor/plugin-image/feature.d.ts +2 -3
  182. package/_vendor/plugin-image/imageHostActionContract.d.ts +1 -1
  183. package/_vendor/plugin-image/imageShapeUtil.d.ts +3 -3
  184. package/_vendor/plugin-image/index.d.ts +5 -4
  185. package/_vendor/plugin-image/productRuntime.d.ts +4 -0
  186. package/_vendor/plugin-image/runtimeShared.d.ts +1 -1
  187. package/_vendor/plugin-image/smudge.d.ts +6 -2
  188. package/_vendor/plugin-image/smudgeRuntime.d.ts +1 -1
  189. package/_vendor/plugin-image/styleRuntime.d.ts +6 -1
  190. package/_vendor/plugin-image/toolbarRuntime.d.ts +1 -1
  191. package/_vendor/plugin-laser/canvasRender.d.ts +2 -2
  192. package/_vendor/plugin-laser/editorRuntime.d.ts +2 -2
  193. package/_vendor/plugin-laser/feature.d.ts +2 -3
  194. package/_vendor/plugin-laser/index.d.ts +4 -2
  195. package/_vendor/plugin-laser/laserRuntime.d.ts +18 -0
  196. package/_vendor/plugin-laser/productRuntime.d.ts +2 -0
  197. package/_vendor/plugin-packaging/api.d.ts +74 -0
  198. package/_vendor/plugin-packaging/canvasRender.d.ts +2 -0
  199. package/_vendor/plugin-packaging/editorRuntime.d.ts +2 -0
  200. package/_vendor/plugin-packaging/feature.d.ts +2 -0
  201. package/_vendor/plugin-packaging/index.d.ts +19 -0
  202. package/_vendor/plugin-packaging/packagingArtwork.d.ts +5 -0
  203. package/_vendor/plugin-packaging/packagingDxf.d.ts +9 -0
  204. package/_vendor/plugin-packaging/packagingGeometry.d.ts +74 -0
  205. package/_vendor/plugin-packaging/packagingInteractions.d.ts +2 -0
  206. package/_vendor/plugin-packaging/packagingPdfExporter.d.ts +25 -0
  207. package/_vendor/plugin-packaging/packagingRuntime.d.ts +11 -0
  208. package/_vendor/plugin-packaging/packagingShapeUtil.d.ts +34 -0
  209. package/_vendor/plugin-packaging/packagingStyle.d.ts +10 -0
  210. package/_vendor/plugin-packaging/packagingSvgExporter.d.ts +7 -0
  211. package/_vendor/plugin-packaging/productRuntime.d.ts +2 -0
  212. package/_vendor/plugin-packaging/types.d.ts +168 -0
  213. package/_vendor/plugin-packaging/validation.d.ts +3 -0
  214. package/_vendor/plugin-path/PathDraftOverlay.d.ts +1 -0
  215. package/_vendor/plugin-path/PathEditInsertPreviewOverlay.d.ts +1 -0
  216. package/_vendor/plugin-path/PathShapeRenderer.d.ts +15 -0
  217. package/_vendor/plugin-path/canvasRender.d.ts +2 -0
  218. package/_vendor/plugin-path/editorRuntime.d.ts +7 -0
  219. package/_vendor/plugin-path/feature.d.ts +2 -0
  220. package/_vendor/plugin-path/index.d.ts +8 -0
  221. package/_vendor/plugin-path/pathBoolean.d.ts +13 -0
  222. package/_vendor/plugin-path/pathDraft.d.ts +10 -0
  223. package/_vendor/plugin-path/pathEditPreview.d.ts +11 -0
  224. package/_vendor/plugin-path/pathEditSelection.d.ts +24 -0
  225. package/_vendor/plugin-path/pathEditSnap.d.ts +6 -0
  226. package/_vendor/plugin-path/pathGeometry.d.ts +74 -0
  227. package/_vendor/plugin-path/pathHandles.d.ts +18 -0
  228. package/_vendor/plugin-path/pathHistory.d.ts +13 -0
  229. package/_vendor/plugin-path/pathInteractions.d.ts +7 -0
  230. package/_vendor/plugin-path/pathShapeUtil.d.ts +30 -0
  231. package/_vendor/plugin-path/pathSvg.d.ts +3 -0
  232. package/_vendor/plugin-path/pathTool.d.ts +42 -0
  233. package/_vendor/plugin-path/productRuntime.d.ts +15 -0
  234. package/_vendor/plugin-path/types.d.ts +36 -0
  235. package/_vendor/plugin-text/api.d.ts +20 -0
  236. package/_vendor/plugin-text/canvasRender.d.ts +6 -3
  237. package/_vendor/plugin-text/capabilities.d.ts +2 -0
  238. package/_vendor/plugin-text/editorRuntime.d.ts +3 -3
  239. package/_vendor/plugin-text/feature.d.ts +4 -4
  240. package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +6 -3
  241. package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +4 -1
  242. package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +6 -3
  243. package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
  244. package/_vendor/plugin-text/host/richTextRendering.d.ts +1 -2
  245. package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +1 -1
  246. package/_vendor/plugin-text/host/textEntryFocus.d.ts +2 -1
  247. package/_vendor/plugin-text/host/textFormattingApi.d.ts +16 -0
  248. package/_vendor/plugin-text/host/textMeasurement.d.ts +10 -2
  249. package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +3 -1
  250. package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +4 -1
  251. package/_vendor/plugin-text/index.d.ts +11 -4
  252. package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
  253. package/_vendor/plugin-text/productRuntime.d.ts +6 -0
  254. package/_vendor/plugin-text/richTextUtils.d.ts +9 -2
  255. package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +12 -0
  256. package/_vendor/plugin-text/textFonts.d.ts +6 -3
  257. package/_vendor/plugin-text/textFormatting.d.ts +47 -0
  258. package/_vendor/plugin-text/textFormattingSession.d.ts +6 -0
  259. package/_vendor/plugin-text/textLabelHelpers.d.ts +32 -6
  260. package/_vendor/plugin-text/textLinkPopoverPresentation.d.ts +18 -0
  261. package/_vendor/plugin-text/textShapeHelpers.d.ts +1 -0
  262. package/_vendor/plugin-text/textShapeUtil.d.ts +9 -5
  263. package/_vendor/plugin-text/textTypes.d.ts +1 -0
  264. package/_vendor/signals/core.d.ts +1 -0
  265. package/_vendor/signals/effect.d.ts +0 -4
  266. package/_vendor/signals/index.d.ts +2 -2
  267. package/_vendor/store/history.d.ts +1 -1
  268. package/_vendor/store/store.d.ts +6 -0
  269. package/browser/indexedDb.d.ts +10 -10
  270. package/browser/persistence.d.ts +6 -38
  271. package/chrome/floating/CanvasKitFloatingPortal.d.ts +6 -0
  272. package/chrome/floating/useCanvasKitFloatingPosition.d.ts +11 -0
  273. package/chrome/toolbar/CanvasKitFloatingToolbarLayer.d.ts +1 -1
  274. package/chrome/toolbar/FloatingSelectionToolbarPageSpace.d.ts +5 -3
  275. package/chrome/toolbar/toolbarLabels.d.ts +1 -1
  276. package/chrome/toolbar/useToolbarSurfaces.d.ts +11 -16
  277. package/chrome/types.d.ts +15 -17
  278. package/chrome/useCanvasKitChromeContext.d.ts +12 -15
  279. package/chrome/useChromeSurfaces.d.ts +12 -0
  280. package/chrome/useContextMenuSurface.d.ts +4 -4
  281. package/chrome/useHistoryControls.d.ts +3 -3
  282. package/chrome/usePageControls.d.ts +3 -3
  283. package/controller/canvasKitController.d.ts +5 -16
  284. package/core/index.d.ts +4 -6
  285. package/core/product-controller/canvasProductController.d.ts +42 -12
  286. package/core/product-controller/index.d.ts +1 -1
  287. package/core/runtime/productAssets.d.ts +4 -2
  288. package/core/runtime/productEditor.d.ts +1 -1
  289. package/core/runtime/productServices.d.ts +11 -21
  290. package/core/runtime/runtimeContracts.d.ts +17 -0
  291. package/es-DocrZgUh.mjs +2 -0
  292. package/features/context-menu/contextMenuRuntime.d.ts +4 -4
  293. package/features/image/asset/imageAssetService.d.ts +2 -3
  294. package/features/image/asset/imageBlobStore.d.ts +7 -2
  295. package/features/image/asset/imageFileHelpers.d.ts +0 -6
  296. package/features/image/asset/svgImageAssetInliner.d.ts +1 -1
  297. package/features/image/controller/imageProductController.d.ts +2 -2
  298. package/features/image/imageHostPlugin.d.ts +1 -0
  299. package/features/image/import/ImageImportController.d.ts +3 -1
  300. package/features/image/index.d.ts +1 -3
  301. package/features/image/smudge/imageSmudgeHostActions.d.ts +2 -2
  302. package/features/image/toolbar/imageHostActions.d.ts +17 -7
  303. package/features/image/toolbar/imageToolbarHostBridge.d.ts +1 -1
  304. package/features/text/link/TextLinkHoverPopover.d.ts +6 -0
  305. package/features/text/textHostPlugin.d.ts +5 -0
  306. package/features/text/textSvgAssetInliner.d.ts +3 -0
  307. package/features/text/textSvgAssetPlugin.d.ts +2 -0
  308. package/index.css +1 -1
  309. package/index.d.ts +36 -12
  310. package/index.mjs +111 -96
  311. package/package.json +12 -9
  312. package/plugins/standardCanvasKitPlugins.d.ts +16 -0
  313. package/react/CanvasKitRoot.d.ts +10 -5
  314. package/react/useCanvasKitControllerLifecycle.d.ts +8 -0
  315. package/react/useCanvasKitRuntime.d.ts +2 -4
  316. package/runtime/canvasKitCommandExecutor.d.ts +13 -0
  317. package/runtime/canvasKitPluginContracts.d.ts +34 -0
  318. package/runtime/canvasKitPluginSetup.d.ts +32 -0
  319. package/runtime/canvasKitResourceScope.d.ts +5 -0
  320. package/runtime/canvasKitRuntime.d.ts +48 -19
  321. package/runtime/canvasKitRuntimeContracts.d.ts +34 -0
  322. package/runtime/persistenceCoordinator.d.ts +33 -0
  323. package/_vendor/canvas-core/editor/createEditorWithRuntimePlugins.d.ts +0 -6
  324. package/_vendor/canvas-core/editor/middleMousePanInteraction.d.ts +0 -2
  325. package/_vendor/canvas-core/schema/snapshotSupport.d.ts +0 -43
  326. package/_vendor/canvas-core/tools/select/states/draggingSelectionHandleInteractionState.d.ts +0 -15
  327. package/_vendor/canvas-react/host/actionRegistry.d.ts +0 -15
  328. package/_vendor/canvas-react/host/canvasRenderPluginHost.d.ts +0 -2
  329. package/_vendor/canvas-react/host/canvasRenderPluginHostManifest.d.ts +0 -2
  330. package/_vendor/canvas-react/host/canvasRenderPluginHostRuntime.d.ts +0 -3
  331. package/_vendor/canvas-react/host/canvasRenderPluginHostTypes.d.ts +0 -104
  332. package/_vendor/canvas-react/host/canvasRenderPluginHostValidation.d.ts +0 -11
  333. package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +0 -17
  334. package/_vendor/canvas-react/host/extension.d.ts +0 -37
  335. package/_vendor/canvas-react/host/toolbarRegistry.d.ts +0 -20
  336. package/_vendor/plugin-text/arrowLabelBindingUtil.d.ts +0 -42
  337. package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +0 -14
  338. package/_vendor/plugin-text/host/RichTextToolbar.d.ts +0 -8
  339. package/_vendor/plugin-text/host/richTextBubbleMenuPositionSync.d.ts +0 -7
  340. package/browser/localSnapshotRestore.d.ts +0 -13
  341. package/builtins/controller/createBuiltInCanvasController.d.ts +0 -16
  342. package/builtins/controller/layerController.d.ts +0 -9
  343. package/builtins/controller/shapeCreationController.d.ts +0 -83
  344. package/builtins/extensions.d.ts +0 -18
  345. package/builtins/index.d.ts +0 -5
  346. package/chrome/useSvgExport.d.ts +0 -15
  347. package/core/api/apiRegistry.d.ts +0 -12
  348. package/core/runtime/productDefinition.d.ts +0 -33
  349. package/core/runtime/productHost.d.ts +0 -20
  350. package/features/actions/actionRuntime.d.ts +0 -21
  351. package/features/clipboard/clipboardHostExtension.d.ts +0 -2
  352. package/features/image/imageHostExtension.d.ts +0 -10
  353. package/features/image/import/useImageImport.d.ts +0 -16
  354. package/features/keyboard/keyboardShortcutHostExtension.d.ts +0 -2
  355. package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +0 -6
  356. package/features/persistence/CanvasKitPersistenceNotice.d.ts +0 -4
  357. package/features/persistence/persistenceHostExtension.d.ts +0 -2
  358. package/features/selection/selectionActions.d.ts +0 -20
  359. package/features/selection/selectionContextMenuContributions.d.ts +0 -2
  360. package/features/selection/selectionHostExtension.d.ts +0 -2
  361. package/features/selection/selectionToolbarContributions.d.ts +0 -2
  362. package/features/tool/toolActions.d.ts +0 -2
  363. package/features/tool/toolContextMenuContributions.d.ts +0 -2
  364. package/features/tool/toolHostExtension.d.ts +0 -2
  365. package/features/tool/toolToolbarContributions.d.ts +0 -2
  366. package/features/view/viewActions.d.ts +0 -5
  367. package/features/view/viewContextMenuContributions.d.ts +0 -2
  368. package/features/view/viewHostExtension.d.ts +0 -2
  369. package/host/defaultHostExtensions.d.ts +0 -2
  370. package/product/canvasKitProduct.d.ts +0 -51
  371. package/react/useCanvasKitController.d.ts +0 -5
  372. package/react/useCanvasKitStartup.d.ts +0 -9
  373. package/runtime/canvasKitHostContracts.d.ts +0 -135
  374. package/runtime/canvasKitHostFeatureHooks.d.ts +0 -12
  375. package/runtime/canvasKitRuntimePlan.d.ts +0 -50
@@ -17,6 +17,7 @@ export declare class ShapeHierarchyManager {
17
17
  getSelectionGroupState(): ShapeGroupState | null;
18
18
  canGroupSelection(): boolean;
19
19
  private getGroupStateForShapeIds;
20
+ private getGroupingShapeCreateInput;
20
21
  private groupShapesFromState;
21
22
  canGroupShapes(ids: readonly ShapeId[]): boolean;
22
23
  groupShapes(ids: readonly ShapeId[], source?: ChangeSource): ShapeRecord | null;
@@ -37,7 +38,6 @@ export declare class ShapeHierarchyManager {
37
38
  moveShapesInParentOrder(ids: readonly ShapeId[], direction: LayerOrderDirection, source?: ChangeSource): boolean;
38
39
  moveShapesToParentOrderEdge(ids: readonly ShapeId[], edge: LayerOrderEdge, source?: ChangeSource): boolean;
39
40
  moveSelectionWithinParent(direction: ShapeSiblingOrderDirection, source?: ChangeSource): boolean;
40
- moveShapesToParentPlacement(input: ReparentShapePlacementInput, source?: ChangeSource): boolean;
41
41
  moveShapesToParentPlacementResult(input: ReparentShapePlacementInput, source?: ChangeSource): ReparentShapePlacementResult;
42
42
  moveSelectionInParentOrder(direction: ShapeSiblingOrderDirection, source?: ChangeSource): boolean;
43
43
  moveSelectionToParentOrderEdge(edge: ShapeSiblingOrderEdge, source?: ChangeSource): boolean;
@@ -48,11 +48,16 @@ export declare class ShapeHierarchyManager {
48
48
  getShapeIdsForSelectionTransform(shapeIds: Iterable<ShapeId>): ShapeId[];
49
49
  getShapeIdsForSelectionRotation(shapeIds: Iterable<ShapeId>): ShapeId[];
50
50
  getSelectionTransformTargetShapes(): ShapeRecord[];
51
+ canResizeSelection(): boolean;
52
+ canFlipSelection(): boolean;
53
+ canRotateSelection(): boolean;
54
+ getSelectionResizeTargetShapes(): ShapeRecord[];
51
55
  getSelectionRotationTargetShapes(): ShapeRecord[];
56
+ private getSelectionTransformAffectedShapes;
52
57
  getShapeExportTraversalIds(shapeIds: Iterable<ShapeId>): ShapeId[];
53
58
  getShapeIdsInContainerBounds(containerId: ShapeId, options?: ContainerBoundsQueryOptions): ShapeId[];
54
59
  canUseShapeParent(parentId: ShapeParentId, childId?: ShapeId): boolean;
55
60
  isShapeOrAncestorInSet(shapeId: ShapeId, ids: ReadonlySet<ShapeId>): boolean;
56
61
  isShapeDescendantOf(shapeId: ShapeId, ancestorId: ShapeId): boolean;
57
- private getShapeIdsForSelectionDescendantTransform;
62
+ private getOutermostUnlockedShapeIds;
58
63
  }
@@ -1,6 +1,7 @@
1
1
  import type { ChangeSource } from "../../../store/index";
2
- import type { ShapeId, ShapeParentId } from "../../schema/records";
2
+ import type { ShapeId, ShapeParentId, ShapeRecord } from "../../schema/records";
3
3
  import type { Editor, ReparentShapePlacementInput, ReparentShapePlacementResult } from "../editor";
4
+ import { type ShapeTransformFields } from "../queries/shapeTransforms";
4
5
  export declare function canUseShapeParent(editor: Editor, parentId: ShapeParentId, childId?: ShapeId): boolean;
5
- export declare function moveShapesToParentPlacement(editor: Editor, input: ReparentShapePlacementInput, source?: ChangeSource): boolean;
6
6
  export declare function moveShapesToParentPlacementResult(editor: Editor, input: ReparentShapePlacementInput, source?: ChangeSource): ReparentShapePlacementResult;
7
+ export declare function getReparentedShapeTransformUpdate(editor: Editor, shape: ShapeRecord, parentId: ShapeParentId): ShapeTransformFields | null;
@@ -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;
@@ -103,6 +103,7 @@ export interface HandleSnapSnapshotInput {
103
103
  export interface HandleSnapInput {
104
104
  mode: HandleSnapMode;
105
105
  pagePoint: Vec;
106
+ sourcePointOffsets?: readonly Vec[];
106
107
  snapshot: HandleSnapSnapshot;
107
108
  threshold: number;
108
109
  }
@@ -26,6 +26,7 @@ export declare class SpatialIndexManager {
26
26
  getShapeAtPoint(point: Vec, options?: ShapeAtPointOptions): ShapeRecord | null;
27
27
  getShapesAtPoint(point: Vec, options?: ShapeAtPointOptions): ShapeRecord[];
28
28
  getShapesHitByLineSegment(start: Vec, end: Vec, options?: ShapeLineSegmentHitTestOptions): ShapeRecord[];
29
+ private doesLineSegmentIntersectShapeClip;
29
30
  private getPageIndexSignal;
30
31
  private getPageIndex;
31
32
  }
@@ -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 {};
@@ -9,19 +9,39 @@ export interface ShapeGeometry {
9
9
  corners: Vec[];
10
10
  outlineVertices: Vec[];
11
11
  }
12
+ export interface ShapeTransformFields {
13
+ x: number;
14
+ y: number;
15
+ rotation: number;
16
+ skewX: number;
17
+ scaleX: number;
18
+ scaleY: number;
19
+ }
20
+ export interface ShapeTransformDecompositionOptions {
21
+ epsilon?: number;
22
+ preferredRotation?: number;
23
+ preferredScaleXSign?: number;
24
+ preferredScaleYSign?: number;
25
+ }
26
+ /**
27
+ * Decompose a shape's local-to-parent affine transform into its canonical
28
+ * translate/rotate/skewX/scale record fields. Axis-collapsed transforms remain
29
+ * representable; unsupported rank-one shears return null.
30
+ */
31
+ export declare function getShapeTransformFieldsFromMatrix(matrix: Mat, localBounds: Box, options?: ShapeTransformDecompositionOptions): ShapeTransformFields | null;
12
32
  export declare function getShapeLocalBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
13
33
  export declare function getShapeRenderBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
14
34
  export declare function getShapeExportBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
15
- export declare function getShapeLocalToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Mat;
16
- export declare function getShapePositionedToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Mat;
17
- export declare function getShapeRenderToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Mat;
18
- export declare function getShapeExportToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Mat;
19
- export declare function getShapePageCenter<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Vec;
20
- export declare function positionedShapePointToPagePoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>): Vec;
21
- export declare function pagePointToShapePositionedPoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>): Vec;
35
+ export declare function getShapeLocalToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
36
+ export declare function getShapePositionedToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
37
+ export declare function getShapeRenderToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
38
+ export declare function getShapeExportToPageTransform<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Mat;
39
+ export declare function getShapePageCenter<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
40
+ export declare function positionedShapePointToPagePoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
41
+ export declare function pagePointToShapePositionedPoint<S extends ShapeRecord>(shape: S, point: Vec, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec;
22
42
  export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Vec[];
23
- export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Vec[];
24
- export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Vec[];
25
- export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
26
- export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): Box;
27
- export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>): ShapeGeometry;
43
+ export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec[];
44
+ export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Vec[];
45
+ export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Box;
46
+ export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): Box;
47
+ export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentLocalToPage?: Mat): ShapeGeometry;
@@ -3,6 +3,12 @@ import { Vec } from "../geometry/vec";
3
3
  import type { ConnectionTerminal } from "../bindings/terminalBinding";
4
4
  import type { ShapeId, ShapeRecord } from "../schema/records";
5
5
  export type SelectionResizeHandleId = "top_left" | "top" | "top_right" | "right" | "bottom_right" | "bottom" | "bottom_left" | "left";
6
+ export declare const SELECTION_RESIZE_HANDLE_IDS: readonly ["top_left", "top", "top_right", "right", "bottom_right", "bottom", "bottom_left", "left"];
7
+ export declare const SELECTION_RESIZE_CORNER_HANDLE_IDS: readonly ["top_left", "top_right", "bottom_right", "bottom_left"];
8
+ export type SelectionResizeMode = "free" | "aspect_ratio_locked";
9
+ export declare const SELECTION_RESIZE_ALL_MODES: readonly ["free", "aspect_ratio_locked"];
10
+ export declare const SELECTION_RESIZE_FREE_ONLY_MODES: readonly ["free"];
11
+ export declare const SELECTION_RESIZE_ASPECT_RATIO_LOCKED_ONLY_MODES: readonly ["aspect_ratio_locked"];
6
12
  export type SelectionRotateHandleId = "top_left_rotate" | "top_right_rotate" | "bottom_right_rotate" | "bottom_left_rotate";
7
13
  export interface SelectionResizeHandle {
8
14
  kind: "resize";
@@ -71,25 +77,29 @@ export interface SelectionFrame extends SelectionRotationTransform {
71
77
  }
72
78
  export interface SelectionResizeShapeSnapshot {
73
79
  shape: ShapeRecord;
80
+ pageShape: ShapeRecord;
74
81
  localBounds: Box;
75
82
  rotation: number;
76
83
  }
77
84
  export interface SelectionResizePointShapeSnapshot {
78
85
  shape: ShapeRecord;
86
+ pageShape: ShapeRecord;
79
87
  startLocalPagePoint: Vec;
80
88
  endLocalPagePoint: Vec;
89
+ middleLocalPagePoint: Vec | null;
81
90
  }
82
91
  export interface SelectionRotateShapeSnapshot {
83
- id: ShapeId;
84
- x: number;
85
- y: number;
92
+ shape: ShapeRecord;
93
+ pageShape: ShapeRecord;
86
94
  localBounds: Box;
87
95
  rotation: number;
88
96
  }
89
97
  export interface SelectionRotatePointShapeSnapshot {
90
98
  shape: ShapeRecord;
99
+ pageShape: ShapeRecord;
91
100
  startPagePoint: Vec;
92
101
  endPagePoint: Vec;
102
+ middlePagePoint: Vec | null;
93
103
  }
94
104
  export interface SelectionResizeSnapshot extends SelectionRotationTransform {
95
105
  startBounds: Box;
@@ -221,15 +231,19 @@ export declare function getSelectionLocalBoundsFromPagePoints({ points, transfor
221
231
  points: readonly Vec[];
222
232
  transform: SelectionRotationTransform;
223
233
  }): Box | null;
224
- export declare function getSelectionResizeSnapshot({ shapes, selectionFrame, getShapeSelectionResizePageOutlineVertices, getShapeSelectionPagePoints, }: {
234
+ export declare function getSelectionResizeSnapshot({ shapes, selectionFrame, getShapeSelectionResizePageOutlineVertices, getShapeSelectionPagePoints, getShapeSelectionPageMiddlePoint, getShapePageRecord, }: {
225
235
  shapes: ShapeRecord[];
226
236
  selectionFrame: SelectionFrame;
227
237
  getShapeSelectionResizePageOutlineVertices: (shape: ShapeRecord) => Vec[];
228
238
  getShapeSelectionPagePoints: (shape: ShapeRecord) => readonly [Vec, Vec] | null;
239
+ getShapeSelectionPageMiddlePoint: (shape: ShapeRecord) => Vec | null;
240
+ getShapePageRecord: (shape: ShapeRecord) => ShapeRecord;
229
241
  }): SelectionResizeSnapshot;
230
- export declare function getSelectionRotateSnapshot({ shapes, selectionFrame, getShapeLocalBounds, getShapeSelectionPagePoints, }: {
242
+ export declare function getSelectionRotateSnapshot({ shapes, selectionFrame, getShapeLocalBounds, getShapeSelectionPagePoints, getShapeSelectionPageMiddlePoint, getShapePageRecord, }: {
231
243
  shapes: ShapeRecord[];
232
244
  selectionFrame: SelectionFrame;
233
245
  getShapeLocalBounds: (shape: ShapeRecord) => Box;
234
246
  getShapeSelectionPagePoints: (shape: ShapeRecord) => readonly [Vec, Vec] | null;
247
+ getShapeSelectionPageMiddlePoint: (shape: ShapeRecord) => Vec | null;
248
+ getShapePageRecord: (shape: ShapeRecord) => ShapeRecord;
235
249
  }): SelectionRotateSnapshot;
@@ -1,7 +1,7 @@
1
1
  import { Vec } from "../geometry/vec";
2
2
  import type { ShapeId, ShapeRecord } from "../schema/records";
3
- import type { ShapeSelectionHandleAnchors } from "../shapes/shapeUtil";
4
- import type { SelectionBindingMiddleHandle, SelectionBindingSegment, SelectionBindingTerminalHandle, SelectionCustomHandle, SelectionFrame, SelectionOverlayFrameGeometryState, SelectionOverlayFrameState, SelectionOverlayFrameStyleState, SelectionOverlayHandleAnchorsState, SelectionOverlayHandleCountsState, SelectionOverlayHandlesState, SelectionResizeHandle, SelectionRotateHandle } from "./selection";
3
+ import type { ShapeSelectionHandleAnchors, ShapeSelectionPathStyle } from "../shapes/shapeUtil";
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;
7
7
  usesSelectionPathOverlay: boolean;
@@ -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 {
@@ -18,6 +20,7 @@ export interface SelectionHandleState {
18
20
  middleHandles: SelectionBindingMiddleHandle[];
19
21
  customHandles: SelectionCustomHandle[];
20
22
  }
23
+ export declare function hitTestSelectionResizeBorder(point: Vec, selectionFrame: SelectionFrame, resizeHandles: readonly SelectionResizeHandle[], hitDistance: number): SelectionResizeHandle | null;
21
24
  export declare function areSelectedShapeOverlayItemsEqual(a: SelectedShapeOverlayItem[], b: SelectedShapeOverlayItem[]): boolean;
22
25
  export declare function areSelectionOverlayFrameStatesEqual(a: SelectionOverlayFrameState | null, b: SelectionOverlayFrameState | null): boolean;
23
26
  export declare function areSelectionOverlayFrameGeometryStatesEqual(a: SelectionOverlayFrameGeometryState | null, b: SelectionOverlayFrameGeometryState | null): boolean;
@@ -27,6 +30,6 @@ export declare function areSelectionOverlayHandlesStatesEqual(a: SelectionOverla
27
30
  export declare function areSelectionOverlayHandleAnchorsStatesEqual(a: SelectionOverlayHandleAnchorsState | null, b: SelectionOverlayHandleAnchorsState | null): boolean;
28
31
  export declare function areSelectionOverlayHandleCountsStatesEqual(a: SelectionOverlayHandleCountsState | null, b: SelectionOverlayHandleCountsState | null): boolean;
29
32
  export declare function isSingleSelectionPathOverlay(selectedShapeItems: SelectedShapeOverlayItem[]): boolean;
30
- export declare function getSelectionHandleAnchorsState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionFrameHandles: (shape: ShapeRecord) => boolean): SelectionOverlayHandleAnchorsState;
33
+ export declare function getSelectionHandleAnchorsState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionResizeHandles: (shape: ShapeRecord) => boolean, canUseSelectionRotateHandle: (shape: ShapeRecord) => boolean, resizeHandleIds: readonly SelectionResizeHandleId[]): SelectionOverlayHandleAnchorsState;
31
34
  export declare function materializeSelectionHandleState(anchors: SelectionOverlayHandleAnchorsState, zoom: number): SelectionHandleState;
32
- export declare function getSelectionHandleState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionFrameHandles: (shape: ShapeRecord) => boolean): SelectionHandleState;
35
+ export declare function getSelectionHandleState(selectedShapes: ShapeRecord[], selectionFrame: SelectionFrame | null, zoom: number, getShapeSelectionHandleAnchors: (shape: ShapeRecord) => ShapeSelectionHandleAnchors, canUseSelectionResizeHandles: (shape: ShapeRecord) => boolean, canUseSelectionRotateHandle: (shape: ShapeRecord) => boolean, resizeHandleIds: readonly SelectionResizeHandleId[]): SelectionHandleState;
@@ -0,0 +1,9 @@
1
+ import type { ShapeRecord } from "../schema/records";
2
+ import type { Editor } from "./editor";
3
+ import { type SelectionResizeHandleId, type SelectionResizeMode } from "./selection";
4
+ export declare function areSelectionResizeRotationsCompatible(left: number, right: number): boolean;
5
+ export declare function areSelectionResizeTargetRotationsCompatible(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], selectionRotation: number): boolean;
6
+ export declare function intersectSelectionResizeModes(modeSets: readonly (readonly SelectionResizeMode[])[]): SelectionResizeMode[];
7
+ export declare function getCommonSelectionResizeModesForHandle(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], handleId: SelectionResizeHandleId, selectionRotation: number): SelectionResizeMode[];
8
+ export declare function getCommonSelectionResizeHandleIds(editor: Editor, resizeTargetShapes: readonly ShapeRecord[], selectionRotation: number): SelectionResizeHandleId[];
9
+ export declare function resolveSelectionResizeMode(allowedModes: readonly SelectionResizeMode[], shiftKey: boolean): SelectionResizeMode | null;
@@ -0,0 +1,6 @@
1
+ import type { ShapeRecord } from "../schema/records";
2
+ import type { ShapeUpdate } from "./commands";
3
+ import type { Editor } from "./editor";
4
+ export declare function getShapePageSpaceRecord(editor: Editor, shape: ShapeRecord): ShapeRecord;
5
+ export declare function tryGetShapePageSpaceRecord(editor: Editor, shape: ShapeRecord): ShapeRecord | null;
6
+ export declare function getShapeParentLocalUpdateFromPageSpace(editor: Editor, shape: ShapeRecord, pageShape: ShapeRecord, pageUpdate: ShapeUpdate): ShapeUpdate | null;
@@ -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,15 +16,15 @@ 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;
22
+ toSvgForeground?(shape: S, context: SvgExportContext): SvgNode | null;
23
23
  }
24
24
  export interface SvgExportOptions {
25
25
  padding?: number;
26
26
  background?: string;
27
- resolveThemeColor?: SvgThemeColorResolver;
27
+ resolveThemeColor?: ThemeColorResolver;
28
28
  }
29
29
  export interface SvgExportResult {
30
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;
@@ -5,4 +5,5 @@ export { Geometry2d } from "./geometry2d";
5
5
  export { Rectangle2d } from "./rectangle2d";
6
6
  export { Ellipse2d } from "./ellipse2d";
7
7
  export { Polyline2d } from "./polyline2d";
8
+ export { doesLineSegmentIntersectPolygon, getPolygonsBounds, isPointInPolygon, isPointInPolygons, isValidPolygon, } from "./polygon";
8
9
  export { distanceBetweenSegments, distanceToSegment, nearestPointOnSegment, segmentsIntersect, } from "./segments";
@@ -16,13 +16,17 @@ export declare class Mat {
16
16
  static Identity(): Mat;
17
17
  static Translate(x: number, y: number): Mat;
18
18
  static Rotate(angle: number): Mat;
19
+ static SkewX(angle: number): Mat;
19
20
  static Scale(sx: number, sy: number): Mat;
20
21
  /** Compose: this × other */
21
22
  compose(other: Mat): Mat;
22
23
  applyToPoint(p: Vec): Vec;
24
+ determinant(): number;
25
+ getMaximumLinearScale(): number;
26
+ tryInvert(epsilon?: number): Mat | null;
23
27
  invert(): Mat;
24
28
  toCssString(): string;
25
29
  toSvgString(): string;
26
- /** Create a transform for a shape: translate(x,y) * rotate(rotation) * scale(scaleX, scaleY) */
27
- static ForShape(x: number, y: number, rotation: number, scaleX?: number, scaleY?: number): Mat;
30
+ /** Create a transform for a shape: translate * rotate * skewX * scale. */
31
+ static ForShape(x: number, y: number, rotation: number, scaleX?: number, scaleY?: number, skewX?: number): Mat;
28
32
  }
@@ -0,0 +1,7 @@
1
+ import { Box } from "./box";
2
+ import { Vec } from "./vec";
3
+ export declare function isValidPolygon(polygon: readonly Vec[]): boolean;
4
+ export declare function getPolygonsBounds(polygons: readonly (readonly Vec[])[]): Box | null;
5
+ export declare function isPointInPolygon(point: Vec, polygon: readonly Vec[]): boolean;
6
+ export declare function isPointInPolygons(point: Vec, polygons: readonly (readonly Vec[])[]): boolean;
7
+ export declare function doesLineSegmentIntersectPolygon(start: Vec, end: Vec, polygon: readonly Vec[], margin?: number): boolean;
@@ -13,8 +13,6 @@ export declare class Vec {
13
13
  rot(angle: number): Vec;
14
14
  /** Perpendicular vector (rotated 90° counter-clockwise). */
15
15
  per(): Vec;
16
- /** Unit vector (alias for normalize). */
17
- uni(): Vec;
18
16
  normalize(): Vec;
19
17
  equals(v: Vec): boolean;
20
18
  clone(): Vec;
@@ -1,57 +1,55 @@
1
1
  export { Editor } from "./editor/editor";
2
- export { createEditorWithRuntimePlugins, type CreateEditorWithRuntimePluginsOptions, } from "./editor/createEditorWithRuntimePlugins";
3
- export { distanceBetweenSegments, distanceToSegment, nearestPointOnSegment, segmentsIntersect, } from "./geometry";
4
- export { getShapeGeometry, getShapeExportBounds, getShapeExportPageBounds, getShapeExportToPageTransform, getShapeLocalBounds, getShapeLocalToPageTransform, getShapePositionedOutlineVertices, getShapePositionedToPageTransform, getShapePageBounds, getShapePageCenter, getShapePageCorners, getShapePageOutlineVertices, pagePointToShapePositionedPoint, positionedShapePointToPagePoint, getShapeRenderBounds, getShapeRenderToPageTransform, } from "./editor/queries/shapeTransforms";
5
- export type { ShapeGeometry } from "./editor/queries/shapeTransforms";
6
- 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, SelectionRotateHandle, SelectionRotateHandleAnchor, SelectionRotateHandleId, SelectionMirrorAxis, } from "./editor/selection";
7
- export { flipSelectionLocalBounds, getSelectionLocalBoundsFromPagePoints, mapSelectionLocalBoundsBetweenBounds, mapSelectionLocalPointBetweenBounds, mirrorSelectionLocalPoint, rotateSelectionPagePoint, selectionLocalPointToPagePoint, selectionPagePointToLocalPoint, } from "./editor/selection";
2
+ export { createEditorWithPlugins, type CreateEditorWithPluginsOptions, } from "./editor/createEditorWithPlugins";
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";
5
+ export { doesLineSegmentIntersectPolygon, distanceBetweenSegments, distanceToSegment, getPolygonsBounds, isPointInPolygon, isPointInPolygons, isValidPolygon, nearestPointOnSegment, segmentsIntersect, } from "./geometry";
6
+ export { getShapeContentClipPath } from "./geometry/contentCutout";
7
+ export { getShapeGeometry, getShapeExportBounds, getShapeExportPageBounds, getShapeExportToPageTransform, getShapeLocalBounds, getShapeLocalToPageTransform, getShapeTransformFieldsFromMatrix, getShapePositionedOutlineVertices, getShapePositionedToPageTransform, getShapePageBounds, getShapePageCenter, getShapePageCorners, getShapePageOutlineVertices, pagePointToShapePositionedPoint, positionedShapePointToPagePoint, getShapeRenderBounds, getShapeRenderToPageTransform, } from "./editor/queries/shapeTransforms";
8
+ export type { ShapeGeometry, ShapeTransformDecompositionOptions, ShapeTransformFields, } from "./editor/queries/shapeTransforms";
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
+ export { SELECTION_RESIZE_ALL_MODES, SELECTION_RESIZE_ASPECT_RATIO_LOCKED_ONLY_MODES, SELECTION_RESIZE_CORNER_HANDLE_IDS, SELECTION_RESIZE_FREE_ONLY_MODES, SELECTION_RESIZE_HANDLE_IDS, flipSelectionLocalBounds, getSelectionLocalBoundsFromPagePoints, mapSelectionLocalBoundsBetweenBounds, mapSelectionLocalPointBetweenBounds, mirrorSelectionLocalPoint, rotateSelectionPagePoint, selectionLocalPointToPagePoint, selectionPagePointToLocalPoint, } from "./editor/selection";
8
11
  export { getAnchoredSelectionResizeLocalBounds, getAspectRatioLockedSelectionResizeBounds, getCenteredSelectionResizeBounds, getConstrainedSelectionResizeBounds, getSelectionResizeBounds, getSelectionResizeScalesFromBounds, isSelectionResizeCorner, normalizeSelectionResizeBoundsFromEdges, selectionResizeHandleMovesBottomEdge, selectionResizeHandleMovesLeftEdge, selectionResizeHandleMovesRightEdge, selectionResizeHandleMovesTopEdge, } from "./editor/resizeGeometry";
9
12
  export { InteractionHandlerRegistry } from "./editor/interactions";
10
13
  export { SelectionHandleInteractionRegistry } from "./editor/selectionHandleInteractions";
11
14
  export { ShortcutManager, formatKeyboardShortcut, normalizeKeyboardShortcut, } from "./editor/managers/shortcutManager";
12
- 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";
13
16
  export type { EditorKeyboardShortcutCommand, KeyboardShortcutBinding, KeyboardShortcutChord, KeyboardShortcutEventLike, KeyboardShortcutInput, KeyboardShortcutTarget, } from "./editor/managers/shortcutManager";
14
- export type { ContainerBoundsQueryOptions, EditorPageState, EditorOverlayDebugState, EditorRenderHostDebugState, EditorSelectionState, LayerOrderDirection, LayerOrderEdge, ReparentShapePlacementInput, ReparentShapePlacementFailureReason, ReparentShapePlacementResult, ShapeSiblingOrderDirection, ShapeSiblingOrderEdge, ShapeSiblingOrderState, ShapeGroupState, ShapeSelectionSiblingOrderState, ShapePropsPatch, EditorToolState, EditorShapeEditingState, } from "./editor/editor";
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";
15
18
  export type { ShapeContainment } from "./editor/managers/queryManager";
16
19
  export type { ShapeAtPointOptions, ShapeLineSegmentHitTestOptions, SpatialQueryOptions, } from "./editor/managers/spatialIndexManager";
17
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";
18
23
  export type { EditorCommandOptions, EditorCommands, CreateAssetInput, CreateBindingInput, CreatePageInput, MovePageInput, RenamePageInput, ReparentShapesInput, CreateShapeInput, SetCameraInput, ShapeUpdate, StartEditingShapeInput, UpdateAssetInput, UpdateBindingInput, UpdateDocumentMetaInput, UpdatePageMetaInput, } from "./editor/commands";
19
24
  export { reparentShapeToContainingParent } from "./editor/commands";
20
25
  export { isEditorClipboardPayload, } from "./editor/clipboard";
21
26
  export type { ClipboardAssetSidecar, DuplicateSelectionInput, EditorClipboardPayload, PasteClipboardPayloadInput, } from "./editor/clipboard";
22
27
  export type { EditorEvent, ClickEditorEvent, PointerEditorEvent, KeyboardEditorEvent, WheelEditorEvent, TickEditorEvent, CancelEditorEvent, EditorPointerType, } from "./editor/events";
23
28
  export type { ChangeSource, RecordUpdate, RecordsDiff, ScopedStoreRecord, StoreRecord, StoreChange, StoreScopeOf, StoreSnapshot, } from "../store/index";
24
- export { SnapshotParseError, parseDocumentSnapshot, parseSessionSnapshot, migrateSnapshotRecords, } from "./schema/snapshots";
25
- export type { DocumentSnapshot, SessionSnapshot, SnapshotMigration, } from "./schema/snapshots";
26
- export { createDocumentSnapshotSupport, filterDocumentSnapshotBySupport, getDocumentSnapshotRequirements, getUnsupportedDocumentSnapshotRequirements, } from "./schema/snapshotSupport";
27
- export type { DocumentSnapshotRequirements, DocumentSnapshotSupport, FilterDocumentSnapshotBySupportResult, UnsupportedDocumentSnapshotRequirements, } from "./schema/snapshotSupport";
29
+ export { SnapshotParseError, parseDocumentSnapshot, parseSessionSnapshot, } from "./schema/snapshots";
30
+ export type { DocumentSnapshot, SessionSnapshot } from "./schema/snapshots";
28
31
  export { ShapeUtil } from "./shapes/shapeUtil";
29
- export type { ShapeBoundsSnapGeometry, ShapeBrushSelectInput, ShapeBrushWrapInput, ShapeBindingPointInput, ShapeBindingTargetHitTestInput, ShapeEditEndInput, ShapeEditEndResult, ShapeGeometryInput, ShapeHandleSnapContext, ShapeHandleSnapGeometry, ShapeLineSegmentHitTestInput, ShapePointHitTestInput, ShapeSnapPoint, ShapeSnapPointKind, ShapeSelectionHandleAnchorInput, ShapeSelectionHandleAnchors, ShapeSelectionFrameInput, ShapeSelectionFlipAxis, ShapeSelectionFlipInput, ShapeSelectionOverlayInfo, ShapeSelectionOverlayInfoInput, ShapeSelectionPagePoints, ShapeSelectionPagePointsInput, ShapeSelectionResizeAspectRatioLockInput, ShapeSelectionResizeInput, ShapeSelectionTranslateInput, } from "./shapes/shapeUtil";
30
- export type { LaserTrailState } from "./editor/managers/interactionTransientManager";
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";
31
33
  export type { HandleSnapContext, HandleSnapInput, HandleSnapMode, HandleSnapResult, HandleSnapSnapshot, HandleSnapSnapshotInput, ResizeSnapInput, ResizeSnapResult, ResizeSnapSnapshot, SnapAxis, SnapCoordinateSpace, SnapPointIndex, SnapPointIndexEntry, SnapPointKind, TranslateSnapInput, TranslateSnapResult, TranslateSnapSnapshot, } from "./editor/managers/snapTypes";
32
34
  export { ShapeUtilRegistry } from "./shapes/shapeUtilRegistry";
33
35
  export { resolveTerminalBindingAtPoint, } from "./bindings/terminalBinding";
34
36
  export { ShapeSvgExporterRegistry, exportShapesToSvgString, renderSvgNode, } from "./exports/svg";
35
- 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";
36
38
  export { getExportIntegrityReport, repairExportIntegrity, } from "./exports/integrity";
37
39
  export type { ExportIntegrityIssue, ExportIntegrityIssueKind, ExportIntegrityRepairResult, ExportIntegrityReport, } from "./exports/integrity";
38
40
  export { getShapeCapabilityManifest } from "./shapes/capabilities";
39
41
  export type { ShapeCapabilityDefinition, ShapeCapabilityManifest, ShapeCapabilityManifestEntry, ShapeCapabilitySupport, } from "./shapes/capabilities";
40
42
  export { BindingUtil } from "./bindings/bindingUtil";
41
- export type { BindingSelectionCompanionFrameContext, BindingUtilEffect, } from "./bindings/bindingUtil";
43
+ export type { BindingSelectionCompanionFrameContext, BindingTargetShapeContentCutoutContext, BindingUtilEffect, } from "./bindings/bindingUtil";
42
44
  export { BindingUtilRegistry } from "./bindings/bindingUtilRegistry";
43
45
  export { StateNode } from "./editor/stateNode";
44
46
  export { getEdgeScrollDelta } from "./editor/edgeScroll";
45
47
  export { HandTool } from "./tools/hand/handTool";
46
48
  export { SelectTool } from "./tools/select/selectTool";
47
- export { SET_ACTIVE_TOOL_TOOLBAR_ACTION_ID, TOGGLE_TOOL_LOCKED_TOOLBAR_ACTION_ID, } from "./surfaces/toolbar";
48
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";
49
- export type { CustomShapeColorRef, ShapeColor, ShapeColorRef, ThemeColorSlot, ThemeColorTokenName, ThemeShapeColorRef, } from "./shapes/colors";
50
- export type { ContextMenuBadgeItem, ContextMenuCanvasTarget, ContextMenuCommandItem, ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuItem, ActiveContextMenu, ContextMenuSection, ContextMenuSelectionTarget, ContextMenuSeparatorItem, ContextMenuShapeTarget, ContextMenuTarget, } from "./surfaces/contextMenu";
51
- export { getEditorOptionsFromEditorRuntimePlugins, setupEditorRuntimePlugins, type LandEditorRuntimePlugin, } from "./plugins";
52
- export type { CanvasAction, CanvasActionRunInput, CanvasActionValue, CanvasActionContext, CanvasSelectionSnapshot, CanvasToolSnapshot, } from "./surfaces/actions";
53
- export type { ToolbarBadgeItem, ToolbarButtonItem, ToolbarColorInputItem, ToolbarContribution, ToolbarGroup, ToolbarItem, ToolbarSegmentedItem, ToolbarSegmentedOption, ToolbarSeparatorItem, ToolbarStepperItem, ToolbarStepperOption, ToolbarTextInputItem, ToolbarPlacement, ToolbarSurface, ToolbarSwatchesItem, ToolbarSwatchOption, } from "./surfaces/toolbar";
54
- export { DEFAULT_CAMERA, DEFAULT_DOCUMENT_ID, DEFAULT_PAGE_ID, DEFAULT_SESSION_ID, createDefaultDocument, createDefaultPage, createDefaultSession, isAnyAssetRecord, isAnyBindingRecord, isAnyShapeRecord, isAssetRecord, isBindingRecord, isDocumentRecord, isDocumentMetadataRecord, isPageRecord, isSessionRecord, isShapeRecord, type AnyBindingRecord, type AnyAssetRecord, type AnyShapeRecord, 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";
50
+ export type { CustomShapeColorRef, ShapeColor, ThemeColorSlot, ThemeColorResolver, ThemeColorTokenName, ThemeShapeColorRef, } from "./shapes/colors";
51
+ export { getEditorOptionsFromPlugins, setupEditorPlugins, type EditorPlugin, createEditorRuntimeToken, EditorRuntimeRegistry, type EditorRuntimeToken, } from "./plugins";
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";
55
53
  export { Vec } from "./geometry/vec";
56
54
  export { Box } from "./geometry/box";
57
55
  export { Mat } from "./geometry/mat";
@@ -4,25 +4,19 @@ import type { LandInteractionHandler } from "../editor/interactions";
4
4
  import type { ShapeSvgExporter } from "../exports/svg";
5
5
  import type { ShapeCapabilityDefinition } from "../shapes/capabilities";
6
6
  import type { ShapeUtil } from "../shapes/shapeUtil";
7
- import type { CanvasAction } from "../surfaces/actions";
8
- import type { ContextMenuContribution } from "../surfaces/contextMenu";
9
- import type { ToolbarContribution } from "../surfaces/toolbar";
10
- export interface LandEditorRuntimePlugin {
7
+ export interface EditorPlugin {
11
8
  id: string;
12
9
  shapeCapabilities?: ShapeCapabilityDefinition[];
13
10
  shapeUtils?: ShapeUtil[];
14
11
  shapeSvgExporters?: ShapeSvgExporter[];
15
12
  bindingUtils?: BindingUtil[];
16
13
  interactionHandlers?: LandInteractionHandler[];
17
- canvasActions?: CanvasAction[];
18
- toolbarContributions?: ToolbarContribution[];
19
- contextMenuContributions?: ContextMenuContribution[];
20
- setup?(editor: Editor): void;
14
+ setup?(editor: Editor): void | (() => void);
21
15
  }
22
- export declare function getEditorOptionsFromEditorRuntimePlugins(plugins: readonly LandEditorRuntimePlugin[]): {
16
+ export declare function getEditorOptionsFromPlugins(plugins: readonly EditorPlugin[]): {
23
17
  shapeUtils: ShapeUtil[];
24
18
  shapeSvgExporters: ShapeSvgExporter[];
25
19
  bindingUtils: BindingUtil[];
26
20
  shapeCapabilities: ShapeCapabilityDefinition[];
27
21
  };
28
- export declare function setupEditorRuntimePlugins(editor: Editor, plugins: readonly LandEditorRuntimePlugin[]): void;
22
+ export declare function setupEditorPlugins(editor: Editor, plugins: readonly EditorPlugin[]): () => void;
@@ -0,0 +1,19 @@
1
+ import { type Signal } from "../../signals/index";
2
+ export interface EditorRuntimeToken<TValue> {
3
+ readonly id: string;
4
+ readonly __value?: TValue;
5
+ }
6
+ export declare function createEditorRuntimeToken<TValue>(id: string): EditorRuntimeToken<TValue>;
7
+ export declare class EditorRuntimeRegistry {
8
+ private readonly values;
9
+ private readonly disposers;
10
+ private isDisposed;
11
+ private readonly revision;
12
+ readonly revisionSignal: Signal<number>;
13
+ notify(): void;
14
+ provide<TValue>(token: EditorRuntimeToken<TValue>, value: TValue, dispose?: (value: TValue) => void): TValue;
15
+ get<TValue>(token: EditorRuntimeToken<TValue>): TValue | null;
16
+ require<TValue>(token: EditorRuntimeToken<TValue>): TValue;
17
+ onDispose(dispose: () => void): void;
18
+ dispose(): void;
19
+ }
@@ -1 +1,2 @@
1
- export { getEditorOptionsFromEditorRuntimePlugins, setupEditorRuntimePlugins, type LandEditorRuntimePlugin, } from "./editorRuntimePlugin";
1
+ export { getEditorOptionsFromPlugins, setupEditorPlugins, type EditorPlugin, } from "./editorRuntimePlugin";
2
+ export { createEditorRuntimeToken, EditorRuntimeRegistry, type EditorRuntimeToken, } from "./editorRuntimeRegistry";