@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
@@ -0,0 +1,74 @@
1
+ import { Box, Vec } from "../canvas-core/index";
2
+ import type { PathHandle, PathNode, PathShapeProps, PathShapeRecord, PathSubpath } from "./types";
3
+ export interface FlattenedPathSubpath {
4
+ id: string;
5
+ closed: boolean;
6
+ points: Vec[];
7
+ }
8
+ export interface PathSegmentHit {
9
+ subpathId: string;
10
+ startNodeId: string;
11
+ endNodeId: string;
12
+ t: number;
13
+ point: Vec;
14
+ distance: number;
15
+ }
16
+ export interface PathNodeRef {
17
+ subpathId: string;
18
+ nodeId: string;
19
+ }
20
+ export type PathNodeOperation = "merge" | "join" | "separate";
21
+ export interface PathNodeOperationResult {
22
+ subpaths: PathSubpath[];
23
+ selectedNodes: PathNodeRef[];
24
+ primaryNode: PathNodeRef | null;
25
+ }
26
+ export interface PathShapeGeometry {
27
+ path: string | null;
28
+ pointBounds: Box;
29
+ localBounds: Box;
30
+ renderBounds: Box;
31
+ outlineVertices: Vec[];
32
+ flattenedSubpaths: FlattenedPathSubpath[];
33
+ }
34
+ export interface NormalizedPathShape {
35
+ x: number;
36
+ y: number;
37
+ subpaths: PathSubpath[];
38
+ geometry: PathShapeGeometry;
39
+ }
40
+ export declare function clonePathHandle(handle: PathHandle): PathHandle;
41
+ export declare function clonePathNode(node: PathNode): PathNode;
42
+ export declare function clonePathSubpath(subpath: PathSubpath): PathSubpath;
43
+ export declare function clonePathSubpaths(subpaths: readonly PathSubpath[]): PathSubpath[];
44
+ export declare function getNodePoint(node: PathNode): Vec;
45
+ export declare function getNodeInPoint(node: PathNode): Vec;
46
+ export declare function getNodeOutPoint(node: PathNode): Vec;
47
+ export declare function flattenPathSubpath(subpath: PathSubpath): FlattenedPathSubpath;
48
+ export declare function getPathShapeLocalGeometry(shape: Pick<PathShapeRecord, "props">): PathShapeGeometry;
49
+ export declare function translatePathSubpaths(subpaths: readonly PathSubpath[], dx: number, dy: number): PathSubpath[];
50
+ export declare function mapPathSubpaths(subpaths: readonly PathSubpath[], mapPoint: (point: Vec) => Vec): PathSubpath[];
51
+ export declare function normalizePathShapeFromPageSubpaths(pageSubpaths: readonly PathSubpath[], props: Pick<PathShapeProps, "strokeWidth" | "fill" | "stroke" | "fillRule">): NormalizedPathShape;
52
+ export declare function resizePathShapeToLocalBounds(shape: PathShapeRecord, targetBounds: Box): PathSubpath[];
53
+ export declare function getPathShapePageSubpaths(shape: PathShapeRecord, localToPage: {
54
+ applyToPoint(point: Vec): Vec;
55
+ }): PathSubpath[];
56
+ export declare function getPathShapePagePath(shape: PathShapeRecord, localToPage: {
57
+ applyToPoint(point: Vec): Vec;
58
+ }): string | null;
59
+ export declare function hitTestPathStroke(flattenedSubpaths: readonly FlattenedPathSubpath[], point: Vec, margin: number): boolean;
60
+ export declare function findPathSegmentAtLocalPoint(subpaths: readonly PathSubpath[], point: Vec, margin: number): PathSegmentHit | null;
61
+ export declare function hitTestPathFill(flattenedSubpaths: readonly FlattenedPathSubpath[], point: Vec, fillRule: "nonzero" | "evenodd"): boolean;
62
+ export declare function getPathSubpathById(subpaths: readonly PathSubpath[], subpathId: string): PathSubpath | null;
63
+ export declare function getPathNodeById(subpaths: readonly PathSubpath[], subpathId: string, nodeId: string): PathNode | null;
64
+ export declare function updatePathNode(subpaths: readonly PathSubpath[], subpathId: string, nodeId: string, update: (node: PathNode) => PathNode): PathSubpath[];
65
+ export declare function updatePathNodeEntries(subpaths: readonly PathSubpath[], entries: readonly PathNodeRef[], update: (node: PathNode) => PathNode): PathSubpath[];
66
+ export declare function setPathNodeCurveHandles(subpaths: readonly PathSubpath[], subpathId: string, nodeId: string): PathSubpath[];
67
+ export declare function removePathNodeHandles(subpaths: readonly PathSubpath[], subpathId: string, nodeId: string): PathSubpath[];
68
+ export declare function removePathNodeEntries(subpaths: readonly PathSubpath[], entries: readonly PathNodeRef[]): PathSubpath[];
69
+ export declare function canApplyPathNodeOperation(subpaths: readonly PathSubpath[], refs: readonly PathNodeRef[], operation: PathNodeOperation): boolean;
70
+ export declare function applyPathNodeOperation(subpaths: readonly PathSubpath[], refsInput: readonly PathNodeRef[], operation: PathNodeOperation, primaryRef?: PathNodeRef | null): PathNodeOperationResult | null;
71
+ export declare function insertPathNodeAfter(subpaths: readonly PathSubpath[], subpathId: string, afterNodeId: string, node: PathNode): PathSubpath[];
72
+ export declare function insertPathNodeAtSegment(subpaths: readonly PathSubpath[], hit: PathSegmentHit, nodeId: string): PathSubpath[];
73
+ export declare function arePathSubpathsEmpty(subpaths: readonly PathSubpath[]): boolean;
74
+ export declare function sanitizePathSubpaths(subpaths: readonly PathSubpath[]): PathSubpath[];
@@ -0,0 +1,18 @@
1
+ export declare const PATH_NODE_HANDLE_TYPE = "path.node";
2
+ export declare const PATH_CONTROL_HANDLE_TYPE = "path.control";
3
+ export type PathControlHandleKind = "in" | "out";
4
+ export interface PathNodeHandleInfo {
5
+ type: typeof PATH_NODE_HANDLE_TYPE;
6
+ subpathId: string;
7
+ nodeId: string;
8
+ }
9
+ export interface PathControlHandleInfo {
10
+ type: typeof PATH_CONTROL_HANDLE_TYPE;
11
+ subpathId: string;
12
+ nodeId: string;
13
+ handle: PathControlHandleKind;
14
+ }
15
+ export type PathHandleInfo = PathNodeHandleInfo | PathControlHandleInfo;
16
+ export declare function createPathNodeHandleId(subpathId: string, nodeId: string): string;
17
+ export declare function createPathControlHandleId(subpathId: string, nodeId: string, handle: PathControlHandleKind): string;
18
+ export declare function parsePathHandle(type: string, id: string): PathHandleInfo | null;
@@ -0,0 +1,13 @@
1
+ import { type Editor, type ShapeId } from "../canvas-core/index";
2
+ import { type PathShapeRecord } from "./types";
3
+ export type PathHistoryMode = "create" | "edit";
4
+ interface PathHistorySessionOptions {
5
+ onApply?: (shape: PathShapeRecord) => void;
6
+ onBoundaryUndo?: () => boolean;
7
+ }
8
+ export declare function startPathHistorySession(editor: Editor, mode: PathHistoryMode, shapeId: ShapeId, options?: PathHistorySessionOptions): boolean;
9
+ export declare function recordPathHistoryStep(editor: Editor, shapeId: ShapeId): boolean;
10
+ export declare function replaceCurrentPathHistoryStep(editor: Editor, shapeId: ShapeId): boolean;
11
+ export declare function endPathHistorySession(editor: Editor, mode: PathHistoryMode, shapeId: ShapeId): boolean;
12
+ export declare function hasPathHistoryNetChanges(editor: Editor, mode: PathHistoryMode, shapeId: ShapeId): boolean;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type Editor, type LandInteractionHandler, type SelectionHandleInteractionHandler } from "../canvas-core/index";
2
+ import { type PathNodeOperation, type PathNodeRef } from "./pathGeometry";
3
+ import { type PathShapeRecord } from "./types";
4
+ export declare function deletePathEditNodes(editor: Editor, shape: PathShapeRecord, entries: readonly PathNodeRef[]): void;
5
+ export declare function runSelectedPathNodeOperation(editor: Editor, operation: PathNodeOperation): boolean;
6
+ export declare function createPathSelectionHandleInteractionHandler(): SelectionHandleInteractionHandler;
7
+ export declare function createPathInteractionHandler(): LandInteractionHandler;
@@ -0,0 +1,30 @@
1
+ import { Box, ShapeUtil, Vec, type ShapeBrushSelectInput, type ShapeBrushWrapInput, type ShapeBindingPointInput, type ShapeHandleSnapGeometry, type ShapeLineSegmentHitTestInput, type ShapePointHitTestInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionFrameInput, type ShapeSelectionOverlayInfo, type ShapeSelectionOverlayInfoInput, type ShapeSelectionResizeInput, type ShapeTerminalBindingOutline, type ShapeUpdate } from "../canvas-core/index";
2
+ import { type PathShapeProps, type PathShapeRecord } from "./types";
3
+ export declare class PathShapeUtil extends ShapeUtil<PathShapeRecord> {
4
+ readonly type: "path";
5
+ getDefaultProps(): PathShapeProps;
6
+ validateProps(props: unknown): PathShapeProps;
7
+ getPositionedBounds(shape: PathShapeRecord): Box;
8
+ getLocalBounds(shape: PathShapeRecord): Box;
9
+ getRenderBounds(shape: PathShapeRecord): Box;
10
+ getExportBounds(shape: PathShapeRecord): Box;
11
+ getSelectionResizeLocalBounds(shape: PathShapeRecord): Box;
12
+ resizeSelectionBounds(shape: PathShapeRecord, input: ShapeSelectionResizeInput): ShapeUpdate;
13
+ getPositionedOutlineVertices(shape: PathShapeRecord): Vec[];
14
+ getTerminalBindingOutlines(shape: PathShapeRecord): readonly ShapeTerminalBindingOutline[];
15
+ resolveBindingPoint(shape: PathShapeRecord, input: ShapeBindingPointInput): Vec;
16
+ getHandleSnapGeometry(shape: PathShapeRecord): ShapeHandleSnapGeometry;
17
+ canReceiveTerminalBinding(_shape: PathShapeRecord): boolean;
18
+ canEdit(_shape: PathShapeRecord): boolean;
19
+ canUseSelectionResizeHandles(shape: PathShapeRecord, input: ShapeSelectionFrameInput): boolean;
20
+ canUseSelectionRotateHandle(shape: PathShapeRecord, input: ShapeSelectionFrameInput): boolean;
21
+ getSelectionHandleAnchors(shape: PathShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
22
+ getSelectionOverlayInfo(shape: PathShapeRecord, input: ShapeSelectionOverlayInfoInput): ShapeSelectionOverlayInfo;
23
+ hitTest(shape: PathShapeRecord, positionedPoint: Vec, _input?: ShapePointHitTestInput): boolean;
24
+ hitTestLineSegment(shape: PathShapeRecord, input: ShapeLineSegmentHitTestInput): boolean;
25
+ isWrappedByBrush(shape: PathShapeRecord, input: ShapeBrushWrapInput): boolean;
26
+ canSelectByBrush(shape: PathShapeRecord, input: ShapeBrushSelectInput): boolean;
27
+ onEditEnd(shape: PathShapeRecord): {
28
+ deleteShapeIds: `shape:${string}`[];
29
+ } | undefined;
30
+ }
@@ -0,0 +1,3 @@
1
+ import type { PathSubpath } from "./types";
2
+ export declare function getPathSvgPathFromSubpath(subpath: PathSubpath): string | null;
3
+ export declare function getPathSvgPathFromSubpaths(subpaths: readonly PathSubpath[]): string | null;
@@ -0,0 +1,42 @@
1
+ import { StateNode, Vec, type Editor, type ShapeId } from "../canvas-core/index";
2
+ import { type PathNode } from "./types";
3
+ interface PathDraft {
4
+ shapeId: ShapeId;
5
+ subpathId: string;
6
+ lastNodeId: string;
7
+ createdShape: boolean;
8
+ previewNodeId: string | null;
9
+ }
10
+ interface DraggingPathNodeInfo {
11
+ shapeId: ShapeId;
12
+ subpathId: string;
13
+ nodeId: string;
14
+ originPagePoint: Vec;
15
+ startNode: PathNode;
16
+ finishOnPointerUp: boolean;
17
+ }
18
+ interface PathPointerModifiers {
19
+ altKey: boolean;
20
+ shiftKey: boolean;
21
+ }
22
+ export declare class PathTool extends StateNode {
23
+ draft: PathDraft | null;
24
+ private operation;
25
+ constructor(editor: Editor);
26
+ protected onEnter(): void;
27
+ protected onExit(): void;
28
+ isInInitialState(): boolean;
29
+ startOrExtend(point: Vec, modifiers: PathPointerModifiers): DraggingPathNodeInfo | null;
30
+ updateNodeDrag(info: DraggingPathNodeInfo, point: Vec, modifiers: PathPointerModifiers): void;
31
+ updatePreview(point: Vec, modifiers: Pick<PathPointerModifiers, "shiftKey">): void;
32
+ private canFinishDraft;
33
+ finishDraft(options?: {
34
+ switchToSelect?: boolean;
35
+ }): void;
36
+ finishDraftAndEdit(): void;
37
+ cancelDraft(): void;
38
+ hasDraft(): boolean;
39
+ private commitOperation;
40
+ private cancelOperation;
41
+ }
42
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type CanvasPluginSetupContext } from "../canvas-plugin-sdk/index";
2
+ export declare const PATH_EDIT_TOOLBAR_ACTION_ID = "path.edit";
3
+ export declare const PATH_EDIT_DONE_ACTION_ID = "path.edit.done";
4
+ export declare const PATH_EDIT_SNAP_ACTION_ID = "path.edit.snap-nodes";
5
+ export declare const PATH_BOOLEAN_UNION_ACTION_ID = "path.boolean.union";
6
+ export declare const PATH_BOOLEAN_SUBTRACT_ACTION_ID = "path.boolean.subtract";
7
+ export declare const PATH_BOOLEAN_INTERSECT_ACTION_ID = "path.boolean.intersect";
8
+ export declare const PATH_BOOLEAN_XOR_ACTION_ID = "path.boolean.xor";
9
+ export declare const PATH_NODE_DELETE_ACTION_ID = "path.node.delete";
10
+ export declare const PATH_NODE_MAKE_CURVE_ACTION_ID = "path.node.make-curve";
11
+ export declare const PATH_NODE_REMOVE_HANDLES_ACTION_ID = "path.node.remove-handles";
12
+ export declare const PATH_NODE_MERGE_ACTION_ID = "path.node.merge";
13
+ export declare const PATH_NODE_JOIN_ACTION_ID = "path.node.join";
14
+ export declare const PATH_NODE_SEPARATE_ACTION_ID = "path.node.separate";
15
+ export declare function setupPathProduct(context: CanvasPluginSetupContext): void;
@@ -0,0 +1,36 @@
1
+ import { type BaseRecord, type ShapeColor, type ShapeRecordBase } from "../canvas-core/index";
2
+ export declare const PATH_FILL_RULES: readonly ["nonzero", "evenodd"];
3
+ export declare const PATH_NODE_KINDS: readonly ["corner", "smooth", "symmetric"];
4
+ export type PathFillRule = (typeof PATH_FILL_RULES)[number];
5
+ export type PathNodeKind = (typeof PATH_NODE_KINDS)[number];
6
+ export interface PathHandle {
7
+ dx: number;
8
+ dy: number;
9
+ }
10
+ export interface PathNode {
11
+ id: string;
12
+ x: number;
13
+ y: number;
14
+ in?: PathHandle | null;
15
+ out?: PathHandle | null;
16
+ kind: PathNodeKind;
17
+ }
18
+ export interface PathSubpath {
19
+ id: string;
20
+ closed: boolean;
21
+ nodes: PathNode[];
22
+ }
23
+ export interface PathShapeProps {
24
+ subpaths: PathSubpath[];
25
+ fill: ShapeColor;
26
+ stroke: ShapeColor;
27
+ strokeWidth: number;
28
+ fillRule: PathFillRule;
29
+ }
30
+ export interface PathShapeRecord extends ShapeRecordBase<"path", PathShapeProps> {
31
+ type: "path";
32
+ props: PathShapeProps;
33
+ }
34
+ export declare function isPathShapeRecord(record: BaseRecord | null | undefined): record is PathShapeRecord;
35
+ export declare function isPathFillRule(value: unknown): value is PathFillRule;
36
+ export declare function isPathNodeKind(value: unknown): value is PathNodeKind;
@@ -0,0 +1,20 @@
1
+ import type { ShapeColor } from "../canvas-core/index";
2
+ import { type CanvasPluginApi, type CanvasShapeRef } from "../canvas-plugin-sdk/index";
3
+ import type { TextShapeProps } from "./textTypes";
4
+ export interface TextInput {
5
+ x: number;
6
+ y: number;
7
+ text: string;
8
+ w?: number;
9
+ h?: number;
10
+ font?: TextShapeProps["font"];
11
+ color?: ShapeColor;
12
+ size?: TextShapeProps["size"];
13
+ textAlign?: TextShapeProps["textAlign"];
14
+ meta?: Record<string, unknown>;
15
+ }
16
+ export interface TextApi {
17
+ create(input: TextInput): CanvasShapeRef<"text"> | null;
18
+ }
19
+ export declare const textApiToken: import("../canvas-plugin-sdk/index").ProductApiToken<TextApi>;
20
+ export declare const textPluginApi: CanvasPluginApi<TextApi>;
@@ -1,5 +1,8 @@
1
1
  import { type TextFontCatalog } from "./textFonts";
