@fusion.dev/helix 0.0.0-dev → 0.0.2

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 (227) hide show
  1. package/custom-elements.json +5565 -5519
  2. package/dist/accordion/item/accordion-item.css.js +1 -19
  3. package/dist/accordion/root/accordion-root.css.js +1 -1
  4. package/dist/accordion/root/accordion-root.d.ts +1 -1
  5. package/dist/accordion/root/accordion-root.js +1 -1
  6. package/dist/announcement/root/announcement-root.css.js +1 -7
  7. package/dist/app-header/root/app-header-root.css.js +1 -7
  8. package/dist/app-header/root/app-header-root.d.ts +20 -23
  9. package/dist/app-header/root/app-header-root.js +4 -4
  10. package/dist/aura/root/aura-axis.d.ts +5 -7
  11. package/dist/aura/root/aura-axis.js +5 -7
  12. package/dist/aura/root/aura-root.css.js +1 -1
  13. package/dist/aura/root/aura-root.d.ts +75 -87
  14. package/dist/aura/root/aura-root.js +100 -109
  15. package/dist/aura/root/aura-shader.d.ts +10 -13
  16. package/dist/aura/root/aura-shader.js +165 -238
  17. package/dist/avatar/group/avatar-group.css.js +1 -1
  18. package/dist/avatar/root/avatar-root.css.js +1 -1
  19. package/dist/badge/root/badge-root.css.js +1 -13
  20. package/dist/badge/root/badge-root.d.ts +4 -5
  21. package/dist/bar-chart/root/bar-chart-root.css.js +1 -13
  22. package/dist/bar-chart/root/bar-chart-root.d.ts +51 -60
  23. package/dist/bar-chart/root/bar-chart-root.js +10 -17
  24. package/dist/blockquote/root/blockquote-root.css.js +1 -1
  25. package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +1 -7
  26. package/dist/breadcrumbs/root/breadcrumbs-root.css.js +1 -1
  27. package/dist/button/root/button-root.css.js +1 -7
  28. package/dist/button/root/button-root.d.ts +16 -25
  29. package/dist/button/root/button-root.js +3 -3
  30. package/dist/button-group/root/button-group-root.css.js +1 -1
  31. package/dist/button-group/root/button-group-root.d.ts +5 -7
  32. package/dist/callout/root/callout-root.css.js +1 -1
  33. package/dist/callout/root/callout-root.d.ts +4 -4
  34. package/dist/callout/root/callout-root.js +4 -4
  35. package/dist/card/root/card-root.css.js +2 -2
  36. package/dist/card/root/card-root.d.ts +38 -48
  37. package/dist/card/root/card-root.js +8 -11
  38. package/dist/carousel/root/carousel-root.css.js +1 -11
  39. package/dist/carousel/root/carousel-root.d.ts +39 -43
  40. package/dist/carousel/root/carousel-root.js +7 -7
  41. package/dist/chat/composer/chat-composer.css.js +1 -1
  42. package/dist/chat/message/chat-message.css.js +1 -7
  43. package/dist/chat/message/chat-message.d.ts +8 -13
  44. package/dist/chat/root/chat-root.css.js +1 -1
  45. package/dist/checkbox/root/checkbox-root.css.js +1 -14
  46. package/dist/checkbox-group/root/checkbox-group-root.css.js +1 -1
  47. package/dist/code/root/code-root.css.js +9 -7
  48. package/dist/code/root/code-root.d.ts +4 -0
  49. package/dist/code/root/code-root.js +4 -0
  50. package/dist/code-block/root/code-block-root.css.js +1 -1
  51. package/dist/color-input/root/color-input-root.css.js +2 -2
  52. package/dist/color-input/root/color-input-root.js +3 -3
  53. package/dist/color-picker/root/color-picker-root.css.js +1 -9
  54. package/dist/color-picker/root/color-picker-root.js +3 -3
  55. package/dist/combobox/root/combobox-root.css.js +1 -8
  56. package/dist/combobox/root/combobox-root.js +1 -1
  57. package/dist/command/root/command-root.css.js +1 -1
  58. package/dist/copy-button/root/copy-button-root.css.js +1 -1
  59. package/dist/data-table/root/data-table-root.css.js +9 -3
  60. package/dist/data-table/root/data-table-root.d.ts +4 -1
  61. package/dist/data-table/root/data-table-root.js +4 -1
  62. package/dist/date-input/root/date-input-root.css.js +1 -1
  63. package/dist/date-picker/root/date-picker-root.css.js +1 -7
  64. package/dist/date-picker/root/date-picker-root.d.ts +1 -1
  65. package/dist/date-picker/root/date-picker-root.js +1 -1
  66. package/dist/dialog/root/dialog-root.css.js +1 -1
  67. package/dist/dialog/root/dialog-root.d.ts +15 -20
  68. package/dist/dialog/root/dialog-root.js +2 -2
  69. package/dist/divider/root/divider-root.css.js +1 -1
  70. package/dist/donut-chart/root/donut-chart-root.css.js +2 -20
  71. package/dist/donut-chart/root/donut-chart-root.d.ts +14 -19
  72. package/dist/donut-chart/root/donut-chart-root.js +6 -7
  73. package/dist/drawer/root/drawer-root.css.js +1 -11
  74. package/dist/drawer/root/drawer-root.d.ts +3 -7
  75. package/dist/drilldown/item/drilldown-item.css.js +1 -1
  76. package/dist/drilldown/root/drilldown-root.css.js +1 -1
  77. package/dist/element-events.generated.js +1 -1
  78. package/dist/empty/root/empty-root.css.js +1 -1
  79. package/dist/file-input/root/file-input-root.css.js +1 -1
  80. package/dist/file-input/root/file-input-root.js +1 -2
  81. package/dist/flex/root/flex-root.css.js +1 -1
  82. package/dist/flex/root/flex-root.d.ts +6 -6
  83. package/dist/flex/root/flex-root.js +9 -9
  84. package/dist/format-date/root/format-date-root.css.js +1 -1
  85. package/dist/grid/root/grid-root.css.js +1 -1
  86. package/dist/grid/root/grid-root.d.ts +8 -8
  87. package/dist/grid/root/grid-root.js +8 -9
  88. package/dist/heatmap/root/heatmap-root.css.js +2 -2
  89. package/dist/heatmap/root/heatmap-root.d.ts +11 -12
  90. package/dist/heatmap/root/heatmap-root.js +11 -12
  91. package/dist/icon/glyph.css.js +1 -1
  92. package/dist/icon/root/icon-root.css.js +1 -1
  93. package/dist/icon-button/root/icon-button-root.css.js +1 -7
  94. package/dist/icon-button/root/icon-button-root.d.ts +10 -10
  95. package/dist/icon-button/root/icon-button-root.js +4 -4
  96. package/dist/image/root/image-root.css.js +1 -7
  97. package/dist/input/root/input-root.css.js +1 -9
  98. package/dist/kbd/root/kbd-root.css.js +1 -1
  99. package/dist/legend/root/legend-root.css.js +1 -1
  100. package/dist/legend/root/legend-root.d.ts +34 -37
  101. package/dist/legend/root/legend-root.js +10 -10
  102. package/dist/line-chart/root/line-chart-root.css.js +1 -8
  103. package/dist/line-chart/root/line-chart-root.d.ts +6 -9
  104. package/dist/list/item/list-item.css.js +1 -1
  105. package/dist/list/root/list-root.css.js +1 -1
  106. package/dist/list/root/list-root.d.ts +4 -7
  107. package/dist/listbox/root/listbox-root.css.js +3 -3
  108. package/dist/listbox/root/listbox-root.d.ts +2 -0
  109. package/dist/listbox/root/listbox-root.js +2 -0
  110. package/dist/loader/root/loader-root.css.js +1 -1
  111. package/dist/loader/root/loader-root.d.ts +5 -9
  112. package/dist/loader/root/loader-root.js +2 -2
  113. package/dist/megamenu/root/megamenu-root.css.js +3 -2
  114. package/dist/menu/item/menu-item.css.js +1 -7
  115. package/dist/menu/root/menu-root.css.js +1 -1
  116. package/dist/meter/root/meter-root.css.js +1 -14
  117. package/dist/meter/root/meter-root.d.ts +18 -18
  118. package/dist/meter/root/meter-root.js +6 -8
  119. package/dist/mixins/mixin-control-surface/mixin-control-surface.d.ts +1 -1
  120. package/dist/navigation/root/navigation-root.css.js +1 -7
  121. package/dist/notifications/notification/notification.css.js +1 -7
  122. package/dist/notifications/root/notifications-root.css.js +1 -1
  123. package/dist/number-input/root/number-input-root.css.js +1 -9
  124. package/dist/option/group/option-group.css.js +1 -1
  125. package/dist/option/root/option-root.css.js +1 -1
  126. package/dist/outline/root/outline-root.css.js +1 -14
  127. package/dist/outline/root/outline-root.d.ts +1 -1
  128. package/dist/outline/root/outline-root.js +1 -1
  129. package/dist/pagination/root/pagination-root.css.js +1 -12
  130. package/dist/pagination/size/pagination-size.css.js +1 -1
  131. package/dist/pagination/summary/pagination-summary.css.js +1 -1
  132. package/dist/pin-input/root/pin-input-root.css.js +1 -7
  133. package/dist/popover/root/popover-root.css.js +4 -2
  134. package/dist/progress/root/progress-root.css.js +1 -7
  135. package/dist/progress/root/progress-root.d.ts +10 -9
  136. package/dist/qr-code/root/qr-code-root.css.js +1 -1
  137. package/dist/qr-code/root/qr-code-root.d.ts +1 -1
  138. package/dist/qr-code/root/qr-code-root.js +1 -1
  139. package/dist/quote/root/quote-root.css.js +1 -1
  140. package/dist/radio/group/radio-group.css.js +1 -1
  141. package/dist/radio/root/radio-root.css.js +1 -14
  142. package/dist/radio/root/radio-root.d.ts +20 -18
  143. package/dist/radio/root/radio-root.js +5 -6
  144. package/dist/rating/root/rating-root.css.js +1 -1
  145. package/dist/rating/root/rating-root.d.ts +4 -5
  146. package/dist/sandbox/preview/sandbox-preview.css.js +1 -1
  147. package/dist/sandbox/preview/sandbox-preview.d.ts +48 -44
  148. package/dist/sandbox/preview/sandbox-preview.js +63 -50
  149. package/dist/sandbox/root/sandbox-root.css.js +1 -2
  150. package/dist/sandbox/root/sandbox-root.d.ts +50 -59
  151. package/dist/sandbox/root/sandbox-root.js +75 -91
  152. package/dist/sandbox/source/sandbox-source.css.js +1 -1
  153. package/dist/sandbox/source/sandbox-source.d.ts +21 -29
  154. package/dist/sandbox/source/sandbox-source.js +26 -34
  155. package/dist/sandbox/status-bar/sandbox-status-bar.css.js +1 -1
  156. package/dist/sandbox/terminal/sandbox-terminal.css.js +1 -1
  157. package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -1
  158. package/dist/scroll-area/root/scroll-area-root.css.js +5 -5
  159. package/dist/select/root/select-root.css.js +2 -15
  160. package/dist/select/root/select-root.d.ts +4 -4
  161. package/dist/select/root/select-root.js +5 -7
  162. package/dist/shared/chart/series.css.js +1 -1
  163. package/dist/shared/chart/terminus.css.js +1 -1
  164. package/dist/shared/field/field-inline.css.js +1 -1
  165. package/dist/shared/field/field-stacked.css.js +1 -1
  166. package/dist/shared/field/field.css.js +1 -1
  167. package/dist/skeleton/root/skeleton-root.css.js +1 -1
  168. package/dist/slider/root/slider-root.css.js +1 -3
  169. package/dist/sparkline/root/sparkline-root.css.js +1 -1
  170. package/dist/sparkline/root/sparkline-root.d.ts +22 -24
  171. package/dist/sparkline/root/sparkline-root.js +6 -6
  172. package/dist/speed-dial/item/speed-dial-item.css.js +1 -7
  173. package/dist/speed-dial/root/speed-dial-root.css.js +1 -1
  174. package/dist/splitter/root/splitter-root.css.js +1 -14
  175. package/dist/stat/group/stat-group.css.js +1 -1
  176. package/dist/stat/root/stat-root.css.js +1 -1
  177. package/dist/steps/root/steps-root.css.js +1 -1
  178. package/dist/steps/step/step.css.js +1 -8
  179. package/dist/steps/step/step.js +1 -1
  180. package/dist/switch/root/switch-root.css.js +1 -8
  181. package/dist/table/cell/table-cell.css.js +1 -1
  182. package/dist/table/column/table-column.css.js +1 -1
  183. package/dist/table/root/table-root.css.js +1 -1
  184. package/dist/table/row/table-row.css.js +1 -1
  185. package/dist/tabs/panel/tab-panel.css.js +1 -1
  186. package/dist/tabs/root/tabs-root.css.js +1 -7
  187. package/dist/tabs/tab/tab.css.js +2 -8
  188. package/dist/tag/root/tag-root.css.js +1 -1
  189. package/dist/tag/root/tag-root.d.ts +10 -19
  190. package/dist/tag/root/tag-root.js +3 -3
  191. package/dist/text/root/text-root.css.js +1 -1
  192. package/dist/text/root/text-root.d.ts +13 -14
  193. package/dist/text/root/text-root.js +6 -6
  194. package/dist/textarea/root/textarea-root.css.js +1 -7
  195. package/dist/time-input/root/time-input-root.css.js +1 -1
  196. package/dist/time-input/root/time-input-root.js +1 -1
  197. package/dist/time-picker/root/time-picker-root.css.js +1 -7
  198. package/dist/time-picker/root/time-picker-root.js +1 -1
  199. package/dist/timeline/item/timeline-item.css.js +1 -1
  200. package/dist/timeline/root/timeline-root.css.js +1 -1
  201. package/dist/toast/item/toast-item.css.js +1 -1
  202. package/dist/toast/root/toast-root.css.js +1 -1
  203. package/dist/toggle/group/toggle-group.css.js +1 -7
  204. package/dist/toggle/group/toggle-group.d.ts +6 -9
  205. package/dist/toggle/root/toggle-root.css.js +1 -1
  206. package/dist/toolbar/root/toolbar-root.css.js +1 -1
  207. package/dist/tooltip/root/tooltip-root.css.js +1 -1
  208. package/dist/tooltip/root/tooltip-root.d.ts +6 -7
  209. package/dist/tour/root/tour-root.css.js +1 -7
  210. package/dist/tour/stop/tour-stop.css.js +2 -2
  211. package/dist/tree/item/tree-item.css.js +1 -17
  212. package/dist/tree/root/tree-root.css.js +1 -1
  213. package/dist/tree/root/tree-root.d.ts +0 -2
  214. package/dist/trend/root/trend-root.css.js +1 -1
  215. package/dist/trend/root/trend-root.d.ts +4 -7
  216. package/dist/trend/root/trend-root.js +4 -7
  217. package/dist/video/root/video-root.css.js +1 -12
  218. package/dist/video/root/video-root.d.ts +3 -8
  219. package/dist/video-playlist/item/video-playlist-item.css.js +1 -7
  220. package/dist/video-playlist/menu/video-playlist-menu.css.js +1 -1
  221. package/dist/video-playlist/root/video-playlist-root.css.js +1 -1
  222. package/dist/virtual-list/root/virtual-list-root.css.js +1 -1
  223. package/elements.css +4 -5
  224. package/helix.css +31 -0
  225. package/jsx.d.ts +11625 -14561
  226. package/package.json +10 -8
  227. package/vue.d.ts +3594 -4231
