@glissade/core 0.10.0 → 0.10.1-pre.1
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/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/sidecar.d.ts +44 -1
- package/dist/sidecar.js +91 -1
- package/dist/studioHost.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as validateTrack, A as GainEnvelope, At as
|
|
1
|
+
import { $ as validateTrack, A as GainEnvelope, At as getValueType, B as emitDevWarning, C as resolveTweenTarget, Ct as UnknownValueTypeError, D as ChildEntry, Dt as Vec2, E as AudioClip, Et as ValueTypeInferenceError, F as TimelineValidationError, Ft as registerValueType, G as TrackValidationError, H as Key, I as audioOffsetSamples, It as stringType, J as resolveEaseDerivative, K as key, L as compileTimeline, Lt as vec2ArcType, M as Marker, Mt as numberType, N as Timeline, Nt as paintType, O as CompiledTimeline, Ot as booleanType, P as TimelineInit, Pt as pathType, Q as track, R as isDurationEditable, Rt as vec2Equals, S as isEditableNodeId, St as PathValue, T as AssetRef, Tt as ValueTypeId, U as KeyOpts, V as setDevWarning, W as Track, X as springTo, Y as sampleTrack, Z as stagger, _ as setSidecarTrack, _t as ColorStop, a as SidecarOrphan, at as springEasing, b as TweenTarget, bt as Paint, c as SidecarVersionError, ct as DEFAULT_EASE, d as emptySidecar, dt as UnknownEasingError, et as velocityAt, f as hashKeys, ft as cubicBezier, g as normalizeEditedKeys, gt as namedEasing, h as migrateSidecar, ht as easings, i as SidecarDocV1, it as spring, j as Json, jt as inferValueType, k as FontFaceRef, kt as colorType, l as assignKeyIds, lt as EaseSpec, m as mergeSidecarDetailed, mt as easingDerivatives, n as OrphanReason, nt as SpringConfig, o as SidecarTimelineEntry, ot as springEasingDerivative, p as mergeSidecar, pt as cubicBezierDerivative, q as resolveEase, r as SidecarDoc, rt as SpringEase, s as SidecarTrackEntry, st as springPresets, t as MergeResult, tt as RetargetSpring, u as deleteSidecarTrack, ut as EasingFn, v as TARGET_PATH, vt as GradientInterpolation, w as targetNodeId, wt as ValueType, x as UnresolvableTargetError, xt as PathContour, y as TargetCarrier, yt as HandoffKind, z as DevWarning, zt as vec2Type } from "./sidecar.js";
|
|
2
2
|
|
|
3
3
|
//#region src/signal.d.ts
|
|
4
4
|
|
|
@@ -357,4 +357,4 @@ interface CheckpointedSim {
|
|
|
357
357
|
}
|
|
358
358
|
declare function bakeCheckpointed<W, S = W>(cfg: CheckpointedBakeConfig<W, S>): CheckpointedSim;
|
|
359
359
|
//#endregion
|
|
360
|
-
export { type AssetRef, type AudioClip, type BakeConfig, BakeError, type BindTarget, type BindableSignal, type BoundTimeline, type CheckpointedBakeConfig, type CheckpointedSim, type ChildEntry, CircularDependencyError, ColorParseError, type CompiledTimeline, type CoverageReport, type CurveSampler, DEFAULT_EASE, type DevWarning, type EaseSpec, type EasingFn, type Equals, type FontFaceRef, type FontMode, type FontRegistry, type FontUsage, FontValidationError, type GainEnvelope, type HandoffKind, type Json, type Key, type KeyOpts, type Marker, type MergeResult, type MissingGlyphs, type OkLab, type OrphanReason, type PathContour, type PathValue, type Playhead, type Position, PositionError, type ReadonlySignal, type ResolvedFace, type RetargetSpring, type Rgba, type Rng, type Scheduler, type SidecarDoc, type SidecarDocV1, type SidecarOrphan, type SidecarTimelineEntry, type SidecarTrackEntry, SidecarVersionError, type Signal, type SignalOptions, type SpringConfig, type SpringEase, 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 Vec2Signal, WriteDuringEvaluationError, assignKeyIds, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, deleteSidecarTrack, easingDerivatives, easings, emitDevWarning, emptySidecar, endReadPhase, evaluateAt, formatColor, getTimelineCallbacks, getValueType, hashKeys, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, mergeSidecar, mergeSidecarDetailed, migrateSidecar, namedEasing, normalizeEditedKeys, numberType, oklabToRgba, parseCmap, parseColor, pathType, random, registerValueType, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, setSidecarTrack, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
|
|
360
|
+
export { type AssetRef, type AudioClip, type BakeConfig, BakeError, type BindTarget, 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 FontFaceRef, type FontMode, type FontRegistry, type FontUsage, FontValidationError, type GainEnvelope, type GradientInterpolation, type HandoffKind, type Json, type Key, type KeyOpts, type Marker, type MergeResult, type MissingGlyphs, type OkLab, type OrphanReason, type Paint, type PathContour, type PathValue, type Playhead, type Position, PositionError, type ReadonlySignal, type ResolvedFace, type RetargetSpring, type Rgba, type Rng, type Scheduler, type SidecarDoc, type SidecarDocV1, type SidecarOrphan, type SidecarTimelineEntry, type SidecarTrackEntry, SidecarVersionError, type Signal, type SignalOptions, type SpringConfig, type SpringEase, 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 Vec2Signal, WriteDuringEvaluationError, assignKeyIds, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, deleteSidecarTrack, easingDerivatives, easings, emitDevWarning, emptySidecar, endReadPhase, evaluateAt, formatColor, getTimelineCallbacks, getValueType, hashKeys, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, mergeSidecar, mergeSidecarDetailed, migrateSidecar, namedEasing, normalizeEditedKeys, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, setSidecarTrack, 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 { $ as
|
|
1
|
+
import { $ as vec2ArcType, A as velocityAt, B as easings, C as resolveEase, D as stagger, E as springTo, F as DEFAULT_EASE, G as colorType, H as UnknownValueTypeError, I as UnknownEasingError, J as numberType, K as getValueType, L as cubicBezier, M as springEasing, N as springEasingDerivative, O as track, P as springPresets, Q as stringType, R as cubicBezierDerivative, S as key, T as sampleTrack, U as ValueTypeInferenceError, V as namedEasing, W as booleanType, X as pathType, Y as paintType, Z as registerValueType, _ as audioOffsetSamples, a as hashKeys, at as formatColor, b as timeline$1, c as migrateSidecar, ct as parseColor, d as TARGET_PATH, et as vec2Equals, f as UnresolvableTargetError, g as TimelineValidationError, h as targetNodeId, i as emptySidecar, it as ColorParseError, j as spring, k as validateTrack, l as normalizeEditedKeys, lt as rgbaToOklab, m as resolveTweenTarget, n as assignKeyIds, nt as emitDevWarning, o as mergeSidecar, ot as lerpColor, p as isEditableNodeId, q as inferValueType, r as deleteSidecarTrack, rt as setDevWarning, s as mergeSidecarDetailed, st as oklabToRgba, t as SidecarVersionError, tt as vec2Type, u as setSidecarTrack, v as compileTimeline, w as resolveEaseDerivative, x as TrackValidationError, y as isDurationEditable, z as easingDerivatives } from "./sidecar.js";
|
|
2
2
|
//#region src/ticker.ts
|
|
3
3
|
/** The default scheduler: flush synchronously, preserving pre-ticker timing. */
|
|
4
4
|
const synchronousScheduler = (flush) => flush();
|
|
@@ -1083,4 +1083,4 @@ function bakeCheckpointed(cfg) {
|
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
1085
|
//#endregion
|
|
1086
|
-
export { BakeError, CircularDependencyError, ColorParseError, DEFAULT_EASE, FontValidationError, PositionError, SidecarVersionError, TARGET_PATH, TimelineValidationError, TrackValidationError, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, ValueTypeInferenceError, WriteDuringEvaluationError, assignKeyIds, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, deleteSidecarTrack, easingDerivatives, easings, emitDevWarning, emptySidecar, endReadPhase, evaluateAt, formatColor, getTimelineCallbacks, getValueType, hashKeys, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, mergeSidecar, mergeSidecarDetailed, migrateSidecar, namedEasing, normalizeEditedKeys, numberType, oklabToRgba, parseCmap, parseColor, pathType, random, registerValueType, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, setSidecarTrack, signal, spring, springEasing, springEasingDerivative, springPresets, springTo, stagger, stringType, synchronousScheduler, targetNodeId, timeline, track, untracked, validateFonts, validateTrack, vec2ArcType, vec2Equals, vec2Signal, vec2Type, velocityAt };
|
|
1086
|
+
export { BakeError, CircularDependencyError, ColorParseError, DEFAULT_EASE, FontValidationError, PositionError, SidecarVersionError, TARGET_PATH, TimelineValidationError, TrackValidationError, UnboundTargetError, UnknownEasingError, UnknownValueTypeError, UnresolvableTargetError, ValueTypeInferenceError, WriteDuringEvaluationError, assignKeyIds, audioOffsetSamples, bake, bakeCheckpointed, batch, beginReadPhase, bindTimeline, booleanType, buildFontRegistry, buildTimeline, colorType, compileTimeline, computed, createPlayhead, cubicBezier, cubicBezierDerivative, deleteSidecarTrack, easingDerivatives, easings, emitDevWarning, emptySidecar, endReadPhase, evaluateAt, formatColor, getTimelineCallbacks, getValueType, hashKeys, inReadPhase, inferValueType, isDurationEditable, isEditableNodeId, isExemptFamily, key, lerpColor, mergeSidecar, mergeSidecarDetailed, migrateSidecar, namedEasing, normalizeEditedKeys, numberType, oklabToRgba, paintType, parseCmap, parseColor, pathType, random, registerValueType, resolveEase, resolveEaseDerivative, resolveTweenTarget, rgbaToOklab, sampleTrack, setDevWarning, setScheduler, setSidecarTrack, 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
|
@@ -55,6 +55,49 @@ declare const booleanType: ValueType<boolean>;
|
|
|
55
55
|
* topology, so no add/sub/scale — handoffs blend from the frozen value.
|
|
56
56
|
*/
|
|
57
57
|
declare const pathType: ValueType<PathValue>;
|
|
58
|
+
/** A gradient color stop: `offset` 0..1 along the gradient, `color` a CSS string. */
|
|
59
|
+
interface ColorStop {
|
|
60
|
+
offset: number;
|
|
61
|
+
color: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* How a gradient blends BETWEEN its stops: `linear` (the canvas-native ramp,
|
|
65
|
+
* the default — byte-identical to no mode), `smooth` (a smoothstep S-curve, no
|
|
66
|
+
* Mach-banding at stops), or `gaussian` (a soft gaussian shoulder — melts like
|
|
67
|
+
* a wide blur with 2-3 stops). `smooth`/`gaussian` densify + oklab-interpolate
|
|
68
|
+
* the stops at raster, so a soft-light fill reads as smooth as a blur, no filter.
|
|
69
|
+
*/
|
|
70
|
+
type GradientInterpolation = 'linear' | 'smooth' | 'gaussian';
|
|
71
|
+
/**
|
|
72
|
+
* A fill/stroke paint (§2.2 animatable document value): a solid color, or a
|
|
73
|
+
* `linear`/`radial` gradient. Geometry (`from`/`to`, `center`/`radius`) is in
|
|
74
|
+
* the shape's LOCAL space; omit it to default to the filled path's bounds.
|
|
75
|
+
* Plain JSON — serializes with no hooks; animatable via `paintType`.
|
|
76
|
+
*/
|
|
77
|
+
type Paint = {
|
|
78
|
+
kind: 'color';
|
|
79
|
+
color: string;
|
|
80
|
+
} | {
|
|
81
|
+
kind: 'linear';
|
|
82
|
+
stops: ColorStop[];
|
|
83
|
+
from?: [number, number];
|
|
84
|
+
to?: [number, number];
|
|
85
|
+
interpolation?: GradientInterpolation;
|
|
86
|
+
} | {
|
|
87
|
+
kind: 'radial';
|
|
88
|
+
stops: ColorStop[];
|
|
89
|
+
center?: [number, number];
|
|
90
|
+
radius?: number;
|
|
91
|
+
interpolation?: GradientInterpolation;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Gradient paint morphing (§2.2): a solid color lifts to a uniform gradient to
|
|
95
|
+
* meet the other side, then matched-kind/matched-stop-count gradients lerp their
|
|
96
|
+
* stops (offset + oklab color) and geometry pairwise; a mismatched kind or stop
|
|
97
|
+
* count snaps (hold a, then b at t ≥ 1) with a one-time dev warning. Lerp-only —
|
|
98
|
+
* no offsets under mismatch — so handoffs blend from the frozen value.
|
|
99
|
+
*/
|
|
100
|
+
declare const paintType: ValueType<Paint>;
|
|
58
101
|
declare class ValueTypeInferenceError extends Error {
|
|
59
102
|
constructor(value: unknown);
|
|
60
103
|
}
|
|
@@ -507,4 +550,4 @@ declare function mergeSidecar(code: Timeline, sidecar: SidecarDoc | SidecarDocV1
|
|
|
507
550
|
*/
|
|
508
551
|
declare function normalizeEditedKeys(keys: Key[]): Key[];
|
|
509
552
|
//#endregion
|
|
510
|
-
export { validateTrack as $, GainEnvelope as A,
|
|
553
|
+
export { validateTrack as $, GainEnvelope as A, getValueType as At, emitDevWarning as B, resolveTweenTarget as C, UnknownValueTypeError as Ct, ChildEntry as D, Vec2 as Dt, AudioClip as E, ValueTypeInferenceError as Et, TimelineValidationError as F, registerValueType as Ft, TrackValidationError as G, Key as H, audioOffsetSamples as I, stringType as It, resolveEaseDerivative as J, key as K, compileTimeline as L, vec2ArcType as Lt, Marker as M, numberType as Mt, Timeline as N, paintType as Nt, CompiledTimeline as O, booleanType as Ot, TimelineInit as P, pathType as Pt, track as Q, isDurationEditable as R, vec2Equals as Rt, isEditableNodeId as S, PathValue as St, AssetRef as T, ValueTypeId as Tt, KeyOpts as U, setDevWarning as V, Track as W, springTo as X, sampleTrack as Y, stagger as Z, setSidecarTrack as _, ColorStop as _t, SidecarOrphan as a, springEasing as at, TweenTarget as b, Paint as bt, SidecarVersionError as c, DEFAULT_EASE as ct, emptySidecar as d, UnknownEasingError as dt, velocityAt as et, hashKeys as f, cubicBezier as ft, normalizeEditedKeys as g, namedEasing as gt, migrateSidecar as h, easings as ht, SidecarDocV1 as i, spring as it, Json as j, inferValueType as jt, FontFaceRef as k, colorType as kt, assignKeyIds as l, EaseSpec as lt, mergeSidecarDetailed as m, easingDerivatives as mt, OrphanReason as n, SpringConfig as nt, SidecarTimelineEntry as o, springEasingDerivative as ot, mergeSidecar as p, cubicBezierDerivative as pt, resolveEase as q, SidecarDoc as r, SpringEase as rt, SidecarTrackEntry as s, springPresets as st, MergeResult as t, RetargetSpring as tt, deleteSidecarTrack as u, EasingFn as ut, TARGET_PATH as v, GradientInterpolation as vt, targetNodeId as w, ValueType as wt, UnresolvableTargetError as x, PathContour as xt, TargetCarrier as y, HandoffKind as yt, DevWarning as z, vec2Type as zt };
|
package/dist/sidecar.js
CHANGED
|
@@ -234,6 +234,93 @@ const pathType = {
|
|
|
234
234
|
},
|
|
235
235
|
defaultHandoff: "blend-from-frozen"
|
|
236
236
|
};
|
|
237
|
+
const lerpN = (a, b, t) => a + (b - a) * t;
|
|
238
|
+
const lerpPt = (a, b, t) => [lerpN(a[0], b[0], t), lerpN(a[1], b[1], t)];
|
|
239
|
+
/** Lift a solid color to a uniform gradient matching `shape` (every stop = color),
|
|
240
|
+
* so a color↔gradient tween fades smoothly instead of snapping. */
|
|
241
|
+
function liftColor(color, shape) {
|
|
242
|
+
const stops = shape.stops.map((s) => ({
|
|
243
|
+
offset: s.offset,
|
|
244
|
+
color
|
|
245
|
+
}));
|
|
246
|
+
const interp = shape.interpolation ? { interpolation: shape.interpolation } : {};
|
|
247
|
+
return shape.kind === "radial" ? {
|
|
248
|
+
kind: "radial",
|
|
249
|
+
stops,
|
|
250
|
+
...shape.center ? { center: shape.center } : {},
|
|
251
|
+
...shape.radius !== void 0 ? { radius: shape.radius } : {},
|
|
252
|
+
...interp
|
|
253
|
+
} : {
|
|
254
|
+
kind: "linear",
|
|
255
|
+
stops,
|
|
256
|
+
...shape.from ? { from: shape.from } : {},
|
|
257
|
+
...shape.to ? { to: shape.to } : {},
|
|
258
|
+
...interp
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
let warnedPaintShape = false;
|
|
262
|
+
function paintSnap(t, a, b) {
|
|
263
|
+
if (!warnedPaintShape) {
|
|
264
|
+
warnedPaintShape = true;
|
|
265
|
+
emitDevWarning("paint lerp across mismatched gradient shapes (different kind or stop count): snapping instead of interpolating — match the kind + stop count on both keyframes (§2.2)");
|
|
266
|
+
}
|
|
267
|
+
return t >= 1 ? b : a;
|
|
268
|
+
}
|
|
269
|
+
const stopsEqual = (a, b) => a.length === b.length && a.every((s, i) => s.offset === b[i].offset && s.color === b[i].color);
|
|
270
|
+
/**
|
|
271
|
+
* Gradient paint morphing (§2.2): a solid color lifts to a uniform gradient to
|
|
272
|
+
* meet the other side, then matched-kind/matched-stop-count gradients lerp their
|
|
273
|
+
* stops (offset + oklab color) and geometry pairwise; a mismatched kind or stop
|
|
274
|
+
* count snaps (hold a, then b at t ≥ 1) with a one-time dev warning. Lerp-only —
|
|
275
|
+
* no offsets under mismatch — so handoffs blend from the frozen value.
|
|
276
|
+
*/
|
|
277
|
+
const paintType = {
|
|
278
|
+
id: "paint",
|
|
279
|
+
lerp: (a, b, t) => {
|
|
280
|
+
if (a.kind === "color" && b.kind === "color") return {
|
|
281
|
+
kind: "color",
|
|
282
|
+
color: lerpColor(a.color, b.color, t)
|
|
283
|
+
};
|
|
284
|
+
let A = a;
|
|
285
|
+
let B = b;
|
|
286
|
+
if (A.kind === "color" && B.kind !== "color") A = liftColor(A.color, B);
|
|
287
|
+
else if (B.kind === "color" && A.kind !== "color") B = liftColor(B.color, A);
|
|
288
|
+
if (A.kind === "color" || B.kind === "color" || A.kind !== B.kind || A.stops.length !== B.stops.length) return paintSnap(t, a, b);
|
|
289
|
+
const stops = A.stops.map((sa, i) => ({
|
|
290
|
+
offset: lerpN(sa.offset, B.stops[i].offset, t),
|
|
291
|
+
color: lerpColor(sa.color, B.stops[i].color, t)
|
|
292
|
+
}));
|
|
293
|
+
const interp = A.interpolation ? { interpolation: A.interpolation } : {};
|
|
294
|
+
if (A.kind === "radial" && B.kind === "radial") return {
|
|
295
|
+
kind: "radial",
|
|
296
|
+
stops,
|
|
297
|
+
...A.center && B.center ? { center: lerpPt(A.center, B.center, t) } : A.center ? { center: A.center } : {},
|
|
298
|
+
...A.radius !== void 0 && B.radius !== void 0 ? { radius: lerpN(A.radius, B.radius, t) } : A.radius !== void 0 ? { radius: A.radius } : {},
|
|
299
|
+
...interp
|
|
300
|
+
};
|
|
301
|
+
if (A.kind === "linear" && B.kind === "linear") return {
|
|
302
|
+
kind: "linear",
|
|
303
|
+
stops,
|
|
304
|
+
...A.from && B.from ? { from: lerpPt(A.from, B.from, t) } : A.from ? { from: A.from } : {},
|
|
305
|
+
...A.to && B.to ? { to: lerpPt(A.to, B.to, t) } : A.to ? { to: A.to } : {},
|
|
306
|
+
...interp
|
|
307
|
+
};
|
|
308
|
+
return paintSnap(t, a, b);
|
|
309
|
+
},
|
|
310
|
+
extrapolates: false,
|
|
311
|
+
equals: (a, b) => {
|
|
312
|
+
if (a === b) return true;
|
|
313
|
+
if (a.kind !== b.kind) return false;
|
|
314
|
+
if (a.kind === "color") return b.kind === "color" && a.color === b.color;
|
|
315
|
+
if (b.kind === "color") return false;
|
|
316
|
+
if (!stopsEqual(a.stops, b.stops)) return false;
|
|
317
|
+
if (a.interpolation !== b.interpolation) return false;
|
|
318
|
+
if (a.kind === "radial" && b.kind === "radial") return JSON.stringify(a.center) === JSON.stringify(b.center) && a.radius === b.radius;
|
|
319
|
+
if (a.kind === "linear" && b.kind === "linear") return JSON.stringify(a.from) === JSON.stringify(b.from) && JSON.stringify(a.to) === JSON.stringify(b.to);
|
|
320
|
+
return false;
|
|
321
|
+
},
|
|
322
|
+
defaultHandoff: "blend-from-frozen"
|
|
323
|
+
};
|
|
237
324
|
var ValueTypeInferenceError = class extends Error {
|
|
238
325
|
constructor(value) {
|
|
239
326
|
super(`cannot infer a value type for ${JSON.stringify(value)}; register a custom type`);
|
|
@@ -241,10 +328,12 @@ var ValueTypeInferenceError = class extends Error {
|
|
|
241
328
|
}
|
|
242
329
|
};
|
|
243
330
|
const isContour = (c) => typeof c === "object" && c !== null && typeof c.closed === "boolean" && Array.isArray(c.v) && Array.isArray(c.in) && Array.isArray(c.out);
|
|
331
|
+
const isPaint = (v) => typeof v === "object" && v !== null && (v.kind === "color" || v.kind === "linear" || v.kind === "radial");
|
|
244
332
|
/** Infer a registered type id from a sample value (builder + bake authoring surfaces). */
|
|
245
333
|
function inferValueType(value) {
|
|
246
334
|
if (typeof value === "number") return "number";
|
|
247
335
|
if (typeof value === "boolean") return "boolean";
|
|
336
|
+
if (isPaint(value)) return "paint";
|
|
248
337
|
if (Array.isArray(value) && value.length === 2 && value.every((v) => typeof v === "number")) return "vec2";
|
|
249
338
|
if (Array.isArray(value) && value.length > 0 && value.every(isContour)) return "path";
|
|
250
339
|
if (typeof value === "string") try {
|
|
@@ -262,6 +351,7 @@ registerValueType(colorType);
|
|
|
262
351
|
registerValueType(stringType);
|
|
263
352
|
registerValueType(booleanType);
|
|
264
353
|
registerValueType(pathType);
|
|
354
|
+
registerValueType(paintType);
|
|
265
355
|
//#endregion
|
|
266
356
|
//#region src/easing.ts
|
|
267
357
|
const c1 = 1.70158;
|
|
@@ -1266,4 +1356,4 @@ function normalizeEditedKeys(keys) {
|
|
|
1266
1356
|
return out;
|
|
1267
1357
|
}
|
|
1268
1358
|
//#endregion
|
|
1269
|
-
export {
|
|
1359
|
+
export { vec2ArcType as $, velocityAt as A, easings as B, resolveEase as C, stagger as D, springTo as E, DEFAULT_EASE as F, colorType as G, UnknownValueTypeError as H, UnknownEasingError as I, numberType as J, getValueType as K, cubicBezier as L, springEasing as M, springEasingDerivative as N, track as O, springPresets as P, stringType as Q, cubicBezierDerivative as R, key as S, sampleTrack as T, ValueTypeInferenceError as U, namedEasing as V, booleanType as W, pathType as X, paintType as Y, registerValueType as Z, audioOffsetSamples as _, hashKeys as a, formatColor as at, timeline as b, migrateSidecar as c, parseColor as ct, TARGET_PATH as d, vec2Equals as et, UnresolvableTargetError as f, TimelineValidationError as g, targetNodeId as h, emptySidecar as i, ColorParseError as it, spring as j, validateTrack as k, normalizeEditedKeys as l, rgbaToOklab as lt, resolveTweenTarget as m, assignKeyIds as n, emitDevWarning as nt, mergeSidecar as o, lerpColor as ot, isEditableNodeId as p, inferValueType as q, deleteSidecarTrack as r, setDevWarning as rt, mergeSidecarDetailed as s, oklabToRgba as st, SidecarVersionError as t, vec2Type as tt, setSidecarTrack as u, compileTimeline as v, resolveEaseDerivative as w, TrackValidationError as x, isDurationEditable as y, easingDerivatives as z };
|
package/dist/studioHost.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as Key, N as Timeline, S as isEditableNodeId,
|
|
1
|
+
import { H as Key, N as Timeline, S as isEditableNodeId, Tt as ValueTypeId, a as SidecarOrphan, lt as EaseSpec, r as SidecarDoc, w as targetNodeId } from "./sidecar.js";
|
|
2
2
|
|
|
3
3
|
//#region src/timelinePatch.d.ts
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1-pre.1",
|
|
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
|
"type": "module",
|