@fusion.dev/helix-core 0.0.0-dev

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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/custom-elements.json +8005 -0
  3. package/dist/controllers/aria-forward-controller/aria-forward-controller.d.ts +67 -0
  4. package/dist/controllers/aria-forward-controller/aria-forward-controller.js +146 -0
  5. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.d.ts +79 -0
  6. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.js +140 -0
  7. package/dist/controllers/command-controller/command-controller.d.ts +83 -0
  8. package/dist/controllers/command-controller/command-controller.js +93 -0
  9. package/dist/controllers/copy-controller/copy-controller.d.ts +58 -0
  10. package/dist/controllers/copy-controller/copy-controller.js +128 -0
  11. package/dist/controllers/disabled-cascade-controller/disabled-cascade-controller.d.ts +76 -0
  12. package/dist/controllers/disabled-cascade-controller/disabled-cascade-controller.js +67 -0
  13. package/dist/controllers/dismiss-controller/dismiss-controller.d.ts +58 -0
  14. package/dist/controllers/dismiss-controller/dismiss-controller.js +165 -0
  15. package/dist/controllers/drilldown-controller/drilldown-controller.d.ts +127 -0
  16. package/dist/controllers/drilldown-controller/drilldown-controller.js +171 -0
  17. package/dist/controllers/floating-controller/floating-controller.d.ts +123 -0
  18. package/dist/controllers/floating-controller/floating-controller.js +227 -0
  19. package/dist/controllers/focus-trap-controller/focus-trap-controller.d.ts +26 -0
  20. package/dist/controllers/focus-trap-controller/focus-trap-controller.js +93 -0
  21. package/dist/controllers/indicator-controller/indicator-controller.d.ts +97 -0
  22. package/dist/controllers/indicator-controller/indicator-controller.js +164 -0
  23. package/dist/controllers/keyboard-navigation-controller/keyboard-navigation-controller.d.ts +113 -0
  24. package/dist/controllers/keyboard-navigation-controller/keyboard-navigation-controller.js +117 -0
  25. package/dist/controllers/popover-controller/popover-controller.d.ts +132 -0
  26. package/dist/controllers/popover-controller/popover-controller.js +150 -0
  27. package/dist/controllers/source-controller/source-controller.d.ts +55 -0
  28. package/dist/controllers/source-controller/source-controller.js +94 -0
  29. package/dist/controllers/token-color-controller/token-color-controller.d.ts +63 -0
  30. package/dist/controllers/token-color-controller/token-color-controller.js +105 -0
  31. package/dist/controllers/virtualize-controller/virtualize-controller.d.ts +127 -0
  32. package/dist/controllers/virtualize-controller/virtualize-controller.js +216 -0
  33. package/dist/events/element-events.d.ts +4 -0
  34. package/dist/events/element-events.js +34 -0
  35. package/dist/events/events.d.ts +743 -0
  36. package/dist/events/events.js +799 -0
  37. package/dist/helix-element/helix-element.d.ts +201 -0
  38. package/dist/helix-element/helix-element.js +695 -0
  39. package/dist/helix-form-element/helix-form-element.d.ts +152 -0
  40. package/dist/helix-form-element/helix-form-element.js +194 -0
  41. package/dist/index.d.ts +54 -0
  42. package/dist/index.js +54 -0
  43. package/dist/mixins/mixin-chart-source/mixin-chart-source.d.ts +137 -0
  44. package/dist/mixins/mixin-chart-source/mixin-chart-source.js +140 -0
  45. package/dist/mixins/mixin-collection/index.d.ts +1 -0
  46. package/dist/mixins/mixin-collection/index.js +1 -0
  47. package/dist/mixins/mixin-collection/mixin-collection.d.ts +58 -0
  48. package/dist/mixins/mixin-collection/mixin-collection.js +154 -0
  49. package/dist/mixins/mixin-controller-active/mixin-controller-active.d.ts +53 -0
  50. package/dist/mixins/mixin-controller-active/mixin-controller-active.js +155 -0
  51. package/dist/mixins/mixin-controller-checked/mixin-controller-checked.d.ts +54 -0
  52. package/dist/mixins/mixin-controller-checked/mixin-controller-checked.js +157 -0
  53. package/dist/mixins/mixin-controller-open/mixin-controller-open.d.ts +49 -0
  54. package/dist/mixins/mixin-controller-open/mixin-controller-open.js +176 -0
  55. package/dist/mixins/mixin-controller-value/mixin-controller-value.d.ts +73 -0
  56. package/dist/mixins/mixin-controller-value/mixin-controller-value.js +173 -0
  57. package/dist/mixins/mixin-dismissible/mixin-dismissible.d.ts +41 -0
  58. package/dist/mixins/mixin-dismissible/mixin-dismissible.js +79 -0
  59. package/dist/mixins/mixin-field/mixin-field.d.ts +145 -0
  60. package/dist/mixins/mixin-field/mixin-field.js +423 -0
  61. package/dist/utils/anchor-element/anchor-element.d.ts +23 -0
  62. package/dist/utils/anchor-element/anchor-element.js +39 -0
  63. package/dist/utils/capture-pointer/capture-pointer.d.ts +22 -0
  64. package/dist/utils/capture-pointer/capture-pointer.js +30 -0
  65. package/dist/utils/closest-instance/closest-instance.d.ts +25 -0
  66. package/dist/utils/closest-instance/closest-instance.js +34 -0
  67. package/dist/utils/create-sheet/create-sheet.d.ts +16 -0
  68. package/dist/utils/create-sheet/create-sheet.js +16 -0
  69. package/dist/utils/custom-element/custom-element.d.ts +26 -0
  70. package/dist/utils/custom-element/custom-element.js +114 -0
  71. package/dist/utils/draw-icon/draw-icon.d.ts +38 -0
  72. package/dist/utils/draw-icon/draw-icon.js +39 -0
  73. package/dist/utils/draw-tooltip/draw-tooltip.d.ts +56 -0
  74. package/dist/utils/draw-tooltip/draw-tooltip.js +89 -0
  75. package/dist/utils/elapsed-time/elapsed-time.d.ts +10 -0
  76. package/dist/utils/elapsed-time/elapsed-time.js +117 -0
  77. package/dist/utils/focusable-elements/focusable-elements.d.ts +40 -0
  78. package/dist/utils/focusable-elements/focusable-elements.js +88 -0
  79. package/dist/utils/format-numbers/format-numbers.d.ts +1 -0
  80. package/dist/utils/format-numbers/format-numbers.js +29 -0
  81. package/dist/utils/host-aria/host-aria.d.ts +38 -0
  82. package/dist/utils/host-aria/host-aria.js +41 -0
  83. package/dist/utils/inherit-disabled/inherit-disabled.d.ts +33 -0
  84. package/dist/utils/inherit-disabled/inherit-disabled.js +55 -0
  85. package/dist/utils/line-path/line-path.d.ts +23 -0
  86. package/dist/utils/line-path/line-path.js +107 -0
  87. package/dist/utils/on-unless-false/on-unless-false.d.ts +28 -0
  88. package/dist/utils/on-unless-false/on-unless-false.js +32 -0
  89. package/dist/utils/read-series/read-series.d.ts +78 -0
  90. package/dist/utils/read-series/read-series.js +187 -0
  91. package/dist/utils/relative-time/relative-time.d.ts +24 -0
  92. package/dist/utils/relative-time/relative-time.js +84 -0
  93. package/dist/utils/request-change/request-change.d.ts +48 -0
  94. package/dist/utils/request-change/request-change.js +7 -0
  95. package/dist/utils/resolve-active-item/resolve-active-item.d.ts +28 -0
  96. package/dist/utils/resolve-active-item/resolve-active-item.js +21 -0
  97. package/dist/utils/restore-value/restore-value.d.ts +32 -0
  98. package/dist/utils/restore-value/restore-value.js +84 -0
  99. package/dist/utils/scale/scale.d.ts +23 -0
  100. package/dist/utils/scale/scale.js +32 -0
  101. package/dist/utils/scale/ticks.d.ts +27 -0
  102. package/dist/utils/scale/ticks.js +52 -0
  103. package/dist/utils/scroll-item-into-view/scroll-item-into-view.d.ts +10 -0
  104. package/dist/utils/scroll-item-into-view/scroll-item-into-view.js +98 -0
  105. package/dist/utils/slot-filled/slot-filled.d.ts +26 -0
  106. package/dist/utils/slot-filled/slot-filled.js +26 -0
  107. package/dist/utils/tell-disclosure/tell-disclosure.d.ts +51 -0
  108. package/dist/utils/tell-disclosure/tell-disclosure.js +76 -0
  109. package/dist/utils/ticker/ticker.d.ts +8 -0
  110. package/dist/utils/ticker/ticker.js +55 -0
  111. package/dist/utils/tone-marks/tone-marks.d.ts +52 -0
  112. package/dist/utils/tone-marks/tone-marks.js +36 -0
  113. package/dist/utils/value-as/value-as.d.ts +64 -0
  114. package/dist/utils/value-as/value-as.js +105 -0
  115. package/package.json +58 -0
