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

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 (234) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/components/datagrid/DataGrid.d.ts +2 -1
  3. package/dist/components/datagrid/grid-column.d.ts +6 -0
  4. package/dist/components/datagrid/model/ColumnModel.d.ts +2 -0
  5. package/dist/components/datagrid/model/GridModel.d.ts +4 -0
  6. package/dist/components/datagrid/view/ColumnStyles.d.ts +7 -3
  7. package/dist/components/datagrid/view/GridBody.d.ts +56 -4
  8. package/dist/components/diagram/Diagram.d.ts +92 -0
  9. package/dist/components/diagram/DiagramEdgeView.d.ts +14 -4
  10. package/dist/components/diagram/DiagramLinks.d.ts +2 -0
  11. package/dist/components/diagram/DiagramNodeView.d.ts +19 -1
  12. package/dist/components/diagram/diagram-change.d.ts +3 -2
  13. package/dist/components/diagram/diagram-edge-click-event-args.d.ts +21 -0
  14. package/dist/components/diagram/diagram-edge-pointer-event-args.d.ts +6 -0
  15. package/dist/components/diagram/diagram-edge.d.ts +8 -0
  16. package/dist/components/diagram/diagram-links-host.d.ts +3 -0
  17. package/dist/components/diagram/diagram-node-click-event-args.d.ts +23 -0
  18. package/dist/components/diagram/diagram-node-context.d.ts +5 -0
  19. package/dist/components/diagram/diagram-node-host.d.ts +4 -0
  20. package/dist/components/diagram/diagram-node-pointer-event-args.d.ts +6 -0
  21. package/dist/components/diagram/diagram-props.d.ts +45 -0
  22. package/dist/components/diagram/diagram-text-changed-event-args.d.ts +7 -0
  23. package/dist/components/diagram/diagram-text-changing-event-args.d.ts +14 -0
  24. package/dist/components/diagram/diagram-text-editing-event-args.d.ts +11 -0
  25. package/dist/components/diagram/index.d.ts +7 -0
  26. package/dist/core/ui-strings.d.ts +5 -0
  27. package/dist/excel/index.js +1 -1
  28. package/dist/excel/index.js.map +1 -1
  29. package/dist/index.js +1644 -759
  30. package/dist/index.js.map +1 -1
  31. package/dist/locales/en.json +3 -0
  32. package/dist/locales/tr.json +3 -0
  33. package/dist/parts/table/RowHeights.d.ts +23 -0
  34. package/dist/parts/table/ScrollGeometry.d.ts +6 -1
  35. package/dist/parts/table/table-sheet-column.d.ts +2 -0
  36. package/dist/pdf/index.js +1 -1
  37. package/dist/pdf/index.js.map +1 -1
  38. package/dist/pdf/pdf-export-options.d.ts +4 -1
  39. package/dist/styles.css +58 -0
  40. package/dist/{tr-4GNbFdQh.js → tr-CMuuXBUb.js} +8 -2
  41. package/dist/{tr-4GNbFdQh.js.map → tr-CMuuXBUb.js.map} +1 -1
  42. package/docs/accordion.md +1 -1
  43. package/docs/actionsheet.md +1 -1
  44. package/docs/appbar.md +1 -1
  45. package/docs/appmenu-api.md +1 -1
  46. package/docs/appmenu-programmatic.md +1 -1
  47. package/docs/appmenu-search.md +1 -1
  48. package/docs/appmenu.md +1 -1
  49. package/docs/avatar.md +1 -1
  50. package/docs/badge.md +1 -1
  51. package/docs/bar-gauge-angles.md +1 -1
  52. package/docs/bar-gauge-data.md +1 -1
  53. package/docs/bar-gauge-labels.md +1 -1
  54. package/docs/bar-gauge.md +1 -1
  55. package/docs/barcode.md +1 -1
  56. package/docs/bottomnavigation.md +1 -1
  57. package/docs/bottomsheet.md +1 -1
  58. package/docs/breadcrumb.md +1 -1
  59. package/docs/button.md +1 -1
  60. package/docs/buttongroup.md +1 -1
  61. package/docs/buttons.md +1 -1
  62. package/docs/calendar.md +1 -1
  63. package/docs/card.md +1 -1
  64. package/docs/chart-bars.md +1 -1
  65. package/docs/chart-candles.md +1 -1
  66. package/docs/chart-funnel.md +1 -1
  67. package/docs/chart-heatmap.md +1 -1
  68. package/docs/chart-lines.md +1 -1
  69. package/docs/chart-live.md +1 -1
  70. package/docs/chart-pie.md +1 -1
  71. package/docs/chart-radar.md +1 -1
  72. package/docs/chart-ranges.md +1 -1
  73. package/docs/chart-references.md +1 -1
  74. package/docs/chart-scatter.md +1 -1
  75. package/docs/chart-waterfall.md +1 -1
  76. package/docs/chart-zoom.md +1 -1
  77. package/docs/chart.md +1 -1
  78. package/docs/chat.md +1 -1
  79. package/docs/checkbox.md +1 -1
  80. package/docs/chip.md +1 -1
  81. package/docs/choice.md +1 -1
  82. package/docs/colorbox.md +1 -1
  83. package/docs/combobox.md +1 -1
  84. package/docs/commands.md +1 -1
  85. package/docs/control.md +1 -1
  86. package/docs/data.md +1 -1
  87. package/docs/datagrid-api.md +3 -2
  88. package/docs/datagrid-bands.md +1 -1
  89. package/docs/datagrid-drag-select.md +1 -1
  90. package/docs/datagrid-drag.md +1 -1
  91. package/docs/datagrid-editing.md +1 -1
  92. package/docs/datagrid-filtering.md +1 -1
  93. package/docs/datagrid-forms.md +1 -1
  94. package/docs/datagrid-grouping.md +1 -1
  95. package/docs/datagrid-layout.md +1 -1
  96. package/docs/datagrid-lookups.md +1 -1
  97. package/docs/datagrid-master-detail.md +1 -1
  98. package/docs/datagrid-scrolling.md +77 -1
  99. package/docs/datagrid-selection.md +1 -1
  100. package/docs/datagrid.md +1 -1
  101. package/docs/datebox.md +1 -1
  102. package/docs/daterangebox.md +1 -1
  103. package/docs/diagram-api.md +19 -4
  104. package/docs/diagram-commands.md +2 -1
  105. package/docs/diagram-connections.md +8 -6
  106. package/docs/diagram-custom-nodes.md +1 -1
  107. package/docs/diagram-designer.md +1 -1
  108. package/docs/diagram-editing.md +132 -5
  109. package/docs/diagram-flow.md +21 -4
  110. package/docs/diagram-keyboard.md +5 -1
  111. package/docs/diagram-layout.md +1 -1
  112. package/docs/diagram-nodes.md +1 -1
  113. package/docs/diagram-tables.md +1 -1
  114. package/docs/diagram.md +11 -8
  115. package/docs/display.md +1 -1
  116. package/docs/draggable.md +1 -1
  117. package/docs/drawer.md +1 -1
  118. package/docs/dropdown.md +1 -1
  119. package/docs/editors.md +1 -1
  120. package/docs/expressioneditor.md +1 -1
  121. package/docs/expressions.md +1 -1
  122. package/docs/feedback.md +1 -1
  123. package/docs/fileuploader.md +1 -1
  124. package/docs/filterbuilder.md +1 -1
  125. package/docs/formlayout-schema.md +1 -1
  126. package/docs/formlayout.md +1 -1
  127. package/docs/foundations.md +1 -1
  128. package/docs/gallery.md +1 -1
  129. package/docs/gauge-base.md +1 -1
  130. package/docs/gauge-circular.md +1 -1
  131. package/docs/gauge-dashboards.md +1 -1
  132. package/docs/gauge-linear.md +1 -1
  133. package/docs/gauge-markers.md +1 -1
  134. package/docs/gauge-marks.md +1 -1
  135. package/docs/gauge-ranges.md +1 -1
  136. package/docs/gauge-scales.md +1 -1
  137. package/docs/gauge.md +1 -1
  138. package/docs/home.md +1 -1
  139. package/docs/keyboard.md +1 -1
  140. package/docs/language.md +1 -1
  141. package/docs/layout.md +1 -1
  142. package/docs/listbox.md +1 -1
  143. package/docs/loadpanel.md +1 -1
  144. package/docs/lookup.md +1 -1
  145. package/docs/markdown.md +1 -1
  146. package/docs/menus-api.md +1 -1
  147. package/docs/menus-context.md +1 -1
  148. package/docs/menus-customization.md +1 -1
  149. package/docs/menus-merging.md +1 -1
  150. package/docs/menus-programmatic.md +1 -1
  151. package/docs/menus.md +1 -1
  152. package/docs/multiview.md +1 -1
  153. package/docs/navigation.md +1 -1
  154. package/docs/numberbox.md +1 -1
  155. package/docs/otpinput.md +1 -1
  156. package/docs/pagination.md +1 -1
  157. package/docs/pivotgrid-api.md +1 -1
  158. package/docs/pivotgrid-chart.md +1 -1
  159. package/docs/pivotgrid-drilldown.md +1 -1
  160. package/docs/pivotgrid-export.md +1 -1
  161. package/docs/pivotgrid-fields.md +1 -1
  162. package/docs/pivotgrid-keyboard.md +1 -1
  163. package/docs/pivotgrid-layout.md +1 -1
  164. package/docs/pivotgrid-panel.md +1 -1
  165. package/docs/pivotgrid-remote.md +1 -1
  166. package/docs/pivotgrid-sorting.md +1 -1
  167. package/docs/pivotgrid-state.md +1 -1
  168. package/docs/pivotgrid-summaries.md +1 -1
  169. package/docs/pivotgrid.md +1 -1
  170. package/docs/popover.md +1 -1
  171. package/docs/progress.md +1 -1
  172. package/docs/qrcode.md +1 -1
  173. package/docs/radiogroup.md +1 -1
  174. package/docs/rating.md +1 -1
  175. package/docs/resizable.md +1 -1
  176. package/docs/ribbonmenu-api.md +1 -1
  177. package/docs/ribbonmenu-commands.md +1 -1
  178. package/docs/ribbonmenu-customization.md +1 -1
  179. package/docs/ribbonmenu-display.md +1 -1
  180. package/docs/ribbonmenu-layouts.md +1 -1
  181. package/docs/ribbonmenu-programmatic.md +1 -1
  182. package/docs/ribbonmenu.md +1 -1
  183. package/docs/scheduler-agenda.md +1 -1
  184. package/docs/scheduler-big-data.md +1 -1
  185. package/docs/scheduler-editing.md +1 -1
  186. package/docs/scheduler-form.md +1 -1
  187. package/docs/scheduler-icalendar.md +1 -1
  188. package/docs/scheduler-mobile.md +1 -1
  189. package/docs/scheduler-recurrence.md +1 -1
  190. package/docs/scheduler-resources.md +1 -1
  191. package/docs/scheduler-timeline.md +1 -1
  192. package/docs/scheduler.md +1 -1
  193. package/docs/scrollview.md +1 -1
  194. package/docs/shortcuteditor.md +1 -1
  195. package/docs/showcase-flowstudio.md +1 -1
  196. package/docs/showcase-home.md +1 -1
  197. package/docs/showcase-mail.md +1 -1
  198. package/docs/showcase.md +1 -1
  199. package/docs/signature.md +1 -1
  200. package/docs/skeleton.md +1 -1
  201. package/docs/slider.md +1 -1
  202. package/docs/sortable.md +1 -1
  203. package/docs/sparkline.md +1 -1
  204. package/docs/speeddial.md +1 -1
  205. package/docs/splitter.md +1 -1
  206. package/docs/stepper.md +1 -1
  207. package/docs/switch.md +1 -1
  208. package/docs/tabdocs-dock.md +1 -1
  209. package/docs/tabdocs-drag.md +1 -1
  210. package/docs/tabdocs-menus.md +1 -1
  211. package/docs/tabdocs-mobile.md +1 -1
  212. package/docs/tabdocs-tabs.md +1 -1
  213. package/docs/tabdocs-windows.md +1 -1
  214. package/docs/tabdocs-workspace.md +1 -1
  215. package/docs/tabdocs.md +1 -1
  216. package/docs/tabs.md +1 -1
  217. package/docs/tagbox.md +1 -1
  218. package/docs/textarea.md +1 -1
  219. package/docs/textbox.md +1 -1
  220. package/docs/tileview.md +1 -1
  221. package/docs/timeline.md +1 -1
  222. package/docs/toast.md +1 -1
  223. package/docs/tokens.md +1 -1
  224. package/docs/toolbar-api.md +1 -1
  225. package/docs/toolbar-customization.md +1 -1
  226. package/docs/toolbar.md +1 -1
  227. package/docs/tooltip.md +1 -1
  228. package/docs/treeview.md +1 -1
  229. package/docs/validationsummary.md +1 -1
  230. package/docs/window.md +1 -1
  231. package/docs/wizard.md +1 -1
  232. package/llms-full.txt +460 -214
  233. package/llms.txt +1 -1
  234. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,61 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0-beta.18] - 2026-11-29
