@ng-native/fabric 0.3.0 → 0.5.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/aria-props.d.ts +16 -0
- package/dist/aria-props.js +78 -0
- package/dist/aria-props.js.map +1 -0
- package/dist/color-mix.js +1 -16
- package/dist/color-mix.js.map +1 -1
- package/dist/css.d.ts +169 -2
- package/dist/css.js +676 -34
- package/dist/css.js.map +1 -1
- package/dist/element-styles.d.ts +15 -0
- package/dist/element-styles.js +103 -0
- package/dist/element-styles.js.map +1 -0
- package/dist/engine.d.ts +252 -7
- package/dist/engine.js +1081 -80
- package/dist/engine.js.map +1 -1
- package/dist/font-faces.d.ts +5 -2
- package/dist/font-faces.js +13 -2
- package/dist/font-faces.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-derived-token.js +11 -10
- package/dist/inline-derived-token.js.map +1 -1
- package/dist/inline-token.d.ts +7 -0
- package/dist/inline-token.js +53 -8
- package/dist/inline-token.js.map +1 -1
- package/dist/inline-transform.d.ts +5 -1
- package/dist/inline-transform.js +34 -6
- package/dist/inline-transform.js.map +1 -1
- package/dist/native-drive.d.ts +21 -0
- package/dist/native-drive.js +60 -0
- package/dist/native-drive.js.map +1 -1
- package/dist/premultiplied-stops.d.ts +7 -0
- package/dist/premultiplied-stops.js +131 -0
- package/dist/premultiplied-stops.js.map +1 -0
- package/dist/scroll-animation.d.ts +11 -0
- package/dist/scroll-animation.js +29 -0
- package/dist/scroll-animation.js.map +1 -1
- package/dist/transition.d.ts +15 -0
- package/dist/transition.js +42 -1
- package/dist/transition.js.map +1 -1
- package/package.json +1 -1
package/dist/scroll-animation.js
CHANGED
|
@@ -50,6 +50,35 @@ export function scrollChannels(tracks, spec, resting, range) {
|
|
|
50
50
|
held,
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The channels for an animation played by the clock, along a value native runs from nothing to
|
|
55
|
+
* `span`: one iteration along 0 to 1, and for `alternate` the way back along 1 to 2, so that
|
|
56
|
+
* native repeats there and back as one animation. Both ends are the frames' own: what the
|
|
57
|
+
* element rests at is committed when the animation ends, and not played.
|
|
58
|
+
*/
|
|
59
|
+
export function clockChannels(tracks, spec, resting) {
|
|
60
|
+
const way = (direction, range) => scrollChannels(tracks, { ...spec, fill: 'both', direction }, resting, range);
|
|
61
|
+
if (spec.direction !== 'alternate' && spec.direction !== 'alternate-reverse') {
|
|
62
|
+
return { ...way(spec.direction, [0, 1]), span: 1 };
|
|
63
|
+
}
|
|
64
|
+
const reversed = spec.direction === 'alternate-reverse';
|
|
65
|
+
const out = way(reversed ? 'reverse' : undefined, [0, 1]);
|
|
66
|
+
const back = way(reversed ? undefined : 'reverse', [1, 2]);
|
|
67
|
+
const join = (a, b) => ({
|
|
68
|
+
input: [...a.input, ...b.input.slice(1)],
|
|
69
|
+
output: [...a.output, ...b.output.slice(1)],
|
|
70
|
+
});
|
|
71
|
+
const transform = out.channels.transform.map((channel, i) => {
|
|
72
|
+
const other = back.channels.transform[i];
|
|
73
|
+
return 'range' in channel && other && 'range' in other
|
|
74
|
+
? { property: channel.property, range: join(channel.range, other.range) }
|
|
75
|
+
: channel;
|
|
76
|
+
});
|
|
77
|
+
const opacity = out.channels.opacity && back.channels.opacity
|
|
78
|
+
? { opacity: join(out.channels.opacity, back.channels.opacity) }
|
|
79
|
+
: {};
|
|
80
|
+
return { channels: { ...opacity, transform }, held: out.held, span: 2 };
|
|
81
|
+
}
|
|
53
82
|
/** One transform group's entries, each driven along the scroll; null if their shapes differ. */
|
|
54
83
|
function drivenGroup(track, resting, along) {
|
|
55
84
|
const shapes = track.map((point) => (Array.isArray(point.value) ? point.value : null));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-animation.js","sourceRoot":"","sources":["../src/scroll-animation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAuC,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G,CAAC,GAAG,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * A `@keyframes` animation played by a scroll view's offset: `animation-timeline: scroll()`.\n *\n * Native interpolates linearly between the points it is given and clamps past both ends, which is\n * all a scroll-driven animation needs from it once its keyframes are laid along the offset: each\n * keyframe sits at its share of the range, a segment's timing function is sampled into points\n * along it, and an unfilled end falls back to the resting value just outside the range. What\n * native can animate this way is opacity and the transforms; anything else holds its first frame.\n */\nimport type { ScrollRange } from './native-drive.ts';\nimport { at, type AnimationSpec, type TrackPoint } from './transition.ts';\n\ntype Track = readonly { offset: number; value: unknown }[];\n\n/** The channels a scroll-driven animation drives natively, in the order native applies them. */\nexport interface DrivenChannels {\n readonly opacity?: ScrollRange;\n /** Every transform entry the view paints: driven by the scroll, or held as it is. */\n readonly transform: readonly TransformChannel[];\n}\n\nexport type TransformChannel =\n | { readonly property: string; readonly range: ScrollRange }\n | { readonly property: string; readonly value: number };\n\n/** What a range with no end, or a percentage of one, stands in for until the scroll view says. */\nconst UNKNOWN_EXTENT = 1e6;\n\n/** Points per eased segment: enough that the curve between them reads as the curve. */\nconst SAMPLES = 12;\n\n/** The transform groups in the order CSS applies them, as the engine composes them. */\nconst GROUPS = ['__translate', '__rotate', '__scale', 'transform'] as const;\n\n/** Where the range starts and ends on the scroll view's offset. */\nexport function rangeOf(spec: AnimationSpec, extent: number | null): [number, number] {\n const end = (value: number | string | undefined, otherwise: number): number => {\n if (value === undefined) return otherwise;\n if (typeof value === 'number') return value;\n return (parseFloat(value) / 100) * (extent ?? UNKNOWN_EXTENT);\n };\n return [end(spec.range?.start, 0), end(spec.range?.end, extent ?? UNKNOWN_EXTENT)];\n}\n\n/**\n * The channels for an animation's tracks over a range, and the properties it cannot drive\n * natively, which the caller holds at their first frame.\n */\nexport function scrollChannels(\n tracks: ReadonlyMap<string, Track>,\n spec: AnimationSpec,\n resting: Readonly<Record<string, unknown>>,\n range: readonly [number, number],\n): { channels: DrivenChannels; held: string[] } {\n const along = (track: Track, pick: (value: unknown) => number | null, rest: number) =>\n laid(track, pick, rest, spec, range);\n const held: string[] = [];\n let opacity: ScrollRange | undefined;\n const transform: TransformChannel[] = [];\n for (const [property, track] of tracks) {\n if (property === 'opacity') {\n opacity =\n along(\n track,\n (value) => (typeof value === 'number' ? value : null),\n numberOr(resting['opacity'], 1),\n ) ?? undefined;\n if (!opacity) held.push(property);\n } else if (!(GROUPS as readonly string[]).includes(property)) {\n held.push(property);\n }\n }\n for (const group of GROUPS) {\n const track = tracks.get(group);\n const channels = track ? drivenGroup(track, resting[group], along) : heldGroup(resting[group]);\n if (channels === null) held.push(group);\n else transform.push(...channels);\n }\n const anyDriven = transform.some((channel) => 'range' in channel);\n return {\n channels: { ...(opacity ? { opacity } : {}), transform: anyDriven ? transform : [] },\n held,\n };\n}\n\n/** One transform group's entries, each driven along the scroll; null if their shapes differ. */\nfunction drivenGroup(\n track: Track,\n resting: unknown,\n along: (\n track: Track,\n pick: (value: unknown) => number | null,\n rest: number,\n ) => ScrollRange | null,\n): TransformChannel[] | null {\n const shapes = track.map((point) => (Array.isArray(point.value) ? point.value : null));\n const shape = shapes.find((entries) => entries?.length) ?? [];\n const keys = shape.map((entry) => Object.keys(entry as object)[0]!);\n const channels: TransformChannel[] = [];\n for (const [index, key] of keys.entries()) {\n const identity = key.startsWith('scale') ? 1 : 0;\n const pick = (value: unknown) => {\n const entries = Array.isArray(value) ? value : null;\n if (!entries?.length) return identity;\n const entry = entries[index] as Record<string, unknown> | undefined;\n return entry && key in entry ? amount(key, entry[key]) : null;\n };\n const range = along(track, pick, restingAmount(resting, index, key, identity));\n if (!range) return null;\n channels.push({ property: key, range });\n }\n return channels;\n}\n\n/** A transform group no keyframe touches, held as the element has it. */\nfunction heldGroup(resting: unknown): TransformChannel[] | null {\n if (!Array.isArray(resting)) return [];\n const channels: TransformChannel[] = [];\n for (const entry of resting as Record<string, unknown>[]) {\n const [key, value] = Object.entries(entry)[0] ?? [];\n const number = key === undefined ? null : amount(key, value);\n if (key === undefined || number === null) return null;\n channels.push({ property: key, value: number });\n }\n return channels;\n}\n\nfunction restingAmount(resting: unknown, index: number, key: string, identity: number): number {\n const entry = Array.isArray(resting) ? (resting[index] as Record<string, unknown>) : undefined;\n return (entry && key in entry ? amount(key, entry[key]) : null) ?? identity;\n}\n\nconst numberOr = (value: unknown, otherwise: number) =>\n typeof value === 'number' ? value : otherwise;\n\nconst RADIANS: Record<string, number> = {\n deg: Math.PI / 180,\n rad: 1,\n grad: Math.PI / 200,\n turn: 2 * Math.PI,\n};\n\n/**\n * A transform entry's amount as native's transform node takes it: points, a factor, or an angle\n * in radians. Null for what it cannot take, a percentage translate.\n */\nfunction amount(key: string, value: unknown): number | null {\n if (typeof value === 'number') return value;\n if (typeof value !== 'string') return null;\n const angle = /^(-?[\\d.]+)(deg|rad|grad|turn)$/.exec(value);\n if (angle && (key.startsWith('rotate') || key.startsWith('skew'))) {\n return Number(angle[1]) * RADIANS[angle[2]!]!;\n }\n return null;\n}\n\n/**\n * One property's frames laid along the scroll: each keyframe at its share of the range, eased\n * segments sampled, and the resting value just past an end the animation does not fill.\n */\nfunction laid(\n track: Track,\n pick: (value: unknown) => number | null,\n rest: number,\n spec: AnimationSpec,\n [start, end]: readonly [number, number],\n): ScrollRange | null {\n const values = track.map((point) => pick(point.value));\n if (values.some((value) => value === null)) return null;\n // Each point keeps its own timing function, which eases the stretch it starts.\n const numeric = track.map((point, i) => ({ ...point, value: values[i]! }));\n const points = sampled(numeric, spec, start, Math.max(end - start, 1e-3));\n const fills = spec.fill;\n const backwards = fills === 'backwards' || fills === 'both';\n const forwards = fills === 'forwards' || fills === 'both';\n if (!backwards) points.unshift([points[0]![0] - 1e-3, rest]);\n if (!forwards) points.push([points.at(-1)![0] + 1e-3, rest]);\n return { input: points.map(([x]) => x), output: points.map(([, y]) => round(y)) };\n}\n\n/** A numeric track's points along the scroll, each eased segment sampled, in offset order. */\nfunction sampled(\n numeric: readonly (TrackPoint & { value: number })[],\n spec: AnimationSpec,\n start: number,\n span: number,\n): [number, number][] {\n const reversed = spec.direction === 'reverse' || spec.direction === 'alternate-reverse';\n const points: [number, number][] = [];\n for (let i = 0; i < numeric.length - 1; i++) {\n const from = numeric[i]!;\n const to = numeric[i + 1]!;\n const steps = isLinear(from.easing ?? spec.easing) ? 1 : SAMPLES;\n for (let s = i === 0 ? 0 : 1; s <= steps; s++) {\n const offset = from.offset + ((to.offset - from.offset) * s) / steps;\n const value = at(numeric, offset, spec.easing) as number;\n points.push([start + (reversed ? 1 - offset : offset) * span, value]);\n }\n }\n if (points.length === 1) points.push([start + span, points[0]![1]]);\n return points.sort((a, b) => a[0] - b[0]);\n}\n\nconst isLinear = (easing: readonly number[]) =>\n easing[0] === 0 && easing[1] === 0 && easing[2] === 1 && easing[3] === 1;\n\nconst round = (value: number) => Math.round(value * 1e6) / 1e6;\n\n/** The values a scroll-driven animation commits: its frame at the offset the view starts at. */\nexport function firstFrame(\n tracks: ReadonlyMap<string, Track>,\n spec: AnimationSpec,\n range: readonly [number, number],\n): Record<string, unknown> {\n const [start, end] = range;\n const reversed = spec.direction === 'reverse' || spec.direction === 'alternate-reverse';\n const before = 0 < start;\n if (before && spec.fill !== 'backwards' && spec.fill !== 'both') return {};\n const through = Math.min(1, Math.max(0, (0 - start) / Math.max(end - start, 1e-3)));\n const local = reversed ? 1 - through : through;\n const values: Record<string, unknown> = {};\n for (const [property, track] of tracks) values[property] = at(track, local, spec.easing);\n return values;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scroll-animation.js","sourceRoot":"","sources":["../src/scroll-animation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAuC,MAAM,iBAAiB,CAAC;AAe1E,kGAAkG;AAClG,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,uFAAuF;AACvF,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,uFAAuF;AACvF,MAAM,MAAM,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAE5E,mEAAmE;AACnE,MAAM,UAAU,OAAO,CAAC,IAAmB,EAAE,MAAqB;IAChE,MAAM,GAAG,GAAG,CAAC,KAAkC,EAAE,SAAiB,EAAU,EAAE;QAC5E,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC;IAChE,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;AACrF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkC,EAClC,IAAmB,EACnB,OAA0C,EAC1C,KAAgC;IAEhC,MAAM,KAAK,GAAG,CAAC,KAAY,EAAE,IAAuC,EAAE,IAAY,EAAE,EAAE,CACpF,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,OAAgC,C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CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * A `@keyframes` animation played by a scroll view's offset: `animation-timeline: scroll()`.\n *\n * Native interpolates linearly between the points it is given and clamps past both ends, which is\n * all a scroll-driven animation needs from it once its keyframes are laid along the offset: each\n * keyframe sits at its share of the range, a segment's timing function is sampled into points\n * along it, and an unfilled end falls back to the resting value just outside the range. What\n * native can animate this way is opacity and the transforms; anything else holds its first frame.\n */\nimport type { ScrollRange } from './native-drive.ts';\nimport { at, type AnimationSpec, type TrackPoint } from './transition.ts';\n\ntype Track = readonly { offset: number; value: unknown }[];\n\n/** The channels a scroll-driven animation drives natively, in the order native applies them. */\nexport interface DrivenChannels {\n readonly opacity?: ScrollRange;\n /** Every transform entry the view paints: driven by the scroll, or held as it is. */\n readonly transform: readonly TransformChannel[];\n}\n\nexport type TransformChannel =\n | { readonly property: string; readonly range: ScrollRange }\n | { readonly property: string; readonly value: number };\n\n/** What a range with no end, or a percentage of one, stands in for until the scroll view says. */\nconst UNKNOWN_EXTENT = 1e6;\n\n/** Points per eased segment: enough that the curve between them reads as the curve. */\nconst SAMPLES = 12;\n\n/** The transform groups in the order CSS applies them, as the engine composes them. */\nconst GROUPS = ['__translate', '__rotate', '__scale', 'transform'] as const;\n\n/** Where the range starts and ends on the scroll view's offset. */\nexport function rangeOf(spec: AnimationSpec, extent: number | null): [number, number] {\n const end = (value: number | string | undefined, otherwise: number): number => {\n if (value === undefined) return otherwise;\n if (typeof value === 'number') return value;\n return (parseFloat(value) / 100) * (extent ?? UNKNOWN_EXTENT);\n };\n return [end(spec.range?.start, 0), end(spec.range?.end, extent ?? UNKNOWN_EXTENT)];\n}\n\n/**\n * The channels for an animation's tracks over a range, and the properties it cannot drive\n * natively, which the caller holds at their first frame.\n */\nexport function scrollChannels(\n tracks: ReadonlyMap<string, Track>,\n spec: AnimationSpec,\n resting: Readonly<Record<string, unknown>>,\n range: readonly [number, number],\n): { channels: DrivenChannels; held: string[] } {\n const along = (track: Track, pick: (value: unknown) => number | null, rest: number) =>\n laid(track, pick, rest, spec, range);\n const held: string[] = [];\n let opacity: ScrollRange | undefined;\n const transform: TransformChannel[] = [];\n for (const [property, track] of tracks) {\n if (property === 'opacity') {\n opacity =\n along(\n track,\n (value) => (typeof value === 'number' ? value : null),\n numberOr(resting['opacity'], 1),\n ) ?? undefined;\n if (!opacity) held.push(property);\n } else if (!(GROUPS as readonly string[]).includes(property)) {\n held.push(property);\n }\n }\n for (const group of GROUPS) {\n const track = tracks.get(group);\n const channels = track ? drivenGroup(track, resting[group], along) : heldGroup(resting[group]);\n if (channels === null) held.push(group);\n else transform.push(...channels);\n }\n const anyDriven = transform.some((channel) => 'range' in channel);\n return {\n channels: { ...(opacity ? { opacity } : {}), transform: anyDriven ? transform : [] },\n held,\n };\n}\n\n/**\n * The channels for an animation played by the clock, along a value native runs from nothing to\n * `span`: one iteration along 0 to 1, and for `alternate` the way back along 1 to 2, so that\n * native repeats there and back as one animation. Both ends are the frames' own: what the\n * element rests at is committed when the animation ends, and not played.\n */\nexport function clockChannels(\n tracks: ReadonlyMap<string, Track>,\n spec: AnimationSpec,\n resting: Readonly<Record<string, unknown>>,\n): { channels: DrivenChannels; held: string[]; span: number } {\n const way = (direction: AnimationSpec['direction'], range: readonly [number, number]) =>\n scrollChannels(tracks, { ...spec, fill: 'both', direction }, resting, range);\n if (spec.direction !== 'alternate' && spec.direction !== 'alternate-reverse') {\n return { ...way(spec.direction, [0, 1]), span: 1 };\n }\n const reversed = spec.direction === 'alternate-reverse';\n const out = way(reversed ? 'reverse' : undefined, [0, 1]);\n const back = way(reversed ? undefined : 'reverse', [1, 2]);\n const join = (a: ScrollRange, b: ScrollRange): ScrollRange => ({\n input: [...a.input, ...b.input.slice(1)],\n output: [...a.output, ...b.output.slice(1)],\n });\n const transform = out.channels.transform.map((channel, i) => {\n const other = back.channels.transform[i];\n return 'range' in channel && other && 'range' in other\n ? { property: channel.property, range: join(channel.range, other.range) }\n : channel;\n });\n const opacity =\n out.channels.opacity && back.channels.opacity\n ? { opacity: join(out.channels.opacity, back.channels.opacity) }\n : {};\n return { channels: { ...opacity, transform }, held: out.held, span: 2 };\n}\n\n/** One transform group's entries, each driven along the scroll; null if their shapes differ. */\nfunction drivenGroup(\n track: Track,\n resting: unknown,\n along: (\n track: Track,\n pick: (value: unknown) => number | null,\n rest: number,\n ) => ScrollRange | null,\n): TransformChannel[] | null {\n const shapes = track.map((point) => (Array.isArray(point.value) ? point.value : null));\n const shape = shapes.find((entries) => entries?.length) ?? [];\n const keys = shape.map((entry) => Object.keys(entry as object)[0]!);\n const channels: TransformChannel[] = [];\n for (const [index, key] of keys.entries()) {\n const identity = key.startsWith('scale') ? 1 : 0;\n const pick = (value: unknown) => {\n const entries = Array.isArray(value) ? value : null;\n if (!entries?.length) return identity;\n const entry = entries[index] as Record<string, unknown> | undefined;\n return entry && key in entry ? amount(key, entry[key]) : null;\n };\n const range = along(track, pick, restingAmount(resting, index, key, identity));\n if (!range) return null;\n channels.push({ property: key, range });\n }\n return channels;\n}\n\n/** A transform group no keyframe touches, held as the element has it. */\nfunction heldGroup(resting: unknown): TransformChannel[] | null {\n if (!Array.isArray(resting)) return [];\n const channels: TransformChannel[] = [];\n for (const entry of resting as Record<string, unknown>[]) {\n const [key, value] = Object.entries(entry)[0] ?? [];\n const number = key === undefined ? null : amount(key, value);\n if (key === undefined || number === null) return null;\n channels.push({ property: key, value: number });\n }\n return channels;\n}\n\nfunction restingAmount(resting: unknown, index: number, key: string, identity: number): number {\n const entry = Array.isArray(resting) ? (resting[index] as Record<string, unknown>) : undefined;\n return (entry && key in entry ? amount(key, entry[key]) : null) ?? identity;\n}\n\nconst numberOr = (value: unknown, otherwise: number) =>\n typeof value === 'number' ? value : otherwise;\n\nconst RADIANS: Record<string, number> = {\n deg: Math.PI / 180,\n rad: 1,\n grad: Math.PI / 200,\n turn: 2 * Math.PI,\n};\n\n/**\n * A transform entry's amount as native's transform node takes it: points, a factor, or an angle\n * in radians. Null for what it cannot take, a percentage translate.\n */\nfunction amount(key: string, value: unknown): number | null {\n if (typeof value === 'number') return value;\n if (typeof value !== 'string') return null;\n const angle = /^(-?[\\d.]+)(deg|rad|grad|turn)$/.exec(value);\n if (angle && (key.startsWith('rotate') || key.startsWith('skew'))) {\n return Number(angle[1]) * RADIANS[angle[2]!]!;\n }\n return null;\n}\n\n/**\n * One property's frames laid along the scroll: each keyframe at its share of the range, eased\n * segments sampled, and the resting value just past an end the animation does not fill.\n */\nfunction laid(\n track: Track,\n pick: (value: unknown) => number | null,\n rest: number,\n spec: AnimationSpec,\n [start, end]: readonly [number, number],\n): ScrollRange | null {\n const values = track.map((point) => pick(point.value));\n if (values.some((value) => value === null)) return null;\n // Each point keeps its own timing function, which eases the stretch it starts.\n const numeric = track.map((point, i) => ({ ...point, value: values[i]! }));\n const points = sampled(numeric, spec, start, Math.max(end - start, 1e-3));\n const fills = spec.fill;\n const backwards = fills === 'backwards' || fills === 'both';\n const forwards = fills === 'forwards' || fills === 'both';\n if (!backwards) points.unshift([points[0]![0] - 1e-3, rest]);\n if (!forwards) points.push([points.at(-1)![0] + 1e-3, rest]);\n return { input: points.map(([x]) => x), output: points.map(([, y]) => round(y)) };\n}\n\n/** A numeric track's points along the scroll, each eased segment sampled, in offset order. */\nfunction sampled(\n numeric: readonly (TrackPoint & { value: number })[],\n spec: AnimationSpec,\n start: number,\n span: number,\n): [number, number][] {\n const reversed = spec.direction === 'reverse' || spec.direction === 'alternate-reverse';\n const points: [number, number][] = [];\n for (let i = 0; i < numeric.length - 1; i++) {\n const from = numeric[i]!;\n const to = numeric[i + 1]!;\n const steps = isLinear(from.easing ?? spec.easing) ? 1 : SAMPLES;\n for (let s = i === 0 ? 0 : 1; s <= steps; s++) {\n const offset = from.offset + ((to.offset - from.offset) * s) / steps;\n const value = at(numeric, offset, spec.easing) as number;\n points.push([start + (reversed ? 1 - offset : offset) * span, value]);\n }\n }\n if (points.length === 1) points.push([start + span, points[0]![1]]);\n return points.sort((a, b) => a[0] - b[0]);\n}\n\nconst isLinear = (easing: readonly number[]) =>\n easing[0] === 0 && easing[1] === 0 && easing[2] === 1 && easing[3] === 1;\n\nconst round = (value: number) => Math.round(value * 1e6) / 1e6;\n\n/** The values a scroll-driven animation commits: its frame at the offset the view starts at. */\nexport function firstFrame(\n tracks: ReadonlyMap<string, Track>,\n spec: AnimationSpec,\n range: readonly [number, number],\n): Record<string, unknown> {\n const [start, end] = range;\n const reversed = spec.direction === 'reverse' || spec.direction === 'alternate-reverse';\n const before = 0 < start;\n if (before && spec.fill !== 'backwards' && spec.fill !== 'both') return {};\n const through = Math.min(1, Math.max(0, (0 - start) / Math.max(end - start, 1e-3)));\n const local = reversed ? 1 - through : through;\n const values: Record<string, unknown> = {};\n for (const [property, track] of tracks) values[property] = at(track, local, spec.easing);\n return values;\n}\n"]}
|
package/dist/transition.d.ts
CHANGED
|
@@ -29,6 +29,13 @@ export interface Transition {
|
|
|
29
29
|
done: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare function bezier(points: readonly number[], x: number): number;
|
|
32
|
+
/** How many degrees one of each hue unit is. */
|
|
33
|
+
export declare const HUE_DEGREES: Record<string, number>;
|
|
34
|
+
type Channels = [number, number, number];
|
|
35
|
+
/** `hsl()`'s hue in degrees and its saturation and lightness as fractions, as sRGB from 0 to 1. */
|
|
36
|
+
export declare function hslToSrgb([h, s, l]: Channels): Channels;
|
|
37
|
+
/** `hwb()`'s hue in degrees and its whiteness and blackness as fractions, as sRGB from 0 to 1. */
|
|
38
|
+
export declare function hwbToSrgb([h, w, b]: Channels): Channels;
|
|
32
39
|
/** A colour as `[r, g, b, a]`, or null for a form not worth parsing. */
|
|
33
40
|
export declare function parseColor(value: unknown): [number, number, number, number] | null;
|
|
34
41
|
/** Whether a word is a CSS colour name, such as `red` or `transparent`. */
|
|
@@ -104,6 +111,13 @@ export interface RunningAnimation {
|
|
|
104
111
|
/** What the properties read right now. Empty once a finished animation stops filling. */
|
|
105
112
|
values: Record<string, unknown>;
|
|
106
113
|
done: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Set while native plays it, with no frame of it in JavaScript: what stops it there. `values`
|
|
116
|
+
* is then the frame it started at, which is what the view is committed with.
|
|
117
|
+
*/
|
|
118
|
+
native?: {
|
|
119
|
+
stop(): void;
|
|
120
|
+
};
|
|
107
121
|
}
|
|
108
122
|
/**
|
|
109
123
|
* Build one track per property the frames touch.
|
|
@@ -148,3 +162,4 @@ export declare function at(track: readonly TrackPoint[], local: number, easing:
|
|
|
148
162
|
* reason: it must not be one.
|
|
149
163
|
*/
|
|
150
164
|
export declare function animationEvent(topLevelType: string, target: unknown, name: string): unknown;
|
|
165
|
+
export {};
|
package/dist/transition.js
CHANGED
|
@@ -45,6 +45,47 @@ export function bezier(points, x) {
|
|
|
45
45
|
}
|
|
46
46
|
const HEX = /^#([0-9a-f]{3,8})$/i;
|
|
47
47
|
const RGB = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+))?\s*\)$/i;
|
|
48
|
+
/** `hsl()` and `hwb()`, with commas or without: a hue, two percentages, and an alpha if any. */
|
|
49
|
+
const HUED = /^(hsla?|hwb)\(\s*(-?[\d.]+)(deg|grad|rad|turn)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%(?:[\s,/]+([\d.]+)(%)?)?\s*\)$/i;
|
|
50
|
+
/** How many degrees one of each hue unit is. */
|
|
51
|
+
export const HUE_DEGREES = {
|
|
52
|
+
deg: 1,
|
|
53
|
+
grad: 0.9,
|
|
54
|
+
rad: 180 / Math.PI,
|
|
55
|
+
turn: 360,
|
|
56
|
+
};
|
|
57
|
+
/** `hsl()`'s hue in degrees and its saturation and lightness as fractions, as sRGB from 0 to 1. */
|
|
58
|
+
export function hslToSrgb([h, s, l]) {
|
|
59
|
+
const hue = Number.isFinite(h) ? ((h % 360) + 360) % 360 : 0;
|
|
60
|
+
const f = (n) => {
|
|
61
|
+
const k = (n + hue / 30) % 12;
|
|
62
|
+
return l - s * Math.min(l, 1 - l) * Math.max(-1, Math.min(k - 3, 9 - k, 1));
|
|
63
|
+
};
|
|
64
|
+
return [f(0), f(8), f(4)];
|
|
65
|
+
}
|
|
66
|
+
/** `hwb()`'s hue in degrees and its whiteness and blackness as fractions, as sRGB from 0 to 1. */
|
|
67
|
+
export function hwbToSrgb([h, w, b]) {
|
|
68
|
+
if (w + b >= 1) {
|
|
69
|
+
const grey = w / (w + b);
|
|
70
|
+
return [grey, grey, grey];
|
|
71
|
+
}
|
|
72
|
+
return hslToSrgb([h, 1, 0.5]).map((c) => c * (1 - w - b) + w);
|
|
73
|
+
}
|
|
74
|
+
/** A colour written as `hsl()` or `hwb()`, as `[r, g, b, a]`. */
|
|
75
|
+
function parseHued(value) {
|
|
76
|
+
const parts = HUED.exec(value);
|
|
77
|
+
if (!parts)
|
|
78
|
+
return null;
|
|
79
|
+
const [, name, hue, unit = 'deg', first, second, alpha, percent] = parts;
|
|
80
|
+
const convert = name.toLowerCase() === 'hwb' ? hwbToSrgb : hslToSrgb;
|
|
81
|
+
const [r, g, b] = convert([
|
|
82
|
+
Number(hue) * HUE_DEGREES[unit.toLowerCase()],
|
|
83
|
+
Math.min(1, Number(first) / 100),
|
|
84
|
+
Math.min(1, Number(second) / 100),
|
|
85
|
+
]).map((channel) => Math.round(channel * 255));
|
|
86
|
+
const opacity = alpha === undefined ? 1 : Number(alpha) / (percent ? 100 : 1);
|
|
87
|
+
return [r, g, b, Math.min(1, opacity)];
|
|
88
|
+
}
|
|
48
89
|
/**
|
|
49
90
|
* Every CSS named colour, as the `[r, g, b, a]` the compiler's own `namedColor()` in
|
|
50
91
|
* `packages/metro/css/values.cjs` resolves it to - generated from that table rather than typed
|
|
@@ -229,7 +270,7 @@ export function parseColor(value) {
|
|
|
229
270
|
return [part(0), part(1), part(2), alpha];
|
|
230
271
|
}
|
|
231
272
|
const named = NAMED_COLORS[value.toLowerCase()];
|
|
232
|
-
return named ? [...named] :
|
|
273
|
+
return named ? [...named] : parseHued(value);
|
|
233
274
|
}
|
|
234
275
|
/** Whether a word is a CSS colour name, such as `red` or `transparent`. */
|
|
235
276
|
export function isNamedColor(value) {
|
package/dist/transition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.js","sourceRoot":"","sources":["../src/transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU,EAAE;IACxD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,6FAA6F;AAC7F,MAAM,QAAQ,GAAG,CAAC,CAAoB,EAAW,EAAE,CACjD,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,UAAU,MAAM,CAAC,MAAyB,EAAE,CAAS;IACzD,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrB,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrB,IAAI,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,CAAC;IAE/B,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG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AM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * CSS transitions, the runtime half.\n *\n * React Native has no CSS animation of any kind, so a `transition` in a stylesheet is compiled to\n * a spec and driven here: the engine notices a transitioning property change between commits,\n * holds the old value, and interpolates towards the new one as the clock advances.\n *\n * This runs in JavaScript, unlike `AnimatedStyle`, which can hand a whole animation to the native\n * driver. It has to: a transition is a reaction to the cascade recomputing, and only this side\n * knows a value changed at all. The cost is a commit per frame, which is the same cost a\n * JavaScript-driven `Animated` value has.\n */\n\n/** What the CSS compiler emits per transitioning property. Durations are in milliseconds. */\nexport interface TransitionSpec {\n readonly duration: number;\n readonly delay: number;\n /** The four control points of the timing curve; a keyword is resolved at build time. */\n readonly easing: readonly number[];\n}\n\nexport interface Transition {\n from: unknown;\n to: unknown;\n /** When the interpolation starts, delay already added. */\n start: number;\n duration: number;\n easing: readonly number[];\n /** What the node paints right now. Also the value a redirected transition starts from. */\n current: unknown;\n done: boolean;\n}\n\n/**\n * A cubic bezier's y at a given x, by bisection.\n *\n * Newton-Raphson converges faster and is what browsers use, but it needs a derivative and a\n * fallback for the flat regions of a curve like `ease-in`. Twenty bisection steps land within\n * 1e-6 on any curve, which is finer than a pixel, and the whole thing is eight lines.\n */\nconst curve = (t: number, a: number, b: number): number => {\n const u = 1 - t;\n return 3 * u * u * t * a + 3 * u * t * t * b + t * t * t;\n};\n\n/** A linear curve is both the default and by far the most common, so it skips the search. */\nconst isLinear = (p: readonly number[]): boolean =>\n p[0] === 0 && p[1] === 0 && p[2] === 1 && p[3] === 1;\n\nexport function bezier(points: readonly number[], x: number): number {\n if (x <= 0) return 0;\n if (x >= 1) return 1;\n if (isLinear(points)) return x;\n\n const [x1 = 0, y1 = 0, x2 = 1, y2 = 1] = points;\n let low = 0;\n let high = 1;\n let t = x;\n for (let i = 0; i < 20; i++) {\n t = (low + high) / 2;\n if (curve(t, x1, x2) < x) low = t;\n else high = t;\n }\n return curve(t, y1, y2);\n}\n\nconst HEX = /^#([0-9a-f]{3,8})$/i;\nconst RGB = /^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)(?:[\\s,/]+([\\d.]+))?\\s*\\)$/i;\n\n/**\n * Every CSS named colour, as the `[r, g, b, a]` the compiler's own `namedColor()` in\n * `packages/metro/css/values.cjs` resolves it to - generated from that table rather than typed\n * out by hand, so there is one authority for what a colour name means and this cannot drift from\n * it. The compiler folds a named colour in a stylesheet into `rgb()` at build time, which is why\n * this table matters only for the rarer case: a value that reaches here without ever having been\n * through the compiler, such as a template binding a keyword straight into a style.\n */\nconst NAMED_COLORS: Record<string, [number, number, number, number]> = {\n aliceblue: [240, 248, 255, 1],\n antiquewhite: [250, 235, 215, 1],\n aqua: [0, 255, 255, 1],\n aquamarine: [127, 255, 212, 1],\n azure: [240, 255, 255, 1],\n beige: [245, 245, 220, 1],\n bisque: [255, 228, 196, 1],\n black: [0, 0, 0, 1],\n blanchedalmond: [255, 235, 205, 1],\n blue: [0, 0, 255, 1],\n blueviolet: [138, 43, 226, 1],\n brown: [165, 42, 42, 1],\n burlywood: [222, 184, 135, 1],\n cadetblue: [95, 158, 160, 1],\n chartreuse: [127, 255, 0, 1],\n chocolate: [210, 105, 30, 1],\n coral: [255, 127, 80, 1],\n cornflowerblue: [100, 149, 237, 1],\n cornsilk: [255, 248, 220, 1],\n crimson: [220, 20, 60, 1],\n cyan: [0, 255, 255, 1],\n darkblue: [0, 0, 139, 1],\n darkcyan: [0, 139, 139, 1],\n darkgoldenrod: [184, 134, 11, 1],\n darkgray: [169, 169, 169, 1],\n darkgreen: [0, 100, 0, 1],\n darkgrey: [169, 169, 169, 1],\n darkkhaki: [189, 183, 107, 1],\n darkmagenta: [139, 0, 139, 1],\n darkolivegreen: [85, 107, 47, 1],\n darkorange: [255, 140, 0, 1],\n darkorchid: [153, 50, 204, 1],\n darkred: [139, 0, 0, 1],\n darksalmon: [233, 150, 122, 1],\n darkseagreen: [143, 188, 143, 1],\n darkslateblue: [72, 61, 139, 1],\n darkslategray: [47, 79, 79, 1],\n darkslategrey: [47, 79, 79, 1],\n darkturquoise: [0, 206, 209, 1],\n darkviolet: [148, 0, 211, 1],\n deeppink: [255, 20, 147, 1],\n deepskyblue: [0, 191, 255, 1],\n dimgray: [105, 105, 105, 1],\n dimgrey: [105, 105, 105, 1],\n dodgerblue: [30, 144, 255, 1],\n firebrick: [178, 34, 34, 1],\n floralwhite: [255, 250, 240, 1],\n forestgreen: [34, 139, 34, 1],\n fuchsia: [255, 0, 255, 1],\n gainsboro: [220, 220, 220, 1],\n ghostwhite: [248, 248, 255, 1],\n gold: [255, 215, 0, 1],\n goldenrod: [218, 165, 32, 1],\n gray: [128, 128, 128, 1],\n green: [0, 128, 0, 1],\n greenyellow: [173, 255, 47, 1],\n grey: [128, 128, 128, 1],\n honeydew: [240, 255, 240, 1],\n hotpink: [255, 105, 180, 1],\n indianred: [205, 92, 92, 1],\n indigo: [75, 0, 130, 1],\n ivory: [255, 255, 240, 1],\n khaki: [240, 230, 140, 1],\n lavender: [230, 230, 250, 1],\n lavenderblush: [255, 240, 245, 1],\n lawngreen: [124, 252, 0, 1],\n lemonchiffon: [255, 250, 205, 1],\n lightblue: [173, 216, 230, 1],\n lightcoral: [240, 128, 128, 1],\n lightcyan: [224, 255, 255, 1],\n lightgoldenrodyellow: [250, 250, 210, 1],\n lightgray: [211, 211, 211, 1],\n lightgreen: [144, 238, 144, 1],\n lightgrey: [211, 211, 211, 1],\n lightpink: [255, 182, 193, 1],\n lightsalmon: [255, 160, 122, 1],\n lightseagreen: [32, 178, 170, 1],\n lightskyblue: [135, 206, 250, 1],\n lightslategray: [119, 136, 153, 1],\n lightslategrey: [119, 136, 153, 1],\n lightsteelblue: [176, 196, 222, 1],\n lightyellow: [255, 255, 224, 1],\n lime: [0, 255, 0, 1],\n limegreen: [50, 205, 50, 1],\n linen: [250, 240, 230, 1],\n magenta: [255, 0, 255, 1],\n maroon: [128, 0, 0, 1],\n mediumaquamarine: [102, 205, 170, 1],\n mediumblue: [0, 0, 205, 1],\n mediumorchid: [186, 85, 211, 1],\n mediumpurple: [147, 112, 219, 1],\n mediumseagreen: [60, 179, 113, 1],\n mediumslateblue: [123, 104, 238, 1],\n mediumspringgreen: [0, 250, 154, 1],\n mediumturquoise: [72, 209, 204, 1],\n mediumvioletred: [199, 21, 133, 1],\n midnightblue: [25, 25, 112, 1],\n mintcream: [245, 255, 250, 1],\n mistyrose: [255, 228, 225, 1],\n moccasin: [255, 228, 181, 1],\n navajowhite: [255, 222, 173, 1],\n navy: [0, 0, 128, 1],\n oldlace: [253, 245, 230, 1],\n olive: [128, 128, 0, 1],\n olivedrab: [107, 142, 35, 1],\n orange: [255, 165, 0, 1],\n orangered: [255, 69, 0, 1],\n orchid: [218, 112, 214, 1],\n palegoldenrod: [238, 232, 170, 1],\n palegreen: [152, 251, 152, 1],\n paleturquoise: [175, 238, 238, 1],\n palevioletred: [219, 112, 147, 1],\n papayawhip: [255, 239, 213, 1],\n peachpuff: [255, 218, 185, 1],\n peru: [205, 133, 63, 1],\n pink: [255, 192, 203, 1],\n plum: [221, 160, 221, 1],\n powderblue: [176, 224, 230, 1],\n purple: [128, 0, 128, 1],\n rebeccapurple: [102, 51, 153, 1],\n red: [255, 0, 0, 1],\n rosybrown: [188, 143, 143, 1],\n royalblue: [65, 105, 225, 1],\n saddlebrown: [139, 69, 19, 1],\n salmon: [250, 128, 114, 1],\n sandybrown: [244, 164, 96, 1],\n seagreen: [46, 139, 87, 1],\n seashell: [255, 245, 238, 1],\n sienna: [160, 82, 45, 1],\n silver: [192, 192, 192, 1],\n skyblue: [135, 206, 235, 1],\n slateblue: [106, 90, 205, 1],\n slategray: [112, 128, 144, 1],\n slategrey: [112, 128, 144, 1],\n snow: [255, 250, 250, 1],\n springgreen: [0, 255, 127, 1],\n steelblue: [70, 130, 180, 1],\n tan: [210, 180, 140, 1],\n teal: [0, 128, 128, 1],\n thistle: [216, 191, 216, 1],\n tomato: [255, 99, 71, 1],\n transparent: [0, 0, 0, 0],\n turquoise: [64, 224, 208, 1],\n violet: [238, 130, 238, 1],\n wheat: [245, 222, 179, 1],\n white: [255, 255, 255, 1],\n whitesmoke: [245, 245, 245, 1],\n yellow: [255, 255, 0, 1],\n yellowgreen: [154, 205, 50, 1],\n};\n\n/** A colour as `[r, g, b, a]`, or null for a form not worth parsing. */\nexport function parseColor(value: unknown): [number, number, number, number] | null {\n if (typeof value !== 'string') return null;\n\n const rgb = RGB.exec(value);\n if (rgb) {\n return [\n Number(rgb[1]),\n Number(rgb[2]),\n Number(rgb[3]),\n rgb[4] === undefined ? 1 : Number(rgb[4]),\n ];\n }\n\n const hex = HEX.exec(value);\n if (hex) {\n const digits = hex[1]!;\n const short = digits.length <= 4;\n const part = (i: number): number => {\n const at = short ? digits.slice(i, i + 1).repeat(2) : digits.slice(i * 2, i * 2 + 2);\n return parseInt(at, 16);\n };\n const alpha = digits.length === 4 || digits.length === 8 ? part(3) / 255 : 1;\n return [part(0), part(1), part(2), alpha];\n }\n\n const named = NAMED_COLORS[value.toLowerCase()];\n return named ? [...named] : null;\n}\n\n/** Whether a word is a CSS colour name, such as `red` or `transparent`. */\nexport function isNamedColor(value: string): boolean {\n return Object.hasOwn(NAMED_COLORS, value.toLowerCase());\n}\n\n/** A transform operation at rest, so a missing transform can be animated from rather than jumped. */\nconst IDENTITY: Record<string, number | string> = {\n translateX: 0,\n translateY: 0,\n scale: 1,\n scaleX: 1,\n scaleY: 1,\n rotate: '0deg',\n rotateX: '0deg',\n rotateY: '0deg',\n rotateZ: '0deg',\n skewX: '0deg',\n skewY: '0deg',\n};\n\n/**\n * A number with a unit on it, inside a transform operation.\n *\n * Angles were the only unit this matched, which quietly made every other one step instead of\n * move: a sheet sliding in with `translateY(100%)` sat at 100% for its whole duration and then\n * arrived, which on a phone reads as an animation that does not run at all. Percentages are the\n * ones that matter - they are how a transform says \"my own size\" without knowing what that is -\n * and lengths cost nothing extra now the shape is the same.\n */\nconst UNIT = /^(-?\\d*\\.?\\d+)(deg|rad|grad|turn|%|px|pt|em|rem)$/;\n\n/** One operation's value: a number, or a number keeping whatever unit it was written in. */\nexport function tween(from: unknown, to: unknown, t: number): unknown {\n if (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n if (typeof from !== 'string' || typeof to !== 'string') return null;\n\n const a = UNIT.exec(from);\n const b = UNIT.exec(to);\n // Matching units only. Converting between them needs a table, and for the pairs anybody\n // actually writes - `0deg` to `1turn`, `0%` to `10px` - the answer would be a guess.\n if (!a || !b || a[2] !== b[2]) return null;\n\n const value = Number(a[1]) + (Number(b[1]) - Number(a[1])) * t;\n return `${Math.round(value * 1000) / 1000}${a[2]}`;\n}\n\n/** The same operations, each at rest: what CSS's `none` means beside a list that has values. */\nfunction atRest(shape: readonly unknown[]): unknown[] {\n return shape.map((entry) => {\n const name = operation(entry);\n if (name === null || !(name in IDENTITY)) return entry;\n // At rest in the unit it is written in, so it can be eased toward: `-25%` from `0%`, and\n // `1turn` from `0turn`. A bare 0 beside a percentage is a pair `tween` cannot blend.\n const written = (entry as Record<string, unknown>)[name];\n const unit = typeof written === 'string' ? UNIT.exec(written)?.[2] : undefined;\n return { [name]: unit ? `0${unit}` : IDENTITY[name] };\n });\n}\n\n/** A transform list with something in it; `none` is an empty one, and means the same as none. */\nconst hasOperations = (value: unknown): value is readonly unknown[] =>\n Array.isArray(value) && value.length > 0;\n\n/** The name of a single-key transform operation, or null for anything else. */\nfunction operation(entry: unknown): string | null {\n if (typeof entry !== 'object' || entry === null) return null;\n const keys = Object.keys(entry);\n return keys.length === 1 ? keys[0]! : null;\n}\n\n/**\n * Two transform lists blended operation by operation.\n *\n * Matched by position *and* name: blending a translate into a scale would mean decomposing a\n * matrix, which is a great deal of arithmetic for a case an author can always write out. Anything\n * that does not line up returns null and steps instead, which is what CSS falls back to.\n *\n * A missing side is the ordinary case rather than the exception - `.slider` to\n * `.slider-end { transform: translateX(180px) }`, and the same again when the class comes off -\n * so whichever side is absent is read as each operation at rest, which is CSS's `none`.\n */\nfunction interpolateTransform(from: unknown, to: unknown, t: number): unknown[] | null {\n const shape = hasOperations(to) ? to : hasOperations(from) ? from : null;\n if (!shape) return null;\n\n const start = hasOperations(from) ? from : atRest(shape);\n const end = hasOperations(to) ? to : atRest(shape);\n if (start.length !== end.length) return null;\n\n const out: unknown[] = [];\n for (let i = 0; i < end.length; i++) {\n const name = operation(end[i]);\n if (name === null || name !== operation(start[i])) return null;\n const value = tween(\n (start[i] as Record<string, unknown>)[name],\n (end[i] as Record<string, unknown>)[name],\n t,\n );\n if (value === null) return null;\n out.push({ [name]: value });\n }\n return out;\n}\n\n/**\n * One step between two values.\n *\n * Numbers, colours and transforms interpolate. Everything else steps to the new value at the end,\n * which is what CSS does for a property it calls discrete, and is right for the keywords and\n * strings that make up most of the rest.\n */\nexport function interpolate(from: unknown, to: unknown, t: number): unknown {\n if (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n\n const a = parseColor(from);\n const b = parseColor(to);\n if (a && b) {\n const mix = (i: number): number => Math.round(a[i]! + (b[i]! - a[i]!) * t);\n const alpha = Math.round((a[3] + (b[3] - a[3]) * t) * 1000) / 1000;\n return `rgba(${mix(0)}, ${mix(1)}, ${mix(2)}, ${alpha})`;\n }\n\n const percent = interpolatePercentage(from, to, t);\n if (percent !== null) return percent;\n\n const transform = interpolateTransform(from, to, t);\n if (transform) return transform;\n\n return t >= 1 ? to : from;\n}\n\n/** `50%` -> `75%`. Both sides have to be percentages; a percentage and a length are not a scale. */\nconst PERCENTAGE = /^(-?[\\d.]+)%$/;\n\nfunction interpolatePercentage(from: unknown, to: unknown, t: number): string | null {\n if (typeof from !== 'string' || typeof to !== 'string') return null;\n const a = PERCENTAGE.exec(from);\n const b = PERCENTAGE.exec(to);\n if (!a || !b) return null;\n const value = Number(a[1]) + (Number(b[1]) - Number(a[1])) * t;\n return `${Math.round(value * 1000) / 1000}%`;\n}\n\n/**\n * Bring one property up to date, and say whether that started a transition.\n *\n * Mutates `props[key]` to what should be painted now, which for a transition in flight is the\n * value it has reached rather than the one it is heading for.\n */\nexport function step(\n state: Map<string, Transition>,\n key: string,\n props: Record<string, unknown>,\n rule: TransitionSpec | undefined,\n now: number,\n): boolean {\n if (!rule || rule.duration <= 0) {\n // No longer transitioning: forget it, so re-adding the rule later starts fresh.\n state.delete(key);\n return false;\n }\n\n const seen = state.get(key);\n if (seen === undefined) {\n // First sight of the property. CSS does not animate one of these either; without the rule\n // every element would animate in from whatever the previous value happened to be.\n state.set(key, settled(props[key], rule));\n return false;\n }\n\n // Nothing to interpolate when one end is missing: `null` here is `auto`, or a property the\n // element no longer sets at all, and there is no value halfway between a number and \"whatever\n // this works out to be\". CSS refuses the same transition. Interpolating anyway held the old\n // value for the whole duration, which is how a section that opened to a height nothing had\n // measured stayed shut - and clearing a height is also what stops the layout that would have\n // corrected it, so it stayed shut rather than catching up a frame later.\n //\n // The same goes for a pair with nothing between them at all, a keyword such as `display` or\n // `flex-direction`: CSS changes it at once rather than transitioning it, and `transition: all`\n // covers it. Holding the old one for the duration kept a `display: none` on screen until the\n // end and then made it vanish.\n const started = !Object.is(seen.to, props[key]);\n if (started && !interpolable(seen.current, props[key])) {\n state.set(key, settled(props[key], rule));\n return false;\n }\n if (started) redirect(seen, props[key], rule, now);\n if (!seen.done) props[key] = seen.current;\n return started;\n}\n\n/**\n * Whether there is a pair here to interpolate at all: two numbers, two colours, two percentages,\n * or two transform lists of the same shape.\n *\n * A transform is the one thing that animates from nothing, because \"no transform\" has a value -\n * the identity - and `interpolateTransform` starts there. Everything else needs both ends.\n */\nfunction interpolable(from: unknown, to: unknown): boolean {\n if (typeof from === 'number' && typeof to === 'number') return true;\n if (parseColor(from) !== null && parseColor(to) !== null) return true;\n if (interpolatePercentage(from, to, 0) !== null) return true;\n return interpolateTransform(from, to, 0) !== null;\n}\n\n/** A property seen for the first time: recorded so the next change has something to aim from. */\nexport function settled(value: unknown, rule: TransitionSpec): Transition {\n return {\n from: value,\n to: value,\n start: 0,\n duration: 0,\n easing: rule.easing,\n current: value,\n done: true,\n };\n}\n\n/** Aim an existing transition at a new value, starting from wherever it had got to. */\nexport function redirect(\n transition: Transition,\n target: unknown,\n rule: TransitionSpec,\n now: number,\n): void {\n transition.from = transition.current;\n transition.to = target;\n transition.start = now + rule.delay;\n transition.duration = rule.duration;\n transition.easing = rule.easing;\n transition.done = false;\n}\n\n/** What the CSS compiler emits for `animation:`. Times are milliseconds. */\nexport interface AnimationSpec {\n readonly name: string;\n readonly duration: number;\n readonly delay: number;\n readonly easing: readonly number[];\n /** `Infinity` for `infinite`. */\n /** `null` is `infinite`, which is what survives being written into the bundle as JSON. */\n readonly iterations: number | null;\n readonly fill: 'none' | 'forwards' | 'backwards' | 'both';\n /** Which way each iteration plays; absent is `normal`, forwards every time. */\n readonly direction?: 'reverse' | 'alternate' | 'alternate-reverse';\n /**\n * `animation-timeline: scroll()`: played by the nearest scroll view's offset along this axis\n * rather than by the clock. See `scroll-animation.ts`.\n */\n readonly timeline?: 'x' | 'y';\n /** `animation-play-state: paused`: held at the frame it has reached, until it runs again. */\n readonly paused?: boolean;\n /**\n * Where along the scroll it plays, in points or as a percentage of how far the view scrolls.\n * An end left out is the scroll's own: 0, or all the way.\n */\n readonly range?: { readonly start?: number | string; readonly end?: number | string };\n}\n\n/** One `@keyframes` frame: where it sits, and what it sets there. */\nexport interface Keyframe {\n readonly offset: number;\n readonly declarations: Record<string, unknown>;\n /** The `animation-timing-function` written in this keyframe, easing it to the next. */\n readonly easing?: readonly number[];\n}\n\nexport interface RunningAnimation {\n spec: AnimationSpec;\n /** When it was paused, while it is; the clock it is sampled at stands still there. */\n pausedAt?: number;\n /**\n * Per property, the offsets that mention it, in order. Built when the animation starts, and again\n * when the colour a frame's `color: currentColor` stands for changes.\n */\n tracks: Map<string, TrackPoint[]>;\n /** The colour the node inherits, which the tracks were built with, for frames that read it. */\n inherited?: unknown;\n start: number;\n /** What the properties read right now. Empty once a finished animation stops filling. */\n values: Record<string, unknown>;\n done: boolean;\n}\n\n/**\n * Build one track per property the frames touch.\n *\n * A property that no frame sets at 0% or 100% is anchored to the value the element would\n * otherwise have, which is what CSS means by an implicit keyframe: `to { opacity: 1 }` alone\n * animates from wherever the element already was. A frame's `color: currentColor` is `inherited`,\n * the colour the element inherits.\n */\nexport function tracksOf(\n frames: readonly Keyframe[],\n resting: Record<string, unknown>,\n inherited?: unknown,\n): Map<string, TrackPoint[]> {\n const tracks = new Map<string, TrackPoint[]>();\n\n for (const frame of frames) {\n for (const property of Object.keys(frame.declarations)) {\n const track = tracks.get(property) ?? [];\n const written = frame.declarations[property];\n const value = isCurrentColour(written) ? inherited : written;\n const point = { offset: frame.offset, value };\n track.push(frame.easing ? { ...point, easing: frame.easing } : point);\n tracks.set(property, track);\n }\n }\n\n for (const [property, track] of tracks) {\n const anchor = resting[property] ?? INITIAL[property];\n if (track[0]!.offset > 0) track.unshift({ offset: 0, value: anchor });\n if (track[track.length - 1]!.offset < 1) {\n track.push({ offset: 1, value: anchor });\n }\n }\n return tracks;\n}\n\n/**\n * Whether any frame sets `color: currentColor`, which is the colour the element inherits and so\n * differs from one element to the next. Kept per set of frames, as it is asked on every frame.\n */\nexport function readsInheritedColour(frames: readonly Keyframe[]): boolean {\n let answer = READS_INHERITED.get(frames);\n if (answer === undefined) {\n answer = frames.some((frame) => isCurrentColour(frame.declarations['color']));\n READS_INHERITED.set(frames, answer);\n }\n return answer;\n}\nconst READS_INHERITED = new WeakMap<readonly Keyframe[], boolean>();\n\n/** The marker the compiler writes for `currentColor`. */\nconst isCurrentColour = (value: unknown): boolean =>\n (value as { __colour?: { color?: unknown } } | null)?.__colour?.color === 'currentcolor';\n\n/**\n * What a property is worth when the element has not said.\n *\n * CSS anchors an implicit keyframe to the element's *computed* value, and a property nobody wrote\n * still has one - `opacity` is 1, not nothing. Anchoring to nothing instead leaves a frame with no\n * value to interpolate towards, so the animation holds its first value and jumps at the end.\n *\n * That is what `animate-pulse` was doing. It is a single frame, `50% { opacity: 0.5 }`, on a\n * skeleton that declares no opacity of its own - so both of its implicit frames were empty and the\n * pulse did not fade, in every skeleton in the library.\n *\n * Only the properties that appear in an animation and have a meaningful resting value. A length\n * defaulting to zero is the same as absent for anything here, and a colour has no initial worth\n * animating from.\n */\nconst INITIAL: Record<string, unknown> = {\n opacity: 1,\n scale: 1,\n rotate: '0deg',\n};\n\n/**\n * Where an animation has got to, as the properties to paint.\n *\n * The easing runs per segment rather than across the whole pass, which is what CSS does with a\n * single timing function: each pair of frames is eased on its own.\n */\nexport function sample(\n running: RunningAnimation,\n now: number,\n): { values: Record<string, unknown>; finished: boolean } {\n const { spec } = running;\n const elapsed = now - running.start - spec.delay;\n // A null count is `infinite`. Multiplying by it would give 0, which reads as an animation that\n // finished before its first frame - so an infinite animation would paint its last frame once\n // and stop, which is exactly what it did.\n const total = spec.duration * (spec.iterations ?? Infinity);\n const finished = spec.duration <= 0 || (elapsed >= total && total !== Infinity);\n\n // Before the delay is up, an animation shows its first frame only if it fills backwards.\n const waiting = !finished && elapsed < 0;\n if (waiting && spec.fill !== 'backwards' && spec.fill !== 'both') return { values: {}, finished };\n const local = directedProgress(spec, finished, elapsed);\n\n const values: Record<string, unknown> = {};\n for (const [property, track] of running.tracks) {\n values[property] = at(track, local, spec.easing);\n }\n return { values, finished };\n}\n\n/**\n * How far through its frames the animation is, 0 to 1, in the direction its current iteration\n * runs. A finished animation is at the end of its last iteration, not the start of one after it,\n * and a fractional count ends part of the way through that iteration.\n */\nfunction directedProgress(spec: AnimationSpec, finished: boolean, elapsed: number): number {\n const position = finished ? (spec.iterations ?? 1) : Math.max(0, elapsed) / spec.duration;\n const iteration = finished ? Math.max(0, Math.ceil(position) - 1) : Math.floor(position);\n const through = Math.min(1, Math.max(0, position - iteration));\n return backwards(spec.direction, iteration) ? 1 - through : through;\n}\n\n/** Whether this iteration runs from the last frame to the first. */\nfunction backwards(direction: AnimationSpec['direction'], iteration: number): boolean {\n switch (direction) {\n case 'reverse':\n return true;\n case 'alternate':\n return iteration % 2 === 1;\n case 'alternate-reverse':\n return iteration % 2 === 0;\n default:\n return false;\n }\n}\n\n/**\n * One property's value at one keyframe, and the curve a keyframe of its own eases it on to the\n * next one by, where it has one.\n */\nexport interface TrackPoint {\n readonly offset: number;\n readonly value: unknown;\n readonly easing?: readonly number[];\n}\n\nexport function at(\n track: readonly TrackPoint[],\n local: number,\n easing: readonly number[],\n): unknown {\n let index = 0;\n while (index < track.length - 2 && track[index + 1]!.offset <= local) index++;\n\n const from = track[index]!;\n const to = track[index + 1] ?? from;\n const span = to.offset - from.offset;\n const t = span <= 0 ? 1 : (local - from.offset) / span;\n // A keyframe's own timing function eases the stretch it starts, over the animation's.\n return interpolate(\n from.value,\n to.value,\n bezier(from.easing ?? easing, Math.min(1, Math.max(0, t))),\n );\n}\n\n/**\n * The event object Angular reads.\n *\n * A keyframe animation is built with the global `AnimationEvent` when the host has defined one,\n * because Angular tells an animation from a transition with `event instanceof AnimationEvent` and\n * picks which end event to wait for from the answer. A transition is a plain object for the same\n * reason: it must not be one.\n */\nexport function animationEvent(topLevelType: string, target: unknown, name: string): unknown {\n const kind = topLevelType.slice(3).toLowerCase();\n const base = { type: kind, target, stopPropagation: () => {} };\n\n if (!kind.startsWith('animation')) return { ...base, propertyName: name };\n\n const Ctor = (globalThis as { AnimationEvent?: new (type: string) => object }).AnimationEvent;\n const event = Ctor ? new Ctor(kind) : {};\n return Object.assign(event, base, { animationName: name });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"transition.js","sourceRoot":"","sources":["../src/transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU,EAAE;IACxD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,GA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;IACrC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACvD,sFAAsF;IACtF,OAAO,WAAW,CAChB,IAAI,CAAC,KAAK,EACV,EAAE,CAAC,KAAK,EACR,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAC3D,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,YAAoB,EAAE,MAAe,EAAE,IAAY;IAChF,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;IAE/D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,GAAG,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAE1E,MAAM,IAAI,GAAI,UAAgE,CAAC,cAAc,CAAC;IAC9F,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * CSS transitions, the runtime half.\n *\n * React Native has no CSS animation of any kind, so a `transition` in a stylesheet is compiled to\n * a spec and driven here: the engine notices a transitioning property change between commits,\n * holds the old value, and interpolates towards the new one as the clock advances.\n *\n * This runs in JavaScript, unlike `AnimatedStyle`, which can hand a whole animation to the native\n * driver. It has to: a transition is a reaction to the cascade recomputing, and only this side\n * knows a value changed at all. The cost is a commit per frame, which is the same cost a\n * JavaScript-driven `Animated` value has.\n */\n\n/** What the CSS compiler emits per transitioning property. Durations are in milliseconds. */\nexport interface TransitionSpec {\n readonly duration: number;\n readonly delay: number;\n /** The four control points of the timing curve; a keyword is resolved at build time. */\n readonly easing: readonly number[];\n}\n\nexport interface Transition {\n from: unknown;\n to: unknown;\n /** When the interpolation starts, delay already added. */\n start: number;\n duration: number;\n easing: readonly number[];\n /** What the node paints right now. Also the value a redirected transition starts from. */\n current: unknown;\n done: boolean;\n}\n\n/**\n * A cubic bezier's y at a given x, by bisection.\n *\n * Newton-Raphson converges faster and is what browsers use, but it needs a derivative and a\n * fallback for the flat regions of a curve like `ease-in`. Twenty bisection steps land within\n * 1e-6 on any curve, which is finer than a pixel, and the whole thing is eight lines.\n */\nconst curve = (t: number, a: number, b: number): number => {\n const u = 1 - t;\n return 3 * u * u * t * a + 3 * u * t * t * b + t * t * t;\n};\n\n/** A linear curve is both the default and by far the most common, so it skips the search. */\nconst isLinear = (p: readonly number[]): boolean =>\n p[0] === 0 && p[1] === 0 && p[2] === 1 && p[3] === 1;\n\nexport function bezier(points: readonly number[], x: number): number {\n if (x <= 0) return 0;\n if (x >= 1) return 1;\n if (isLinear(points)) return x;\n\n const [x1 = 0, y1 = 0, x2 = 1, y2 = 1] = points;\n let low = 0;\n let high = 1;\n let t = x;\n for (let i = 0; i < 20; i++) {\n t = (low + high) / 2;\n if (curve(t, x1, x2) < x) low = t;\n else high = t;\n }\n return curve(t, y1, y2);\n}\n\nconst HEX = /^#([0-9a-f]{3,8})$/i;\nconst RGB = /^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)(?:[\\s,/]+([\\d.]+))?\\s*\\)$/i;\n\n/** `hsl()` and `hwb()`, with commas or without: a hue, two percentages, and an alpha if any. */\nconst HUED =\n /^(hsla?|hwb)\\(\\s*(-?[\\d.]+)(deg|grad|rad|turn)?[\\s,]+([\\d.]+)%[\\s,]+([\\d.]+)%(?:[\\s,/]+([\\d.]+)(%)?)?\\s*\\)$/i;\n/** How many degrees one of each hue unit is. */\nexport const HUE_DEGREES: Record<string, number> = {\n deg: 1,\n grad: 0.9,\n rad: 180 / Math.PI,\n turn: 360,\n};\n\ntype Channels = [number, number, number];\n\n/** `hsl()`'s hue in degrees and its saturation and lightness as fractions, as sRGB from 0 to 1. */\nexport function hslToSrgb([h, s, l]: Channels): Channels {\n const hue = Number.isFinite(h) ? ((h % 360) + 360) % 360 : 0;\n const f = (n: number) => {\n const k = (n + hue / 30) % 12;\n return l - s * Math.min(l, 1 - l) * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n };\n return [f(0), f(8), f(4)];\n}\n\n/** `hwb()`'s hue in degrees and its whiteness and blackness as fractions, as sRGB from 0 to 1. */\nexport function hwbToSrgb([h, w, b]: Channels): Channels {\n if (w + b >= 1) {\n const grey = w / (w + b);\n return [grey, grey, grey];\n }\n return hslToSrgb([h, 1, 0.5]).map((c) => c * (1 - w - b) + w) as Channels;\n}\n\n/** A colour written as `hsl()` or `hwb()`, as `[r, g, b, a]`. */\nfunction parseHued(value: string): [number, number, number, number] | null {\n const parts = HUED.exec(value);\n if (!parts) return null;\n const [, name, hue, unit = 'deg', first, second, alpha, percent] = parts;\n const convert = name!.toLowerCase() === 'hwb' ? hwbToSrgb : hslToSrgb;\n const [r, g, b] = convert([\n Number(hue) * HUE_DEGREES[unit.toLowerCase()]!,\n Math.min(1, Number(first) / 100),\n Math.min(1, Number(second) / 100),\n ]).map((channel) => Math.round(channel * 255));\n const opacity = alpha === undefined ? 1 : Number(alpha) / (percent ? 100 : 1);\n return [r!, g!, b!, Math.min(1, opacity)];\n}\n\n/**\n * Every CSS named colour, as the `[r, g, b, a]` the compiler's own `namedColor()` in\n * `packages/metro/css/values.cjs` resolves it to - generated from that table rather than typed\n * out by hand, so there is one authority for what a colour name means and this cannot drift from\n * it. The compiler folds a named colour in a stylesheet into `rgb()` at build time, which is why\n * this table matters only for the rarer case: a value that reaches here without ever having been\n * through the compiler, such as a template binding a keyword straight into a style.\n */\nconst NAMED_COLORS: Record<string, [number, number, number, number]> = {\n aliceblue: [240, 248, 255, 1],\n antiquewhite: [250, 235, 215, 1],\n aqua: [0, 255, 255, 1],\n aquamarine: [127, 255, 212, 1],\n azure: [240, 255, 255, 1],\n beige: [245, 245, 220, 1],\n bisque: [255, 228, 196, 1],\n black: [0, 0, 0, 1],\n blanchedalmond: [255, 235, 205, 1],\n blue: [0, 0, 255, 1],\n blueviolet: [138, 43, 226, 1],\n brown: [165, 42, 42, 1],\n burlywood: [222, 184, 135, 1],\n cadetblue: [95, 158, 160, 1],\n chartreuse: [127, 255, 0, 1],\n chocolate: [210, 105, 30, 1],\n coral: [255, 127, 80, 1],\n cornflowerblue: [100, 149, 237, 1],\n cornsilk: [255, 248, 220, 1],\n crimson: [220, 20, 60, 1],\n cyan: [0, 255, 255, 1],\n darkblue: [0, 0, 139, 1],\n darkcyan: [0, 139, 139, 1],\n darkgoldenrod: [184, 134, 11, 1],\n darkgray: [169, 169, 169, 1],\n darkgreen: [0, 100, 0, 1],\n darkgrey: [169, 169, 169, 1],\n darkkhaki: [189, 183, 107, 1],\n darkmagenta: [139, 0, 139, 1],\n darkolivegreen: [85, 107, 47, 1],\n darkorange: [255, 140, 0, 1],\n darkorchid: [153, 50, 204, 1],\n darkred: [139, 0, 0, 1],\n darksalmon: [233, 150, 122, 1],\n darkseagreen: [143, 188, 143, 1],\n darkslateblue: [72, 61, 139, 1],\n darkslategray: [47, 79, 79, 1],\n darkslategrey: [47, 79, 79, 1],\n darkturquoise: [0, 206, 209, 1],\n darkviolet: [148, 0, 211, 1],\n deeppink: [255, 20, 147, 1],\n deepskyblue: [0, 191, 255, 1],\n dimgray: [105, 105, 105, 1],\n dimgrey: [105, 105, 105, 1],\n dodgerblue: [30, 144, 255, 1],\n firebrick: [178, 34, 34, 1],\n floralwhite: [255, 250, 240, 1],\n forestgreen: [34, 139, 34, 1],\n fuchsia: [255, 0, 255, 1],\n gainsboro: [220, 220, 220, 1],\n ghostwhite: [248, 248, 255, 1],\n gold: [255, 215, 0, 1],\n goldenrod: [218, 165, 32, 1],\n gray: [128, 128, 128, 1],\n green: [0, 128, 0, 1],\n greenyellow: [173, 255, 47, 1],\n grey: [128, 128, 128, 1],\n honeydew: [240, 255, 240, 1],\n hotpink: [255, 105, 180, 1],\n indianred: [205, 92, 92, 1],\n indigo: [75, 0, 130, 1],\n ivory: [255, 255, 240, 1],\n khaki: [240, 230, 140, 1],\n lavender: [230, 230, 250, 1],\n lavenderblush: [255, 240, 245, 1],\n lawngreen: [124, 252, 0, 1],\n lemonchiffon: [255, 250, 205, 1],\n lightblue: [173, 216, 230, 1],\n lightcoral: [240, 128, 128, 1],\n lightcyan: [224, 255, 255, 1],\n lightgoldenrodyellow: [250, 250, 210, 1],\n lightgray: [211, 211, 211, 1],\n lightgreen: [144, 238, 144, 1],\n lightgrey: [211, 211, 211, 1],\n lightpink: [255, 182, 193, 1],\n lightsalmon: [255, 160, 122, 1],\n lightseagreen: [32, 178, 170, 1],\n lightskyblue: [135, 206, 250, 1],\n lightslategray: [119, 136, 153, 1],\n lightslategrey: [119, 136, 153, 1],\n lightsteelblue: [176, 196, 222, 1],\n lightyellow: [255, 255, 224, 1],\n lime: [0, 255, 0, 1],\n limegreen: [50, 205, 50, 1],\n linen: [250, 240, 230, 1],\n magenta: [255, 0, 255, 1],\n maroon: [128, 0, 0, 1],\n mediumaquamarine: [102, 205, 170, 1],\n mediumblue: [0, 0, 205, 1],\n mediumorchid: [186, 85, 211, 1],\n mediumpurple: [147, 112, 219, 1],\n mediumseagreen: [60, 179, 113, 1],\n mediumslateblue: [123, 104, 238, 1],\n mediumspringgreen: [0, 250, 154, 1],\n mediumturquoise: [72, 209, 204, 1],\n mediumvioletred: [199, 21, 133, 1],\n midnightblue: [25, 25, 112, 1],\n mintcream: [245, 255, 250, 1],\n mistyrose: [255, 228, 225, 1],\n moccasin: [255, 228, 181, 1],\n navajowhite: [255, 222, 173, 1],\n navy: [0, 0, 128, 1],\n oldlace: [253, 245, 230, 1],\n olive: [128, 128, 0, 1],\n olivedrab: [107, 142, 35, 1],\n orange: [255, 165, 0, 1],\n orangered: [255, 69, 0, 1],\n orchid: [218, 112, 214, 1],\n palegoldenrod: [238, 232, 170, 1],\n palegreen: [152, 251, 152, 1],\n paleturquoise: [175, 238, 238, 1],\n palevioletred: [219, 112, 147, 1],\n papayawhip: [255, 239, 213, 1],\n peachpuff: [255, 218, 185, 1],\n peru: [205, 133, 63, 1],\n pink: [255, 192, 203, 1],\n plum: [221, 160, 221, 1],\n powderblue: [176, 224, 230, 1],\n purple: [128, 0, 128, 1],\n rebeccapurple: [102, 51, 153, 1],\n red: [255, 0, 0, 1],\n rosybrown: [188, 143, 143, 1],\n royalblue: [65, 105, 225, 1],\n saddlebrown: [139, 69, 19, 1],\n salmon: [250, 128, 114, 1],\n sandybrown: [244, 164, 96, 1],\n seagreen: [46, 139, 87, 1],\n seashell: [255, 245, 238, 1],\n sienna: [160, 82, 45, 1],\n silver: [192, 192, 192, 1],\n skyblue: [135, 206, 235, 1],\n slateblue: [106, 90, 205, 1],\n slategray: [112, 128, 144, 1],\n slategrey: [112, 128, 144, 1],\n snow: [255, 250, 250, 1],\n springgreen: [0, 255, 127, 1],\n steelblue: [70, 130, 180, 1],\n tan: [210, 180, 140, 1],\n teal: [0, 128, 128, 1],\n thistle: [216, 191, 216, 1],\n tomato: [255, 99, 71, 1],\n transparent: [0, 0, 0, 0],\n turquoise: [64, 224, 208, 1],\n violet: [238, 130, 238, 1],\n wheat: [245, 222, 179, 1],\n white: [255, 255, 255, 1],\n whitesmoke: [245, 245, 245, 1],\n yellow: [255, 255, 0, 1],\n yellowgreen: [154, 205, 50, 1],\n};\n\n/** A colour as `[r, g, b, a]`, or null for a form not worth parsing. */\nexport function parseColor(value: unknown): [number, number, number, number] | null {\n if (typeof value !== 'string') return null;\n\n const rgb = RGB.exec(value);\n if (rgb) {\n return [\n Number(rgb[1]),\n Number(rgb[2]),\n Number(rgb[3]),\n rgb[4] === undefined ? 1 : Number(rgb[4]),\n ];\n }\n\n const hex = HEX.exec(value);\n if (hex) {\n const digits = hex[1]!;\n const short = digits.length <= 4;\n const part = (i: number): number => {\n const at = short ? digits.slice(i, i + 1).repeat(2) : digits.slice(i * 2, i * 2 + 2);\n return parseInt(at, 16);\n };\n const alpha = digits.length === 4 || digits.length === 8 ? part(3) / 255 : 1;\n return [part(0), part(1), part(2), alpha];\n }\n\n const named = NAMED_COLORS[value.toLowerCase()];\n return named ? [...named] : parseHued(value);\n}\n\n/** Whether a word is a CSS colour name, such as `red` or `transparent`. */\nexport function isNamedColor(value: string): boolean {\n return Object.hasOwn(NAMED_COLORS, value.toLowerCase());\n}\n\n/** A transform operation at rest, so a missing transform can be animated from rather than jumped. */\nconst IDENTITY: Record<string, number | string> = {\n translateX: 0,\n translateY: 0,\n scale: 1,\n scaleX: 1,\n scaleY: 1,\n rotate: '0deg',\n rotateX: '0deg',\n rotateY: '0deg',\n rotateZ: '0deg',\n skewX: '0deg',\n skewY: '0deg',\n};\n\n/**\n * A number with a unit on it, inside a transform operation.\n *\n * Angles were the only unit this matched, which quietly made every other one step instead of\n * move: a sheet sliding in with `translateY(100%)` sat at 100% for its whole duration and then\n * arrived, which on a phone reads as an animation that does not run at all. Percentages are the\n * ones that matter - they are how a transform says \"my own size\" without knowing what that is -\n * and lengths cost nothing extra now the shape is the same.\n */\nconst UNIT = /^(-?\\d*\\.?\\d+)(deg|rad|grad|turn|%|px|pt|em|rem)$/;\n\n/** One operation's value: a number, or a number keeping whatever unit it was written in. */\nexport function tween(from: unknown, to: unknown, t: number): unknown {\n if (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n if (typeof from !== 'string' || typeof to !== 'string') return null;\n\n const a = UNIT.exec(from);\n const b = UNIT.exec(to);\n // Matching units only. Converting between them needs a table, and for the pairs anybody\n // actually writes - `0deg` to `1turn`, `0%` to `10px` - the answer would be a guess.\n if (!a || !b || a[2] !== b[2]) return null;\n\n const value = Number(a[1]) + (Number(b[1]) - Number(a[1])) * t;\n return `${Math.round(value * 1000) / 1000}${a[2]}`;\n}\n\n/** The same operations, each at rest: what CSS's `none` means beside a list that has values. */\nfunction atRest(shape: readonly unknown[]): unknown[] {\n return shape.map((entry) => {\n const name = operation(entry);\n if (name === null || !(name in IDENTITY)) return entry;\n // At rest in the unit it is written in, so it can be eased toward: `-25%` from `0%`, and\n // `1turn` from `0turn`. A bare 0 beside a percentage is a pair `tween` cannot blend.\n const written = (entry as Record<string, unknown>)[name];\n const unit = typeof written === 'string' ? UNIT.exec(written)?.[2] : undefined;\n return { [name]: unit ? `0${unit}` : IDENTITY[name] };\n });\n}\n\n/** A transform list with something in it; `none` is an empty one, and means the same as none. */\nconst hasOperations = (value: unknown): value is readonly unknown[] =>\n Array.isArray(value) && value.length > 0;\n\n/** The name of a single-key transform operation, or null for anything else. */\nfunction operation(entry: unknown): string | null {\n if (typeof entry !== 'object' || entry === null) return null;\n const keys = Object.keys(entry);\n return keys.length === 1 ? keys[0]! : null;\n}\n\n/**\n * Two transform lists blended operation by operation.\n *\n * Matched by position *and* name: blending a translate into a scale would mean decomposing a\n * matrix, which is a great deal of arithmetic for a case an author can always write out. Anything\n * that does not line up returns null and steps instead, which is what CSS falls back to.\n *\n * A missing side is the ordinary case rather than the exception - `.slider` to\n * `.slider-end { transform: translateX(180px) }`, and the same again when the class comes off -\n * so whichever side is absent is read as each operation at rest, which is CSS's `none`.\n */\nfunction interpolateTransform(from: unknown, to: unknown, t: number): unknown[] | null {\n const shape = hasOperations(to) ? to : hasOperations(from) ? from : null;\n if (!shape) return null;\n\n const start = hasOperations(from) ? from : atRest(shape);\n const end = hasOperations(to) ? to : atRest(shape);\n if (start.length !== end.length) return null;\n\n const out: unknown[] = [];\n for (let i = 0; i < end.length; i++) {\n const name = operation(end[i]);\n if (name === null || name !== operation(start[i])) return null;\n const value = tween(\n (start[i] as Record<string, unknown>)[name],\n (end[i] as Record<string, unknown>)[name],\n t,\n );\n if (value === null) return null;\n out.push({ [name]: value });\n }\n return out;\n}\n\n/**\n * One step between two values.\n *\n * Numbers, colours and transforms interpolate. Everything else steps to the new value at the end,\n * which is what CSS does for a property it calls discrete, and is right for the keywords and\n * strings that make up most of the rest.\n */\nexport function interpolate(from: unknown, to: unknown, t: number): unknown {\n if (typeof from === 'number' && typeof to === 'number') return from + (to - from) * t;\n\n const a = parseColor(from);\n const b = parseColor(to);\n if (a && b) {\n const mix = (i: number): number => Math.round(a[i]! + (b[i]! - a[i]!) * t);\n const alpha = Math.round((a[3] + (b[3] - a[3]) * t) * 1000) / 1000;\n return `rgba(${mix(0)}, ${mix(1)}, ${mix(2)}, ${alpha})`;\n }\n\n const percent = interpolatePercentage(from, to, t);\n if (percent !== null) return percent;\n\n const transform = interpolateTransform(from, to, t);\n if (transform) return transform;\n\n return t >= 1 ? to : from;\n}\n\n/** `50%` -> `75%`. Both sides have to be percentages; a percentage and a length are not a scale. */\nconst PERCENTAGE = /^(-?[\\d.]+)%$/;\n\nfunction interpolatePercentage(from: unknown, to: unknown, t: number): string | null {\n if (typeof from !== 'string' || typeof to !== 'string') return null;\n const a = PERCENTAGE.exec(from);\n const b = PERCENTAGE.exec(to);\n if (!a || !b) return null;\n const value = Number(a[1]) + (Number(b[1]) - Number(a[1])) * t;\n return `${Math.round(value * 1000) / 1000}%`;\n}\n\n/**\n * Bring one property up to date, and say whether that started a transition.\n *\n * Mutates `props[key]` to what should be painted now, which for a transition in flight is the\n * value it has reached rather than the one it is heading for.\n */\nexport function step(\n state: Map<string, Transition>,\n key: string,\n props: Record<string, unknown>,\n rule: TransitionSpec | undefined,\n now: number,\n): boolean {\n if (!rule || rule.duration <= 0) {\n // No longer transitioning: forget it, so re-adding the rule later starts fresh.\n state.delete(key);\n return false;\n }\n\n const seen = state.get(key);\n if (seen === undefined) {\n // First sight of the property. CSS does not animate one of these either; without the rule\n // every element would animate in from whatever the previous value happened to be.\n state.set(key, settled(props[key], rule));\n return false;\n }\n\n // Nothing to interpolate when one end is missing: `null` here is `auto`, or a property the\n // element no longer sets at all, and there is no value halfway between a number and \"whatever\n // this works out to be\". CSS refuses the same transition. Interpolating anyway held the old\n // value for the whole duration, which is how a section that opened to a height nothing had\n // measured stayed shut - and clearing a height is also what stops the layout that would have\n // corrected it, so it stayed shut rather than catching up a frame later.\n //\n // The same goes for a pair with nothing between them at all, a keyword such as `display` or\n // `flex-direction`: CSS changes it at once rather than transitioning it, and `transition: all`\n // covers it. Holding the old one for the duration kept a `display: none` on screen until the\n // end and then made it vanish.\n const started = !Object.is(seen.to, props[key]);\n if (started && !interpolable(seen.current, props[key])) {\n state.set(key, settled(props[key], rule));\n return false;\n }\n if (started) redirect(seen, props[key], rule, now);\n if (!seen.done) props[key] = seen.current;\n return started;\n}\n\n/**\n * Whether there is a pair here to interpolate at all: two numbers, two colours, two percentages,\n * or two transform lists of the same shape.\n *\n * A transform is the one thing that animates from nothing, because \"no transform\" has a value -\n * the identity - and `interpolateTransform` starts there. Everything else needs both ends.\n */\nfunction interpolable(from: unknown, to: unknown): boolean {\n if (typeof from === 'number' && typeof to === 'number') return true;\n if (parseColor(from) !== null && parseColor(to) !== null) return true;\n if (interpolatePercentage(from, to, 0) !== null) return true;\n return interpolateTransform(from, to, 0) !== null;\n}\n\n/** A property seen for the first time: recorded so the next change has something to aim from. */\nexport function settled(value: unknown, rule: TransitionSpec): Transition {\n return {\n from: value,\n to: value,\n start: 0,\n duration: 0,\n easing: rule.easing,\n current: value,\n done: true,\n };\n}\n\n/** Aim an existing transition at a new value, starting from wherever it had got to. */\nexport function redirect(\n transition: Transition,\n target: unknown,\n rule: TransitionSpec,\n now: number,\n): void {\n transition.from = transition.current;\n transition.to = target;\n transition.start = now + rule.delay;\n transition.duration = rule.duration;\n transition.easing = rule.easing;\n transition.done = false;\n}\n\n/** What the CSS compiler emits for `animation:`. Times are milliseconds. */\nexport interface AnimationSpec {\n readonly name: string;\n readonly duration: number;\n readonly delay: number;\n readonly easing: readonly number[];\n /** `Infinity` for `infinite`. */\n /** `null` is `infinite`, which is what survives being written into the bundle as JSON. */\n readonly iterations: number | null;\n readonly fill: 'none' | 'forwards' | 'backwards' | 'both';\n /** Which way each iteration plays; absent is `normal`, forwards every time. */\n readonly direction?: 'reverse' | 'alternate' | 'alternate-reverse';\n /**\n * `animation-timeline: scroll()`: played by the nearest scroll view's offset along this axis\n * rather than by the clock. See `scroll-animation.ts`.\n */\n readonly timeline?: 'x' | 'y';\n /** `animation-play-state: paused`: held at the frame it has reached, until it runs again. */\n readonly paused?: boolean;\n /**\n * Where along the scroll it plays, in points or as a percentage of how far the view scrolls.\n * An end left out is the scroll's own: 0, or all the way.\n */\n readonly range?: { readonly start?: number | string; readonly end?: number | string };\n}\n\n/** One `@keyframes` frame: where it sits, and what it sets there. */\nexport interface Keyframe {\n readonly offset: number;\n readonly declarations: Record<string, unknown>;\n /** The `animation-timing-function` written in this keyframe, easing it to the next. */\n readonly easing?: readonly number[];\n}\n\nexport interface RunningAnimation {\n spec: AnimationSpec;\n /** When it was paused, while it is; the clock it is sampled at stands still there. */\n pausedAt?: number;\n /**\n * Per property, the offsets that mention it, in order. Built when the animation starts, and again\n * when the colour a frame's `color: currentColor` stands for changes.\n */\n tracks: Map<string, TrackPoint[]>;\n /** The colour the node inherits, which the tracks were built with, for frames that read it. */\n inherited?: unknown;\n start: number;\n /** What the properties read right now. Empty once a finished animation stops filling. */\n values: Record<string, unknown>;\n done: boolean;\n /**\n * Set while native plays it, with no frame of it in JavaScript: what stops it there. `values`\n * is then the frame it started at, which is what the view is committed with.\n */\n native?: { stop(): void };\n}\n\n/**\n * Build one track per property the frames touch.\n *\n * A property that no frame sets at 0% or 100% is anchored to the value the element would\n * otherwise have, which is what CSS means by an implicit keyframe: `to { opacity: 1 }` alone\n * animates from wherever the element already was. A frame's `color: currentColor` is `inherited`,\n * the colour the element inherits.\n */\nexport function tracksOf(\n frames: readonly Keyframe[],\n resting: Record<string, unknown>,\n inherited?: unknown,\n): Map<string, TrackPoint[]> {\n const tracks = new Map<string, TrackPoint[]>();\n\n for (const frame of frames) {\n for (const property of Object.keys(frame.declarations)) {\n const track = tracks.get(property) ?? [];\n const written = frame.declarations[property];\n const value = isCurrentColour(written) ? inherited : written;\n const point = { offset: frame.offset, value };\n track.push(frame.easing ? { ...point, easing: frame.easing } : point);\n tracks.set(property, track);\n }\n }\n\n for (const [property, track] of tracks) {\n const anchor = resting[property] ?? INITIAL[property];\n if (track[0]!.offset > 0) track.unshift({ offset: 0, value: anchor });\n if (track[track.length - 1]!.offset < 1) {\n track.push({ offset: 1, value: anchor });\n }\n }\n return tracks;\n}\n\n/**\n * Whether any frame sets `color: currentColor`, which is the colour the element inherits and so\n * differs from one element to the next. Kept per set of frames, as it is asked on every frame.\n */\nexport function readsInheritedColour(frames: readonly Keyframe[]): boolean {\n let answer = READS_INHERITED.get(frames);\n if (answer === undefined) {\n answer = frames.some((frame) => isCurrentColour(frame.declarations['color']));\n READS_INHERITED.set(frames, answer);\n }\n return answer;\n}\nconst READS_INHERITED = new WeakMap<readonly Keyframe[], boolean>();\n\n/** The marker the compiler writes for `currentColor`. */\nconst isCurrentColour = (value: unknown): boolean =>\n (value as { __colour?: { color?: unknown } } | null)?.__colour?.color === 'currentcolor';\n\n/**\n * What a property is worth when the element has not said.\n *\n * CSS anchors an implicit keyframe to the element's *computed* value, and a property nobody wrote\n * still has one - `opacity` is 1, not nothing. Anchoring to nothing instead leaves a frame with no\n * value to interpolate towards, so the animation holds its first value and jumps at the end.\n *\n * That is what `animate-pulse` was doing. It is a single frame, `50% { opacity: 0.5 }`, on a\n * skeleton that declares no opacity of its own - so both of its implicit frames were empty and the\n * pulse did not fade, in every skeleton in the library.\n *\n * Only the properties that appear in an animation and have a meaningful resting value. A length\n * defaulting to zero is the same as absent for anything here, and a colour has no initial worth\n * animating from.\n */\nconst INITIAL: Record<string, unknown> = {\n opacity: 1,\n scale: 1,\n rotate: '0deg',\n};\n\n/**\n * Where an animation has got to, as the properties to paint.\n *\n * The easing runs per segment rather than across the whole pass, which is what CSS does with a\n * single timing function: each pair of frames is eased on its own.\n */\nexport function sample(\n running: RunningAnimation,\n now: number,\n): { values: Record<string, unknown>; finished: boolean } {\n const { spec } = running;\n const elapsed = now - running.start - spec.delay;\n // A null count is `infinite`. Multiplying by it would give 0, which reads as an animation that\n // finished before its first frame - so an infinite animation would paint its last frame once\n // and stop, which is exactly what it did.\n const total = spec.duration * (spec.iterations ?? Infinity);\n const finished = spec.duration <= 0 || (elapsed >= total && total !== Infinity);\n\n // Before the delay is up, an animation shows its first frame only if it fills backwards.\n const waiting = !finished && elapsed < 0;\n if (waiting && spec.fill !== 'backwards' && spec.fill !== 'both') return { values: {}, finished };\n const local = directedProgress(spec, finished, elapsed);\n\n const values: Record<string, unknown> = {};\n for (const [property, track] of running.tracks) {\n values[property] = at(track, local, spec.easing);\n }\n return { values, finished };\n}\n\n/**\n * How far through its frames the animation is, 0 to 1, in the direction its current iteration\n * runs. A finished animation is at the end of its last iteration, not the start of one after it,\n * and a fractional count ends part of the way through that iteration.\n */\nfunction directedProgress(spec: AnimationSpec, finished: boolean, elapsed: number): number {\n const position = finished ? (spec.iterations ?? 1) : Math.max(0, elapsed) / spec.duration;\n const iteration = finished ? Math.max(0, Math.ceil(position) - 1) : Math.floor(position);\n const through = Math.min(1, Math.max(0, position - iteration));\n return backwards(spec.direction, iteration) ? 1 - through : through;\n}\n\n/** Whether this iteration runs from the last frame to the first. */\nfunction backwards(direction: AnimationSpec['direction'], iteration: number): boolean {\n switch (direction) {\n case 'reverse':\n return true;\n case 'alternate':\n return iteration % 2 === 1;\n case 'alternate-reverse':\n return iteration % 2 === 0;\n default:\n return false;\n }\n}\n\n/**\n * One property's value at one keyframe, and the curve a keyframe of its own eases it on to the\n * next one by, where it has one.\n */\nexport interface TrackPoint {\n readonly offset: number;\n readonly value: unknown;\n readonly easing?: readonly number[];\n}\n\nexport function at(\n track: readonly TrackPoint[],\n local: number,\n easing: readonly number[],\n): unknown {\n let index = 0;\n while (index < track.length - 2 && track[index + 1]!.offset <= local) index++;\n\n const from = track[index]!;\n const to = track[index + 1] ?? from;\n const span = to.offset - from.offset;\n const t = span <= 0 ? 1 : (local - from.offset) / span;\n // A keyframe's own timing function eases the stretch it starts, over the animation's.\n return interpolate(\n from.value,\n to.value,\n bezier(from.easing ?? easing, Math.min(1, Math.max(0, t))),\n );\n}\n\n/**\n * The event object Angular reads.\n *\n * A keyframe animation is built with the global `AnimationEvent` when the host has defined one,\n * because Angular tells an animation from a transition with `event instanceof AnimationEvent` and\n * picks which end event to wait for from the answer. A transition is a plain object for the same\n * reason: it must not be one.\n */\nexport function animationEvent(topLevelType: string, target: unknown, name: string): unknown {\n const kind = topLevelType.slice(3).toLowerCase();\n const base = { type: kind, target, stopPropagation: () => {} };\n\n if (!kind.startsWith('animation')) return { ...base, propertyName: name };\n\n const Ctor = (globalThis as { AnimationEvent?: new (type: string) => object }).AnimationEvent;\n const event = Ctor ? new Ctor(kind) : {};\n return Object.assign(event, base, { animationName: name });\n}\n"]}
|
package/package.json
CHANGED