@pixerate/editor 0.57.0 → 0.59.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/animation/index.cjs +23 -3
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +3 -2
- package/dist/animation/index.d.ts +3 -2
- package/dist/animation/index.js +23 -3
- package/dist/animation-editor/index.cjs +836 -158
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +454 -40
- package/dist/animation-editor/index.d.ts +454 -40
- package/dist/animation-editor/index.js +790 -112
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/behavior-Ymbld6jL.d.cts +60 -0
- package/dist/behavior-Ymbld6jL.d.ts +60 -0
- package/dist/canvas/index.cjs +35 -29
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +4 -4
- package/dist/canvas/index.d.ts +4 -4
- package/dist/canvas/index.js +9 -3
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-O4ONBPZW.cjs → chunk-2FGRTYJN.cjs} +4 -4
- package/dist/{chunk-O4ONBPZW.cjs.map → chunk-2FGRTYJN.cjs.map} +1 -1
- package/dist/{chunk-XZ4L3R4K.cjs → chunk-2FHLHZAL.cjs} +39 -3
- package/dist/chunk-2FHLHZAL.cjs.map +1 -0
- package/dist/chunk-3NYXDBBW.js +122 -0
- package/dist/chunk-3NYXDBBW.js.map +1 -0
- package/dist/{chunk-NONDTTH7.js → chunk-3TLL5OID.js} +17 -2
- package/dist/{chunk-NONDTTH7.js.map → chunk-3TLL5OID.js.map} +1 -1
- package/dist/{chunk-UB2OY7FD.js → chunk-AGR4P4UZ.js} +38 -2
- package/dist/chunk-AGR4P4UZ.js.map +1 -0
- package/dist/{chunk-SHOVAHUB.js → chunk-JK6M6V7G.js} +2 -2
- package/dist/{chunk-XCXQDPID.cjs → chunk-YJLCBA7V.cjs} +25 -10
- package/dist/chunk-YJLCBA7V.cjs.map +1 -0
- package/dist/chunk-ZCNLBRT6.cjs +122 -0
- package/dist/chunk-ZCNLBRT6.cjs.map +1 -0
- package/dist/{easing-CNGk-W6d.d.ts → easing-lM0Xo9Ni.d.cts} +14 -2
- package/dist/{easing-CNGk-W6d.d.cts → easing-lM0Xo9Ni.d.ts} +14 -2
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/parameters/index.js +1 -1
- package/dist/{player-W-5DX3Go.d.ts → player-DV4Jujdq.d.ts} +1 -1
- package/dist/{player-Dg0FT0UI.d.cts → player-DrcP2xqj.d.cts} +1 -1
- package/dist/{svg-CPK82TtU.d.ts → svg-Dh17jCyA.d.ts} +22 -1
- package/dist/{svg-CLg2zqZA.d.cts → svg-ymShkNtu.d.cts} +22 -1
- package/dist/vector/index.cjs +472 -472
- package/dist/vector/index.d.cts +3 -3
- package/dist/vector/index.d.ts +3 -3
- package/dist/vector/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-UB2OY7FD.js.map +0 -1
- package/dist/chunk-XCXQDPID.cjs.map +0 -1
- package/dist/chunk-XZ4L3R4K.cjs.map +0 -1
- /package/dist/{chunk-SHOVAHUB.js.map → chunk-JK6M6V7G.js.map} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/animation/behavior.ts
|
|
2
|
+
var MOTION_BEHAVIORS = ["pulse", "oscillate", "wriggle", "overshoot"];
|
|
3
|
+
var WRIGGLE_EDGE = 0.15;
|
|
4
|
+
function wave(kind, angle) {
|
|
5
|
+
switch (kind) {
|
|
6
|
+
case "square":
|
|
7
|
+
return Math.sin(angle) >= 0 ? 1 : -1;
|
|
8
|
+
case "triangle":
|
|
9
|
+
return 2 / Math.PI * Math.asin(Math.sin(angle));
|
|
10
|
+
case "sawtooth": {
|
|
11
|
+
const norm = angle / (2 * Math.PI) % 1;
|
|
12
|
+
return 2 * (norm < 0 ? norm + 1 : norm) - 1;
|
|
13
|
+
}
|
|
14
|
+
default:
|
|
15
|
+
return Math.sin(angle);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function behaviorProgress(behavior, t, index = 0, ms = 800) {
|
|
19
|
+
const time = Math.max(0, t);
|
|
20
|
+
switch (behavior.type) {
|
|
21
|
+
case "pulse":
|
|
22
|
+
return 0.5 + 0.5 * Math.sin(2 * Math.PI * (_nullishCoalesce(behavior.count, () => ( 1))) * time - Math.PI / 2);
|
|
23
|
+
case "oscillate": {
|
|
24
|
+
const w = wave(behavior.wave, 2 * Math.PI * (_nullishCoalesce(behavior.count, () => ( 1))) * time);
|
|
25
|
+
const decay = _nullishCoalesce(behavior.decay, () => ( 0));
|
|
26
|
+
return decay > 0 ? w * Math.max(0, 1 - t) ** decay : w;
|
|
27
|
+
}
|
|
28
|
+
case "wriggle": {
|
|
29
|
+
const edge = quinticFade(Math.min(1, Math.max(0, Math.min(t, 1 - t) / WRIGGLE_EDGE)));
|
|
30
|
+
if (edge === 0) return 0;
|
|
31
|
+
return edge * fractalWiggle(_nullishCoalesce(behavior.frequency, () => ( 2)), 1, _nullishCoalesce(behavior.octaves, () => ( 2)), 0.5, t * ms / 1e3, _nullishCoalesce(behavior.seed, () => ( 42)), index);
|
|
32
|
+
}
|
|
33
|
+
case "overshoot": {
|
|
34
|
+
const p = Math.min(1, time);
|
|
35
|
+
if (p >= 1) return 1;
|
|
36
|
+
return 1 - Math.exp(-(_nullishCoalesce(behavior.damping, () => ( 4))) * p) * Math.cos((_nullishCoalesce(behavior.cycles, () => ( 3))) * Math.PI * p);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function isMotionBehavior(value) {
|
|
41
|
+
if (typeof value !== "object" || value === null) return false;
|
|
42
|
+
const b = value;
|
|
43
|
+
const positive = (k) => b[k] === void 0 || typeof b[k] === "number" && Number.isFinite(b[k]) && b[k] > 0;
|
|
44
|
+
const atLeastZero = (k) => b[k] === void 0 || typeof b[k] === "number" && Number.isFinite(b[k]) && b[k] >= 0;
|
|
45
|
+
switch (b.type) {
|
|
46
|
+
case "pulse":
|
|
47
|
+
return positive("count");
|
|
48
|
+
case "oscillate":
|
|
49
|
+
return positive("count") && atLeastZero("decay") && (b.wave === void 0 || ["sine", "triangle", "square", "sawtooth"].includes(b.wave));
|
|
50
|
+
case "wriggle":
|
|
51
|
+
return positive("frequency") && positive("octaves") && (b.seed === void 0 || Number.isInteger(b.seed));
|
|
52
|
+
case "overshoot":
|
|
53
|
+
return positive("cycles") && atLeastZero("damping");
|
|
54
|
+
default:
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function motionSeedFromId(id) {
|
|
59
|
+
let h = 2166136261;
|
|
60
|
+
for (let i = 0; i < id.length; i++) h = Math.imul(h ^ id.charCodeAt(i), 16777619);
|
|
61
|
+
return (h >>> 0) % 2147483647 || 1;
|
|
62
|
+
}
|
|
63
|
+
var GOLDEN_GAMMA = 0x9e3779b97f4a7c15n;
|
|
64
|
+
var MULT1 = 0xbf58476d1ce4e5b9n;
|
|
65
|
+
var MULT2 = 0x94d049bb133111ebn;
|
|
66
|
+
var MASK64 = 0xffffffffffffffffn;
|
|
67
|
+
var BASE_MIX = 0x2545f4914f6cdd1dn;
|
|
68
|
+
var POW2_53 = 9007199254740992;
|
|
69
|
+
function hash64(x) {
|
|
70
|
+
let v = x + GOLDEN_GAMMA & MASK64;
|
|
71
|
+
v = (v ^ v >> 30n) * MULT1 & MASK64;
|
|
72
|
+
v = (v ^ v >> 27n) * MULT2 & MASK64;
|
|
73
|
+
return (v ^ v >> 31n) & MASK64;
|
|
74
|
+
}
|
|
75
|
+
function mixSeeds(parts) {
|
|
76
|
+
let h = BASE_MIX;
|
|
77
|
+
for (const p of parts) {
|
|
78
|
+
const val = typeof p === "bigint" ? p : BigInt(Math.floor(p));
|
|
79
|
+
h = hash64(h ^ hash64(val & MASK64));
|
|
80
|
+
}
|
|
81
|
+
return h;
|
|
82
|
+
}
|
|
83
|
+
function unitFloat(seed) {
|
|
84
|
+
return Number(hash64(seed) >> 11n) / POW2_53;
|
|
85
|
+
}
|
|
86
|
+
function quinticFade(t) {
|
|
87
|
+
return t * t * t * (t * (t * 6 - 15) + 10);
|
|
88
|
+
}
|
|
89
|
+
function noise1d(seed, x) {
|
|
90
|
+
if (!Number.isFinite(x)) return 0;
|
|
91
|
+
const floorX = Math.floor(x);
|
|
92
|
+
const u = quinticFade(x - floorX);
|
|
93
|
+
const i = BigInt(floorX);
|
|
94
|
+
const a = unitFloat(seed ^ hash64(i & MASK64)) * 2 - 1;
|
|
95
|
+
const b = unitFloat(seed ^ hash64(i + 1n & MASK64)) * 2 - 1;
|
|
96
|
+
return a + (b - a) * u;
|
|
97
|
+
}
|
|
98
|
+
function fractalWiggle(freq, amp, octaves = 3, ampMult = 0.5, t = 0, seed = 42, dimension = 0) {
|
|
99
|
+
const oct = Math.max(1, Math.min(16, Math.floor(octaves)));
|
|
100
|
+
let currentAmp = amp;
|
|
101
|
+
let currentFreq = freq;
|
|
102
|
+
let sum = 0;
|
|
103
|
+
const baseSeed = BigInt(Math.floor(seed));
|
|
104
|
+
for (let k = 0; k < oct; k++) {
|
|
105
|
+
const s = mixSeeds([baseSeed, BigInt(dimension), BigInt(k)]);
|
|
106
|
+
const phaseOffset = unitFloat(s) * 1e3;
|
|
107
|
+
sum += currentAmp * noise1d(s, currentFreq * t + phaseOffset);
|
|
108
|
+
currentAmp *= ampMult;
|
|
109
|
+
currentFreq *= 2;
|
|
110
|
+
}
|
|
111
|
+
return sum;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
exports.MOTION_BEHAVIORS = MOTION_BEHAVIORS; exports.behaviorProgress = behaviorProgress; exports.isMotionBehavior = isMotionBehavior; exports.motionSeedFromId = motionSeedFromId; exports.quinticFade = quinticFade; exports.fractalWiggle = fractalWiggle;
|
|
122
|
+
//# sourceMappingURL=chunk-ZCNLBRT6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-ZCNLBRT6.cjs","../src/animation/behavior.ts"],"names":[],"mappings":"AAAA;AC8BO,IAAM,iBAAA,EAAmB,CAAC,OAAA,EAAS,WAAA,EAAa,SAAA,EAAW,WAAW,CAAA;AAG7E,IAAM,aAAA,EAAe,IAAA;AAErB,SAAS,IAAA,CAAK,IAAA,EAA+D,KAAA,EAAuB;AACnG,EAAA,OAAA,CAAQ,IAAA,EAAM;AAAA,IACb,KAAK,QAAA;AACJ,MAAA,OAAO,IAAA,CAAK,GAAA,CAAI,KAAK,EAAA,GAAK,EAAA,EAAI,EAAA,EAAI,CAAA,CAAA;AAAA,IACnC,KAAK,UAAA;AACJ,MAAA,OAAQ,EAAA,EAAI,IAAA,CAAK,GAAA,EAAM,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,KAAK,CAAC,CAAA;AAAA,IACjD,KAAK,UAAA,EAAY;AAChB,MAAA,MAAM,KAAA,EAAQ,MAAA,EAAA,CAAS,EAAA,EAAI,IAAA,CAAK,EAAA,EAAA,EAAO,CAAA;AACvC,MAAA,OAAO,EAAA,EAAA,CAAK,KAAA,EAAO,EAAA,EAAI,KAAA,EAAO,EAAA,EAAI,IAAA,EAAA,EAAQ,CAAA;AAAA,IAC3C;AAAA,IACA,OAAA;AACC,MAAA,OAAO,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA;AAAA,EACvB;AACD;AAMO,SAAS,gBAAA,CAAiB,QAAA,EAA0B,CAAA,EAAW,MAAA,EAAQ,CAAA,EAAG,GAAA,EAAK,GAAA,EAAa;AAClG,EAAA,MAAM,KAAA,EAAO,IAAA,CAAK,GA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O,WAAA,EAAa,OAAA,CAAQ,CAAA,EAAG,YAAA,EAAc,EAAA,EAAI,WAAW,CAAA;AAC5D,IAAA,WAAA,GAAc,OAAA;AACd,IAAA,YAAA,GAAe,CAAA;AAAA,EAChB;AACA,EAAA,OAAO,GAAA;AACR;ADvDA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,6PAAC","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-ZCNLBRT6.cjs","sourcesContent":[null,"/**\n * Behaviours: how a change gets from `from` to `to` other than straight along its ease (a\n * pulse there and back, an oscillation, a seeded wriggle, a springy overshoot). Ported from\n * `@pixerate/flair` (MIT): `SvgBehavior` and `behaviorProgress` in `vector/motion.ts`, the\n * oscillate and overshoot evaluators in `scene/behavior.ts` and the noise in `time/noise.ts`.\n * The numbers must stay identical to Flair's, so a behaviour exported to Flair plays the same\n * frames there as here (the animation editor writes them as Flair `behavior`s, Flair ≥ 0.38).\n */\n\n/**\n * A behaviour: its progress `u` at each moment, where 0 is `from`, 1 is `to`, and numbers go\n * past either. `t` is the change's time, 0–1, through its ease (linear unless given).\n *\n * - `pulse`: there and back `count` times (default 1): u = sin²(π·count·t).\n * - `oscillate`: swings round `from`, out to `to` and as far the other way, `count` times\n * (default 1), dying away by (1 − t)^`decay` (default 0, no decay).\n * - `wriggle`: wanders round `from` by up to about `to − from`, as seeded smooth fractal noise\n * at `frequency` Hz (default 2) with `octaves` layers (default 2); each number in a value\n * wanders on its own channel. It eases out of and back to rest over the first and last 15%\n * of its time. The same `seed` (default 42) gives the same wander.\n * - `overshoot`: goes to `to`, past it and back, settling like a spring:\n * u = 1 − e^(−damping·t)·cos(cycles·π·t) (default 3 cycles, damping 4).\n */\nexport type MotionBehavior =\n\t| { type: 'pulse'; count?: number }\n\t| { type: 'oscillate'; count?: number; decay?: number; wave?: 'sine' | 'triangle' | 'square' | 'sawtooth' }\n\t| { type: 'wriggle'; frequency?: number; octaves?: number; seed?: number }\n\t| { type: 'overshoot'; cycles?: number; damping?: number };\n\n/** Every `MotionBehavior` type. */\nexport const MOTION_BEHAVIORS = ['pulse', 'oscillate', 'wriggle', 'overshoot'] as const;\n\n/** Share of a wriggle's time spent easing out of and back to rest, at each end. */\nconst WRIGGLE_EDGE = 0.15;\n\nfunction wave(kind: 'sine' | 'triangle' | 'square' | 'sawtooth' | undefined, angle: number): number {\n\tswitch (kind) {\n\t\tcase 'square':\n\t\t\treturn Math.sin(angle) >= 0 ? 1 : -1;\n\t\tcase 'triangle':\n\t\t\treturn (2 / Math.PI) * Math.asin(Math.sin(angle));\n\t\tcase 'sawtooth': {\n\t\t\tconst norm = (angle / (2 * Math.PI)) % 1;\n\t\t\treturn 2 * (norm < 0 ? norm + 1 : norm) - 1;\n\t\t}\n\t\tdefault:\n\t\t\treturn Math.sin(angle);\n\t}\n}\n\n/**\n * A behaviour's progress at `t` (0–1, eased) of a change lasting `ms`, for the `index`-th number\n * in a value (only a wriggle tells numbers apart).\n */\nexport function behaviorProgress(behavior: MotionBehavior, t: number, index = 0, ms = 800): number {\n\tconst time = Math.max(0, t);\n\tswitch (behavior.type) {\n\t\tcase 'pulse':\n\t\t\t// sin²(πct) = (1 − cos 2πct) / 2: written as Flair writes it, so the numbers match.\n\t\t\treturn 0.5 + 0.5 * Math.sin(2 * Math.PI * (behavior.count ?? 1) * time - Math.PI / 2);\n\t\tcase 'oscillate': {\n\t\t\tconst w = wave(behavior.wave, 2 * Math.PI * (behavior.count ?? 1) * time);\n\t\t\tconst decay = behavior.decay ?? 0;\n\t\t\treturn decay > 0 ? w * Math.max(0, 1 - t) ** decay : w;\n\t\t}\n\t\tcase 'wriggle': {\n\t\t\tconst edge = quinticFade(Math.min(1, Math.max(0, Math.min(t, 1 - t) / WRIGGLE_EDGE)));\n\t\t\tif (edge === 0) return 0;\n\t\t\treturn edge * fractalWiggle(behavior.frequency ?? 2, 1, behavior.octaves ?? 2, 0.5, (t * ms) / 1000, behavior.seed ?? 42, index);\n\t\t}\n\t\tcase 'overshoot': {\n\t\t\tconst p = Math.min(1, time);\n\t\t\tif (p >= 1) return 1;\n\t\t\treturn 1 - Math.exp(-(behavior.damping ?? 4) * p) * Math.cos((behavior.cycles ?? 3) * Math.PI * p);\n\t\t}\n\t}\n}\n\n/** Whether `value` is a well-formed `MotionBehavior`. */\nexport function isMotionBehavior(value: unknown): value is MotionBehavior {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst b = value as Record<string, unknown>;\n\tconst positive = (k: string) => b[k] === undefined || (typeof b[k] === 'number' && Number.isFinite(b[k]) && (b[k] as number) > 0);\n\tconst atLeastZero = (k: string) => b[k] === undefined || (typeof b[k] === 'number' && Number.isFinite(b[k]) && (b[k] as number) >= 0);\n\tswitch (b.type) {\n\t\tcase 'pulse':\n\t\t\treturn positive('count');\n\t\tcase 'oscillate':\n\t\t\treturn positive('count') && atLeastZero('decay') && (b.wave === undefined || ['sine', 'triangle', 'square', 'sawtooth'].includes(b.wave as string));\n\t\tcase 'wriggle':\n\t\t\treturn positive('frequency') && positive('octaves') && (b.seed === undefined || Number.isInteger(b.seed));\n\t\tcase 'overshoot':\n\t\t\treturn positive('cycles') && atLeastZero('damping');\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/** A seed from an id (FNV-1a), so each element wriggles its own way: Flair's `seedOf`. */\nexport function motionSeedFromId(id: string): number {\n\tlet h = 0x811c9dc5;\n\tfor (let i = 0; i < id.length; i++) h = Math.imul(h ^ id.charCodeAt(i), 0x01000193);\n\treturn (h >>> 0) % 2147483647 || 1;\n}\n\n// ── Noise (SplitMix64 hashing, quintic value noise), as Flair's `time/noise.ts` ─────────────\n\nconst GOLDEN_GAMMA = 0x9e3779b97f4a7c15n;\nconst MULT1 = 0xbf58476d1ce4e5b9n;\nconst MULT2 = 0x94d049bb133111ebn;\nconst MASK64 = 0xffffffffffffffffn;\nconst BASE_MIX = 0x2545f4914f6cdd1dn;\nconst POW2_53 = 9007199254740992;\n\nfunction hash64(x: bigint): bigint {\n\tlet v = (x + GOLDEN_GAMMA) & MASK64;\n\tv = ((v ^ (v >> 30n)) * MULT1) & MASK64;\n\tv = ((v ^ (v >> 27n)) * MULT2) & MASK64;\n\treturn (v ^ (v >> 31n)) & MASK64;\n}\n\nfunction mixSeeds(parts: (bigint | number)[]): bigint {\n\tlet h = BASE_MIX;\n\tfor (const p of parts) {\n\t\tconst val = typeof p === 'bigint' ? p : BigInt(Math.floor(p));\n\t\th = hash64(h ^ hash64(val & MASK64));\n\t}\n\treturn h;\n}\n\nfunction unitFloat(seed: bigint): number {\n\treturn Number(hash64(seed) >> 11n) / POW2_53;\n}\n\n/** 6t⁵ − 15t⁴ + 10t³: zero slope and curvature at 0 and 1. */\nexport function quinticFade(t: number): number {\n\treturn t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n\nfunction noise1d(seed: bigint, x: number): number {\n\tif (!Number.isFinite(x)) return 0;\n\tconst floorX = Math.floor(x);\n\tconst u = quinticFade(x - floorX);\n\tconst i = BigInt(floorX);\n\tconst a = unitFloat(seed ^ hash64(i & MASK64)) * 2 - 1;\n\tconst b = unitFloat(seed ^ hash64((i + 1n) & MASK64)) * 2 - 1;\n\treturn a + (b - a) * u;\n}\n\n/**\n * Multi-octave smooth noise (After Effects' `wiggle`): the sum over `octaves` of\n * amp·ampMult^k · noise(freq·2^k·t), each octave and `dimension` seeded apart. `t` in seconds.\n */\nexport function fractalWiggle(freq: number, amp: number, octaves = 3, ampMult = 0.5, t = 0, seed = 42, dimension = 0): number {\n\tconst oct = Math.max(1, Math.min(16, Math.floor(octaves)));\n\tlet currentAmp = amp;\n\tlet currentFreq = freq;\n\tlet sum = 0;\n\tconst baseSeed = BigInt(Math.floor(seed));\n\tfor (let k = 0; k < oct; k++) {\n\t\tconst s = mixSeeds([baseSeed, BigInt(dimension), BigInt(k)]);\n\t\tconst phaseOffset = unitFloat(s) * 1000.0;\n\t\tsum += currentAmp * noise1d(s, currentFreq * t + phaseOffset);\n\t\tcurrentAmp *= ampMult;\n\t\tcurrentFreq *= 2.0;\n\t}\n\treturn sum;\n}\n"]}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - `spring` is a damped spring settling on the next value (it may overshoot).
|
|
9
9
|
*/
|
|
10
10
|
/** Named easing presets. */
|
|
11
|
-
type AnimationEasingPreset = 'linear' | 'hold' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-back' | 'ease-out-back' | 'ease-out-elastic' | 'ease-in-elastic' | 'ease-in-out-elastic' | 'elastic' | 'spring';
|
|
11
|
+
type AnimationEasingPreset = 'linear' | 'hold' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-back' | 'ease-out-back' | 'ease-out-elastic' | 'ease-in-elastic' | 'ease-in-out-elastic' | 'elastic' | 'spring' | 'spring-gentle' | 'spring-quick' | 'spring-bouncy' | 'spring-slow';
|
|
12
12
|
interface CubicBezierEasing {
|
|
13
13
|
type: 'cubic-bezier';
|
|
14
14
|
x1: number;
|
|
@@ -43,6 +43,18 @@ declare const ANIMATION_EASING_PRESETS: readonly AnimationEasingPreset[];
|
|
|
43
43
|
declare const ANIMATION_EASING_LABELS: Readonly<Record<AnimationEasingPreset, string>>;
|
|
44
44
|
/** The CSS control points of the bezier presets (CSS Easing Functions Level 1 values for the CSS keywords). */
|
|
45
45
|
declare const CUBIC_BEZIER_PRESETS: Readonly<Record<string, readonly [number, number, number, number]>>;
|
|
46
|
+
/**
|
|
47
|
+
* Figma's named springs (mass 1): gentle 100 / 15, quick 300 / 20, bouncy 600 / 15, slow 80 / 20
|
|
48
|
+
* (stiffness / damping). Each plays until it settles (see `springSettleMs`).
|
|
49
|
+
*/
|
|
50
|
+
declare const SPRING_PRESETS: Readonly<Record<'spring-gentle' | 'spring-quick' | 'spring-bouncy' | 'spring-slow', Required<Omit<SpringEasing, 'type'>>>>;
|
|
51
|
+
/**
|
|
52
|
+
* How long a spring takes to settle within 0.1% of its target, in ms (clamped to 50–10000):
|
|
53
|
+
* 6.9 / (ζ·ω₀) s when under-damped, else 9.2 / its slowest rate.
|
|
54
|
+
*/
|
|
55
|
+
declare function springSettleMs(spring: Omit<SpringEasing, 'type'>): number;
|
|
56
|
+
/** The same curve run backwards in time (`1 − e(1 − u)`) for a cubic-bezier, or null for other easings. */
|
|
57
|
+
declare function reverseCubicBezier(easing: AnimationEasing | string | undefined | null): CubicBezierEasing | null;
|
|
46
58
|
/**
|
|
47
59
|
* Normalised position for a parametric elastic oscillation curve (as used in Rive and Penner curves).
|
|
48
60
|
* Amplitude controls the overshoot intensity; period controls the wave frequency across normalized progress `t` (0–1).
|
|
@@ -85,4 +97,4 @@ declare function easingToCss(easing: AnimationEasing | string | undefined | null
|
|
|
85
97
|
/** Short label for an easing (a preset's label, or `Custom` / `Spring` / `Elastic`). */
|
|
86
98
|
declare function easingLabel(easing: AnimationEasing | undefined | null): string;
|
|
87
99
|
|
|
88
|
-
export { ANIMATION_EASING_LABELS as A, CUBIC_BEZIER_PRESETS as C, type ElasticEasing as E,
|
|
100
|
+
export { ANIMATION_EASING_LABELS as A, CUBIC_BEZIER_PRESETS as C, type ElasticEasing as E, SPRING_PRESETS as S, ANIMATION_EASING_PRESETS as a, type AnimationEasing as b, type AnimationEasingPreset as c, type CubicBezierEasing as d, type SpringEasing as e, cubicBezierAt as f, easingFromInfluence as g, easingLabel as h, easingToCss as i, elasticAt as j, evaluateEasing as k, isAnimationEasing as l, reverseCubicBezier as m, springSettleMs as n, parseCssEasing as p, resolveEasing as r, springAt as s };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - `spring` is a damped spring settling on the next value (it may overshoot).
|
|
9
9
|
*/
|
|
10
10
|
/** Named easing presets. */
|
|
11
|
-
type AnimationEasingPreset = 'linear' | 'hold' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-back' | 'ease-out-back' | 'ease-out-elastic' | 'ease-in-elastic' | 'ease-in-out-elastic' | 'elastic' | 'spring';
|
|
11
|
+
type AnimationEasingPreset = 'linear' | 'hold' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-back' | 'ease-out-back' | 'ease-out-elastic' | 'ease-in-elastic' | 'ease-in-out-elastic' | 'elastic' | 'spring' | 'spring-gentle' | 'spring-quick' | 'spring-bouncy' | 'spring-slow';
|
|
12
12
|
interface CubicBezierEasing {
|
|
13
13
|
type: 'cubic-bezier';
|
|
14
14
|
x1: number;
|
|
@@ -43,6 +43,18 @@ declare const ANIMATION_EASING_PRESETS: readonly AnimationEasingPreset[];
|
|
|
43
43
|
declare const ANIMATION_EASING_LABELS: Readonly<Record<AnimationEasingPreset, string>>;
|
|
44
44
|
/** The CSS control points of the bezier presets (CSS Easing Functions Level 1 values for the CSS keywords). */
|
|
45
45
|
declare const CUBIC_BEZIER_PRESETS: Readonly<Record<string, readonly [number, number, number, number]>>;
|
|
46
|
+
/**
|
|
47
|
+
* Figma's named springs (mass 1): gentle 100 / 15, quick 300 / 20, bouncy 600 / 15, slow 80 / 20
|
|
48
|
+
* (stiffness / damping). Each plays until it settles (see `springSettleMs`).
|
|
49
|
+
*/
|
|
50
|
+
declare const SPRING_PRESETS: Readonly<Record<'spring-gentle' | 'spring-quick' | 'spring-bouncy' | 'spring-slow', Required<Omit<SpringEasing, 'type'>>>>;
|
|
51
|
+
/**
|
|
52
|
+
* How long a spring takes to settle within 0.1% of its target, in ms (clamped to 50–10000):
|
|
53
|
+
* 6.9 / (ζ·ω₀) s when under-damped, else 9.2 / its slowest rate.
|
|
54
|
+
*/
|
|
55
|
+
declare function springSettleMs(spring: Omit<SpringEasing, 'type'>): number;
|
|
56
|
+
/** The same curve run backwards in time (`1 − e(1 − u)`) for a cubic-bezier, or null for other easings. */
|
|
57
|
+
declare function reverseCubicBezier(easing: AnimationEasing | string | undefined | null): CubicBezierEasing | null;
|
|
46
58
|
/**
|
|
47
59
|
* Normalised position for a parametric elastic oscillation curve (as used in Rive and Penner curves).
|
|
48
60
|
* Amplitude controls the overshoot intensity; period controls the wave frequency across normalized progress `t` (0–1).
|
|
@@ -85,4 +97,4 @@ declare function easingToCss(easing: AnimationEasing | string | undefined | null
|
|
|
85
97
|
/** Short label for an easing (a preset's label, or `Custom` / `Spring` / `Elastic`). */
|
|
86
98
|
declare function easingLabel(easing: AnimationEasing | undefined | null): string;
|
|
87
99
|
|
|
88
|
-
export { ANIMATION_EASING_LABELS as A, CUBIC_BEZIER_PRESETS as C, type ElasticEasing as E,
|
|
100
|
+
export { ANIMATION_EASING_LABELS as A, CUBIC_BEZIER_PRESETS as C, type ElasticEasing as E, SPRING_PRESETS as S, ANIMATION_EASING_PRESETS as a, type AnimationEasing as b, type AnimationEasingPreset as c, type CubicBezierEasing as d, type SpringEasing as e, cubicBezierAt as f, easingFromInfluence as g, easingLabel as h, easingToCss as i, elasticAt as j, evaluateEasing as k, isAnimationEasing as l, reverseCubicBezier as m, springSettleMs as n, parseCssEasing as p, resolveEasing as r, springAt as s };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkQKLRAA4Tcjs = require('../chunk-QKLRAA4T.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2FHLHZALcjs = require('../chunk-2FHLHZAL.cjs');
|
|
7
7
|
|
|
8
8
|
// src/parameters/schema.ts
|
|
9
9
|
function humanizeParameterId(id) {
|
|
@@ -1259,7 +1259,7 @@ function createRangeMapper(options = {}) {
|
|
|
1259
1259
|
if (typeof easing === "function") {
|
|
1260
1260
|
progress = easing(normalized);
|
|
1261
1261
|
} else {
|
|
1262
|
-
progress =
|
|
1262
|
+
progress = _chunk2FHLHZALcjs.evaluateEasing.call(void 0, easing, normalized);
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
1265
|
return outMin + progress * outSpan;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AnimationEasing } from '../easing-
|
|
1
|
+
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.cjs';
|
|
2
2
|
import { J as JsonSchema } from '../schema-Di0CS6Pe.cjs';
|
|
3
3
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
4
4
|
import { C as CommandSpec } from '../registry-CaR7LC6W.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AnimationEasing } from '../easing-
|
|
1
|
+
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
2
2
|
import { J as JsonSchema } from '../schema-Di0CS6Pe.js';
|
|
3
3
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
4
4
|
import { C as CommandSpec } from '../registry-rVtFJjRM.js';
|
package/dist/parameters/index.js
CHANGED
|
@@ -780,6 +780,27 @@ interface VectorSvgExportOptions {
|
|
|
780
780
|
* one filled path of the area the stroke paints.
|
|
781
781
|
*/
|
|
782
782
|
strokes?: 'clip' | 'outline';
|
|
783
|
+
/**
|
|
784
|
+
* Groups to write round nodes, by node id, outermost first: to move a node from outside it
|
|
785
|
+
* or clip it (the animation editor's reveals and its Flair export use this).
|
|
786
|
+
*/
|
|
787
|
+
wrap?: Readonly<Record<string, readonly VectorSvgWrapper[]>>;
|
|
788
|
+
}
|
|
789
|
+
/** A group written round a node (see `VectorSvgExportOptions.wrap`). */
|
|
790
|
+
interface VectorSvgWrapper {
|
|
791
|
+
id?: string;
|
|
792
|
+
/** An SVG `transform` attribute. */
|
|
793
|
+
transform?: string;
|
|
794
|
+
/**
|
|
795
|
+
* Clips the group through a rect (`x`, `y`, `width`, `height`) or circle (`cx`, `cy`, `r`) in
|
|
796
|
+
* the units of the group's own box (`clipPathUnits="objectBoundingBox"`: 0–1 across it).
|
|
797
|
+
*/
|
|
798
|
+
clip?: {
|
|
799
|
+
id: string;
|
|
800
|
+
shape: 'rect' | 'circle';
|
|
801
|
+
shapeId?: string;
|
|
802
|
+
attrs: Readonly<Record<string, number>>;
|
|
803
|
+
};
|
|
783
804
|
}
|
|
784
805
|
/** `data-vector-corners`: the live corners of subpaths as `subpath.index:radius[:kind]`, space separated. */
|
|
785
806
|
declare function vectorCornersAttribute(subpaths: readonly VectorSubpath[], precision?: number): string;
|
|
@@ -844,4 +865,4 @@ declare function parseSvgTransform(value: string | undefined): AffineMatrix;
|
|
|
844
865
|
/** Parses SVG markup into a vector document. Throws when there is no `<svg>` element. */
|
|
845
866
|
declare function parseVectorSvg(svg: string, options?: VectorSvgImportOptions): VectorDocument;
|
|
846
867
|
|
|
847
|
-
export { VECTOR_BLEND_SPACINGS as $, type VectorDefaults as A, type VectorStyle as B, type VectorHandleRef as C, type VectorSegmentRef as D, type VectorBlendOptions as E, type VectorModifiers as F, type VectorGradientPatch as G, type VectorAlign as H, type VectorDistribute as I, type VectorArrange as J, type VectorAverageAxis as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorRenderStrokeParts as S, type VectorPaintDef as T, type VectorArrowAlign as U, type VectorDocument as V, type VectorBlend as W, type VectorMergeMode as X, type VectorLineJoin as Y, type VectorWarpStyle as Z, VECTOR_ARROWHEADS as _, type VectorNode as a,
|
|
868
|
+
export { VECTOR_BLEND_SPACINGS as $, type VectorDefaults as A, type VectorStyle as B, type VectorHandleRef as C, type VectorSegmentRef as D, type VectorBlendOptions as E, type VectorModifiers as F, type VectorGradientPatch as G, type VectorAlign as H, type VectorDistribute as I, type VectorArrange as J, type VectorAverageAxis as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorRenderStrokeParts as S, type VectorPaintDef as T, type VectorArrowAlign as U, type VectorDocument as V, type VectorBlend as W, type VectorMergeMode as X, type VectorLineJoin as Y, type VectorWarpStyle as Z, VECTOR_ARROWHEADS as _, type VectorNode as a, vectorGradientAspect as a$, VECTOR_CORNER_KINDS as a0, VECTOR_EFFECT_TYPES as a1, VECTOR_GRADIENT_INTERPOLATIONS as a2, VECTOR_GRADIENT_MAX_PERIODS as a3, VECTOR_GRADIENT_MIN_STOPS as a4, VECTOR_GRADIENT_SPREADS as a5, VECTOR_GRADIENT_TYPES as a6, VECTOR_MERGE_MODES as a7, VECTOR_PATHFINDER_OPERATIONS as a8, VECTOR_STROKE_GRADIENT_MODES as a9, isVectorGradient as aA, mapVectorGradient as aB, mapVectorPaint as aC, moveVectorGradientHandle as aD, moveVectorGradientStop as aE, parseSvgTransform as aF, parseVectorColor as aG, parseVectorSvg as aH, patternAttrs as aI, periodicVectorGradientStops as aJ, pinVectorGradient as aK, removeVectorGradientStop as aL, reverseVectorGradient as aM, samplePlainStops as aN, sampleVectorGradient as aO, sampleVectorGradientAt as aP, sampleVectorPaintDefAt as aQ, sanitizeVectorGradient as aR, setVectorGradientVector as aS, sortedVectorGradientStops as aT, spanVectorGradientStops as aU, transformVectorGradient as aV, transformVectorPaint as aW, vectorBoxMatrix as aX, vectorCornersAttribute as aY, vectorDocumentToSvg as aZ, vectorGradientArea as a_, VECTOR_TOOLS as aa, VECTOR_TRANSFORM_HANDLES as ab, type VectorCorner as ac, type VectorGradientPoints as ad, type VectorGradientRamp as ae, type VectorGradientSvgOptions as af, type VectorGradientUnits as ag, type VectorLineCap as ah, type VectorMatrix as ai, type VectorPaintSvgOptions as aj, type VectorRgba as ak, type VectorSvgImportOptions as al, type VectorSvgPatternDef as am, type VectorSvgWrapper as an, applyVectorCornersAttribute as ao, applyVectorGradientPatch as ap, applyVectorGradientSpread as aq, convertVectorGradient as ar, defaultVectorGradient as as, expandVectorGradientSpread as at, expandVectorGradientStops as au, explicitVectorGradient as av, gradientMidpointRemap as aw, hasExplicitGradientGeometry as ax, insertVectorGradientStop as ay, isCentredVectorGradient as az, type VectorBounds as b, vectorGradientFocalParam as b0, vectorGradientHandles as b1, vectorGradientMatrix as b2, vectorGradientMidpointFromPosition as b3, vectorGradientMidpointPosition as b4, vectorGradientNeedsExpansion as b5, vectorGradientParam as b6, vectorGradientPoints as b7, vectorGradientRamp as b8, vectorGradientSvgDefs as b9, vectorGradientTAt as ba, vectorGradientUnitsMatrix as bb, vectorPaintToSvg as bc, vectorPathLocalBounds as bd, vectorStrokeSvgParts as be, widthProfileFromAttribute as bf, widthProfileToAttribute as bg, type VectorSvgExportOptions as c, type Vec2 as d, type VectorSubpath as e, type VectorAnchor as f, type VectorPathNode as g, type VectorAnchorType as h, type VectorPaint as i, type VectorGroupNode as j, type VectorCornerKind as k, type VectorWidthPoint as l, type VectorGradientHandle as m, type VectorGradient as n, type VectorGradientStop as o, type VectorViewport as p, type VectorEffectType as q, type VectorEffectParamsMap as r, type VectorFillRule as s, type VectorBooleanOperation as t, type VectorEffect as u, type VectorWarpMesh as v, type VectorTransformHandle as w, type VectorAnchorRef as x, type VectorPathfinderOperation as y, type VectorTool as z };
|
|
@@ -780,6 +780,27 @@ interface VectorSvgExportOptions {
|
|
|
780
780
|
* one filled path of the area the stroke paints.
|
|
781
781
|
*/
|
|
782
782
|
strokes?: 'clip' | 'outline';
|
|
783
|
+
/**
|
|
784
|
+
* Groups to write round nodes, by node id, outermost first: to move a node from outside it
|
|
785
|
+
* or clip it (the animation editor's reveals and its Flair export use this).
|
|
786
|
+
*/
|
|
787
|
+
wrap?: Readonly<Record<string, readonly VectorSvgWrapper[]>>;
|
|
788
|
+
}
|
|
789
|
+
/** A group written round a node (see `VectorSvgExportOptions.wrap`). */
|
|
790
|
+
interface VectorSvgWrapper {
|
|
791
|
+
id?: string;
|
|
792
|
+
/** An SVG `transform` attribute. */
|
|
793
|
+
transform?: string;
|
|
794
|
+
/**
|
|
795
|
+
* Clips the group through a rect (`x`, `y`, `width`, `height`) or circle (`cx`, `cy`, `r`) in
|
|
796
|
+
* the units of the group's own box (`clipPathUnits="objectBoundingBox"`: 0–1 across it).
|
|
797
|
+
*/
|
|
798
|
+
clip?: {
|
|
799
|
+
id: string;
|
|
800
|
+
shape: 'rect' | 'circle';
|
|
801
|
+
shapeId?: string;
|
|
802
|
+
attrs: Readonly<Record<string, number>>;
|
|
803
|
+
};
|
|
783
804
|
}
|
|
784
805
|
/** `data-vector-corners`: the live corners of subpaths as `subpath.index:radius[:kind]`, space separated. */
|
|
785
806
|
declare function vectorCornersAttribute(subpaths: readonly VectorSubpath[], precision?: number): string;
|
|
@@ -844,4 +865,4 @@ declare function parseSvgTransform(value: string | undefined): AffineMatrix;
|
|
|
844
865
|
/** Parses SVG markup into a vector document. Throws when there is no `<svg>` element. */
|
|
845
866
|
declare function parseVectorSvg(svg: string, options?: VectorSvgImportOptions): VectorDocument;
|
|
846
867
|
|
|
847
|
-
export { VECTOR_BLEND_SPACINGS as $, type VectorDefaults as A, type VectorStyle as B, type VectorHandleRef as C, type VectorSegmentRef as D, type VectorBlendOptions as E, type VectorModifiers as F, type VectorGradientPatch as G, type VectorAlign as H, type VectorDistribute as I, type VectorArrange as J, type VectorAverageAxis as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorRenderStrokeParts as S, type VectorPaintDef as T, type VectorArrowAlign as U, type VectorDocument as V, type VectorBlend as W, type VectorMergeMode as X, type VectorLineJoin as Y, type VectorWarpStyle as Z, VECTOR_ARROWHEADS as _, type VectorNode as a,
|
|
868
|
+
export { VECTOR_BLEND_SPACINGS as $, type VectorDefaults as A, type VectorStyle as B, type VectorHandleRef as C, type VectorSegmentRef as D, type VectorBlendOptions as E, type VectorModifiers as F, type VectorGradientPatch as G, type VectorAlign as H, type VectorDistribute as I, type VectorArrange as J, type VectorAverageAxis as K, type VectorArrowhead as L, type VectorBlendSpacing as M, type VectorGradientInterpolation as N, type VectorGradientSpread as O, type VectorGradientType as P, type VectorStrokeAlign as Q, type VectorStrokeGradientMode as R, type VectorRenderStrokeParts as S, type VectorPaintDef as T, type VectorArrowAlign as U, type VectorDocument as V, type VectorBlend as W, type VectorMergeMode as X, type VectorLineJoin as Y, type VectorWarpStyle as Z, VECTOR_ARROWHEADS as _, type VectorNode as a, vectorGradientAspect as a$, VECTOR_CORNER_KINDS as a0, VECTOR_EFFECT_TYPES as a1, VECTOR_GRADIENT_INTERPOLATIONS as a2, VECTOR_GRADIENT_MAX_PERIODS as a3, VECTOR_GRADIENT_MIN_STOPS as a4, VECTOR_GRADIENT_SPREADS as a5, VECTOR_GRADIENT_TYPES as a6, VECTOR_MERGE_MODES as a7, VECTOR_PATHFINDER_OPERATIONS as a8, VECTOR_STROKE_GRADIENT_MODES as a9, isVectorGradient as aA, mapVectorGradient as aB, mapVectorPaint as aC, moveVectorGradientHandle as aD, moveVectorGradientStop as aE, parseSvgTransform as aF, parseVectorColor as aG, parseVectorSvg as aH, patternAttrs as aI, periodicVectorGradientStops as aJ, pinVectorGradient as aK, removeVectorGradientStop as aL, reverseVectorGradient as aM, samplePlainStops as aN, sampleVectorGradient as aO, sampleVectorGradientAt as aP, sampleVectorPaintDefAt as aQ, sanitizeVectorGradient as aR, setVectorGradientVector as aS, sortedVectorGradientStops as aT, spanVectorGradientStops as aU, transformVectorGradient as aV, transformVectorPaint as aW, vectorBoxMatrix as aX, vectorCornersAttribute as aY, vectorDocumentToSvg as aZ, vectorGradientArea as a_, VECTOR_TOOLS as aa, VECTOR_TRANSFORM_HANDLES as ab, type VectorCorner as ac, type VectorGradientPoints as ad, type VectorGradientRamp as ae, type VectorGradientSvgOptions as af, type VectorGradientUnits as ag, type VectorLineCap as ah, type VectorMatrix as ai, type VectorPaintSvgOptions as aj, type VectorRgba as ak, type VectorSvgImportOptions as al, type VectorSvgPatternDef as am, type VectorSvgWrapper as an, applyVectorCornersAttribute as ao, applyVectorGradientPatch as ap, applyVectorGradientSpread as aq, convertVectorGradient as ar, defaultVectorGradient as as, expandVectorGradientSpread as at, expandVectorGradientStops as au, explicitVectorGradient as av, gradientMidpointRemap as aw, hasExplicitGradientGeometry as ax, insertVectorGradientStop as ay, isCentredVectorGradient as az, type VectorBounds as b, vectorGradientFocalParam as b0, vectorGradientHandles as b1, vectorGradientMatrix as b2, vectorGradientMidpointFromPosition as b3, vectorGradientMidpointPosition as b4, vectorGradientNeedsExpansion as b5, vectorGradientParam as b6, vectorGradientPoints as b7, vectorGradientRamp as b8, vectorGradientSvgDefs as b9, vectorGradientTAt as ba, vectorGradientUnitsMatrix as bb, vectorPaintToSvg as bc, vectorPathLocalBounds as bd, vectorStrokeSvgParts as be, widthProfileFromAttribute as bf, widthProfileToAttribute as bg, type VectorSvgExportOptions as c, type Vec2 as d, type VectorSubpath as e, type VectorAnchor as f, type VectorPathNode as g, type VectorAnchorType as h, type VectorPaint as i, type VectorGroupNode as j, type VectorCornerKind as k, type VectorWidthPoint as l, type VectorGradientHandle as m, type VectorGradient as n, type VectorGradientStop as o, type VectorViewport as p, type VectorEffectType as q, type VectorEffectParamsMap as r, type VectorFillRule as s, type VectorBooleanOperation as t, type VectorEffect as u, type VectorWarpMesh as v, type VectorTransformHandle as w, type VectorAnchorRef as x, type VectorPathfinderOperation as y, type VectorTool as z };
|