@fusion.dev/helix-headless 0.148.0 → 0.149.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 (240) hide show
  1. package/custom-elements.json +6966 -1798
  2. package/dist/announcement/root/announcement-root.d.ts +5 -0
  3. package/dist/announcement/root/announcement-root.js +5 -2
  4. package/dist/area-chart/root/area-chart-root.d.ts +11 -0
  5. package/dist/area-chart/root/area-chart-root.js +20 -7
  6. package/dist/avatar/group/avatar-group.d.ts +10 -2
  7. package/dist/avatar/group/avatar-group.js +10 -5
  8. package/dist/badge/count.d.ts +6 -1
  9. package/dist/badge/count.js +3 -3
  10. package/dist/badge/root/badge-root.d.ts +6 -2
  11. package/dist/badge/root/badge-root.js +3 -3
  12. package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
  13. package/dist/bar-chart/root/bar-chart-root.js +17 -4
  14. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
  15. package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
  16. package/dist/button/root/button-root.d.ts +10 -1
  17. package/dist/button/root/button-root.js +3 -2
  18. package/dist/button-group/root/button-group-root.d.ts +3 -0
  19. package/dist/button-group/root/button-group-root.js +2 -2
  20. package/dist/callout/root/callout-root.d.ts +16 -2
  21. package/dist/callout/root/callout-root.js +16 -4
  22. package/dist/canvas/describe.d.ts +10 -0
  23. package/dist/canvas/describe.js +9 -0
  24. package/dist/canvas/neighbor.d.ts +17 -0
  25. package/dist/canvas/neighbor.js +1 -0
  26. package/dist/canvas/node/canvas-node.js +3 -2
  27. package/dist/canvas/root/canvas-root.d.ts +65 -8
  28. package/dist/canvas/root/canvas-root.js +115 -49
  29. package/dist/carousel/root/carousel-root.d.ts +5 -0
  30. package/dist/carousel/root/carousel-root.js +16 -5
  31. package/dist/chat/composer/chat-composer.d.ts +5 -0
  32. package/dist/chat/composer/chat-composer.js +4 -1
  33. package/dist/chat/message/chat-message.d.ts +9 -5
  34. package/dist/chat/message/chat-message.js +8 -4
  35. package/dist/chat/naming.js +2 -2
  36. package/dist/chat/root/chat-root.d.ts +27 -1
  37. package/dist/chat/root/chat-root.js +37 -9
  38. package/dist/checkbox/root/checkbox-root.d.ts +11 -0
  39. package/dist/checkbox/root/checkbox-root.js +8 -2
  40. package/dist/checkbox-group/root/checkbox-group-root.d.ts +11 -0
  41. package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
  42. package/dist/code-block/root/code-block-root.d.ts +12 -2
  43. package/dist/code-block/root/code-block-root.js +12 -2
  44. package/dist/color-input/root/color-input-root.d.ts +13 -0
  45. package/dist/color-input/root/color-input-root.js +18 -5
  46. package/dist/color-picker/root/color-picker-root.d.ts +19 -3
  47. package/dist/color-picker/root/color-picker-root.js +47 -13
  48. package/dist/combobox/root/combobox-root.d.ts +36 -7
  49. package/dist/combobox/root/combobox-root.js +37 -12
  50. package/dist/command/root/command-root.d.ts +15 -6
  51. package/dist/command/root/command-root.js +9 -4
  52. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  53. package/dist/copy-button/root/copy-button-root.js +7 -2
  54. package/dist/data-table/root/data-table-root.d.ts +171 -29
  55. package/dist/data-table/root/data-table-root.js +268 -118
  56. package/dist/date-input/root/date-input-root.d.ts +32 -9
  57. package/dist/date-input/root/date-input-root.js +66 -44
  58. package/dist/date-picker/root/date-picker-root.d.ts +38 -15
  59. package/dist/date-picker/root/date-picker-root.js +52 -33
  60. package/dist/dialog/root/dialog-root.d.ts +12 -1
  61. package/dist/dialog/root/dialog-root.js +11 -4
  62. package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
  63. package/dist/donut-chart/root/donut-chart-root.js +8 -5
  64. package/dist/drawer/root/drawer-root.d.ts +12 -1
  65. package/dist/drawer/root/drawer-root.js +9 -2
  66. package/dist/drilldown/root/drilldown-root.d.ts +5 -0
  67. package/dist/drilldown/root/drilldown-root.js +4 -1
  68. package/dist/element-events.generated.js +25 -3
  69. package/dist/file-input/root/file-input-root.d.ts +18 -3
  70. package/dist/file-input/root/file-input-root.js +34 -17
  71. package/dist/filter-input/chip/filter-chip.d.ts +13 -0
  72. package/dist/filter-input/chip/filter-chip.js +6 -1
  73. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  74. package/dist/filter-input/menu/filter-menu.js +3 -1
  75. package/dist/filter-input/root/filter-input-root.d.ts +20 -3
  76. package/dist/filter-input/root/filter-input-root.js +8 -4
  77. package/dist/format-date/root/format-date-root.d.ts +20 -2
  78. package/dist/format-date/root/format-date-root.js +5 -2
  79. package/dist/graph/root/graph-model.d.ts +11 -0
  80. package/dist/graph/root/graph-model.js +4 -0
  81. package/dist/graph/root/graph-root.d.ts +78 -9
  82. package/dist/graph/root/graph-root.js +124 -27
  83. package/dist/heatmap/root/heatmap-root.d.ts +25 -4
  84. package/dist/heatmap/root/heatmap-root.js +27 -7
  85. package/dist/icon-button/root/icon-button-root.d.ts +5 -0
  86. package/dist/icon-button/root/icon-button-root.js +1 -0
  87. package/dist/input/root/input-root.d.ts +5 -0
  88. package/dist/input/root/input-root.js +4 -1
  89. package/dist/lightbox/root/lightbox-root.d.ts +14 -4
  90. package/dist/lightbox/root/lightbox-root.js +25 -7
  91. package/dist/line-chart/root/line-chart-root.d.ts +5 -0
  92. package/dist/line-chart/root/line-chart-root.js +4 -2
  93. package/dist/list/item/list-item.d.ts +32 -0
  94. package/dist/list/item/list-item.js +34 -7
  95. package/dist/list/root/list-root.d.ts +87 -0
  96. package/dist/list/root/list-root.js +112 -2
  97. package/dist/listbox/reorder/index.d.ts +1 -0
  98. package/dist/listbox/reorder/index.js +4 -0
  99. package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
  100. package/dist/listbox/reorder/listbox-reorder.js +151 -0
  101. package/dist/listbox/root/listbox-root.d.ts +68 -11
  102. package/dist/listbox/root/listbox-root.js +41 -9
  103. package/dist/loader/root/loader-root.d.ts +5 -0
  104. package/dist/loader/root/loader-root.js +3 -1
  105. package/dist/map/area/map-area.d.ts +5 -0
  106. package/dist/map/area/map-area.js +3 -1
  107. package/dist/map/buildings/map-buildings.d.ts +5 -0
  108. package/dist/map/buildings/map-buildings.js +3 -1
  109. package/dist/map/contours/map-contours.d.ts +5 -0
  110. package/dist/map/contours/map-contours.js +3 -1
  111. package/dist/map/landcover/map-landcover.d.ts +5 -0
  112. package/dist/map/landcover/map-landcover.js +3 -1
  113. package/dist/map/marker/map-marker.d.ts +16 -1
  114. package/dist/map/marker/map-marker.js +13 -5
  115. package/dist/map/points/map-points.d.ts +5 -0
  116. package/dist/map/points/map-points.js +6 -4
  117. package/dist/map/position/map-position.d.ts +5 -0
  118. package/dist/map/position/map-position.js +3 -1
  119. package/dist/map/raster/map-raster.d.ts +5 -0
  120. package/dist/map/raster/map-raster.js +3 -1
  121. package/dist/map/root/map-root.d.ts +33 -14
  122. package/dist/map/root/map-root.js +59 -22
  123. package/dist/map/route/map-route.d.ts +5 -0
  124. package/dist/map/route/map-route.js +3 -1
  125. package/dist/map/terrain/map-terrain.d.ts +5 -0
  126. package/dist/map/terrain/map-terrain.js +3 -1
  127. package/dist/menu/root/menu-root.d.ts +5 -0
  128. package/dist/menu/root/menu-root.js +3 -1
  129. package/dist/meter/root/meter-root.d.ts +16 -3
  130. package/dist/meter/root/meter-root.js +12 -5
  131. package/dist/navigation/root/navigation-root.d.ts +5 -0
  132. package/dist/navigation/root/navigation-root.js +3 -1
  133. package/dist/notifications/notification/notification.d.ts +5 -0
  134. package/dist/notifications/notification/notification.js +3 -1
  135. package/dist/notifications/root/notifications-root.d.ts +8 -0
  136. package/dist/notifications/root/notifications-root.js +10 -2
  137. package/dist/number-input/root/number-input-root.d.ts +21 -8
  138. package/dist/number-input/root/number-input-root.js +26 -11
  139. package/dist/object-inspector/root/object-inspector-root.d.ts +51 -12
  140. package/dist/object-inspector/root/object-inspector-root.js +21 -20
  141. package/dist/outline/root/outline-root.d.ts +5 -0
  142. package/dist/outline/root/outline-root.js +3 -1
  143. package/dist/pagination/root/pagination-root.d.ts +7 -1
  144. package/dist/pagination/root/pagination-root.js +16 -7
  145. package/dist/pagination/size/pagination-size.d.ts +7 -3
  146. package/dist/pagination/size/pagination-size.js +4 -2
  147. package/dist/pagination/summary/pagination-summary.d.ts +8 -6
  148. package/dist/pagination/summary/pagination-summary.js +4 -9
  149. package/dist/pin-input/code.d.ts +6 -6
  150. package/dist/pin-input/code.js +1 -5
  151. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  152. package/dist/pin-input/root/pin-input-root.js +6 -2
  153. package/dist/popover/root/popover-root.d.ts +12 -2
  154. package/dist/popover/root/popover-root.js +10 -4
  155. package/dist/progress/root/progress-root.d.ts +7 -2
  156. package/dist/progress/root/progress-root.js +5 -2
  157. package/dist/qr-code/name.d.ts +3 -2
  158. package/dist/qr-code/name.js +2 -2
  159. package/dist/qr-code/root/qr-code-root.d.ts +12 -2
  160. package/dist/qr-code/root/qr-code-root.js +9 -2
  161. package/dist/radio/group/radio-group.d.ts +11 -0
  162. package/dist/radio/group/radio-group.js +8 -2
  163. package/dist/rating/root/rating-root.d.ts +12 -1
  164. package/dist/rating/root/rating-root.js +10 -3
  165. package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -2
  166. package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
  167. package/dist/select/root/select-root.d.ts +11 -0
  168. package/dist/select/root/select-root.js +13 -3
  169. package/dist/skip-link/root/skip-link-root.d.ts +5 -0
  170. package/dist/skip-link/root/skip-link-root.js +3 -1
  171. package/dist/slider/root/slider-root.d.ts +7 -2
  172. package/dist/slider/root/slider-root.js +11 -5
  173. package/dist/sparkline/readings.d.ts +15 -5
  174. package/dist/sparkline/readings.js +3 -3
  175. package/dist/sparkline/root/sparkline-root.d.ts +9 -4
  176. package/dist/sparkline/root/sparkline-root.js +9 -3
  177. package/dist/speed-dial/root/speed-dial-root.d.ts +5 -0
  178. package/dist/speed-dial/root/speed-dial-root.js +4 -1
  179. package/dist/splitter/root/splitter-root.d.ts +6 -1
  180. package/dist/splitter/root/splitter-root.js +9 -4
  181. package/dist/steps/root/steps-root.d.ts +9 -2
  182. package/dist/steps/root/steps-root.js +6 -3
  183. package/dist/steps/step/step.d.ts +12 -0
  184. package/dist/steps/step/step.js +11 -2
  185. package/dist/switch/root/switch-root.d.ts +11 -0
  186. package/dist/switch/root/switch-root.js +8 -2
  187. package/dist/table/column/table-column.d.ts +11 -4
  188. package/dist/table/column/table-column.js +15 -10
  189. package/dist/table/grid-controller.d.ts +8 -3
  190. package/dist/table/grid-controller.js +17 -11
  191. package/dist/table/root/table-root.d.ts +107 -5
  192. package/dist/table/root/table-root.js +122 -20
  193. package/dist/table/row/table-row.d.ts +42 -0
  194. package/dist/table/row/table-row.js +40 -1
  195. package/dist/tabs/root/tabs-root.d.ts +5 -0
  196. package/dist/tabs/root/tabs-root.js +3 -1
  197. package/dist/tag/group/tag-group.d.ts +5 -0
  198. package/dist/tag/group/tag-group.js +3 -1
  199. package/dist/tag/root/tag-root.d.ts +14 -1
  200. package/dist/tag/root/tag-root.js +11 -8
  201. package/dist/textarea/root/textarea-root.d.ts +5 -0
  202. package/dist/textarea/root/textarea-root.js +3 -1
  203. package/dist/time-input/root/time-input-root.d.ts +14 -7
  204. package/dist/time-input/root/time-input-root.js +43 -32
  205. package/dist/time-picker/root/time-picker-root.d.ts +15 -7
  206. package/dist/time-picker/root/time-picker-root.js +25 -12
  207. package/dist/toast/item/toast-item.d.ts +7 -0
  208. package/dist/toast/item/toast-item.js +1 -0
  209. package/dist/toast/root/toast-root.d.ts +9 -1
  210. package/dist/toast/root/toast-root.js +5 -4
  211. package/dist/toolbar/root/toolbar-root.d.ts +5 -0
  212. package/dist/toolbar/root/toolbar-root.js +5 -2
  213. package/dist/tooltip/root/tooltip-root.d.ts +27 -17
  214. package/dist/tour/root/tour-root.d.ts +8 -2
  215. package/dist/tour/root/tour-root.js +4 -2
  216. package/dist/tour/stop/tour-stop.d.ts +5 -0
  217. package/dist/tour/stop/tour-stop.js +6 -1
  218. package/dist/tree/grip.d.ts +5 -0
  219. package/dist/tree/grip.js +1 -0
  220. package/dist/tree/item/tree-item.d.ts +24 -0
  221. package/dist/tree/item/tree-item.js +27 -5
  222. package/dist/tree/root/tree-root.d.ts +66 -1
  223. package/dist/tree/root/tree-root.js +77 -5
  224. package/dist/trend/root/trend-root.d.ts +20 -4
  225. package/dist/trend/root/trend-root.js +20 -5
  226. package/dist/video/root/video-root.d.ts +12 -3
  227. package/dist/video/root/video-root.js +41 -14
  228. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  229. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  230. package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
  231. package/dist/video-playlist/root/video-playlist-root.js +3 -1
  232. package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
  233. package/dist/virtual-list/root/virtual-list-root.js +5 -2
  234. package/lint.json +1 -1
  235. package/package.json +7 -6
  236. package/types/jsx.d.ts +4014 -1862
  237. package/types/vue.d.ts +1266 -624
  238. package/types/words.d.ts +3280 -0
  239. package/dist/toast/hotkey.d.ts +0 -22
  240. package/dist/toast/hotkey.js +0 -23
