@fusion.dev/helix-headless 0.147.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 (296) hide show
  1. package/custom-elements.json +11222 -2332
  2. package/dist/accordion/item/accordion-item.d.ts +5 -2
  3. package/dist/accordion/item/accordion-item.js +11 -7
  4. package/dist/accordion/root/accordion-root.js +4 -6
  5. package/dist/announcement/root/announcement-root.d.ts +61 -5
  6. package/dist/announcement/root/announcement-root.js +126 -20
  7. package/dist/area-chart/root/area-chart-root.d.ts +11 -0
  8. package/dist/area-chart/root/area-chart-root.js +21 -9
  9. package/dist/avatar/group/avatar-group.d.ts +10 -2
  10. package/dist/avatar/group/avatar-group.js +10 -5
  11. package/dist/badge/count.d.ts +19 -0
  12. package/dist/badge/count.js +20 -0
  13. package/dist/badge/root/badge-root.d.ts +6 -2
  14. package/dist/badge/root/badge-root.js +8 -22
  15. package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
  16. package/dist/bar-chart/root/bar-chart-root.js +17 -4
  17. package/dist/blockquote/root/blockquote-root.d.ts +66 -8
  18. package/dist/blockquote/root/blockquote-root.js +85 -8
  19. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
  22. package/dist/button/root/button-root.d.ts +10 -1
  23. package/dist/button/root/button-root.js +3 -2
  24. package/dist/button-group/arrows.d.ts +14 -0
  25. package/dist/button-group/arrows.js +10 -0
  26. package/dist/button-group/root/button-group-root.d.ts +144 -3
  27. package/dist/button-group/root/button-group-root.js +142 -2
  28. package/dist/callout/root/callout-root.d.ts +16 -2
  29. package/dist/callout/root/callout-root.js +16 -4
  30. package/dist/canvas/describe.d.ts +10 -0
  31. package/dist/canvas/describe.js +9 -0
  32. package/dist/canvas/edge-pan.d.ts +61 -0
  33. package/dist/canvas/edge-pan.js +63 -0
  34. package/dist/canvas/neighbor.d.ts +17 -0
  35. package/dist/canvas/neighbor.js +1 -0
  36. package/dist/canvas/node/canvas-node.d.ts +12 -2
  37. package/dist/canvas/node/canvas-node.js +8 -3
  38. package/dist/canvas/root/canvas-document.d.ts +10 -0
  39. package/dist/canvas/root/canvas-document.js +1 -0
  40. package/dist/canvas/root/canvas-root.d.ts +168 -9
  41. package/dist/canvas/root/canvas-root.js +239 -69
  42. package/dist/canvas/snap.d.ts +42 -0
  43. package/dist/canvas/snap.js +32 -0
  44. package/dist/carousel/root/carousel-root.d.ts +9 -3
  45. package/dist/carousel/root/carousel-root.js +17 -10
  46. package/dist/chat/composer/chat-composer.d.ts +5 -0
  47. package/dist/chat/composer/chat-composer.js +4 -1
  48. package/dist/chat/message/chat-message.d.ts +9 -5
  49. package/dist/chat/message/chat-message.js +8 -4
  50. package/dist/chat/naming.js +2 -2
  51. package/dist/chat/root/chat-root.d.ts +40 -4
  52. package/dist/chat/root/chat-root.js +38 -14
  53. package/dist/checkbox/root/checkbox-root.d.ts +11 -0
  54. package/dist/checkbox/root/checkbox-root.js +8 -2
  55. package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
  56. package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
  57. package/dist/checkbox-group/select-all.d.ts +11 -0
  58. package/dist/checkbox-group/select-all.js +5 -0
  59. package/dist/code-block/root/code-block-root.d.ts +20 -8
  60. package/dist/code-block/root/code-block-root.js +16 -5
  61. package/dist/color-input/root/color-input-root.d.ts +13 -0
  62. package/dist/color-input/root/color-input-root.js +18 -5
  63. package/dist/color-picker/root/color-picker-root.d.ts +19 -3
  64. package/dist/color-picker/root/color-picker-root.js +52 -24
  65. package/dist/color-picker/wheel.d.ts +11 -0
  66. package/dist/color-picker/wheel.js +9 -0
  67. package/dist/combobox/root/combobox-root.d.ts +106 -18
  68. package/dist/combobox/root/combobox-root.js +101 -26
  69. package/dist/command/root/command-root.d.ts +19 -9
  70. package/dist/command/root/command-root.js +9 -4
  71. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  72. package/dist/copy-button/root/copy-button-root.js +7 -2
  73. package/dist/data-table/root/data-table-root.d.ts +171 -29
  74. package/dist/data-table/root/data-table-root.js +284 -161
  75. package/dist/date-input/root/date-input-root.d.ts +32 -9
  76. package/dist/date-input/root/date-input-root.js +66 -44
  77. package/dist/date-picker/root/date-picker-root.d.ts +38 -15
  78. package/dist/date-picker/root/date-picker-root.js +52 -33
  79. package/dist/description-list/item/description-list-item.d.ts +4 -0
  80. package/dist/description-list/item/description-list-item.js +7 -1
  81. package/dist/dialog/root/dialog-root.d.ts +12 -1
  82. package/dist/dialog/root/dialog-root.js +11 -4
  83. package/dist/divider/root/divider-root.d.ts +45 -16
  84. package/dist/divider/root/divider-root.js +28 -4
  85. package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
  86. package/dist/donut-chart/root/donut-chart-root.js +8 -5
  87. package/dist/drawer/root/drawer-root.d.ts +12 -1
  88. package/dist/drawer/root/drawer-root.js +9 -2
  89. package/dist/drilldown/item/drilldown-item.js +3 -4
  90. package/dist/drilldown/root/drilldown-root.d.ts +5 -0
  91. package/dist/drilldown/root/drilldown-root.js +4 -1
  92. package/dist/element-events.generated.js +26 -3
  93. package/dist/empty/root/empty-root.d.ts +17 -3
  94. package/dist/empty/root/empty-root.js +29 -5
  95. package/dist/file-input/root/file-input-root.d.ts +18 -3
  96. package/dist/file-input/root/file-input-root.js +34 -18
  97. package/dist/file-input/status.js +2 -1
  98. package/dist/filter-input/chip/filter-chip.d.ts +13 -0
  99. package/dist/filter-input/chip/filter-chip.js +7 -3
  100. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  101. package/dist/filter-input/menu/filter-menu.js +3 -1
  102. package/dist/filter-input/root/filter-input-root.d.ts +20 -3
  103. package/dist/filter-input/root/filter-input-root.js +8 -4
  104. package/dist/format-date/fields.d.ts +20 -0
  105. package/dist/format-date/fields.js +14 -0
  106. package/dist/format-date/options.d.ts +2 -1
  107. package/dist/format-date/options.js +9 -38
  108. package/dist/format-date/root/format-date-root.d.ts +55 -5
  109. package/dist/format-date/root/format-date-root.js +29 -34
  110. package/dist/graph/root/graph-model.d.ts +11 -0
  111. package/dist/graph/root/graph-model.js +4 -0
  112. package/dist/graph/root/graph-root.d.ts +101 -14
  113. package/dist/graph/root/graph-root.js +140 -46
  114. package/dist/heatmap/root/heatmap-root.d.ts +37 -4
  115. package/dist/heatmap/root/heatmap-root.js +51 -16
  116. package/dist/icon-button/root/icon-button-root.d.ts +5 -0
  117. package/dist/icon-button/root/icon-button-root.js +1 -0
  118. package/dist/image/root/image-root.d.ts +11 -0
  119. package/dist/input/root/input-root.d.ts +5 -0
  120. package/dist/input/root/input-root.js +4 -1
  121. package/dist/kbd/root/kbd-root.js +1 -2
  122. package/dist/legend/root/legend-root.js +4 -17
  123. package/dist/lightbox/root/lightbox-root.d.ts +14 -4
  124. package/dist/lightbox/root/lightbox-root.js +25 -7
  125. package/dist/line-chart/root/line-chart-root.d.ts +5 -0
  126. package/dist/line-chart/root/line-chart-root.js +4 -2
  127. package/dist/list/item/list-item.d.ts +32 -0
  128. package/dist/list/item/list-item.js +34 -7
  129. package/dist/list/root/list-root.d.ts +87 -0
  130. package/dist/list/root/list-root.js +119 -23
  131. package/dist/listbox/reorder/index.d.ts +1 -0
  132. package/dist/listbox/reorder/index.js +4 -0
  133. package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
  134. package/dist/listbox/reorder/listbox-reorder.js +151 -0
  135. package/dist/listbox/root/listbox-root.d.ts +185 -33
  136. package/dist/listbox/root/listbox-root.js +166 -136
  137. package/dist/loader/root/loader-root.d.ts +5 -0
  138. package/dist/loader/root/loader-root.js +3 -1
  139. package/dist/map/area/map-area.d.ts +5 -0
  140. package/dist/map/area/map-area.js +3 -1
  141. package/dist/map/buildings/map-buildings.d.ts +5 -0
  142. package/dist/map/buildings/map-buildings.js +3 -1
  143. package/dist/map/contours/map-contours.d.ts +5 -0
  144. package/dist/map/contours/map-contours.js +3 -1
  145. package/dist/map/landcover/map-landcover.d.ts +5 -0
  146. package/dist/map/landcover/map-landcover.js +3 -1
  147. package/dist/map/marker/map-marker.d.ts +18 -2
  148. package/dist/map/marker/map-marker.js +13 -5
  149. package/dist/map/points/map-points.d.ts +5 -0
  150. package/dist/map/points/map-points.js +6 -4
  151. package/dist/map/position/map-position.d.ts +5 -0
  152. package/dist/map/position/map-position.js +3 -1
  153. package/dist/map/raster/map-raster.d.ts +5 -0
  154. package/dist/map/raster/map-raster.js +3 -1
  155. package/dist/map/root/map-root.d.ts +73 -16
  156. package/dist/map/root/map-root.js +122 -44
  157. package/dist/map/route/map-route.d.ts +5 -0
  158. package/dist/map/route/map-route.js +3 -1
  159. package/dist/map/terrain/map-terrain.d.ts +5 -0
  160. package/dist/map/terrain/map-terrain.js +3 -1
  161. package/dist/megamenu/root/megamenu-root.js +4 -11
  162. package/dist/menu/root/menu-root.d.ts +7 -2
  163. package/dist/menu/root/menu-root.js +3 -1
  164. package/dist/meter/root/meter-root.d.ts +16 -3
  165. package/dist/meter/root/meter-root.js +12 -5
  166. package/dist/navigation/root/navigation-root.d.ts +5 -0
  167. package/dist/navigation/root/navigation-root.js +7 -8
  168. package/dist/notifications/group/notification-group.d.ts +8 -1
  169. package/dist/notifications/group/notification-group.js +12 -6
  170. package/dist/notifications/notification/notification.d.ts +17 -1
  171. package/dist/notifications/notification/notification.js +6 -2
  172. package/dist/notifications/root/notifications-root.d.ts +49 -5
  173. package/dist/notifications/root/notifications-root.js +36 -8
  174. package/dist/number-input/root/number-input-root.d.ts +21 -8
  175. package/dist/number-input/root/number-input-root.js +26 -11
  176. package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
  177. package/dist/object-inspector/root/object-inspector-root.js +41 -30
  178. package/dist/outline/root/outline-root.d.ts +5 -0
  179. package/dist/outline/root/outline-root.js +3 -1
  180. package/dist/pagination/root/pagination-root.d.ts +7 -1
  181. package/dist/pagination/root/pagination-root.js +16 -7
  182. package/dist/pagination/size/pagination-size.d.ts +8 -3
  183. package/dist/pagination/size/pagination-size.js +5 -3
  184. package/dist/pagination/summary/pagination-summary.d.ts +8 -6
  185. package/dist/pagination/summary/pagination-summary.js +4 -9
  186. package/dist/pin-input/code.d.ts +23 -0
  187. package/dist/pin-input/code.js +21 -0
  188. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  189. package/dist/pin-input/root/pin-input-root.js +13 -23
  190. package/dist/popover/root/popover-root.d.ts +12 -2
  191. package/dist/popover/root/popover-root.js +10 -4
  192. package/dist/progress/root/progress-root.d.ts +7 -2
  193. package/dist/progress/root/progress-root.js +5 -2
  194. package/dist/qr-code/name.d.ts +3 -2
  195. package/dist/qr-code/name.js +2 -2
  196. package/dist/qr-code/root/qr-code-root.d.ts +26 -5
  197. package/dist/qr-code/root/qr-code-root.js +27 -6
  198. package/dist/radio/group/radio-group.d.ts +11 -0
  199. package/dist/radio/group/radio-group.js +8 -2
  200. package/dist/rating/root/rating-root.d.ts +12 -1
  201. package/dist/rating/root/rating-root.js +10 -3
  202. package/dist/scatter-chart/measures.d.ts +22 -0
  203. package/dist/scatter-chart/measures.js +11 -0
  204. package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
  205. package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
  206. package/dist/select/root/select-root.d.ts +67 -8
  207. package/dist/select/root/select-root.js +45 -11
  208. package/dist/skip-link/root/skip-link-root.d.ts +5 -0
  209. package/dist/skip-link/root/skip-link-root.js +3 -1
  210. package/dist/slider/root/slider-root.d.ts +7 -2
  211. package/dist/slider/root/slider-root.js +11 -5
  212. package/dist/sparkline/readings.d.ts +15 -5
  213. package/dist/sparkline/readings.js +3 -3
  214. package/dist/sparkline/root/sparkline-root.d.ts +9 -4
  215. package/dist/sparkline/root/sparkline-root.js +9 -3
  216. package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
  217. package/dist/speed-dial/group/speed-dial-group.js +43 -0
  218. package/dist/speed-dial/index.d.ts +1 -0
  219. package/dist/speed-dial/index.js +1 -0
  220. package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
  221. package/dist/speed-dial/item/speed-dial-item.js +41 -3
  222. package/dist/speed-dial/long-press.d.ts +50 -0
  223. package/dist/speed-dial/long-press.js +48 -0
  224. package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
  225. package/dist/speed-dial/root/speed-dial-root.js +117 -5
  226. package/dist/splitter/root/splitter-root.d.ts +12 -3
  227. package/dist/splitter/root/splitter-root.js +22 -4
  228. package/dist/steps/root/steps-root.d.ts +9 -2
  229. package/dist/steps/root/steps-root.js +6 -3
  230. package/dist/steps/step/step.d.ts +12 -0
  231. package/dist/steps/step/step.js +11 -2
  232. package/dist/switch/root/switch-root.d.ts +11 -0
  233. package/dist/switch/root/switch-root.js +8 -2
  234. package/dist/table/cell/table-cell.d.ts +8 -1
  235. package/dist/table/cell/table-cell.js +6 -2
  236. package/dist/table/column/table-column.d.ts +11 -4
  237. package/dist/table/column/table-column.js +15 -10
  238. package/dist/table/grid-controller.d.ts +122 -0
  239. package/dist/table/grid-controller.js +299 -0
  240. package/dist/table/root/table-root.d.ts +154 -8
  241. package/dist/table/root/table-root.js +197 -38
  242. package/dist/table/row/table-row.d.ts +55 -1
  243. package/dist/table/row/table-row.js +60 -7
  244. package/dist/tabs/root/tabs-root.d.ts +5 -0
  245. package/dist/tabs/root/tabs-root.js +3 -1
  246. package/dist/tag/group/tag-group.d.ts +5 -0
  247. package/dist/tag/group/tag-group.js +8 -15
  248. package/dist/tag/root/tag-root.d.ts +14 -1
  249. package/dist/tag/root/tag-root.js +11 -8
  250. package/dist/textarea/root/textarea-root.d.ts +5 -0
  251. package/dist/textarea/root/textarea-root.js +3 -1
  252. package/dist/time-input/root/time-input-root.d.ts +14 -7
  253. package/dist/time-input/root/time-input-root.js +43 -32
  254. package/dist/time-picker/root/time-picker-root.d.ts +16 -7
  255. package/dist/time-picker/root/time-picker-root.js +28 -12
  256. package/dist/toast/item/toast-item.d.ts +13 -3
  257. package/dist/toast/item/toast-item.js +2 -0
  258. package/dist/toast/root/toast-root.d.ts +22 -2
  259. package/dist/toast/root/toast-root.js +24 -17
  260. package/dist/toggle/group/toggle-group.js +3 -5
  261. package/dist/toolbar/root/toolbar-root.d.ts +36 -0
  262. package/dist/toolbar/root/toolbar-root.js +43 -9
  263. package/dist/tooltip/root/tooltip-root.d.ts +27 -17
  264. package/dist/tooltip/root/tooltip-root.js +1 -2
  265. package/dist/tour/root/tour-root.d.ts +8 -2
  266. package/dist/tour/root/tour-root.js +4 -2
  267. package/dist/tour/stop/tour-stop.d.ts +5 -0
  268. package/dist/tour/stop/tour-stop.js +6 -1
  269. package/dist/tree/grip.d.ts +5 -0
  270. package/dist/tree/grip.js +1 -0
  271. package/dist/tree/item/tree-item.d.ts +24 -0
  272. package/dist/tree/item/tree-item.js +27 -5
  273. package/dist/tree/root/tree-root.d.ts +66 -1
  274. package/dist/tree/root/tree-root.js +77 -5
  275. package/dist/trend/root/trend-root.d.ts +20 -4
  276. package/dist/trend/root/trend-root.js +20 -5
  277. package/dist/video/root/video-root.d.ts +23 -3
  278. package/dist/video/root/video-root.js +56 -15
  279. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  280. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  281. package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
  282. package/dist/video-playlist/root/video-playlist-root.js +3 -1
  283. package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
  284. package/dist/virtual-list/root/virtual-list-root.js +10 -19
  285. package/lint.json +1 -1
  286. package/package.json +7 -6
  287. package/types/jsx.d.ts +6005 -2114
  288. package/types/svelte.d.ts +1 -0
  289. package/types/vue.d.ts +1594 -676
  290. package/types/words.d.ts +3280 -0
  291. package/dist/kbd/keys.d.ts +0 -29
  292. package/dist/kbd/keys.js +0 -52
  293. package/dist/toast/hotkey.d.ts +0 -22
  294. package/dist/toast/hotkey.js +0 -23
  295. package/dist/tooltip/focus-target.d.ts +0 -6
  296. package/dist/tooltip/focus-target.js +0 -9