@@ -91,6 +91,10 @@ const OPENING_PATIENCE = 500;
91
91
  let HelixAura = class HelixAura extends HelixElement {
92
92
  constructor() {
93
93
  super(...arguments);
94
+ /**
95
+ * How soft the falloff is, `0` tight and `1` diffuse.
96
+ */
97
+ this.bloom = 0.5;
94
98
  /**
95
99
  * How far the settings wander on their own, `0` still and `1` restless.
96
100
  *
@@ -107,13 +111,9 @@ let HelixAura = class HelixAura extends HelixElement {
107
111
  */
108
112
  this.drift = 0;
109
113
  /**
110
- * How far the pointer reaches into the field, `0` upward.
111
- *
112
- * Multiplied into the presence the pointer already fades in and out with, so
113
- * it scales the whole response rather than any one part of it, whichever
114
- * interaction is in play.
114
+ * Overall brightness, as a multiplier on the field.
115
115
  */
116
- this.reach = 1;
116
+ this.gain = 1;
117
117
  /**
118
118
  * Whether the pointer shifts and lifts the field.
119
119
  *
@@ -124,13 +124,13 @@ let HelixAura = class HelixAura extends HelixElement {
124
124
  */
125
125
  this.interactive = false;
126
126
  /**
127
- * How soft the falloff is, `0` tight and `1` diffuse.
128
- */
129
- this.bloom = 0.5;
130
- /**
131
- * Overall brightness, as a multiplier on the field.
127
+ * How far the pointer reaches into the field, `0` upward.
128
+ *
129
+ * Multiplied into the presence the pointer already fades in and out with, so
130
+ * it scales the whole response rather than any one part of it, whichever
131
+ * interaction is in play.
132
132
  */
133
- this.gain = 1;
133
+ this.reach = 1;
134
134
  /**
135
135
  * Feature size, as a multiplier on the sampled coordinates.
136
136
  */
@@ -218,20 +218,23 @@ let HelixAura = class HelixAura extends HelixElement {
218
218
  * ending at P to ending at P, P, which is the same shape, and nothing jumps.
219
219
  */
220
220
  this.head = { x: 1, y: 1 };
221
- /** Where the pointer is, and where the field has got to. The gap is weight. */
222
- /* `presence`, not `reach`: the eased value is how far the pointer has faded
223
- in, and `reach` is now the consumer's amplitude. The two multiply. */
221
+ /**
222
+ * Where the pointer is, and where the field has got to. The gap is weight.
223
+ *
224
+ * `presence`, not `reach`: the eased value is how far the pointer has faded
225
+ * in, and `reach` is the consumer's amplitude. The two multiply.
226
+ */
224
227
  this.target = { presence: 0, x: 0, y: 0 };
225
228
  this.eased = { presence: 0, x: 0, y: 0 };
226
229
  /**
227
230
  * The element's box, cached.
228
231
  *
229
- * **Read per event, this was the ragged half.** `getBoundingClientRect` forces
230
- * a synchronous layout, and a pointer emits events far faster than the
231
- * display refreshes: a 1000Hz mouse flushed layout a thousand times a second
232
- * to compute a number that only changes when the page reflows. Refreshed from
233
- * the resize observer and from scroll, both of which are exactly when it can
234
- * go stale, and never from the handler that reads it.
232
+ * **Never read per event.** `getBoundingClientRect` forces a synchronous
233
+ * layout, and a pointer emits events far faster than the display refreshes: a
234
+ * 1000Hz mouse flushed layout a thousand times a second to compute a number
235
+ * that only changes when the page reflows. Refreshed from the resize observer
236
+ * and from scroll, both of which are exactly when it can go stale, and never
237
+ * from the handler that reads it.
235
238
  */
236
239
  this.box = { height: 1, left: 0, top: 0, width: 1 };
237
240
  /**
@@ -246,9 +249,8 @@ let HelixAura = class HelixAura extends HelixElement {
246
249
  * scales: it opens coarse and tightens, which reads as the background zooming
247
250
  * out on load rather than as a background.
248
251
  *
249
- * Refusing the degenerate 0 by 0 box fixed the worst of it, a 2 by 2 drawing
250
- * buffer smeared over the page, and left the ordinary case: a first real box
251
- * that is simply not the last one.
252
+ * Refusing the degenerate 0 by 0 box leaves the ordinary case: a first real
253
+ * box that is simply not the last one.
252
254
  *
253
255
  * So the opening frame waits for the box to stop moving. Nothing paints until
254
256
  * a measurement has stood unchanged for one animation frame, which is the
@@ -313,36 +315,32 @@ let HelixAura = class HelixAura extends HelixElement {
313
315
  field snapped to its opening frame, which is the one thing a background
314
316
  must never do. */
315
317
  this.elapsed += delta * Math.max(0, this.drifted(this.speed, 0.4, 0.043));
316
- /* Two time constants, because position and presence are two different
317
- jobs and one number was serving both badly.
318
-
318
+ /* Two time constants, because position and presence are two different jobs
319
+ and one number serves both badly.
320
+
319
321
  **Position tracks.** A parallax that lags is not weighty, it is late: at
320
322
  85 milliseconds it took about two tenths of a second to close nine tenths
321
323
  of the gap, which is well inside what a reader perceives as the page
322
- being slow rather than the field being heavy. 28 milliseconds puts it at
323
- the edge of perception while still absorbing the jitter a raw pointer
324
- carries, which is the only thing the easing was ever for.
325
-
324
+ being slow rather than the field being heavy.
325
+
326
326
  **Presence does not.** `reach` is the effect fading in as the pointer
327
327
  arrives and out as it leaves, and that wants to be gradual: snapped on,
328
328
  the whole field flinches the instant a cursor crosses the edge.
329
-
329
+
330
+ **The position constant scales with the gap, because one constant cannot
331
+ do both jobs.** A fixed 28 milliseconds leaves a moving pointer a
332
+ distance v * t behind it for as long as it keeps moving: about 56 pixels
333
+ at a 2000 pixel per second flick and twice that at twice the speed, which
334
+ is what reads as the field being unable to keep up. Lowering it for
335
+ everyone would give the jitter of a resting hand straight back to the
336
+ shader, which is the only thing the smoothing was ever there for. Jitter
337
+ is small and a flick is large, so the size of the gap is the signal that
338
+ tells them apart: at rest this eases over about 25 milliseconds, a gap of
339
+ one shape unit closes over nine, and two over five.
340
+
330
341
  Frame-rate independent, written as a time constant rather than a
331
342
  per-frame factor: a factor ties the feel to the refresh rate, so a 120Hz
332
343
  display would chase twice as eagerly as a 60Hz one. */
333
- /* **The constant scales with the gap, because one constant cannot do both
334
- jobs.** A fixed 28 milliseconds leaves a moving pointer a distance v * t
335
- behind it for as long as it keeps moving: about 56 pixels at a 2000
336
- pixel per second flick and twice that at twice the speed, which is what
337
- reads as the field being unable to keep up. Lowering it for everyone
338
- would give the jitter of a resting hand straight back to the shader,
339
- which is the only thing the smoothing was ever there for.
340
-
341
- Jitter is small and a flick is large, so the size of the gap is the
342
- signal that tells them apart. At rest this still eases over about 25
343
- milliseconds; a gap of one shape unit closes over nine, and two over
344
- five. Nothing to tune per shape and nothing to measure per frame beyond
345
- a distance already implied by the two points. */
346
344
  const drift = Math.hypot(this.target.x - this.eased.x, this.target.y - this.eased.y);
347
345
  const follow = 1 - Math.exp(-delta / (0.028 / (1 + drift * 2.4)));
348
346
  if (!this.interactive) {
@@ -414,16 +412,15 @@ let HelixAura = class HelixAura extends HelixElement {
414
412
  }
415
413
  /* Everything the canvas needs, in one place both lifecycles can reach.
416
414
  *
417
- * This was the body of `firstUpdated`, which runs once for the life of the
418
- * element, while `disconnectedCallback` deletes the program, drops the
419
- * context and disconnects both observers, and runs every time the element
420
- * moves. So an aura reordered by a framework came back with `this.gl` null
421
- * and nothing to rebuild it: a live component painting nothing, for the rest
422
- * of the page's life, with no error anywhere.
415
+ * `firstUpdated` runs once for the life of the element, while
416
+ * `disconnectedCallback` deletes the program, drops the context and
417
+ * disconnects both observers, and runs every time the element moves. Setup
418
+ * that lives only in `firstUpdated` therefore leaves an aura reordered by a
419
+ * framework with `this.gl` null and nothing to rebuild it: a live component
420
+ * painting nothing, for the rest of the page's life, with no error anywhere.
423
421
  *
424
422
  * Guarded at the call site on `hasUpdated`, because the first connection
425
- * happens before the first render and there is no canvas yet.
426
- * `check:observers` holds the pairing. */
423
+ * happens before the first render and there is no canvas yet. */
427
424
  start() {
428
425
  /* Client only, and by contract. There is no canvas on a server, so the
429
426
  shader is an enhancement over markup that already renders a gradient. */
@@ -453,7 +450,7 @@ let HelixAura = class HelixAura extends HelixElement {
453
450
  the pointer is measured against. Passive, because nothing here cancels. */
454
451
  window.addEventListener('scroll', this.handleScroll, { capture: true, passive: true });
455
452
  this.sized = new ResizeObserver(() => {
456
- /* **A resize repaints unconditionally, where a resize used to ask.**
453
+ /* **A resize repaints unconditionally rather than asking.**
457
454
  `measure` clears the drawing buffer whenever it resizes it, because
458
455
  assigning `canvas.width` is a reset and not a hint. `paintOnce` declines
459
456
  while the loop holds a frame handle, which is right for a property
@@ -481,17 +478,16 @@ let HelixAura = class HelixAura extends HelixElement {
481
478
  /**
482
479
  * The context and the program, from whatever canvas can still give one.
483
480
  *
484
- * **A canvas whose context was force-lost never yields a working one again**,
485
- * and the release below used to assume the opposite: `getContext` hands back
486
- * the very same dead object, which reports `isContextLost()` and answers
487
- * `null` to every `getShaderParameter`. So `link` failed, `start` returned
488
- * before installing a single observer, and the element sat connected and
489
- * permanently blind, holding whatever buffer it last painted. Measured on the
490
- * landing page, where one remove-and-reinsert was enough: the frozen frame
491
- * was the 2x2 the first `measure` took before layout, stretched across two
492
- * screens as a gray smear that reads as a broken gradient rather than as a
493
- * dead component. The only sound in the console was `getShaderInfoLog`
494
- * answering `null`, twice per element.
481
+ * **A canvas whose context was force-lost never yields a working one again.**
482
+ * `getContext` hands back the very same dead object, which reports
483
+ * `isContextLost()` and answers `null` to every `getShaderParameter`, so
484
+ * `link` fails, `start` returns before installing a single observer, and the
485
+ * element sits connected and permanently blind, holding whatever buffer it
486
+ * last painted. Measured on the landing page, where one remove-and-reinsert
487
+ * was enough: the frozen frame was the 2x2 the first `measure` took before
488
+ * layout, stretched across two screens as a gray smear that reads as a broken
489
+ * gradient rather than as a dead component. The only sound in the console was
490
+ * `getShaderInfoLog` answering `null`, twice per element.
495
491
  *
496
492
  * A spent canvas is therefore replaced rather than re-asked. `restoreContext`
497
493
  * is the other way and is not reachable from here: it needs the `webglcontextlost`
@@ -849,12 +845,10 @@ let HelixAura = class HelixAura extends HelixElement {
849
845
  * `/helix/aura`, where it is a toggle a reader chose. So the cap applies where
850
846
  * nothing is being followed and lifts where something is.
851
847
  *
852
- * **Measured before it was capped, because the cost had changed.** 252 was
853
- * filed against one field on the first two screens. It is three now, one per
854
- * transparent run of the page, and with the frame limiter off they drew 2,654
855
- * times in three seconds against 1,276 for one: the work scales with the count
856
- * because each instance draws once per callback. Capping the two that nobody
857
- * points at is most of that back.
848
+ * **The cost scales with the count.** Three fields run on the landing page,
849
+ * one per transparent run, and with the frame limiter off they drew 2,654
850
+ * times in three seconds against 1,276 for one: each instance draws once per
851
+ * callback. Capping the two that nobody points at is most of that back.
858
852
  */
859
853
  static { this.CAPPED = 1000 / 30; }
860
854
  play() {
@@ -877,13 +871,6 @@ let HelixAura = class HelixAura extends HelixElement {
877
871
  stale stamp. `elapsed` is deliberately kept. */
878
872
  this.last = 0;
879
873
  }
880
- /*
881
- * One axis, wandering around its set value.
882
- *
883
- * Two sines at an irrational ratio rather than one, so a single axis has no
884
- * period of its own either. Bounded by construction: the weights sum to one,
885
- * so the value never leaves `base` plus or minus `span`.
886
- */
887
874
  /**
888
875
  * The angle actually drawn, which is `terminus` resolved against the box.
889
876
  *
@@ -891,12 +878,9 @@ let HelixAura = class HelixAura extends HelixElement {
891
878
  * business knowing when: it is read once per frame from numbers already
892
879
  * there.
893
880
  *
894
- * The solve is `tiltFor` in `aura-axis.ts` rather than an expression here,
895
- * and that is the fix for how this went wrong twice. Both times the
896
- * arithmetic sat inside this getter next to a sentence describing different
897
- * arithmetic, and nothing in the repository could tell they disagreed. It is
898
- * callable now, and `aura-root.dom.spec.ts` runs it against a model of the
899
- * shader in both directions. See 155.
881
+ * The solve is `tiltFor` in `aura-axis.ts` rather than an expression here, so
882
+ * it is callable and `aura-root.dom.spec.ts` runs it against a model of the
883
+ * shader in both directions.
900
884
  */
901
885
  get bearing() {
902
886
  if (this.terminus === undefined) {
@@ -905,6 +889,13 @@ let HelixAura = class HelixAura extends HelixElement {
905
889
  const { height, width } = this.box;
906
890
  return tiltFor(this.terminus, width / Math.max(height, 1));
907
891
  }
892
+ /*
893
+ * One axis, wandering around its set value.
894
+ *
895
+ * Two sines at an irrational ratio rather than one, so a single axis has no
896
+ * period of its own either. Bounded by construction: the weights sum to one,
897
+ * so the value never leaves `base` plus or minus `span`.
898
+ */
908
899
  drifted(base, span, seed) {
909
900
  if (!this.drift) {
910
901
  return base;
@@ -926,19 +917,19 @@ let HelixAura = class HelixAura extends HelixElement {
926
917
  /**
927
918
  * Keeps the head of the wake on the cursor, and commits it as it travels.
928
919
  *
929
- * **The head used to be a committed mark, and that was both faults at once.**
930
- * Marks are spaced by distance so eight slots cover a gesture rather than the
931
- * last few milliseconds of one, but committing was also the only time the
932
- * stroke grew: its leading end therefore sat up to a full gate behind the
933
- * pointer, and caught up in jumps of exactly that size. Latent, and jagged,
934
- * for one reason.
920
+ * **The head is provisional, never a committed mark**, and holding it in the
921
+ * ring is two faults at once. Marks are spaced by distance so eight slots
922
+ * cover a gesture rather than the last few milliseconds of one, but if
923
+ * committing is also the only time the stroke grows, its leading end sits up
924
+ * to a full gate behind the pointer and catches up in jumps of exactly that
925
+ * size. Latent, and jagged, for one reason.
935
926
  *
936
- * So the slot at `trailNext` is provisional. It is rewritten every frame to
937
- * wherever the field has actually eased to, which is where the cursor looks
938
- * like it is, so the stroke always reaches the pointer. Crossing the gate does
939
- * not move the head, it just stops the previous position from being
940
- * overwritten, and a new provisional head starts from there. The wake grows
941
- * continuously and is still only ever eight points.
927
+ * So the slot at `trailNext` is rewritten every frame to wherever the field
928
+ * has actually eased to, which is where the cursor looks like it is, so the
929
+ * stroke always reaches the pointer. Crossing the gate does not move the head,
930
+ * it just stops the previous position from being overwritten, and a new
931
+ * provisional head starts from there. The wake grows continuously and is still
932
+ * only ever eight points.
942
933
  *
943
934
  * Measured against `eased` rather than `target`, or the stroke would reach a
944
935
  * place the field has not arrived at yet and lead its own parallax.
@@ -960,9 +951,9 @@ let HelixAura = class HelixAura extends HelixElement {
960
951
  this.trail[at + 1] = this.head.y;
961
952
  this.trail[at + 2] = 0;
962
953
  this.trailNext = (this.trailNext + 1) % 8;
963
- /* Every other mark ages a slot's worth on each commit, on top of ageing
954
+ /* Every other mark ages a slot's worth on each commit, on top of aging
964
955
  with time.
965
-
956
+
966
957
  Time alone is not enough, because what has to be spent by the moment the
967
958
  ring reuses a slot is a function of *distance traveled*, not of seconds:
968
959
  marks commit every gate length, so a brisk gesture laps the ring long
@@ -983,26 +974,23 @@ let HelixAura = class HelixAura extends HelixElement {
983
974
  }
984
975
  };
985
976
  __decorate([
986
- property({ reflect: true })
987
- ], HelixAura.prototype, "variant", void 0);
977
+ property({ type: Number })
978
+ ], HelixAura.prototype, "bloom", void 0);
988
979
  __decorate([
989
980
  property({ type: Number })
990
981
  ], HelixAura.prototype, "drift", void 0);
982
+ __decorate([
983
+ property({ type: Number })
984
+ ], HelixAura.prototype, "gain", void 0);
991
985
  __decorate([
992
986
  property()
993
987
  ], HelixAura.prototype, "interaction", void 0);
994
- __decorate([
995
- property({ type: Number })
996
- ], HelixAura.prototype, "reach", void 0);
997
988
  __decorate([
998
989
  property({ reflect: true, type: Boolean })
999
990
  ], HelixAura.prototype, "interactive", void 0);
1000
991
  __decorate([
1001
992
  property({ type: Number })
1002
- ], HelixAura.prototype, "bloom", void 0);
1003
- __decorate([
1004
- property({ type: Number })
1005
- ], HelixAura.prototype, "gain", void 0);
993
+ ], HelixAura.prototype, "reach", void 0);
1006
994
  __decorate([
1007
995
  property({ type: Number })
1008
996
  ], HelixAura.prototype, "scale", void 0);
@@ -1011,13 +999,16 @@ __decorate([
1011
999
  ], HelixAura.prototype, "speed", void 0);
1012
1000
  __decorate([
1013
1001
  property({ type: Number })
1014
- ], HelixAura.prototype, "tilt", void 0);
1002
+ ], HelixAura.prototype, "terminus", void 0);
1015
1003
  __decorate([
1016
1004
  property({ type: Number })
1017
- ], HelixAura.prototype, "terminus", void 0);
1005
+ ], HelixAura.prototype, "tilt", void 0);
1018
1006
  __decorate([
1019
1007
  property({ type: Number })
1020
1008
  ], HelixAura.prototype, "variance", void 0);
1009
+ __decorate([
1010
+ property({ reflect: true })
1011
+ ], HelixAura.prototype, "variant", void 0);
1021
1012
  HelixAura = HelixAura_1 = __decorate([
1022
1013
  customElement('helix-aura')
1023
1014
  ], HelixAura);