@glissade/core 0.25.0-pre.1 → 0.26.0-pre.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.
package/dist/clips.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as ValueTypeId, O as Vec2, Q as EaseSpec, r as Track, t as Key } from "./track.js";
1
+ import { A as Vec2, O as ValueTypeId, et as EaseSpec, i as Track, t as Key } from "./track.js";
2
2
  import { r as TweenTarget } from "./targetRef.js";
3
3
 
4
4
  //#region src/clip.d.ts
package/dist/clips.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as inferValueType, i as resolveTweenTarget, p as track, s as key, t as TARGET_PATH } from "./targetRef.js";
1
+ import { C as inferValueType, i as resolveTweenTarget, m as track, s as key, t as TARGET_PATH } from "./targetRef.js";
2
2
  //#region src/clip.ts
3
3
  /**
4
4
  * Motion clips (DESIGN.md §2 build-time sugar): `clip()` captures a relative-time
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as EasingFn, A as colorType, B as stringType, C as PathValue, D as ValueTypeInferenceError, E as ValueTypeId, F as numberType, G as SpringConfig, H as vec2Equals, I as paintType, J as springEasing, K as SpringEase, L as pathType, M as getValueType, N as inferValueType, O as Vec2, P as listValueTypes, Q as EaseSpec, R as registerValueType, S as PathContour, T as ValueType, U as vec2Type, V as vec2ArcType, W as RetargetSpring, X as springPresets, Y as springEasingDerivative, Z as DEFAULT_EASE, _ as HandoffKind, a as key, at as namedEasing, b as MeshPoint, c as sampleTrack, d as track, et as UnknownEasingError, f as validateTrack, g as GradientInterpolation, h as FontAxes, i as TrackValidationError, it as easings, j as fontAxesType, k as booleanType, l as springTo, m as ColorStop, n as KeyOpts, nt as cubicBezierDerivative, o as resolveEase, p as velocityAt, q as spring, r as Track, rt as easingDerivatives, s as resolveEaseDerivative, t as Key, tt as cubicBezier, u as stagger, v as MeshInterpolation, w as UnknownValueTypeError, x as Paint, y as MeshPaint, z as reprOf } from "./track.js";
1
+ import { $ as DEFAULT_EASE, A as Vec2, B as registerValueType, C as Paint, D as ValueType, E as UnknownValueTypeError, F as inferValueType, G as vec2Type, H as stringType, I as listValueTypes, J as SpringEase, K as RetargetSpring, L as numberType, M as colorType, N as fontAxesType, O as ValueTypeId, P as getValueType, Q as springPresets, R as paintType, S as MeshPoint, T as PathValue, U as vec2ArcType, V as reprOf, W as vec2Equals, X as springEasing, Y as spring, Z as springEasingDerivative, _ as FontAxes, a as TrackValidationError, at as easingDerivatives, b as MeshInterpolation, c as resolveEaseDerivative, d as springTo, et as EaseSpec, f as stagger, g as ColorStop, h as velocityAt, i as Track, it as cubicBezierDerivative, j as booleanType, k as ValueTypeInferenceError, l as retime, m as validateTrack, n as KeyOpts, nt as UnknownEasingError, o as key, ot as easings, p as track, q as SpringConfig, r as RetimeSpec, rt as cubicBezier, s as resolveEase, st as namedEasing, t as Key, tt as EasingFn, u as sampleTrack, v as GradientInterpolation, w as PathContour, x as MeshPaint, y as HandoffKind, z as pathType } from "./track.js";
2
2
  import { a as isEditableNodeId, i as UnresolvableTargetError, n as TargetCarrier, o as resolveTweenTarget, r as TweenTarget, s as targetNodeId, t as TARGET_PATH } from "./targetRef.js";
3
3
  import { _ as setDevWarning, a as FontFaceRef, c as Marker, d as TimelineValidationError, f as audioOffsetSamples, g as emitDevWarning, h as DevWarning, i as CompiledTimeline, l as Timeline, m as isDurationEditable, n as AudioClip, o as GainEnvelope, p as compileTimeline, r as ChildEntry, s as Json, t as AssetRef, u as TimelineInit } from "./timeline.js";
4
4
 
@@ -505,4 +505,4 @@ interface CheckpointedSim {
505
505
  }
506
506
  declare function bakeCheckpointed<W, S = W>(cfg: CheckpointedBakeConfig<W, S>): CheckpointedSim;
507
507
  //#endregion
508
- export { type AssetRef, type AudioClip, type BakeConfig, BakeError, type BindOptions, type BindTarget, BindTypeMismatchError, type BindableSignal, type BoundTimeline, type CheckpointedBakeConfig, type CheckpointedSim, type ChildEntry, CircularDependencyError, ColorParseError, type ColorStop, type CompiledTimeline, type CoverageReport, type CurveSampler, DEFAULT_EASE, type DevWarning, type EaseSpec, type EasingFn, type Equals, type FontAxes, type FontFaceRef, type FontMode, type FontRegistry, type FontUsage, FontValidationError, type GainEnvelope, type GradientInterpolation, type HandoffKind, type Json, type Key, type KeyOpts, type Marker, type MeshInterpolation, type MeshPaint, type MeshPoint, type MissingGlyphs, type OkLab, type Paint, type PathContour, type PathValue, type Playhead, type Position, PositionError, type ReadonlySignal, type ResolvedFace, type RetargetSpring, type Rgba, type Rng, type Scheduler, type Signal, type SignalOptions, type SpringConfig, type SpringEase, type StaggerOpts, type StaggerSpec, TARGET_PATH, type TargetCarrier, type Timeline, type TimelineBuilder, type TimelineInit, TimelineValidationError, type Track, TrackValidationError, type TweenOpts, type TweenTarget, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, type ValidateFontsOptions, type ValueType, type ValueTypeId, ValueTypeInferenceError, type Vec2, type Vec2Component, type Vec2Signal, WriteDuringEvaluationError, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, easingDerivatives, easings, emitDevWarning, endReadPhase, evaluateAt, fontAxesType, formatColor, getTimelineCallbacks, getValueType, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, listValueTypes, namedEasing, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, reprOf, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
508
+ export { type AssetRef, type AudioClip, type BakeConfig, BakeError, type BindOptions, type BindTarget, BindTypeMismatchError, type BindableSignal, type BoundTimeline, type CheckpointedBakeConfig, type CheckpointedSim, type ChildEntry, CircularDependencyError, ColorParseError, type ColorStop, type CompiledTimeline, type CoverageReport, type CurveSampler, DEFAULT_EASE, type DevWarning, type EaseSpec, type EasingFn, type Equals, type FontAxes, type FontFaceRef, type FontMode, type FontRegistry, type FontUsage, FontValidationError, type GainEnvelope, type GradientInterpolation, type HandoffKind, type Json, type Key, type KeyOpts, type Marker, type MeshInterpolation, type MeshPaint, type MeshPoint, type MissingGlyphs, type OkLab, type Paint, type PathContour, type PathValue, type Playhead, type Position, PositionError, type ReadonlySignal, type ResolvedFace, type RetargetSpring, type RetimeSpec, type Rgba, type Rng, type Scheduler, type Signal, type SignalOptions, type SpringConfig, type SpringEase, type StaggerOpts, type StaggerSpec, TARGET_PATH, type TargetCarrier, type Timeline, type TimelineBuilder, type TimelineInit, TimelineValidationError, type Track, TrackValidationError, type TweenOpts, type TweenTarget, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, type ValidateFontsOptions, type ValueType, type ValueTypeId, ValueTypeInferenceError, type Vec2, type Vec2Component, type Vec2Signal, WriteDuringEvaluationError, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, easingDerivatives, easings, emitDevWarning, endReadPhase, evaluateAt, fontAxesType, formatColor, getTimelineCallbacks, getValueType, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, listValueTypes, namedEasing, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, reprOf, resolveEase, resolveEaseDerivative, resolveTweenTarget, retime, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as vec2ArcType, B as setDevWarning, C as listValueTypes, D as registerValueType, E as pathType, F as lerpColor, G as DEFAULT_EASE, H as springEasing, I as oklabToRgba, J as cubicBezierDerivative, K as UnknownEasingError, L as parseColor, M as vec2Type, N as ColorParseError, O as reprOf, P as formatColor, R as rgbaToOklab, S as inferValueType, T as paintType, U as springEasingDerivative, V as spring, W as springPresets, X as easings, Y as easingDerivatives, Z as namedEasing, _ as ValueTypeInferenceError, a as targetNodeId, b as fontAxesType, c as resolveEase, d as springTo, f as stagger, g as UnknownValueTypeError, h as velocityAt, i as resolveTweenTarget, j as vec2Equals, k as stringType, l as resolveEaseDerivative, m as validateTrack, n as UnresolvableTargetError, o as TrackValidationError, p as track, q as cubicBezier, r as isEditableNodeId, s as key, t as TARGET_PATH, u as sampleTrack, v as booleanType, w as numberType, x as getValueType, y as colorType, z as emitDevWarning } from "./targetRef.js";
1
+ import { A as stringType, B as emitDevWarning, C as inferValueType, D as pathType, E as paintType, F as formatColor, G as springPresets, H as spring, I as lerpColor, J as cubicBezier, K as DEFAULT_EASE, L as oklabToRgba, M as vec2Equals, N as vec2Type, O as registerValueType, P as ColorParseError, Q as namedEasing, R as parseColor, S as getValueType, T as numberType, U as springEasing, V as setDevWarning, W as springEasingDerivative, X as easingDerivatives, Y as cubicBezierDerivative, Z as easings, _ as UnknownValueTypeError, a as targetNodeId, b as colorType, c as resolveEase, d as sampleTrack, f as springTo, g as velocityAt, h as validateTrack, i as resolveTweenTarget, j as vec2ArcType, k as reprOf, l as resolveEaseDerivative, m as track, n as UnresolvableTargetError, o as TrackValidationError, p as stagger, q as UnknownEasingError, r as isEditableNodeId, s as key, t as TARGET_PATH, u as retime, v as ValueTypeInferenceError, w as listValueTypes, x as fontAxesType, y as booleanType, z as rgbaToOklab } from "./targetRef.js";
2
2
  import { t as parseCmap } from "./cmap.js";
3
3
  import { a as isDurationEditable, i as compileTimeline, n as audioOffsetSamples, o as namespaceCallName, r as callMarkerPrefix, s as timeline$1, t as TimelineValidationError } from "./timeline.js";
4
4
  //#region src/ticker.ts
@@ -1121,4 +1121,4 @@ function bakeCheckpointed(cfg) {
1121
1121
  };
1122
1122
  }
1123
1123
  //#endregion
1124
- export { BakeError, BindTypeMismatchError, CircularDependencyError, ColorParseError, DEFAULT_EASE, FontValidationError, PositionError, TARGET_PATH, TimelineValidationError, TrackValidationError, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, ValueTypeInferenceError, WriteDuringEvaluationError, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, easingDerivatives, easings, emitDevWarning, endReadPhase, evaluateAt, fontAxesType, formatColor, getTimelineCallbacks, getValueType, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, listValueTypes, namedEasing, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, reprOf, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
1124
+ export { BakeError, BindTypeMismatchError, CircularDependencyError, ColorParseError, DEFAULT_EASE, FontValidationError, PositionError, TARGET_PATH, TimelineValidationError, TrackValidationError, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, ValueTypeInferenceError, WriteDuringEvaluationError, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, easingDerivatives, easings, emitDevWarning, endReadPhase, evaluateAt, fontAxesType, formatColor, getTimelineCallbacks, getValueType, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, listValueTypes, namedEasing, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, reprOf, resolveEase, resolveEaseDerivative, resolveTweenTarget, retime, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
package/dist/sidecar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as ValueTypeId, r as Track, t as Key } from "./track.js";
1
+ import { O as ValueTypeId, i as Track, t as Key } from "./track.js";
2
2
  import { l as Timeline } from "./timeline.js";
3
3
 
4
4
  //#region src/sidecar.d.ts
package/dist/sidecar.js CHANGED
@@ -1,4 +1,4 @@
1
- import { V as spring, a as targetNodeId, o as TrackValidationError, r as isEditableNodeId, z as emitDevWarning } from "./targetRef.js";
1
+ import { B as emitDevWarning, H as spring, a as targetNodeId, o as TrackValidationError, r as isEditableNodeId } from "./targetRef.js";
2
2
  //#region src/sidecar.ts
3
3
  /**
4
4
  * The editor sidecar (DESIGN.md §6.2): code declares scene structure and
@@ -1,4 +1,4 @@
1
- import { E as ValueTypeId, Q as EaseSpec, t as Key } from "./track.js";
1
+ import { O as ValueTypeId, et as EaseSpec, t as Key } from "./track.js";
2
2
  import { a as isEditableNodeId, s as targetNodeId } from "./targetRef.js";
3
3
  import { l as Timeline } from "./timeline.js";
4
4
  import { SidecarDoc, SidecarOrphan } from "./sidecar.js";
package/dist/targetRef.js CHANGED
@@ -1,4 +1,35 @@
1
1
  //#region src/easing.ts
2
+ /**
3
+ * Time-mirror of an ease, so a segment played BACKWARD eases identically to the
4
+ * forward segment (used by `retime`'s reverse/pingpong). The built-in eases pair
5
+ * exactly — `easeInX ↔ easeOutX`, and `easeInOutX`/`linear` self-mirror — and a
6
+ * `cubicBezier` mirrors by point reflection (`[x1,y1,x2,y2] → [1−x2,1−y2,1−x1,1−y1]`,
7
+ * the analytic reverse of a bézier ease). Springs are causal and a custom-named
8
+ * ease has no known inverse, so both throw fail-loud rather than mis-animate.
9
+ */
10
+ function mirrorEase(spec) {
11
+ if (spec === void 0) return void 0;
12
+ if (typeof spec === "string") {
13
+ if (spec === "linear") return "linear";
14
+ if (spec.startsWith("easeInOut")) return spec;
15
+ if (spec.startsWith("easeIn")) return `easeOut${spec.slice(6)}`;
16
+ if (spec.startsWith("easeOut")) return `easeIn${spec.slice(7)}`;
17
+ throw new Error(`retime: cannot time-mirror the custom ease '${spec}' for reverse/pingpong — reverse only the built-in eases or a cubicBezier, or retime with { speed } / { shift }`);
18
+ }
19
+ if (spec.kind === "cubicBezier") {
20
+ const [x1, y1, x2, y2] = spec.pts;
21
+ return {
22
+ kind: "cubicBezier",
23
+ pts: [
24
+ 1 - x2,
25
+ 1 - y2,
26
+ 1 - x1,
27
+ 1 - y1
28
+ ]
29
+ };
30
+ }
31
+ throw new Error("retime: cannot reverse/pingpong a spring ease (springs are causal) — retime the spring segment with { speed } / { shift }, or author the reverse explicitly");
32
+ }
2
33
  const c1 = 1.70158;