@@ -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([
@@ -161,8 +161,22 @@ import '../../menu/index.js';
161
161
  * @cssproperty --video-intrinsic-ratio - The media's own aspect ratio, once it is known. `--video-aspect-ratio` overrides it.
162
162
  * @cssproperty --video-level - The current volume, 0 to 1.
163
163
  * @cssproperty --video-progress - How far playback has reached, as a fraction of the duration.
164
+ *
165
+ * @cssstate ended - Playback reached the end, until it starts again or the source changes.
166
+ * @cssstate error - The source could not be played, and `failure` shows.
167
+ * @cssstate fullscreen - The player fills the screen.
168
+ * @cssstate idle - The video plays and the user has been still for `idle-delay`, so the bar hides.
169
+ * @cssstate muted - The sound is off.
170
+ * @cssstate paused - Playback is paused, which is where every player starts.
171
+ * @cssstate playing - Playback runs, waiting for data included.
172
+ * @cssstate waiting - Playback stopped to wait for more data, and `loading` shows.
164
173
  */
165
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;
166
180
  /**
167
181
  * Whether the video starts playing on its own. Browsers allow this only while
168
182
  * it is muted.
@@ -265,7 +279,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
265
279
  */
266
280
  extraControls: string;
267
281
  /**
268
- * 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.
269
284
  */
270
285
  forwardLabel: string;
271
286
  /**
@@ -337,7 +352,9 @@ export declare class HelixHeadlessVideo extends HelixElement {
337
352
  */
338
353
  pauseLabel: string;
339
354
  /**
340
- * 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, ...}`.
341
358
  */
342
359
  percentLabel: string;
343
360
  /**
@@ -374,7 +391,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
374
391
  */
375
392
  remoteLabel: string;
376
393
  /**
377
- * 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.
378
396
  */
379
397
  rewindLabel: string;
380
398
  /**
@@ -452,6 +470,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
452
470
  */
453
471
  private failed;
454
472
  private playing;
473
+ /** Whether playback reached the end, for `:state(ended)`. */
474
+ private finished;
455
475
  private position;
456
476
  private knownDuration;
457
477
  private loudness;
@@ -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';
@@ -72,6 +72,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
72
72
  this.buffering = false;
73
73
  this.failed = false;
74
74
  this.playing = false;
75
+ this.finished = false;
75
76
  this.position = 0;
76
77
  this.knownDuration = 0;
77
78
  this.loudness = 1;
@@ -127,6 +128,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
127
128
  };
128
129
  this.handleTime = () => {
129
130
  this.position = this.video?.currentTime ?? 0;
131
+ this.finished = this.video?.ended ?? false;
130
132
  };
131
133
  this.handleWaiting = () => {
132
134
  this.buffering = true;
@@ -144,7 +146,8 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
144
146
  this.handleState = (event) => {
145
147
  const video = this.video;
146
148
  this.playing = video ? !video.paused : false;
147
- if (event.type === 'emptied' || event.type === 'pause') {
149
+ this.finished = video?.ended ?? false;
150
+ if (event.type === 'emptied' || event.type === 'ended' || event.type === 'pause') {
148
151
  this.buffering = false;
149
152
  }
150
153
  if (event.type === 'play') {
@@ -207,6 +210,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
207
210
  };
208
211
  this.captions = [];
209
212
  }
213
+ static { this.words = 'helix-video'; }
210
214
  get conditions() {
211
215
  return {
212
216
  hydrating: this.hydrating,
@@ -438,6 +442,14 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
438
442
  super.updated?.(changed);
439
443
  this.toggleAttribute('data-playing', this.playing);
440
444
  this.toggleAttribute('data-idle', this.idle && this.playing);
445
+ this.toggleState('ended', this.finished);
446
+ this.toggleState('error', this.failed);
447
+ this.toggleState('fullscreen', this.full);
448
+ this.toggleState('idle', this.idle && this.playing);
449
+ this.toggleState('muted', this.silent);
450
+ this.toggleState('paused', !this.playing);
451
+ this.toggleState('playing', this.playing);
452
+ this.toggleState('waiting', this.buffering);
441
453
  if (changed.has('media')) {
442
454
  this.video?.load();
443
455
  }
@@ -458,7 +470,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
458
470
  return html `<button
459
471
  part="rewind"
460
472
  type="button"
461
- aria-label=${fillTemplate(this.rewindLabel, { seconds: SKIP_SECONDS })}
473
+ aria-label=${formatWords(this, 'rewindLabel', { seconds: SKIP_SECONDS })}
462
474
  @click=${() => this.skipBy(-SKIP_SECONDS)}
463
475
  >
464
476
  <slot name="rewind-icon">${drawIcon(arrowCounterClockwise)}</slot>
@@ -468,7 +480,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
468
480
  return html `<button
469
481
  part="forward"
470
482
  type="button"
471
- aria-label=${fillTemplate(this.forwardLabel, { seconds: SKIP_SECONDS })}
483
+ aria-label=${formatWords(this, 'forwardLabel', { seconds: SKIP_SECONDS })}
472
484
  @click=${() => this.skipBy(SKIP_SECONDS)}
473
485
  >
474
486
  <slot name="forward-icon">${drawIcon(arrowClockwise)}</slot>
@@ -632,7 +644,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
632
644
  ${back
633
645
  ? html `<slot name="rewind-icon" slot="start">${drawIcon(arrowCounterClockwise)}</slot>`
634
646
  : html `<slot name="forward-icon" slot="start">${drawIcon(arrowClockwise)}</slot>`}
635
- ${fillTemplate(back ? this.rewindLabel : this.forwardLabel, { seconds: SKIP_SECONDS })}
647
+ ${formatWords(this, back ? 'rewindLabel' : 'forwardLabel', { seconds: SKIP_SECONDS })}
636
648
  </${this.tag('menu-item')}>`;
637
649
  }
638
650
  if (one === 'previous') {
@@ -679,6 +691,9 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
679
691
  }
680
692
  renderBar() {
681
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;
682
697
  return html `<div part="controls">
683
698
  <button
684
699
  part="play"
@@ -705,19 +720,19 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
705
720
  max=${Number.isFinite(this.knownDuration) && this.knownDuration > 0 ? this.knownDuration : 0}
706
721
  step="0.01"
707
722
  .value=${String(this.position)}
708
- aria-label=${this.seekLabel}
709
- aria-valuetext=${fillTemplate(this.timeLabel, {
723
+ aria-label=${seekLabel}
724
+ aria-valuetext=${formatWords(this, 'timeLabel', {
710
725
  duration: clock(this.knownDuration),
711
726
  position: clock(this.position),
712
727
  })}
713
- style=${`--video-progress: ${done}`}
728
+ style=${progress}
714
729
  @input=${this.takeScrub}
715
730
  />
716
731
  <span part="sound">
717
732
  <button
718
733
  part="mute"
719
734
  type="button"
720
- aria-label=${this.muteLabel}
735
+ aria-label=${muteLabel}
721
736
  aria-pressed=${this.silent ? 'true' : 'false'}
722
737
  @click=${() => {
723
738
  const video = this.video;
@@ -737,11 +752,11 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
737
752
  max="1"
738
753
  step="0.05"
739
754
  .value=${String(this.silent ? 0 : this.loudness)}
740
- aria-label=${this.volumeLabel}
741
- aria-valuetext=${fillTemplate(this.percentLabel, {
755
+ aria-label=${volumeLabel}
756
+ aria-valuetext=${formatWords(this, 'percentLabel', {
742
757
  percent: Math.round((this.silent ? 0 : this.loudness) * 100),
743
758
  })}
744
- style=${`--video-level: ${this.silent ? 0 : this.loudness}`}
759
+ style=${level}
745
760
  @input=${this.takeVolume}
746
761
  />
747
762
  </span>
@@ -771,7 +786,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
771
786
  <button
772
787
  part="fullscreen"
773
788
  type="button"
774
- aria-label=${this.fullscreenLabel}
789
+ aria-label=${fullscreenLabel}
775
790
  aria-pressed=${this.full ? 'true' : 'false'}
776
791
  @click=${() => void this.fullscreen.toggle()}
777
792
  >
@@ -885,9 +900,11 @@ __decorate([
885
900
  property({ reflect: true, type: Boolean })
886
901
  ], HelixHeadlessVideo.prototype, "autoplay", void 0);
887
902
  __decorate([
903
+ words,
888
904
  property({ attribute: 'captions-label' })
889
905
  ], HelixHeadlessVideo.prototype, "captionsLabel", void 0);
890
906
  __decorate([
907
+ words,
891
908
  property({ attribute: 'captions-off-label' })
892
909
  ], HelixHeadlessVideo.prototype, "captionsOffLabel", void 0);
893
910
  __decorate([
@@ -906,18 +923,22 @@ __decorate([
906
923
  property({ attribute: 'disableremoteplayback', reflect: true, type: Boolean })
907
924
  ], HelixHeadlessVideo.prototype, "disableRemotePlayback", void 0);
908
925
  __decorate([
926
+ words,
909
927
  property({ attribute: 'download-label' })
910
928
  ], HelixHeadlessVideo.prototype, "downloadLabel", void 0);
911
929
  __decorate([
930
+ words,
912
931
  property({ attribute: 'error-label' })
913
932
  ], HelixHeadlessVideo.prototype, "errorLabel", void 0);
914
933
  __decorate([
915
934
  property({ attribute: 'extra-controls' })
916
935
  ], HelixHeadlessVideo.prototype, "extraControls", void 0);
917
936
  __decorate([
937
+ words,
918
938
  property({ attribute: 'forward-label' })
919
939
  ], HelixHeadlessVideo.prototype, "forwardLabel", void 0);
920
940
  __decorate([
941
+ words,
921
942
  property({ attribute: 'fullscreen-label' })
922
943
  ], HelixHeadlessVideo.prototype, "fullscreenLabel", void 0);
923
944
  __decorate([
@@ -927,36 +948,45 @@ __decorate([
927
948
  property()
928
949
  ], HelixHeadlessVideo.prototype, "label", void 0);
929
950
  __decorate([
951
+ words,
930
952
  property({ attribute: 'loading-label' })
931
953
  ], HelixHeadlessVideo.prototype, "loadingLabel", void 0);
932
954
  __decorate([
933
955
  property({ reflect: true, type: Boolean })
934
956
  ], HelixHeadlessVideo.prototype, "loop", void 0);
935
957
  __decorate([
958
+ words,
936
959
  property({ attribute: 'more-label' })
937
960
  ], HelixHeadlessVideo.prototype, "moreLabel", void 0);
938
961
  __decorate([
962
+ words,
939
963
  property({ attribute: 'mute-label' })
940
964
  ], HelixHeadlessVideo.prototype, "muteLabel", void 0);
941
965
  __decorate([
966
+ words,
942
967
  property({ attribute: 'next-label' })
943
968
  ], HelixHeadlessVideo.prototype, "nextLabel", void 0);
944
969
  __decorate([
945
970
  property({ attribute: 'overflow-controls' })
946
971
  ], HelixHeadlessVideo.prototype, "overflowControls", void 0);
947
972
  __decorate([
973
+ words,
948
974
  property({ attribute: 'pause-label' })
949
975
  ], HelixHeadlessVideo.prototype, "pauseLabel", void 0);
950
976
  __decorate([
977
+ words,
951
978
  property({ attribute: 'percent-label' })
952
979
  ], HelixHeadlessVideo.prototype, "percentLabel", void 0);
953
980
  __decorate([
981
+ words,
954
982
  property({ attribute: 'pip-label' })
955
983
  ], HelixHeadlessVideo.prototype, "pipLabel", void 0);
956
984
  __decorate([
985
+ words,
957
986
  property({ attribute: 'player-label' })
958
987
  ], HelixHeadlessVideo.prototype, "playerLabel", void 0);
959
988
  __decorate([
989
+ words,
960
990
  property({ attribute: 'play-label' })
961
991
  ], HelixHeadlessVideo.prototype, "playLabel", void 0);
962
992
  __decorate([
@@ -969,18 +999,23 @@ __decorate([
969
999
  property()
970
1000
  ], HelixHeadlessVideo.prototype, "preload", void 0);
971
1001
  __decorate([
1002
+ words,
972
1003
  property({ attribute: 'previous-label' })
973
1004
  ], HelixHeadlessVideo.prototype, "previousLabel", void 0);
974
1005
  __decorate([
1006
+ words,
975
1007
  property({ attribute: 'remote-label' })
976
1008
  ], HelixHeadlessVideo.prototype, "remoteLabel", void 0);
977
1009
  __decorate([
1010
+ words,
978
1011
  property({ attribute: 'rewind-label' })
979
1012
  ], HelixHeadlessVideo.prototype, "rewindLabel", void 0);
980
1013
  __decorate([
1014
+ words,
981
1015
  property({ attribute: 'seek-label' })
982
1016
  ], HelixHeadlessVideo.prototype, "seekLabel", void 0);
983
1017
  __decorate([
1018
+ words,
984
1019
  property({ attribute: 'speed-label' })
985
1020
  ], HelixHeadlessVideo.prototype, "speedLabel", void 0);
986
1021
  __decorate([
@@ -993,12 +1028,15 @@ __decorate([
993
1028
  property({ attribute: 'start-control' })
994
1029
  ], HelixHeadlessVideo.prototype, "startControl", void 0);
995
1030
  __decorate([
1031
+ words,
996
1032
  property({ attribute: 'subtitles-label' })
997
1033
  ], HelixHeadlessVideo.prototype, "subtitlesLabel", void 0);
998
1034
  __decorate([
1035
+ words,
999
1036
  property({ attribute: 'time-label' })
1000
1037
  ], HelixHeadlessVideo.prototype, "timeLabel", void 0);
1001
1038
  __decorate([
1039
+ words,
1002
1040
  property({ attribute: 'volume-label' })
1003
1041
  ], HelixHeadlessVideo.prototype, "volumeLabel", void 0);
1004
1042
  __decorate([
@@ -1010,6 +1048,9 @@ __decorate([
1010
1048
  __decorate([
1011
1049
  state()
1012
1050
  ], HelixHeadlessVideo.prototype, "playing", void 0);
1051
+ __decorate([
1052
+ state()
1053
+ ], HelixHeadlessVideo.prototype, "finished", void 0);
1013
1054
  __decorate([
1014
1055
  state()
1015
1056
  ], HelixHeadlessVideo.prototype, "position", void 0);
@@ -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, commaList, customElement, elementById, HelixBeforeChangeEvent, HelixElement, HelixLoadMoreEvent, HelixRangeChangeEvent, isRtl, rangeAdd, requestChange, 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';
@@ -98,9 +98,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
98
98
  if (at === undefined) {
99
99
  return;
100
100
  }
101
- const inner = path.slice(0, path.indexOf(row));
102
- if (inner.some((node) => node instanceof HTMLElement &&
103
- node.matches('a[href], button, input, select, textarea, label'))) {
101
+ if (pressedOwnControl(event, row, 'a[href], button, input, select, textarea, label')) {
104
102
  return;
105
103
  }
106
104
  this.press(at, event.shiftKey && this.selectionMode === 'multiple');
@@ -120,6 +118,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
120
118
  this.requestUpdate();
121
119
  };
122
120
  }
121
+ static { this.words = 'helix-virtual-list'; }
123
122
  get range() {
124
123
  return this.itemsOn(this.virtualize.visible());
125
124
  }
@@ -206,6 +205,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
206
205
  super.updated?.(changed);
207
206
  this.virtualize.measure();
208
207
  this.place();
208
+ this.virtualize.settle();
209
209
  this.report();
210
210
  }
211
211
  read() {
@@ -270,8 +270,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
270
270
  const now = commaList(this.value);
271
271
  if (extend && mode === 'multiple') {
272
272
  const keys = this.keys();
273
- const from = this.anchor === undefined ? -1 : keys.indexOf(this.anchor);
274
- const range = rangeAdd(now, keys, from, at);
273
+ const range = rangeAdd(now, keys, anchorAt(keys, this.anchor, at).anchor, at);
275
274
  if (range) {
276
275
  this.choose(this.inOrder(range));
277
276
  }
@@ -285,23 +284,14 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
285
284
  this.choose(this.inOrder(toggleValue(now, key)));
286
285
  }
287
286
  inOrder(keys) {
288
- const wanted = new Set(keys);
289
- const ordered = this.keys().filter((key) => wanted.has(key));
290
- const placed = new Set(ordered);
291
- return [...ordered, ...keys.filter((key) => !placed.has(key))].join(',');
287
+ return inRowOrder(keys, this.keys()).join(',');
292
288
  }
293
289
  choose(next) {
294
290
  if (next === this.value) {
295
291
  return;
296
292
  }
297
- requestChange({
298
- apply: (value) => {
299
- this.value = value;
300
- this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
301
- },
302
- event: (value) => new HelixBeforeChangeEvent({ value }),
303
- host: this,
304
- next,
293
+ requestValue(this, next, (value) => {
294
+ this.value = value;
305
295
  });
306
296
  }
307
297
  async focusIndex(index) {
@@ -366,7 +356,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
366
356
  fragment.append(document.createElement('div'));
367
357
  }
368
358
  else if (template) {
369
- fragment.append(template.content.cloneNode(true));
359
+ fragment.append(...template.content.cloneNode(true).children);
370
360
  }
371
361
  this.fill([...fragment.children], at);
372
362
  return fragment;
@@ -492,6 +482,7 @@ __decorate([
492
482
  property({ type: Boolean })
493
483
  ], HelixHeadlessVirtualList.prototype, "loading", void 0);
494
484
  __decorate([
485
+ words,
495
486
  property({ attribute: 'loading-label' })
496
487
  ], HelixHeadlessVirtualList.prototype, "loadingLabel", void 0);
497
488
  __decorate([