@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,52 @@
1
+ import type { CanvasActionContext, CanvasActionValue } from "./actions";
2
+ import type { Editor } from "../canvas-core/index";
3
+ export interface ChromeChannel<TId extends string = string> {
4
+ readonly id: TId;
5
+ }
6
+ export declare function createChromeChannel<const TId extends string>(id: TId): ChromeChannel<TId>;
7
+ export declare const chromeChannels: {
8
+ readonly mainMenu: ChromeChannel<"land.chrome.main-menu">;
9
+ readonly commandPalette: ChromeChannel<"land.chrome.command-palette">;
10
+ readonly inspector: ChromeChannel<"land.chrome.inspector">;
11
+ readonly status: ChromeChannel<"land.chrome.status">;
12
+ };
13
+ export type ChromeItem = {
14
+ kind: "command";
15
+ id: string;
16
+ actionId: string;
17
+ label: string;
18
+ icon?: string;
19
+ value?: CanvasActionValue;
20
+ shortcut?: string;
21
+ tone?: "default" | "destructive";
22
+ dataUi?: string;
23
+ } | {
24
+ kind: "separator";
25
+ id: string;
26
+ } | {
27
+ kind: "badge";
28
+ id: string;
29
+ label: string;
30
+ dataUi?: string;
31
+ };
32
+ export type ChromeCommandItem = Extract<ChromeItem, {
33
+ kind: "command";
34
+ }>;
35
+ export interface ChromeSection {
36
+ id: string;
37
+ order?: number;
38
+ title?: string;
39
+ items: readonly ChromeItem[];
40
+ }
41
+ export interface ChromeContribution {
42
+ id: string;
43
+ channel: ChromeChannel;
44
+ order?: number;
45
+ actionIds: readonly string[];
46
+ subscribe?(editor: Editor, listener: () => void): () => void;
47
+ when?(context: CanvasActionContext): boolean;
48
+ getSections(context: CanvasActionContext): readonly ChromeSection[];
49
+ }
50
+ export interface CanvasPluginChromeSetup {
51
+ add(...contributions: readonly ChromeContribution[]): void;
52
+ }
@@ -0,0 +1,15 @@
1
+ import type { Editor } from "../canvas-core/index";
2
+ import type { CanvasActionContext } from "./actions";
3
+ import type { ChromeChannel, ChromeContribution, ChromeSection } from "./chrome";
4
+ export declare class CanvasChromeRegistry {
5
+ private readonly contributions;
6
+ private readonly channels;
7
+ private readonly contributionsByChannel;
8
+ private stateRevision;
9
+ constructor(contributions?: readonly ChromeContribution[]);
10
+ getChannels(): readonly ChromeChannel[];
11
+ getStateRevision(): number;
12
+ subscribeToState(editor: Editor, listener: () => void): () => void;
13
+ getSections(channel: ChromeChannel, context: CanvasActionContext): ChromeSection[];
14
+ }
15
+ export declare function createCanvasChromeRegistry(contributions?: readonly ChromeContribution[]): CanvasChromeRegistry;
@@ -1,32 +1,12 @@
1
- import type { Vec } from "../geometry";
2
- import type { ShapeId, ShapeRecordBase } from "../schema/records";
1
+ import type { CanvasContextMenuRequest, CanvasContextMenuTarget } from "../canvas-react/index";
3
2
  import type { CanvasActionContext, CanvasActionValue } from "./actions";
4
- export interface ContextMenuCanvasTarget {
5
- type: "canvas";
6
- }
7
- export interface ContextMenuShapeTarget {
8
- type: "shape";
9
- shapeId: ShapeId;
10
- shapeType: ShapeRecordBase["type"];
11
- selected: boolean;
12
- }
13
- export interface ContextMenuSelectionTarget {
14
- type: "selection";
15
- selectedShapeIds: readonly ShapeId[];
16
- }
17
- export type ContextMenuTarget = ContextMenuCanvasTarget | ContextMenuShapeTarget | ContextMenuSelectionTarget;
18
- export interface ActiveContextMenu {
19
- anchor: {
20
- screenPoint: Vec;
21
- pagePoint: Vec;
22
- };
23
- target: ContextMenuTarget;
24
- }
3
+ export type ContextMenuTarget = CanvasContextMenuTarget;
4
+ export type ActiveContextMenu = CanvasContextMenuRequest;
25
5
  export interface ContextMenuContext extends CanvasActionContext {
26
6
  menu: ActiveContextMenu;
27
7
  }