3
34
  const c2 = c1 * 1.525;
4
35
  const c3 = 2.70158;
@@ -913,6 +944,78 @@ function stagger(tracks, delay) {
913
944
  };
914
945
  });
915
946
  }
947
+ /** Minimal reversed copy of a key schedule: mirror times about [t0,tn], reverse
948
+ * the value order, and time-mirror each segment's ease so it plays identically
949
+ * backward. Throws on `hold` segments (asymmetric — can't reverse cleanly). */
950
+ function reversedKeys(keys) {
951
+ const n = keys.length;
952
+ if (n < 2) return keys.map((k) => ({
953
+ t: k.t,
954
+ value: k.value
955
+ }));
956
+ const t0 = keys[0].t;
957
+ const tn = keys[n - 1].t;
958
+ const out = [];
959
+ for (let j = 0; j < n; j++) {
960
+ const src = keys[n - 1 - j];
961
+ const k = {
962
+ t: t0 + tn - src.t,
963
+ value: src.value
964
+ };
965
+ if (j >= 1) {
966
+ const oldArrival = keys[n - j];
967
+ if (oldArrival.interp === "hold") throw new TrackValidationError("retime", "cannot reverse/pingpong a track with a hold segment (a hold is asymmetric in time) — retime it with { speed } / { shift }, or author the reversed schedule explicitly");
968
+ const m = mirrorEase(oldArrival.ease);
969
+ if (m !== void 0) k.ease = m;
970
+ }
971
+ out.push(k);
972
+ }
973
+ return out;
974
+ }
975
+ /**
976
+ * Retime a set of tracks by remapping their key TIMES — slow-mo/fast (`speed`),
977
+ * delay/advance (`shift`), `reverse`, or `pingpong` — as a pure build-time
978
+ * transform. Because it rewrites the schedule into an ordinary `Track[]` (no
979
+ * runtime clock warp, no cross-frame state), evaluate() stays a pure function of
980
+ * time and the result is golden-stable and O(log keys) scrubbable like any doc.
981
+ * Reverse/pingpong time-mirror each segment's ease exactly for the built-in
982
+ * eases and cubicBezier; springs and hold segments fail loud (they're causal /
983
+ * asymmetric). Returns NEW tracks; the inputs are untouched.
984
+ *
985
+ * retime(move, { speed: 0.5 }) // half speed
986
+ * retime(move, { reverse: true }) // play it backward
987
+ * retime(move, { pingpong: true }) // there and back
988
+ */
989
+ function retime(tracks, spec) {
990
+ const speed = spec.speed ?? 1;
991
+ if (!(speed > 0) || !Number.isFinite(speed)) throw new TrackValidationError("retime", `speed must be a finite number > 0 (got ${speed})`);
992
+ if (spec.reverse && spec.pingpong) throw new TrackValidationError("retime", "pass reverse OR pingpong, not both");
993
+ const shift = spec.shift ?? 0;
994
+ return tracks.map((tr) => {
995
+ let keys = tr.keys.map((k) => ({
996
+ ...k,
997
+ t: k.t / speed
998
+ }));
999
+ if (spec.reverse) keys = reversedKeys(keys);
1000
+ if (spec.pingpong && keys.length >= 2) {
1001
+ const t0 = keys[0].t;
1002
+ const tn = keys[keys.length - 1].t;
1003
+ const back = reversedKeys(keys).map((k) => ({
1004
+ ...k,
1005
+ t: k.t + (tn - t0)
1006
+ }));
1007
+ keys = [...keys, ...back.slice(1)];
1008
+ }
1009
+ if (shift !== 0) keys = keys.map((k) => ({
1010
+ ...k,
1011
+ t: k.t + shift
1012
+ }));
1013
+ return {
1014
+ ...tr,
1015
+ keys
1016
+ };
1017
+ });
1018
+ }
916
1019
  function track(target, type, keys, opts) {
917
1020
  const tr = {
918
1021
  target,
@@ -1078,4 +1181,4 @@ function resolveTweenTarget(target) {
1078
1181
  return path;
1079
1182
  }
1080
1183
  //#endregion
1081
- export { vec2ArcType as A, setDevWarning as B, listValueTypes as C, registerValueType as D, pathType as E, lerpColor as F, DEFAULT_EASE as G, springEasing as H, oklabToRgba as I, cubicBezierDerivative as J, UnknownEasingError as K, parseColor as L, vec2Type as M, ColorParseError as N, reprOf as O, formatColor as P, rgbaToOklab as R, inferValueType as S, paintType as T, springEasingDerivative as U, spring as V, springPresets as W, easings as X, easingDerivatives as Y, namedEasing as Z, ValueTypeInferenceError as _, targetNodeId as a, fontAxesType as b, resolveEase as c, springTo as d, stagger as f, UnknownValueTypeError as g, velocityAt as h, resolveTweenTarget as i, vec2Equals as j, stringType as k, resolveEaseDerivative as l, validateTrack as m, UnresolvableTargetError as n, TrackValidationError as o, track as p, cubicBezier as q, isEditableNodeId as r, key as s, TARGET_PATH as t, sampleTrack as u, booleanType as v, numberType as w, getValueType as x, colorType as y, emitDevWarning as z };
1184
+ export { stringType as A, emitDevWarning as B, inferValueType as C, pathType as D, paintType as E, formatColor as F, springPresets as G, spring as H, lerpColor as I, cubicBezier as J, DEFAULT_EASE as K, oklabToRgba as L, vec2Equals as M, vec2Type as N, registerValueType as O, ColorParseError as P, namedEasing as Q, parseColor as R, getValueType as S, numberType as T, springEasing as U, setDevWarning as V, springEasingDerivative as W, easingDerivatives as X, cubicBezierDerivative as Y, easings as Z, UnknownValueTypeError as _, targetNodeId as a, colorType as b, resolveEase as c, sampleTrack as d, springTo as f, velocityAt as g, validateTrack as h, resolveTweenTarget as i, vec2ArcType as j, reprOf as k, resolveEaseDerivative as l, track as m, UnresolvableTargetError as n, TrackValidationError as o, stagger as p, UnknownEasingError as q, isEditableNodeId as r, key as s, TARGET_PATH as t, retime as u, ValueTypeInferenceError as v, listValueTypes as w, fontAxesType as x, booleanType as y, rgbaToOklab as z };
@@ -1,4 +1,4 @@
1
- import { r as Track, t as Key } from "./track.js";
1
+ import { i as Track, t as Key } from "./track.js";
2
2
 
3
3
  //#region src/devWarning.d.ts
4
4
  /** The configurable dev-warning channel (no DOM lib in core; console may not exist). */
package/dist/timeline.js CHANGED
@@ -1,4 +1,4 @@
1
- import { V as spring, m as validateTrack, z as emitDevWarning } from "./targetRef.js";
1
+ import { B as emitDevWarning, H as spring, h as validateTrack } from "./targetRef.js";
2
2
  //#region src/timeline.ts
3
3
  /**
4
4
  * The Timeline document (DESIGN.md §2.3) — the serializable animation source
package/dist/track.d.ts CHANGED
@@ -13,6 +13,15 @@ type EaseSpec = string | {
13
13
  damping: number;
14
14
  mass: number;
15
15
  };
16
+ /**
17
+ * Time-mirror of an ease, so a segment played BACKWARD eases identically to the
18
+ * forward segment (used by `retime`'s reverse/pingpong). The built-in eases pair
19
+ * exactly — `easeInX ↔ easeOutX`, and `easeInOutX`/`linear` self-mirror — and a
20
+ * `cubicBezier` mirrors by point reflection (`[x1,y1,x2,y2] → [1−x2,1−y2,1−x1,1−y1]`,
21
+ * the analytic reverse of a bézier ease). Springs are causal and a custom-named
22
+ * ease has no known inverse, so both throw fail-loud rather than mis-animate.
23
+ */
24
+
16
25
  declare const easings: Record<string, EasingFn>;
17
26
  /**
18
27
  * Analytic derivatives d(u) of every named ease (§B.6) — closed-form, used
@@ -349,6 +358,31 @@ declare function springTo<T>(endT: number, from: T, to: T, cfg: SpringConfig): [
349
358
  * [key(0, 0), key(0.3, 1, 'easeOutCubic')])), 0.08)
350
359
  */
351
360
  declare function stagger<T>(tracks: readonly Track<T>[], delay: number | ((index: number) => number)): Track<T>[];
361
+ interface RetimeSpec {
362
+ /** playback rate: 2 = twice as fast (key times ÷ speed), 0.5 = half speed. Must be > 0. Default 1. */
363
+ speed?: number;
364
+ /** seconds added to every key time (applied AFTER speed/reverse) — delay or advance the group. Default 0. */
365
+ shift?: number;
366
+ /** play the schedule BACKWARD in place — same [start,end] span, values reversed, eases time-mirrored. */
367
+ reverse?: boolean;
368
+ /** forward THEN reversed as one there-and-back track (roughly doubles the active span). */
369
+ pingpong?: boolean;
370
+ }
371
+ /**
372
+ * Retime a set of tracks by remapping their key TIMES — slow-mo/fast (`speed`),
373
+ * delay/advance (`shift`), `reverse`, or `pingpong` — as a pure build-time
374
+ * transform. Because it rewrites the schedule into an ordinary `Track[]` (no
375
+ * runtime clock warp, no cross-frame state), evaluate() stays a pure function of
376
+ * time and the result is golden-stable and O(log keys) scrubbable like any doc.
377
+ * Reverse/pingpong time-mirror each segment's ease exactly for the built-in
378
+ * eases and cubicBezier; springs and hold segments fail loud (they're causal /
379
+ * asymmetric). Returns NEW tracks; the inputs are untouched.
380
+ *
381
+ * retime(move, { speed: 0.5 }) // half speed
382
+ * retime(move, { reverse: true }) // play it backward
383
+ * retime(move, { pingpong: true }) // there and back
384
+ */
385
+ declare function retime<T>(tracks: readonly Track<T>[], spec: RetimeSpec): Track<T>[];
352
386
  declare function track<T>(target: string, type: ValueTypeId, keys: Key<T>[], opts?: {
353
387
  editable?: boolean;
354
388
  }): Track<T>;
@@ -369,4 +403,4 @@ declare function velocityAt<T>(tr: Track<T>, t: number): T | null;
369
403
  /** Pure sample of a track at time t (§2.4). */
370
404
  declare function sampleTrack<T>(tr: Track<T>, t: number): T;
371
405
  //#endregion
372
- export { EasingFn as $, colorType as A, stringType as B, PathValue as C, ValueTypeInferenceError as D, ValueTypeId as E, numberType as F, SpringConfig as G, vec2Equals as H, paintType as I, springEasing as J, SpringEase as K, pathType as L, getValueType as M, inferValueType as N, Vec2 as O, listValueTypes as P, EaseSpec as Q, registerValueType as R, PathContour as S, ValueType as T, vec2Type as U, vec2ArcType as V, RetargetSpring as W, springPresets as X, springEasingDerivative as Y, DEFAULT_EASE as Z, HandoffKind as _, key as a, namedEasing as at, MeshPoint as b, sampleTrack as c, track as d, UnknownEasingError as et, validateTrack as f, GradientInterpolation as g, FontAxes as h, TrackValidationError as i, easings as it, fontAxesType as j, booleanType as k, springTo as l, ColorStop as m, KeyOpts as n, cubicBezierDerivative as nt, resolveEase as o, velocityAt as p, spring as q, Track as r, easingDerivatives as rt, resolveEaseDerivative as s, Key as t, cubicBezier as tt, stagger as u, MeshInterpolation as v, UnknownValueTypeError as w, Paint as x, MeshPaint as y, reprOf as z };
406
+ export { DEFAULT_EASE as $, Vec2 as A, registerValueType as B, Paint as C, ValueType as D, UnknownValueTypeError as E, inferValueType as F, vec2Type as G, stringType as H, listValueTypes as I, SpringEase as J, RetargetSpring as K, numberType as L, colorType as M, fontAxesType as N, ValueTypeId as O, getValueType as P, springPresets as Q, paintType as R, MeshPoint as S, PathValue as T, vec2ArcType as U, reprOf as V, vec2Equals as W, springEasing as X, spring as Y, springEasingDerivative as Z, FontAxes as _, TrackValidationError as a, easingDerivatives as at, MeshInterpolation as b, resolveEaseDerivative as c, springTo as d, EaseSpec as et, stagger as f, ColorStop as g, velocityAt as h, Track as i, cubicBezierDerivative as it, booleanType as j, ValueTypeInferenceError as k, retime as l, validateTrack as m, KeyOpts as n, UnknownEasingError as nt, key as o, easings as ot, track as p, SpringConfig as q, RetimeSpec as r, cubicBezier as rt, resolveEase as s, namedEasing as st, Key as t, EasingFn as tt, sampleTrack as u, GradientInterpolation as v, PathContour as w, MeshPaint as x, HandoffKind as y, pathType as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/core",
3
- "version": "0.25.0-pre.1",
3
+ "version": "0.26.0-pre.0",
4
4
  "description": "glissade core: signals, tracks, timeline document, evaluation, easing, springs, seeded RNG. Zero DOM/Node dependencies.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {