@motifx-community/ui 0.1.0-beta.14 → 0.1.0-beta.16

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 (330) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +2 -2
  3. package/dist/components/diagram/Diagram.d.ts +607 -0
  4. package/dist/components/diagram/DiagramAutoPan.d.ts +17 -0
  5. package/dist/components/diagram/DiagramBends.d.ts +70 -0
  6. package/dist/components/diagram/DiagramDragging.d.ts +66 -0
  7. package/dist/components/diagram/DiagramEdgeView.d.ts +78 -0
  8. package/dist/components/diagram/DiagramGrid.d.ts +13 -0
  9. package/dist/components/diagram/DiagramHistory.d.ts +16 -0
  10. package/dist/components/diagram/DiagramLinks.d.ts +177 -0
  11. package/dist/components/diagram/DiagramMap.d.ts +62 -0
  12. package/dist/components/diagram/DiagramNodeView.d.ts +143 -0
  13. package/dist/components/diagram/DiagramOverview.d.ts +20 -0
  14. package/dist/components/diagram/DiagramPanning.d.ts +34 -0
  15. package/dist/components/diagram/diagram-alignment.d.ts +2 -0
  16. package/dist/components/diagram/diagram-auto-pan-host.d.ts +8 -0
  17. package/dist/components/diagram/diagram-background.d.ts +2 -0
  18. package/dist/components/diagram/diagram-bends-host.d.ts +17 -0
  19. package/dist/components/diagram/diagram-card-kind.d.ts +42 -0
  20. package/dist/components/diagram/diagram-card-node.d.ts +11 -0
  21. package/dist/components/diagram/diagram-center-options.d.ts +6 -0
  22. package/dist/components/diagram/diagram-change.d.ts +11 -0
  23. package/dist/components/diagram/diagram-class-member.d.ts +13 -0
  24. package/dist/components/diagram/diagram-class-node.d.ts +12 -0
  25. package/dist/components/diagram/diagram-column-checked-event-args.d.ts +9 -0
  26. package/dist/components/diagram/diagram-connected-event-args.d.ts +6 -0
  27. package/dist/components/diagram/diagram-connecting-event-args.d.ts +9 -0
  28. package/dist/components/diagram/diagram-connection.d.ts +7 -0
  29. package/dist/components/diagram/diagram-data.d.ts +12 -0
  30. package/dist/components/diagram/diagram-deleted-event-args.d.ts +8 -0
  31. package/dist/components/diagram/diagram-deleting-event-args.d.ts +9 -0
  32. package/dist/components/diagram/diagram-dragging-host.d.ts +47 -0
  33. package/dist/components/diagram/diagram-drawn-node.d.ts +10 -0
  34. package/dist/components/diagram/diagram-edge-end.d.ts +2 -0
  35. package/dist/components/diagram/diagram-edge-path.d.ts +5 -0
  36. package/dist/components/diagram/diagram-edge-reshaped-event-args.d.ts +8 -0
  37. package/dist/components/diagram/diagram-edge-reshaping-event-args.d.ts +6 -0
  38. package/dist/components/diagram/diagram-edge.d.ts +49 -0
  39. package/dist/components/diagram/diagram-edit.d.ts +10 -0
  40. package/dist/components/diagram/diagram-export-options.d.ts +14 -0
  41. package/dist/components/diagram/diagram-export.d.ts +28 -0
  42. package/dist/components/diagram/diagram-fit-options.d.ts +12 -0
  43. package/dist/components/diagram/diagram-history-changed-event-args.d.ts +14 -0
  44. package/dist/components/diagram/diagram-history-step.d.ts +9 -0
  45. package/dist/components/diagram/diagram-kinds.d.ts +9 -0
  46. package/dist/components/diagram/diagram-layered.d.ts +39 -0
  47. package/dist/components/diagram/diagram-layout-direction.d.ts +2 -0
  48. package/dist/components/diagram/diagram-layout-options.d.ts +24 -0
  49. package/dist/components/diagram/diagram-layout-type.d.ts +5 -0
  50. package/dist/components/diagram/diagram-layout.d.ts +33 -0
  51. package/dist/components/diagram/diagram-line-look.d.ts +6 -0
  52. package/dist/components/diagram/diagram-line.d.ts +11 -0
  53. package/dist/components/diagram/diagram-links-host.d.ts +45 -0
  54. package/dist/components/diagram/diagram-links-options.d.ts +7 -0
  55. package/dist/components/diagram/diagram-map-props.d.ts +10 -0
  56. package/dist/components/diagram/diagram-map-target.d.ts +27 -0
  57. package/dist/components/diagram/diagram-marker.d.ts +6 -0
  58. package/dist/components/diagram/diagram-mini-map-options.d.ts +13 -0
  59. package/dist/components/diagram/diagram-mini-map-position.d.ts +2 -0
  60. package/dist/components/diagram/diagram-node-context.d.ts +26 -0
  61. package/dist/components/diagram/diagram-node-host.d.ts +23 -0
  62. package/dist/components/diagram/diagram-node-kind.d.ts +43 -0
  63. package/dist/components/diagram/diagram-node-move.d.ts +11 -0
  64. package/dist/components/diagram/diagram-node-resized-event-args.d.ts +8 -0
  65. package/dist/components/diagram/diagram-node-resizing-event-args.d.ts +6 -0
  66. package/dist/components/diagram/diagram-node-size.d.ts +8 -0
  67. package/dist/components/diagram/diagram-node-status.d.ts +2 -0
  68. package/dist/components/diagram/diagram-node-toggled-event-args.d.ts +7 -0
  69. package/dist/components/diagram/diagram-node.d.ts +56 -0
  70. package/dist/components/diagram/diagram-nodes-moved-event-args.d.ts +6 -0
  71. package/dist/components/diagram/diagram-nodes-moving-event-args.d.ts +6 -0
  72. package/dist/components/diagram/diagram-panning-host.d.ts +19 -0
  73. package/dist/components/diagram/diagram-pasted-event-args.d.ts +7 -0
  74. package/dist/components/diagram/diagram-pasting-event-args.d.ts +11 -0
  75. package/dist/components/diagram/diagram-path-ends.d.ts +11 -0
  76. package/dist/components/diagram/diagram-path-result.d.ts +6 -0
  77. package/dist/components/diagram/diagram-paths.d.ts +35 -0
  78. package/dist/components/diagram/diagram-point.d.ts +5 -0
  79. package/dist/components/diagram/diagram-port-place.d.ts +9 -0
  80. package/dist/components/diagram/diagram-port.d.ts +27 -0
  81. package/dist/components/diagram/diagram-props.d.ts +159 -0
  82. package/dist/components/diagram/diagram-reconnected-event-args.d.ts +10 -0
  83. package/dist/components/diagram/diagram-reconnecting-event-args.d.ts +11 -0
  84. package/dist/components/diagram/diagram-rect.d.ts +7 -0
  85. package/dist/components/diagram/diagram-resize-side.d.ts +2 -0
  86. package/dist/components/diagram/diagram-route.d.ts +10 -0
  87. package/dist/components/diagram/diagram-selection-changed-event-args.d.ts +9 -0
  88. package/dist/components/diagram/diagram-selection.d.ts +5 -0
  89. package/dist/components/diagram/diagram-side.d.ts +2 -0
  90. package/dist/components/diagram/diagram-table-column.d.ts +13 -0
  91. package/dist/components/diagram/diagram-table-node.d.ts +12 -0
  92. package/dist/components/diagram/diagram-tree.d.ts +14 -0
  93. package/dist/components/diagram/diagram-viewport-changed-event-args.d.ts +8 -0
  94. package/dist/components/diagram/diagram-viewport-options.d.ts +5 -0
  95. package/dist/components/diagram/diagram-viewport.d.ts +6 -0
  96. package/dist/components/diagram/index.d.ts +65 -0
  97. package/dist/components/diagram/swallow-next-click.d.ts +5 -0
  98. package/dist/components/expressioneditor/ExpressionEditor.d.ts +111 -0
  99. package/dist/components/expressioneditor/expression-editor-props.d.ts +24 -0
  100. package/dist/components/expressioneditor/index.d.ts +2 -0
  101. package/dist/components/formlayout/FormLayout.d.ts +10 -3
  102. package/dist/components/formlayout/form-editor-type.d.ts +1 -1
  103. package/dist/components/formlayout/form-item.d.ts +4 -1
  104. package/dist/components/formlayout/form-layout-props.d.ts +1 -1
  105. package/dist/components/formlayout/index.d.ts +1 -0
  106. package/dist/components/formlayout/schema-items.d.ts +26 -0
  107. package/dist/components/pivotgrid/model/PivotAxisWindow.d.ts +53 -1
  108. package/dist/components/pivotgrid/model/PivotCellWindow.d.ts +2 -0
  109. package/dist/components/pivotgrid/model/PivotWindows.d.ts +3 -6
  110. package/dist/components/toolbar/Toolbar.d.ts +5 -3
  111. package/dist/core/control.d.ts +2 -0
  112. package/dist/core/keyboard.d.ts +5 -0
  113. package/dist/core/measure/index.d.ts +2 -0
  114. package/dist/core/measure/picture.d.ts +27 -0
  115. package/dist/core/shortcut-options.d.ts +5 -2
  116. package/dist/core/ui-strings.d.ts +191 -0
  117. package/dist/generated/tokens.d.ts +1615 -0
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +11501 -705
  120. package/dist/index.js.map +1 -1
  121. package/dist/locales/en.json +180 -1
  122. package/dist/locales/tr.json +180 -1
  123. package/dist/styles.css +2262 -3
  124. package/dist/tokens/index.d.ts +1615 -0
  125. package/dist/tokens/index.js +1615 -0
  126. package/dist/tokens/index.js.map +1 -1
  127. package/dist/{tr-BGbF9uCs.js → tr-4GNbFdQh.js} +361 -3
  128. package/dist/{tr-BGbF9uCs.js.map → tr-4GNbFdQh.js.map} +1 -1
  129. package/docs/accordion.md +1 -1
  130. package/docs/actionsheet.md +1 -1
  131. package/docs/appbar.md +1 -1
  132. package/docs/appmenu-api.md +1 -1
  133. package/docs/appmenu-programmatic.md +1 -1
  134. package/docs/appmenu-search.md +1 -1
  135. package/docs/appmenu.md +1 -1
  136. package/docs/avatar.md +1 -1
  137. package/docs/badge.md +1 -1
  138. package/docs/bar-gauge-angles.md +1 -1
  139. package/docs/bar-gauge-data.md +1 -1
  140. package/docs/bar-gauge-labels.md +1 -1
  141. package/docs/bar-gauge.md +1 -1
  142. package/docs/barcode.md +1 -1
  143. package/docs/bottomnavigation.md +1 -1
  144. package/docs/bottomsheet.md +1 -1
  145. package/docs/breadcrumb.md +1 -1
  146. package/docs/button.md +1 -1
  147. package/docs/buttongroup.md +1 -1
  148. package/docs/buttons.md +1 -1
  149. package/docs/calendar.md +1 -1
  150. package/docs/card.md +1 -1
  151. package/docs/chart-bars.md +1 -1
  152. package/docs/chart-candles.md +1 -1
  153. package/docs/chart-funnel.md +1 -1
  154. package/docs/chart-heatmap.md +1 -1
  155. package/docs/chart-lines.md +1 -1
  156. package/docs/chart-live.md +1 -1
  157. package/docs/chart-pie.md +1 -1
  158. package/docs/chart-radar.md +1 -1
  159. package/docs/chart-ranges.md +1 -1
  160. package/docs/chart-references.md +1 -1
  161. package/docs/chart-scatter.md +1 -1
  162. package/docs/chart-waterfall.md +1 -1
  163. package/docs/chart-zoom.md +1 -1
  164. package/docs/chart.md +1 -1
  165. package/docs/chat.md +1 -1
  166. package/docs/checkbox.md +1 -1
  167. package/docs/chip.md +1 -1
  168. package/docs/choice.md +1 -1
  169. package/docs/colorbox.md +1 -1
  170. package/docs/combobox.md +1 -1
  171. package/docs/commands.md +1 -1
  172. package/docs/control.md +1 -1
  173. package/docs/data.md +2 -2
  174. package/docs/datagrid-api.md +1 -1
  175. package/docs/datagrid-bands.md +1 -1
  176. package/docs/datagrid-drag-select.md +1 -1
  177. package/docs/datagrid-drag.md +1 -1
  178. package/docs/datagrid-editing.md +1 -1
  179. package/docs/datagrid-filtering.md +1 -1
  180. package/docs/datagrid-forms.md +1 -1
  181. package/docs/datagrid-grouping.md +1 -1
  182. package/docs/datagrid-layout.md +1 -1
  183. package/docs/datagrid-lookups.md +1 -1
  184. package/docs/datagrid-master-detail.md +1 -1
  185. package/docs/datagrid-scrolling.md +1 -1
  186. package/docs/datagrid-selection.md +1 -1
  187. package/docs/datagrid.md +1 -1
  188. package/docs/datalayer-api.md +491 -0
  189. package/docs/datalayer-changes.md +501 -0
  190. package/docs/datalayer-odata.md +998 -0
  191. package/docs/datalayer-pivot.md +850 -0
  192. package/docs/datalayer-queries.md +516 -0
  193. package/docs/datalayer-rest.md +529 -0
  194. package/docs/datalayer-soap.md +576 -0
  195. package/docs/datalayer-source.md +464 -0
  196. package/docs/datalayer.md +264 -0
  197. package/docs/datebox.md +1 -1
  198. package/docs/daterangebox.md +1 -1
  199. package/docs/diagram-api.md +200 -0
  200. package/docs/diagram-commands.md +79 -0
  201. package/docs/diagram-connections.md +157 -0
  202. package/docs/diagram-custom-nodes.md +325 -0
  203. package/docs/diagram-designer.md +816 -0
  204. package/docs/diagram-editing.md +62 -0
  205. package/docs/diagram-flow.md +157 -0
  206. package/docs/diagram-keyboard.md +58 -0
  207. package/docs/diagram-layout.md +354 -0
  208. package/docs/diagram-nodes.md +206 -0
  209. package/docs/diagram-tables.md +212 -0
  210. package/docs/diagram.md +217 -0
  211. package/docs/display.md +1 -1
  212. package/docs/draggable.md +1 -1
  213. package/docs/drawer.md +1 -1
  214. package/docs/dropdown.md +1 -1
  215. package/docs/editors.md +1 -1
  216. package/docs/expressioneditor.md +469 -0
  217. package/docs/expressions.md +431 -0
  218. package/docs/feedback.md +1 -1
  219. package/docs/fileuploader.md +1 -1
  220. package/docs/filterbuilder.md +1 -1
  221. package/docs/formlayout-schema.md +143 -0
  222. package/docs/formlayout.md +16 -4
  223. package/docs/foundations.md +1 -1
  224. package/docs/gallery.md +1 -1
  225. package/docs/gauge-base.md +1 -1
  226. package/docs/gauge-circular.md +1 -1
  227. package/docs/gauge-dashboards.md +1 -1
  228. package/docs/gauge-linear.md +1 -1
  229. package/docs/gauge-markers.md +1 -1
  230. package/docs/gauge-marks.md +1 -1
  231. package/docs/gauge-ranges.md +1 -1
  232. package/docs/gauge-scales.md +1 -1
  233. package/docs/gauge.md +1 -1
  234. package/docs/home.md +1 -1
  235. package/docs/keyboard.md +2 -2
  236. package/docs/language.md +1 -1
  237. package/docs/layout.md +1 -1
  238. package/docs/listbox.md +1 -1
  239. package/docs/loadpanel.md +1 -1
  240. package/docs/lookup.md +1 -1
  241. package/docs/markdown.md +1 -1
  242. package/docs/menus-api.md +1 -1
  243. package/docs/menus-context.md +1 -1
  244. package/docs/menus-customization.md +1 -1
  245. package/docs/menus-merging.md +1 -1
  246. package/docs/menus-programmatic.md +1 -1
  247. package/docs/menus.md +1 -1
  248. package/docs/multiview.md +1 -1
  249. package/docs/navigation.md +1 -1
  250. package/docs/numberbox.md +1 -1
  251. package/docs/otpinput.md +1 -1
  252. package/docs/pagination.md +1 -1
  253. package/docs/pivotgrid-api.md +1 -1
  254. package/docs/pivotgrid-chart.md +1 -1
  255. package/docs/pivotgrid-drilldown.md +1 -1
  256. package/docs/pivotgrid-export.md +1 -1
  257. package/docs/pivotgrid-fields.md +1 -1
  258. package/docs/pivotgrid-keyboard.md +1 -1
  259. package/docs/pivotgrid-layout.md +1 -1
  260. package/docs/pivotgrid-panel.md +1 -1
  261. package/docs/pivotgrid-remote.md +122 -44
  262. package/docs/pivotgrid-sorting.md +3 -3
  263. package/docs/pivotgrid-state.md +1 -1
  264. package/docs/pivotgrid-summaries.md +1 -1
  265. package/docs/pivotgrid.md +1 -1
  266. package/docs/popover.md +1 -1
  267. package/docs/progress.md +1 -1
  268. package/docs/qrcode.md +1 -1
  269. package/docs/radiogroup.md +1 -1
  270. package/docs/rating.md +1 -1
  271. package/docs/resizable.md +1 -1
  272. package/docs/ribbonmenu-api.md +1 -1
  273. package/docs/ribbonmenu-commands.md +1 -1
  274. package/docs/ribbonmenu-customization.md +1 -1
  275. package/docs/ribbonmenu-display.md +1 -1
  276. package/docs/ribbonmenu-layouts.md +1 -1
  277. package/docs/ribbonmenu-programmatic.md +1 -1
  278. package/docs/ribbonmenu.md +1 -1
  279. package/docs/scheduler-agenda.md +1 -1
  280. package/docs/scheduler-big-data.md +1 -1
  281. package/docs/scheduler-editing.md +1 -1
  282. package/docs/scheduler-form.md +1 -1
  283. package/docs/scheduler-icalendar.md +1 -1
  284. package/docs/scheduler-mobile.md +1 -1
  285. package/docs/scheduler-recurrence.md +1 -1
  286. package/docs/scheduler-resources.md +1 -1
  287. package/docs/scheduler-timeline.md +1 -1
  288. package/docs/scheduler.md +1 -1
  289. package/docs/scrollview.md +1 -1
  290. package/docs/shortcuteditor.md +1 -1
  291. package/docs/showcase-flowstudio.md +61 -0
  292. package/docs/showcase-home.md +1 -1
  293. package/docs/showcase-mail.md +1 -1
  294. package/docs/showcase.md +1 -1
  295. package/docs/signature.md +1 -1
  296. package/docs/skeleton.md +1 -1
  297. package/docs/slider.md +1 -1
  298. package/docs/sortable.md +1 -1
  299. package/docs/sparkline.md +1 -1
  300. package/docs/speeddial.md +1 -1
  301. package/docs/splitter.md +1 -1
  302. package/docs/stepper.md +1 -1
  303. package/docs/switch.md +1 -1
  304. package/docs/tabdocs-dock.md +1 -1
  305. package/docs/tabdocs-drag.md +1 -1
  306. package/docs/tabdocs-menus.md +1 -1
  307. package/docs/tabdocs-mobile.md +1 -1
  308. package/docs/tabdocs-tabs.md +1 -1
  309. package/docs/tabdocs-windows.md +1 -1
  310. package/docs/tabdocs-workspace.md +1 -1
  311. package/docs/tabdocs.md +1 -1
  312. package/docs/tabs.md +1 -1
  313. package/docs/tagbox.md +1 -1
  314. package/docs/textarea.md +1 -1
  315. package/docs/textbox.md +1 -1
  316. package/docs/tileview.md +1 -1
  317. package/docs/timeline.md +1 -1
  318. package/docs/toast.md +1 -1
  319. package/docs/tokens.md +324 -1
  320. package/docs/toolbar-api.md +1 -1
  321. package/docs/toolbar-customization.md +1 -1
  322. package/docs/toolbar.md +1 -1
  323. package/docs/tooltip.md +1 -1
  324. package/docs/treeview.md +1 -1
  325. package/docs/validationsummary.md +1 -1
  326. package/docs/window.md +1 -1
  327. package/docs/wizard.md +1 -1
  328. package/llms-full.txt +10142 -462
  329. package/llms.txt +32 -1
  330. package/package.json +2 -2