28
8
  export type ContextMenuContributionTarget = "canvas" | "selection" | "shape" | "any";
29
- export interface ContextMenuCommandItem {
9
+ export type ContextMenuItem = {
30
10
  kind: "command";
31
11
  id: string;
32
12
  actionId: string;
@@ -36,18 +16,33 @@ export interface ContextMenuCommandItem {
36
16
  shortcut?: string;
37
17
  tone?: "default" | "destructive";
38
18
  dataUi?: string;
39
- }
40
- export interface ContextMenuSeparatorItem {
19
+ } | {
41
20
  kind: "separator";
42
21
  id: string;
43
- }
44
- export interface ContextMenuBadgeItem {
22
+ } | {
45
23
  kind: "badge";
46
24
  id: string;
47
25
  label: string;
48
26
  dataUi?: string;
49
- }
50
- export type ContextMenuItem = ContextMenuCommandItem | ContextMenuSeparatorItem | ContextMenuBadgeItem;
27
+ };
28
+ export type ContextMenuCommandItem = Extract<ContextMenuItem, {
29
+ kind: "command";
30
+ }>;
31
+ export type ContextMenuSeparatorItem = Extract<ContextMenuItem, {
32
+ kind: "separator";
33
+ }>;
34
+ export type ContextMenuBadgeItem = Extract<ContextMenuItem, {
35
+ kind: "badge";
36
+ }>;
37
+ export type ContextMenuCanvasTarget = Extract<ContextMenuTarget, {
38
+ type: "canvas";
39
+ }>;
40
+ export type ContextMenuShapeTarget = Extract<ContextMenuTarget, {
41
+ type: "shape";
42
+ }>;
43
+ export type ContextMenuSelectionTarget = Extract<ContextMenuTarget, {
44
+ type: "selection";
45
+ }>;
51
46
  export interface ContextMenuSection {
52
47
  id: string;
53
48
  order?: number;
@@ -0,0 +1,11 @@
1
+ import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection } from "./contextMenu";
2
+ export declare class CanvasContextMenuRegistry {
3
+ private readonly contributions;
4
+ private readonly contributionsByTarget;
5
+ private readonly contributionIndexes;
6
+ private nextContributionIndex;
7
+ registerContribution(contribution: ContextMenuContribution): void;
8
+ getSections(target: ContextMenuContributionTarget, context: ContextMenuContext): ContextMenuSection[];
9
+ private addToIndex;
10
+ }
11
+ export declare function createCanvasContextMenuRegistry(contributions?: readonly ContextMenuContribution[]): CanvasContextMenuRegistry;
@@ -0,0 +1,9 @@
1
+ import type { CanvasExportArtifact, CanvasExportContribution, CanvasExportFormat, CanvasExportProviderInput } from "./exports";
2
+ export declare class CanvasExportRegistry {
3
+ private readonly contributionsByFormat;
4
+ constructor(contributions?: readonly CanvasExportContribution[]);
5
+ getFormats(): readonly CanvasExportFormat[];
6
+ hasFormat(format: string): boolean;
7
+ export(format: string, input: CanvasExportProviderInput): Promise<CanvasExportArtifact>;
8
+ }
9
+ export declare function createCanvasExportRegistry(contributions?: readonly CanvasExportContribution[]): CanvasExportRegistry;
@@ -0,0 +1,26 @@
1
+ import type { Editor, ShapeId } from "../canvas-core/index";
2
+ export interface CanvasExportFormat {
3
+ format: string;
4
+ label: string;
5
+ mimeType: string;
6
+ fileExtension: string;
7
+ }
8
+ export interface CanvasExportProviderInput {
9
+ editor: Editor;
10
+ shapeIds: readonly ShapeId[];
11
+ options?: unknown;
12
+ }
13
+ export interface CanvasExportPayload {
14
+ data: Blob | string | Uint8Array | null;
15
+ result?: unknown;
16
+ status?: unknown;
17
+ }
18
+ export interface CanvasExportArtifact extends CanvasExportFormat, CanvasExportPayload {
19
+ }
20
+ export interface CanvasExportContribution extends CanvasExportFormat {
21
+ id: string;
22
+ export(input: CanvasExportProviderInput): CanvasExportPayload | Promise<CanvasExportPayload>;
23
+ }
24
+ export interface CanvasPluginExportSetup {
25
+ add(...contributions: readonly CanvasExportContribution[]): void;
26
+ }
@@ -0,0 +1,10 @@
1
+ import type { CanvasImportContext, CanvasImportContribution, CanvasImportPreview, CanvasImportRequest, CanvasImportResult } from "./imports";
2
+ export declare class CanvasImportRegistry {
3
+ private readonly contributions;
4
+ constructor(contributions?: readonly CanvasImportContribution[]);
5
+ getContributions(): readonly CanvasImportContribution[];
6
+ canImport(request: CanvasImportRequest): boolean;
7
+ canImportPreview(preview: CanvasImportPreview): boolean;
8
+ import(request: CanvasImportRequest, context: CanvasImportContext): Promise<CanvasImportResult>;
9
+ }
10
+ export declare function createCanvasImportRegistry(contributions?: readonly CanvasImportContribution[]): CanvasImportRegistry;
@@ -0,0 +1,38 @@
1
+ import type { Editor, Vec } from "../canvas-core/index";
2
+ export type CanvasImportSource = "clipboard" | "drop" | "file-picker";
3
+ export interface CanvasImportRequest {
4
+ source: CanvasImportSource;
5
+ files: readonly File[];
6
+ text?: string;
7
+ html?: string;
8
+ urls?: readonly string[];
9
+ pagePoint?: Vec;
10
+ }
11
+ export interface CanvasImportPreview {
12
+ source: "drop";
13
+ dataTypes: readonly string[];
14
+ fileTypes: readonly string[];
15
+ }
16
+ export type CanvasImportResult = "handled" | "ignored";
17
+ export interface CanvasImportContext {
18
+ editor: Editor;
19
+ }
20
+ export interface CanvasImportContribution {
21
+ id: string;
22
+ order?: number;
23
+ /**
24
+ * A synchronous, payload-free check used during dragover, when browsers may
25
+ * hide file and URL values until drop.
26
+ */
27
+ acceptsPreview?(preview: CanvasImportPreview): boolean;
28
+ /**
29
+ * Returning true claims the native paste/drop event. If import() later
30
+ * returns ignored, later contributions may run, but browser default handling
31
+ * remains suppressed for that claimed event.
32
+ */
33
+ accepts(request: CanvasImportRequest): boolean;
34
+ import(request: CanvasImportRequest, context: CanvasImportContext): CanvasImportResult | Promise<CanvasImportResult>;
35
+ }
36
+ export interface CanvasPluginImportSetup {
37
+ add(...contributions: readonly CanvasImportContribution[]): void;
38
+ }
@@ -0,0 +1,18 @@
1
+ export * from "./actions";
2
+ export * from "./actionRegistry";
3
+ export * from "./capability";
4
+ export * from "./chrome";
5
+ export * from "./chromeRegistry";
6
+ export * from "./contextMenu";
7
+ export * from "./contextMenuRegistry";
8
+ export * from "./exports";
9
+ export * from "./exportRegistry";
10
+ export * from "./imports";
11
+ export * from "./importRegistry";
12
+ export * from "./lifecycle";
13
+ export * from "./plugin";
14
+ export * from "./pluginUi";
15
+ export * from "./productApi";
16
+ export * from "./services";
17
+ export * from "./toolbar";
18
+ export * from "./toolbarRegistry";
@@ -0,0 +1,31 @@
1
+ import type { Editor } from "../canvas-core/index";
2
+ import type { CanvasActionContext } from "./actions";
3
+ import type { ProductServiceRegistry } from "./services";
4
+ export interface CanvasPluginPersistence {
5
+ flush(): Promise<void>;
6
+ }
7
+ export interface CanvasPluginStartupResult {
8
+ documentSource: "restored" | "seeded" | "empty";
9
+ sessionRestored: boolean;
10
+ warnings: readonly unknown[];
11
+ }
12
+ export interface CanvasPluginBeforeReadyContext {
13
+ editor: Editor;
14
+ persistence: CanvasPluginPersistence | null;
15
+ productId: string;
16
+ signal: AbortSignal;
17
+ startup: CanvasPluginStartupResult;
18
+ services: ProductServiceRegistry;
19
+ }
20
+ export interface CanvasPluginBeforeCommandContext {
21
+ commandId: string;
22
+ context?: CanvasActionContext;
23
+ editor: Editor;
24
+ }
25
+ export type CanvasPluginBeforeReady = (context: CanvasPluginBeforeReadyContext) => Promise<void> | void;
26
+ export type CanvasPluginBeforeCommand = (context: CanvasPluginBeforeCommandContext) => void;
27
+ export interface CanvasPluginLifecycleSetup {
28
+ beforeCommand(hook: CanvasPluginBeforeCommand): void;
29
+ beforeReady(hook: CanvasPluginBeforeReady): void;
30
+ defer(dispose: () => void): void;
31
+ }
@@ -0,0 +1,76 @@
1
+ import type { EditorPlugin, Editor, KeyboardShortcutInput, ShapeRecordBase } from "../canvas-core/index";
2
+ import type { CanvasRenderPlugin } from "../canvas-react/host/index";
3
+ import type { CanvasAction } from "./actions";
4
+ import type { ContextMenuContribution } from "./contextMenu";
5
+ import type { CanvasPluginChromeSetup } from "./chrome";
6
+ import type { CanvasPluginImportSetup } from "./imports";
7
+ import type { CanvasPluginExportSetup } from "./exports";
8
+ import type { CanvasPluginLifecycleSetup, CanvasPluginPersistence } from "./lifecycle";
9
+ import type { CanvasPluginUiSetup } from "./pluginUi";
10
+ import type { ProductServiceSetup } from "./services";
11
+ import type { ToolbarContribution } from "./toolbar";
12
+ import type { CanvasPluginApi, CanvasPluginApiContext } from "./productApi";
13
+ import { type CanvasPluginCapabilitySetup, type CanvasPluginCapabilityToken } from "./capability";
14
+ export interface CanvasActionShortcut {
15
+ actionId: string;
16
+ shortcut: KeyboardShortcutInput;
17
+ }
18
+ export interface CanvasPluginActionSetup {
19
+ add(...actions: readonly CanvasAction[]): void;
20
+ addShortcuts(...shortcuts: readonly CanvasActionShortcut[]): void;
21
+ }
22
+ export interface CanvasPluginToolbarSetup {
23
+ add(...contributions: readonly ToolbarContribution[]): void;
24
+ }
25
+ export interface CanvasPluginContextMenuSetup {
26
+ add(...contributions: readonly ContextMenuContribution[]): void;
27
+ }
28
+ export interface CanvasPluginApiSetup<TApiContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
29
+ add<TApi>(api: CanvasPluginApi<TApi, TApiContext>): void;
30
+ }
31
+ export interface CanvasPluginSetupContext<TApiContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
32
+ readonly actions: CanvasPluginActionSetup;
33
+ readonly apis: CanvasPluginApiSetup<TApiContext>;
34
+ readonly capabilities: CanvasPluginCapabilitySetup;
35
+ readonly chrome: CanvasPluginChromeSetup;
36
+ readonly contextMenu: CanvasPluginContextMenuSetup;
37
+ readonly editor: Editor;
38
+ readonly exports: CanvasPluginExportSetup;
39
+ readonly imports: CanvasPluginImportSetup;
40
+ readonly lifecycle: CanvasPluginLifecycleSetup;
41
+ readonly persistence: CanvasPluginPersistence | null;
42
+ readonly productId: string;
43
+ readonly services: ProductServiceSetup;
44
+ readonly toolbar: CanvasPluginToolbarSetup;
45
+ readonly ui: CanvasPluginUiSetup;
46
+ }
47
+ export type CanvasPluginSetup<TContext extends CanvasPluginSetupContext = CanvasPluginSetupContext> = (context: TContext) => void;
48
+ type CanvasPluginSetupLike = (context: never) => unknown;
49
+ export interface CanvasPluginReference {
50
+ readonly id: string;
51
+ readonly __canvasPluginReferenceBrand: "CanvasPluginReference";
52
+ }
53
+ export type CanvasPluginRequirement = CanvasPluginReference | CanvasPluginCapabilityToken;
54
+ export interface CanvasPluginDefinition<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> {
55
+ readonly id: string;
56
+ readonly provides?: readonly CanvasPluginCapabilityToken[];
57
+ readonly requires?: readonly CanvasPluginRequirement[];
58
+ readonly editor?: EditorPlugin;
59
+ readonly render?: CanvasRenderPlugin;
60
+ readonly setup?: TSetup;
61
+ }
62
+ export interface CanvasPlugin<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> extends CanvasPluginDefinition<TSetup>, CanvasPluginReference {
63
+ }
64
+ export type CanvasPluginInput<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> = CanvasPlugin<TSetup> | readonly CanvasPluginInput<TSetup>[];
65
+ export interface CompiledCanvasPlugins<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup> {
66
+ readonly plugins: readonly CanvasPlugin<TSetup>[];
67
+ readonly pluginIds: readonly string[];
68
+ readonly editorPlugins: readonly EditorPlugin[];
69
+ readonly renderPlugins: readonly CanvasRenderPlugin[];
70
+ readonly shapeTypes: readonly ShapeRecordBase["type"][];
71
+ }
72
+ export declare function defineCanvasPlugin<TSetup extends CanvasPluginSetupLike = CanvasPluginSetup>(plugin: CanvasPluginDefinition<TSetup>): CanvasPlugin<TSetup>;
73
+ export declare function compileCanvasPlugins<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): CompiledCanvasPlugins<TSetup>;
74
+ export declare function assertValidCanvasPluginGraph<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[]): void;
75
+ export declare function hasCanvasPluginCapabilityProvider<TSetup extends CanvasPluginSetupLike>(input: readonly CanvasPluginInput<TSetup>[], token: CanvasPluginCapabilityToken): boolean;
76
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { Editor } from "../canvas-core/index";
2
+ import type { ComponentType, ReactNode } from "react";
3
+ import type { CanvasActionContext } from "./actions";
4
+ import type { CanvasActionRegistry } from "./actionRegistry";
5
+ import type { CanvasImportRegistry } from "./importRegistry";
6
+ import type { ProductServiceRegistry } from "./services";
7
+ export interface CanvasCommandInput<TResult> {
8
+ commandId: string;
9
+ context?: CanvasActionContext;
10
+ run(): TResult;
11
+ }
12
+ export type ExecuteCanvasCommand = <TResult>(input: CanvasCommandInput<TResult>) => TResult;
13
+ export interface CanvasPluginComponentProps {
14
+ actionRegistry: CanvasActionRegistry;
15
+ editor: Editor;
16
+ executeCommand: ExecuteCanvasCommand;
17
+ getHostElement(): HTMLElement | null;
18
+ imports: CanvasImportRegistry;
19
+ services: ProductServiceRegistry;
20
+ }
21
+ export interface CanvasPluginProvider {
22
+ id: string;
23
+ order?: number;
24
+ component: ComponentType<{
25
+ children: ReactNode;
26
+ }>;
27
+ }
28
+ export interface CanvasPluginComponent {
29
+ id: string;
30
+ order?: number;
31
+ component: ComponentType<CanvasPluginComponentProps>;
32
+ }
33
+ export interface CanvasPluginUiSetup {
34
+ addComponents(...components: readonly CanvasPluginComponent[]): void;
35
+ addProviders(...providers: readonly CanvasPluginProvider[]): void;
36
+ allowPropertiesDuringEditing(predicate: (context: CanvasActionContext) => boolean): void;
37
+ }
@@ -0,0 +1,28 @@
1
+ import type { Editor, ShapeId } from "../canvas-core/index";
2
+ import type { CanvasPluginCapabilityRegistry, CanvasPluginCapabilityToken } from "./capability";
3
+ import type { CanvasExportRegistry } from "./exportRegistry";
4
+ export interface ProductApiToken<TApi> extends CanvasPluginCapabilityToken<TApi, "api"> {
5
+ readonly __api?: TApi;
6
+ }
7
+ export interface ProductApiRegistry {
8
+ get<TApi>(token: ProductApiToken<TApi>): TApi | null;
9
+ }
10
+ export interface ProductApiRegistryRuntime extends ProductApiRegistry {
11
+ register<TApi>(token: ProductApiToken<TApi>, api: TApi): void;
12
+ }
13
+ export interface CanvasShapeRef<TType extends string = string> {
14
+ id: ShapeId;
15
+ type: TType;
16
+ }
17
+ export interface CanvasPluginApiContext {
18
+ apis: ProductApiRegistry;
19
+ capabilities: CanvasPluginCapabilityRegistry;
20
+ editor: Editor;
21
+ exportRegistry: CanvasExportRegistry;
22
+ }
23
+ export interface CanvasPluginApi<TApi, TContext extends CanvasPluginApiContext = CanvasPluginApiContext> {
24
+ token: ProductApiToken<TApi>;
25
+ create(context: TContext): TApi | null;
26
+ }
27
+ export declare function createProductApiToken<TApi>(id: string): ProductApiToken<TApi>;
28
+ export declare function createProductApiRegistry(): ProductApiRegistryRuntime;
@@ -0,0 +1,20 @@
1
+ import type { CanvasPluginCapabilityToken } from "./capability";
2
+ export interface ProductServiceToken<TService> extends CanvasPluginCapabilityToken<TService, "service"> {
3
+ readonly __service?: TService;
4
+ }
5
+ export interface ProductServiceFactoryContext {
6
+ productId: string;
7
+ }
8
+ export interface ProductServiceFactory<TService> {
9
+ token: ProductServiceToken<TService>;
10
+ create(context: ProductServiceFactoryContext): TService;
11
+ dispose?(service: TService): void;
12
+ }
13
+ export interface ProductServiceRegistry {
14
+ get<TService>(token: ProductServiceToken<TService>): TService | null;
15
+ }
16
+ export interface ProductServiceSetup extends ProductServiceRegistry {
17
+ add<TService>(factory: ProductServiceFactory<TService>): TService;
18
+ }
19
+ export declare function createProductServiceToken<TService>(id: string): ProductServiceToken<TService>;
20
+ export declare function requireProductService<TService>(services: ProductServiceRegistry, token: ProductServiceToken<TService>): TService;
@@ -1,8 +1,19 @@
1
+ import type { Editor } from "../canvas-core/index";
1
2
  import type { CanvasActionContext, CanvasActionValue } from "./actions";