@@ -58,7 +58,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
58
58
  */
59
59
  export declare class HelixHeadlessTrend extends HelixElement {
60
60
  /**
61
- * The word read out after the direction when the move is an improvement.
61
+ * The key this family's words are registered under, its styled tag:
62
+ * `registerWords('de', { 'helix-trend': { upLabel: 'Gestiegen' } })`.
63
+ */
64
+ static words: string;
65
+ /**
66
+ * The word read out after the direction when the move is an improvement,
67
+ * `{betterLabel}` in `judgment-label`.
62
68
  */
63
69
  betterLabel: string;
64
70
  /**
@@ -97,9 +103,18 @@ export declare class HelixHeadlessTrend extends HelixElement {
97
103
  */
98
104
  good?: 'down' | 'up';
99
105
  /**
100
- * The locale `value` is written in, such as `de` for `1.234,5`.
106
+ * What the `direction` part says. `{direction}` is the word for the
107
+ * movement, `up-label`, `down-label` or `unchanged-label`, and
108
+ * `{judgment}` is `better` or `worse` where `good` judges the move, so a
109
+ * language whose words agree with the movement writes each phrase whole:
110
+ * `{judgment, select, better {...} worse {...} other {...}}`.
111
+ * `{betterLabel}` and `{worseLabel}` are `better-label` and `worse-label`.
112
+ */
113
+ judgmentLabel: string;
114
+ /**
115
+ * The locale the words and `value` are in, such as `de` for `1.234,5`.
101
116
  *
102
- * Absent uses the runtime's own. Set it on a page rendered on a server, so
117
+ * Absent reads the nearest `lang`, then the runtime's own. Set it on a page rendered on a server, so
103
118
  * the server and the browser write the figure alike.
104
119
  */
105
120
  locale: string;
@@ -133,7 +148,8 @@ export declare class HelixHeadlessTrend extends HelixElement {
133
148
  */
134
149
  value?: number;
135
150
  /**
136
- * The word read out after the direction when the move is a setback.
151
+ * The word read out after the direction when the move is a setback,
152
+ * `{worseLabel}` in `judgment-label`.
137
153
  */
138
154
  worseLabel: string;
139
155
  /**
@@ -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, HelixElement, reportRuntime } from '@fusion.dev/helix-core';
7
+ import { customElement, formatWords, HelixElement, reportRuntime, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { arrowDown, arrowUp, minus } from '@fusion.dev/helix-icons';
9
9
  import { html } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -21,11 +21,13 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
21
21
  super(...arguments);
22
22
  this.betterLabel = 'better';
23
23
  this.downLabel = 'Down';
24
+ this.judgmentLabel = '{judgment, select, better {{direction}, {betterLabel}} worse {{direction}, {worseLabel}} other {{direction}}}';
24
25
  this.locale = '';
25
26
  this.unchangedLabel = 'Unchanged';
26
27
  this.upLabel = 'Up';
27
28
  this.worseLabel = 'worse';
28
29
  }
30
+ static { this.words = 'helix-trend'; }
29
31
  renderIcon(icon) {
30
32
  return html `<slot aria-hidden="true" name="icon"
31
33
  ><svg
@@ -69,8 +71,12 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
69
71
  render() {
70
72
  const moved = this.moved;
71
73
  const direction = readDirection(moved);
72
- const judged = this.judged;
73
- const judgment = judged ? `, ${judged === 'better' ? this.betterLabel : this.worseLabel}` : '';
74
+ const said = formatWords(this, 'judgmentLabel', {
75
+ betterLabel: this.betterLabel,
76
+ direction: this[direction.word],
77
+ judgment: this.judged ?? 'none',
78
+ worseLabel: this.worseLabel,
79
+ });
74
80
  const icon = this.renderIcon(direction.icon);
75
81
  const glyph = moved === 'up'
76
82
  ? html `<slot aria-hidden="true" name="up-icon">${icon}</slot>`
@@ -80,20 +86,22 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
80
86
  const value = this.value;
81
87
  const figure = value === undefined || !Number.isFinite(value)
82
88
  ? ''
83
- : figureOf(value, this.locale, this.formatOptions);
89
+ : figureOf(value, wordsLocale(this), this.formatOptions);
84
90
  return html `${glyph}
85
- <span part="direction">${`${this[direction.word]}${judgment}`}</span>
91
+ <span part="direction">${said}</span>
86
92
  <span part="value" ?hidden=${figure === ''}>${figure}</span><slot></slot>
87
93
  <slot name="label"></slot>`;
88
94
  }
89
95
  };
90
96
  __decorate([
97
+ words,
91
98
  property({ attribute: 'better-label' })
92
99
  ], HelixHeadlessTrend.prototype, "betterLabel", void 0);
93
100
  __decorate([
94
101
  property({ reflect: true })
95
102
  ], HelixHeadlessTrend.prototype, "direction", void 0);
96
103
  __decorate([
104
+ words,
97
105
  property({ attribute: 'down-label' })
98
106
  ], HelixHeadlessTrend.prototype, "downLabel", void 0);
99
107
  __decorate([
@@ -102,6 +110,10 @@ __decorate([
102
110
  __decorate([
103
111
  property({ reflect: true })
104
112
  ], HelixHeadlessTrend.prototype, "good", void 0);
113
+ __decorate([
114
+ words,
115
+ property({ attribute: 'judgment-label' })
116
+ ], HelixHeadlessTrend.prototype, "judgmentLabel", void 0);
105
117
  __decorate([
106
118
  property()
107
119
  ], HelixHeadlessTrend.prototype, "locale", void 0);
@@ -109,15 +121,18 @@ __decorate([
109
121
  property({ reflect: true })
110
122
  ], HelixHeadlessTrend.prototype, "movement", void 0);
111
123
  __decorate([
124
+ words,
112
125
  property({ attribute: 'unchanged-label' })
113
126
  ], HelixHeadlessTrend.prototype, "unchangedLabel", void 0);
114
127
  __decorate([
128
+ words,
115
129
  property({ attribute: 'up-label' })
116
130
  ], HelixHeadlessTrend.prototype, "upLabel", void 0);
117
131
  __decorate([
118
132
  property({ type: Number })
119
133
  ], HelixHeadlessTrend.prototype, "value", void 0);
120
134
  __decorate([
135
+ words,
121
136
  property({ attribute: 'worse-label' })
122
137
  ], HelixHeadlessTrend.prototype, "worseLabel", void 0);
123
138
  HelixHeadlessTrend = __decorate([
@@ -172,6 +172,11 @@ import '../../menu/index.js';
172
172
  * @cssstate waiting - Playback stopped to wait for more data, and `loading` shows.
173
173
  */
174
174
  export declare class HelixHeadlessVideo extends HelixElement {
175
+ /**
176
+ * The key this family's words are registered under, its styled tag:
177
+ * `registerWords('de', { 'helix-video': { playLabel: 'Abspielen' } })`.
178
+ */
179
+ static words: string;
175
180
  /**
176
181
  * Whether the video starts playing on its own. Browsers allow this only while
177
182
  * it is muted.
@@ -274,7 +279,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
274
279
  */
275
280
  extraControls: string;
276
281
  /**
277
- * What the control that skips ahead is called, with `{seconds}` filled in.
282
+ * What the control that skips ahead is called. `{seconds}` is how far, written
283
+ * in the locale, and each language writes the forms it has.
278
284
  */
279
285
  forwardLabel: string;
280
286
  /**
@@ -346,7 +352,9 @@ export declare class HelixHeadlessVideo extends HelixElement {
346
352
  */
347
353
  pauseLabel: string;
348
354
  /**
349
- * How the volume is read out, with `{percent}` filled in.
355
+ * How the volume is read out. `{percent}` is the volume from 0 to 100,
356
+ * written in the locale, and a language that needs plural forms writes them
357
+ * with `{percent, plural, ...}`.
350
358
  */
351
359
  percentLabel: string;
352
360
  /**
@@ -383,7 +391,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
383
391
  */
384
392
  remoteLabel: string;
385
393
  /**
386
- * What the control that skips back is called, with `{seconds}` filled in.
394
+ * What the control that skips back is called. `{seconds}` is how far, written
395
+ * in the locale, and each language writes the forms it has.
387
396
  */
388
397
  rewindLabel: string;
389
398
  /**
@@ -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 { activeCue, adoptTrack, CueController, captionsAmong, captionTracks, copiesOf, customElement, drawIcon, FullscreenController, fillTemplate, HelixElement, HelixNextEvent, HelixPreviousEvent, IdleController, MediaSessionController, onUnlessFalse, RemotePlaybackController, reportRuntime, SKIP_SECONDS, sameCopies, showCaption, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
7
+ import { activeCue, adoptTrack, CueController, captionsAmong, captionTracks, copiesOf, customElement, drawIcon, FullscreenController, formatWords, HelixElement, HelixNextEvent, HelixPreviousEvent, IdleController, MediaSessionController, onUnlessFalse, RemotePlaybackController, reportRuntime, SKIP_SECONDS, sameCopies, showCaption, words, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
8
8
  import { airplay, arrowClockwise, arrowCounterClockwise, closedCaptioning, cornersIn, cornersOut, dotsThreeVertical, download, gauge, pause, pictureInPicture, play, skipBack, skipForward, speakerHigh, speakerX, } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -41,7 +41,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
41
41
  this.downloadLabel = 'Download';
42
42
  this.errorLabel = 'This video could not be played';
43
43
  this.extraControls = '';
44
- this.forwardLabel = 'Forward {seconds} seconds';
44
+ this.forwardLabel = '{seconds, plural, one {Forward # second} other {Forward # seconds}}';
45
45
  this.fullscreenLabel = 'Fullscreen';
46
46
  this.idleDelay = 2500;
47
47
  this.label = '';
@@ -61,7 +61,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
61
61
  this.preload = 'metadata';
62
62
  this.previousLabel = 'Previous';
63
63
  this.remoteLabel = 'Play on another device';
64
- this.rewindLabel = 'Back {seconds} seconds';
64
+ this.rewindLabel = '{seconds, plural, one {Back # second} other {Back # seconds}}';
65
65
  this.seekLabel = 'Seek';
66
66
  this.speedLabel = 'Playback speed';
67
67
  this.speeds = '0.5 1 1.5 2';
@@ -210,6 +210,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
210
210
  };
211
211
  this.captions = [];
212
212
  }
213
+ static { this.words = 'helix-video'; }
213
214
  get conditions() {
214
215
  return {
215
216
  hydrating: this.hydrating,
@@ -469,7 +470,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
469
470
  return html `<button
470
471
  part="rewind"
471
472
  type="button"
472
- aria-label=${fillTemplate(this.rewindLabel, { seconds: SKIP_SECONDS })}
473
+ aria-label=${formatWords(this, 'rewindLabel', { seconds: SKIP_SECONDS })}
473
474
  @click=${() => this.skipBy(-SKIP_SECONDS)}
474
475
  >
475
476
  <slot name="rewind-icon">${drawIcon(arrowCounterClockwise)}</slot>
@@ -479,7 +480,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
479
480
  return html `<button
480
481
  part="forward"
481
482
  type="button"
482
- aria-label=${fillTemplate(this.forwardLabel, { seconds: SKIP_SECONDS })}
483
+ aria-label=${formatWords(this, 'forwardLabel', { seconds: SKIP_SECONDS })}
483
484
  @click=${() => this.skipBy(SKIP_SECONDS)}
484
485
  >
485
486
  <slot name="forward-icon">${drawIcon(arrowClockwise)}</slot>
@@ -643,7 +644,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
643
644
  ${back
644
645
  ? html `<slot name="rewind-icon" slot="start">${drawIcon(arrowCounterClockwise)}</slot>`
645
646
  : html `<slot name="forward-icon" slot="start">${drawIcon(arrowClockwise)}</slot>`}
646
- ${fillTemplate(back ? this.rewindLabel : this.forwardLabel, { seconds: SKIP_SECONDS })}
647
+ ${formatWords(this, back ? 'rewindLabel' : 'forwardLabel', { seconds: SKIP_SECONDS })}
647
648
  </${this.tag('menu-item')}>`;
648
649
  }
649
650
  if (one === 'previous') {
@@ -690,6 +691,9 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
690
691
  }
691
692
  renderBar() {
692
693
  const done = this.knownDuration > 0 ? this.position / this.knownDuration : 0;
694
+ const progress = `--video-progress: ${done}`;
695
+ const level = `--video-level: ${this.silent ? 0 : this.loudness}`;
696
+ const { fullscreenLabel, muteLabel, seekLabel, volumeLabel } = this;
693
697
  return html `<div part="controls">
694
698
  <button
695
699
  part="play"
@@ -716,19 +720,19 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
716
720
  max=${Number.isFinite(this.knownDuration) && this.knownDuration > 0 ? this.knownDuration : 0}
717
721
  step="0.01"
718
722
  .value=${String(this.position)}
719
- aria-label=${this.seekLabel}
720
- aria-valuetext=${fillTemplate(this.timeLabel, {
723
+ aria-label=${seekLabel}
724
+ aria-valuetext=${formatWords(this, 'timeLabel', {
721
725
  duration: clock(this.knownDuration),
722
726
  position: clock(this.position),
723
727
  })}
724
- style=${`--video-progress: ${done}`}
728
+ style=${progress}
725
729
  @input=${this.takeScrub}
726
730
  />
727
731
  <span part="sound">
728
732
  <button
729
733
  part="mute"
730
734
  type="button"
731
- aria-label=${this.muteLabel}
735
+ aria-label=${muteLabel}
732
736
  aria-pressed=${this.silent ? 'true' : 'false'}
733
737
  @click=${() => {
734
738
  const video = this.video;
@@ -748,11 +752,11 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
748
752
  max="1"
749
753
  step="0.05"
750
754
  .value=${String(this.silent ? 0 : this.loudness)}
751
- aria-label=${this.volumeLabel}
752
- aria-valuetext=${fillTemplate(this.percentLabel, {
755
+ aria-label=${volumeLabel}
756
+ aria-valuetext=${formatWords(this, 'percentLabel', {
753
757
  percent: Math.round((this.silent ? 0 : this.loudness) * 100),
754
758
  })}
755
- style=${`--video-level: ${this.silent ? 0 : this.loudness}`}
759
+ style=${level}
756
760
  @input=${this.takeVolume}
757
761
  />
758
762
  </span>
@@ -782,7 +786,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
782
786
  <button
783
787
  part="fullscreen"
784
788
  type="button"
785
- aria-label=${this.fullscreenLabel}
789
+ aria-label=${fullscreenLabel}
786
790
  aria-pressed=${this.full ? 'true' : 'false'}
787
791
  @click=${() => void this.fullscreen.toggle()}
788
792
  >
@@ -896,9 +900,11 @@ __decorate([
896
900
  property({ reflect: true, type: Boolean })
897
901
  ], HelixHeadlessVideo.prototype, "autoplay", void 0);
898
902
  __decorate([
903
+ words,
899
904
  property({ attribute: 'captions-label' })
900
905
  ], HelixHeadlessVideo.prototype, "captionsLabel", void 0);
901
906
  __decorate([
907
+ words,
902
908
  property({ attribute: 'captions-off-label' })
903
909
  ], HelixHeadlessVideo.prototype, "captionsOffLabel", void 0);
904
910
  __decorate([
@@ -917,18 +923,22 @@ __decorate([
917
923
  property({ attribute: 'disableremoteplayback', reflect: true, type: Boolean })
918
924
  ], HelixHeadlessVideo.prototype, "disableRemotePlayback", void 0);
919
925
  __decorate([
926
+ words,
920
927
  property({ attribute: 'download-label' })
921
928
  ], HelixHeadlessVideo.prototype, "downloadLabel", void 0);
922
929
  __decorate([
930
+ words,
923
931
  property({ attribute: 'error-label' })
924
932
  ], HelixHeadlessVideo.prototype, "errorLabel", void 0);
925
933
  __decorate([
926
934
  property({ attribute: 'extra-controls' })
927
935
  ], HelixHeadlessVideo.prototype, "extraControls", void 0);
928
936
  __decorate([
937
+ words,
929
938
  property({ attribute: 'forward-label' })
930
939
  ], HelixHeadlessVideo.prototype, "forwardLabel", void 0);
931
940
  __decorate([
941
+ words,
932
942
  property({ attribute: 'fullscreen-label' })
933
943
  ], HelixHeadlessVideo.prototype, "fullscreenLabel", void 0);
934
944
  __decorate([
@@ -938,36 +948,45 @@ __decorate([
938
948
  property()
939
949
  ], HelixHeadlessVideo.prototype, "label", void 0);
940
950
  __decorate([
951
+ words,
941
952
  property({ attribute: 'loading-label' })
942
953
  ], HelixHeadlessVideo.prototype, "loadingLabel", void 0);
943
954
  __decorate([
944
955
  property({ reflect: true, type: Boolean })
945
956
  ], HelixHeadlessVideo.prototype, "loop", void 0);
946
957
  __decorate([
958
+ words,
947
959
  property({ attribute: 'more-label' })
948
960
  ], HelixHeadlessVideo.prototype, "moreLabel", void 0);
949
961
  __decorate([
962
+ words,
950
963
  property({ attribute: 'mute-label' })
951
964
  ], HelixHeadlessVideo.prototype, "muteLabel", void 0);
952
965
  __decorate([
966
+ words,
953
967
  property({ attribute: 'next-label' })
954
968
  ], HelixHeadlessVideo.prototype, "nextLabel", void 0);
955
969
  __decorate([
956
970
  property({ attribute: 'overflow-controls' })
957
971
  ], HelixHeadlessVideo.prototype, "overflowControls", void 0);
958
972
  __decorate([
973
+ words,
959
974
  property({ attribute: 'pause-label' })
960
975
  ], HelixHeadlessVideo.prototype, "pauseLabel", void 0);
961
976
  __decorate([
977
+ words,
962
978
  property({ attribute: 'percent-label' })
963
979
  ], HelixHeadlessVideo.prototype, "percentLabel", void 0);
964
980
  __decorate([
981
+ words,
965
982
  property({ attribute: 'pip-label' })
966
983
  ], HelixHeadlessVideo.prototype, "pipLabel", void 0);
967
984
  __decorate([
985
+ words,
968
986
  property({ attribute: 'player-label' })
969
987
  ], HelixHeadlessVideo.prototype, "playerLabel", void 0);
970
988
  __decorate([
989
+ words,
971
990
  property({ attribute: 'play-label' })
972
991
  ], HelixHeadlessVideo.prototype, "playLabel", void 0);
973
992
  __decorate([
@@ -980,18 +999,23 @@ __decorate([
980
999
  property()
981
1000
  ], HelixHeadlessVideo.prototype, "preload", void 0);
982
1001
  __decorate([
1002
+ words,
983
1003
  property({ attribute: 'previous-label' })
984
1004
  ], HelixHeadlessVideo.prototype, "previousLabel", void 0);
985
1005
  __decorate([
1006
+ words,
986
1007
  property({ attribute: 'remote-label' })
987
1008
  ], HelixHeadlessVideo.prototype, "remoteLabel", void 0);
988
1009
  __decorate([
1010
+ words,
989
1011
  property({ attribute: 'rewind-label' })
990
1012
  ], HelixHeadlessVideo.prototype, "rewindLabel", void 0);
991
1013
  __decorate([
1014
+ words,
992
1015
  property({ attribute: 'seek-label' })
993
1016
  ], HelixHeadlessVideo.prototype, "seekLabel", void 0);
994
1017
  __decorate([
1018
+ words,
995
1019
  property({ attribute: 'speed-label' })
996
1020
  ], HelixHeadlessVideo.prototype, "speedLabel", void 0);
997
1021
  __decorate([
@@ -1004,12 +1028,15 @@ __decorate([
1004
1028
  property({ attribute: 'start-control' })
1005
1029
  ], HelixHeadlessVideo.prototype, "startControl", void 0);
1006
1030
  __decorate([
1031
+ words,
1007
1032
  property({ attribute: 'subtitles-label' })
1008
1033
  ], HelixHeadlessVideo.prototype, "subtitlesLabel", void 0);
1009
1034
  __decorate([
1035
+ words,
1010
1036
  property({ attribute: 'time-label' })
1011
1037
  ], HelixHeadlessVideo.prototype, "timeLabel", void 0);
1012
1038
  __decorate([
1039
+ words,
1013
1040
  property({ attribute: 'volume-label' })
1014
1041
  ], HelixHeadlessVideo.prototype, "volumeLabel", void 0);
1015
1042
  __decorate([
@@ -43,6 +43,11 @@ import '../../menu/index.js';
43
43
  * @csspart trigger - The button that opens the menu.
44
44
  */
45
45
  export declare class HelixHeadlessVideoPlaylistMenu extends HelixElement {
46
+ /**
47
+ * The key this part's words are registered under, its styled tag:
48
+ * `registerWords('de', { 'helix-video-playlist-menu': { label: 'Folgen' } })`.
49
+ */
50
+ static words: string;
46
51
  /**
47
52
  * The name of the menu and its trigger, read by screen readers.
48
53
  *
@@ -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 { closestInstance, customElement, drawIcon, HelixElement, HelixSelectEvent, } from '@fusion.dev/helix-core';
7
+ import { closestInstance, customElement, drawIcon, HelixElement, HelixSelectEvent, words, } from '@fusion.dev/helix-core';
8
8
  import { list } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -36,6 +36,7 @@ let HelixHeadlessVideoPlaylistMenu = class HelixHeadlessVideoPlaylistMenu extend
36
36
  this.dispatchEvent(new HelixSelectEvent({ value }));
37
37
  };
38
38
  }
39
+ static { this.words = 'helix-video-playlist-menu'; }
39
40
  connectedCallback() {
40
41
  super.connectedCallback();
41
42
  this.updateComplete.then(() => this.watch());
@@ -108,6 +109,7 @@ let HelixHeadlessVideoPlaylistMenu = class HelixHeadlessVideoPlaylistMenu extend
108
109
  }
109
110
  };
110
111
  __decorate([
112
+ words,
111
113
  property()
112
114
  ], HelixHeadlessVideoPlaylistMenu.prototype, "label", void 0);
113
115
  __decorate([
@@ -53,6 +53,11 @@ declare const HelixHeadlessVideoPlaylist_base: (new (...args: any[]) => import("
53
53
  * @csspart player - The region that holds the player.
54
54
  */
55
55
  export declare class HelixHeadlessVideoPlaylist extends HelixHeadlessVideoPlaylist_base {
56
+ /**
57
+ * The key this family's words are registered under, its styled tag:
58
+ * `registerWords('de', { 'helix-video-playlist': { label: 'Wiedergabeliste' } })`.
59
+ */
60
+ static words: string;
56
61
  /**
57
62
  * The list's name, read by screen readers.
58
63
  */
@@ -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, HelixElement, HelixEndEvent, MixinControllerActive, } from '@fusion.dev/helix-core';
7
+ import { customElement, HelixElement, HelixEndEvent, MixinControllerActive, words, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { HelixHeadlessVideoPlaylistItem } from '../item/video-playlist-item.js';
@@ -44,6 +44,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
44
44
  this.step(1);
45
45
  };
46
46
  }
47
+ static { this.words = 'helix-video-playlist'; }
47
48
  get items() {
48
49
  return [...this.querySelectorAll('*')].filter((one) => one instanceof HelixHeadlessVideoPlaylistItem && one.value !== '');
49
50
  }
@@ -139,6 +140,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
139
140
  }
140
141
  };
141
142
  __decorate([
143
+ words,
142
144
  property()
143
145
  ], HelixHeadlessVideoPlaylist.prototype, "label", void 0);
144
146
  __decorate([
@@ -94,7 +94,9 @@ export interface VirtualListRange {
94
94
  * **Row height.** Rows are placed by `estimate` until they are drawn. Then the
95
95
  * list reads the drawn rows' height once and places every row by it, so a
96
96
  * wrong estimate still reaches the last item. Set `measured` for rows of
97
- * different heights.
97
+ * different heights. Once the list draws rows of different heights, such as
98
+ * rows that wrap on a narrow screen, it places each row by its own height
99
+ * whether `measured` is set or not.
98
100
  *
99
101
  * The list follows its source. A new `items` array, an edit to the script's
100
102
  * text, or a script replaced under the same id draws the new rows. A row that
@@ -123,6 +125,11 @@ export interface VirtualListRange {
123
125
  * @csspart viewport - The scrolling box. On this tier, it needs only a block size.
124
126
  */
125
127
  export declare class HelixHeadlessVirtualList extends HelixElement {
128
+ /**
129
+ * The key this family's words are registered under, its styled tag:
130
+ * `registerWords('de', { 'helix-virtual-list': { loadingLabel: 'Weitere werden geladen' } })`.
131
+ */
132
+ static words: string;
126
133
  /**
127
134
  * How many items a line holds. One, the default, is a list; more lays the
128
135
  * items out as a grid of that many equal columns, windowed a line at a
@@ -176,7 +183,8 @@ export declare class HelixHeadlessVirtualList extends HelixElement {
176
183
  /**
177
184
  * Places each row by its own measured height. Without it, rows are placed
178
185
  * by one height: `estimate` until rows are drawn, then the drawn rows' height,
179
- * read once.
186
+ * read once. Rows that come out different heights are placed by their own
187
+ * heights either way.
180
188
  *
181
189
  * **Off by default, because the straight line is better when it holds.** One
182
190
  * height makes offset and index convert by division, which can never
@@ -393,7 +401,15 @@ export declare class HelixHeadlessVirtualList extends HelixElement {
393
401
  private stamp;
394
402
  /** Fills a drawn row from its item, by `renderItem` or by the template's holes. */
395
403
  private fill;
396
- /** New elements for item `at`: a `<div>` for `renderItem`, or the template's clone. */
404
+ /**
405
+ * New elements for item `at`: a `<div>` for `renderItem`, or the template's clone.
406
+ *
407
+ * **Only the template's elements are drawn.** The whitespace around them is
408
+ * text, and `place` takes rows out by their elements, so every text node
409
+ * drawn stayed in the list. Measured on the preview in Chromium: 3,846 nodes
410
+ * after 1,900 rows, and a window move cost 1.9 milliseconds where it had
411
+ * cost 0.34 at the top.
412
+ */
397
413
  private draw;
398
414
  /**
399
415
  * Puts the windowed rows into the light DOM, and takes the rest out.
@@ -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 { AriaForwardController, anchorAt, commaList, customElement, elementById, HelixElement, HelixLoadMoreEvent, HelixRangeChangeEvent, inRowOrder, isRtl, pressedOwnControl, rangeAdd, requestValue, searchableById, selectsAll, Typeahead, toggleValue, typesCharacter, VirtualizeController, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, anchorAt, commaList, customElement, elementById, HelixElement, HelixLoadMoreEvent, HelixRangeChangeEvent, inRowOrder, isRtl, pressedOwnControl, rangeAdd, requestValue, searchableById, selectsAll, Typeahead, toggleValue, typesCharacter, VirtualizeController, words, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing, render } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
10
  import { holdControls, releaseControls } from '../controls.js';
@@ -118,6 +118,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
118
118
  this.requestUpdate();
119
119
  };
120
120
  }
121
+ static { this.words = 'helix-virtual-list'; }
121
122
  get range() {
122
123
  return this.itemsOn(this.virtualize.visible());
123
124
  }
@@ -204,6 +205,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
204
205
  super.updated?.(changed);
205
206
  this.virtualize.measure();
206
207
  this.place();
208
+ this.virtualize.settle();
207
209
  this.report();
208
210
  }
209
211
  read() {
@@ -354,7 +356,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
354
356
  fragment.append(document.createElement('div'));
355
357
  }
356
358
  else if (template) {
357
- fragment.append(template.content.cloneNode(true));
359
+ fragment.append(...template.content.cloneNode(true).children);
358
360
  }
359
361
  this.fill([...fragment.children], at);
360
362
  return fragment;
@@ -480,6 +482,7 @@ __decorate([
480
482
  property({ type: Boolean })
481
483
  ], HelixHeadlessVirtualList.prototype, "loading", void 0);
482
484
  __decorate([
485
+ words,
483
486
  property({ attribute: 'loading-label' })
484
487
  ], HelixHeadlessVirtualList.prototype, "loadingLabel", void 0);
485
488
  __decorate([