@fusion.dev/helix-headless 0.169.0 → 0.171.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.
- package/custom-elements.json +663 -95
- package/dist/chat/composer/chat-composer.d.ts +2 -1
- package/dist/chat/composer/chat-composer.js +7 -1
- package/dist/chat/root/chat-root.d.ts +36 -6
- package/dist/chat/root/chat-root.js +53 -5
- package/dist/code-block/root/code-block-root.d.ts +20 -2
- package/dist/code-block/root/code-block-root.js +29 -8
- package/dist/color-picker/root/color-picker-root.d.ts +50 -7
- package/dist/color-picker/root/color-picker-root.js +62 -1
- package/dist/combobox/root/combobox-root.d.ts +16 -6
- package/dist/combobox/root/combobox-root.js +9 -2
- package/dist/command/root/command-root.d.ts +16 -1
- package/dist/command/root/command-root.js +8 -0
- package/dist/data-table/root/data-table-root.d.ts +40 -5
- package/dist/data-table/root/data-table-root.js +35 -7
- package/dist/filter-input/chip/filter-chip.d.ts +13 -3
- package/dist/filter-input/chip/filter-chip.js +5 -0
- package/dist/filter-input/menu/filter-menu.js +0 -1
- package/dist/filter-input/root/filter-input-root.d.ts +71 -4
- package/dist/filter-input/root/filter-input-root.js +87 -2
- package/dist/format-date/root/format-date-root.d.ts +3 -1
- package/dist/input/root/input-root.d.ts +6 -0
- package/dist/input/root/input-root.js +13 -0
- package/dist/listbox/root/listbox-root.d.ts +6 -0
- package/dist/listbox/root/listbox-root.js +6 -1
- package/dist/number-input/root/number-input-root.d.ts +16 -6
- package/dist/number-input/root/number-input-root.js +15 -4
- package/dist/select/root/select-root.js +2 -0
- package/dist/steps/root/steps-root.d.ts +32 -8
- package/dist/steps/root/steps-root.js +70 -9
- package/dist/steps/step/step.d.ts +9 -1
- package/dist/steps/step/step.js +5 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +19 -1
- package/dist/video-playlist/root/video-playlist-root.js +14 -3
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -0
- package/dist/virtual-list/root/virtual-list-root.js +7 -2
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +510 -126
- package/types/vue.d.ts +109 -26
- package/types/words.d.ts +12 -2
package/dist/steps/step/step.js
CHANGED
|
@@ -22,6 +22,7 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
|
22
22
|
this.invalid = false;
|
|
23
23
|
this.locked = false;
|
|
24
24
|
this.optional = false;
|
|
25
|
+
this.stop = true;
|
|
25
26
|
this.value = '';
|
|
26
27
|
this.holding = false;
|
|
27
28
|
this.readContent = () => {
|
|
@@ -73,6 +74,7 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
|
73
74
|
part="label"
|
|
74
75
|
exportparts="button: label-button, live: label-live, spinner: label-spinner, text: label-text"
|
|
75
76
|
emphasis="ghost"
|
|
77
|
+
.focusable=${this.stop}
|
|
76
78
|
aria-current=${this.current ? 'step' : nothing}
|
|
77
79
|
aria-describedby=${this.complete ? 'state' : nothing}
|
|
78
80
|
?disabled=${this.disabled || this.locked}
|
|
@@ -122,6 +124,9 @@ __decorate([
|
|
|
122
124
|
__decorate([
|
|
123
125
|
property({ reflect: true, type: Boolean })
|
|
124
126
|
], HelixHeadlessStep.prototype, "optional", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ attribute: false })
|
|
129
|
+
], HelixHeadlessStep.prototype, "stop", void 0);
|
|
125
130
|
__decorate([
|
|
126
131
|
property()
|
|
127
132
|
], HelixHeadlessStep.prototype, "value", void 0);
|
|
@@ -11,6 +11,12 @@ declare const HelixHeadlessVideoPlaylist_base: (new (...args: any[]) => import("
|
|
|
11
11
|
* captions, and poster treatment. `Sandbox` takes its preview and `Menu` its
|
|
12
12
|
* trigger the same way.
|
|
13
13
|
*
|
|
14
|
+
* **The player is a `Video` or a plain `<video>`.** Either takes `src` and
|
|
15
|
+
* `poster` from the entry, is named by it, plays on, and answers Shift with N
|
|
16
|
+
* or P while focused. A plain `<video>` has no previous and next controls
|
|
17
|
+
* that send `helix-previous` or `helix-next`, so its moves are the entries,
|
|
18
|
+
* the menu, and your own buttons calling `previous()` and `next()`.
|
|
19
|
+
*
|
|
14
20
|
* **Entries are markup.** React skips properties it would set imperatively
|
|
15
21
|
* during hydration, so an array property on a custom element is missing on the
|
|
16
22
|
* first paint of a server-rendered page. `using-the-elements.mdx` has the
|
|
@@ -43,7 +49,8 @@ declare const HelixHeadlessVideoPlaylist_base: (new (...args: any[]) => import("
|
|
|
43
49
|
*
|
|
44
50
|
* **The player is named by the current entry**, and the device's own media
|
|
45
51
|
* controls show the entry as the title. A player you gave a `label` keeps
|
|
46
|
-
* your name, and only the title follows the entry.
|
|
52
|
+
* your name, and only the title follows the entry. A plain `<video>` is
|
|
53
|
+
* named through `aria-label`, unless you wrote one.
|
|
47
54
|
*
|
|
48
55
|
* **Keyboard.** The entries take one stop in the tab order: the entry you
|
|
49
56
|
* last focused, or the current entry before you have focused one. Enter or
|
|
@@ -235,6 +242,17 @@ export declare class HelixHeadlessVideoPlaylist extends HelixHeadlessVideoPlayli
|
|
|
235
242
|
* Before they focus one, the current entry holds it.
|
|
236
243
|
*/
|
|
237
244
|
private stop;
|
|
245
|
+
/** The name this playlist last wrote on a plain media player, to tell it from yours. */
|
|
246
|
+
private wroteName;
|
|
247
|
+
/**
|
|
248
|
+
* Names the player by the entry.
|
|
249
|
+
*
|
|
250
|
+
* The consumer's own name for the player stands. Only a player named by
|
|
251
|
+
* nobody takes the entry's words as its name: `label` on a player that has
|
|
252
|
+
* one, and `aria-label` on a plain `<video>` or `<audio>`, which has none and
|
|
253
|
+
* was heard as an unnamed video.
|
|
254
|
+
*/
|
|
255
|
+
private name;
|
|
238
256
|
/** The entry the player was last pointed at. */
|
|
239
257
|
private pointed;
|
|
240
258
|
/** Hears entries arrive and leave, which change no property here. */
|
|
@@ -161,6 +161,19 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
|
|
|
161
161
|
get items() {
|
|
162
162
|
return [...this.querySelectorAll('*')].filter((one) => one instanceof HelixHeadlessVideoPlaylistItem && one.value !== '');
|
|
163
163
|
}
|
|
164
|
+
name(player, text) {
|
|
165
|
+
if (player instanceof HTMLMediaElement) {
|
|
166
|
+
const own = player.getAttribute('aria-label');
|
|
167
|
+
if (own === null || own === this.wroteName) {
|
|
168
|
+
player.setAttribute('aria-label', text);
|
|
169
|
+
this.wroteName = text;
|
|
170
|
+
}
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (!player.hasAttribute('label')) {
|
|
174
|
+
player.label = text;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
164
177
|
get player() {
|
|
165
178
|
const slot = this.renderRoot?.querySelector('slot[name="player"]');
|
|
166
179
|
return slot?.assignedElements()[0] ?? null;
|
|
@@ -299,9 +312,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
|
|
|
299
312
|
}
|
|
300
313
|
player.poster = current.poster;
|
|
301
314
|
player.mediaTitle = current.text;
|
|
302
|
-
|
|
303
|
-
player.label = current.text;
|
|
304
|
-
}
|
|
315
|
+
this.name(player, current.text);
|
|
305
316
|
if (this.chased) {
|
|
306
317
|
this.status.say(formatWords(this, 'playingLabel', { title: current.text }));
|
|
307
318
|
void player.updateComplete?.then(() => player.play()).catch(() => { });
|
|
@@ -119,6 +119,11 @@ export interface VirtualListRange {
|
|
|
119
119
|
* commas. Their rows carry `aria-disabled`, the keys and typing pass over
|
|
120
120
|
* them, and a press, Space, or Control with A does not select them.
|
|
121
121
|
*
|
|
122
|
+
* **Rows a stylesheet can tell apart.** A chosen row carries `data-selected`,
|
|
123
|
+
* a disabled one `data-disabled`, as React Aria's rows do, and the row the
|
|
124
|
+
* keys are on, which holds the tab stop, `data-active`, whether or not the
|
|
125
|
+
* list has focus.
|
|
126
|
+
*
|
|
122
127
|
* **Loading more.** `helix-range-change` fires as the items on screen change,
|
|
123
128
|
* and `range` holds them. `helix-load-more` fires once a reader is within one
|
|
124
129
|
* screen of the end, once for each length of the set: add to `items` and it can
|
|
@@ -560,6 +565,9 @@ export declare class HelixHeadlessVirtualList extends HelixElement {
|
|
|
560
565
|
* `option` with `aria-selected` there, and `listitem` otherwise, and
|
|
561
566
|
* `aria-disabled` on an item `disabled-keys` names. Every pass,
|
|
562
567
|
* since a choice changes no row's content.
|
|
568
|
+
*
|
|
569
|
+
* `data-selected` and `data-disabled` say the same to a stylesheet, as
|
|
570
|
+
* React Aria's rows do, so one rule reads the same in either kind of list.
|
|
563
571
|
*/
|
|
564
572
|
private mark;
|
|
565
573
|
/** Writes a row's place in the set. */
|
|
@@ -532,18 +532,22 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
532
532
|
}
|
|
533
533
|
mark(element, at, chosen, off) {
|
|
534
534
|
element.setAttribute('role', this.selectionMode ? 'option' : 'listitem');
|
|
535
|
+
const selected = Boolean(this.selectionMode) && chosen.has(this.keyAt(at));
|
|
535
536
|
if (this.selectionMode) {
|
|
536
|
-
element.setAttribute('aria-selected', String(
|
|
537
|
+
element.setAttribute('aria-selected', String(selected));
|
|
537
538
|
}
|
|
538
539
|
else {
|
|
539
540
|
element.removeAttribute('aria-selected');
|
|
540
541
|
}
|
|
541
|
-
|
|
542
|
+
element.toggleAttribute('data-selected', selected);
|
|
543
|
+
const disabled = off.size > 0 && off.has(this.keyAt(at));
|
|
544
|
+
if (disabled) {
|
|
542
545
|
element.setAttribute('aria-disabled', 'true');
|
|
543
546
|
}
|
|
544
547
|
else {
|
|
545
548
|
element.removeAttribute('aria-disabled');
|
|
546
549
|
}
|
|
550
|
+
element.toggleAttribute('data-disabled', disabled);
|
|
547
551
|
}
|
|
548
552
|
stamp(element, at) {
|
|
549
553
|
element.setAttribute('aria-posinset', String(at + 1));
|
|
@@ -660,6 +664,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
660
664
|
}
|
|
661
665
|
const stop = at === this.active;
|
|
662
666
|
group[0]?.setAttribute('tabindex', stop ? '0' : '-1');
|
|
667
|
+
group[0]?.toggleAttribute('data-active', stop);
|
|
663
668
|
if (stop && (fresh.has(at) || this.released !== at)) {
|
|
664
669
|
releaseControls(group);
|
|
665
670
|
}
|