@fusion.dev/helix-headless 0.162.1 → 0.164.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 (45) hide show
  1. package/custom-elements.json +1041 -47
  2. package/dist/callout/root/callout-root.d.ts +43 -4
  3. package/dist/callout/root/callout-root.js +58 -2
  4. package/dist/canvas/index.d.ts +1 -1
  5. package/dist/canvas/root/canvas-document.d.ts +33 -0
  6. package/dist/canvas/root/canvas-root.d.ts +50 -2
  7. package/dist/canvas/root/canvas-root.js +98 -3
  8. package/dist/chat/composer/chat-composer.js +1 -1
  9. package/dist/chat/root/chat-root.d.ts +15 -4
  10. package/dist/chat/root/chat-root.js +19 -8
  11. package/dist/code-block/patch.d.ts +42 -0
  12. package/dist/code-block/patch.js +118 -0
  13. package/dist/code-block/root/code-block-root.d.ts +37 -1
  14. package/dist/code-block/root/code-block-root.js +57 -9
  15. package/dist/color-picker/root/color-picker-root.d.ts +7 -3
  16. package/dist/color-picker/root/color-picker-root.js +7 -4
  17. package/dist/combobox/root/combobox-root.d.ts +1 -0
  18. package/dist/combobox/root/combobox-root.js +10 -1
  19. package/dist/data-table/root/data-table-root.d.ts +1 -0
  20. package/dist/data-table/root/data-table-root.js +1 -0
  21. package/dist/element-events.generated.js +7 -1
  22. package/dist/map/root/map-root.d.ts +8 -1
  23. package/dist/map/root/map-root.js +12 -0
  24. package/dist/menu/item/menu-item.d.ts +38 -7
  25. package/dist/menu/item/menu-item.js +20 -9
  26. package/dist/menu/root/menu-root.d.ts +10 -1
  27. package/dist/menu/root/menu-root.js +8 -3
  28. package/dist/object-inspector/root/object-inspector-root.d.ts +23 -0
  29. package/dist/object-inspector/root/object-inspector-root.js +19 -1
  30. package/dist/steps/root/steps-root.d.ts +7 -1
  31. package/dist/steps/root/steps-root.js +6 -1
  32. package/dist/table/grid-controller.d.ts +7 -0
  33. package/dist/table/grid-controller.js +15 -1
  34. package/dist/table/root/table-root.d.ts +10 -0
  35. package/dist/table/root/table-root.js +18 -1
  36. package/dist/video/root/video-root.js +2 -1
  37. package/dist/video-playlist/item/video-playlist-item.d.ts +8 -0
  38. package/dist/video-playlist/item/video-playlist-item.js +7 -0
  39. package/dist/video-playlist/root/video-playlist-root.d.ts +60 -0
  40. package/dist/video-playlist/root/video-playlist-root.js +55 -1
  41. package/lint.json +1 -1
  42. package/package.json +5 -5
  43. package/types/jsx.d.ts +502 -40
  44. package/types/vue.d.ts +126 -14
  45. package/types/words.d.ts +58 -0
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, drawStatus, formatWords, HelixElement, HelixEndEvent, inlineStep, MixinControllerActive, StatusController, words, } from '@fusion.dev/helix-core';
7
+ import { customElement, drawStatus, formatWords, HelixElement, HelixEndEvent, inlineStep, MixinControllerActive, ReorderController, StatusController, words, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { HelixHeadlessVideoPlaylistItem } from '../item/video-playlist-item.js';
@@ -12,11 +12,30 @@ import { playOrder, stepTo } from '../order.js';
12
12
  let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinControllerActive(HelixElement) {
13
13
  constructor() {
14
14
  super(...arguments);
15
+ this.canceledLabel = 'Canceled';
16
+ this.droppedLabel = 'Dropped';
15
17
  this.emptyLabel = 'No videos';
16
18
  this.label = 'Playlist';
19
+ this.movedLabel = '{name} moved to position {position} of {count}';
17
20
  this.noAdvance = false;
21
+ this.pickedUpLabel = 'Picked up {name}';
18
22
  this.playingLabel = 'Now playing {title}';
23
+ this.reorderable = false;
19
24
  this.status = new StatusController(this);
25
+ this.reorder = new ReorderController(this, {
26
+ axis: 'block',
27
+ box: (value) => this.entryFor(value)?.getBoundingClientRect(),
28
+ current: (event) => this.entryOf(event)?.value,
29
+ grip: (event) => {
30
+ const entry = this.entryOf(event);
31
+ return entry ? { element: entry, key: entry.value } : undefined;
32
+ },
33
+ holds: false,
34
+ keys: () => this.items.map((one) => one.value),
35
+ name: (value) => this.entryFor(value)?.text || value,
36
+ refocus: (value) => this.entryFor(value)?.focus(),
37
+ say: (words) => this.status.say(words),
38
+ });
20
39
  this.shuffle = false;
21
40
  this.chased = false;
22
41
  this.known = {
@@ -116,6 +135,21 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
116
135
  };
117
136
  }
118
137
  static { this.words = 'helix-video-playlist'; }
138
+ entryOf(event) {
139
+ const items = this.items;
140
+ return event
141
+ .composedPath()
142
+ .find((node) => items.includes(node) &&
143
+ !node.disabled);
144
+ }
145
+ entryFor(value) {
146
+ return this.items.find((one) => one.value === value);
147
+ }
148
+ markMoves() {
149
+ for (const entry of this.items) {
150
+ entry.move = this.reorderable ? this.reorder.moveOf(entry.value) : undefined;
151
+ }
152
+ }
119
153
  get items() {
120
154
  return [...this.querySelectorAll('*')].filter((one) => one instanceof HelixHeadlessVideoPlaylistItem && one.value !== '');
121
155
  }
@@ -228,6 +262,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
228
262
  }
229
263
  updated(changed) {
230
264
  super.updated?.(changed);
265
+ this.markMoves();
231
266
  const items = this.items;
232
267
  const current = this.resolveActive(items);
233
268
  for (const item of items) {
@@ -270,6 +305,14 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
270
305
  ${drawStatus(this.status)}`;
271
306
  }
272
307
  };
308
+ __decorate([
309
+ words,
310
+ property({ attribute: 'canceled-label' })
311
+ ], HelixHeadlessVideoPlaylist.prototype, "canceledLabel", void 0);
312
+ __decorate([
313
+ words,
314
+ property({ attribute: 'dropped-label' })
315
+ ], HelixHeadlessVideoPlaylist.prototype, "droppedLabel", void 0);
273
316
  __decorate([
274
317
  words,
275
318
  property({ attribute: 'empty-label' })
@@ -278,13 +321,24 @@ __decorate([
278
321
  words,
279
322
  property()
280
323
  ], HelixHeadlessVideoPlaylist.prototype, "label", void 0);
324
+ __decorate([
325
+ words,
326
+ property({ attribute: 'moved-label' })
327
+ ], HelixHeadlessVideoPlaylist.prototype, "movedLabel", void 0);
281
328
  __decorate([
282
329
  property({ attribute: 'no-advance', type: Boolean })
283
330
  ], HelixHeadlessVideoPlaylist.prototype, "noAdvance", void 0);
331
+ __decorate([
332
+ words,
333
+ property({ attribute: 'picked-up-label' })
334
+ ], HelixHeadlessVideoPlaylist.prototype, "pickedUpLabel", void 0);
284
335
  __decorate([
285
336
  words,
286
337
  property({ attribute: 'playing-label' })
287
338
  ], HelixHeadlessVideoPlaylist.prototype, "playingLabel", void 0);
339
+ __decorate([
340
+ property({ reflect: true, type: Boolean })
341
+ ], HelixHeadlessVideoPlaylist.prototype, "reorderable", void 0);
288
342
  __decorate([
289
343
  property()
290
344
  ], HelixHeadlessVideoPlaylist.prototype, "repeat", void 0);