@fusion.dev/helix 0.0.0-dev → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +5565 -5519
- package/dist/accordion/item/accordion-item.css.js +1 -19
- package/dist/accordion/root/accordion-root.css.js +1 -1
- package/dist/accordion/root/accordion-root.d.ts +1 -1
- package/dist/accordion/root/accordion-root.js +1 -1
- package/dist/announcement/root/announcement-root.css.js +1 -7
- package/dist/app-header/root/app-header-root.css.js +1 -7
- package/dist/app-header/root/app-header-root.d.ts +20 -23
- package/dist/app-header/root/app-header-root.js +4 -4
- package/dist/aura/root/aura-axis.d.ts +5 -7
- package/dist/aura/root/aura-axis.js +5 -7
- package/dist/aura/root/aura-root.css.js +1 -1
- package/dist/aura/root/aura-root.d.ts +75 -87
- package/dist/aura/root/aura-root.js +100 -109
- package/dist/aura/root/aura-shader.d.ts +10 -13
- package/dist/aura/root/aura-shader.js +165 -238
- package/dist/avatar/group/avatar-group.css.js +1 -1
- package/dist/avatar/root/avatar-root.css.js +1 -1
- package/dist/badge/root/badge-root.css.js +1 -13
- package/dist/badge/root/badge-root.d.ts +4 -5
- package/dist/bar-chart/root/bar-chart-root.css.js +1 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +51 -60
- package/dist/bar-chart/root/bar-chart-root.js +10 -17
- package/dist/blockquote/root/blockquote-root.css.js +1 -1
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +1 -7
- package/dist/breadcrumbs/root/breadcrumbs-root.css.js +1 -1
- package/dist/button/root/button-root.css.js +1 -7
- package/dist/button/root/button-root.d.ts +16 -25
- package/dist/button/root/button-root.js +3 -3
- package/dist/button-group/root/button-group-root.css.js +1 -1
- package/dist/button-group/root/button-group-root.d.ts +5 -7
- package/dist/callout/root/callout-root.css.js +1 -1
- package/dist/callout/root/callout-root.d.ts +4 -4
- package/dist/callout/root/callout-root.js +4 -4
- package/dist/card/root/card-root.css.js +2 -2
- package/dist/card/root/card-root.d.ts +38 -48
- package/dist/card/root/card-root.js +8 -11
- package/dist/carousel/root/carousel-root.css.js +1 -11
- package/dist/carousel/root/carousel-root.d.ts +39 -43
- package/dist/carousel/root/carousel-root.js +7 -7
- package/dist/chat/composer/chat-composer.css.js +1 -1
- package/dist/chat/message/chat-message.css.js +1 -7
- package/dist/chat/message/chat-message.d.ts +8 -13
- package/dist/chat/root/chat-root.css.js +1 -1
- package/dist/checkbox/root/checkbox-root.css.js +1 -14
- package/dist/checkbox-group/root/checkbox-group-root.css.js +1 -1
- package/dist/code/root/code-root.css.js +9 -7
- package/dist/code/root/code-root.d.ts +4 -0
- package/dist/code/root/code-root.js +4 -0
- package/dist/code-block/root/code-block-root.css.js +1 -1
- package/dist/color-input/root/color-input-root.css.js +2 -2
- package/dist/color-input/root/color-input-root.js +3 -3
- package/dist/color-picker/root/color-picker-root.css.js +1 -9
- package/dist/color-picker/root/color-picker-root.js +3 -3
- package/dist/combobox/root/combobox-root.css.js +1 -8
- package/dist/combobox/root/combobox-root.js +1 -1
- package/dist/command/root/command-root.css.js +1 -1
- package/dist/copy-button/root/copy-button-root.css.js +1 -1
- package/dist/data-table/root/data-table-root.css.js +9 -3
- package/dist/data-table/root/data-table-root.d.ts +4 -1
- package/dist/data-table/root/data-table-root.js +4 -1
- package/dist/date-input/root/date-input-root.css.js +1 -1
- package/dist/date-picker/root/date-picker-root.css.js +1 -7
- package/dist/date-picker/root/date-picker-root.d.ts +1 -1
- package/dist/date-picker/root/date-picker-root.js +1 -1
- package/dist/dialog/root/dialog-root.css.js +1 -1
- package/dist/dialog/root/dialog-root.d.ts +15 -20
- package/dist/dialog/root/dialog-root.js +2 -2
- package/dist/divider/root/divider-root.css.js +1 -1
- package/dist/donut-chart/root/donut-chart-root.css.js +2 -20
- package/dist/donut-chart/root/donut-chart-root.d.ts +14 -19
- package/dist/donut-chart/root/donut-chart-root.js +6 -7
- package/dist/drawer/root/drawer-root.css.js +1 -11
- package/dist/drawer/root/drawer-root.d.ts +3 -7
- package/dist/drilldown/item/drilldown-item.css.js +1 -1
- package/dist/drilldown/root/drilldown-root.css.js +1 -1
- package/dist/element-events.generated.js +1 -1
- package/dist/empty/root/empty-root.css.js +1 -1
- package/dist/file-input/root/file-input-root.css.js +1 -1
- package/dist/file-input/root/file-input-root.js +1 -2
- package/dist/flex/root/flex-root.css.js +1 -1
- package/dist/flex/root/flex-root.d.ts +6 -6
- package/dist/flex/root/flex-root.js +9 -9
- package/dist/format-date/root/format-date-root.css.js +1 -1
- package/dist/grid/root/grid-root.css.js +1 -1
- package/dist/grid/root/grid-root.d.ts +8 -8
- package/dist/grid/root/grid-root.js +8 -9
- package/dist/heatmap/root/heatmap-root.css.js +2 -2
- package/dist/heatmap/root/heatmap-root.d.ts +11 -12
- package/dist/heatmap/root/heatmap-root.js +11 -12
- package/dist/icon/glyph.css.js +1 -1
- package/dist/icon/root/icon-root.css.js +1 -1
- package/dist/icon-button/root/icon-button-root.css.js +1 -7
- package/dist/icon-button/root/icon-button-root.d.ts +10 -10
- package/dist/icon-button/root/icon-button-root.js +4 -4
- package/dist/image/root/image-root.css.js +1 -7
- package/dist/input/root/input-root.css.js +1 -9
- package/dist/kbd/root/kbd-root.css.js +1 -1
- package/dist/legend/root/legend-root.css.js +1 -1
- package/dist/legend/root/legend-root.d.ts +34 -37
- package/dist/legend/root/legend-root.js +10 -10
- package/dist/line-chart/root/line-chart-root.css.js +1 -8
- package/dist/line-chart/root/line-chart-root.d.ts +6 -9
- package/dist/list/item/list-item.css.js +1 -1
- package/dist/list/root/list-root.css.js +1 -1
- package/dist/list/root/list-root.d.ts +4 -7
- package/dist/listbox/root/listbox-root.css.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +2 -0
- package/dist/listbox/root/listbox-root.js +2 -0
- package/dist/loader/root/loader-root.css.js +1 -1
- package/dist/loader/root/loader-root.d.ts +5 -9
- package/dist/loader/root/loader-root.js +2 -2
- package/dist/megamenu/root/megamenu-root.css.js +3 -2
- package/dist/menu/item/menu-item.css.js +1 -7
- package/dist/menu/root/menu-root.css.js +1 -1
- package/dist/meter/root/meter-root.css.js +1 -14
- package/dist/meter/root/meter-root.d.ts +18 -18
- package/dist/meter/root/meter-root.js +6 -8
- package/dist/mixins/mixin-control-surface/mixin-control-surface.d.ts +1 -1
- package/dist/navigation/root/navigation-root.css.js +1 -7
- package/dist/notifications/notification/notification.css.js +1 -7
- package/dist/notifications/root/notifications-root.css.js +1 -1
- package/dist/number-input/root/number-input-root.css.js +1 -9
- package/dist/option/group/option-group.css.js +1 -1
- package/dist/option/root/option-root.css.js +1 -1
- package/dist/outline/root/outline-root.css.js +1 -14
- package/dist/outline/root/outline-root.d.ts +1 -1
- package/dist/outline/root/outline-root.js +1 -1
- package/dist/pagination/root/pagination-root.css.js +1 -12
- package/dist/pagination/size/pagination-size.css.js +1 -1
- package/dist/pagination/summary/pagination-summary.css.js +1 -1
- package/dist/pin-input/root/pin-input-root.css.js +1 -7
- package/dist/popover/root/popover-root.css.js +4 -2
- package/dist/progress/root/progress-root.css.js +1 -7
- package/dist/progress/root/progress-root.d.ts +10 -9
- package/dist/qr-code/root/qr-code-root.css.js +1 -1
- package/dist/qr-code/root/qr-code-root.d.ts +1 -1
- package/dist/qr-code/root/qr-code-root.js +1 -1
- package/dist/quote/root/quote-root.css.js +1 -1
- package/dist/radio/group/radio-group.css.js +1 -1
- package/dist/radio/root/radio-root.css.js +1 -14
- package/dist/radio/root/radio-root.d.ts +20 -18
- package/dist/radio/root/radio-root.js +5 -6
- package/dist/rating/root/rating-root.css.js +1 -1
- package/dist/rating/root/rating-root.d.ts +4 -5
- package/dist/sandbox/preview/sandbox-preview.css.js +1 -1
- package/dist/sandbox/preview/sandbox-preview.d.ts +48 -44
- package/dist/sandbox/preview/sandbox-preview.js +63 -50
- package/dist/sandbox/root/sandbox-root.css.js +1 -2
- package/dist/sandbox/root/sandbox-root.d.ts +50 -59
- package/dist/sandbox/root/sandbox-root.js +75 -91
- package/dist/sandbox/source/sandbox-source.css.js +1 -1
- package/dist/sandbox/source/sandbox-source.d.ts +21 -29
- package/dist/sandbox/source/sandbox-source.js +26 -34
- package/dist/sandbox/status-bar/sandbox-status-bar.css.js +1 -1
- package/dist/sandbox/terminal/sandbox-terminal.css.js +1 -1
- package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -1
- package/dist/scroll-area/root/scroll-area-root.css.js +5 -5
- package/dist/select/root/select-root.css.js +2 -15
- package/dist/select/root/select-root.d.ts +4 -4
- package/dist/select/root/select-root.js +5 -7
- package/dist/shared/chart/series.css.js +1 -1
- package/dist/shared/chart/terminus.css.js +1 -1
- package/dist/shared/field/field-inline.css.js +1 -1
- package/dist/shared/field/field-stacked.css.js +1 -1
- package/dist/shared/field/field.css.js +1 -1
- package/dist/skeleton/root/skeleton-root.css.js +1 -1
- package/dist/slider/root/slider-root.css.js +1 -3
- package/dist/sparkline/root/sparkline-root.css.js +1 -1
- package/dist/sparkline/root/sparkline-root.d.ts +22 -24
- package/dist/sparkline/root/sparkline-root.js +6 -6
- package/dist/speed-dial/item/speed-dial-item.css.js +1 -7
- package/dist/speed-dial/root/speed-dial-root.css.js +1 -1
- package/dist/splitter/root/splitter-root.css.js +1 -14
- package/dist/stat/group/stat-group.css.js +1 -1
- package/dist/stat/root/stat-root.css.js +1 -1
- package/dist/steps/root/steps-root.css.js +1 -1
- package/dist/steps/step/step.css.js +1 -8
- package/dist/steps/step/step.js +1 -1
- package/dist/switch/root/switch-root.css.js +1 -8
- package/dist/table/cell/table-cell.css.js +1 -1
- package/dist/table/column/table-column.css.js +1 -1
- package/dist/table/root/table-root.css.js +1 -1
- package/dist/table/row/table-row.css.js +1 -1
- package/dist/tabs/panel/tab-panel.css.js +1 -1
- package/dist/tabs/root/tabs-root.css.js +1 -7
- package/dist/tabs/tab/tab.css.js +2 -8
- package/dist/tag/root/tag-root.css.js +1 -1
- package/dist/tag/root/tag-root.d.ts +10 -19
- package/dist/tag/root/tag-root.js +3 -3
- package/dist/text/root/text-root.css.js +1 -1
- package/dist/text/root/text-root.d.ts +13 -14
- package/dist/text/root/text-root.js +6 -6
- package/dist/textarea/root/textarea-root.css.js +1 -7
- package/dist/time-input/root/time-input-root.css.js +1 -1
- package/dist/time-input/root/time-input-root.js +1 -1
- package/dist/time-picker/root/time-picker-root.css.js +1 -7
- package/dist/time-picker/root/time-picker-root.js +1 -1
- package/dist/timeline/item/timeline-item.css.js +1 -1
- package/dist/timeline/root/timeline-root.css.js +1 -1
- package/dist/toast/item/toast-item.css.js +1 -1
- package/dist/toast/root/toast-root.css.js +1 -1
- package/dist/toggle/group/toggle-group.css.js +1 -7
- package/dist/toggle/group/toggle-group.d.ts +6 -9
- package/dist/toggle/root/toggle-root.css.js +1 -1
- package/dist/toolbar/root/toolbar-root.css.js +1 -1
- package/dist/tooltip/root/tooltip-root.css.js +1 -1
- package/dist/tooltip/root/tooltip-root.d.ts +6 -7
- package/dist/tour/root/tour-root.css.js +1 -7
- package/dist/tour/stop/tour-stop.css.js +2 -2
- package/dist/tree/item/tree-item.css.js +1 -17
- package/dist/tree/root/tree-root.css.js +1 -1
- package/dist/tree/root/tree-root.d.ts +0 -2
- package/dist/trend/root/trend-root.css.js +1 -1
- package/dist/trend/root/trend-root.d.ts +4 -7
- package/dist/trend/root/trend-root.js +4 -7
- package/dist/video/root/video-root.css.js +1 -12
- package/dist/video/root/video-root.d.ts +3 -8
- package/dist/video-playlist/item/video-playlist-item.css.js +1 -7
- package/dist/video-playlist/menu/video-playlist-menu.css.js +1 -1
- package/dist/video-playlist/root/video-playlist-root.css.js +1 -1
- package/dist/virtual-list/root/virtual-list-root.css.js +1 -1
- package/elements.css +4 -5
- package/helix.css +31 -0
- package/jsx.d.ts +11625 -14561
- package/package.json +10 -8
- 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
|
-
*
|
|
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.
|
|
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
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
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.
|
|
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
|
-
/**
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
* **
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
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
|
|
250
|
-
*
|
|
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
|
-
|
|
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.
|
|
323
|
-
|
|
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
|
-
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
* and nothing to rebuild it: a live component
|
|
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
|
|
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
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* `
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
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
|
-
* **
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
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
|
-
*
|
|
896
|
-
*
|
|
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
|
|
930
|
-
* Marks are spaced by distance so eight slots
|
|
931
|
-
* last few milliseconds of one, but
|
|
932
|
-
*
|
|
933
|
-
* pointer
|
|
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
|
|
937
|
-
*
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
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
|
|
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({
|
|
987
|
-
], HelixAura.prototype, "
|
|
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, "
|
|
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, "
|
|
1002
|
+
], HelixAura.prototype, "terminus", void 0);
|
|
1015
1003
|
__decorate([
|
|
1016
1004
|
property({ type: Number })
|
|
1017
|
-
], HelixAura.prototype, "
|
|
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);
|