@fusion.dev/helix-headless 0.241.2 → 0.242.0

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 (91) hide show
  1. package/api.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/chat/composer/chat-composer.d.ts +8 -1
  4. package/dist/chat/composer/chat-composer.js +15 -1
  5. package/dist/chat/message/chat-message.d.ts +12 -0
  6. package/dist/chat/message/chat-message.js +8 -0
  7. package/dist/chat/root/chat-root.d.ts +9 -0
  8. package/dist/chat/root/chat-root.js +13 -1
  9. package/dist/code-editor/root/code-editor-root.d.ts +1 -0
  10. package/dist/code-editor/root/code-editor-root.js +1 -1
  11. package/dist/column-manager/root/column-manager-root.d.ts +30 -2
  12. package/dist/column-manager/root/column-manager-root.js +73 -9
  13. package/dist/combobox/root/combobox-root.d.ts +8 -1
  14. package/dist/combobox/root/combobox-root.js +19 -2
  15. package/dist/data-table/binding.d.ts +22 -0
  16. package/dist/data-table/binding.js +52 -7
  17. package/dist/data-table/root/data-table-root.d.ts +34 -6
  18. package/dist/data-table/root/data-table-root.js +42 -7
  19. package/dist/date-input/root/date-input-root.d.ts +8 -1
  20. package/dist/date-input/root/date-input-root.js +19 -2
  21. package/dist/date-picker/root/date-picker-root.d.ts +5 -0
  22. package/dist/date-picker/root/date-picker-root.js +3 -0
  23. package/dist/editor/root/editor-root.d.ts +1 -0
  24. package/dist/editor/root/editor-root.js +1 -1
  25. package/dist/element-events.generated.js +2 -0
  26. package/dist/file-input/root/file-input-root.d.ts +8 -1
  27. package/dist/file-input/root/file-input-root.js +19 -2
  28. package/dist/filter-input/root/filter-input-root.d.ts +8 -1
  29. package/dist/filter-input/root/filter-input-root.js +13 -1
  30. package/dist/find/root/find-root.d.ts +1 -0
  31. package/dist/find/root/find-root.js +4 -4
  32. package/dist/hover-card/index.d.ts +1 -0
  33. package/dist/hover-card/index.js +1 -0
  34. package/dist/hover-card/root/hover-card-root.d.ts +122 -0
  35. package/dist/hover-card/root/hover-card-root.js +185 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/index.js +2 -0
  38. package/dist/line-chart/root/line-chart-root.d.ts +7 -1
  39. package/dist/line-chart/root/line-chart-root.js +6 -0
  40. package/dist/list/root/list-root.d.ts +12 -1
  41. package/dist/list/root/list-root.js +11 -1
  42. package/dist/log/line/log-line.d.ts +11 -0
  43. package/dist/log/line/log-line.js +8 -0
  44. package/dist/log/root/log-root.d.ts +9 -0
  45. package/dist/log/root/log-root.js +13 -1
  46. package/dist/meter/root/meter-root.d.ts +12 -1
  47. package/dist/meter/root/meter-root.js +31 -2
  48. package/dist/navigation/root/navigation-root.d.ts +5 -1
  49. package/dist/navigation/root/navigation-root.js +13 -1
  50. package/dist/notifications/root/notifications-root.d.ts +10 -1
  51. package/dist/notifications/root/notifications-root.js +12 -1
  52. package/dist/object-inspector/root/object-inspector-root.js +6 -6
  53. package/dist/pagination/root/pagination-root.d.ts +16 -1
  54. package/dist/pagination/root/pagination-root.js +19 -1
  55. package/dist/popover/root/popover-root.d.ts +6 -0
  56. package/dist/popover/root/popover-root.js +2 -0
  57. package/dist/progress/root/progress-root.d.ts +11 -1
  58. package/dist/progress/root/progress-root.js +29 -2
  59. package/dist/sparkline/root/sparkline-root.d.ts +3 -1
  60. package/dist/sparkline/root/sparkline-root.js +8 -1
  61. package/dist/stat/root/stat-root.d.ts +22 -1
  62. package/dist/stat/root/stat-root.js +27 -4
  63. package/dist/table/root/table-root.d.ts +22 -5
  64. package/dist/table/root/table-root.js +13 -1
  65. package/dist/tabs/root/tabs-root.d.ts +6 -1
  66. package/dist/tabs/root/tabs-root.js +12 -1
  67. package/dist/tag/group/tag-group.d.ts +13 -1
  68. package/dist/tag/group/tag-group.js +12 -1
  69. package/dist/terminal/root/terminal-root.d.ts +1 -0
  70. package/dist/terminal/root/terminal-root.js +1 -1
  71. package/dist/theme-toggle/index.d.ts +1 -0
  72. package/dist/theme-toggle/index.js +1 -0
  73. package/dist/theme-toggle/root/theme-toggle-root.d.ts +98 -0
  74. package/dist/theme-toggle/root/theme-toggle-root.js +68 -0
  75. package/dist/time-input/root/time-input-root.d.ts +8 -1
  76. package/dist/time-input/root/time-input-root.js +19 -2
  77. package/dist/timeline/root/timeline-root.d.ts +10 -1
  78. package/dist/timeline/root/timeline-root.js +11 -1
  79. package/dist/toggle/group/toggle-group.d.ts +5 -1
  80. package/dist/toggle/group/toggle-group.js +12 -2
  81. package/dist/tree/root/tree-root.d.ts +13 -1
  82. package/dist/tree/root/tree-root.js +11 -1
  83. package/dist/trend/root/trend-root.d.ts +14 -1
  84. package/dist/trend/root/trend-root.js +20 -2
  85. package/examples.json +1 -1
  86. package/lint.json +1 -1
  87. package/package.json +5 -5
  88. package/types/jsx.d.ts +425 -10
  89. package/types/svelte.d.ts +2 -0
  90. package/types/vue.d.ts +249 -8
  91. package/types/words.d.ts +8 -0
