@univerjs-pro/boards-ui 1.0.0-alpha.3

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 (292) hide show
  1. package/README.md +46 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/cjs/shape-preset-labels-C4G0G9GI.js +1 -0
  23. package/lib/es/index.js +1 -0
  24. package/lib/es/locale/ar-SA.js +1 -0
  25. package/lib/es/locale/ca-ES.js +1 -0
  26. package/lib/es/locale/de-DE.js +1 -0
  27. package/lib/es/locale/en-US.js +1 -0
  28. package/lib/es/locale/es-ES.js +1 -0
  29. package/lib/es/locale/fa-IR.js +1 -0
  30. package/lib/es/locale/fr-FR.js +1 -0
  31. package/lib/es/locale/id-ID.js +1 -0
  32. package/lib/es/locale/it-IT.js +1 -0
  33. package/lib/es/locale/ja-JP.js +1 -0
  34. package/lib/es/locale/ko-KR.js +1 -0
  35. package/lib/es/locale/pl-PL.js +1 -0
  36. package/lib/es/locale/pt-BR.js +1 -0
  37. package/lib/es/locale/ru-RU.js +1 -0
  38. package/lib/es/locale/sk-SK.js +1 -0
  39. package/lib/es/locale/vi-VN.js +1 -0
  40. package/lib/es/locale/zh-CN.js +1 -0
  41. package/lib/es/locale/zh-HK.js +1 -0
  42. package/lib/es/locale/zh-TW.js +1 -0
  43. package/lib/es/shape-preset-labels-092BdVw3.js +1 -0
  44. package/lib/index.css +1229 -0
  45. package/lib/index.js +1 -0
  46. package/lib/locale/ar-SA.js +1 -0
  47. package/lib/locale/ca-ES.js +1 -0
  48. package/lib/locale/de-DE.js +1 -0
  49. package/lib/locale/en-US.js +1 -0
  50. package/lib/locale/es-ES.js +1 -0
  51. package/lib/locale/fa-IR.js +1 -0
  52. package/lib/locale/fr-FR.js +1 -0
  53. package/lib/locale/id-ID.js +1 -0
  54. package/lib/locale/it-IT.js +1 -0
  55. package/lib/locale/ja-JP.js +1 -0
  56. package/lib/locale/ko-KR.js +1 -0
  57. package/lib/locale/pl-PL.js +1 -0
  58. package/lib/locale/pt-BR.js +1 -0
  59. package/lib/locale/ru-RU.js +1 -0
  60. package/lib/locale/sk-SK.js +1 -0
  61. package/lib/locale/vi-VN.js +1 -0
  62. package/lib/locale/zh-CN.js +1 -0
  63. package/lib/locale/zh-HK.js +1 -0
  64. package/lib/locale/zh-TW.js +1 -0
  65. package/lib/shape-preset-labels-092BdVw3.js +1 -0
  66. package/lib/types/commands/operations/board-container-child-contextmenu.operation.d.ts +18 -0
  67. package/lib/types/commands/operations/board-container-contextmenu.operation.d.ts +18 -0
  68. package/lib/types/commands/operations/board-selection.operation.d.ts +14 -0
  69. package/lib/types/commands/operations/board-swimlane-contextmenu.operation.d.ts +23 -0
  70. package/lib/types/common/board-shortcuts.d.ts +98 -0
  71. package/lib/types/common/connector-presets.d.ts +22 -0
  72. package/lib/types/common/connector-routing-preference.d.ts +11 -0
  73. package/lib/types/common/settings-actions.d.ts +26 -0
  74. package/lib/types/common/shape-presets.d.ts +58 -0
  75. package/lib/types/common/sticky-colors.d.ts +4 -0
  76. package/lib/types/common/theme-presets.d.ts +2 -0
  77. package/lib/types/common/toolbar-tools.d.ts +17 -0
  78. package/lib/types/components/object-list-panel/board-object-list-state.d.ts +27 -0
  79. package/lib/types/config/config.d.ts +92 -0
  80. package/lib/types/const.d.ts +26 -0
  81. package/lib/types/controllers/board-clipboard-shortcut.controller.d.ts +25 -0
  82. package/lib/types/controllers/board-connector-floating-toolbar.render-controller.d.ts +30 -0
  83. package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +158 -0
  84. package/lib/types/controllers/board-container-membership.render-controller.d.ts +27 -0
  85. package/lib/types/controllers/board-element-selection.controller.d.ts +63 -0
  86. package/lib/types/controllers/board-element-transform.controller.d.ts +52 -0
  87. package/lib/types/controllers/board-element-transformer-config.util.d.ts +27 -0
  88. package/lib/types/controllers/board-grid.render-controller.d.ts +14 -0
  89. package/lib/types/controllers/board-grouping-shortcut.controller.d.ts +20 -0
  90. package/lib/types/controllers/board-history-shortcut.controller.d.ts +16 -0
  91. package/lib/types/controllers/board-ink-interaction.render-controller.d.ts +124 -0
  92. package/lib/types/controllers/board-layout-shortcut.controller.d.ts +20 -0
  93. package/lib/types/controllers/board-mermaid-import.controller.d.ts +9 -0
  94. package/lib/types/controllers/board-order-shortcut.controller.d.ts +16 -0
  95. package/lib/types/controllers/board-pending-insert.render-controller.d.ts +27 -0
  96. package/lib/types/controllers/board-render-object-cleanup.util.d.ts +7 -0
  97. package/lib/types/controllers/board-render.controller.d.ts +36 -0
  98. package/lib/types/controllers/board-selection-overlay.render-controller.d.ts +30 -0
  99. package/lib/types/controllers/board-selection-shortcut.controller.d.ts +20 -0
  100. package/lib/types/controllers/board-settings-shortcut.controller.d.ts +20 -0
  101. package/lib/types/controllers/board-shape-adjust.render-controller.d.ts +68 -0
  102. package/lib/types/controllers/board-shape-floating-toolbar.render-controller.d.ts +29 -0
  103. package/lib/types/controllers/board-shape-text-float-menu.render-controller.d.ts +9 -0
  104. package/lib/types/controllers/board-swimlane-lane-shortcut.controller.d.ts +23 -0
  105. package/lib/types/controllers/board-swimlane-resize.render-controller.d.ts +33 -0
  106. package/lib/types/controllers/board-text-editing.render-controller.d.ts +46 -0
  107. package/lib/types/controllers/board-theme-follow-univer.controller.d.ts +10 -0
  108. package/lib/types/controllers/board-tool-shortcut.controller.d.ts +22 -0
  109. package/lib/types/controllers/board-ui.controller.d.ts +9 -0
  110. package/lib/types/controllers/board-view-shortcut.controller.d.ts +29 -0
  111. package/lib/types/controllers/board-viewport-input.render-controller.d.ts +27 -0
  112. package/lib/types/index.d.ts +27 -0
  113. package/lib/types/locale/ar-SA.d.ts +3 -0
  114. package/lib/types/locale/ca-ES.d.ts +3 -0
  115. package/lib/types/locale/de-DE.d.ts +3 -0
  116. package/lib/types/locale/en-US.d.ts +659 -0
  117. package/lib/types/locale/es-ES.d.ts +3 -0
  118. package/lib/types/locale/fa-IR.d.ts +3 -0
  119. package/lib/types/locale/fr-FR.d.ts +3 -0
  120. package/lib/types/locale/id-ID.d.ts +3 -0
  121. package/lib/types/locale/it-IT.d.ts +3 -0
  122. package/lib/types/locale/ja-JP.d.ts +3 -0
  123. package/lib/types/locale/ko-KR.d.ts +3 -0
  124. package/lib/types/locale/pl-PL.d.ts +3 -0
  125. package/lib/types/locale/pt-BR.d.ts +3 -0
  126. package/lib/types/locale/ru-RU.d.ts +3 -0
  127. package/lib/types/locale/shared/shape-preset-labels.d.ts +153 -0
  128. package/lib/types/locale/sk-SK.d.ts +3 -0
  129. package/lib/types/locale/types.d.ts +3 -0
  130. package/lib/types/locale/vi-VN.d.ts +3 -0
  131. package/lib/types/locale/zh-CN.d.ts +3 -0
  132. package/lib/types/locale/zh-HK.d.ts +3 -0
  133. package/lib/types/locale/zh-TW.d.ts +3 -0
  134. package/lib/types/menu/board-container-child-contextmenu.menu.d.ts +5 -0
  135. package/lib/types/menu/board-container-child-contextmenu.schema.d.ts +2 -0
  136. package/lib/types/menu/board-container-contextmenu.menu.d.ts +9 -0
  137. package/lib/types/menu/board-container-contextmenu.schema.d.ts +2 -0
  138. package/lib/types/menu/board-contextmenu.d.ts +7 -0
  139. package/lib/types/menu/board-swimlane-contextmenu.menu.d.ts +8 -0
  140. package/lib/types/menu/board-swimlane-contextmenu.schema.d.ts +2 -0
  141. package/lib/types/plugin.d.ts +21 -0
  142. package/lib/types/render-adapters/board-element-render-adapter.d.ts +63 -0
  143. package/lib/types/render-objects/board-adjust-point-object.d.ts +27 -0
  144. package/lib/types/render-objects/board-connector-affordance-object.d.ts +21 -0
  145. package/lib/types/render-objects/board-connector-endpoint-object.d.ts +29 -0
  146. package/lib/types/render-objects/board-connector-object.d.ts +58 -0
  147. package/lib/types/render-objects/board-connector-quick-connect-preview-object.d.ts +22 -0
  148. package/lib/types/render-objects/board-connector-snap-object.d.ts +16 -0
  149. package/lib/types/render-objects/board-connector-waypoint-object.d.ts +51 -0
  150. package/lib/types/render-objects/board-container-membership-object.d.ts +19 -0
  151. package/lib/types/render-objects/board-document-text-render.util.d.ts +61 -0
  152. package/lib/types/render-objects/board-grid-object.d.ts +17 -0
  153. package/lib/types/render-objects/board-guide-object.d.ts +29 -0
  154. package/lib/types/render-objects/board-image-object.d.ts +16 -0
  155. package/lib/types/render-objects/board-ink-draft-object.d.ts +16 -0
  156. package/lib/types/render-objects/board-ink-eraser-draft-object.d.ts +18 -0
  157. package/lib/types/render-objects/board-ink-pen-editor-object.d.ts +39 -0
  158. package/lib/types/render-objects/board-ink-stage-action-button-object.d.ts +32 -0
  159. package/lib/types/render-objects/board-ink-tool-cursor-object.d.ts +19 -0
  160. package/lib/types/render-objects/board-pending-insert-object.d.ts +35 -0
  161. package/lib/types/render-objects/board-selection-marquee-object.d.ts +28 -0
  162. package/lib/types/render-objects/board-shape-object.d.ts +75 -0
  163. package/lib/types/render-objects/board-swimlane-resize-object.d.ts +33 -0
  164. package/lib/types/services/board-canvas-pop-manager.service.d.ts +22 -0
  165. package/lib/types/services/board-clipboard-resource-adapter.service.d.ts +54 -0
  166. package/lib/types/services/board-clipboard.service.d.ts +54 -0
  167. package/lib/types/services/board-connector-tool.service.d.ts +11 -0
  168. package/lib/types/services/board-container-rename.service.d.ts +20 -0
  169. package/lib/types/services/board-container-tool.service.d.ts +12 -0
  170. package/lib/types/services/board-dom-layer.service.d.ts +31 -0
  171. package/lib/types/services/board-element-edit.service.d.ts +124 -0
  172. package/lib/types/services/board-element-insert.service.d.ts +40 -0
  173. package/lib/types/services/board-element-state.service.d.ts +83 -0
  174. package/lib/types/services/board-find.service.d.ts +22 -0
  175. package/lib/types/services/board-image-insert.service.d.ts +23 -0
  176. package/lib/types/services/board-ink-edit.service.d.ts +33 -0
  177. package/lib/types/services/board-ink-pen-adapter.service.d.ts +22 -0
  178. package/lib/types/services/board-mermaid-import.service.d.ts +82 -0
  179. package/lib/types/services/board-render-scene.service.d.ts +9 -0
  180. package/lib/types/services/board-selection-overlay.service.d.ts +13 -0
  181. package/lib/types/services/board-selection.service.d.ts +18 -0
  182. package/lib/types/services/board-settings-action.service.d.ts +21 -0
  183. package/lib/types/services/board-settings.service.d.ts +13 -0
  184. package/lib/types/services/board-shape-intrinsic-size.service.d.ts +34 -0
  185. package/lib/types/services/board-side-panel.service.d.ts +37 -0
  186. package/lib/types/services/board-swimlane-lane-rename.service.d.ts +18 -0
  187. package/lib/types/services/board-text-editing.service.d.ts +45 -0
  188. package/lib/types/services/board-tool.service.d.ts +85 -0
  189. package/lib/types/services/board-ui-state.service.d.ts +98 -0
  190. package/lib/types/services/board-viewport.service.d.ts +15 -0
  191. package/lib/types/utils/board-alignment-guides.util.d.ts +27 -0
  192. package/lib/types/utils/board-clipboard.util.d.ts +40 -0
  193. package/lib/types/utils/board-connector-adjacency.util.d.ts +7 -0
  194. package/lib/types/utils/board-connector-affordance.util.d.ts +15 -0
  195. package/lib/types/utils/board-connector-hit-test.util.d.ts +14 -0
  196. package/lib/types/utils/board-connector-label.util.d.ts +17 -0
  197. package/lib/types/utils/board-connector-marker-anchor.util.d.ts +17 -0
  198. package/lib/types/utils/board-connector-marker.util.d.ts +13 -0
  199. package/lib/types/utils/board-connector-move.util.d.ts +8 -0
  200. package/lib/types/utils/board-connector-quick-connect.util.d.ts +22 -0
  201. package/lib/types/utils/board-connector-render-bounds.util.d.ts +11 -0
  202. package/lib/types/utils/board-connector-router.util.d.ts +62 -0
  203. package/lib/types/utils/board-connector-routing.util.d.ts +53 -0
  204. package/lib/types/utils/board-connector-selection.util.d.ts +10 -0
  205. package/lib/types/utils/board-connector-snap-highlight.util.d.ts +10 -0
  206. package/lib/types/utils/board-connector-snap.util.d.ts +25 -0
  207. package/lib/types/utils/board-connector-waypoint.util.d.ts +71 -0
  208. package/lib/types/utils/board-container-membership-overlay.util.d.ts +19 -0
  209. package/lib/types/utils/board-container-membership-update.util.d.ts +10 -0
  210. package/lib/types/utils/board-container-spatial-index.util.d.ts +16 -0
  211. package/lib/types/utils/board-container-target.util.d.ts +17 -0
  212. package/lib/types/utils/board-container-title-label.util.d.ts +20 -0
  213. package/lib/types/utils/board-container-toolbar.util.d.ts +40 -0
  214. package/lib/types/utils/board-draft-insert-position.util.d.ts +13 -0
  215. package/lib/types/utils/board-find.util.d.ts +25 -0
  216. package/lib/types/utils/board-floating-toolbar-anchor.util.d.ts +2 -0
  217. package/lib/types/utils/board-free-polyline-draft.util.d.ts +24 -0
  218. package/lib/types/utils/board-grid.util.d.ts +21 -0
  219. package/lib/types/utils/board-image-file.util.d.ts +11 -0
  220. package/lib/types/utils/board-image.util.d.ts +31 -0
  221. package/lib/types/utils/board-insert-config.util.d.ts +32 -0
  222. package/lib/types/utils/board-insert.util.d.ts +23 -0
  223. package/lib/types/utils/board-interaction-config.util.d.ts +19 -0
  224. package/lib/types/utils/board-mermaid-preview.util.d.ts +4 -0
  225. package/lib/types/utils/board-render-dirty.util.d.ts +8 -0
  226. package/lib/types/utils/board-render-page.util.d.ts +19 -0
  227. package/lib/types/utils/board-scene-input-lock.util.d.ts +7 -0
  228. package/lib/types/utils/board-selection-delete.util.d.ts +20 -0
  229. package/lib/types/utils/board-selection-geometry.util.d.ts +31 -0
  230. package/lib/types/utils/board-selection-hit-test.util.d.ts +17 -0
  231. package/lib/types/utils/board-selection-interaction.util.d.ts +23 -0
  232. package/lib/types/utils/board-selection-move.util.d.ts +17 -0
  233. package/lib/types/utils/board-selection-normalize.util.d.ts +3 -0
  234. package/lib/types/utils/board-selection-overlay.util.d.ts +15 -0
  235. package/lib/types/utils/board-selection-resize.util.d.ts +6 -0
  236. package/lib/types/utils/board-shape-editor.util.d.ts +9 -0
  237. package/lib/types/utils/board-shape-outline.util.d.ts +53 -0
  238. package/lib/types/utils/board-shape-text-document.util.d.ts +20 -0
  239. package/lib/types/utils/board-shape-theme.util.d.ts +4 -0
  240. package/lib/types/utils/board-shortcut-preconditions.util.d.ts +3 -0
  241. package/lib/types/utils/board-snap-session.util.d.ts +62 -0
  242. package/lib/types/utils/board-spacing-guides.util.d.ts +24 -0
  243. package/lib/types/utils/board-swimlane-focus.util.d.ts +11 -0
  244. package/lib/types/utils/board-swimlane-resize.util.d.ts +25 -0
  245. package/lib/types/utils/board-view-shortcut.util.d.ts +40 -0
  246. package/lib/types/utils/board-viewport-input.util.d.ts +35 -0
  247. package/lib/types/utils/board-viewport.util.d.ts +45 -0
  248. package/lib/types/views/BoardCanvasView.d.ts +1 -0
  249. package/lib/types/views/BoardConnectorFloatingToolbar.d.ts +17 -0
  250. package/lib/types/views/BoardConnectorQuickShapeMenu.d.ts +12 -0
  251. package/lib/types/views/BoardContainerRenamePopup.d.ts +6 -0
  252. package/lib/types/views/BoardDomLayerView.d.ts +8 -0
  253. package/lib/types/views/BoardFloatingPanelLayer.d.ts +1 -0
  254. package/lib/types/views/BoardFloatingToolPanel.d.ts +98 -0
  255. package/lib/types/views/BoardLeftToolbar.d.ts +1 -0
  256. package/lib/types/views/BoardMermaidImportDialog.d.ts +1 -0
  257. package/lib/types/views/BoardMindMapTemplateThumbnailIcon.d.ts +8 -0
  258. package/lib/types/views/BoardObjectListPanel.d.ts +1 -0
  259. package/lib/types/views/BoardSettingsMenu.d.ts +2 -0
  260. package/lib/types/views/BoardShapeFloatingToolbar.d.ts +16 -0
  261. package/lib/types/views/BoardShapePanel.d.ts +1 -0
  262. package/lib/types/views/BoardShapeTextEditorContainer.d.ts +24 -0
  263. package/lib/types/views/BoardShapeTextFloatToolbar.d.ts +1 -0
  264. package/lib/types/views/BoardShortcutHelpDrawer.d.ts +1 -0
  265. package/lib/types/views/BoardSwimlaneLaneRenamePopup.d.ts +6 -0
  266. package/lib/types/views/BoardTableSizePicker.d.ts +18 -0
  267. package/lib/types/views/BoardWorkbench.d.ts +1 -0
  268. package/lib/types/views/BoardZoomControls.d.ts +1 -0
  269. package/lib/types/views/board-floating-panel-layout.d.ts +33 -0
  270. package/lib/types/views/use-board-palette-pending-insert-drag.d.ts +9 -0
  271. package/lib/types/views/use-board-panel-outside-pointer-down.d.ts +5 -0
  272. package/lib/umd/index.js +1 -0
  273. package/lib/umd/locale/ar-SA.js +1 -0
  274. package/lib/umd/locale/ca-ES.js +1 -0
  275. package/lib/umd/locale/de-DE.js +1 -0
  276. package/lib/umd/locale/en-US.js +1 -0
  277. package/lib/umd/locale/es-ES.js +1 -0
  278. package/lib/umd/locale/fa-IR.js +1 -0
  279. package/lib/umd/locale/fr-FR.js +1 -0
  280. package/lib/umd/locale/id-ID.js +1 -0
  281. package/lib/umd/locale/it-IT.js +1 -0
  282. package/lib/umd/locale/ja-JP.js +1 -0
  283. package/lib/umd/locale/ko-KR.js +1 -0
  284. package/lib/umd/locale/pl-PL.js +1 -0
  285. package/lib/umd/locale/pt-BR.js +1 -0
  286. package/lib/umd/locale/ru-RU.js +1 -0
  287. package/lib/umd/locale/sk-SK.js +1 -0
  288. package/lib/umd/locale/vi-VN.js +1 -0
  289. package/lib/umd/locale/zh-CN.js +1 -0
  290. package/lib/umd/locale/zh-HK.js +1 -0
  291. package/lib/umd/locale/zh-TW.js +1 -0
  292. package/package.json +97 -0
