@fusion.dev/helix-core 0.245.0 → 0.247.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 (40) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.d.ts +20 -0
  3. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.js +23 -3
  4. package/dist/controllers/drag-dismiss-controller/drag-dismiss-controller.d.ts +170 -0
  5. package/dist/controllers/drag-dismiss-controller/drag-dismiss-controller.js +215 -0
  6. package/dist/controllers/focus-mark-controller/focus-mark-controller.d.ts +58 -0
  7. package/dist/controllers/focus-mark-controller/focus-mark-controller.js +76 -0
  8. package/dist/controllers/hover-mark-controller/hover-mark-controller.d.ts +21 -3
  9. package/dist/controllers/hover-mark-controller/hover-mark-controller.js +31 -15
  10. package/dist/controllers/indicator-controller/indicator-controller.js +1 -1
  11. package/dist/controllers/layout-motion-controller/layout-motion-controller.d.ts +6 -0
  12. package/dist/controllers/layout-motion-controller/layout-motion-controller.js +1 -1
  13. package/dist/controllers/readings-motion-controller/readings-motion-controller.d.ts +167 -0
  14. package/dist/controllers/readings-motion-controller/readings-motion-controller.js +306 -0
  15. package/dist/controllers/source-controller/source-controller.d.ts +7 -0
  16. package/dist/controllers/source-controller/source-controller.js +2 -0
  17. package/dist/controllers/swipe-controller/swipe-controller.d.ts +19 -3
  18. package/dist/controllers/swipe-controller/swipe-controller.js +32 -10
  19. package/dist/events/details.d.ts +6 -2
  20. package/dist/helix-element/mark-rules.d.ts +14 -0
  21. package/dist/helix-element/mark-rules.js +1 -0
  22. package/dist/index.d.ts +9 -1
  23. package/dist/index.js +9 -1
  24. package/dist/utils/burst-confetti/burst-confetti.d.ts +39 -0
  25. package/dist/utils/burst-confetti/burst-confetti.js +251 -0
  26. package/dist/utils/draw-value-axis/draw-value-axis.d.ts +8 -1
  27. package/dist/utils/draw-value-axis/draw-value-axis.js +11 -5
  28. package/dist/utils/flash-change/flash-change.d.ts +55 -0
  29. package/dist/utils/flash-change/flash-change.js +85 -0
  30. package/dist/utils/readings-motion/readings-motion.d.ts +45 -0
  31. package/dist/utils/readings-motion/readings-motion.js +40 -0
  32. package/dist/utils/resize-from/resize-from.d.ts +36 -0
  33. package/dist/utils/resize-from/resize-from.js +37 -0
  34. package/dist/utils/scale/levels.d.ts +57 -0
  35. package/dist/utils/scale/levels.js +19 -0
  36. package/dist/utils/swipe/swipe.d.ts +52 -0
  37. package/dist/utils/swipe/swipe.js +78 -0
  38. package/dist/version.d.ts +1 -1
  39. package/dist/version.js +1 -1
  40. package/package.json +4 -4