@@ -0,0 +1,743 @@
1
+ /**
2
+ * Event classes, one per event a Helix component dispatches.
3
+ *
4
+ * A named class rather than `dispatchEvent(new CustomEvent(name, …))` for three
5
+ * reasons, all of them about the type reaching a consumer:
6
+ *
7
+ * 1. `@event {HelixBeforeOpenEvent} helix-before-open` puts the class name in the manifest,
8
+ * which is what lets the React generator emit a typed callback instead of
9
+ * `(detail: unknown)`.
10
+ * 2. The augmentation of `HTMLElementEventMap` below types `addEventListener`
11
+ * for consumers writing plain HTML, who never see the React wrappers.
12
+ * 3. The event name lives on the class as `eventName`, so a listener and a
13
+ * dispatch cannot disagree about the string.
14
+ */
15
+ /** Detail carried by `helix-before-open` and `helix-before-close`. */
16
+ export interface OpenDetail {
17
+ /** The state the element is moving to. */
18
+ open: boolean;
19
+ }
20
+ /**
21
+ * Fired when an element is about to open.
22
+ *
23
+ * Cancelable: `preventDefault()` refuses the change, and the element stays
24
+ * closed. Paired with `helix-before-close` rather than being one event carrying a
25
+ * boolean, so a listener that only cares about one direction says so by which
26
+ * event it listens for.
27
+ *
28
+ * Neither bubbles nor composed. A dialog inside a drawer inside a popover is
29
+ * three overlays, and an inner one opening must not read as the outer one
30
+ * opening.
31
+ */
32
+ export declare class HelixBeforeOpenEvent extends CustomEvent<OpenDetail> {
33
+ static readonly eventName = "helix-before-open";
34
+ constructor();
35
+ }
36
+ /** Fired when an element is about to close. See `HelixBeforeOpenEvent`. */
37
+ export declare class HelixBeforeCloseEvent extends CustomEvent<OpenDetail> {
38
+ static readonly eventName = "helix-before-close";
39
+ constructor();
40
+ }
41
+ /**
42
+ * Fired when the reader asks for the next thing in a set.
43
+ *
44
+ * Paired with `helix-previous` rather than being one event carrying a
45
+ * direction, which is the reason `helix-before-open` gives for its own pair: a
46
+ * listener that only cares about one direction says so by which event it
47
+ * listens for. The detail carries the direction anyway, so a consumer who does
48
+ * want one handler can have one.
49
+ *
50
+ * Bubbles and is composed, because the thing that answers this is usually not
51
+ * the thing that asked. A video has no notion of a set: it plays one resource,
52
+ * and what comes next is a playlist's business or the consumer's, so the event
53
+ * has to reach a wrapper.
54
+ *
55
+ * Not cancelable. There is no default action to refuse: the component that
56
+ * fires this does nothing on its own, and an event whose `preventDefault` means
57
+ * nothing is an event that lies about what it offers.
58
+ */
59
+ export declare class HelixNextEvent extends CustomEvent<SkipDetail> {
60
+ static readonly eventName = "helix-next";
61
+ constructor();
62
+ }
63
+ /** Fired when the reader asks for the previous one. See `HelixNextEvent`. */
64
+ export declare class HelixPreviousEvent extends CustomEvent<SkipDetail> {
65
+ static readonly eventName = "helix-previous";
66
+ constructor();
67
+ }
68
+ /** Detail carried by `helix-next` and `helix-previous`. */
69
+ export interface SkipDetail {
70
+ /** Which way the reader asked to go. */
71
+ to: 'next' | 'previous';
72
+ }
73
+ /** Detail carried by `helix-navigate`. */
74
+ export interface NavigateDetail {
75
+ /** Where the view is moving to, in whatever the component pages by. */
76
+ value: string;
77
+ }
78
+ /** Detail carried by `helix-filter`. */
79
+ export interface FilterDetail {
80
+ /** What the list is being narrowed to. */
81
+ value: string;
82
+ }
83
+ /** Detail carried by `helix-read`. */
84
+ export interface ReadDetail {
85
+ /**
86
+ * The state being asked for, as a boolean rather than a word that reads like
87
+ * one, which is `helix-toggle`'s rule and for the same reason: `"false"` is
88
+ * truthy and a consumer who forgets that marks everything read.
89
+ */
90
+ read: boolean;
91
+ }
92
+ /** Detail carried by `helix-send`. */
93
+ export interface SendDetail {
94
+ /** What the reader wrote, as they left it. */
95
+ value: string;
96
+ }
97
+ /** Detail carried by `helix-sort`. */
98
+ export interface SortDetail {
99
+ /**
100
+ * The order being asked for, as `field:direction`.
101
+ *
102
+ * **One string rather than a field and a direction beside it**, because a sort
103
+ * is one fact and two properties holding half of it each is the mistake
104
+ * `helix-table`'s `columns` string already made in this family: the headings
105
+ * and the widths were two halves of one thing kept in two places with nothing
106
+ * holding them together. `name:asc` is also what a URL query carries and what
107
+ * an API takes, so a consumer syncing either does no translation.
108
+ *
109
+ * Empty means unsorted, which is a state a reader can ask for: a third click
110
+ * on a sortable heading returns the set to the order it arrived in, and that
111
+ * order is information the data came with.
112
+ */
113
+ value: string;
114
+ }
115
+ /** Detail carried by `helix-dismiss`. */
116
+ export interface DismissDetail {
117
+ /** Text content of the element asking to go, for identifying which it was. */
118
+ label: string;
119
+ }
120
+ /** What a stop's own controls ask the tour to do. */
121
+ export interface TourAskDetail {
122
+ /**
123
+ * Which control was pressed.
124
+ */
125
+ what: 'back' | 'next' | 'skip';
126
+ }
127
+ /**
128
+ * A stop asking the tour to move.
129
+ *
130
+ * Composed and bubbling, because a stop is slotted into the root and the root
131
+ * has to hear it across that boundary.
132
+ *
133
+ * **A class rather than the raw `CustomEvent` this was.** It dispatched, it
134
+ * bubbled, and it was invisible: `check:events` matches `new HelixSomethingEvent(`,
135
+ * so a hand-rolled `CustomEvent` was not held to being declared, and nothing
136
+ * carried it into the manifest. Consumers could hear it and could not find it,
137
+ * which is the trap #75 is about, in its purest form.
138
+ */
139
+ export declare class HelixTourAskEvent extends CustomEvent<TourAskDetail> {
140
+ static readonly eventName = "helix-tour-ask";
141
+ constructor(detail: TourAskDetail);
142
+ }
143
+ /**
144
+ * The eyedropper opening, and closing again.
145
+ *
146
+ * Two events rather than one carrying a flag, because what a consumer does with
147
+ * them is not symmetrical: the surface holding the picker has to get out of the
148
+ * way for the sample and come back afterwards, and those are two moments with
149
+ * different work in each.
150
+ *
151
+ * **A class rather than the bare `Event` these were.** They dispatched, they
152
+ * bubbled, `ColorInput` bound both, and `check:events` matched
153
+ * `new CustomEvent(` and so held neither to being declared: two pieces of
154
+ * public API that a consumer could hear and could not find. The check reads
155
+ * `new Event(` now as well.
156
+ *
157
+ * No detail, because there is nothing to say beyond that it happened.
158
+ */
159
+ export declare class HelixSampleStartEvent extends Event {
160
+ static readonly eventName = "helix-sample-start";
161
+ constructor();
162
+ }
163
+ /** The eyedropper closing, whether or not a color was taken. */
164
+ export declare class HelixSampleEndEvent extends Event {
165
+ static readonly eventName = "helix-sample-end";
166
+ constructor();
167
+ }
168
+ /**
169
+ * Fired when an element asks to be taken away.
170
+ *
171
+ * A request rather than a notification: the element does not remove itself,
172
+ * because the consumer owns the markup it is in and removing the node under
173
+ * them would put their state and the document out of step. Cancelable, so
174
+ * `preventDefault()` is a refusal.
175
+ *
176
+ * One verb for both shapes. A tag leaving a list and an announcement closing
177
+ * itself are the same act from the element's side.
178
+ */
179
+ export declare class HelixDismissEvent extends CustomEvent<DismissDetail> {
180
+ static readonly eventName = "helix-dismiss";
181
+ constructor(detail: DismissDetail);
182
+ }
183
+ /**
184
+ * Detail carried by every request that proposes a value.
185
+ *
186
+ * **`value` is a string, and the things that are not strings are the rule
187
+ * rather than the exception to it.** Pagination's page, its page size, the
188
+ * splitter's position and the carousel's index all announce through `String()`.
189
+ * That is deliberate: an HTML value is a string, a consumer parses one back
190
+ * with `Number()`, and nothing is lost on the way.
191
+ *
192
+ * A boolean is the case where it *is* lost, because `"false"` is truthy, so a
193
+ * consumer who forgets to compare against the word gets the opposite answer and
194
+ * no error. That is why checkedness has `helix-toggle` and its own boolean, and
195
+ * it is the line to hold: **stringify a value, never a fact.** A new control
196
+ * whose state is a boolean wants an event with a typed detail, not a `String()`
197
+ * call here.
198
+ *
199
+ * **There is no `property` field, and there was one until 27 Aug 2026.** It named
200
+ * which property a request was about, which every verb in this file now says by
201
+ * itself: `helix-before-pin` carried `'pinned'`, `helix-before-collapse` carried
202
+ * `'collapsed'`, the active mixin carried `'active'`. Two families sharing a verb
203
+ * are told apart by the element rather than by a field, `composedPath()[0]`
204
+ * surviving the retarget that `event.target` does not.
205
+ *
206
+ * The one element that sent one verb for two facts was the sandbox root, whose
207
+ * split and whose panel both settled through `helix-before-resize`. They have a
208
+ * verb each now, `helix-before-split` and `helix-before-panel-resize`, which is
209
+ * 294's argument one level down: a name says what moved, and a field that repeats
210
+ * the name is eleven dispatch sites paying for one that needed it. See 306.
211
+ */
212
+ export interface ChangeDetail {
213
+ /** The value after the change. */
214
+ value: string;
215
+ }
216
+ /**
217
+ * A set is about to make a different child current, and can be refused.
218
+ *
219
+ * **The generic `helix-change` covered this and should not have.** Eleven
220
+ * families that are not form controls announced their state under the word the
221
+ * platform uses for a committed value, which is 294's whole complaint read from
222
+ * the other end: `Tabs` moving to another tab, `Tree` marking another row and
223
+ * `Steps` advancing are not a value changing, they are a set choosing. One word
224
+ * for four questions is what `appearance` was before `check:axes`.
225
+ *
226
+ * `active` names which child is current, so `activate` is the verb, and unlike
227
+ * `change` the platform has no claim on it.
228
+ *
229
+ * **It has a notification half now, and this said it did not.** *Reversed 28 Aug
230
+ * 2026.* The paragraph here read "there is no notification half: a native
231
+ * `change` would be a lie about what moved, and no other native event means
232
+ * this. The before event is the whole channel." The first half of that is still
233
+ * exactly right, which is why the pair is `helix-activate` and not `change`. The
234
+ * conclusion did not follow: that no *native* word fits is an argument against
235
+ * borrowing one, not an argument against having a notification at all.
236
+ *
237
+ * What the missing half cost is the thing 294 fixed for values and left here.
238
+ * A consumer who only wants to know which child is current now had one channel,
239
+ * and it fires *before* `apply`: `currentTarget.active` still holds the previous
240
+ * value inside the handler, and `detail.value` is a proposal another listener may
241
+ * refuse. Measured across the four families taking this mixin, nothing at all was
242
+ * announced afterwards. `Tabs` and `Tree` looked covered because `helix-select`
243
+ * bubbles up from a child, which fires when an item is *chosen* and not when
244
+ * `active` is assigned; `Steps` and `Video Playlist` had nothing.
245
+ *
246
+ * So the shape is the one `MixinControllerOpen` already has, a cancelable
247
+ * request and a plain notification after the state has moved. See #325.
248
+ */
249
+ export declare class HelixBeforeActivateEvent extends CustomEvent<ChangeDetail> {
250
+ static readonly eventName = "helix-before-activate";
251
+ constructor(detail: ChangeDetail);
252
+ }
253
+ /**
254
+ * A set has made a different child current.
255
+ *
256
+ * The notification half of `helix-before-activate`, dispatched after the state
257
+ * has moved, so `currentTarget.active` is the new value and the detail is a fact
258
+ * rather than a proposal.
259
+ *
260
+ * **Not cancelable**, for the reason every notification here is not: the
261
+ * decision was taken by the event before it, and a second refusable event for
262
+ * one transition is two answers to one question.
263
+ *
264
+ * **Prefixed, and it has to be.** `activate` unprefixed is not in any
265
+ * `*EventMap` in the DOM library, checked rather than assumed, but the prefix is
266
+ * what stops an event dispatched inside a shadow root and retargeted to the host
267
+ * being mistaken for something the host's own contents sent. That is the same
268
+ * argument `helix-select` and `helix-resize` are excused under.
269
+ */
270
+ export declare class HelixActivateEvent extends CustomEvent<ChangeDetail> {
271
+ static readonly eventName = "helix-activate";
272
+ constructor(detail: ChangeDetail);
273
+ }
274
+ /** A message is about to be pinned or unpinned, and can be refused. */
275
+ export declare class HelixBeforePinEvent extends CustomEvent<ChangeDetail> {
276
+ static readonly eventName = "helix-before-pin";
277
+ constructor(detail: ChangeDetail);
278
+ }
279
+ /** A divider is about to move, and can be refused. */
280
+ export declare class HelixBeforeResizeEvent extends CustomEvent<ChangeDetail> {
281
+ static readonly eventName = "helix-before-resize";
282
+ constructor(detail: ChangeDetail);
283
+ }
284
+ /**
285
+ * The divider between a sandbox's panes is about to move, and can be refused.
286
+ *
287
+ * Its own verb rather than a `helix-before-resize` carrying which divider moved:
288
+ * a sandbox has two, and they were told apart by a field on a detail every other
289
+ * request in this file also carries. See 306.
290
+ */
291
+ export declare class HelixBeforeSplitEvent extends CustomEvent<ChangeDetail> {
292
+ static readonly eventName = "helix-before-split";
293
+ constructor(detail: ChangeDetail);
294
+ }
295
+ /**
296
+ * A sandbox's panel is about to change height, and can be refused.
297
+ *
298
+ * The sibling of `helix-before-split`, and named for the divider rather than for
299
+ * the axis because a reader binding one of the two is choosing which divider they
300
+ * care about. `value` is pixels here and a percentage there, which is what each
301
+ * property already publishes.
302
+ */
303
+ export declare class HelixBeforePanelResizeEvent extends CustomEvent<ChangeDetail> {
304
+ static readonly eventName = "helix-before-panel-resize";
305
+ constructor(detail: ChangeDetail);
306
+ }
307
+ /** A pane is about to collapse or reopen, and can be refused. */
308
+ export declare class HelixBeforeCollapseEvent extends CustomEvent<ChangeDetail> {
309
+ static readonly eventName = "helix-before-collapse";
310
+ constructor(detail: ChangeDetail);
311
+ }
312
+ /** Source is about to be edited, and can be refused. */
313
+ export declare class HelixBeforeEditEvent extends CustomEvent<ChangeDetail> {
314
+ static readonly eventName = "helix-before-edit";
315
+ constructor(detail: ChangeDetail);
316
+ }
317
+ /**
318
+ * A value is about to change, and the change can be refused.
319
+ *
320
+ * **The request half of every value control.** It announces the value being
321
+ * *proposed*, before anything moves, so a listener calling `preventDefault()`
322
+ * refuses it and the control stays where it was. That is how a consumer takes
323
+ * one decision without declaring a mode, which is what 294 settled: the element
324
+ * always owns and applies its state, and refusing is the way to take it over.
325
+ *
326
+ * **The notification is native and separate.** Once this has gone out and the
327
+ * value has moved, the control announces it again under the platform's own
328
+ * name, `input` while a reader is editing and `change` when they are done, so
329
+ * `onChange` in React and `onchange=` in HTML both reach it and
330
+ * `currentTarget.value` is correct by the time a handler reads it. This event
331
+ * carries the detail because at the moment it fires the value is not on the
332
+ * element yet.
333
+ *
334
+ * **It replaced `helix-change` and `helix-input` on the value controls**, which
335
+ * were one mechanism under two names chosen by `announcesInput`. The name said
336
+ * *phase* and the flag meant *granularity*, so a consumer reading "change" as
337
+ * "the reader is done" wired a request to `onhelix-change` and got one per
338
+ * character. Granularity is now what the platform already says it is, `input`
339
+ * against `change`, and `announcesInput` picks which native one fires rather
340
+ * than which name this carries. See 294.
341
+ */
342
+ export declare class HelixBeforeChangeEvent extends CustomEvent<ChangeDetail> {
343
+ static readonly eventName = "helix-before-change";
344
+ constructor(detail: ChangeDetail);
345
+ }
346
+ /**
347
+ * A checked state is about to change, and the change can be refused.
348
+ *
349
+ * **Its own event rather than a `helix-before-change` carrying a boolean**, and
350
+ * the reason is recorded rather than aesthetic. Reported through the value
351
+ * event the state arrived as `String(checked)`, so a consumer received the
352
+ * string `"false"`, which is truthy, and this library's own checkbox group
353
+ * decoded it with `detail.value === 'true'`. A test asserting the value would
354
+ * have passed on that bug. A control whose state is a boolean wants an event
355
+ * with a typed boolean in it.
356
+ *
357
+ * The notification is native, as it is for a value: the control relays `change`
358
+ * from the inner input and announces `input` beside it, so `onChange` reads
359
+ * `currentTarget.checked` and gets a boolean from the platform.
360
+ *
361
+ * It also ends a collision. Checkbox Group listened for its boxes' change and
362
+ * dispatched its own under the same name from the same host, so it had to call
363
+ * `stopImmediatePropagation` to keep a consumer from receiving one box's
364
+ * boolean alongside the whole set. Two names, two facts.
365
+ */
366
+ export declare class HelixBeforeToggleEvent extends CustomEvent<ToggleDetail> {
367
+ static readonly eventName = "helix-before-toggle";
368
+ constructor(detail: ToggleDetail);
369
+ }
370
+ /** Detail carried by `helix-scrolled`. */
371
+ export interface ScrolledDetail {
372
+ /**
373
+ * Whether the page is scrolled away from the top, as a boolean and not a word
374
+ * that reads like one. Follows `helix-toggle`'s rule for the same reason.
375
+ */
376
+ scrolled: boolean;
377
+ }
378
+ /** Detail carried by `helix-toggle`. */
379
+ export interface ToggleDetail {
380
+ /** The state being asked for, as a boolean and not a word that reads like one. */
381
+ checked: boolean;
382
+ }
383
+ /** Detail carried by `helix-create`. */
384
+ export interface CreateDetail {
385
+ /** What the reader typed, which is being offered as a new answer. */
386
+ value: string;
387
+ }
388
+ /**
389
+ * The reader asked for something the list does not hold.
390
+ *
391
+ * Cancelable, and announced before anything is applied, because the options are
392
+ * the consumer's own light DOM and no component here writes into it. What the
393
+ * control can do is say what was asked for and take the value; putting an
394
+ * option in the list, or a row in a database, is the consumer's, and a consumer
395
+ * who validates first refuses this and adds nothing.
396
+ *
397
+ * The detail carries the text as typed, not a slug of it. Trimming or lowering
398
+ * it here would be this element deciding what a name means, and a consumer who
399
+ * wants an identifier can make one from what they were given.
400
+ */
401
+ export declare class HelixCreateEvent extends CustomEvent<CreateDetail> {
402
+ static readonly eventName = "helix-create";
403
+ constructor(detail: CreateDetail);
404
+ }
405
+ /** Detail carried by `helix-copy`. */
406
+ export interface CopyDetail {
407
+ /** What was put on the clipboard. */
408
+ value: string;
409
+ }
410
+ /**
411
+ * Something was copied to the clipboard.
412
+ *
413
+ * Not cancelable, and deliberately: it is announced after the write, because a
414
+ * clipboard write is a permission the platform may refuse and there is nothing
415
+ * useful to report until it has either happened or not.
416
+ */
417
+ export declare class HelixCopyEvent extends CustomEvent<CopyDetail> {
418
+ static readonly eventName = "helix-copy";
419
+ constructor(detail: CopyDetail);
420
+ }
421
+ /** Detail carried by `helix-console`. */
422
+ export interface ConsoleDetail {
423
+ /** How the message was logged. */
424
+ level: 'log' | 'info' | 'warn' | 'error';
425
+ /** The message, already flattened to text. */
426
+ text: string;
427
+ }
428
+ /**
429
+ * Fired when something being previewed writes to the console.
430
+ *
431
+ * Carries text rather than the logged values. The preview is a separate
432
+ * document, so what arrives has crossed `postMessage` and been through
433
+ * structured clone: a DOM node or a function does not survive that, and half a
434
+ * value is worse than a string of it.
435
+ */
436
+ export declare class HelixConsoleEvent extends CustomEvent<ConsoleDetail> {
437
+ static readonly eventName = "helix-console";
438
+ constructor(detail: ConsoleDetail);
439
+ }
440
+ /** Detail carried by `helix-resize`. */
441
+ export interface ResizeDetail {
442
+ /** How tall the content is, in CSS pixels. */
443
+ size: number;
444
+ }
445
+ /**
446
+ * Fired when something reports how much room its content actually needs.
447
+ *
448
+ * **A measurement crossing a boundary the measurer is on the far side of.** A
449
+ * sandboxed preview is its own document: nothing outside it can read the height
450
+ * of what it drew, because the frame is opaque and a box sized from the outside
451
+ * only ever reports the box. So the document measures itself and says so, and
452
+ * this is what it says it with.
453
+ *
454
+ * A number rather than a box, because the width is the container's to decide and
455
+ * only the block size follows the content. A consumer that wants to act on it
456
+ * clamps it: what arrives is what was drawn, which for an empty example is
457
+ * nearly nothing and for a long one is more than a page.
458
+ */
459
+ export declare class HelixResizeEvent extends CustomEvent<ResizeDetail> {
460
+ static readonly eventName = "helix-resize";
461
+ constructor(detail: ResizeDetail);
462
+ }
463
+ /**
464
+ * Fired when a header crosses the threshold between resting at the top of the
465
+ * page and floating over it.
466
+ *
467
+ * **State a consumer used to read off an attribute, said out loud instead.**
468
+ * The header reflected this as `data-scrolled` on its own host, which is an
469
+ * attribute nobody rendered: a server sends the element without it and the
470
+ * element adds it on upgrade, so a framework hydrating the page finds markup
471
+ * that no longer matches what it sent. The threshold now lives in a custom
472
+ * state, which is deliberately not in the DOM and therefore not something a
473
+ * hydration pass can disagree with.
474
+ *
475
+ * That closes the observability the attribute accidentally provided. A
476
+ * `MutationObserver` can watch an attribute and there is no equivalent for
477
+ * `ElementInternals.states`, so a component holding a boolean nothing can read
478
+ * is a component with a private opinion its consumers demonstrably need: the
479
+ * bar's own backdrop is drawn by the page around it, and the page has to know
480
+ * when to light it.
481
+ *
482
+ * Not cancelable. It reports where the page is rather than asking permission to
483
+ * be there, and refusing it would leave the state and the announcement
484
+ * disagreeing.
485
+ *
486
+ * The hysteresis stays inside the header, which is the point of announcing at
487
+ * all: a consumer listening to `scroll` itself would be a second opinion on
488
+ * when the page counts as scrolled, and the two would part company at the eight
489
+ * pixels of travel this waits for.
490
+ */
491
+ export declare class HelixScrolledEvent extends CustomEvent<ScrolledDetail> {
492
+ static readonly eventName = "helix-scrolled";
493
+ constructor(detail: ScrolledDetail);
494
+ }
495
+ /** Detail carried by `helix-caret`. */
496
+ export interface CaretDetail {
497
+ /** One-based column, counted in characters from the start of the line. */
498
+ column: number;
499
+ /** One-based line. */
500
+ line: number;
501
+ }
502
+ /**
503
+ * Fired when the cursor moves in a text editor.
504
+ *
505
+ * Not cancelable, unlike everything else here. The others announce something
506
+ * about to happen and a listener can refuse it; this one reports where the
507
+ * caret already is, and there is nothing left to refuse.
508
+ *
509
+ * It fires on every keystroke and every arrow press, which is why the status
510
+ * bar reads it from the DOM rather than through a framework's state: routing a
511
+ * caret position through React would re-render the workbench on every cursor
512
+ * move.
513
+ */
514
+ export declare class HelixCaretEvent extends CustomEvent<CaretDetail> {
515
+ static readonly eventName = "helix-caret";
516
+ constructor(detail: CaretDetail);
517
+ }
518
+ /** Detail carried by `helix-select`. */
519
+ export interface SelectDetail {
520
+ /**
521
+ * Whether the reader took the row's second destination rather than its first.
522
+ *
523
+ * Absent everywhere but a command palette, where a row can carry two: the
524
+ * value alone would say which was taken, since the two differ, but only by
525
+ * comparing strings a consumer would have to keep in step with the markup.
526
+ * A flag says it outright.
527
+ */
528
+ alternate?: boolean;
529
+ /** Value of the item the reader chose. */
530
+ value: string;
531
+ }
532
+ /**
533
+ * Fired when a component moves the view it is showing, rather than its value.
534
+ *
535
+ * A calendar paging to another month is not choosing a date, and the two have
536
+ * to be separable: a consumer driving the view needs to hear that it moved
537
+ * without being told the answer changed. `helix-change` belongs to the value,
538
+ * and giving it both jobs would make either one unusable on its own.
539
+ */
540
+ export declare class HelixNavigateEvent extends CustomEvent<NavigateDetail> {
541
+ static readonly eventName = "helix-navigate";
542
+ constructor(detail: NavigateDetail);
543
+ }
544
+ /** Detail carried by `helix-complete`. */
545
+ export interface CompleteDetail {
546
+ /** What the control now holds, in full. */
547
+ value: string;
548
+ }
549
+ /**
550
+ * Fired when a control that fills up has filled.
551
+ *
552
+ * The moment a code entry exists for: a six-character field is worth submitting
553
+ * the instant the sixth character lands, and a consumer watching `helix-change`
554
+ * has to know the length and compare it on every keystroke to find that moment
555
+ * themselves.
556
+ *
557
+ * Separate from `helix-change` rather than a flag on it, because they are
558
+ * answered by different code: one keeps a value in step and the other decides
559
+ * whether to send a form. A listener that only cares about the second says so by
560
+ * which event it listens for.
561
+ *
562
+ * `complete` is free as a verb. React's synthetic system claims `change`,
563
+ * `input`, `submit`, `reset`, `copy`, `paste`, `scroll`, `drag`, `focus` and
564
+ * `blur`, measured, and this is none of them.
565
+ *
566
+ * Not cancelable. It reports that something already happened, which is the same
567
+ * reason `helix-caret` is not: there is nothing left to refuse once the last
568
+ * character is in the box.
569
+ */
570
+ export declare class HelixCompleteEvent extends CustomEvent<CompleteDetail> {
571
+ static readonly eventName = "helix-complete";
572
+ constructor(detail: CompleteDetail);
573
+ }
574
+ /**
575
+ * Fired when the reader offers something they wrote.
576
+ *
577
+ * **Cancelable, and the composer clears only when nobody refused.** Sending is a
578
+ * round trip: a composer that empties itself and then hears the request failed
579
+ * has thrown away the only copy of what the reader typed, and a reader who has
580
+ * just written three paragraphs is exactly who cannot afford that. Refusing
581
+ * leaves the text where it is.
582
+ *
583
+ * Not `helix-create`, which is the combobox's event for a value a list does not
584
+ * hold, and not `helix-change`, because nothing about a value changed: the
585
+ * reader finished something and handed it over.
586
+ */
587
+ export declare class HelixSendEvent extends CustomEvent<SendDetail> {
588
+ static readonly eventName = "helix-send";
589
+ constructor(detail: SendDetail);
590
+ }
591
+ /**
592
+ * Fired when something a user comes back to is marked read, or unread.
593
+ *
594
+ * **Read state is reported rather than owned.** Marking a notification read is
595
+ * usually a round trip, and a component that flips the state itself and then
596
+ * hears the request failed has already told the reader something untrue. So this
597
+ * is cancelable, and refusing it leaves the item alone; a component left
598
+ * uncontrolled applies it once nobody has refused, which is the same contract
599
+ * every other axis in the library uses.
600
+ *
601
+ * Bubbles and is composed, so a feed hears its own items: one handler on the
602
+ * list serves every notification in it, which is what a consumer syncing to a
603
+ * server actually wants.
604
+ */
605
+ export declare class HelixReadEvent extends CustomEvent<ReadDetail> {
606
+ static readonly eventName = "helix-read";
607
+ constructor(detail: ReadDetail);
608
+ }
609
+ /**
610
+ * Fired when the reader asks for a different order.
611
+ *
612
+ * Cancelable, and refusing it leaves the order alone, which is what makes a
613
+ * server-side sort expressible: the consumer refuses the local reorder, fetches,
614
+ * and hands back a new set. In controlled mode nothing is written whatever the
615
+ * answer, and this is the element reporting that a heading was clicked.
616
+ *
617
+ * Not `helix-change`: nothing about the data changed, only the order it is read
618
+ * in, and a consumer listening for changes to a value should not hear a sort.
619
+ * That is the same distinction `helix-filter` is drawn on.
620
+ */
621
+ export declare class HelixSortEvent extends CustomEvent<SortDetail> {
622
+ static readonly eventName = "helix-sort";
623
+ constructor(detail: SortDetail);
624
+ }
625
+ /**
626
+ * Fired when a component narrows what it is showing.
627
+ *
628
+ * Filtering hides rather than removes, so nothing about the value changes and
629
+ * `helix-change` would be a lie. What a consumer wants to know is that the list
630
+ * in front of the reader is no longer the whole list.
631
+ */
632
+ export declare class HelixFilterEvent extends CustomEvent<FilterDetail> {
633
+ static readonly eventName = "helix-filter";
634
+ constructor(detail: FilterDetail);
635
+ }
636
+ /** What a shortcut reports when its chord is pressed. */
637
+ export interface ShortcutDetail {
638
+ /**
639
+ * The chord that matched, as it was written.
640
+ *
641
+ * Given back rather than left to be remembered, so one handler can serve
642
+ * several keys and answer by comparing what it was told.
643
+ */
644
+ keys: string;
645
+ }
646
+ /**
647
+ * Fired when a shortcut's chord is pressed.
648
+ *
649
+ * Cancelable, and the key event is only consumed where this is not refused: a
650
+ * consumer that decides the moment is wrong, a dialog is over the control or
651
+ * the reader is mid-composition, calls `preventDefault()` and the keystroke
652
+ * goes on to whatever would have had it.
653
+ */
654
+ export declare class HelixShortcutEvent extends CustomEvent<ShortcutDetail> {
655
+ static readonly eventName = "helix-shortcut";
656
+ constructor(detail: ShortcutDetail);
657
+ }
658
+ /**
659
+ * Fired when the reader selects an item in a set.
660
+ *
661
+ * Bubbles and is composed, because this is how a set coordinates: a tree, a
662
+ * tab list and a toggle group all learn which of their children was chosen by
663
+ * hearing it arrive.
664
+ */
665
+ export declare class HelixSelectEvent extends CustomEvent<SelectDetail> {
666
+ static readonly eventName = "helix-select";
667
+ constructor(detail: SelectDetail);
668
+ }
669
+ /**
670
+ * Every event this file publishes, and the one place a new one is added.
671
+ *
672
+ * The map below is derived from this rather than written beside it. Kept by
673
+ * hand, the two drifted: `helix-filter` and `helix-navigate` were dispatched by
674
+ * the calendar, the listbox and the pagination and were missing from the map
675
+ * for weeks, so the one thing the augmentation exists to do was not done for
676
+ * them and a consumer writing `addEventListener('helix-navigate', …)` got
677
+ * `Event` and had to reach into `detail` through a cast. Nothing failed, which
678
+ * is why two of the nine went missing.
679
+ *
680
+ * Derived, a class that is in here is typed and a class that is not is absent
681
+ * from both halves at once, so the two cannot disagree. `check:events` fails
682
+ * the build on an exported event class left out of this object, which is the
683
+ * only step left that can be forgotten.
684
+ */
685
+ declare const registry: {
686
+ readonly HelixActivateEvent: typeof HelixActivateEvent;
687
+ readonly HelixBeforeActivateEvent: typeof HelixBeforeActivateEvent;
688
+ readonly HelixBeforeChangeEvent: typeof HelixBeforeChangeEvent;
689
+ readonly HelixBeforeCloseEvent: typeof HelixBeforeCloseEvent;
690
+ readonly HelixBeforeCollapseEvent: typeof HelixBeforeCollapseEvent;
691
+ readonly HelixBeforeEditEvent: typeof HelixBeforeEditEvent;
692
+ readonly HelixBeforeOpenEvent: typeof HelixBeforeOpenEvent;
693
+ readonly HelixBeforePanelResizeEvent: typeof HelixBeforePanelResizeEvent;
694
+ readonly HelixBeforePinEvent: typeof HelixBeforePinEvent;
695
+ readonly HelixBeforeResizeEvent: typeof HelixBeforeResizeEvent;
696
+ readonly HelixBeforeSplitEvent: typeof HelixBeforeSplitEvent;
697
+ readonly HelixBeforeToggleEvent: typeof HelixBeforeToggleEvent;
698
+ readonly HelixCaretEvent: typeof HelixCaretEvent;
699
+ readonly HelixCompleteEvent: typeof HelixCompleteEvent;
700
+ readonly HelixConsoleEvent: typeof HelixConsoleEvent;
701
+ readonly HelixCopyEvent: typeof HelixCopyEvent;
702
+ readonly HelixCreateEvent: typeof HelixCreateEvent;
703
+ readonly HelixDismissEvent: typeof HelixDismissEvent;
704
+ readonly HelixFilterEvent: typeof HelixFilterEvent;
705
+ readonly HelixNavigateEvent: typeof HelixNavigateEvent;
706
+ readonly HelixNextEvent: typeof HelixNextEvent;
707
+ readonly HelixPreviousEvent: typeof HelixPreviousEvent;
708
+ readonly HelixReadEvent: typeof HelixReadEvent;
709
+ readonly HelixResizeEvent: typeof HelixResizeEvent;
710
+ readonly HelixSampleEndEvent: typeof HelixSampleEndEvent;
711
+ readonly HelixSampleStartEvent: typeof HelixSampleStartEvent;
712
+ readonly HelixScrolledEvent: typeof HelixScrolledEvent;
713
+ readonly HelixSelectEvent: typeof HelixSelectEvent;
714
+ readonly HelixSendEvent: typeof HelixSendEvent;
715
+ readonly HelixShortcutEvent: typeof HelixShortcutEvent;
716
+ readonly HelixSortEvent: typeof HelixSortEvent;
717
+ readonly HelixTourAskEvent: typeof HelixTourAskEvent;
718
+ };
719
+ /**
720
+ * Every name this library dispatches.
721
+ *
722
+ * Exported so a runtime check can ask whether a name is one of ours without
723
+ * keeping a second list of them. `HelixElement` uses it to tell a consumer that
724
+ * the handler prop they wrote is attached to nothing.
725
+ */
726
+ export declare const helixEventNames: ReadonlySet<string>;
727
+ type Registry = typeof registry;
728
+ /**
729
+ * The registry keyed by what each class dispatches as.
730
+ *
731
+ * `eventName` is `static readonly` with no annotation, so TypeScript infers the
732
+ * string literal and it can be used as a key. That is also what makes the name
733
+ * on the class the single source of it: the map key, the dispatch and the
734
+ * listener all read the same declaration.
735
+ */
736
+ type HelixEventMap = {
737
+ [K in keyof Registry as Registry[K]['eventName']]: InstanceType<Registry[K]>;
738
+ };
739
+ declare global {
740
+ interface HTMLElementEventMap extends HelixEventMap {
741
+ }
742
+ }
743
+ export {};