@@ -0,0 +1,34 @@
1
+ import type { ComponentBase } from '@motifx/core';
2
+ import type { DiagramPanningHost } from './diagram-panning-host';
3
+ /**
4
+ * The user's panning and zooming with a pointer: a drag of the surface, the middle button anywhere, a drag anywhere
5
+ * while Space is held, one finger or two, and the wheel.
6
+ */
7
+ export declare class DiagramPanning {
8
+ private readonly surface;
9
+ private readonly host;
10
+ /** The pointers down, where they are now on the page. */
11
+ private readonly pointers;
12
+ /** The gesture under way: the view and the pointers as it began, and where the surface starts on the page. */
13
+ private gesture;
14
+ private stops;
15
+ private spaceHeld;
16
+ /** The wheel's turns since the last frame: a pan in pixels, a zoom factor and where the pointer was. */
17
+ private wheelTurns;
18
+ constructor(surface: ComponentBase, host: DiagramPanningHost);
19
+ pointerDown(e: PointerEvent): void;
20
+ get isSpaceHeld(): boolean;
21
+ /** Space held: a drag anywhere pans, on a node too. */
22
+ holdSpace(on: boolean): void;
23
+ wheel(e: WheelEvent): void;
24
+ dispose(): void;
25
+ private listen;
26
+ /** Starts the gesture again from the pointers down now, so a finger added or lifted does not make the view jump. */
27
+ private begin;
28
+ private pointerMove;
29
+ private pointerUp;
30
+ private end;
31
+ /** Where the inside of the surface starts on the page: the view is placed from there. */
32
+ private readonly readOrigin;
33
+ private readonly applyWheel;
34
+ }
@@ -0,0 +1,2 @@
1
+ /** How `Diagram.align` lines the selected nodes up: by their left, centre or right edges, or their top, middle or bottom ones. */
2
+ export type DiagramAlignment = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
@@ -0,0 +1,8 @@
1
+ import type { Size } from '../../core/measure';
2
+ import type { DiagramViewport } from './diagram-viewport';
3
+ /** What `DiagramAutoPan` asks of the diagram it pans. */
4
+ export interface DiagramAutoPanHost {
5
+ viewport(): DiagramViewport;
6
+ room(): Size;
7
+ move(viewport: DiagramViewport): void;
8
+ }
@@ -0,0 +1,2 @@
1
+ /** The marks drawn on the surface of a diagram, one at each step of its grid. */
2
+ export type DiagramBackground = 'dots' | 'lines' | 'cross' | 'none';
@@ -0,0 +1,17 @@
1
+ import type { DiagramAutoPanHost } from './diagram-auto-pan-host';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ import type { DiagramEdgeReshapedEventArgs } from './diagram-edge-reshaped-event-args';
4
+ import type { DiagramEdgeReshapingEventArgs } from './diagram-edge-reshaping-event-args';
5
+ import type { DiagramPoint } from './diagram-point';
6
+ import type { DiagramEdgeView } from './DiagramEdgeView';
7
+ /** What `DiagramBends` asks of the connections whose lines it reshapes; it pans the view while a drag nears an edge. */
8
+ export interface DiagramBendsHost<E extends DiagramEdge = DiagramEdge> extends DiagramAutoPanHost {
9
+ /** Where the inside of the surface starts on the page. */
10
+ origin(): DiagramPoint;
11
+ /** The step a point snaps to while it is dragged, or `null`. */
12
+ snapStep(): number | null;
13
+ /** The line changed: it is drawn again with the next frame. */
14
+ redraw(view: DiagramEdgeView<E>): void;
15
+ reshaping(e: DiagramEdgeReshapingEventArgs<E>): void;
16
+ reshaped(e: DiagramEdgeReshapedEventArgs<E>): void;
17
+ }
@@ -0,0 +1,42 @@
1
+ import type { IconSource } from '../../core/icon-source';
2
+ import type { DiagramCardNode } from './diagram-card-node';
3
+ import type { DiagramNode } from './diagram-node';
4
+ import type { DiagramNodeContext } from './diagram-node-context';
5
+ import type { DiagramNodeKind } from './diagram-node-kind';
6
+ /** What `cardKind` makes a kind of: the body of its own under the header, where its title and icon come from, and the kind's ports and look. */
7
+ export interface DiagramCardKindOptions<N extends DiagramNode = DiagramCardNode> {
8
+ /**
9
+ * Makes the body under the header, once per node, as a kind's `content` does: a component, a text, or parts added to
10
+ * `context.host`, which is the body here.
11
+ */
12
+ body?: (context: DiagramNodeContext<N>) => unknown;
13
+ /** Writes what changed in the body when the node is drawn again. */
14
+ update?: (context: DiagramNodeContext<N>) => void;
15
+ /** The icon of a node. Default: its `icon`. */
16
+ icon?: (node: N) => IconSource | undefined;
17
+ /** The line under the title. Default: its `subtitle`. */
18
+ subtitle?: (node: N) => string | undefined;
19
+ /** The ports of a node that names none of its own, as a kind's `ports`. */
20
+ ports?: DiagramNodeKind<N>['ports'];
21
+ /** Classes of every node of the kind, besides the card's own. */
22
+ cssClass?: string;
23
+ resizable?: boolean;
24
+ minWidth?: number;
25
+ minHeight?: number;
26
+ }
27
+ /**
28
+ * A kind of node to start one's own from: a header with an icon, the node's text as the title and a line under it, a
29
+ * body of the kind's own, and a row for each port on the left or the right that has a `label`, the port beside its row,
30
+ * the ways in on the left and the ways out on the right. A node's `status` shows on it as on any node. The `card` kind
31
+ * every diagram knows is `cardKind()`.
32
+ *
33
+ * @example
34
+ * const kinds = {
35
+ * decision: cardKind({
36
+ * icon: () => glyph('split'),
37
+ * ports: [{ id: 'in', side: 'left', direction: 'target' }, { id: 'yes', side: 'right', direction: 'source', label: 'Yes' }, { id: 'no', side: 'right', direction: 'source', label: 'No' }],
38
+ * body: (context) => <code>{() => context.node.condition}</code>,
39
+ * }),
40
+ * };
41
+ */
42
+ export declare function cardKind<N extends DiagramNode = DiagramCardNode>(options?: DiagramCardKindOptions<N>): DiagramNodeKind<N>;
@@ -0,0 +1,11 @@
1
+ import type { IconSource } from '../../core/icon-source';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /**
4
+ * A node of the `card` kind: a header with an icon, its text as the title and a line under it, and a row for each of
5
+ * its ports that has a `label`, the port beside its row.
6
+ */
7
+ export interface DiagramCardNode extends DiagramNode {
8
+ icon?: IconSource;
9
+ /** The line under the title, such as what the step does or what it is set to. */
10
+ subtitle?: string;
11
+ }
@@ -0,0 +1,6 @@
1
+ import type { DiagramViewportOptions } from './diagram-viewport-options';
2
+ /** How `Diagram.centerOn` brings a node or a point to the middle of the view. */
3
+ export interface DiagramCenterOptions extends DiagramViewportOptions {
4
+ /** The zoom to show it at; the current zoom by default. */
5
+ zoom?: number;
6
+ }
@@ -0,0 +1,11 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /**
4
+ * What a step of the history did: nodes moved or resized, a node collapsed, a connection made, moved or its line
5
+ * reshaped, items deleted or pasted, the nodes laid out, or a change the app made (`Diagram.record`).
6
+ */
7
+ export interface DiagramChange<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
8
+ readonly kind: 'move' | 'resize' | 'collapse' | 'connect' | 'reconnect' | 'reshape' | 'delete' | 'paste' | 'layout' | 'edit';
9
+ readonly nodes: readonly N[];
10
+ readonly edges: readonly E[];
11
+ }
@@ -0,0 +1,13 @@
1
+ /** A field or a method of a class node. */
2
+ export interface DiagramClassMember {
3
+ /** Its name; a method's with its parameters, such as `area()` or `scale(by: number)`. */
4
+ name: string;
5
+ /** Its type, or what a method returns: shown after a colon. */
6
+ type?: string;
7
+ /** Who sees it, shown before it: `+` public, `-` private, `#` protected, `~` package. Default: none shown. */
8
+ visibility?: 'public' | 'private' | 'protected' | 'package';
9
+ /** A member of the class rather than of each object: underlined. */
10
+ static?: boolean;
11
+ /** Abstract: slanted. */
12
+ abstract?: boolean;
13
+ }
@@ -0,0 +1,12 @@
1
+ import type { DiagramClassMember } from './diagram-class-member';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /** A node of the built-in `class` kind: its `text` is the class's name. */
4
+ export interface DiagramClassNode extends DiagramNode {
5
+ /** Shown over its name between guillemets, such as `interface` or `enumeration`. */
6
+ stereotype?: string;
7
+ /** An abstract class: its name slanted. */
8
+ abstract?: boolean;
9
+ /** Its fields and its methods, each in a compartment of its own. Changed in place, they are read on `refresh()`. */
10
+ attributes?: DiagramClassMember[];
11
+ methods?: DiagramClassMember[];
12
+ }
@@ -0,0 +1,9 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ import type { DiagramTableColumn } from './diagram-table-column';
3
+ /** Occurs after the box of a column of a table was ticked or cleared: its `checked` holds the new state. */
4
+ export interface DiagramColumnCheckedEventArgs<N extends DiagramNode = DiagramNode> {
5
+ readonly node: N;
6
+ readonly column: DiagramTableColumn;
7
+ readonly checked: boolean;
8
+ readonly byUser: boolean;
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ /** Occurs after a new connection was added to `edges`. */
3
+ export interface DiagramConnectedEventArgs<E extends DiagramEdge = DiagramEdge> {
4
+ readonly edge: E;
5
+ readonly byUser: boolean;
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { DiagramConnection } from './diagram-connection';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ /** Occurs before a new connection is added: change the fields of `edge` it adds, or `cancel` it. */
4
+ export interface DiagramConnectingEventArgs<E extends DiagramEdge = DiagramEdge> {
5
+ readonly connection: DiagramConnection;
6
+ edge: E;
7
+ readonly byUser: boolean;
8
+ cancel: boolean;
9
+ }
@@ -0,0 +1,7 @@
1
+ /** The two ends a connection joins: nodes by `id`, and their ports. */
2
+ export interface DiagramConnection {
3
+ source: string;
4
+ sourcePort?: string;
5
+ target: string;
6
+ targetPort?: string;
7
+ }
@@ -0,0 +1,12 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ import type { DiagramViewport } from './diagram-viewport';
4
+ /** What `Diagram.save` gives and `Diagram.load` takes: plain data, which `JSON.stringify` writes as it is. */
5
+ export interface DiagramData<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
6
+ /** The version of the form of the data; `save` writes `1`. */
7
+ version?: number;
8
+ nodes: N[];
9
+ edges?: E[];
10
+ /** The view: where it was, for a load that shows the diagram as it was saved. */
11
+ viewport?: DiagramViewport;
12
+ }
@@ -0,0 +1,8 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /** Occurs after nodes and connections were taken out of `nodes` and `edges`. */
4
+ export interface DiagramDeletedEventArgs<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
5
+ readonly nodes: readonly N[];
6
+ readonly edges: readonly E[];
7
+ readonly byUser: boolean;
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /** Occurs before nodes and connections are deleted: the connections of the nodes are among `edges`. `cancel` keeps them all. */
4
+ export interface DiagramDeletingEventArgs<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
5
+ readonly nodes: readonly N[];
6
+ readonly edges: readonly E[];
7
+ readonly byUser: boolean;
8
+ cancel: boolean;
9
+ }
@@ -0,0 +1,47 @@
1
+ import type { DiagramAutoPanHost } from './diagram-auto-pan-host';
2
+ import type { DiagramNode } from './diagram-node';
3
+ import type { DiagramNodeMove } from './diagram-node-move';
4
+ import type { DiagramNodeSize } from './diagram-node-size';
5
+ import type { DiagramNodeView } from './DiagramNodeView';
6
+ import type { DiagramPoint } from './diagram-point';
7
+ import type { DiagramRect } from './diagram-rect';
8
+ /** What `DiagramDragging` asks of the diagram whose nodes it moves and selects. */
9
+ export interface DiagramDraggingHost<N extends DiagramNode = DiagramNode> extends DiagramAutoPanHost {
10
+ /** Where the inside of the surface starts on the page. */
11
+ origin(): DiagramPoint;
12
+ views(): Iterable<DiagramNodeView<N>>;
13
+ /** Whether the user may drag the node now, and select it. */
14
+ canDrag(view: DiagramNodeView<N>): boolean;
15
+ canSelect(view: DiagramNodeView<N>): boolean;
16
+ /** Whether the user may select by dragging a rectangle. */
17
+ selectable(): boolean;
18
+ isSelected(view: DiagramNodeView<N>): boolean;
19
+ /** The selected nodes, in their order. */
20
+ selectedViews(): DiagramNodeView<N>[];
21
+ /** The selection now, by `id`, and a new one the user made. */
22
+ selection(): {
23
+ nodes: string[];
24
+ edges: string[];
25
+ };
26
+ select(nodes: string[], edges: string[]): void;
27
+ /** The step the nodes snap to while they are dragged, or `null`. */
28
+ snapStep(): number | null;
29
+ /** Whether a dragged node lines up with the others: it snaps to their edges and middles, and guides show it. */
30
+ guides(): boolean;
31
+ /** Draws the guides, an SVG path in the diagram's units; none for `null`. */
32
+ drawGuides(path: string | null): void;
33
+ /** Asks to start dragging the nodes; `false` when `onNodesMoving` cancels. */
34
+ moving(nodes: N[]): boolean;
35
+ /** The nodes inside a group, at every depth: they move with it. */
36
+ descendants(view: DiagramNodeView<N>): DiagramNodeView<N>[];
37
+ /** The group a node dragged with `moving` would be dropped into, where it is now; `null` for the surface. */
38
+ dropTarget(view: DiagramNodeView<N>, moving: ReadonlySet<DiagramNodeView<N>>): DiagramNodeView<N> | null;
39
+ /** Whether the user may resize the node now; asks `onNodeResizing` before a resize; tells it after. */
40
+ canResize(view: DiagramNodeView<N>): boolean;
41
+ resizing(node: N): boolean;
42
+ resized(node: N, from: DiagramRect, to: DiagramRect, given: DiagramNodeSize): void;
43
+ /** A node was put at a new place while it is dragged: its lines follow it. */
44
+ placed(view: DiagramNodeView<N>): void;
45
+ /** The nodes were dropped. */
46
+ moved(moves: DiagramNodeMove<N>[]): void;
47
+ }
@@ -0,0 +1,10 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ import type { DiagramRect } from './diagram-rect';
3
+ /** A node on the surface, as `Diagram.drawnNodes` gives it. */
4
+ export interface DiagramDrawnNode<N extends DiagramNode = DiagramNode> {
5
+ readonly node: N;
6
+ /** Its place and size in the diagram's units. */
7
+ readonly rect: DiagramRect;
8
+ /** Whether it holds other nodes: a group or a lane. */
9
+ readonly group: boolean;
10
+ }
@@ -0,0 +1,2 @@
1
+ /** An end of a connection. */
2
+ export type DiagramEdgeEnd = 'source' | 'target';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The shape of a connection's line. `step` and `rounded-step` turn at right angles the shortest way; `orthogonal` and
3
+ * `rounded-orthogonal` turn at right angles around the nodes in their way, with as few turns as they can.
4
+ */
5
+ export type DiagramEdgePath = 'straight' | 'curve' | 'step' | 'rounded-step' | 'orthogonal' | 'rounded-orthogonal';
@@ -0,0 +1,8 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramPoint } from './diagram-point';
3
+ /** Occurs after the user moved, added or removed points of a connection's line: its `points` hold the new ones. */
4
+ export interface DiagramEdgeReshapedEventArgs<E extends DiagramEdge = DiagramEdge> {
5
+ readonly edge: E;
6
+ /** The points it had before; `undefined` when it had none. */
7
+ readonly previous: readonly DiagramPoint[] | undefined;
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ /** Occurs when the user starts to move, add or remove a point of a connection's line; `cancel` keeps the line as it is. */
3
+ export interface DiagramEdgeReshapingEventArgs<E extends DiagramEdge = DiagramEdge> {
4
+ readonly edge: E;
5
+ cancel: boolean;
6
+ }
@@ -0,0 +1,49 @@
1
+ import type { DiagramEdgePath } from './diagram-edge-path';
2
+ import type { DiagramMarker } from './diagram-marker';
3
+ import type { DiagramPathEnds } from './diagram-path-ends';
4
+ import type { DiagramPathResult } from './diagram-path-result';
5
+ import type { DiagramPoint } from './diagram-point';
6
+ /** A connection between two nodes: the app's own object, kept and handed back as it is given. */
7
+ export interface DiagramEdge {
8
+ /** Unique among the connections. */
9
+ id: string;
10
+ /** The `id` of the node it starts at, and of the node it ends at. */
11
+ source: string;
12
+ target: string;
13
+ /** The ports it starts and ends at. Without one, the end takes the side, or the port, nearest the other node. */
14
+ sourcePort?: string;
15
+ targetPort?: string;
16
+ /** The shape of the line: the diagram's `edgePath` by default. A function draws a line of the app's own. */
17
+ path?: DiagramEdgePath | ((ends: DiagramPathEnds) => DiagramPathResult);
18
+ /**
19
+ * The points the line passes through, in the diagram's units, in order: the user adds, moves and removes them on a
20
+ * selected connection, and they move with the two nodes when both move. A right-angled line turns at them.
21
+ */
22
+ points?: DiagramPoint[];
23
+ /** The text in the middle of the line. */
24
+ label?: string;
25
+ /** The texts at its ends, beside the line by the node, such as how many rows or objects an end takes (`1`, `0..*`). */
26
+ sourceLabel?: string;
27
+ targetLabel?: string;
28
+ /** The marks at its ends. Default: none at the source, an arrow at the target. */
29
+ sourceMarker?: DiagramMarker;
30
+ targetMarker?: DiagramMarker;
31
+ /** A dashed line. */
32
+ dashed?: boolean;
33
+ /** A dashed line that moves from the source to the target. */
34
+ animated?: boolean;
35
+ /** `false` keeps its ends where they are. Default: `true`. */
36
+ reconnectable?: boolean;
37
+ /** The color of its line and its marks. */
38
+ color?: string;
39
+ /** The width of its line, in the diagram's units. */
40
+ width?: number;
41
+ /** Classes of the app's own on the connection's element, for its look. */
42
+ cssClass?: string;
43
+ /** Styles on the connection's element: CSS properties by name. */
44
+ style?: Record<string, string>;
45
+ /** `false` keeps the user from selecting it. Default: `true`. */
46
+ selectable?: boolean;
47
+ /** `false` keeps the user from deleting it. Default: `true`. */
48
+ deletable?: boolean;
49
+ }
@@ -0,0 +1,10 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /** A change the app made, for `Diagram.record`: what puts it back, what makes it again, and what it changed. */
4
+ export interface DiagramEdit<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
5
+ undo(): void;
6
+ redo(): void;
7
+ /** The nodes and the connections it changed, which `onHistoryChanged` tells. */
8
+ nodes?: readonly N[];
9
+ edges?: readonly E[];
10
+ }
@@ -0,0 +1,14 @@
1
+ /** How `Diagram.toSVG`, `toDataURL` and `toBlob` draw the diagram. */
2
+ export interface DiagramExportOptions {
3
+ /** The nodes to draw, by `id`, with the connections between them. Default: every node on the surface. */
4
+ nodes?: readonly string[];
5
+ /** The room around the drawing, in the diagram's units. Default: `16`. */
6
+ padding?: number;
7
+ /** The background: a CSS color, or `'transparent'` for none. Default: the color behind the diagram. */
8
+ background?: string;
9
+ /**
10
+ * How many pixels of a PNG stand for a unit of the diagram. Default: `2`. A drawing too large for the browser to
11
+ * hold as one image is drawn at a smaller scale.
12
+ */
13
+ scale?: number;
14
+ }
@@ -0,0 +1,28 @@
1
+ import type { ComponentBase } from '@motifx/core';
2
+ import type { DiagramExportOptions } from './diagram-export-options';
3
+ import type { DiagramViewport } from './diagram-viewport';
4
+ /** What an image of a diagram is drawn from: the diagram and its view, and the parts of the nodes and of the lines to draw, in the order they lie. */
5
+ export interface DiagramImageSource {
6
+ surface: ComponentBase;
7
+ viewport: DiagramViewport;
8
+ nodes: readonly ComponentBase[];
9
+ lines: readonly {
10
+ marks: readonly ComponentBase[];
11
+ labels: readonly ComponentBase[];
12
+ }[];
13
+ }
14
+ /** An image of a diagram: an SVG document that stands alone, and its size in the diagram's units. */
15
+ interface DiagramImage {
16
+ svg: string;
17
+ width: number;
18
+ height: number;
19
+ }
20
+ /**
21
+ * The diagram as an SVG document, read at once: an export needs its answer now, so the reads waiting in the window run
22
+ * with this one. Asked for inside a run of the measuring layer, where nothing runs at once, it is read fresh. Nothing is
23
+ * put on the page.
24
+ */
25
+ export declare function diagramImage(source: DiagramImageSource, options: DiagramExportOptions): DiagramImage;
26
+ /** The diagram drawn on a canvas, off the page, at `scale` or as near it as the browser can hold: the browser reads the SVG as an image first, which is not immediate. */
27
+ export declare function diagramCanvas(source: DiagramImageSource, options: DiagramExportOptions): Promise<HTMLCanvasElement>;
28
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { DiagramViewportOptions } from './diagram-viewport-options';
2
+ /** How `Diagram.fit` fits nodes into view. */
3
+ export interface DiagramFitOptions extends DiagramViewportOptions {
4
+ /** The nodes to fit, by `id`; all of them by default. */
5
+ nodes?: readonly string[];
6
+ /** The room kept around the nodes, in pixels. Default: `32`. */
7
+ padding?: number;
8
+ /** The smallest zoom the fit takes. Default: the diagram's `minZoom`. */
9
+ minZoom?: number;
10
+ /** The largest zoom the fit takes, so a few nodes are not blown up. Default: `1`, actual size. */
11
+ maxZoom?: number;
12
+ }
@@ -0,0 +1,14 @@
1
+ import type { DiagramChange } from './diagram-change';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ import type { DiagramNode } from './diagram-node';
4
+ /**
5
+ * Occurs whenever the history changes: a step was added (the user changed the diagram), undone or redone, or the
6
+ * history was cleared. After an undo or a redo, `nodes` and `edges` and their objects already say what the diagram shows.
7
+ */
8
+ export interface DiagramHistoryChangedEventArgs<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
9
+ readonly reason: 'add' | 'undo' | 'redo' | 'clear';
10
+ /** The step added, undone or redone; `null` when the history was cleared. */
11
+ readonly change: DiagramChange<N, E> | null;
12
+ readonly canUndo: boolean;
13
+ readonly canRedo: boolean;
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { DiagramChange } from './diagram-change';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ import type { DiagramNode } from './diagram-node';
4
+ /** A step of a diagram's history: what puts the change back, what makes it again, and what it was. */
5
+ export interface DiagramHistoryStep<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
6
+ undo(): void;
7
+ redo(): void;
8
+ change: DiagramChange<N, E>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ import type { DiagramNodeKind } from './diagram-node-kind';
3
+ /**
4
+ * The kinds every diagram knows: a group and a lane, which hold other nodes under a title (a lane's title runs down its
5
+ * side); a note, text with no ports; a table, its columns in rows with a port beside each; and a class, its members in
6
+ * compartments. Groups, lanes, tables and classes collapse with the button in their header: `toggle` does it. The box
7
+ * of a column of a table the user ticks or clears: `check` does it.
8
+ */
9
+ export declare function builtInKinds<N extends DiagramNode>(toggle: (node: N) => void, check: (node: N, column: string, checked: boolean) => void): Record<string, DiagramNodeKind<N>>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * A node of a layered layout in the layout's own axes: its size across the layers (the way a layer runs) and along
3
+ * them (the way the connections run).
4
+ */
5
+ export interface LayerItem {
6
+ cross: number;
7
+ rank: number;
8
+ }
9
+ /**
10
+ * A connection between two items, by their places in the list, and where it meets each of them: the share of the way
11
+ * across the item, `0.5` for its middle.
12
+ */
13
+ export interface LayerLink {
14
+ source: number;
15
+ target: number;
16
+ sourceShare: number;
17
+ targetShare: number;
18
+ }
19
+ /** Where a layered layout puts the items and the lines that run past layers, in its own axes. */
20
+ export interface LayerPlan {
21
+ /** The middle of each item across the layers. */
22
+ cross: number[];
23
+ /** Where each item starts along the layers. */
24
+ rank: number[];
25
+ /** For each link that runs past a layer, the points it passes the layers at, from its source; `null` for the others. */
26
+ routes: ({
27
+ cross: number;
28
+ rank: number;
29
+ }[] | null)[];
30
+ /** How far the layout reaches along the layers. */
31
+ extent: number;
32
+ }
33
+ /**
34
+ * Lays items out in layers that every link runs across in the same way: the links that close a cycle are turned round,
35
+ * the layers keep the links as short as they can be, long links pass each layer at a point of their own, the order in
36
+ * each layer crosses as few links as it can, and each item stands near the items it links to. Groups of items that do
37
+ * not link to each other stand side by side; items with no link at all stand in rows after them.
38
+ */
39
+ export declare function layeredPlan(items: readonly LayerItem[], links: readonly LayerLink[], nodeGap: number, layerGap: number): LayerPlan;
@@ -0,0 +1,2 @@
1
+ /** Which way the connections of a layered layout or a tree run: from the top down, from the left to the right, and back. */
2
+ export type DiagramLayoutDirection = 'down' | 'right' | 'up' | 'left';
@@ -0,0 +1,24 @@
1
+ import type { DiagramLayoutDirection } from './diagram-layout-direction';
2
+ import type { DiagramLayoutType } from './diagram-layout-type';
3
+ /** How `Diagram.layout` places the nodes. */
4
+ export interface DiagramLayoutOptions {
5
+ /** Layers the connections run across, a tree, or rows. Default: `'layered'`. */
6
+ type?: DiagramLayoutType;
7
+ /** Which way the connections of layers and of a tree run. Default: `'down'`. */
8
+ direction?: DiagramLayoutDirection;
9
+ /** The room between two nodes side by side, in the diagram's units. Default: `40`. */
10
+ nodeGap?: number;
11
+ /** The room between two layers, or two levels of a tree, in the diagram's units. Default: `80`. */
12
+ layerGap?: number;
13
+ /** How many nodes a row of a grid holds. Default: as many as make the grid about as wide as it is high. */
14
+ columns?: number;
15
+ /**
16
+ * The nodes to place, by `id`; a group takes the nodes in it along. Default: every node in no group. A node that may
17
+ * not be dragged stays where it is.
18
+ */
19
+ nodes?: readonly string[];
20
+ /** The nodes glide to their places with the design language's motion. Default: `false`. */
21
+ animate?: boolean;
22
+ /** Fits the nodes into view once they are placed. Default: `false`. */
23
+ fit?: boolean;
24
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * How `Diagram.layout` places the nodes: in layers that the connections run across (`layered`), as a tree under the
3
+ * nodes no connection comes into (`tree`), or in rows (`grid`).
4
+ */
5
+ export type DiagramLayoutType = 'layered' | 'tree' | 'grid';
@@ -0,0 +1,33 @@
1
+ import type { DiagramLayoutDirection } from './diagram-layout-direction';
2
+ import type { DiagramLayoutType } from './diagram-layout-type';
3
+ import type { DiagramPoint } from './diagram-point';
4
+ /** A node to place: its size in the diagram's units. */
5
+ export interface LayoutBox {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /**
10
+ * A connection between two boxes, by their places in the list, and where it meets each: the share of the way across
11
+ * the box along its layer (from the left for `'down'` and `'up'`, from the top for `'right'` and `'left'`), `0.5` for
12
+ * its middle.
13
+ */
14
+ export interface LayoutLink {
15
+ source: number;
16
+ target: number;
17
+ sourceShare: number;
18
+ targetShare: number;
19
+ }
20
+ /** What a layout makes: the top left corner of each box, the layout starting at 0, 0; and for each link the points it passes layers at, or `null`. */
21
+ export interface LayoutResult {
22
+ places: DiagramPoint[];
23
+ routes: (DiagramPoint[] | null)[];
24
+ }
25
+ export interface LayoutSettings {
26
+ type: DiagramLayoutType;
27
+ direction: DiagramLayoutDirection;
28
+ nodeGap: number;
29
+ layerGap: number;
30
+ columns: number | undefined;
31
+ }
32
+ /** Places the boxes: in layers or as a tree laid out the way `direction` says, or in rows. */
33
+ export declare function planLayout(boxes: readonly LayoutBox[], links: readonly LayoutLink[], settings: LayoutSettings): LayoutResult;
@@ -0,0 +1,6 @@
1
+ /** The look a line is drawn with, in the diagram's units: the size of its marks, the corners of a rounded step, a step's way out of its node. */
2
+ export interface DiagramLineLook {
3
+ marker: number;
4
+ corner: number;
5
+ gap: number;
6
+ }
@@ -0,0 +1,11 @@
1
+ import type { DiagramPathResult } from './diagram-path-result';
2
+ import type { DiagramPoint } from './diagram-point';
3
+ /**
4
+ * A connection's line as drawn: its path and label, the way back along the line at each end (a mark points against
5
+ * it), and the points it runs through: its ends and its corners, or the points of its own for a curve.
6
+ */
7
+ export interface DiagramLine extends DiagramPathResult {
8
+ sourceBack: DiagramPoint;
9
+ targetBack: DiagramPoint;
10
+ corners: DiagramPoint[];
11
+ }