@@ -0,0 +1,85 @@
1
+ import { boxesOf } from '../../controllers/layout-motion-controller/layout-motion-controller.js';
2
+ import { reducedMotion } from '../page-motion/page-motion.js';
3
+ import { readTiming } from '../plain-host/plain-host.js';
4
+ const WASH = 'light-dark(color-mix(in oklab, var(--helix-color-info, oklch(0.48 0.12 245)) 14%, transparent), color-mix(in oklab, var(--helix-color-info, oklch(0.7 0.16 245)) 22%, transparent))';
5
+ const flashes = new WeakMap();
6
+ const millisecondsOf = (written, standing) => {
7
+ const amount = Number.parseFloat(written);
8
+ if (!Number.isFinite(amount)) {
9
+ return standing;
10
+ }
11
+ return written.trim().endsWith('ms') || !written.trim().endsWith('s') ? amount : amount * 1000;
12
+ };
13
+ const strengthOf = (flash) => {
14
+ const at = Number(flash.animation.currentTime ?? 0);
15
+ if (at < flash.ramped) {
16
+ return flash.from + (1 - flash.from) * (at / flash.ramped);
17
+ }
18
+ if (at < flash.held) {
19
+ return 1;
20
+ }
21
+ if (at >= flash.total) {
22
+ return 0;
23
+ }
24
+ return 1 - (at - flash.held) / (flash.total - flash.held);
25
+ };
26
+ const boxesToWash = (element) => boxesOf(element).flatMap((box) => getComputedStyle(box).display === 'table-row'
27
+ ? [...box.children].filter((cell) => cell instanceof HTMLElement)
28
+ : [box]);
29
+ const washAt = (color, strength) => `inset 0 0 0 100vmax color-mix(in oklab, ${color} ${Math.round(strength * 1000) / 10}%, transparent)`;
30
+ const flashBox = (box, color, timing, reduced) => new Promise((resolve) => {
31
+ const running = flashes.get(box);
32
+ const from = running && !reduced ? strengthOf(running) : 0;
33
+ if (running) {
34
+ running.animation.cancel();
35
+ running.done();
36
+ }
37
+ const ramped = from > 0 ? timing.ramp * (1 - from) : 0;
38
+ const held = ramped + timing.hold;
39
+ const total = held + timing.fade;
40
+ if (total < 1) {
41
+ flashes.delete(box);
42
+ resolve();
43
+ return;
44
+ }
45
+ const keyframes = [];
46
+ if (ramped > 0) {
47
+ keyframes.push({ boxShadow: washAt(color, from), offset: 0 });
48
+ }
49
+ keyframes.push({ boxShadow: washAt(color, 1), offset: ramped / total }, { boxShadow: washAt(color, 1), offset: held / total }, { boxShadow: washAt(color, 0), offset: 1 });
50
+ const animation = box.animate(keyframes, { composite: 'add', duration: total });
51
+ const flash = { animation, done: resolve, from, held, ramped, total };
52
+ flashes.set(box, flash);
53
+ const finish = () => {
54
+ if (flashes.get(box) === flash) {
55
+ flashes.delete(box);
56
+ resolve();
57
+ }
58
+ };
59
+ animation.finished.then(finish, finish);
60
+ });
61
+ export const flashChange = (element, options = {}) => {
62
+ if (!element.isConnected) {
63
+ return Promise.resolve();
64
+ }
65
+ const boxes = boxesToWash(element).filter((box) => typeof box.animate === 'function');
66
+ if (boxes.length === 0) {
67
+ return Promise.resolve();
68
+ }
69
+ const reduced = reducedMotion();
70
+ const written = options.color ?? WASH;
71
+ const color = written.startsWith('--') ? `var(${written})` : written;
72
+ const slow = millisecondsOf(readTiming(element, undefined, '--helix-duration-slow', '320ms'), 320);
73
+ const usual = reduced && slow < 1 ? 320 : slow;
74
+ const hold = options.hold === undefined
75
+ ? usual
76
+ : millisecondsOf(readTiming(element, options.hold, '--helix-duration-slow', '320ms'), usual);
77
+ const asked = options.duration === undefined
78
+ ? usual * 2
79
+ : millisecondsOf(readTiming(element, options.duration, '--helix-duration-slow', '320ms'), usual * 2);
80
+ const fade = reduced
81
+ ? Math.min(asked, millisecondsOf(readTiming(element, undefined, '--helix-duration-fade', '120ms'), 120))
82
+ : asked;
83
+ const ramp = millisecondsOf(readTiming(element, undefined, '--helix-duration-fast', '120ms'), 120);
84
+ return Promise.all(boxes.map((box) => flashBox(box, color, { fade, hold, ramp }, reduced))).then(() => undefined);
85
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The arithmetic a chart's readings move by: a number between two, an axis
3
+ * between two ranges, the keys a chart knows its items by, and the curve a
4
+ * chart grows in along.
5
+ *
6
+ * Kept apart from `ReadingsMotionController` because a frame between two
7
+ * tables is arithmetic a picture hides: a tick drawn past the end of its axis,
8
+ * or a name written at another category's place, shows for a frame and is
9
+ * gone before anyone can point at it.
10
+ */
11
+ /** A number `share` of the way from `from` to `to`, where `share` runs from 0 to 1. */
12
+ export declare const mix: (from: number, to: number, share: number) => number;
13
+ /**
14
+ * The key each item is known by from one table to the next, from its name:
15
+ * the name itself, and where the same name comes again, the name and how
16
+ * many times it came before. A chart matches its items across two tables by
17
+ * these keys.
18
+ */
19
+ export declare const keysOf: (names: readonly string[]) => string[];
20
+ /** An axis as a chart publishes it: its range, the ticks on it, and the words and grid lines that go with them. */
21
+ export interface MovingAxis {
22
+ labels?: readonly string[] | undefined;
23
+ range: readonly [number, number];
24
+ rules?: readonly number[] | undefined;
25
+ ticks: readonly number[];
26
+ }
27
+ /**
28
+ * The axis `share` of the way from `from` to `to`.
29
+ *
30
+ * **The range moves, and the ticks are the new axis's from the start**, each
31
+ * at its own number, so they slide with the range as it eases to its new
32
+ * ends. A tick, and its word, outside the range drawn this frame is left out
33
+ * until the range reaches it, so nothing is written past the end of the axis.
34
+ * The grid's lines are kept inside the range the same way.
35
+ */
36
+ export declare const mixAxis: <A extends MovingAxis>(from: A, to: A, share: number) => A;
37
+ /**
38
+ * How much of its reading an item at `step` of `steps` has reached `elapsed`
39
+ * milliseconds after a chart began to grow in, from 0 to 1. **In reading
40
+ * order**, each step a little after the one before it, fast at first and slow
41
+ * to rest, and never past its reading.
42
+ */
43
+ export declare const grownAt: (step: number, steps: number, elapsed: number) => number;
44
+ /** How long the items of `steps` steps take to grow in, the last one included, in milliseconds. */
45
+ export declare const growTime: (steps: number) => number;
@@ -0,0 +1,40 @@
1
+ export const mix = (from, to, share) => share >= 1 ? to : share <= 0 ? from : from + (to - from) * share;
2
+ export const keysOf = (names) => {
3
+ const seen = new Map();
4
+ return names.map((name) => {
5
+ const count = seen.get(name) ?? 0;
6
+ seen.set(name, count + 1);
7
+ return count === 0 ? name : `${name}\u0000${count}`;
8
+ });
9
+ };
10
+ export const mixAxis = (from, to, share) => {
11
+ if (share >= 1) {
12
+ return to;
13
+ }
14
+ const range = [
15
+ mix(from.range[0], to.range[0], share),
16
+ mix(from.range[1], to.range[1], share),
17
+ ];
18
+ const [low, high] = [Math.min(...range), Math.max(...range)];
19
+ const inside = (value) => value >= low - 1e-9 * (high - low || 1) && value <= high + 1e-9 * (high - low || 1);
20
+ const kept = to.ticks.flatMap((tick, at) => (inside(tick) ? [at] : []));
21
+ return {
22
+ ...to,
23
+ range,
24
+ ticks: kept.map((at) => to.ticks[at]),
25
+ ...(to.labels ? { labels: kept.map((at) => to.labels?.[at] ?? '') } : {}),
26
+ ...(to.rules ? { rules: to.rules.filter(inside) } : {}),
27
+ };
28
+ };
29
+ const GROW = 1000;
30
+ const STAGGER = 110;
31
+ const SPREAD = 660;
32
+ const stepOf = (steps) => (steps > 1 ? Math.min(STAGGER, SPREAD / (steps - 1)) : 0);
33
+ export const grownAt = (step, steps, elapsed) => {
34
+ const t = (elapsed - step * stepOf(steps)) / GROW;
35
+ if (t <= 0) {
36
+ return 0;
37
+ }
38
+ return t >= 1 ? 1 : 1 - (1 - t) ** 3;
39
+ };
40
+ export const growTime = (steps) => GROW + stepOf(steps) * Math.max(0, steps - 1);
@@ -0,0 +1,36 @@
1
+ /** How `resizeFrom` times the move. */
2
+ export interface ResizeFromOptions {
3
+ /**
4
+ * The move in flight on the element, if any. It ends before the new height
5
+ * is measured, so a move started during another measures where the element
6
+ * comes to rest and starts from where it is drawn.
7
+ */
8
+ previous?: Animation | undefined;
9
+ /**
10
+ * The move's duration and curve, read once the new height is known. The
11
+ * duration is in milliseconds, or a CSS time such as `320ms` or `0.32s`. A
12
+ * duration under a millisecond, or one that does not read as a time, moves
13
+ * nothing.
14
+ */
15
+ timing: () => {
16
+ duration: number | string;
17
+ easing: string;
18
+ };
19
+ }
20
+ /**
21
+ * Moves an element's height from `from`, in pixels, to the height it lays out
22
+ * at next. Resolves with the move, or with `undefined` where nothing moves:
23
+ * the two heights are within a pixel, the duration is under a millisecond, or
24
+ * the reader asked for reduced motion.
25
+ *
26
+ * **A height is often a keyword**, such as `auto` or `fit-content`, which no
27
+ * transition can follow. So the move runs on the two measured heights, as a
28
+ * `block-size` animation, and the keyword is in place again once it ends.
29
+ *
30
+ * **Measured once the change has laid out.** Content that arrives in updates
31
+ * of its own lays out a frame after the change that asked for it, so a height
32
+ * read at once is short of where the element comes to rest. A new
33
+ * `ResizeObserver` reports once, after layout and before that frame is
34
+ * painted, and the move starts there, so no frame shows the new height first.
35
+ */
36
+ export declare const resizeFrom: (element: HTMLElement, from: number, options: ResizeFromOptions) => Promise<Animation | undefined>;
@@ -0,0 +1,37 @@
1
+ import { reducedMotion } from '../page-motion/page-motion.js';
2
+ const milliseconds = (value) => {
3
+ if (typeof value === 'number') {
4
+ return value;
5
+ }
6
+ const amount = Number.parseFloat(value);
7
+ if (!Number.isFinite(amount)) {
8
+ return 0;
9
+ }
10
+ return value.trim().endsWith('ms') ? amount : amount * 1000;
11
+ };
12
+ export const resizeFrom = (element, from, options) => {
13
+ if (typeof element.animate !== 'function' ||
14
+ typeof ResizeObserver === 'undefined' ||
15
+ reducedMotion()) {
16
+ options.previous?.cancel();
17
+ return Promise.resolve(undefined);
18
+ }
19
+ return new Promise((resolve) => {
20
+ const watcher = new ResizeObserver(() => {
21
+ watcher.disconnect();
22
+ options.previous?.cancel();
23
+ const to = element.getBoundingClientRect().height;
24
+ const { duration, easing } = options.timing();
25
+ const length = milliseconds(duration);
26
+ if (Math.abs(to - from) < 1 || !(length >= 1)) {
27
+ resolve(undefined);
28
+ return;
29
+ }
30
+ resolve(element.animate([{ blockSize: `${from}px` }, { blockSize: `${to}px` }], {
31
+ duration: length,
32
+ easing: easing.trim() || 'ease-out',
33
+ }));
34
+ });
35
+ watcher.observe(element);
36
+ });
37
+ };
@@ -0,0 +1,57 @@
1
+ /** One level a scale rules, as `levelsOf` gives it. */
2
+ export interface Level {
3
+ /**
4
+ * Whether the scale before this one ruled the level and this one does not.
5
+ * A chart draws such a level hidden, at its place on the new scale, so a
6
+ * stylesheet can fade it out as it moves there with the others.
7
+ */
8
+ leaving: boolean;
9
+ /** The value the level is at. */
10
+ level: number;
11
+ }
12
+ /**
13
+ * The levels a scale rules, followed by the levels the scale before it ruled
14
+ * that it does not.
15
+ *
16
+ * **A rule or a number that stays on the axis is the same element**, keyed by
17
+ * its value, so a stylesheet moves it from its place on the old scale to its
18
+ * place on the new one. A level the new scale adds is a new element, which a
19
+ * stylesheet fades in. A level the new scale drops says `leaving`, so the
20
+ * chart can keep it through its fade.
21
+ *
22
+ * **In order of value, the leaving among the rest.** Kept that way, a keyed
23
+ * list moves no element it keeps from one place in the list to another, and
24
+ * an element moved in the document starts its style afresh: it would fade in
25
+ * again and never travel.
26
+ *
27
+ * @param domain The scale's lowest and highest values.
28
+ * @param before The scale before this one, which `ScaleMemory` holds, or nothing.
29
+ */
30
+ export declare const levelsOf: (domain: readonly [number, number], before?: readonly [number, number]) => Level[];
31
+ /**
32
+ * The scale a chart drew before the one it draws now, for `levelsOf`.
33
+ *
34
+ * **Held until the scale changes again.** A chart draws again on every move
35
+ * of the pointer, so a scale held for one drawing would take the levels the
36
+ * last change dropped away in the middle of their fade. They stay, hidden, until the
37
+ * next change, which drops them for good.
38
+ */
39
+ export declare class ScaleMemory {
40
+ private now;
41
+ private was;
42
+ /**
43
+ * Records the scale drawn now and gives the one drawn before it, or nothing
44
+ * on the first drawing.
45
+ *
46
+ * @param domain The scale's lowest and highest values.
47
+ */
48
+ before(domain: readonly [number, number]): readonly [number, number] | undefined;
49
+ }
50
+ /**
51
+ * Where a leaving level stands on the new scale, held inside the plot, so a
52
+ * number the scale stretched far past its end fades out at the end it left
53
+ * from.
54
+ *
55
+ * @param place A level's place along the plot, from 0 to 100.
56
+ */
57
+ export declare const heldInside: (place: number) => number;
@@ -0,0 +1,19 @@
1
+ import { ticks } from './ticks.js';
2
+ export const levelsOf = (domain, before) => {
3
+ const now = ticks(domain);
4
+ const gone = before === undefined ? [] : ticks(before).filter((level) => !now.includes(level));
5
+ return [
6
+ ...now.map((level) => ({ leaving: false, level })),
7
+ ...gone.map((level) => ({ leaving: true, level })),
8
+ ].sort((one, other) => one.level - other.level);
9
+ };
10
+ export class ScaleMemory {
11
+ before(domain) {
12
+ if (this.now === undefined || this.now[0] !== domain[0] || this.now[1] !== domain[1]) {
13
+ this.was = this.now;
14
+ this.now = [domain[0], domain[1]];
15
+ }
16
+ return this.was;
17
+ }
18
+ }
19
+ export const heldInside = (place) => Math.min(100, Math.max(0, place));
@@ -61,3 +61,55 @@ export declare const snapTravel: (size: number, fraction: number) => number;
61
61
  * a right-to-left one. A quarter of the width, or a fling, is enough.
62
62
  */
63
63
  export declare const swipeStep: (dx: number, vx: number, width: number, rtl: boolean) => -1 | 0 | 1;
64
+ /**
65
+ * How far a surface is drawn past a bound, for a drag that went `over` pixels
66
+ * past it, on a surface `size` pixels long along the drag.
67
+ */
68
+ export declare const resist: (over: number, size: number) => number;
69
+ /**
70
+ * Where a surface dragged to `travel` is drawn: where the finger is between
71
+ * `min` and `max`, and with resistance past either.
72
+ */
73
+ export declare const resisted: (travel: number, min: number, max: number, size: number) => number;
74
+ /** A release on its way to rest: how long it takes, and where it is after `elapsed` milliseconds. */
75
+ export interface Glide {
76
+ /** The travel `elapsed` milliseconds after the release. */
77
+ at: (elapsed: number) => number;
78
+ /** How long the glide takes, in milliseconds. */
79
+ duration: number;
80
+ }
81
+ /**
82
+ * The glide off the edge after a release that dismisses: from `from` to `to`,
83
+ * starting at `velocity`, in pixels per millisecond, and taking at most
84
+ * `longest` milliseconds.
85
+ *
86
+ * **It leaves at the speed it was let go.** Thrown fast enough to cover the
87
+ * distance in `longest`, it keeps that speed to the edge. Let go slowly, or
88
+ * moving back, it starts at that speed and gathers pace evenly, so the speed
89
+ * never jumps at the release.
90
+ */
91
+ export declare const exitGlide: (from: number, to: number, velocity: number, longest: number) => Glide;
92
+ /**
93
+ * The glide back to rest after a release that does not dismiss: along the
94
+ * host's curve from `from` to `to`, in at most `duration` milliseconds, with
95
+ * the speed it was let go at carried in. `curve` is the curve's progress at
96
+ * evenly spaced points from its start to its end, the browser's reading of a
97
+ * timing function such as `--helix-easing-spring`.
98
+ *
99
+ * **A spring starts from standing, and a release usually does not.** Run from
100
+ * its start, `--helix-easing-spring` covers a tenth of the way in its first
101
+ * quarter and then half of it in the next twelfth, so a surface let go moving
102
+ * toward its rest slowed almost to a stop and then lurched: measured in
103
+ * Chromium on November 19, 2026, 16 pixels a frame before the release, then
104
+ * 8, 4, 1, 3, 5 and 29. Moving toward its rest, the glide enters the curve at
105
+ * the first point that moves as fast as the release, and fits its length so
106
+ * it starts at the release's speed, within half and the whole of `duration`.
107
+ *
108
+ * **What the curve cannot match is pushed and spent.** The difference between
109
+ * the release's speed and the curve's, all of it for a release moving away
110
+ * from rest or standing on it, is added as a push that starts at that speed
111
+ * and dies away, `v·t·e^(−t/τ)` with τ an eighth of the glide: a flick away
112
+ * from rest carries the surface on a little before the curve brings it back,
113
+ * and the push has spent all but a few ten-thousandths of itself by the end.
114
+ */
115
+ export declare const settleGlide: (from: number, to: number, velocity: number, duration: number, curve?: readonly number[]) => Glide;
@@ -46,3 +46,81 @@ export const swipeStep = (dx, vx, width, rtl) => {
46
46
  }
47
47
  return 0;
48
48
  };