2
3
  export declare const SET_ACTIVE_TOOL_TOOLBAR_ACTION_ID = "editor.tool.set-active-tool";
3
4
  export declare const TOGGLE_TOOL_LOCKED_TOOLBAR_ACTION_ID = "editor.tool.toggle-locked";
4
5
  export type ToolbarSurface = "selection" | "tool";
5
- export type ToolbarPlacement = "chrome" | "context" | "floating";
6
+ export type ToolbarGroupPresentation = "primary" | "overflow";
7
+ export interface ToolbarChannel<TId extends string = string> {
8
+ readonly id: TId;
9
+ }
10
+ export declare function createToolbarChannel<const TId extends string>(id: TId): ToolbarChannel<TId>;
11
+ export declare const toolbarChannels: {
12
+ readonly toolSwitcher: ToolbarChannel<"land.toolbar.tool-switcher">;
13
+ readonly toolOptions: ToolbarChannel<"land.toolbar.tool-options">;
14
+ readonly selectionProperties: ToolbarChannel<"land.toolbar.selection-properties">;
15
+ readonly selectionQuickActions: ToolbarChannel<"land.toolbar.selection-quick-actions">;
16
+ };
6
17
  export interface ToolbarButtonItem {
7
18
  kind: "button";
8
19
  id: string;
@@ -13,6 +24,13 @@ export interface ToolbarButtonItem {
13
24
  shortcut?: string;
14
25
  dataUi?: string;
15
26
  }
27
+ export interface ToolbarCheckboxItem {
28
+ kind: "checkbox";
29
+ id: string;
30
+ actionId: string;
31
+ label: string;
32
+ dataUi?: string;
33
+ }
16
34
  export interface ToolbarSegmentedOption {
17
35
  value: string;
18
36
  label: string;
@@ -23,6 +41,8 @@ export interface ToolbarSegmentedItem {
23
41
  kind: "segmented";
24
42
  id: string;
25
43
  actionId: string;
44
+ label?: string;
45
+ icon?: string;
26
46
  options: readonly ToolbarSegmentedOption[];
27
47
  }
28
48
  export interface ToolbarSwatchOption {
@@ -38,6 +58,14 @@ export interface ToolbarSwatchesItem {
38
58
  label: string;
39
59
  options: readonly ToolbarSwatchOption[];
40
60
  }
61
+ export interface ToolbarColorPresetOption {
62
+ id: string;
63
+ label: string;
64
+ hexColor: string;
65
+ opacity?: number;
66
+ value?: CanvasActionValue;
67
+ dataUi?: string;
68
+ }
41
69
  export interface ToolbarStepperOption {
42
70
  value: number;
43
71
  label: string;
@@ -56,7 +84,11 @@ export interface ToolbarTextInputItem {
56
84
  id: string;
57
85
  actionId: string;
58
86
  label: string;
87
+ icon?: string;
88
+ presentation?: "inline" | "popover";
59
89
  placeholder?: string;
90
+ suffix?: string;
91
+ validate?(value: string): boolean;
60
92
  dataUi?: string;
61
93
  }
62
94
  export interface ToolbarColorInputItem {
@@ -64,9 +96,12 @@ export interface ToolbarColorInputItem {
64
96
  id: string;
65
97
  actionId: string;
66
98
  label: string;
99
+ previewStyle?: "solid" | "outline";
67
100
  fallback?: string;
68
- includeAlpha?: boolean;
101
+ /** Embed opacity in the color value by default, or send it separately. */
102
+ opacityMode?: "embedded" | "separate";
69
103
  opacityFallback?: number;
104
+ presets?: readonly ToolbarColorPresetOption[];
70
105
  dataUi?: string;
71
106
  }
72
107
  export interface ToolbarSliderItem {
@@ -89,18 +124,26 @@ export interface ToolbarSeparatorItem {
89
124
  kind: "separator";
90
125
  id: string;
91
126
  }
92
- export type ToolbarItem = ToolbarButtonItem | ToolbarSegmentedItem | ToolbarSwatchesItem | ToolbarStepperItem | ToolbarTextInputItem | ToolbarColorInputItem | ToolbarSliderItem | ToolbarBadgeItem | ToolbarSeparatorItem;
127
+ export type ToolbarItem = ToolbarButtonItem | ToolbarCheckboxItem | ToolbarSegmentedItem | ToolbarSwatchesItem | ToolbarStepperItem | ToolbarTextInputItem | ToolbarColorInputItem | ToolbarSliderItem | ToolbarBadgeItem | ToolbarSeparatorItem;
93
128
  export interface ToolbarGroup {
94
129
  id: string;
95
130
  order?: number;
131
+ presentation?: ToolbarGroupPresentation;
96
132
  items: readonly ToolbarItem[];
97
133
  }
98
134
  export interface ToolbarContribution {
99
135
  id: string;
100
- surface: ToolbarSurface;
101
- placement?: ToolbarPlacement;
136
+ channel: ToolbarChannel;
102
137
  order?: number;
103
138
  actionIds: readonly string[];
139
+ subscribe?(editor: Editor, listener: () => void): () => void;
104
140
  when?(context: CanvasActionContext): boolean;
105
141
  getGroups(context: CanvasActionContext): readonly ToolbarGroup[];
106
142
  }
143
+ export interface ToolbarGroupSource {
144
+ groups: readonly ToolbarGroup[];
145
+ groupIdPrefix?: string;
146
+ }
147
+ export declare function mergeToolbarGroups(sources: readonly ToolbarGroupSource[], options?: {
148
+ dedupeActionIdsAcrossSources?: boolean;
149
+ }): ToolbarGroup[];
@@ -0,0 +1,18 @@
1
+ import type { Editor } from "../canvas-core/index";
2
+ import type { CanvasActionContext } from "./actions";
3
+ import type { ToolbarChannel, ToolbarContribution, ToolbarGroup } from "./toolbar";
4
+ export declare class CanvasToolbarRegistry {
5
+ private readonly contributions;
6
+ private readonly channels;
7
+ private readonly contributionsByChannel;
8
+ private readonly contributionIndexes;
9
+ private nextContributionIndex;
10
+ private stateRevision;
11
+ registerContribution(contribution: ToolbarContribution): void;
12
+ getStateRevision(): number;
13
+ subscribeToState(editor: Editor, listener: () => void): () => void;
14
+ getGroups(channel: ToolbarChannel, context: CanvasActionContext): ToolbarGroup[];
15
+ getChannels(): readonly ToolbarChannel[];
16
+ private addToIndexes;
17
+ }
18
+ export declare function createCanvasToolbarRegistry(contributions?: readonly ToolbarContribution[]): CanvasToolbarRegistry;
@@ -1,4 +1,4 @@
1
- import { type ActiveContextMenu } from "../../canvas-core/index";
1
+ import type { CanvasContextMenuRequest } from "../contextMenuRequest";
2
2
  import type { CanvasRenderPluginComponent, CanvasRenderPluginProvider } from "../host/canvasRenderPlugin";
3
3
  import { type CanvasRendererRegistry } from "../host/rendererRegistry";
4
4
  import { type CanvasOverlayRegistry } from "../host/overlayRegistry";
@@ -7,7 +7,7 @@ export declare function Canvas({ canvasComponents, canvasProviders, domEventGuar
7
7
  canvasComponents?: readonly CanvasRenderPluginComponent[];
8
8
  canvasProviders?: readonly CanvasRenderPluginProvider[];
9
9
  domEventGuardRegistry?: CanvasDomEventGuardRegistry;
10
- onContextMenuRequest?: (activeContextMenu: ActiveContextMenu) => void;
10
+ onContextMenuRequest?: (request: CanvasContextMenuRequest) => void;
11
11
  overlayRegistry?: CanvasOverlayRegistry;
12
12
  rendererRegistry?: CanvasRendererRegistry;
13
13
  showGrid?: boolean;
@@ -0,0 +1,13 @@
1
+ import type { Editor, KeyboardEditorEvent } from "../../canvas-core/index";
2
+ export declare function createKeyboardEvent(name: KeyboardEditorEvent["name"], event: KeyboardEvent): KeyboardEditorEvent;
3
+ export declare function routeCanvasKeyUp(editor: Editor, event: KeyboardEvent, isEditableTarget: boolean): void;
4
+ export declare function getKeyboardShortcutEvent(event: KeyboardEvent): {
5
+ key: string;
6
+ shiftKey: boolean;
7
+ altKey: boolean;
8
+ ctrlKey: boolean;
9
+ metaKey: boolean;
10
+ accelKey: boolean;
11
+ };
12
+ export declare function isCanvasPanKey(event: Pick<KeyboardEvent, "code">): boolean;
13
+ export declare function isCanvasPanKeyEventTarget(target: EventTarget | null, container: HTMLElement): boolean;
@@ -1,5 +1,6 @@
1
1
  import { type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type RefObject } from "react";
2
- import { type ActiveContextMenu, type Editor, type ShapeEditingSession } from "../../canvas-core/index";
2
+ import { type Editor, type ShapeEditingSession } from "../../canvas-core/index";
3
+ import type { CanvasContextMenuRequest } from "../contextMenuRequest";
3
4
  import type { CanvasDomEventGuardRegistry } from "../host/domEventGuards";
4
5
  export interface CanvasDomEventHandlers {
5
6
  onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
@@ -10,13 +11,13 @@ export interface CanvasDomEventState {
10
11
  containerRef: RefObject<HTMLDivElement | null>;
11
12
  handlers: CanvasDomEventHandlers;
12
13
  isPointerActive: boolean;
13
- isMiddleButtonPanning: boolean;
14
+ isCameraPanning: boolean;
14
15
  surfaceCursor: string | undefined;
15
16
  }
16
17
  export declare function useCanvasDomEvents({ activeDomEventGuards, activeToolId, editor, onContextMenuRequest, shapeEditingSession, }: {
17
18
  activeDomEventGuards: CanvasDomEventGuardRegistry;
18
19
  activeToolId: string;
19
20
  editor: Editor;
20
- onContextMenuRequest?: (activeContextMenu: ActiveContextMenu) => void;
21
+ onContextMenuRequest?: (request: CanvasContextMenuRequest) => void;
21
22
  shapeEditingSession: ShapeEditingSession | null;
22
23
  }): CanvasDomEventState;