2
- import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
3
- export declare function createTextCanvasRenderPlugin({ fontCatalog, }?: {
2
+ import type { TextTiptapEditorChangeHandler } from "./textFormatting";
3
+ import { type CanvasRenderPlugin } from "../canvas-react/host/index";
4
+ export declare function createTextCanvasRenderPlugin({ fontCatalog, formattingToolbar, onTiptapEditorChange, }?: {
4
5
  fontCatalog?: TextFontCatalog;
5
- }): LandCanvasRenderPlugin;
6
+ formattingToolbar?: boolean;
7
+ onTiptapEditorChange?: TextTiptapEditorChangeHandler;
8
+ }): CanvasRenderPlugin;
@@ -0,0 +1,2 @@
1
+ import type { TextFontCatalog } from "./textFonts";
2
+ export declare const textFontCatalogCapability: import("../canvas-plugin-sdk/index").CanvasPluginValueToken<TextFontCatalog>;
@@ -1,5 +1,5 @@
1
- import { type LandEditorRuntimePlugin } from "../canvas-core/index";
1
+ import type { EditorPlugin } from "../canvas-core/index";
2
2
  import { type TextFontCatalog } from "./textFonts";
3
- export declare function createTextEditorRuntimePlugin({ fontCatalog, }?: {
3
+ export declare function createTextEditorPlugin({ fontCatalog, }?: {
4
4
  fontCatalog?: TextFontCatalog;
5
- }): LandEditorRuntimePlugin;
5
+ }): EditorPlugin;
@@ -1,4 +1,4 @@
1
- import { type LandFeatureBundle } from "../canvas-react/host/index";
2
- import { type TextExtensionOptions } from "./textFonts";
3
- export declare function createTextFeatureBundle(options?: Readonly<TextExtensionOptions>): LandFeatureBundle;
4
- export declare const Text: import("../canvas-react/host/index").ConfigurableLandExtension<TextExtensionOptions>;
1
+ import { type CanvasPlugin } from "../canvas-plugin-sdk/index";
2
+ import { type TextPluginOptions } from "./textFonts";
3
+ export declare function createTextPlugin(options?: Readonly<Partial<TextPluginOptions>>): CanvasPlugin;
4
+ export declare const Text: CanvasPlugin<import("../canvas-plugin-sdk/index").CanvasPluginSetup<import("../canvas-plugin-sdk/index").CanvasPluginSetupContext<import("../canvas-plugin-sdk/index").CanvasPluginApiContext>>>;
@@ -1,8 +1,6 @@
1
1
  import { BindingUtil, type BindingRecordBase, type BindingUtilEffect, type Editor, type ShapeRecord } from "../canvas-core/index";