@@ -1,4 +1,4 @@
1
- import { HelixFormElement } from '@fusion.dev/helix-core';
1
+ import { HelixFormElement, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../tooltip/index.js';
4
4
  /**
@@ -439,6 +439,13 @@ export declare class HelixHeadlessChatComposer extends HelixHeadlessChatComposer
439
439
  * draws, and a picture of a key is not turned round with the text.
440
440
  */
441
441
  protected renderSend(): TemplateResult;
442
+ /**
443
+ * Sliding what the draft carries to their new places as they come and go: one arriving
444
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
445
+ * `--chat-composer-move-duration` and `--chat-composer-move-easing`, which this tier never
446
+ * sets, so it moves nothing until a stylesheet does.
447
+ */
448
+ protected readonly motion: LayoutMotionController;
442
449
  /**
443
450
  * What the draft carries, the field, and a row of tools under it.
444
451
  *
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { customElement, DelayController, deepActiveElement, HelixFormElement, hostAria, internalsOf, MixinVoice, markRegion, motionPaused, numberConverter, onMotionChange, pressedOwnControl, reducedMotion, SPOKEN_RULE, timeConverter, words, } from '@fusion.dev/helix-core';
2
+ import { customElement, DelayController, deepActiveElement, HelixFormElement, hostAria, internalsOf, LayoutMotionController, MixinVoice, markRegion, motionPaused, numberConverter, onMotionChange, pressedOwnControl, reducedMotion, SPOKEN_RULE, timeConverter, words, } from '@fusion.dev/helix-core';
3
3
  import { arrowElbowDownLeft, stop } from '@fusion.dev/helix-icons';
4
4
  import { html, nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
@@ -70,6 +70,20 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends MixinVoi
70
70
  this.focused = event.type === 'focus';
71
71
  this.turnExamples();
72
72
  };
73
+ this.motion = new LayoutMotionController(this, {
74
+ arriveIntoEmpty: true,
75
+ items: () => (this.renderRoot
76
+ ?.querySelector('slot[name="attachments"]')
77
+ ?.assignedElements() ?? []).filter((one) => one instanceof HTMLElement),
78
+ leaving: () => this.partNamed('attachments'),
79
+ timing: () => {
80
+ const style = getComputedStyle(this);
81
+ return {
82
+ duration: style.getPropertyValue('--chat-composer-move-duration'),
83
+ easing: style.getPropertyValue('--chat-composer-move-easing'),
84
+ };
85
+ },
86
+ });
73
87
  this.handleInput = (event) => {
74
88
  event.stopPropagation();
75
89
  this.value = event.target.value;
@@ -68,8 +68,20 @@ export declare const FAILED_LABEL = "Not sent";
68
68
  * @csspart state - The text that names the turn's state, when there is one to show.
69
69
  * @csspart time - The turn's time.
70
70
  * @csspart work - The box around the `work` slot, above the content.
71
+ *
72
+ * @cssstate arriving - The message was added at the end of a conversation already drawn.
71
73
  */
72
74
  export declare class HelixHeadlessChatMessage extends HelixElement {
75
+ /**
76
+ * **Arriving, where it joins the end of a conversation already drawn**:
77
+ * `:state(arriving)`, which a stylesheet can bring it in by. Not where it
78
+ * was there as the conversation first drew, which is what the page came with, not
79
+ * history loaded above, and not inside a conversation that draws its turns from
80
+ * data, which marks its own.
81
+ */
82
+ connectedCallback(): void;
83
+ /** Whether it joined one already drawn, as `:state(arriving)` says, for the tier above to bring it in by. */
84
+ protected arriving: boolean;
73
85
  /**
74
86
  * The key this part's words are registered under, its styled tag:
75
87
  * `registerWords('de', { 'helix-chat-message': { retryLabel: 'Erneut versuchen' } })`.
@@ -9,6 +9,7 @@ export const FAILED_LABEL = 'Not sent';
9
9
  let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixElement {
10
10
  constructor() {
11
11
  super(...arguments);
12
+ this.arriving = false;
12
13
  this.at = '';
13
14
  this.authorLabel = '';
14
15
  this.failedLabel = 'Not sent';
@@ -47,6 +48,13 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
47
48
  });
48
49
  };
49
50
  }
51
+ connectedCallback() {
52
+ super.connectedCallback();
53
+ const parent = this.parentElement;
54
+ const later = (one) => one !== null && (one.localName === this.localName || later(one.nextElementSibling));
55
+ this.arriving = parent?.hasUpdated === true && !later(this.nextElementSibling);
56
+ this.toggleState('arriving', this.arriving);
57
+ }
50
58
  static { this.words = 'helix-chat-message'; }
51
59
  get moment() {
52
60
  if (this.at === '') {
@@ -710,6 +710,15 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
710
710
  * different outline.
711
711
  */
712
712
  protected renderPlaceholder(): TemplateResult;
713
+ /** The last turn's key and how many turns there were, at the last render, to tell a turn arriving from history loading. */
714
+ private lastTurn;
715
+ /**
716
+ * From which turn on the turns are new at the end of the conversation this
717
+ * render, or none: a turn added after the last one, not history loaded
718
+ * above it and not a turn scrolled back into view. Those take
719
+ * `data-arriving` for this render, which a stylesheet can bring in by.
720
+ */
721
+ private arrivingFrom;
713
722
  /** The turns fed as data, a window of them, between the room the rest would take. */
714
723
  private renderTurns;
715
724
  /**
@@ -710,11 +710,23 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
710
710
  </div>
711
711
  </div>`;
712
712
  }
713
+ arrivingFrom() {
714
+ const turns = this.turns;
715
+ const keyOf = (at) => turns[at]?.key ?? at;
716
+ const was = this.lastTurn;
717
+ this.lastTurn =
718
+ turns.length > 0 ? { count: turns.length, key: keyOf(turns.length - 1) } : undefined;
719
+ if (!this.hasUpdated || was === undefined || turns.length <= was.count) {
720
+ return Number.POSITIVE_INFINITY;
721
+ }
722
+ return keyOf(was.count - 1) === was.key ? was.count : Number.POSITIVE_INFINITY;
723
+ }
713
724
  renderTurns() {
714
725
  const { after, before, first, last } = this.virtualize.window;
715
726
  const message = this.tag('chat-message');
727
+ const arriving = this.arrivingFrom();
716
728
  return html `<div part="before" role="presentation" style="block-size: ${before}px; flex: none"></div>
717
- ${repeat(this.turns.slice(first, last), (turn, offset) => turn.key ?? first + offset, (turn, offset) => html `<div part="turn" data-index=${first + offset}>
729
+ ${repeat(this.turns.slice(first, last), (turn, offset) => turn.key ?? first + offset, (turn, offset) => html `<div part="turn" data-index=${first + offset} ?data-arriving=${first + offset >= arriving}>
718
730
  <${message}
719
731
  exportparts="actions: message-actions, attachments: message-attachments, avatar: message-avatar, body: message-body,
720
732
  content: message-content, indicator: message-indicator, mark: message-mark, message,
@@ -193,6 +193,7 @@ declare const HelixHeadlessCodeEditor_base: (new (...args: any[]) => import("@fu
193
193
  * @csspart find-replace-toggle - The button that shows the replace field under the find field. Expanded while it shows. Not drawn while `readonly`.
194
194
  * @csspart find-replace-toggle-button - The find and replace button's inner button.
195
195
  * @csspart find-replace-toggle-live - The find and replace button's live region, which speaks while the button is pending.
196
+ * @csspart find-replace-toggle-mark - The caret on the find bar's replace toggle, which points down while the replace row shows and along the line while it is shut.
196
197
  * @csspart find-replace-toggle-spinner - The ring the find and replace button turns while it is pending.
197
198
  * @csspart find-replace-toggle-text - The box the find and replace button's icon sits in.
198
199
  * @csspart find-toggle - The button in the header that opens and closes the find bar. Expanded while it is open.
@@ -362,7 +362,7 @@ let HelixHeadlessCodeEditor = class HelixHeadlessCodeEditor extends MixinControl
362
362
  const find = this.tag('find');
363
363
  return html `<${find}
364
364
  part="find"
365
- exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace: find-replace, replace-all: find-replace-all, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle: find-replace-toggle, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
365
+ exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace: find-replace, replace-all: find-replace-all, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle: find-replace-toggle, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-mark: find-replace-toggle-mark, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
366
366
  close-label=${this.findCloseLabel}
367
367
  controls-label=${this.findControlsLabel}
368
368
  invalid-label=${this.findInvalidLabel}
@@ -1,4 +1,4 @@
1
- import { HelixElement } from '@fusion.dev/helix-core';
1
+ import { HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { type TemplateResult } from 'lit';
3
3
  import { TableBinding, type ToolColumn, type ToolTable } from '../../data-table/binding.js';
4
4
  import '../../checkbox/index.js';
@@ -17,7 +17,8 @@ import '../../checkbox/index.js';
17
17
  * Each row has:
18
18
  *
19
19
  * - A checkbox that shows or hides the column. The last column showing cannot be hidden.
20
- * - A grip that moves the column. Drag it, or press Alt with Up or Down.
20
+ * - A grip that moves the column. Drag it, or press Alt with Up or Down. While
21
+ * a row is dragged, a line marks the gap it will land in.
21
22
  * - A pin button that pins the column to the start of the row, then to the end, then unpins it.
22
23
  * A pinned column stays in view while the table scrolls sideways.
23
24
  * - A note that says "Pinned", or "Hidden at this width" for a column the table leaves out
@@ -58,6 +59,7 @@ import '../../checkbox/index.js';
58
59
  * @csspart checkbox-mark-checked - Added to `checkbox-mark` while the column shows.
59
60
  * @csspart checkbox-mark-dash - Forwarded from the checkbox. Not shown, since a column is shown or hidden.
60
61
  * @csspart checkbox-mark-indeterminate - Forwarded from the checkbox. Not shown, since a column is shown or hidden.
62
+ * @csspart drop - The line that marks where a dragged row will land. It carries `data-at` while it marks a gap, and that gap's place down the element as `--_column-manager-drop-y`. Hidden until a stylesheet shows it, so the headless tier lays out as it did without it.
61
63
  * @csspart grip - The button that moves a column.
62
64
  * @csspart grip-mark - The icon on the grip.
63
65
  * @csspart header - The row above the list that holds the title and the reset button.
@@ -116,9 +118,23 @@ export declare class HelixHeadlessColumnManager extends HelixElement {
116
118
  private said;
117
119
  /** The field being dragged, while a pointer drags one. */
118
120
  private dragging;
121
+ /**
122
+ * The gap a dragged row would land in, as its place among the rows, `0`
123
+ * before the first, and how far down the list the middle of that gap is.
124
+ * Absent where dropping would move nothing.
125
+ */
126
+ private dropGap;
119
127
  /** The columns as the list first read them, which Reset puts back. */
120
128
  private first;
121
129
  protected readonly binding: TableBinding;
130
+ /**
131
+ * Sliding each column's row to its new place as the order changes, by a
132
+ * drop, by Alt with an arrow, by a pin, or by Reset, so the reader sees
133
+ * where a column went rather than the list redrawn in a new order. Timed by
134
+ * `--column-manager-move-duration` and `--column-manager-move-easing`,
135
+ * which this tier never sets, so it moves nothing until a stylesheet does.
136
+ */
137
+ protected readonly motion: LayoutMotionController;
122
138
  /** The bound table, once it is in the tree. */
123
139
  get table(): ToolTable | null;
124
140
  /** The columns with a field, in the order the table shows them. */
@@ -136,8 +152,20 @@ export declare class HelixHeadlessColumnManager extends HelixElement {
136
152
  protected willUpdate(): void;
137
153
  private readonly handleKey;
138
154
  private readonly handleDragStart;
155
+ /**
156
+ * **The gap under the pointer**: before the row it is over in that row's
157
+ * upper half, after it in the lower half. Measured from the element's top,
158
+ * which the line is placed against, beside the list so the list holds only
159
+ * the columns.
160
+ */
139
161
  private readonly handleDragOver;
162
+ /** Over the list between two rows, the line holds where it was. */
163
+ private readonly handleListOver;
164
+ /** Out of the list, the line goes, and a drop there moves nothing. */
165
+ private readonly handleListLeave;
166
+ /** Moves the dragged row into the gap the line marks. */
140
167
  private readonly handleDrop;
168
+ private readonly handleDragEnd;
141
169
  protected renderItem(table: ToolTable, column: ToolColumn, onlyShown: boolean): TemplateResult;
142
170
  protected render(): TemplateResult;
143
171
  }
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { customElement, formatWords, HelixElement, words, } from '@fusion.dev/helix-core';
2
+ import { customElement, formatWords, HelixElement, LayoutMotionController, words, } from '@fusion.dev/helix-core';
3
3
  import { dotsSixVertical, pushPin, pushPinSlash } from '@fusion.dev/helix-icons';
4
4
  import { nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
@@ -25,8 +25,20 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
25
25
  this.unpinLabel = 'Unpin {name}';
26
26
  this.said = '';
27
27
  this.dragging = undefined;
28
+ this.dropGap = undefined;
28
29
  this.first = undefined;
29
30
  this.binding = new TableBinding(this);
31
+ this.motion = new LayoutMotionController(this, {
32
+ items: () => [...(this.renderRoot?.querySelectorAll('[part~="item"]') ?? [])],
33
+ timing: () => {
34
+ const style = getComputedStyle(this);
35
+ return {
36
+ duration: style.getPropertyValue('--column-manager-move-duration'),
37
+ easing: style.getPropertyValue('--column-manager-move-easing'),
38
+ };
39
+ },
40
+ watch: 'updates',
41
+ });
30
42
  this.handleKey = (event, field) => {
31
43
  if (!event.altKey || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) {
32
44
  return;
@@ -48,21 +60,58 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
48
60
  event.dataTransfer.effectAllowed = 'move';
49
61
  }
50
62
  };
51
- this.handleDragOver = (event) => {
63
+ this.handleDragOver = (event, field) => {
64
+ const table = this.table;
65
+ if (this.dragging === undefined || !table) {
66
+ return;
67
+ }
68
+ event.preventDefault();
69
+ const row = event.currentTarget;
70
+ const list = this.partNamed('list');
71
+ const box = row.getBoundingClientRect();
72
+ const after = event.clientY > box.top + box.height / 2;
73
+ const fields = this.columns(table).map((column) => column.field);
74
+ const at = fields.indexOf(field) + (after ? 1 : 0);
75
+ const from = fields.indexOf(this.dragging);
76
+ if (at === from || at === from + 1 || !list) {
77
+ this.dropGap = undefined;
78
+ return;
79
+ }
80
+ const half = (Number.parseFloat(getComputedStyle(list).rowGap) || 0) / 2;
81
+ const y = (after ? box.bottom + half : box.top - half) - this.getBoundingClientRect().top;
82
+ if (this.dropGap?.at !== at || this.dropGap.y !== y) {
83
+ this.dropGap = { at, y };
84
+ }
85
+ };
86
+ this.handleListOver = (event) => {
52
87
  if (this.dragging !== undefined) {
53
88
  event.preventDefault();
54
89
  }
55
90
  };
56
- this.handleDrop = (event, field) => {
91
+ this.handleListLeave = (event) => {
92
+ const list = event.currentTarget;
93
+ if (!list.contains(event.relatedTarget)) {
94
+ this.dropGap = undefined;
95
+ }
96
+ };
97
+ this.handleDrop = (event) => {
57
98
  const table = this.table;
58
99
  const moving = this.dragging;
100
+ const gap = this.dropGap;
59
101
  this.dragging = undefined;
60
- if (!table || moving === undefined || moving === field) {
102
+ this.dropGap = undefined;
103
+ if (!table || moving === undefined || gap === undefined) {
61
104
  return;
62
105
  }
63
106
  event.preventDefault();
64
107
  const fields = this.columns(table).map((column) => column.field);
65
- this.moveColumn(moving, fields.indexOf(field) - fields.indexOf(moving));
108
+ const from = fields.indexOf(moving);
109
+ const to = gap.at > from ? gap.at - 1 : gap.at;
110
+ this.moveColumn(moving, to - from);
111
+ };
112
+ this.handleDragEnd = () => {
113
+ this.dragging = undefined;
114
+ this.dropGap = undefined;
66
115
  };
67
116
  }
68
117
  static { this.words = 'helix-column-manager'; }
@@ -160,9 +209,8 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
160
209
  data-field=${field}
161
210
  draggable="true"
162
211
  @dragstart=${(event) => this.handleDragStart(event, field)}
163
- @dragend=${() => (this.dragging = undefined)}
164
- @dragover=${this.handleDragOver}
165
- @drop=${(event) => this.handleDrop(event, field)}
212
+ @dragend=${this.handleDragEnd}
213
+ @dragover=${(event) => this.handleDragOver(event, field)}
166
214
  @keydown=${(event) => this.handleKey(event, field)}
167
215
  >
168
216
  <button part="grip" type="button" aria-label=${formatWords(this, 'moveLabel', { name })}
@@ -199,11 +247,24 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
199
247
  <span part="title" id="title">${this.label || this.fallbackLabel}</span>
200
248
  <button part="reset" type="button" @click=${() => this.reset()}>${this.resetLabel}</button>
201
249
  </div>
202
- <ul part="list" aria-labelledby="title">
250
+ <ul
251
+ part="list"
252
+ aria-labelledby="title"
253
+ @dragover=${this.handleListOver}
254
+ @dragleave=${this.handleListLeave}
255
+ @drop=${this.handleDrop}
256
+ >
203
257
  ${table
204
258
  ? repeat(columns, (column) => column.field, (column) => this.renderItem(table, column, shownCount <= 1))
205
259
  : nothing}
206
260
  </ul>
261
+ <span
262
+ part="drop"
263
+ aria-hidden="true"
264
+ hidden
265
+ data-at=${this.dropGap?.at ?? nothing}
266
+ style=${this.dropGap ? `--_column-manager-drop-y: ${this.dropGap.y}px` : nothing}
267
+ ></span>
207
268
  <span part="live" aria-live="polite">${this.said}</span>`;
208
269
  }
209
270
  };
@@ -255,6 +316,9 @@ __decorate([
255
316
  __decorate([
256
317
  state()
257
318
  ], HelixHeadlessColumnManager.prototype, "dragging", void 0);
319
+ __decorate([
320
+ state()
321
+ ], HelixHeadlessColumnManager.prototype, "dropGap", void 0);
258
322
  HelixHeadlessColumnManager = __decorate([
259
323
  customElement('helix-headless-column-manager')
260
324
  ], HelixHeadlessColumnManager);
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, HelixFormElement, ListedController, PopoverController, UpgradeController } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixFormElement, LayoutMotionController, ListedController, PopoverController, UpgradeController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../listbox/index.js';
4
4
  import '../../tag/root/index.js';
@@ -153,6 +153,13 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
153
153
  * `registerWords('de', { 'helix-combobox': { noResultsText: 'Keine Treffer' } })`.
154
154
  */
155
155
  static words: string;
156
+ /**
157
+ * Sliding the tags to their new places as they come and go: one arriving
158
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
159
+ * `--combobox-move-duration` and `--combobox-move-easing`, which this tier never
160
+ * sets, so it moves nothing until a stylesheet does.
161
+ */
162
+ protected readonly motion: LayoutMotionController;
156
163
  protected readonly aria: AriaForwardController;
157
164
  /** The region VoiceOver hears the highlight, the count and a choice from. */
158
165
  private readonly status;
@@ -1,8 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, afterLinkFollowed, auditChildren, chosenValues, countLabel, customElement, DelayController, drawAutofill, drawStatus, formatWords, HelixBeforeFilterEvent, HelixFilterEvent, HelixFormElement, handedLocale, internalsOf, ListedController, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, onApple, PopoverController, reportValues, StatusController, submitImplicitly, timeConverter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, afterLinkFollowed, auditChildren, chosenValues, countLabel, customElement, DelayController, drawAutofill, drawStatus, formatWords, HelixBeforeFilterEvent, HelixFilterEvent, HelixFormElement, handedLocale, internalsOf, LayoutMotionController, ListedController, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, onApple, PopoverController, reportValues, StatusController, submitImplicitly, timeConverter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { caretDown } from '@fusion.dev/helix-icons';
4
4
  import { nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
6
+ import { repeat } from 'lit/directives/repeat.js';
6
7
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
7
8
  import { html } from 'lit/static-html.js';
8
9
  import { optionsAmong } from '../../option/among.js';
@@ -15,6 +16,22 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
15
16
  constructor() {
16
17
  super(...arguments);
17
18
  this.listed = new ListedController(this, 'focus', () => internalsOf(this)?.ariaKeyShortcuts);
19
+ this.motion = new LayoutMotionController(this, {
20
+ arriveIntoEmpty: true,
21
+ items: () => [
22
+ ...(this.renderRoot?.querySelectorAll('[part~="tag"]:not([data-leaving])') ??
23
+ []),
24
+ ],
25
+ leaving: () => this.partNamed('field'),
26
+ timing: () => {
27
+ const style = getComputedStyle(this);
28
+ return {
29
+ duration: style.getPropertyValue('--combobox-move-duration'),
30
+ easing: style.getPropertyValue('--combobox-move-easing'),
31
+ };
32
+ },
33
+ watch: 'updates',
34
+ });
18
35
  this.aria = new AriaForwardController(this, {
19
36
  target: () => this.partNamed('control'),
20
37
  });
@@ -663,7 +680,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
663
680
  <div part="field" @click=${this.handleFieldClick}>
664
681
  <slot name="start"></slot>
665
682
  ${this.multiple && this.chosen.length > 0
666
- ? this.renderTokenRow(this.shown.map((option) => this.renderTag(option)), this.restCount)
683
+ ? this.renderTokenRow(repeat(this.shown, (option) => option.value, (option) => this.renderTag(option)), this.restCount)
667
684
  : nothing}
668
685
  <input
669
686
  part="control"
@@ -55,6 +55,12 @@ type BoundHost = ReactiveControllerHost & HTMLElement & {
55
55
  *
56
56
  * **Looked up on every read**, so a table defined after the tool, or one that
57
57
  * replaces another under the same id, is found the next time the tool draws.
58
+ * **And watched for until it is there.** A tool parsed before its table, on a
59
+ * page whose elements are defined before the parser reaches the table, found
60
+ * nothing when it connected and had no reason to draw again: November 17,
61
+ * 2026, a Table Export written above its table read "Export 0 rows" for good.
62
+ * So while the id names nothing, the binding watches the tool's tree for it,
63
+ * and stops once it appears.
58
64
  *
59
65
  * **A controller on the table, and no events.** A page that sets `view` or
60
66
  * `selected` fires nothing, and a table that leaves a column out at a narrow
@@ -67,6 +73,10 @@ export declare class TableBinding implements ReactiveController {
67
73
  private heard;
68
74
  /** Whether the tool has drawn once, after which it looks for the table. */
69
75
  private drawn;
76
+ /** Watches the tool's tree while its `for` names nothing in it. */
77
+ private watching;
78
+ /** The tag the binding is waiting to see defined, so it asks once. */
79
+ private defining;
70
80
  /** What the binding adds to the table it follows. */
71
81
  private readonly watcher;
72
82
  constructor(host: BoundHost);
@@ -79,6 +89,18 @@ export declare class TableBinding implements ReactiveController {
79
89
  hostConnected(): void;
80
90
  hostDisconnected(): void;
81
91
  hostUpdated(): void;
92
+ /**
93
+ * Asks the tool to draw again once the table it names is there and defined:
94
+ * when the id appears in its tree, and when the table's tag is defined. A
95
+ * table defined after the tool upgrades with no event the tool can hear.
96
+ */
97
+ private await;
98
+ /**
99
+ * Draws the tool again once the table's tag is defined, or now where it
100
+ * just appeared already defined.
101
+ */
102
+ private awaitDefined;
103
+ private stopWatching;
82
104
  private listen;
83
105
  private follow;
84
106
  }
@@ -7,6 +7,7 @@ export class TableBinding {
7
7
  this.host = host;
8
8
  this.heard = null;
9
9
  this.drawn = false;
10
+ this.defining = '';
10
11
  this.watcher = {
11
12
  hostUpdated: () => this.host.requestUpdate(),
12
13
  };
@@ -26,20 +27,64 @@ export class TableBinding {
26
27
  }
27
28
  hostConnected() {
28
29
  this.listen();
29
- if (!this.table && this.host.for !== '' && typeof customElements !== 'undefined') {
30
- const scope = this.host.getRootNode();
31
- const tag = scope.getElementById?.(this.host.for)?.localName;
32
- if (tag?.includes('-')) {
33
- customElements.whenDefined(tag).then(() => this.host.requestUpdate());
34
- }
35
- }
30
+ this.await();
36
31
  }
37
32
  hostDisconnected() {
33
+ this.stopWatching();
38
34
  this.follow(null);
39
35
  }
40
36
  hostUpdated() {
41
37
  this.drawn = true;
42
38
  this.listen();
39
+ if (!this.heard) {
40
+ this.await();
41
+ }
42
+ }
43
+ await() {
44
+ if (this.host.for === '' ||
45
+ typeof customElements === 'undefined' ||
46
+ typeof MutationObserver === 'undefined') {
47
+ return;
48
+ }
49
+ const scope = this.host.getRootNode();
50
+ const target = scope.getElementById?.(this.host.for);
51
+ if (target) {
52
+ this.stopWatching();
53
+ this.awaitDefined(target, false);
54
+ return;
55
+ }
56
+ if (this.watching) {
57
+ return;
58
+ }
59
+ this.watching = new MutationObserver(() => {
60
+ const found = scope.getElementById?.(this.host.for);
61
+ if (found) {
62
+ this.stopWatching();
63
+ this.awaitDefined(found, true);
64
+ }
65
+ });
66
+ this.watching.observe(scope, { childList: true, subtree: true });
67
+ }
68
+ awaitDefined(target, appeared) {
69
+ const tag = target.localName;
70
+ if (!tag.includes('-') || customElements.get(tag)) {
71
+ if (appeared) {
72
+ this.host.requestUpdate();
73
+ }
74
+ return;
75
+ }
76
+ if (this.defining === tag) {
77
+ return;
78
+ }
79
+ this.defining = tag;
80
+ void customElements.whenDefined(tag).then(() => {
81
+ this.defining = '';
82
+ this.host.requestUpdate();
83
+ });
84
+ }
85
+ stopWatching() {
86
+ this.watching?.disconnect();
87
+ this.watching = undefined;
43
88
  }
44
89
  listen() {
45
90
  this.follow(this.table);
@@ -1,4 +1,4 @@
1
- import { type DataRow, HelixElement } from '@fusion.dev/helix-core';
1
+ import { type DataRow, HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import type { HelixHeadlessTableColumn } from '../../table/column/table-column.js';
4
4
  import '../../checkbox/index.js';
@@ -180,6 +180,16 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
180
180
  * nothing while a `sort` is set, since the sort decides the order, and a tree
181
181
  * grid draws none.
182
182
  *
183
+ * **Rows slide to their places.** When the table sorts, or `rows` changes,
184
+ * each row it keeps moves from where it was drawn to where it is now, its
185
+ * cells together, and a row it adds fades in. Set `row-key` so a row is known
186
+ * across the change. The table times it from `--data-table-move-duration` and
187
+ * `--data-table-move-easing`, which the styled tier sets from the duration and
188
+ * easing tokens. Here neither is set, so nothing moves until you set them.
189
+ * Under reduced motion nothing moves, whatever they say. A `windowed` table
190
+ * draws only the rows in view, so a sort that brings in other rows fades them
191
+ * in where they land.
192
+ *
183
193
  * **Editable cells.** `editable` on a column lets a reader edit its cells,
184
194
  * and `rowEditable` decides row by row. The column's `type` picks the field:
185
195
  * text, a number, a date, or a select of an enum's values, and a boolean
@@ -355,6 +365,7 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
355
365
  * @csspart pagination - The built-in pagination, when it is shown.
356
366
  * @csspart pagination-first - The pagination's button that goes to the first page, shown with `ends`.
357
367
  * @csspart pagination-gap - The pagination's marker for pages that are not shown.
368
+ * @csspart pagination-indicator - The pagination's mark that moves to the page you are on.
358
369
  * @csspart pagination-item - One item in the pagination's list, holding a page or a gap.
359
370
  * @csspart pagination-last - The pagination's button that goes to the last page, shown with `ends`.
360
371
  * @csspart pagination-list - The pagination's list of pages.
@@ -385,6 +396,8 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
385
396
  * @cssproperty --data-table-cell-align - The alignment of the cell's column: `start`, `center`, or `end`. Unset when the column sets none. The component writes it on each cell it draws, and the stylesheet reads it. `Table` sets `--table-cell-align` for the same purpose.
386
397
  * @cssproperty --data-table-cell-block-align - Where a cell's content sits from top to bottom in a row taller than it: `start`, `center` or `end`. `center` by default. Set it on the table, or on a row through `::part(row)`; a column's `vertical-align` writes it on each of that column's cells, and wins.
387
398
  * @cssproperty --data-table-level - How deep a row is in a tree grid, from 1. The component writes it on each row header cell, and the stylesheet indents by it.
399
+ * @cssproperty --data-table-move-duration - How long a row takes to slide to its new place, or to fade in. Unset, nothing moves.
400
+ * @cssproperty --data-table-move-easing - The curve a row slides and fades in along.
388
401
  * @cssproperty --data-table-pin-offset - How far a pinned column's cell stays from its end of the row, in pixels: the width of the pinned columns before it. The component writes it on each cell of a pinned column, and the stylesheet reads it.
389
402
  * @cssproperty --data-table-template - The column track list, worked out from the columns. The component writes it inline on the element that reads it, so setting it has no effect. Set a column's `width` to change it.
390
403
  *
@@ -675,8 +688,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
675
688
  /**
676
689
  * Lets users reorder the columns.
677
690
  *
678
- * Each heading with a `field` gets a grip, dragged along the header or moved a
679
- * place at a time with the arrow keys once it has focus.
691
+ * Each heading with a `field` gets a grip, moved a place at a time with the
692
+ * arrow keys once it has focus. A pointer drags the grip or the heading
693
+ * itself along the header, and a press that does not travel still sorts.
680
694
  */
681
695
  reorderable: boolean;
682
696
  /**
@@ -915,9 +929,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
915
929
  /** The grid's size as the last render counted it, for the internals. */
916
930
  private counts;
917
931
  /**
918
- * A column dragged by its grip. The headings follow the pointer and the
919
- * order is asked for once it lets go, so a consumer hears one order and not
920
- * the dozen a drag passes through. The arrow keys on a grip move a column a
932
+ * A column dragged by its grip or its heading. The headings follow the
933
+ * pointer and the order is asked for once it lets go, so a consumer hears
934
+ * one order and not the dozen a drag passes through. The arrow keys on a grip move a column a
921
935
  * place each, which `handleGripKey` does, so this only drags.
922
936
  */
923
937
  private readonly columnMoves;
@@ -934,6 +948,20 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
934
948
  private lineOf;
935
949
  /** Said once, so a table that re-renders does not repeat it. */
936
950
  private warnedAboutKey;
951
+ /**
952
+ * Sliding each row it keeps to its new place when the table sorts or `rows`
953
+ * changes. Looked for after each update, because the table draws its rows,
954
+ * and in the box that scrolls them.
955
+ */
956
+ protected readonly motion: LayoutMotionController;
957
+ /**
958
+ * Sliding each column to its new place when it moves, by its menu, its keys
959
+ * or its grip, the cells under it with it, and fading in a column shown
960
+ * again. Measured by the heading, which is the page's element and keeps who
961
+ * it is across the move; the cells are drawn again in their new places, so
962
+ * the ones under the heading after the move are the ones that slide.
963
+ */
964
+ protected readonly columnMotion: LayoutMotionController;
937
965
  private readonly virtualize;
938
966
  /**
939
967
  * The rows in the shadow tree, each with the row of the page it drew.