49
+ const GIVE = 0.55;
50
+ export const resist = (over, size) => {
51
+ if (over <= 0) {
52
+ return 0;
53
+ }
54
+ return size > 0 ? size * (1 - 1 / ((over * GIVE) / size + 1)) : over * GIVE;
55
+ };
56
+ export const resisted = (travel, min, max, size) => {
57
+ if (travel < min) {
58
+ return min - resist(min - travel, size);
59
+ }
60
+ return travel > max ? max + resist(travel - max, size) : travel;
61
+ };
62
+ export const exitGlide = (from, to, velocity, longest) => {
63
+ const distance = to - from;
64
+ const duration = velocity > 0 ? Math.max(1, Math.min(longest, distance / velocity)) : Math.max(1, longest);
65
+ const gather = (2 * (distance - velocity * duration)) / duration ** 2;
66
+ return {
67
+ at: (elapsed) => {
68
+ const t = Math.min(Math.max(elapsed, 0), duration);
69
+ return from + velocity * t + (gather * t * t) / 2;
70
+ },
71
+ duration,
72
+ };
73
+ };
74
+ const DECAY = 8;
75
+ const along = (curve, share) => {
76
+ const steps = curve.length - 1;
77
+ if (steps < 1) {
78
+ return share;
79
+ }
80
+ const at = Math.min(Math.max(share, 0), 1) * steps;
81
+ const index = Math.min(Math.floor(at), steps - 1);
82
+ const before = curve[index] ?? 0;
83
+ const after = curve[index + 1] ?? 1;
84
+ return before + (after - before) * (at - index);
85
+ };
86
+ export const settleGlide = (from, to, velocity, duration, curve = [0, 1]) => {
87
+ const distance = to - from;
88
+ const steps = curve.length - 1;
89
+ let enter = 0;
90
+ let length = Math.max(1, duration);
91
+ let push = velocity;
92
+ if (distance !== 0 && velocity * distance > 0 && steps >= 1) {
93
+ const needed = (velocity * length) / distance;
94
+ let best = 0;
95
+ let steepest = Number.NEGATIVE_INFINITY;
96
+ for (let index = 0; index < steps && (curve[index] ?? 1) < 1; index += 1) {
97
+ const slope = ((curve[index + 1] ?? 1) - (curve[index] ?? 0)) * steps;
98
+ if (slope >= needed || slope > steepest) {
99
+ best = index;
100
+ steepest = slope;
101
+ }
102
+ if (slope >= needed) {
103
+ break;
104
+ }
105
+ }
106
+ const start = curve[best] ?? 0;
107
+ if (steepest > 0 && start < 1) {
108
+ enter = best / steps;
109
+ const left = 1 - enter;
110
+ const fit = (distance * steepest * left) / (velocity * (1 - start));
111
+ length = Math.min(Math.max(fit, (duration * left) / 2), Math.max(1, duration));
112
+ push = velocity - (distance * steepest * left) / (length * (1 - start));
113
+ }
114
+ }
115
+ const start = along(curve, enter);
116
+ const tau = length / DECAY;
117
+ return {
118
+ at: (elapsed) => {
119
+ const t = Math.min(Math.max(elapsed, 0), length);
120
+ const share = enter + ((1 - enter) * t) / length;
121
+ const progress = start < 1 ? (along(curve, share) - start) / (1 - start) : 1;
122
+ return from + distance * progress + push * t * Math.exp(-t / tau);
123
+ },
124
+ duration: length,
125
+ };
126
+ };
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * `package.json`, so the two always agree. Nothing else in the running code
6
6
  * knows which release it is.