2
2
  import { GEO_LABEL_BINDING_TYPE } from "./textLabelHelpers";
3
3
  import type { TextShapeRecord } from "./textTypes";
4
- export declare const GEO_LABEL_EDGE_PADDING = 16;
5
- export declare const GEO_LABEL_MIN_WIDTH = 16;
6
4
  export declare const GEO_LABEL_INDEX_SUFFIX = ".label";
7
5
  export interface GeoLabelBindingProps {
8
6
  normalizedAnchor: {
@@ -19,7 +17,11 @@ export declare class GeoLabelBindingUtil extends BindingUtil<GeoLabelBindingReco
19
17
  readonly type = "geo-label";
20
18
  getDefaultProps(): GeoLabelBindingProps;
21
19
  validateProps(props: unknown): GeoLabelBindingProps;
22
- canBind(_editor: Editor, _binding: GeoLabelBindingRecord, context: {
20
+ canBind(_editor: Editor, binding: GeoLabelBindingRecord, context: {
21
+ fromShape: ShapeRecord;
22
+ toShape: ShapeRecord;
23
+ }): boolean;
24
+ canUseShapeHierarchy(_binding: GeoLabelBindingRecord, context: {
23
25
  fromShape: ShapeRecord;
24
26
  toShape: ShapeRecord;
25
27
  }): boolean;
@@ -38,6 +40,7 @@ export declare class GeoLabelBindingUtil extends BindingUtil<GeoLabelBindingReco
38
40
  }): BindingUtilEffect | void;
39
41
  onBeforeDeleteBinding(editor: Editor, binding: GeoLabelBindingRecord): BindingUtilEffect | void;
40
42
  getExportShapeIds(_editor: Editor, binding: GeoLabelBindingRecord): TextShapeRecord["id"][];
43
+ getShapeHierarchyRootId(binding: GeoLabelBindingRecord, shapeId: ShapeRecord["id"]): ShapeRecord["id"] | null;
41
44
  private syncLabelPosition;
42
45
  }
43
46
  export declare function getGeoLabelLayout(editor: Editor, label: TextShapeRecord, owner: ShapeRecord): Pick<TextShapeRecord, "x" | "y" | "rotation"> & {
@@ -1,7 +1,10 @@
1
1
  import type { TextShapeRecord } from "../textTypes";
2
2
  import type { TextFontCatalog } from "../textFonts";
3
- export declare function ShapeEditingSessionBox({ shapeId, markId, fontCatalog, }: {
3
+ import type { TextTiptapEditorChangeHandler } from "../textFormatting";
4
+ export declare function ShapeEditingSessionBox({ shapeId, markId, fontCatalog, formattingToolbar, onTiptapEditorChange, }: {
4
5
  shapeId: TextShapeRecord["id"];
5
6
  markId: string;
6
7
  fontCatalog: TextFontCatalog;
8
+ formattingToolbar?: boolean;
9
+ onTiptapEditorChange?: TextTiptapEditorChangeHandler;
7
10
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,11 @@
1
1
  import { type CSSProperties } from "react";
2
2
  import { type Editor as TiptapEditor } from "@tiptap/react";
3
- import type { Editor as LandEditor } from "../../canvas-core/index";
3
+ import { type Editor as LandEditor } from "../../canvas-core/index";
4
4
  import type { RichTextDocument, TextShapeRecord } from "../textTypes";
5
5
  import type { TextFontCatalog } from "../textFonts";
6
+ import type { TextTiptapEditorChangeHandler, TextTiptapEditorHandle } from "../textFormatting";
6
7
  import { type TiptapTextEditorController } from "./tiptapTextEditorController";
7
- export interface TiptapTextEditorHandle {
8
+ export interface TiptapTextEditorHandle extends TextTiptapEditorHandle {
8
9
  readonly editor: TiptapEditor;
9
10
  readonly controller: TiptapTextEditorController;
10
11
  }
@@ -15,6 +16,8 @@ export interface TiptapTextEditorProps {
15
16
  initialRichText: RichTextDocument;
16
17
  className: string;
17
18
  editorStyle: CSSProperties;
19
+ formattingToolbar?: boolean;
20
+ onTiptapEditorChange?: TextTiptapEditorChangeHandler;
18
21
  onReady(handle: TiptapTextEditorHandle): void;
19
22
  onDispose(handle: TiptapTextEditorHandle): void;
20
23
  onRichTextChange(input: {
@@ -23,4 +26,4 @@ export interface TiptapTextEditorProps {
23
26
  richText: RichTextDocument;
24
27
  }): void;
25
28
  }
26
- export declare function TiptapTextEditor({ landEditor, shape, fontCatalog, initialRichText, className, editorStyle, onReady, onDispose, onRichTextChange, }: TiptapTextEditorProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function TiptapTextEditor({ landEditor, shape, fontCatalog, initialRichText, className, editorStyle, formattingToolbar, onTiptapEditorChange, onReady, onDispose, onRichTextChange, }: TiptapTextEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { Editor as TiptapEditor } from "@tiptap/react";
2
+ export declare function applyInitialTextBackgroundToEmptyEditor(editor: TiptapEditor, backgroundColor: string | null): boolean;
@@ -3,9 +3,8 @@ import type { RichTextDocument } from "../textTypes";
3
3
  export interface RichTextRenderLinkHandlers {
4
4
  onPointerEnter?(input: {
5
5
  href: string;
6
- path: readonly number[];
7
6
  element: HTMLSpanElement;
8
7
  }): void;
9
8
  onPointerLeave?(): void;
10
9
  }
11
- export declare function renderRichTextDocument(richText: RichTextDocument, linkHandlers?: RichTextRenderLinkHandlers): ReactNode;
10
+ export declare function renderRichTextDocument(richText: RichTextDocument, linkHandlers?: RichTextRenderLinkHandlers, defaultBackgroundColor?: string): ReactNode;
@@ -1,4 +1,4 @@
1
1
  import { type CSSProperties } from "react";
2
2
  import type { TextShapeRecord } from "../textTypes";
3
3
  import type { TextFontCatalog } from "../textFonts";
4
- export declare function useTextEditingBoxStyle(shape: TextShapeRecord, fontCatalog: TextFontCatalog): CSSProperties;
4
+ export declare function useTextEditingBoxStyle(shape: TextShapeRecord, fontCatalog: TextFontCatalog, paddingInline?: number): CSSProperties;
@@ -11,7 +11,7 @@ export declare function focusTextEditorWhenMounted({ editor, controller, shapeId
11
11
  onApplied?: (request: ShapeEditingEntryRequest | null) => void;
12
12
  attempt?: number;
13
13
  }): void;
14
- export declare function useTextEditingEntryFocus({ editor, shapeId, session, tiptapEditor, richTextController, entryRequest, consumedEntryRequestIdRef, }: {
14
+ export declare function useTextEditingEntryFocus({ editor, shapeId, session, tiptapEditor, richTextController, entryRequest, consumedEntryRequestIdRef, onEntryFocusApplied, }: {
15
15
  editor: Editor;
16
16
  shapeId: TextShapeRecord["id"];
17
17
  session: ShapeEditingSession;
@@ -19,4 +19,5 @@ export declare function useTextEditingEntryFocus({ editor, shapeId, session, tip
19
19
  richTextController: TiptapTextEditorController | null;
20
20
  entryRequest: ShapeEditingEntryRequest | null;
21
21
  consumedEntryRequestIdRef: MutableRefObject<number | null>;
22
+ onEntryFocusApplied?: () => void;
22
23
  }): void;
@@ -0,0 +1,16 @@
1
+ import { type Editor as LandEditor } from "../../canvas-core/index";
2
+ import type { Editor as TiptapEditor } from "@tiptap/core";
3
+ import type { TextFormattingApi, TextFormattingSnapshot } from "../textFormatting";
4
+ import type { TextFontCatalog } from "../textFonts";
5
+ import type { TextShapeRecord } from "../textTypes";
6
+ export declare function createTextFormattingApi({ editor, fontCatalog, landEditor, shapeId, }: {
7
+ editor: TiptapEditor;
8
+ fontCatalog: TextFontCatalog;
9
+ landEditor: LandEditor;
10
+ shapeId: TextShapeRecord["id"];
11
+ }): TextFormattingApi;
12
+ export declare function getTextFormattingSnapshot({ editor, fontCatalog, shape, }: {
13
+ editor: TiptapEditor;
14
+ fontCatalog: TextFontCatalog;
15
+ shape: TextShapeRecord;
16
+ }): TextFormattingSnapshot;
@@ -1,13 +1,21 @@
1
1
  import type { Editor as TiptapEditor } from "@tiptap/react";
2
2
  import type { RichTextDocument, TextShapeRecord } from "../textTypes";
3
3
  import type { TextFontCatalog } from "../textFonts";
4
+ import { type TextLabelLayoutConstraints } from "../textLabelHelpers";
4
5
  export declare const TEXT_AUTO_SIZE_MIN_W = 16;
5
- export declare function measureTextShapeFromEditor(textEditor: TiptapEditor, shape: TextShapeRecord, fontCatalog: TextFontCatalog): {
6
+ export declare function measureTextShapeFromEditor(textEditor: TiptapEditor, shape: TextShapeRecord, fontCatalog: TextFontCatalog, labelLayout?: TextLabelLayoutConstraints | null): {
6
7
  w: number;
7
8
  h: number;
8
9
  } | undefined;
9
- export declare function measureTextShapeFromRichText(richText: RichTextDocument, shape: TextShapeRecord, fontCatalog: TextFontCatalog): {
10
+ export declare function measureTextShapeFromRichText(richText: RichTextDocument, shape: TextShapeRecord, fontCatalog: TextFontCatalog, labelLayout?: TextLabelLayoutConstraints | null): {
10
11
  w: number;
11
12
  h: number;
12
13
  } | undefined;
13
14
  export declare function applyTextShapeElementStyles(element: HTMLElement, shape: TextShapeRecord, fontCatalog: TextFontCatalog): void;
15
+ export declare function resolveMeasuredTextShapeSize(shape: TextShapeRecord, measuredSize: {
16
+ w: number;
17
+ h: number;
18
+ }, labelLayout?: TextLabelLayoutConstraints | null): {
19
+ w: number;
20
+ h: number;
21
+ } | undefined;
@@ -2,8 +2,10 @@ import { type ReactNode } from "react";
2
2
  import type { Editor } from "../../canvas-core/index";
3
3
  import type { TextShapeRecord } from "../textTypes";
4
4
  import type { TextFontCatalog } from "../textFonts";
5
+ import type { TextTiptapEditorChangeHandler } from "../textFormatting";
5
6
  export interface TextShapeRendererRuntime {
7
+ hasEditingSession: boolean;
6
8
  isEditingThisShape: boolean;
7
9
  editingHost: ReactNode;
8
10
  }
9
- export declare function useTextShapeRendererRuntime(editor: Editor, shape: TextShapeRecord, fontCatalog: TextFontCatalog): TextShapeRendererRuntime;
11
+ export declare function useTextShapeRendererRuntime(editor: Editor, shape: TextShapeRecord, fontCatalog: TextFontCatalog, formattingToolbar?: boolean, onTiptapEditorChange?: TextTiptapEditorChangeHandler): TextShapeRendererRuntime;
@@ -2,12 +2,14 @@ import type { Editor as TiptapEditor } from "@tiptap/react";
2
2
  import { type Editor, type ShapeId } from "../../canvas-core/index";
3
3
  import type { RichTextDocument, TextShapeRecord } from "../textTypes";
4
4
  import type { TextFontCatalog } from "../textFonts";
5
+ import type { TextFormattingApi } from "../textFormatting";
5
6
  export interface TiptapTextSelectionSnapshot {
6
7
  type: string | null;
7
8
  text: string | null;
8
9
  }
9
10
  export interface TiptapTextEditorController {
10
11
  readonly shapeId: ShapeId;
12
+ readonly formatting: TextFormattingApi;
11
13
  getValue(): RichTextDocument;
12
14
  setValue(value: RichTextDocument): void;
13
15
  isDestroyed(): boolean;
@@ -28,8 +30,9 @@ export interface TiptapTextEditorController {
28
30
  } | undefined;
29
31
  onCompositionStateChange(listener: (isComposing: boolean) => void): () => void;
30
32
  }
31
- export declare function createTiptapTextEditorController({ shapeId, editor, fontCatalog, }: {
33
+ export declare function createTiptapTextEditorController({ shapeId, editor, fontCatalog, landEditor, }: {
32
34
  shapeId: ShapeId;
33
35
  editor: TiptapEditor;
34
36
  fontCatalog: TextFontCatalog;
37
+ landEditor: Editor;
35
38
  }): TiptapTextEditorController;
@@ -1,8 +1,15 @@
1
- export { Text, createTextFeatureBundle } from "./feature";
2
- export { createTextEditorRuntimePlugin } from "./editorRuntime";
1
+ export { Text, createTextPlugin } from "./feature";
2
+ export { textFontCatalogCapability } from "./capabilities";
3
+ export { textApiToken } from "./api";
4
+ export type { TextApi, TextInput } from "./api";
5
+ export { createTextEditorPlugin } from "./editorRuntime";
6
+ export { createTextProductSetup } from "./productRuntime";
3
7
  export { createTextCanvasRenderPlugin } from "./canvasRender";
4
- export { DEFAULT_TEXT_FONT, HOST_TEXT_FONT, createDefaultTextFontCatalog, createDefaultTextExtensionOptions, } from "./textFonts";
8
+ export { DEFAULT_TEXT_FONT, HOST_TEXT_FONT, createDefaultTextFontCatalog, createDefaultTextPluginOptions, createTextFontCatalog, } from "./textFonts";
5
9
  export { createRichTextFromPlainText, getPlainTextFromRichText, validateRichTextDocument, } from "./richTextUtils";
6
10
  export { isTextShapeRecord, updateTextShapeRichText, } from "./textShapeHelpers";
7
- export type { TextExtensionOptions, TextFontDefinition, TextFontFaceSource, TextFontSource, TextStylesheetFontSource, TextSystemFontSource, } from "./textFonts";
11
+ export { TextLinkPopoverPresenterProvider, } from "./textLinkPopoverPresentation";
12
+ export type { TextLinkPopoverPresenter, TextLinkPopoverPresenterProps, } from "./textLinkPopoverPresentation";
13
+ export type { TextPluginOptions, TextFontDefinition, TextFontCatalog, TextFontFaceSource, TextFontSource, TextStylesheetFontSource, TextSystemFontSource, } from "./textFonts";
8
14
  export type { RichTextDocument, TextShapeAlign, TextShapeFont, TextShapeProps, TextShapeRecord, TextShapeSize, } from "./textTypes";
15
+ export type { TextFormattingApi, TextFormattingMixed, TextFormattingSnapshot, TextFormattingTarget, TextFormattingValue, TextInlineFormat, TextTiptapEditorChangeHandler, TextTiptapEditorHandle, } from "./textFormatting";
@@ -0,0 +1,55 @@
1
+ import { BindingUtil, type BindingRecord, type BindingRecordBase, type BindingUtilEffect, type BindingSelectionCompanionFrameContext, type Editor, type SelectionOverlayFrameGeometryState, type ShapeLabelPathGeometry, type ShapeRecord, Vec } from "../canvas-core/index";
2
+ import { PATH_LABEL_BINDING_TYPE } from "./textLabelHelpers";
3
+ import type { TextShapeRecord } from "./textTypes";
4
+ export declare const PATH_LABEL_INDEX_SUFFIX = ".label";
5
+ export interface PathLabelBindingProps {
6
+ labelPosition: number;
7
+ }
8
+ export interface PathLabelBindingRecord extends BindingRecordBase<typeof PATH_LABEL_BINDING_TYPE, PathLabelBindingProps> {
9
+ type: typeof PATH_LABEL_BINDING_TYPE;
10
+ props: PathLabelBindingProps;
11
+ }
12
+ export declare function isPathLabelBindingRecord(record: BindingRecord | null | undefined): record is PathLabelBindingRecord;
13
+ export declare class PathLabelBindingUtil extends BindingUtil<PathLabelBindingRecord> {
14
+ readonly type = "path-label";
15
+ getDefaultProps(): PathLabelBindingProps;
16
+ validateProps(props: unknown): PathLabelBindingProps;
17
+ canBind(editor: Editor, binding: PathLabelBindingRecord, context: {
18
+ fromShape: ShapeRecord;
19
+ toShape: ShapeRecord;
20
+ }): boolean;
21
+ canUseShapeHierarchy(_binding: PathLabelBindingRecord, context: {
22
+ fromShape: ShapeRecord;
23
+ toShape: ShapeRecord;
24
+ }, editor?: Editor): boolean;
25
+ getExclusiveBindingKey(binding: PathLabelBindingRecord): string;
26
+ onBindingCreate(editor: Editor, binding: PathLabelBindingRecord): BindingUtilEffect | void;
27
+ onBindingUpdate(editor: Editor, _before: PathLabelBindingRecord, after: PathLabelBindingRecord): BindingUtilEffect | void;
28
+ onBindingLoad(editor: Editor, binding: PathLabelBindingRecord): BindingUtilEffect | void;
29
+ getGeometryDependentShapeIds(_editor: Editor, binding: PathLabelBindingRecord, context: {
30
+ role: "from" | "to";
31
+ }): ShapeRecord["id"][];
32
+ getTargetShapeContentCutoutLocalPolygons(editor: Editor, _binding: PathLabelBindingRecord, context: {
33
+ fromShape: ShapeRecord;
34
+ toShape: ShapeRecord;
35
+ }): readonly (readonly Vec[])[];
36
+ onAfterShapeChange(editor: Editor, binding: PathLabelBindingRecord, _context: {
37
+ role: "from" | "to";
38
+ }): BindingUtilEffect | void;
39
+ onBeforeDeleteShape(_editor: Editor, binding: PathLabelBindingRecord, context: {
40
+ role: "from" | "to";
41
+ }): BindingUtilEffect | void;
42
+ onBeforeDeleteBinding(_editor: Editor, binding: PathLabelBindingRecord): BindingUtilEffect | void;
43
+ getExportShapeIds(_editor: Editor, binding: PathLabelBindingRecord): TextShapeRecord["id"][];
44
+ getShapeHierarchyRootId(binding: PathLabelBindingRecord, shapeId: ShapeRecord["id"]): ShapeRecord["id"] | null;
45
+ getSelectionCompanionFrameGeometries(editor: Editor, binding: PathLabelBindingRecord, context: BindingSelectionCompanionFrameContext): SelectionOverlayFrameGeometryState[];
46
+ private syncLabelPosition;
47
+ }
48
+ export declare function getPathLabelLayout(editor: Editor, label: TextShapeRecord, owner: ShapeRecord, labelPosition?: number): Pick<TextShapeRecord, "x" | "y" | "rotation"> & {
49
+ props: Pick<TextShapeRecord["props"], "w">;
50
+ };
51
+ export declare function getPathLabelOwnerGeometry(editor: Editor, owner: ShapeRecord): ShapeLabelPathGeometry | null;
52
+ export declare function getPathLabelPositionRange(editor: Editor, label: TextShapeRecord, pathGeometry: ShapeLabelPathGeometry): {
53
+ start: number;
54
+ end: number;
55
+ };
@@ -0,0 +1,6 @@
1
+ import { type CanvasPluginSetup } from "../canvas-plugin-sdk/index";
2
+ import { type TextFontCatalog } from "./textFonts";
3
+ export declare function createTextProductSetup({ fontCatalog, selectionFormattingToolbar, }?: {
4
+ fontCatalog?: TextFontCatalog;
5
+ selectionFormattingToolbar?: boolean;
6
+ }): CanvasPluginSetup;
@@ -4,9 +4,15 @@ export type RichTextTextNode = JSONContent & {
4
4
  type: "text";
5
5
  text: string;
6
6
  };
7
+ export type RichTextBlockTextAlign = "left" | "center" | "right";
7
8
  export interface RichTextMarkStyle {
9
+ color?: string;
10
+ backgroundColor?: string;
11
+ fontFamily?: string;
12
+ fontSize?: string;
8
13
  fontWeight?: number;
9
14
  fontStyle?: "italic";
15
+ lineHeight?: string;
10
16
  textDecorationLine?: string;
11
17
  }
12
18
  export declare function createRichTextFromPlainText(text: string): RichTextDocument;
@@ -14,6 +20,7 @@ export declare function getPlainTextFromRichText(richTextDocument: RichTextDocum
14
20
  export declare function validateRichTextDocument(value: unknown): RichTextDocument;
15
21
  export declare function renderRichTextDocumentToHtml(richText: RichTextDocument): string;
16
22
  export declare function isRichTextTextNode(node: JSONContent): node is RichTextTextNode;
17
- export declare function getRichTextTextNodeStyle(node: RichTextTextNode): string | undefined;
18
- export declare function getRichTextMarkStyle(marks: JSONContent["marks"]): RichTextMarkStyle | undefined;
23
+ export declare function getRichTextTextNodeStyle(node: RichTextTextNode, defaultBackgroundColor?: string): string | undefined;
24
+ export declare function getRichTextBlockTextAlign(node: JSONContent): RichTextBlockTextAlign | undefined;
25
+ export declare function getRichTextMarkStyle(marks: JSONContent["marks"], defaultBackgroundColor?: string): RichTextMarkStyle | undefined;
19
26
  export declare function getRichTextLinkHref(marks: JSONContent["marks"]): string | undefined;