@@ -0,0 +1,45 @@
1
+ import type { IShapeTextEditingParams, IShapeTextHostSizeUpdateParams, IShapeTextUpdateParams } from '@univerjs-pro/shape-editor-ui';
2
+ import type { Nullable } from '@univerjs/core';
3
+ import type { Observable } from 'rxjs';
4
+ import { IBoardElementService } from '@univerjs-pro/boards';
5
+ import { Disposable } from '@univerjs/core';
6
+ import { BoardElementEditService } from './board-element-edit.service';
7
+ import { BoardShapeIntrinsicSizeService } from './board-shape-intrinsic-size.service';
8
+ export interface IBoardTextEditingParams extends IShapeTextEditingParams {
9
+ unitId: string;
10
+ subUnitId: string;
11
+ shapeId: string;
12
+ shapeKey: string;
13
+ visible: boolean;
14
+ }
15
+ export declare class BoardTextEditingService extends Disposable {
16
+ private readonly _boardElementService;
17
+ private readonly _editService;
18
+ private readonly _intrinsicSizeService;
19
+ private readonly _editingParams$;
20
+ readonly editingParams$: Observable<Nullable<IBoardTextEditingParams>>;
21
+ private readonly _onSavingEditorData$;
22
+ readonly onSavingEditorData$: Observable<Nullable<boolean>>;
23
+ private _ignoreExternalFocusChangesUntil;
24
+ private _discardEditingKey;
25
+ private _externalCompletionPointerDownEvent;
26
+ constructor(_boardElementService: IBoardElementService, _editService: BoardElementEditService, _intrinsicSizeService: BoardShapeIntrinsicSizeService);
27
+ dispose(): void;
28
+ setEditing(params: Nullable<IBoardTextEditingParams>): void;
29
+ setOnSavingEditorData(params: Nullable<boolean>): void;
30
+ getEditing(): Nullable<IBoardTextEditingParams>;
31
+ ignoreExternalFocusChanges(duration?: number): void;
32
+ shouldIgnoreExternalFocusChanges(): boolean;
33
+ completeEditing(event?: PointerEvent): void;
34
+ shouldIgnoreSelectionPointerDown(evt: Event): boolean;
35
+ cancelEditing(): void;
36
+ updateShapeText(params: IShapeTextUpdateParams): boolean;
37
+ updatePlainTextShapeHostSize(params: IShapeTextHostSizeUpdateParams): boolean;
38
+ private _updateConnectorLabelText;
39
+ private _resolveHostSize;
40
+ private _resolveConnectorLabelHostSize;
41
+ private _updateConnectorLabelSize;
42
+ private _updateConnectorLabelElement;
43
+ private _ensureConnectorLabel;
44
+ private _shouldDiscardEditorUpdate;
45
+ }
@@ -0,0 +1,85 @@
1
+ import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle, IBoardSwimlaneData } from '@univerjs-pro/boards';
2
+ import type { IBoardPendingInsert } from './board-ui-state.service';
3
+ import { BoardToolType } from '@univerjs-pro/boards';
4
+ import { ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
5
+ import { IBoardUIStateService } from './board-ui-state.service';
6
+ export interface IBoardTableInsertOptions {
7
+ rows?: number;
8
+ columns?: number;
9
+ keepShapeSidebarOpen?: boolean;
10
+ width?: number;
11
+ height?: number;
12
+ diagramPreset?: string;
13
+ }
14
+ export interface IBoardShapeInsertOptions {
15
+ height?: number;
16
+ width?: number;
17
+ }
18
+ interface IBoardToolMindMapBlueprintNode {
19
+ text: string;
20
+ orderKey?: string;
21
+ side?: 'left' | 'right' | 'top' | 'bottom';
22
+ collapsed?: boolean;
23
+ branchColorKey?: string;
24
+ foreignAttributes?: Record<string, string>;
25
+ children: IBoardToolMindMapBlueprintNode[];
26
+ }
27
+ export declare class BoardToolService {
28
+ private readonly _stateService;
29
+ private readonly _commandService;
30
+ private readonly _instanceService;
31
+ private readonly _configService;
32
+ constructor(_stateService: IBoardUIStateService, _commandService: ICommandService, _instanceService: IUniverInstanceService, _configService: IConfigService);
33
+ private _getInsertConfig;
34
+ private _isToolbarAvailable;
35
+ private _collapseInsertTools;
36
+ collapseFloatingTools(): void;
37
+ closeShapeSidebar(): void;
38
+ private _getActiveBoardModel;
39
+ private _executeActiveBoardOperation;
40
+ activateToolbarTool(tool: BoardToolType): void;
41
+ private _insertTable;
42
+ private _resolveTablePendingInsert;
43
+ beginTableInsert(size?: IBoardTableInsertOptions): void;
44
+ beginTableInsertDrag(size?: IBoardTableInsertOptions): void;
45
+ private _insertChart;
46
+ private _beginLineMode;
47
+ beginLineInsert(routing: BoardConnectorRouting, style?: Partial<IBoardConnectorStyle>): void;
48
+ private _openContainerPanel;
49
+ beginContainerInsert(size?: {
50
+ width?: number;
51
+ height?: number;
52
+ }): void;
53
+ private _openSwimlanePanel;
54
+ beginSwimlaneInsert(orientation: IBoardSwimlaneData['orientation']): void;
55
+ private _beginPenMode;
56
+ private _openMindMapPanel;
57
+ beginMindMapInsert(template?: {
58
+ rootText?: string;
59
+ structureKind?: 'mindmap-horizontal' | 'mindmap-vertical' | 'tree-right' | 'tree-left' | 'tree-alternate' | 'timeline-horizontal' | 'timeline-vertical';
60
+ branchLineType?: 'rounded-orthogonal' | 'curve' | 'orthogonal';
61
+ children?: Array<{
62
+ text?: string;
63
+ orderKey?: string;
64
+ side?: 'left' | 'right' | 'top' | 'bottom';
65
+ collapsed?: boolean;
66
+ branchColorKey?: string;
67
+ foreignAttributes?: Record<string, string>;
68
+ }>;
69
+ blueprint?: {
70
+ title?: string;
71
+ root: IBoardToolMindMapBlueprintNode;
72
+ };
73
+ }): void;
74
+ private _beginResourcesPanel;
75
+ private _beginImport;
76
+ private _resolveShapePendingInsert;
77
+ beginShapeInsert(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
78
+ beginShapeInsertDrag(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
79
+ beginPendingInsertDrag(pendingInsert: IBoardPendingInsert): void;
80
+ cancelPendingInsertDrag(): void;
81
+ beginStickyInsert(fillColor: string): void;
82
+ beginStickyInsertDrag(fillColor: string): void;
83
+ openShapeSidebar(): void;
84
+ }
85
+ export {};
@@ -0,0 +1,98 @@
1
+ import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle, IBoardSettings, IBoardSwimlaneData } from '@univerjs-pro/boards';
2
+ import type { IBoardInsertRect } from '../utils/board-insert.util';
3
+ import type { IBoardViewportPoint, IBoardViewportTransform } from '../utils/board-viewport.util';
4
+ import { BoardToolType } from '@univerjs-pro/boards';
5
+ import { Disposable, IConfigService } from '@univerjs/core';
6
+ import { BehaviorSubject } from 'rxjs';
7
+ export type IBoardPendingInsert = {
8
+ type: BoardToolType.Shape;
9
+ shapeType: BoardShapeType | string;
10
+ width?: number;
11
+ height?: number;
12
+ } | {
13
+ type: BoardToolType.Text;
14
+ } | {
15
+ type: BoardToolType.Sticky;
16
+ fillColor: string;
17
+ } | {
18
+ type: BoardToolType.Container;
19
+ width?: number;
20
+ height?: number;
21
+ } | {
22
+ type: BoardToolType.Swimlane;
23
+ orientation?: IBoardSwimlaneData['orientation'];
24
+ } | {
25
+ type: BoardToolType.Table;
26
+ columns: number;
27
+ diagramPreset?: string;
28
+ height: number;
29
+ rows: number;
30
+ width: number;
31
+ } | {
32
+ type: BoardToolType.MindMap;
33
+ };
34
+ export interface IBoardUIState {
35
+ settings: Required<IBoardSettings>;
36
+ activeTool: BoardToolType | null;
37
+ connectorRouting: BoardConnectorRouting;
38
+ connectorStyle: IBoardConnectorStyle;
39
+ pendingInsert: IBoardPendingInsert | null;
40
+ pendingInsertDragActive: boolean;
41
+ pendingInsertPreviewRect: IBoardInsertRect | null;
42
+ objectListPanelOpen: boolean;
43
+ shapeSidebarOpen: boolean;
44
+ zoomRatio: number;
45
+ viewportPanOffset: IBoardViewportPoint;
46
+ }
47
+ export interface IBoardUIStateService {
48
+ readonly state$: ReturnType<BehaviorSubject<IBoardUIState>['asObservable']>;
49
+ getState(): IBoardUIState;
50
+ getSettings(): Required<IBoardSettings>;
51
+ setSettings(settings: Partial<IBoardSettings>): void;
52
+ setActiveTool(tool: BoardToolType | null): void;
53
+ setConnectorRouting(routing: BoardConnectorRouting | string | undefined): void;
54
+ setConnectorStyle(style: Partial<IBoardConnectorStyle>): void;
55
+ reverseConnectorMarkers(): void;
56
+ setPendingInsert(pendingInsert: IBoardPendingInsert): void;
57
+ beginPendingInsertDrag(pendingInsert: IBoardPendingInsert): void;
58
+ endPendingInsertDrag(): void;
59
+ setPendingInsertPreviewRect(rect: IBoardInsertRect | null): void;
60
+ clearPendingInsert(): void;
61
+ setObjectListPanelOpen(open: boolean): void;
62
+ setShapeSidebarOpen(open: boolean): void;
63
+ setZoomRatio(zoomRatio: number): void;
64
+ setZoomRatioAtViewportPoint(zoomRatio: number, viewportPoint: IBoardViewportPoint): void;
65
+ setViewportPanOffset(panOffset: IBoardViewportPoint): void;
66
+ setViewportTransform(viewport: IBoardViewportTransform): void;
67
+ shiftViewportPanOffset(delta: IBoardViewportPoint): void;
68
+ }
69
+ export declare const IBoardUIStateService: import("@wendellhu/redi").IdentifierDecorator<IBoardUIStateService>;
70
+ export declare class BoardUIStateService extends Disposable implements IBoardUIStateService {
71
+ private readonly _configService?;
72
+ private readonly _interactionConfig;
73
+ private readonly _state$;
74
+ readonly state$: ReturnType<BehaviorSubject<IBoardUIState>['asObservable']>;
75
+ constructor(_configService?: IConfigService | undefined);
76
+ dispose(): void;
77
+ getState(): IBoardUIState;
78
+ getSettings(): Required<IBoardSettings>;
79
+ private _isToolbarAvailable;
80
+ private _persistConnectorRoutingStyle;
81
+ setSettings(settings: Partial<IBoardSettings>): void;
82
+ setActiveTool(tool: BoardToolType | null): void;
83
+ setConnectorRouting(routing: BoardConnectorRouting | string | undefined): void;
84
+ setConnectorStyle(style: Partial<IBoardConnectorStyle>): void;
85
+ reverseConnectorMarkers(): void;
86
+ setPendingInsert(pendingInsert: IBoardPendingInsert): void;
87
+ beginPendingInsertDrag(pendingInsert: IBoardPendingInsert): void;
88
+ endPendingInsertDrag(): void;
89
+ setPendingInsertPreviewRect(rect: IBoardInsertRect | null): void;
90
+ clearPendingInsert(): void;
91
+ setObjectListPanelOpen(open: boolean): void;
92
+ setShapeSidebarOpen(open: boolean): void;
93
+ setZoomRatio(zoomRatio: number): void;
94
+ setZoomRatioAtViewportPoint(zoomRatio: number, viewportPoint: IBoardViewportPoint): void;
95
+ setViewportPanOffset(panOffset: IBoardViewportPoint): void;
96
+ setViewportTransform(viewport: IBoardViewportTransform): void;
97
+ shiftViewportPanOffset(delta: IBoardViewportPoint): void;
98
+ }
@@ -0,0 +1,15 @@
1
+ import type { BoardModel } from '@univerjs-pro/boards';
2
+ import type { IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
3
+ import { IBoardElementService } from '@univerjs-pro/boards';
4
+ import { IBoardUIStateService } from './board-ui-state.service';
5
+ export interface IBoardViewportFitContentOptions {
6
+ viewportSize: IBoardViewportSize;
7
+ padding?: number;
8
+ zoom?: IBoardViewportZoomConfig;
9
+ }
10
+ export declare class BoardViewportService {
11
+ private readonly _boardElementService;
12
+ private readonly _uiStateService;
13
+ constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService);
14
+ fitContent(boardModel: BoardModel | null | undefined, options: IBoardViewportFitContentOptions): boolean;
15
+ }
@@ -0,0 +1,27 @@
1
+ import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardSelectionRect } from './board-selection-geometry.util';
3
+ export interface IBoardAlignmentGuide {
4
+ position: number;
5
+ sourceElementId: string;
6
+ sourceId: string;
7
+ }
8
+ export interface IBoardAlignmentGuides {
9
+ vertical: IBoardAlignmentGuide[];
10
+ horizontal: IBoardAlignmentGuide[];
11
+ }
12
+ export interface IResolveBoardElementAlignmentGuidesOptions {
13
+ activeRect: IBoardSelectionRect;
14
+ activeIds: string[];
15
+ elementData: Record<string, IBoardElementData>;
16
+ elementOrder: string[];
17
+ threshold: number;
18
+ }
19
+ export interface IBoardAlignmentSnap {
20
+ delta: {
21
+ x: number;
22
+ y: number;
23
+ };
24
+ guides: IBoardAlignmentGuides;
25
+ }
26
+ export declare function resolveBoardElementAlignmentGuides(options: IResolveBoardElementAlignmentGuidesOptions): IBoardAlignmentGuides;
27
+ export declare function resolveBoardElementAlignmentSnap(options: IResolveBoardElementAlignmentGuidesOptions): IBoardAlignmentSnap;
@@ -0,0 +1,40 @@
1
+ import type { IBoardElementData, IUpdateBoardElementsOperationItem } from '@univerjs-pro/boards';
2
+ export type BoardClipboardElement = IBoardElementData['element'];
3
+ export interface IBoardClipboardPayload {
4
+ elements: BoardClipboardElement[];
5
+ resources?: Record<string, unknown>;
6
+ }
7
+ export type BoardElementStylePayloadKind = 'shape' | 'connector' | 'text';
8
+ export interface IBoardElementStylePayload {
9
+ kind: BoardElementStylePayloadKind;
10
+ shapeData?: Record<string, unknown>;
11
+ connectorStyle?: Record<string, unknown>;
12
+ textStyle?: Record<string, unknown>;
13
+ }
14
+ export interface ICreateBoardElementClipboardPayloadOptions {
15
+ selectedIds: string[];
16
+ elementOrder: string[];
17
+ elementData: Record<string, IBoardElementData>;
18
+ }
19
+ export interface ICreateBoardPasteElementsOptions {
20
+ payload: IBoardClipboardPayload;
21
+ offset: {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ targetParentId?: string;
26
+ createId?: (sourceId: string) => string;
27
+ }
28
+ export interface ICreateBoardPasteElementsWithIdMapResult {
29
+ elements: BoardClipboardElement[];
30
+ elementIdMap: Map<string, string>;
31
+ }
32
+ export interface ICreateBoardElementStyleUpdatesOptions {
33
+ payload: IBoardElementStylePayload;
34
+ selectedIds: string[];
35
+ elementData: Record<string, IBoardElementData>;
36
+ }
37
+ export declare function createBoardElementClipboardPayload(options: ICreateBoardElementClipboardPayloadOptions): IBoardClipboardPayload | null;
38
+ export declare function createBoardElementStylePayload(element: BoardClipboardElement | undefined): IBoardElementStylePayload | null;
39
+ export declare function createBoardElementStyleUpdates(options: ICreateBoardElementStyleUpdatesOptions): IUpdateBoardElementsOperationItem[];
40
+ export declare function createBoardPasteElementsWithIdMap(options: ICreateBoardPasteElementsOptions): ICreateBoardPasteElementsWithIdMapResult;
@@ -0,0 +1,7 @@
1
+ import type { IBoardConnectorData, IBoardElementData } from '@univerjs-pro/boards';
2
+ export type BoardConnectorAdjacencyMap = Map<string, string[]>;
3
+ export interface ICreateBoardConnectorAdjacencyMapOptions {
4
+ includeHidden?: boolean;
5
+ }
6
+ export declare function getBoardConnectorBoundShapeIds(connectorData: IBoardConnectorData): string[];
7
+ export declare function createBoardConnectorAdjacencyMap(elementData: Record<string, IBoardElementData>, options?: ICreateBoardConnectorAdjacencyMapOptions): BoardConnectorAdjacencyMap;
@@ -0,0 +1,15 @@
1
+ import type { IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ export interface IBoardConnectorAffordanceHandle {
3
+ elementId: string;
4
+ endpoint: IBoardConnectorEndpoint;
5
+ point: IBoardConnectorPoint;
6
+ normal: IBoardConnectorPoint;
7
+ segmentIndex: number;
8
+ visualScreenOffset?: number;
9
+ }
10
+ export interface IResolveBoardConnectorAffordanceHandlesOptions {
11
+ selectedIds: readonly string[];
12
+ elementData: Record<string, IBoardElementData>;
13
+ }
14
+ export declare function withBoardConnectorEndpointFallbackPoint(endpoint: IBoardConnectorEndpoint, point: IBoardConnectorPoint): IBoardConnectorEndpoint;
15
+ export declare function resolveBoardConnectorAffordanceHandles(options: IResolveBoardConnectorAffordanceHandlesOptions): IBoardConnectorAffordanceHandle[];
@@ -0,0 +1,14 @@
1
+ import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { BoardConnectorPathCommand } from './board-connector-routing.util';
3
+ export interface IHitTestBoardConnectorElementOptions {
4
+ connectorData: IBoardConnectorData;
5
+ point: IBoardConnectorPoint;
6
+ elementData?: Record<string, IBoardElementData>;
7
+ connectorId?: string;
8
+ pathCommands?: readonly BoardConnectorPathCommand[];
9
+ routePoints?: readonly IBoardConnectorPoint[];
10
+ pathTolerance?: number;
11
+ }
12
+ export declare const BOARD_CONNECTOR_DEFAULT_HIT_TOLERANCE = 8;
13
+ export declare function resolveBoardConnectorHitTolerance(strokeWidth?: number): number;
14
+ export declare function hitTestBoardConnectorElement(options: IHitTestBoardConnectorElementOptions): boolean;
@@ -0,0 +1,17 @@
1
+ import type { IBoardConnectorData, IBoardConnectorLabel, IBoardConnectorPoint } from '@univerjs-pro/boards';
2
+ import type { IResolveBoardConnectorRoutePointsOptions } from './board-connector-routing.util';
3
+ export declare const BOARD_CONNECTOR_LABEL_DEFAULT_WIDTH = 96;
4
+ export declare const BOARD_CONNECTOR_LABEL_DEFAULT_HEIGHT = 28;
5
+ export declare const BOARD_CONNECTOR_LABEL_DEFAULT_PATH_RATIO = 0.5;
6
+ export declare const BOARD_CONNECTOR_LABEL_TEXT_PADDING_X = 6;
7
+ export declare const BOARD_CONNECTOR_LABEL_TEXT_PADDING_Y = 3;
8
+ export interface IBoardConnectorLabelRect {
9
+ left: number;
10
+ top: number;
11
+ width: number;
12
+ height: number;
13
+ }
14
+ export declare function resolveBoardConnectorLabelPathPoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
15
+ export declare function resolveBoardConnectorLabelRect(points: readonly IBoardConnectorPoint[], label: IBoardConnectorData['label'] | IBoardConnectorLabel): IBoardConnectorLabelRect;
16
+ export declare function resolveBoardConnectorLabelDragUpdate(points: readonly IBoardConnectorPoint[], label: IBoardConnectorLabel, point: IBoardConnectorPoint): IBoardConnectorLabel;
17
+ export declare function resolveBoardConnectorLabelSnapUpdate(points: readonly IBoardConnectorPoint[], label: IBoardConnectorLabel): IBoardConnectorLabel;
@@ -0,0 +1,17 @@
1
+ import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { BoardConnectorPathCommand } from './board-connector-routing.util';
3
+ export interface IBoardConnectorMarkerAnchor {
4
+ point: IBoardConnectorPoint;
5
+ tangent: IBoardConnectorPoint;
6
+ }
7
+ export interface IBoardConnectorMarkerAnchors {
8
+ start: IBoardConnectorMarkerAnchor;
9
+ end: IBoardConnectorMarkerAnchor;
10
+ }
11
+ export interface IResolveBoardConnectorMarkerAnchorsOptions {
12
+ connectorData?: IBoardConnectorData;
13
+ elementData?: Record<string, IBoardElementData>;
14
+ endpointGap?: number;
15
+ }
16
+ export declare const BOARD_CONNECTOR_ENDPOINT_VISUAL_GAP = 5;
17
+ export declare function resolveBoardConnectorMarkerAnchors(routing: string, points: readonly IBoardConnectorPoint[], pathCommands: readonly BoardConnectorPathCommand[], options?: IResolveBoardConnectorMarkerAnchorsOptions): IBoardConnectorMarkerAnchors | null;
@@ -0,0 +1,13 @@
1
+ import type { IBoardConnectorMarker, IBoardConnectorPoint } from '@univerjs-pro/boards';
2
+ import type { UniverRenderingContext } from '@univerjs/engine-render';
3
+ export declare const BOARD_CONNECTOR_DEFAULT_MARKER_SIZE = 12;
4
+ export declare const BOARD_CONNECTOR_DEFAULT_MARKER_COLOR = "#1f2937";
5
+ export declare function resolveBoardConnectorMarkerSize(marker: IBoardConnectorMarker, strokeWidth: number): number;
6
+ export declare function getBoardConnectorMarkerTrim(marker: IBoardConnectorMarker | undefined, strokeWidth: number): number;
7
+ export declare function hitTestBoardConnectorMarker(marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, markerPoint: IBoardConnectorPoint, tangent: IBoardConnectorPoint, style: {
8
+ strokeWidth: number;
9
+ }): boolean;
10
+ export declare function drawBoardConnectorMarker(ctx: UniverRenderingContext, marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, tangent: IBoardConnectorPoint, style: {
11
+ stroke: string;
12
+ strokeWidth: number;
13
+ }): void;
@@ -0,0 +1,8 @@
1
+ import type { IBoardConnectorElement, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ export interface IResolveBoardConnectorMoveUpdateOptions {
3
+ element: IBoardConnectorElement;
4
+ delta: IBoardConnectorPoint;
5
+ elementData?: Record<string, IBoardElementData>;
6
+ }
7
+ export declare function canMoveBoardConnectorBody(element: IBoardConnectorElement): boolean;
8
+ export declare function resolveBoardConnectorMoveUpdate(options: IResolveBoardConnectorMoveUpdateOptions): IBoardConnectorElement;
@@ -0,0 +1,22 @@
1
+ import type { BoardConnectorRouting, IBoardConnectorElement, IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardConnectorStyle, IBoardElementData, IBoardShapeElement } from '@univerjs-pro/boards';
2
+ import { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
3
+ export declare const BOARD_QUICK_CONNECT_GAP = 200;
4
+ export interface ICreateBoardConnectorQuickConnectElementsOptions {
5
+ sourceEndpoint: IBoardConnectorEndpoint;
6
+ sourcePoint: IBoardConnectorPoint;
7
+ normal: IBoardConnectorPoint;
8
+ routing: BoardConnectorRouting;
9
+ style: IBoardConnectorStyle;
10
+ targetPoint?: IBoardConnectorPoint;
11
+ shapeType?: ShapeTypeEnum | string;
12
+ sourceSize?: {
13
+ width?: number;
14
+ height?: number;
15
+ };
16
+ elementData?: Record<string, IBoardElementData>;
17
+ }
18
+ export interface ICreateBoardConnectorQuickConnectElementsResult {
19
+ shape: IBoardShapeElement;
20
+ connector: IBoardConnectorElement;
21
+ }
22
+ export declare function createBoardConnectorQuickConnectElements(options: ICreateBoardConnectorQuickConnectElementsOptions): ICreateBoardConnectorQuickConnectElementsResult;
@@ -0,0 +1,11 @@
1
+ import type { IBoardConnectorData, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
2
+ import type { IBoardConnectorRouteBounds, IResolveBoardConnectorRoutePointsOptions } from './board-connector-routing.util';
3
+ export interface IResolveBoardConnectorRenderBoundsOptions {
4
+ elementData?: Record<string, IBoardElementData>;
5
+ connectorId?: string;
6
+ fallbackTransform?: IBoardElementTransform;
7
+ stabilityHint?: IResolveBoardConnectorRoutePointsOptions['stabilityHint'];
8
+ }
9
+ export declare function expandBoardConnectorBounds(bounds: IBoardConnectorRouteBounds, padding: number): IBoardConnectorRouteBounds;
10
+ export declare function resolveBoardConnectorMarkerBoundsPadding(connectorData: IBoardConnectorData): number;
11
+ export declare function resolveBoardConnectorRenderBounds(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRenderBoundsOptions): IBoardConnectorRouteBounds;
@@ -0,0 +1,62 @@
1
+ import type { IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ export interface IBoardRoutingRect {
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export interface IBoardRoutingSegment {
9
+ start: IBoardConnectorPoint;
10
+ end: IBoardConnectorPoint;
11
+ }
12
+ export type BoardRoutingObstacleKind = 'shape' | 'image' | 'table' | 'container' | 'generic';
13
+ export interface IBoardRoutingObstacle {
14
+ id: string;
15
+ bounds: IBoardRoutingRect;
16
+ polygon?: IBoardConnectorPoint[];
17
+ clearance: number;
18
+ kind: BoardRoutingObstacleKind;
19
+ }
20
+ export interface IBoardRoutingPenaltyContext {
21
+ obstacles: readonly IBoardRoutingObstacle[];
22
+ searchRect: IBoardRoutingRect;
23
+ }
24
+ export interface IBoardRoutingGuideCoordinates {
25
+ xs?: readonly number[];
26
+ ys?: readonly number[];
27
+ }
28
+ export interface IBoardRoutingPenaltyProvider {
29
+ priority?: 'avoid' | 'soft';
30
+ scoreSegment(segment: IBoardRoutingSegment, context: IBoardRoutingPenaltyContext): number;
31
+ getGuideCoordinates?(context: IBoardRoutingPenaltyContext): IBoardRoutingGuideCoordinates;
32
+ }
33
+ export interface ICreateBoardConnectorRoutingObstaclesOptions {
34
+ clearance?: number;
35
+ excludeElementIds?: readonly string[];
36
+ }
37
+ export interface IBoardRoutingObstacleIndex {
38
+ obstacles: readonly IBoardRoutingObstacle[];
39
+ version: string;
40
+ query(bounds: IBoardRoutingRect): IBoardRoutingObstacle[];
41
+ }
42
+ export interface IResolveBoardOrthogonalObstacleRouteOptions {
43
+ start: IBoardConnectorPoint;
44
+ end: IBoardConnectorPoint;
45
+ preferredStartAxis?: 'horizontal' | 'vertical' | null;
46
+ preferredEndAxis?: 'horizontal' | 'vertical' | null;
47
+ obstacles?: readonly IBoardRoutingObstacle[];
48
+ obstacleIndex?: IBoardRoutingObstacleIndex;
49
+ maxGraphNodes?: number;
50
+ searchPadding?: number;
51
+ penaltyProviders?: readonly IBoardRoutingPenaltyProvider[];
52
+ stabilityHint?: {
53
+ routePoints: readonly IBoardConnectorPoint[];
54
+ penalty?: number;
55
+ tolerance?: number;
56
+ };
57
+ fallbackRoute?: () => IBoardConnectorPoint[];
58
+ }
59
+ export declare function createBoardConnectorRoutingObstacleIndex(elementData: Record<string, IBoardElementData> | undefined, options?: ICreateBoardConnectorRoutingObstaclesOptions): IBoardRoutingObstacleIndex;
60
+ export declare function isBoardRoutingPointInsideObstacle(point: IBoardConnectorPoint, obstacle: IBoardRoutingObstacle): boolean;
61
+ export declare function doesBoardRoutingSegmentIntersectObstacle(segment: IBoardRoutingSegment, obstacle: IBoardRoutingObstacle): boolean;
62
+ export declare function resolveBoardOrthogonalObstacleRoute(options: IResolveBoardOrthogonalObstacleRouteOptions): IBoardConnectorPoint[];
@@ -0,0 +1,53 @@
1
+ import type { IBoardConnectorData, IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
2
+ import type { IBoardRoutingSegment } from './board-connector-router.util';
3
+ export interface IBoardConnectorRouteBounds {
4
+ left: number;
5
+ top: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface IBoardConnectorResolvedEndpoint {
10
+ point: IBoardConnectorPoint;
11
+ normal?: IBoardConnectorPoint;
12
+ boundShapeId?: string;
13
+ }
14
+ export type BoardConnectorPathCommand = {
15
+ type: 'moveTo';
16
+ point: IBoardConnectorPoint;
17
+ } | {
18
+ type: 'lineTo';
19
+ point: IBoardConnectorPoint;
20
+ } | {
21
+ type: 'bezierCurveTo';
22
+ control1: IBoardConnectorPoint;
23
+ control2: IBoardConnectorPoint;
24
+ point: IBoardConnectorPoint;
25
+ };
26
+ export interface IResolveBoardConnectorEndpointPointOptions {
27
+ elementData?: Record<string, IBoardElementData>;
28
+ connectorId?: string;
29
+ }
30
+ export interface IResolveBoardConnectorEndpointOptions extends IResolveBoardConnectorEndpointPointOptions {
31
+ }
32
+ export interface IResolveBoardConnectorRoutePointsOptions extends IResolveBoardConnectorEndpointPointOptions {
33
+ stabilityHint?: {
34
+ routePoints: readonly IBoardConnectorPoint[];
35
+ penalty?: number;
36
+ tolerance?: number;
37
+ };
38
+ resolvedRoutePoints?: readonly IBoardConnectorPoint[];
39
+ }
40
+ export declare const BOARD_CONNECTOR_MIN_BOUNDS_SIZE = 1;
41
+ export declare function resolveBoardConnectorEndpointPoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointPointOptions): IBoardConnectorPoint | null;
42
+ export declare function resolveBoardConnectorEndpoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorResolvedEndpoint | null;
43
+ export declare function isBoardConnectorTerminalSegmentAlignedWithEndpointNormal(segment: IBoardRoutingSegment, endpoint: IBoardConnectorResolvedEndpoint, terminal: 'start' | 'end'): boolean;
44
+ export declare function isBoardConnectorRouteAlignedWithEndpoints(connectorData: IBoardConnectorData, routePoints: readonly IBoardConnectorPoint[] | undefined, options?: IResolveBoardConnectorEndpointPointOptions): routePoints is readonly IBoardConnectorPoint[];
45
+ export declare function normalizeBoardConnectorEndpointManualRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorData;
46
+ export declare function resolveBoardConnectorRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
47
+ export declare function resolveBoardConnectorPathCommands(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): BoardConnectorPathCommand[];
48
+ export declare function resolveBoardConnectorPathBounds(commands: readonly BoardConnectorPathCommand[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
49
+ export declare function trimBoardConnectorPathCommands(commands: readonly BoardConnectorPathCommand[], startTrim: number, endTrim: number): BoardConnectorPathCommand[];
50
+ export declare function hitTestBoardConnectorPath(point: IBoardConnectorPoint, commands: readonly BoardConnectorPathCommand[], tolerance: number): boolean;
51
+ export declare function resolveBoardConnectorRouteBounds(points: readonly IBoardConnectorPoint[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
52
+ export declare function distanceToBoardConnectorSegment(point: IBoardConnectorPoint, start: IBoardConnectorPoint, end: IBoardConnectorPoint): number;
53
+ export declare function trimBoardConnectorRoute(points: readonly IBoardConnectorPoint[], startTrim: number, endTrim: number): IBoardConnectorPoint[];
@@ -0,0 +1,10 @@
1
+ import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardSelectionContext } from '../services/board-element-state.service';
3
+ export interface IResolveSelectedBoardConnectorDataOptions {
4
+ currentUnitId: string | null | undefined;
5
+ context: IBoardSelectionContext | null;
6
+ selectedIds: readonly string[];
7
+ focusedId: string | null;
8
+ getElementById: (unitId: string, subUnitId: string, elementId: string) => IBoardElementData | null | undefined;
9
+ }
10
+ export declare function resolveSelectedBoardConnectorData(options: IResolveSelectedBoardConnectorDataOptions): IBoardElementData | null;
@@ -0,0 +1,10 @@
1
+ import type { IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardConnectorBoundarySnap } from './board-connector-snap.util';
3
+ export interface IBoardConnectorSnapHighlight {
4
+ elementId: string;
5
+ point: IBoardConnectorPoint;
6
+ normal: IBoardConnectorPoint;
7
+ segmentStart: IBoardConnectorPoint;
8
+ segmentEnd: IBoardConnectorPoint;
9
+ }
10
+ export declare function resolveBoardConnectorSnapHighlight(snap: IBoardConnectorBoundarySnap | null | undefined, elementData: Record<string, IBoardElementData>): IBoardConnectorSnapHighlight | null;
@@ -0,0 +1,25 @@
1
+ import type { IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ export interface IBoardConnectorBoundarySnap {
3
+ endpoint: IBoardConnectorEndpoint;
4
+ point: IBoardConnectorPoint;
5
+ normal: IBoardConnectorPoint;
6
+ distance: number;
7
+ elementId: string;
8
+ }
9
+ export interface IResolveBoardConnectorBoundarySnapOptions {
10
+ point: IBoardConnectorPoint;
11
+ elementData: Record<string, IBoardElementData>;
12
+ threshold: number;
13
+ candidateElementIds?: readonly string[];
14
+ excludeElementIds?: readonly string[];
15
+ preferredElementId?: string | null;
16
+ hysteresisThreshold?: number;
17
+ }
18
+ export interface IIsBoardConnectorBoundarySnapCandidateOptions {
19
+ point: IBoardConnectorPoint;
20
+ elementDataItem: IBoardElementData;
21
+ elementData?: Record<string, IBoardElementData>;
22
+ threshold: number;
23
+ }
24
+ export declare function isBoardConnectorBoundarySnapCandidate(options: IIsBoardConnectorBoundarySnapCandidateOptions): boolean;
25
+ export declare function resolveBoardConnectorBoundarySnap(options: IResolveBoardConnectorBoundarySnapOptions): IBoardConnectorBoundarySnap | null;