7
7
  */
8
- export declare const VERSION = "0.245.0";
8
+ export declare const VERSION = "0.247.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.245.0';
1
+ export const VERSION = '0.247.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-core",
3
3
  "description": "Helix element primitives: base classes, mixins, decorators, utilities.",
4
- "version": "0.245.0",
4
+ "version": "0.247.0",
5
5
  "license": "MIT",
6
6
  "author": "Fusion Development Group",
7
7
  "repository": {
@@ -87,12 +87,12 @@
87
87
  "bugs": "https://github.com/project-fusion/fusion/issues",
88
88
  "dependencies": {
89
89
  "@floating-ui/dom": "^1.8.0",
90
- "@fusion.dev/helix-icons": "0.245.0",
90
+ "@fusion.dev/helix-icons": "0.247.0",
91
91
  "tslib": "^2.9.1"
92
92
  },
93
93
  "devDependencies": {
94
- "@fusion.dev/helix-cem": "0.245.0",
95
- "@fusion.dev/helix-testing": "0.245.0",
94
+ "@fusion.dev/helix-cem": "0.247.0",
95
+ "@fusion.dev/helix-testing": "0.247.0",
96
96
  "@lit-labs/ssr": "^4.1.0",
97
97
  "lit": "^3.2.1"
98
98
  },