10
+
11
+ Needs `@motifx/core` 1.2.0-rc.31 and `@motifx-community/data` 0.1.0-beta.3.
12
+
13
+ ### Added
14
+
15
+ - A `DataGrid` column's `wrap`: the text of its cells wraps onto more lines, a line break in the text starts a new one,
16
+ and a row grows to hold its tallest cell, never shorter than the rows' height. Only the rows on the screen are
17
+ measured, before they are shown, so many rows of notes scroll as rows of one height do. The first row in view stays
18
+ where it is while rows above it are measured, when a column's width changes and when wrapping is turned on or off; a
19
+ row brought into view by the keys stays whole once it is measured, and Page Up and Page Down count the rows that fit
20
+ by their heights. The header, filter, group and summary rows keep one height, and a grid with no such column works as
21
+ before. An Excel export sets the column's data cells to wrap their text, and a PDF export wraps them unless
22
+ `wordWrapEnabled` says otherwise. `wrap` can be a function, or changed with `columnOption`.
23
+
24
+ ### Fixed
25
+
26
+ - `DataGrid.addRow()` called while the rows load (before the first of them arrive, before the grid is on the page, or
27
+ after the sort changes) waits for them (#9). It placed the new row as if the grid had no rows: the row was added
28
+ (`changes.added`) but never drawn, and no editor opened. It now opens the row once the rows arrive, as it does after
29
+ the load: on the last page in paged mode, with its editor open and the given values filled in. It resolves `false`
30
+ if the grid is disposed first.
31
+
32
+ ## [0.1.0-beta.17] - 2026-11-28
33
+
34
+ Needs `@motifx/core` 1.2.0-rc.31 and `@motifx-community/data` 0.1.0-beta.3.
35
+
36
+ ### Added
37
+
38
+ - `Diagram` events for the nodes and connections the user points at, clicks or opens a menu on: `onNodeClick`,
39
+ `onNodeDblClick`, `onNodeContextMenu`, `onNodePointerEnter`, `onNodePointerLeave`, and the same five for connections
40
+ (`onEdgeClick`, `onEdgeDblClick`, `onEdgeContextMenu`, `onEdgePointerEnter`, `onEdgePointerLeave`). Each carries the
41
+ item, the pointer's place (`at`, where the app opens its own menu) and `cancel`. The keys reach them too: the Menu key
42
+ or Shift+F10 on the item under the keys opens its menu, and Alt+Enter is its double click.
43
+ - A connection's `status` and `statusText`, as a node's: `setEdgeStatus` marks the connections a run goes along as
44
+ waiting, running (its line moving), done, skipped or failed, in the look's colors, with the text in the line's tip and
45
+ the status said to a screen reader with the connection's two nodes.
46
+ - A node's text edited in place (`textEditable`): a double click on the text, F2 or the new `rename` command opens an
47
+ editor over it. Enter or leaving it writes the text as a step of the history (a `text` change), Escape keeps the old
48
+ one, and an empty text is refused. `editText(id)` opens it in code; `onTextEditing`, `onTextChanging` (change or
49
+ refuse the new text) and `onTextChanged`. A kind with content of its own names the part that shows the text with
50
+ `context.textPart`; `cardKind` and the built-in kinds do.
51
+
52
+ ### Fixed
53
+
54
+ - A `DataGrid` row is as wide as its columns, never as its content (#7). A column with `flex` that got less room than
55
+ its filter-row editor asks for kept the editor's width in the filter row: that row grew wider than the others, its
56
+ cells no longer lined up with the headers, and the grid scrolled sideways. A long text in a cell and a group's title
57
+ widened their own rows in the same way. Each row is a grid sized to its content, so its flexing tracks grew with what
58
+ its cells held; the cells of a row no longer pass their content's width to it (`contain: inline-size`).
59
+ - The rows of a `cardKind` node follow the order of its `ports` when they change (#8). A port added among the others got
60
+ its row, and its port beside it, at the bottom of the card, after the ports that came after it. Each row keeps its
61
+ place among the rows of its side, and they are put in order when a place changes; a card whose ports did not change
62
+ does no extra work.
63
+
9
64
  ## [0.1.0-beta.16] - 2026-11-27
10
65
 
11
66
  Needs `@motifx/core` 1.2.0-rc.31 and `@motifx-community/data` 0.1.0-beta.3.
@@ -342,7 +342,8 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
342
342
  * Opens a new row, as the "New row" button does: at the bottom (the grid moves to the end, and a
343
343
  * virtual list loads only the last block) or at the top, with the first cell a new row can fill in
344
344
  * edit mode. The row being edited is left first, and no row is added if it cannot be left. `values`
345
- * fill the new row as if typed.
345
+ * fill the new row as if typed. While the rows load (before the first of them arrive, or after the
346
+ * sort changes), it waits for them; `false` if the grid is disposed first.
346
347
  */
347
348
  addRow(values?: Partial<T>): Promise<boolean>;
348
349
  /**
@@ -74,6 +74,12 @@ export interface GridColumn<T = any> {
74
74
  hidden?: boolean;
75
75
  /** The horizontal alignment. By default, `end` for numbers, `center` for booleans and `start` otherwise. */
76
76
  align?: 'start' | 'center' | 'end';
77
+ /**
78
+ * The text of the column's cells wraps onto more lines, and a row grows to hold its tallest cell, never shorter than
79
+ * the rows' height. A line break in the text starts a new line. A grid without such a column keeps all its rows one
80
+ * height. A function is tracked.
81
+ */
82
+ wrap?: Bind<boolean>;
77
83
  /** Reads the value in place of `row[field]`. */
78
84
  value?: (row: T) => unknown;
79
85
  /**
@@ -102,6 +102,8 @@ export declare class ColumnModel<T> {
102
102
  title(field: string): string;
103
103
  /** Alignment of the column's cells: its own, else by type. */
104
104
  align(field: string): 'start' | 'center' | 'end';
105
+ /** Whether the text of the column's cells wraps onto more lines (`wrap`); the grid's own columns never do. */
106
+ wraps(field: string): boolean;
105
107
  /** Where a band's caption sits: its own, else the `bandAlign` setting. */
106
108
  bandAlign(id: string): 'start' | 'center' | 'end';
107
109
  /** Whether the user may use `feature` on this column or band: its own value, else the grid's. */
@@ -66,6 +66,8 @@ export declare class GridModel<T> {
66
66
  /** Tells the views that fields of `state` changed (`grid.` and the field). */
67
67
  stateChanged(...fields: (keyof GridState & string)[]): void;
68
68
  readonly state: GridState;
69
+ /** Set when the grid is disposed: a wait for the rows ends with it. */
70
+ private readonly life;
69
71
  /** The new-row area, in display order. */
70
72
  readonly addedRows: AddedRow<T>[];
71
73
  /** The rows, their source and their unsaved changes; recreated when the data props change. */
@@ -165,6 +167,8 @@ export declare class GridModel<T> {
165
167
  loadMore(): boolean;
166
168
  /** Infinite mode: loads part after part until `rows` rows show (or every row does); whether they do. */
167
169
  loadTo(rows: number): Promise<boolean>;
170
+ /** Resolves once the rows the grid waits for have arrived, or failed to: `false` when the grid is disposed first. */
171
+ rowsLoaded(): Promise<boolean>;
168
172
  /** Infinite mode: what the indicator under the rows shows (`loadMoreIndicator`): a part loading, a part that failed, or nothing. Reactive. */
169
173
  moreState(): 'loading' | 'failed' | null;
170
174
  get saveMode(): data.SaveMode;
@@ -2,7 +2,7 @@ import type { ComponentBase } from '@motifx/core';
2
2
  import type { ColumnModel } from '../model/ColumnModel';
3
3
  import type { StickyOffset } from '../model/sticky-offset';
4
4
  /**
5
- * Per-column CSS of one grid: columns not shown, the tracks of the columns pinned to the end, alignment and sticky offsets, written as rules keyed
5
+ * Per-column CSS of one grid: columns not shown, the tracks of the columns pinned to the end, alignment, wrapping and sticky offsets, written as rules keyed
6
6
  * by `data-field` (a pinned band's header by `data-band`, at the offset of its columns). Changing a width or pinning a column rewrites this sheet only; no cell gets a
7
7
  * binding of its own and no row is touched. A rule finds the rows through the parts that hold them (the head, the body,
8
8
  * the foot, the copy of a dragged row), which carry the grid's id, and goes on by child combinators only: the rows of a
@@ -21,12 +21,16 @@ export declare class ColumnStyles<T> {
21
21
  private style;
22
22
  private stopWatch;
23
23
  constructor(columns: ColumnModel<T>, gridId: string);
24
- /** `placed`: every column's cells get their track by number, so a row may leave out the cells of columns not drawn (virtual columns). */
24
+ /**
25
+ * `placed`: every column's cells get their track by number, so a row may leave out the cells of columns not drawn (virtual
26
+ * columns). `wrap`: the columns whose cells wrap their text; with any, a data row (in the body, and its copy while it is
27
+ * dragged) is as tall as its tallest cell.
28
+ */
25
29
  update(visible: string[], offsets: Map<string, StickyOffset>, align: Map<string, string>, bands?: readonly {
26
30
  id: string;
27
31
  first: number;
28
32
  count: number;
29
- }[], placed?: boolean): void;
33
+ }[], placed?: boolean, wrap?: ReadonlySet<string>): void;
30
34
  attach(owner: ComponentBase): void;
31
35
  detach(): void;
32
36
  private drop;
@@ -21,7 +21,11 @@ import { GroupRow } from './GroupRow';
21
21
  * detail of the one row that has it open (the columns the width hides) is a detail row too, right
22
22
  * under its row and before its details. The viewport is read with the measuring layer: a layout asked for
23
23
  * runs at once with the viewport as last read (and as the body scrolled it), and again with the next round
24
- * if the viewport turns out to be elsewhere; the sizes of details and of the edit form are watched.
24
+ * if the viewport turns out to be elsewhere; the sizes of details and of the edit form are watched. While a
25
+ * column wraps its text, a data row is as tall as its cells: the rows drawn are measured in the round after
26
+ * they are laid out, before the screen is drawn, and again when one changes size; what they add over the
27
+ * rows' height is kept by position (`RowHeights`), and the first row in view stays where it stood when the
28
+ * rows above it come out taller or shorter.
25
29
  */
26
30
  export declare class GridBody<T> extends Component<HTMLDivElement> {
27
31
  private readonly grid;
@@ -85,12 +89,57 @@ export declare class GridBody<T> extends Component<HTMLDivElement> {
85
89
  private dropLine;
86
90
  /** The row a dragged row would be dropped onto. */
87
91
  private dropRow;
92
+ /** Whether a column wraps its text: data rows are as tall as their cells, measured as they are drawn. */
93
+ private wrapping;
94
+ /** The columns and widths the rows were measured for. */
95
+ private wrapFor;
96
+ /** What the rows laid out add over the rows' height, and the rows and height that was found for. */
97
+ private heights;
98
+ private heightsFor;
99
+ /** The size watches of the pooled rows, while rows are measured. */
100
+ private readonly rowWatches;
101
+ /**
102
+ * The row kept in place after the last layout, the first in view or the one `reveal` brought in: its position, its id,
103
+ * how far below the top of the view its top (or its bottom, `edge`) stood, and the scroll then.
104
+ */
105
+ private anchor;
106
+ /** The row `reveal` brought into view, at the edge it was brought to: kept there while rows are measured, until the view is scrolled. */
107
+ private pinned;
88
108
  constructor(grid: GridModel<T>,
89
109
  /** The grid's viewport, the scroller the body sits in; `null` before it is made. */
90
110
  viewport: () => ComponentBase | null, widths: ActionWidths, host: Omit<DetailHost<T>, 'owner'>);
91
111
  onConfigured(): void;
92
- /** Geometry of the rows the body lays out (all rows, or one page); the edit form's row is as tall as the form, open details and the adaptive detail add their height. */
112
+ /**
113
+ * Geometry of the rows the body lays out (all rows, or one page); the edit form's row is as tall as the form, open details
114
+ * and the adaptive detail add their height, and so do rows taller than the others while a column wraps.
115
+ */
93
116
  geometry(): ScrollGeometry;
117
+ /**
118
+ * Whether a column wraps its text, and the columns and widths that is for (`key`): with one, rows are measured as they
119
+ * are drawn and when they change size; another key has the rows drawn measured again.
120
+ */
121
+ setWrap(on: boolean, key: string): void;
122
+ /** Scrolls so that a row noted in the view (`anchor`) stands where it stood, in the rows as they are now. */
123
+ private scrollToAnchor;
124
+ /** What the rows laid out add over the rows' height while a column wraps; found again for other rows or another height. */
125
+ private rowHeights;
126
+ /** Watches a pooled row's size while rows are measured: a row that changes size (its content drawn again) is measured again. */
127
+ private watchRow;
128
+ /** A row drawn came out another size than it was measured at: the rows after it move, with the next round. */
129
+ private rowResized;
130
+ /** The heights of the data rows drawn, read after they were laid out. */
131
+ private readonly readHeights;
132
+ /** Rows that came out another height: the rows are laid out again, the first row in view where it stood. */
133
+ private readonly writeHeights;
134
+ /**
135
+ * While rows are measured, the first row in view stays where it stood when what the rows above it add changed (they were
136
+ * measured, or found again), unless the view was scrolled since: returns the scroll the rows are laid out for.
137
+ */
138
+ private keepAnchor;
139
+ /** Notes the row to keep where it stands (`keepAnchor`): the one `reveal` brought in, else the first that starts in view. */
140
+ private noteAnchor;
141
+ /** While rows are measured, a row `reveal` scrolled to stays at the edge it came to (`v`: the view's new top). */
142
+ private pin;
94
143
  /** The details drawn now, the adaptive detail among them, in grid order (a row's adaptive detail before its details). */
95
144
  drawnDetails(): DetailRow<T>[];
96
145
  /** The adaptive detail drawn under grid row `index`. */
@@ -164,8 +213,11 @@ export declare class GridBody<T> extends Component<HTMLDivElement> {
164
213
  reveal(index: number, align?: 'nearest' | 'start' | 'end'): void;
165
214
  /** Back to the first row (after a sort change); the rows follow with the next round. */
166
215
  toStart(): void;
167
- /** Rows the viewport shows fully, for PageUp/PageDown. */
168
- pageRows(): number;
216
+ /**
217
+ * Rows the viewport shows fully, for PageUp/PageDown: a screen of rows down (`down`) or up from grid row `from`, counted
218
+ * by their heights while some are taller than the others.
219
+ */
220
+ pageRows(from?: number, down?: boolean): number;
169
221
  /** The pooled row that shows grid row `index`, if it is drawn. */
170
222
  rowAt(index: number): GridRow<T> | undefined;
171
223
  /** The cell of grid row `index`, if that row is drawn; a group row's one cell, or a group footer itself, for any field. */
@@ -20,6 +20,8 @@ import type { DiagramData } from './diagram-data';
20
20
  import type { DiagramDeletedEventArgs } from './diagram-deleted-event-args';
21
21
  import type { DiagramDeletingEventArgs } from './diagram-deleting-event-args';
22
22
  import type { DiagramDrawnNode } from './diagram-drawn-node';
23
+ import type { DiagramEdgeClickEventArgs } from './diagram-edge-click-event-args';
24
+ import type { DiagramEdgePointerEventArgs } from './diagram-edge-pointer-event-args';
23
25
  import type { DiagramEdgeReshapedEventArgs } from './diagram-edge-reshaped-event-args';
24
26
  import type { DiagramEdgeReshapingEventArgs } from './diagram-edge-reshaping-event-args';
25
27
  import type { DiagramEdge } from './diagram-edge';
@@ -30,6 +32,8 @@ import type { DiagramFitOptions } from './diagram-fit-options';
30
32
  import type { DiagramLayoutOptions } from './diagram-layout-options';
31
33
  import type { DiagramMiniMapOptions } from './diagram-mini-map-options';
32
34
  import type { DiagramNode } from './diagram-node';
35
+ import type { DiagramNodeClickEventArgs } from './diagram-node-click-event-args';
36
+ import type { DiagramNodePointerEventArgs } from './diagram-node-pointer-event-args';
33
37
  import type { DiagramNodesMovedEventArgs } from './diagram-nodes-moved-event-args';
34
38
  import type { DiagramNodesMovingEventArgs } from './diagram-nodes-moving-event-args';
35
39
  import type { DiagramPoint } from './diagram-point';
@@ -39,6 +43,9 @@ import type { DiagramReconnectingEventArgs } from './diagram-reconnecting-event-
39
43
  import type { DiagramRect } from './diagram-rect';
40
44
  import type { DiagramSelection } from './diagram-selection';
41
45
  import type { DiagramSelectionChangedEventArgs } from './diagram-selection-changed-event-args';
46
+ import type { DiagramTextChangedEventArgs } from './diagram-text-changed-event-args';
47
+ import type { DiagramTextChangingEventArgs } from './diagram-text-changing-event-args';
48
+ import type { DiagramTextEditingEventArgs } from './diagram-text-editing-event-args';
42
49
  import type { DiagramViewport } from './diagram-viewport';
43
50
  import type { DiagramViewportChangedEventArgs } from './diagram-viewport-changed-event-args';
44
51
  import type { DiagramViewportOptions } from './diagram-viewport-options';
@@ -139,6 +146,27 @@ export declare class Diagram<N extends DiagramNode = DiagramNode, E extends Diag
139
146
  private readonly pastingEmitter;
140
147
  private readonly pastedEmitter;
141
148
  private readonly historyChangedEmitter;
149
+ private readonly nodeClickEmitter;
150
+ private readonly nodeDblClickEmitter;
151
+ private readonly nodeMenuEmitter;
152
+ private readonly nodeMenu;
153
+ private readonly nodePointerEnterEmitter;
154
+ private readonly nodePointerLeaveEmitter;
155
+ private readonly edgeClickEmitter;
156
+ private readonly edgeDblClickEmitter;
157
+ private readonly edgeMenuEmitter;
158
+ private readonly edgeMenu;
159
+ private readonly edgePointerEnterEmitter;
160
+ private readonly edgePointerLeaveEmitter;
161
+ private readonly textEditingEmitter;
162
+ private readonly textChangingEmitter;
163
+ private readonly textChangedEmitter;
164
+ /** What every node's part asks of the diagram and tells it: one object for all the nodes, however many. */
165
+ private readonly nodeHost;
166
+ /** When the Menu key or Shift+F10 last opened the app's menu: the `contextmenu` event the browser sends after it stays its own. */
167
+ private menuKeyAt;
168
+ /** The node whose text is edited in place, and its editor, while it is. */
169
+ private editing;
142
170
  /** The size of the surface, from its size observer; 0 until it is laid out. */
143
171
  private room;
144
172
  /** The view last told: a change is told from it. */
@@ -183,6 +211,8 @@ export declare class Diagram<N extends DiagramNode = DiagramNode, E extends Diag
183
211
  set guides(value: Bind<boolean>);
184
212
  get history(): boolean;
185
213
  set history(value: Bind<boolean>);
214
+ get textEditable(): boolean;
215
+ set textEditable(value: Bind<boolean>);
186
216
  get commandScope(): ComponentBase | null;
187
217
  set commandScope(value: Bind<ComponentBase | null>);
188
218
  /** Whether there is a step to undo, and one to redo. */
@@ -359,9 +389,56 @@ export declare class Diagram<N extends DiagramNode = DiagramNode, E extends Diag
359
389
  * were hidden in a group or shown again, or the surface changed its size. A map follows the diagram with it.
360
390
  */
361
391
  get onContentChanged(): MotifEvent<void>;
392
+ get onNodeClick(): MotifEvent<DiagramNodeClickEventArgs<N>>;
393
+ get onNodeDblClick(): MotifEvent<DiagramNodeClickEventArgs<N>>;
394
+ get onNodeContextMenu(): MotifEvent<DiagramNodeClickEventArgs<N>>;
395
+ get onNodePointerEnter(): MotifEvent<DiagramNodePointerEventArgs<N>>;
396
+ get onNodePointerLeave(): MotifEvent<DiagramNodePointerEventArgs<N>>;
397
+ get onEdgeClick(): MotifEvent<DiagramEdgeClickEventArgs<E>>;
398
+ get onEdgeDblClick(): MotifEvent<DiagramEdgeClickEventArgs<E>>;
399
+ get onEdgeContextMenu(): MotifEvent<DiagramEdgeClickEventArgs<E>>;
400
+ get onEdgePointerEnter(): MotifEvent<DiagramEdgePointerEventArgs<E>>;
401
+ get onEdgePointerLeave(): MotifEvent<DiagramEdgePointerEventArgs<E>>;
402
+ get onTextEditing(): MotifEvent<DiagramTextEditingEventArgs<N>>;
403
+ get onTextChanging(): MotifEvent<DiagramTextChangingEventArgs<N>>;
404
+ get onTextChanged(): MotifEvent<DiagramTextChangedEventArgs<N>>;
362
405
  /** Makes the selection these nodes and connections, the ones that exist and may be selected; tells when it changed. */
363
406
  private choose;
364
407
  private edgeClicked;
408
+ /** What the pointer did on a node: told; a double click on its text edits it, a right click opens the app's menu. */
409
+ private nodeTold;
410
+ /** What the pointer did on a connection, besides a click: told; a right click opens the app's menu. */
411
+ private edgeTold;
412
+ /** What a click on a node tells: where it was on the page, or for a key the middle of the node. */
413
+ private nodeArgs;
414
+ /** What a click on a connection tells: where it was on the page, or for a key the middle between its ends. */
415
+ private edgeArgs;
416
+ /** A double click on a node, or Alt+Enter on it: told, then its text is edited (`textEditable`), unless canceled. */
417
+ private nodeOpened;
418
+ /**
419
+ * A right click on a node, or the Menu key on it: told to the app, which opens its menu there; the browser's own
420
+ * stays closed, unless canceled. Nothing is told while nobody listens. Returns whether the app took it.
421
+ */
422
+ private nodeMenuAsked;
423
+ /** A right click on a connection, or the Menu key on it, as `nodeMenuAsked`. */
424
+ private edgeMenuAsked;
425
+ /** The Menu key or Shift+F10: the context menu of the connection or the node under the keys. Returns whether the app took it. */
426
+ private keyMenu;
427
+ /** Alt+Enter: a double click on the connection or the node under the keys. Returns whether there was one. */
428
+ private keyOpen;
429
+ /** What a screen reader calls a connection: its label, else its two nodes. */
430
+ private edgeName;
431
+ /** The node F2 and the `rename` command edit the text of: the one under the keys, else the only one selected. */
432
+ private renameTarget;
433
+ /** Opens the editor of a node's text over it, after `onTextEditing`; an edit going on elsewhere is written first. */
434
+ private startEditing;
435
+ /**
436
+ * Ends the edit of a node's text: `write` writes the editor's text, after `onTextChanging`, as a step of the history.
437
+ * The editor goes; when it had focus, focus comes back to the diagram, on the node.
438
+ */
439
+ private stopEditing;
440
+ /** Writes a node's new text, after `onTextChanging`, as a step of the history, and tells it. */
441
+ private writeText;
365
442
  private canMove;
366
443
  /** Asks `onNodesMoving` before nodes move; `false` when it cancels. */
367
444
  private startMoving;
@@ -543,6 +620,21 @@ export declare class Diagram<N extends DiagramNode = DiagramNode, E extends Diag
543
620
  * `statusText` are written, and saved with it unless the app leaves them out. Returns whether it changed.
544
621
  */
545
622
  setNodeStatus(id: string, status: DiagramNodeStatus | null, text?: string): boolean;
623
+ /**
624
+ * Shows what a connection is doing as a run goes along it (`null` takes the status away): the look's color of the
625
+ * status on its line and its marks, unless it has a `color` of its own, a line that moves while it runs, and the
626
+ * status in the line's tip; a screen reader hears it with the connection's two nodes. Not a step of the history: the
627
+ * connection's `status` and `statusText` are written, and saved with it unless the app leaves them out. Returns
628
+ * whether it changed.
629
+ */
630
+ setEdgeStatus(id: string, status: DiagramNodeStatus | null, text?: string): boolean;
631
+ /**
632
+ * Edits a node's text in place, as a double click on it does with `textEditable`: an editor opens over the text, and
633
+ * Enter or leaving it writes the new text as a step of the history, Escape keeps the old one. The node is selected
634
+ * and brought into view. Returns whether the editor opened: not in a read-only diagram, not for a node off the page
635
+ * (out of view in a large diagram, or in a collapsed group), and not when `onTextEditing` cancels.
636
+ */
637
+ editText(id: string): boolean;
546
638
  /**
547
639
  * The connections of a node: those that end at it (`direction: 'in'`), start at it (`'out'`) or either, at one of its
548
640
  * ports or any. Read in a getter, it follows the connections as they are drawn, taken away and moved.
@@ -1,9 +1,16 @@
1
1
  import type { Component, ComponentBase } from '@motifx/core';
2
2
  import type { DiagramEdge } from './diagram-edge';
3
3
  import type { DiagramLineLook } from './diagram-line-look';
4
+ import type { DiagramPointerAct } from './diagram-node-host';
4
5
  import type { DiagramPoint } from './diagram-point';
5
6
  import type { DiagramRect } from './diagram-rect';
6
7
  import type { DiagramSide } from './diagram-side';
8
+ /** What a line tells its diagram: a press, a click, and the rest the pointer does on it. */
9
+ export interface EdgeTold<E extends DiagramEdge> {
10
+ pressed: (view: DiagramEdgeView<E>, e: PointerEvent) => void;
11
+ clicked: (view: DiagramEdgeView<E>, e: MouseEvent) => void;
12
+ pointer: (what: Exclude<DiagramPointerAct, 'click'>, view: DiagramEdgeView<E>, e: MouseEvent) => void;
13
+ }
7
14
  /**
8
15
  * A connection on the surface: its line, the wider line the pointer finds it by, the marks at its ends and its label.
9
16
  * Its way is worked out at every draw; its parts are made the first time it is shown, and leave the page while it is not
@@ -14,6 +21,8 @@ export declare class DiagramEdgeView<E extends DiagramEdge = DiagramEdge> {
14
21
  private readonly labels;
15
22
  private readonly told;
16
23
  private parts;
24
+ /** The tip of its status, while it has one. */
25
+ private tip;
17
26
  /** The line as last worked out, written to its parts while it is shown. */
18
27
  private drawn;
19
28
  private selected;
@@ -39,10 +48,7 @@ export declare class DiagramEdgeView<E extends DiagramEdge = DiagramEdge> {
39
48
  bounds: DiagramRect | null;
40
49
  /** Whether it is on the page: it lies in view, or the diagram shows every line. */
41
50
  live: boolean;
42
- constructor(edges: ComponentBase, labels: ComponentBase, edge: E, told: {
43
- pressed: (view: DiagramEdgeView<E>, e: PointerEvent) => void;
44
- clicked: (view: DiagramEdgeView<E>, e: MouseEvent) => void;
45
- });
51
+ constructor(edges: ComponentBase, labels: ComponentBase, edge: E, told: EdgeTold<E>);
46
52
  /** The group of its parts; `null` until it is first shown. */
47
53
  get group(): Component<SVGGElement> | null;
48
54
  /** Puts it on the page or takes it off: its parts are made the first time. Returns whether they were made now. */
@@ -67,6 +73,10 @@ export declare class DiagramEdgeView<E extends DiagramEdge = DiagramEdge> {
67
73
  markSelected(on: boolean): void;
68
74
  /** The app's color, width, classes and style properties; those it took away since the last draw come off. */
69
75
  private drawLook;
76
+ /** Writes its status again, as `setEdgeStatus` changed it: nothing else of the line changes. */
77
+ drawState(): void;
78
+ /** Its status: the look's color of it on the line and its marks, and the status in the line's tip. */
79
+ private drawStatus;
70
80
  remove(): void;
71
81
  private drawMark;
72
82
  private drawLabel;
@@ -25,6 +25,8 @@ export declare class DiagramLinks<N extends DiagramNode = DiagramNode, E extends
25
25
  /** The handles that move, add and take away the points of the selected lines; the keys do the same through it. */
26
26
  readonly bends: DiagramBends<E>;
27
27
  private readonly views;
28
+ /** What every line tells the diagram: one object for all the lines, however many. */
29
+ private readonly told;
28
30
  /** The selected connections, by `id`, and the handles over their ends, which take an end to move it. */
29
31
  private readonly selected;
30
32
  private readonly handles;
@@ -1,4 +1,4 @@
1
- import { type Component } from '@motifx/core';
1
+ import { ComponentBase, type Component } from '@motifx/core';
2
2
  import { type Size } from '../../core/measure';
3
3
  import type { DiagramNode } from './diagram-node';
4
4
  import type { DiagramNodeHost } from './diagram-node-host';
@@ -42,6 +42,10 @@ export declare class DiagramNodeView<N extends DiagramNode = DiagramNode> {
42
42
  live: boolean;
43
43
  /** The part a press drags the node from, when the kind's content named one. */
44
44
  private handle;
45
+ /** The part that shows its text, when the kind's content named one (`context.textPart`). */
46
+ private textHolder;
47
+ /** The editor of its text, over the part that shows it, while the text is edited. */
48
+ private editor;
45
49
  /** What names it, when the kind's content gave it (`context.label`), and what stops the name following its data. */
46
50
  private naming;
47
51
  private stopNaming;
@@ -126,6 +130,20 @@ export declare class DiagramNodeView<N extends DiagramNode = DiagramNode> {
126
130
  * the rest drags the node (off a drag handle, it only selects).
127
131
  */
128
132
  private pressed;
133
+ /** Whether an event comes from a port, a resize handle or the editor of its text: none of them is the node's own. */
134
+ private fromHandle;
135
+ /** Whether an event came from the part that shows its text: anywhere on a node of a text, off its ports and handles. */
136
+ isTextEvent(e: Event): boolean;
137
+ /** The part its text is edited over: the one that shows it, else its content. */
138
+ private get textPlace();
139
+ /** Whether its text is being edited in place. */
140
+ get isEditing(): boolean;
141
+ /**
142
+ * Puts the editor of its text over the part that shows the text, as wide as it and no narrower than the editor's
143
+ * own smallest; `null` takes it away. The editor is placed with the window's next measuring round, when the node is
144
+ * laid out, and moves and zooms with the node.
145
+ */
146
+ holdEditor(editor: ComponentBase | null): void;
129
147
  /**
130
148
  * Whether an event comes from a control inside `from`: a part that takes focus, a control of the kit whose focus is a
131
149
  * part of its own (a field), or one that is off (a button that is off keeps the press too). A layout of the kit, such
@@ -2,10 +2,11 @@ import type { DiagramEdge } from './diagram-edge';
2
2
  import type { DiagramNode } from './diagram-node';
3
3
  /**
4
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`).
5
+ * reshaped, items deleted or pasted, the nodes laid out, a node's text edited in place, or a change the app made
6
+ * (`Diagram.record`).
6
7
  */
7
8
  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 kind: 'move' | 'resize' | 'collapse' | 'connect' | 'reconnect' | 'reshape' | 'delete' | 'paste' | 'layout' | 'text' | 'edit';
9
10
  readonly nodes: readonly N[];
10
11
  readonly edges: readonly E[];
11
12
  }
@@ -0,0 +1,21 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramPoint } from './diagram-point';
3
+ /**
4
+ * A connection clicked, double-clicked or asked for its context menu: with the pointer on its line or its labels, or
5
+ * with the keys on the connection under them (Alt+Enter stands for a double click; the Menu key or Shift+F10 for the
6
+ * context menu).
7
+ */
8
+ export interface DiagramEdgeClickEventArgs<E extends DiagramEdge = DiagramEdge> {
9
+ readonly edge: E;
10
+ /** The browser's event: the pointer's, or the key's. */
11
+ readonly event: MouseEvent | KeyboardEvent;
12
+ /** Whether a key asked for it. */
13
+ readonly byKeyboard: boolean;
14
+ /**
15
+ * Where it happened on the page, in pixels: the pointer, or the middle of the line for a key. A context menu opens
16
+ * there with `menu.open(e.at, diagram)`.
17
+ */
18
+ readonly at: DiagramPoint;
19
+ /** With `true`, the diagram skips its own response: a click does not select the connection, and the browser shows its own context menu. */
20
+ cancel: boolean;
21
+ }
@@ -0,0 +1,6 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ /** The pointer came over a connection or left it: its line, its marks and its labels alike. */
3
+ export interface DiagramEdgePointerEventArgs<E extends DiagramEdge = DiagramEdge> {
4
+ readonly edge: E;
5
+ readonly event: PointerEvent;
6
+ }
@@ -1,5 +1,6 @@
1
1
  import type { DiagramEdgePath } from './diagram-edge-path';
2
2
  import type { DiagramMarker } from './diagram-marker';
3
+ import type { DiagramNodeStatus } from './diagram-node-status';
3
4
  import type { DiagramPathEnds } from './diagram-path-ends';
4
5
  import type { DiagramPathResult } from './diagram-path-result';
5
6
  import type { DiagramPoint } from './diagram-point';
@@ -46,4 +47,11 @@ export interface DiagramEdge {
46
47
  selectable?: boolean;
47
48
  /** `false` keeps the user from deleting it. Default: `true`. */
48
49
  deletable?: boolean;
50
+ /**
51
+ * What the connection is doing as a run goes along it, as `Diagram.setEdgeStatus` writes it: the same statuses as a
52
+ * node's, drawn in the look's colors of them unless the connection has a `color` of its own.
53
+ */
54
+ status?: DiagramNodeStatus;
55
+ /** A short text with the status, such as how many rows went along: in the line's tip and said with it. */
56
+ statusText?: string;
49
57
  }
@@ -7,6 +7,7 @@ import type { DiagramEdgePath } from './diagram-edge-path';
7
7
  import type { DiagramEdgeReshapedEventArgs } from './diagram-edge-reshaped-event-args';
8
8
  import type { DiagramEdgeReshapingEventArgs } from './diagram-edge-reshaping-event-args';
9
9
  import type { DiagramNode } from './diagram-node';
10
+ import type { DiagramPointerAct } from './diagram-node-host';
10
11
  import type { DiagramNodeView } from './DiagramNodeView';
11
12
  import type { DiagramPoint } from './diagram-point';
12
13
  import type { DiagramReconnectedEventArgs } from './diagram-reconnected-event-args';
@@ -16,6 +17,8 @@ import type { DiagramViewport } from './diagram-viewport';
16
17
  export interface DiagramLinksHost<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> extends DiagramAutoPanHost {
17
18
  /** A click on a connection, which selects it. */
18
19
  edgeClicked(edge: E, e: MouseEvent): void;
20
+ /** What else the pointer did on a connection: a double click, a right click, or it came over the line or left it. */
21
+ edgeTold(what: Exclude<DiagramPointerAct, 'click'>, edge: E, e: MouseEvent): void;
19
22
  /** The connections: the array the diagram was given, which a new connection is added to. */
20
23
  edges(): E[];
21
24
  view(id: string): DiagramNodeView<N> | undefined;
@@ -0,0 +1,23 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ import type { DiagramPoint } from './diagram-point';
3
+ /**
4
+ * A node clicked, double-clicked or asked for its context menu: with the pointer, or with the keys on the node under
5
+ * them (Alt+Enter stands for a double click; the Menu key or Shift+F10 for the context menu).
6
+ */
7
+ export interface DiagramNodeClickEventArgs<N extends DiagramNode = DiagramNode> {
8
+ readonly node: N;
9
+ /** The browser's event: the pointer's, or the key's. */
10
+ readonly event: MouseEvent | KeyboardEvent;
11
+ /** Whether a key asked for it. */
12
+ readonly byKeyboard: boolean;
13
+ /**
14
+ * Where it happened on the page, in pixels: the pointer, or the middle of the node for a key. A context menu opens
15
+ * there with `menu.open(e.at, diagram)`.
16
+ */
17
+ readonly at: DiagramPoint;
18
+ /**
19
+ * With `true`, the diagram skips its own response: a double click does not edit the node's text, and the browser
20
+ * shows its own context menu. A click has none, as a press selects the node before it.
21
+ */
22
+ cancel: boolean;
23
+ }
@@ -23,4 +23,9 @@ export interface DiagramNodeContext<N extends DiagramNode = DiagramNode> {
23
23
  * and the diagram says it, in place of the node's `text`. For a name the user changes inside the content.
24
24
  */
25
25
  label(read: () => string): void;
26
+ /**
27
+ * Makes `part` the place that shows the node's `text`: an edit of the text in place (`textEditable`) opens over it,
28
+ * and a double click on it starts one. Without it, a kind with content of its own has its text edited over the node.
29
+ */
30
+ textPart(part: ComponentBase): void;
26
31
  }
@@ -20,4 +20,8 @@ export interface DiagramNodeHost<N extends DiagramNode = DiagramNode> {
20
20
  pressed(view: DiagramNodeView<N>, port: DiagramPort | null, e: PointerEvent, drags: boolean): void;
21
21
  /** A press on a resize handle of the node. */
22
22
  resizePressed(view: DiagramNodeView<N>, side: DiagramResizeSide, e: PointerEvent): void;
23
+ /** What the pointer did on the node, off its ports and handles: a click, a double click, a right click, or it came over the node or left it. */
24
+ told(what: DiagramPointerAct, view: DiagramNodeView<N>, e: MouseEvent): void;
23
25
  }
26
+ /** What the pointer did on a node or a connection. */
27
+ export type DiagramPointerAct = 'click' | 'dblclick' | 'contextmenu' | 'enter' | 'leave';
@@ -0,0 +1,6 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ /** The pointer came over a node or left it: over its content, its ports and its frame alike. */
3
+ export interface DiagramNodePointerEventArgs<N extends DiagramNode = DiagramNode> {
4
+ readonly node: N;
5
+ readonly event: PointerEvent;
6
+ }