@pixodesk/svg-animator-core 1.0.40 → 1.0.43
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/README.md +58 -13
- package/dist/{internal-BZSJtt_h.d.ts → PxDocumentDiagnostic-DkBZYJ7X.d.cts} +227 -462
- package/dist/{internal-BZSJtt_h.d.cts → PxDocumentDiagnostic-DkBZYJ7X.d.ts} +227 -462
- package/dist/{chunk-PAE3NF2U.js → chunk-BOTZI36B.js} +183 -580
- package/dist/chunk-BOTZI36B.js.map +1 -0
- package/dist/chunk-CAZFG2HW.min.js +1 -0
- package/dist/index.cjs +240 -926
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +117 -175
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/internal.cjs +93 -91
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +378 -1
- package/dist/internal.d.ts +378 -1
- package/dist/internal.js +413 -34
- package/dist/internal.js.map +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PAE3NF2U.js.map +0 -1
- package/dist/chunk-WIVGJ5YO.min.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BASELINE_PLAYER_VERSION,
|
|
3
|
-
COLOR_ATTR_NAMES,
|
|
4
|
-
CSS_ONLY_STYLE_PROPS,
|
|
5
|
-
DEFAULT_DURATION_MS,
|
|
6
|
-
DISALLOWED_SVG_TAGS_LOWER,
|
|
7
|
-
LOOP_JUMP_SHIFT_MS,
|
|
8
2
|
OFFSET_DISTANCE_ATTR,
|
|
9
|
-
|
|
10
|
-
PLAYER_WIRE_STEPS,
|
|
11
|
-
PLAYER_WIRE_VERSION,
|
|
12
|
-
PX_ANIM_ATTR_NAME,
|
|
13
|
-
PX_ANIM_SRC_ATTR_NAME,
|
|
14
|
-
PX_PLAYER_SCHEMA_VERSION,
|
|
3
|
+
PX_DEFAULT_DURATION_MS,
|
|
15
4
|
PX_TIMELINE_SHARED_KEYS,
|
|
16
5
|
PX_TIME_ONLY_TIMELINE_KEYS,
|
|
17
6
|
PX_TRANSFORM_PART_KEYS,
|
|
18
7
|
PX_TRIGGER_DEFAULTS,
|
|
19
|
-
|
|
8
|
+
PX_WIRE_BASELINE_VERSION,
|
|
9
|
+
PX_WIRE_SCHEMA_VERSION,
|
|
10
|
+
PX_WIRE_STEPS,
|
|
11
|
+
PX_WIRE_VERSION,
|
|
12
|
+
PX_WIRE_VERSION_KEY,
|
|
20
13
|
PxAlongPathMode,
|
|
21
14
|
PxAnimatedSvgDocumentSchema,
|
|
22
15
|
PxAnimatorConfigSchema,
|
|
@@ -26,7 +19,7 @@ import {
|
|
|
26
19
|
PxCloneEffectSchema,
|
|
27
20
|
PxCloneWithout,
|
|
28
21
|
PxControlMode,
|
|
29
|
-
|
|
22
|
+
PxDefinitionsSchema,
|
|
30
23
|
PxDiagnosticKind,
|
|
31
24
|
PxEffectsSchema,
|
|
32
25
|
PxElementAnimationSchema,
|
|
@@ -44,7 +37,7 @@ import {
|
|
|
44
37
|
PxLoopSchema,
|
|
45
38
|
PxMaskType,
|
|
46
39
|
PxMaskedByEffectSchema,
|
|
47
|
-
|
|
40
|
+
PxNodeBaseSchema,
|
|
48
41
|
PxNodeSchema,
|
|
49
42
|
PxOutAction,
|
|
50
43
|
PxPathOverflow,
|
|
@@ -63,27 +56,23 @@ import {
|
|
|
63
56
|
PxStartOn,
|
|
64
57
|
PxStrokeTrimEffectSchema,
|
|
65
58
|
PxStrokeTrimSubPaths,
|
|
66
|
-
|
|
59
|
+
PxSvgNodeRootSchema,
|
|
67
60
|
PxTextEffectSchema,
|
|
68
61
|
PxTextPathEffectSchema,
|
|
69
62
|
PxTextPathMethod,
|
|
70
63
|
PxTextPathSpacing,
|
|
71
64
|
PxTimelineEngine,
|
|
72
|
-
|
|
65
|
+
PxTimelineEngineSetting,
|
|
73
66
|
PxTimelineSchema,
|
|
74
67
|
PxTransformByEffectSchema,
|
|
75
68
|
PxTransformPartsSchema,
|
|
76
69
|
PxTransformValueSchema,
|
|
77
70
|
PxTriggerSchema,
|
|
78
71
|
PxUnits,
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
PxWireStepKind,
|
|
73
|
+
PxWireVersionRelation,
|
|
81
74
|
TRANSFORM_ATTR,
|
|
82
|
-
TRANSFORM_FN_NAMES,
|
|
83
75
|
TRANSFORM_PART,
|
|
84
|
-
WIRE_VERSION_KEY,
|
|
85
|
-
WireStepKind,
|
|
86
|
-
WireVersionRelation,
|
|
87
76
|
__spreadProps,
|
|
88
77
|
__spreadValues,
|
|
89
78
|
applyTextGlyphsAlongPath,
|
|
@@ -94,91 +83,59 @@ import {
|
|
|
94
83
|
bezier2D_arcLengthLUT,
|
|
95
84
|
bezierToSvgPath,
|
|
96
85
|
calcAnimationValues,
|
|
97
|
-
camelCaseToKebabWordIfNeeded,
|
|
98
86
|
clamp,
|
|
99
87
|
clone,
|
|
100
88
|
compareWireVersion,
|
|
101
|
-
composeTransformParts,
|
|
102
89
|
controlModeTakesOverTrigger,
|
|
103
|
-
|
|
104
|
-
createDiagnostics,
|
|
105
|
-
createPathSampler,
|
|
106
|
-
cubicBezier,
|
|
107
|
-
deepClone,
|
|
90
|
+
convertWireDocument,
|
|
108
91
|
deepClonePxNode,
|
|
109
92
|
describeSchema,
|
|
110
93
|
diagnoseDocument,
|
|
111
|
-
|
|
112
|
-
diffInEffect,
|
|
113
|
-
downgradePlayerDocument,
|
|
114
|
-
extendedPathForBrowser,
|
|
94
|
+
downgradeWireDocument,
|
|
115
95
|
flattenAnimatorTimeline,
|
|
116
96
|
formatWireVersion,
|
|
117
97
|
genId,
|
|
118
98
|
generateNewIds,
|
|
119
|
-
generateUniqueId,
|
|
120
99
|
getAnimatorConfig,
|
|
121
100
|
getBindings,
|
|
122
101
|
getChildren,
|
|
123
|
-
|
|
124
|
-
getNormalizedBindings,
|
|
125
|
-
getNormalizedProps,
|
|
102
|
+
getDefinitions,
|
|
126
103
|
indexById,
|
|
127
|
-
interpolateValue,
|
|
128
104
|
isNativeForced,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
105
|
+
isPxDocument,
|
|
106
|
+
isValidPxDocument,
|
|
107
|
+
keyframeEasing,
|
|
108
|
+
keyframeTangentIn,
|
|
109
|
+
keyframeTangentOut,
|
|
110
|
+
keyframeTime,
|
|
111
|
+
keyframeValue,
|
|
133
112
|
keyframeWith,
|
|
134
|
-
kfEasing,
|
|
135
|
-
kfTangentIn,
|
|
136
|
-
kfTangentOut,
|
|
137
|
-
kfTime,
|
|
138
|
-
kfValue,
|
|
139
|
-
layoutGlyphTextChars,
|
|
140
|
-
materializeGlyphText,
|
|
141
|
-
materializeGlyphTextAlongPath,
|
|
142
113
|
materializeInternalLoopsInTree,
|
|
143
|
-
materializeMotionPathInPropAnim,
|
|
144
114
|
materializeMotionPathsInTree,
|
|
145
115
|
mayUseNativeScrollTimeline,
|
|
146
|
-
mergeStaticTransformIntoAnimDef,
|
|
147
116
|
nestAnimatorTimeline,
|
|
117
|
+
normalizeBindings,
|
|
148
118
|
parseSvgPathToBezier,
|
|
149
119
|
parseWireVersion,
|
|
150
120
|
partsRecord,
|
|
151
|
-
planSchemaRelease,
|
|
152
121
|
px,
|
|
153
122
|
readAnimatable,
|
|
154
123
|
readStaticOrigin,
|
|
155
124
|
readWireVersion,
|
|
156
125
|
regenerateIdsAndRewriteRefs,
|
|
157
126
|
regenerateIdsInClone,
|
|
158
|
-
releaseLogProblems,
|
|
159
|
-
reportDocumentDiagnostics,
|
|
160
127
|
resolveControlMode,
|
|
161
128
|
resolveTimelineEngine,
|
|
162
129
|
resolveTrigger,
|
|
163
|
-
reverseEasing,
|
|
164
|
-
sanitizeAttributeValue,
|
|
165
|
-
schemaFieldUniverse,
|
|
166
130
|
schemaKeys,
|
|
167
|
-
scrollOffsetProgress,
|
|
168
|
-
scrollPhaseInterval,
|
|
169
|
-
scrollResolveAxis,
|
|
170
|
-
scrollTotalDurationMs,
|
|
171
|
-
scrollViewProgress,
|
|
172
131
|
spliceDefs,
|
|
173
|
-
splitEasing,
|
|
174
132
|
stripHash,
|
|
175
|
-
|
|
176
|
-
toRGBA,
|
|
133
|
+
toDomProps,
|
|
177
134
|
validateDocument,
|
|
178
135
|
validateNodeEffects,
|
|
179
|
-
|
|
136
|
+
wireVersionAdvice,
|
|
180
137
|
writeAnimatableChannel
|
|
181
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-BOTZI36B.js";
|
|
182
139
|
|
|
183
140
|
// src/effects/transform/transformationEffect.ts
|
|
184
141
|
function applyTransformByEffect(node, fx, ctx) {
|
|
@@ -566,11 +523,11 @@ function buildStopChildren(stops, ctx) {
|
|
|
566
523
|
const loopFromSource = read.loop;
|
|
567
524
|
let stopCount = 0;
|
|
568
525
|
for (const kf of kfs) {
|
|
569
|
-
const v =
|
|
526
|
+
const v = keyframeValue(kf);
|
|
570
527
|
if (Array.isArray(v) && v.length > stopCount) stopCount = v.length;
|
|
571
528
|
}
|
|
572
529
|
if (!stopCount) return [];
|
|
573
|
-
const firstKfValue =
|
|
530
|
+
const firstKfValue = keyframeValue(kfs[0]);
|
|
574
531
|
const baselineStops = [];
|
|
575
532
|
for (let i = 0; i < stopCount; i++) {
|
|
576
533
|
const s = (_b = (_a = firstKfValue == null ? void 0 : firstKfValue[i]) != null ? _a : prevDefinedStop(kfs, 0, i)) != null ? _b : { offset: i / Math.max(1, stopCount - 1), color: "#000000" };
|
|
@@ -591,11 +548,11 @@ function animatedStopNode(baseline, kfs, stopIdx, _ctx, loop) {
|
|
|
591
548
|
const offsetKfs = [];
|
|
592
549
|
let offsetVaries = false;
|
|
593
550
|
for (const kf of kfs) {
|
|
594
|
-
const t =
|
|
595
|
-
const arr =
|
|
551
|
+
const t = keyframeTime(kf);
|
|
552
|
+
const arr = keyframeValue(kf);
|
|
596
553
|
const sliced = (_a = arr == null ? void 0 : arr[stopIdx]) != null ? _a : prevDefinedStop(kfs, kfs.indexOf(kf), stopIdx);
|
|
597
554
|
if (!sliced) continue;
|
|
598
|
-
const easing =
|
|
555
|
+
const easing = keyframeEasing(kf);
|
|
599
556
|
const colorOut = { time: t, value: sliced.color };
|
|
600
557
|
if (easing !== void 0) colorOut.easing = easing;
|
|
601
558
|
colorKfs.push(colorOut);
|
|
@@ -623,11 +580,11 @@ function animatedStopNode(baseline, kfs, stopIdx, _ctx, loop) {
|
|
|
623
580
|
}
|
|
624
581
|
function prevDefinedStop(kfs, fromIdx, stopIdx) {
|
|
625
582
|
for (let i = fromIdx; i >= 0; i--) {
|
|
626
|
-
const arr =
|
|
583
|
+
const arr = keyframeValue(kfs[i]);
|
|
627
584
|
if (arr == null ? void 0 : arr[stopIdx]) return arr[stopIdx];
|
|
628
585
|
}
|
|
629
586
|
for (let i = fromIdx + 1; i < kfs.length; i++) {
|
|
630
|
-
const arr =
|
|
587
|
+
const arr = keyframeValue(kfs[i]);
|
|
631
588
|
if (arr == null ? void 0 : arr[stopIdx]) return arr[stopIdx];
|
|
632
589
|
}
|
|
633
590
|
return void 0;
|
|
@@ -1428,7 +1385,7 @@ function readScalarValues(r) {
|
|
|
1428
1385
|
if (r.kind === "static" /* Static */) return [r.value];
|
|
1429
1386
|
const out = [];
|
|
1430
1387
|
for (const kf of r.keyframes) {
|
|
1431
|
-
const v =
|
|
1388
|
+
const v = keyframeValue(kf);
|
|
1432
1389
|
if (typeof v === "number") out.push(v);
|
|
1433
1390
|
}
|
|
1434
1391
|
return out;
|
|
@@ -1439,9 +1396,9 @@ function computeAnimAttr(read, map) {
|
|
|
1439
1396
|
return {
|
|
1440
1397
|
kind: "animated" /* Animated */,
|
|
1441
1398
|
keyframes: read.keyframes.map((kf) => ({
|
|
1442
|
-
time:
|
|
1443
|
-
value: map(
|
|
1444
|
-
easing:
|
|
1399
|
+
time: keyframeTime(kf),
|
|
1400
|
+
value: map(keyframeValue(kf)),
|
|
1401
|
+
easing: keyframeEasing(kf)
|
|
1445
1402
|
})),
|
|
1446
1403
|
loop: read.loop
|
|
1447
1404
|
};
|
|
@@ -1459,7 +1416,7 @@ function computeOpacityFromRange(rangeRead) {
|
|
|
1459
1416
|
let anyHide = false;
|
|
1460
1417
|
let allHide = true;
|
|
1461
1418
|
for (const kf of kfs) {
|
|
1462
|
-
if (hide(
|
|
1419
|
+
if (hide(keyframeValue(kf))) anyHide = true;
|
|
1463
1420
|
else allHide = false;
|
|
1464
1421
|
}
|
|
1465
1422
|
if (!anyHide) return void 0;
|
|
@@ -1469,10 +1426,10 @@ function computeOpacityFromRange(rangeRead) {
|
|
|
1469
1426
|
const kf = kfs[i];
|
|
1470
1427
|
const prevKf = i > 0 ? kfs[i - 1] : void 0;
|
|
1471
1428
|
const nextKf = i < kfs.length - 1 ? kfs[i + 1] : void 0;
|
|
1472
|
-
const t =
|
|
1473
|
-
const thisHide = hide(
|
|
1474
|
-
const prevHide = prevKf ? thisHide && hide(
|
|
1475
|
-
const nextHide = nextKf ? thisHide && hide(
|
|
1429
|
+
const t = keyframeTime(kf);
|
|
1430
|
+
const thisHide = hide(keyframeValue(kf));
|
|
1431
|
+
const prevHide = prevKf ? thisHide && hide(keyframeValue(prevKf)) : thisHide;
|
|
1432
|
+
const nextHide = nextKf ? thisHide && hide(keyframeValue(nextKf)) : thisHide;
|
|
1476
1433
|
if (prevHide && !nextHide) {
|
|
1477
1434
|
out.push({ time: t, value: 0 });
|
|
1478
1435
|
out.push({ time: t + OPACITY_STEP_MS, value: 1 });
|
|
@@ -1488,9 +1445,9 @@ function readRangeWithCrossings(raw) {
|
|
|
1488
1445
|
const r = readAnimatable(raw);
|
|
1489
1446
|
if (r.kind !== "animated" /* Animated */) return r;
|
|
1490
1447
|
const kfs = r.keyframes.map((kf) => ({
|
|
1491
|
-
time:
|
|
1492
|
-
value:
|
|
1493
|
-
easing:
|
|
1448
|
+
time: keyframeTime(kf),
|
|
1449
|
+
value: keyframeValue(kf),
|
|
1450
|
+
easing: keyframeEasing(kf)
|
|
1494
1451
|
}));
|
|
1495
1452
|
const hasReverse = kfs.some((kf) => kf.value[0] > kf.value[1]);
|
|
1496
1453
|
if (!hasReverse) {
|
|
@@ -1618,7 +1575,7 @@ function shapeToPathD(node) {
|
|
|
1618
1575
|
}
|
|
1619
1576
|
|
|
1620
1577
|
// src/effects/PlayerEffectsUtil.ts
|
|
1621
|
-
function
|
|
1578
|
+
function materializeNodeEffects(root) {
|
|
1622
1579
|
var _a, _b;
|
|
1623
1580
|
const ctx = {
|
|
1624
1581
|
defs: [],
|
|
@@ -1631,7 +1588,7 @@ function applyPlayerEffects(root) {
|
|
|
1631
1588
|
// Resolved engine: `frames` ONLY when explicitly set; auto/waapi/unset →
|
|
1632
1589
|
// waapi (we're not 100% sure it's frames, and CSS/WAAPI need the inline form).
|
|
1633
1590
|
engine: resolveTimelineEngine((_a = getAnimatorConfig(root)) == null ? void 0 : _a.engine),
|
|
1634
|
-
glyphs: (_b =
|
|
1591
|
+
glyphs: (_b = getDefinitions(root)) == null ? void 0 : _b.fonts
|
|
1635
1592
|
};
|
|
1636
1593
|
const working = clone(root);
|
|
1637
1594
|
indexById(working, ctx.idMap);
|
|
@@ -1715,11 +1672,11 @@ function buildOffsetPath(propAnim) {
|
|
|
1715
1672
|
if (propAnim.alongPathMode !== "offsetPath") return void 0;
|
|
1716
1673
|
const kfs = propAnim.keyframes;
|
|
1717
1674
|
if (!kfs || kfs.length < 2) return void 0;
|
|
1718
|
-
const first =
|
|
1675
|
+
const first = keyframeValue(kfs[0]);
|
|
1719
1676
|
const anchor = (first == null ? void 0 : first.origin) && first.origin.length >= 2 ? [first.origin[0], first.origin[1]] : [0, 0];
|
|
1720
1677
|
const points = [];
|
|
1721
1678
|
for (const kf of kfs) {
|
|
1722
|
-
const v =
|
|
1679
|
+
const v = keyframeValue(kf);
|
|
1723
1680
|
const tr = v == null ? void 0 : v.translate;
|
|
1724
1681
|
if (!tr || tr.length < 2) return void 0;
|
|
1725
1682
|
const parts = Object.keys(v);
|
|
@@ -1728,13 +1685,13 @@ function buildOffsetPath(propAnim) {
|
|
|
1728
1685
|
if (o[0] !== anchor[0] || o[1] !== anchor[1]) return void 0;
|
|
1729
1686
|
points.push([tr[0] + anchor[0], tr[1] + anchor[1]]);
|
|
1730
1687
|
}
|
|
1731
|
-
if (!kfs.some((kf) =>
|
|
1688
|
+
if (!kfs.some((kf) => keyframeTangentIn(kf) || keyframeTangentOut(kf))) return void 0;
|
|
1732
1689
|
let d = "M" + fmt(points[0][0]) + "," + fmt(points[0][1]);
|
|
1733
1690
|
const segLens = [];
|
|
1734
1691
|
for (let i = 0; i < points.length - 1; i++) {
|
|
1735
1692
|
const p0 = points[i], p1 = points[i + 1];
|
|
1736
|
-
const to = (_b =
|
|
1737
|
-
const ti = (_c =
|
|
1693
|
+
const to = (_b = keyframeTangentOut(kfs[i])) != null ? _b : [0, 0];
|
|
1694
|
+
const ti = (_c = keyframeTangentIn(kfs[i + 1])) != null ? _c : [0, 0];
|
|
1738
1695
|
const c1 = [p0[0] + to[0], p0[1] + to[1]];
|
|
1739
1696
|
const c2 = [p1[0] + ti[0], p1[1] + ti[1]];
|
|
1740
1697
|
d += "C" + fmt(c1[0]) + "," + fmt(c1[1]) + "," + fmt(c2[0]) + "," + fmt(c2[1]) + "," + fmt(p1[0]) + "," + fmt(p1[1]);
|
|
@@ -1746,8 +1703,8 @@ function buildOffsetPath(propAnim) {
|
|
|
1746
1703
|
let cum = 0;
|
|
1747
1704
|
for (let i = 0; i < kfs.length; i++) {
|
|
1748
1705
|
if (i > 0) cum += segLens[i - 1];
|
|
1749
|
-
const out = { t:
|
|
1750
|
-
const e =
|
|
1706
|
+
const out = { t: keyframeTime(kfs[i]), v: cum / total };
|
|
1707
|
+
const e = keyframeEasing(kfs[i]);
|
|
1751
1708
|
if (e !== void 0) out.e = e;
|
|
1752
1709
|
distanceKfs.push(out);
|
|
1753
1710
|
}
|
|
@@ -1946,14 +1903,14 @@ function walkAndMaterialize(node, idMap, animatedIds, genId3, defsCollector, roo
|
|
|
1946
1903
|
}
|
|
1947
1904
|
|
|
1948
1905
|
// src/materialize/PxAnimatorMaterializeAll.ts
|
|
1949
|
-
function materializeAllInTree(doc, engine,
|
|
1906
|
+
function materializeAllInTree(doc, engine, options) {
|
|
1950
1907
|
var _a, _b;
|
|
1951
|
-
let root =
|
|
1908
|
+
let root = materializeNodeEffects(doc).root;
|
|
1952
1909
|
root = materializeOffsetPathsInTree(root);
|
|
1953
|
-
const duration = (_b = (_a = getAnimatorConfig(root)) == null ? void 0 : _a.duration) != null ? _b :
|
|
1910
|
+
const duration = (_b = (_a = getAnimatorConfig(root)) == null ? void 0 : _a.duration) != null ? _b : PX_DEFAULT_DURATION_MS;
|
|
1954
1911
|
root = materializeInternalLoopsInTree(root, duration);
|
|
1955
1912
|
if (engine === PxTimelineEngine.native) {
|
|
1956
|
-
root = materializeMotionPathsInTree(root,
|
|
1913
|
+
root = materializeMotionPathsInTree(root, options == null ? void 0 : options.motionPath);
|
|
1957
1914
|
root = materializeAnimatedUseInstances(root);
|
|
1958
1915
|
root = pruneUnreferencedDefs(root);
|
|
1959
1916
|
}
|
|
@@ -2063,16 +2020,16 @@ function cancelFrame(handle) {
|
|
|
2063
2020
|
}
|
|
2064
2021
|
g.clearTimeout(handle);
|
|
2065
2022
|
}
|
|
2066
|
-
function
|
|
2023
|
+
function createAdapterAnimator(doc, adapter, callbacks) {
|
|
2067
2024
|
var _a;
|
|
2068
2025
|
const config = getAnimatorConfig(doc) || {};
|
|
2069
|
-
const bindings =
|
|
2026
|
+
const bindings = normalizeBindings(doc, PxTimelineEngine.js);
|
|
2070
2027
|
const _iterations = config.iterations;
|
|
2071
2028
|
let iterations = 1;
|
|
2072
2029
|
if (typeof _iterations === "number") iterations = _iterations || 1;
|
|
2073
2030
|
if (_iterations === "infinite") iterations = Infinity;
|
|
2074
2031
|
if (iterations < 1) iterations = 1;
|
|
2075
|
-
const duration = +(config.duration ||
|
|
2032
|
+
const duration = +(config.duration || PX_DEFAULT_DURATION_MS);
|
|
2076
2033
|
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations : 1) * duration : 0;
|
|
2077
2034
|
const direction = config.direction || "normal";
|
|
2078
2035
|
const fill = (_a = config.fill) != null ? _a : "forwards";
|
|
@@ -2330,6 +2287,38 @@ function createBasicFrameLoopAnimator(doc, adapter, callbacks) {
|
|
|
2330
2287
|
return api;
|
|
2331
2288
|
}
|
|
2332
2289
|
|
|
2290
|
+
// src/playback/PxDiagnosticCode.ts
|
|
2291
|
+
var PxDiagnosticCode = /* @__PURE__ */ ((PxDiagnosticCode2) => {
|
|
2292
|
+
PxDiagnosticCode2[PxDiagnosticCode2["buildFailed"] = 1001] = "buildFailed";
|
|
2293
|
+
PxDiagnosticCode2[PxDiagnosticCode2["invalidDocumentAtSrc"] = 1002] = "invalidDocumentAtSrc";
|
|
2294
|
+
PxDiagnosticCode2[PxDiagnosticCode2["loadFailed"] = 1003] = "loadFailed";
|
|
2295
|
+
PxDiagnosticCode2[PxDiagnosticCode2["animationBuildFailed"] = 1004] = "animationBuildFailed";
|
|
2296
|
+
PxDiagnosticCode2[PxDiagnosticCode2["effectsShape"] = 1101] = "effectsShape";
|
|
2297
|
+
PxDiagnosticCode2[PxDiagnosticCode2["timelineOverrideIgnored"] = 1102] = "timelineOverrideIgnored";
|
|
2298
|
+
PxDiagnosticCode2[PxDiagnosticCode2["blockedTag"] = 1103] = "blockedTag";
|
|
2299
|
+
PxDiagnosticCode2[PxDiagnosticCode2["unsupportedAnimatedAttrs"] = 1104] = "unsupportedAnimatedAttrs";
|
|
2300
|
+
PxDiagnosticCode2[PxDiagnosticCode2["noBindings"] = 1105] = "noBindings";
|
|
2301
|
+
PxDiagnosticCode2[PxDiagnosticCode2["unresolvedBinding"] = 1106] = "unresolvedBinding";
|
|
2302
|
+
PxDiagnosticCode2[PxDiagnosticCode2["triggersNoRoot"] = 1201] = "triggersNoRoot";
|
|
2303
|
+
PxDiagnosticCode2[PxDiagnosticCode2["noRootForSelector"] = 1202] = "noRootForSelector";
|
|
2304
|
+
PxDiagnosticCode2[PxDiagnosticCode2["noRootElement"] = 1203] = "noRootElement";
|
|
2305
|
+
PxDiagnosticCode2[PxDiagnosticCode2["noElementsForSelector"] = 1206] = "noElementsForSelector";
|
|
2306
|
+
PxDiagnosticCode2[PxDiagnosticCode2["setAttributeNoElement"] = 1207] = "setAttributeNoElement";
|
|
2307
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollSmoothingNeedsOwnDriver"] = 1301] = "scrollSmoothingNeedsOwnDriver";
|
|
2308
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollNativeUnavailable"] = 1302] = "scrollNativeUnavailable";
|
|
2309
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollSubjectInvalid"] = 1303] = "scrollSubjectInvalid";
|
|
2310
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollSubjectNoMatch"] = 1304] = "scrollSubjectNoMatch";
|
|
2311
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollNoRootToObserve"] = 1305] = "scrollNoRootToObserve";
|
|
2312
|
+
PxDiagnosticCode2[PxDiagnosticCode2["scrollTriggerIgnored"] = 1306] = "scrollTriggerIgnored";
|
|
2313
|
+
PxDiagnosticCode2[PxDiagnosticCode2["rateRejected"] = 1401] = "rateRejected";
|
|
2314
|
+
PxDiagnosticCode2[PxDiagnosticCode2["controlPropsConflict"] = 1501] = "controlPropsConflict";
|
|
2315
|
+
PxDiagnosticCode2[PxDiagnosticCode2["rnCompileFailed"] = 1601] = "rnCompileFailed";
|
|
2316
|
+
PxDiagnosticCode2[PxDiagnosticCode2["rnRenderFailed"] = 1602] = "rnRenderFailed";
|
|
2317
|
+
PxDiagnosticCode2[PxDiagnosticCode2["rnBoundaryCaught"] = 1603] = "rnBoundaryCaught";
|
|
2318
|
+
PxDiagnosticCode2[PxDiagnosticCode2["rnUnsupported"] = 1604] = "rnUnsupported";
|
|
2319
|
+
return PxDiagnosticCode2;
|
|
2320
|
+
})(PxDiagnosticCode || {});
|
|
2321
|
+
|
|
2333
2322
|
// src/playback/PxAnimatorConfigPatch.ts
|
|
2334
2323
|
var FLAT_ONLY_KEYS = [
|
|
2335
2324
|
"timelineSource",
|
|
@@ -2448,9 +2437,9 @@ function mergeAnimatorConfig(base, patch) {
|
|
|
2448
2437
|
}
|
|
2449
2438
|
return { config: out, warnings };
|
|
2450
2439
|
}
|
|
2451
|
-
function applyAnimatorConfig(doc, patch,
|
|
2440
|
+
function applyAnimatorConfig(doc, patch, options) {
|
|
2452
2441
|
var _a, _b;
|
|
2453
|
-
const reset = !!(
|
|
2442
|
+
const reset = !!(options == null ? void 0 : options.resetTimeline);
|
|
2454
2443
|
if (!doc || (patch === void 0 || !reset && (patch === null || !isPlainObject(patch) || !Object.keys(patch).length))) {
|
|
2455
2444
|
return { doc, warnings: [] };
|
|
2456
2445
|
}
|
|
@@ -2482,22 +2471,14 @@ function applyAnimatorConfig(doc, patch, opts) {
|
|
|
2482
2471
|
return { doc: __spreadProps(__spreadValues({}, anyDoc), { animator: merged.config }), warnings };
|
|
2483
2472
|
}
|
|
2484
2473
|
export {
|
|
2485
|
-
BASELINE_PLAYER_VERSION,
|
|
2486
|
-
COLOR_ATTR_NAMES,
|
|
2487
|
-
CSS_ONLY_STYLE_PROPS,
|
|
2488
|
-
DEFAULT_DURATION_MS,
|
|
2489
|
-
DISALLOWED_SVG_TAGS_LOWER,
|
|
2490
|
-
LOOP_JUMP_SHIFT_MS,
|
|
2491
|
-
PCT_BASED_ATTR_NAMES,
|
|
2492
|
-
PLAYER_WIRE_STEPS,
|
|
2493
|
-
PLAYER_WIRE_VERSION,
|
|
2494
|
-
PX_ANIM_ATTR_NAME,
|
|
2495
|
-
PX_ANIM_SRC_ATTR_NAME,
|
|
2496
|
-
PX_PLAYER_SCHEMA_VERSION,
|
|
2497
2474
|
PX_RATE_REJECTED,
|
|
2498
2475
|
PX_TRANSFORM_PART_KEYS,
|
|
2499
2476
|
PX_TRIGGER_DEFAULTS,
|
|
2500
|
-
|
|
2477
|
+
PX_WIRE_BASELINE_VERSION,
|
|
2478
|
+
PX_WIRE_SCHEMA_VERSION,
|
|
2479
|
+
PX_WIRE_STEPS,
|
|
2480
|
+
PX_WIRE_VERSION,
|
|
2481
|
+
PX_WIRE_VERSION_KEY,
|
|
2501
2482
|
PxAlongPathMode,
|
|
2502
2483
|
PxAnimatedSvgDocumentSchema,
|
|
2503
2484
|
PxAnimatorConfigSchema,
|
|
@@ -2507,7 +2488,8 @@ export {
|
|
|
2507
2488
|
PxCloneEffectSchema,
|
|
2508
2489
|
PxCloneWithout,
|
|
2509
2490
|
PxControlMode,
|
|
2510
|
-
|
|
2491
|
+
PxDefinitionsSchema,
|
|
2492
|
+
PxDiagnosticCode,
|
|
2511
2493
|
PxDiagnosticKind,
|
|
2512
2494
|
PxEffectsSchema,
|
|
2513
2495
|
PxElementAnimationSchema,
|
|
@@ -2525,7 +2507,7 @@ export {
|
|
|
2525
2507
|
PxLoopSchema,
|
|
2526
2508
|
PxMaskType,
|
|
2527
2509
|
PxMaskedByEffectSchema,
|
|
2528
|
-
|
|
2510
|
+
PxNodeBaseSchema,
|
|
2529
2511
|
PxNodeSchema,
|
|
2530
2512
|
PxOutAction,
|
|
2531
2513
|
PxPathOverflow,
|
|
@@ -2544,105 +2526,65 @@ export {
|
|
|
2544
2526
|
PxStartOn,
|
|
2545
2527
|
PxStrokeTrimEffectSchema,
|
|
2546
2528
|
PxStrokeTrimSubPaths,
|
|
2547
|
-
|
|
2529
|
+
PxSvgNodeRootSchema,
|
|
2548
2530
|
PxTextEffectSchema,
|
|
2549
2531
|
PxTextPathEffectSchema,
|
|
2550
2532
|
PxTextPathMethod,
|
|
2551
2533
|
PxTextPathSpacing,
|
|
2552
2534
|
PxTimelineEngine,
|
|
2553
|
-
|
|
2535
|
+
PxTimelineEngineSetting,
|
|
2554
2536
|
PxTimelineSchema,
|
|
2555
2537
|
PxTransformByEffectSchema,
|
|
2556
2538
|
PxTransformPartsSchema,
|
|
2557
2539
|
PxTransformValueSchema,
|
|
2558
2540
|
PxTriggerSchema,
|
|
2559
2541
|
PxUnits,
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
TRANSFORM_FN_NAMES,
|
|
2563
|
-
WIRE_VERSION_KEY,
|
|
2564
|
-
WireStepKind,
|
|
2565
|
-
WireVersionRelation,
|
|
2542
|
+
PxWireStepKind,
|
|
2543
|
+
PxWireVersionRelation,
|
|
2566
2544
|
applyAnimatorConfig,
|
|
2567
|
-
applyPlayerEffects,
|
|
2568
2545
|
applyWireSteps,
|
|
2569
|
-
bezierToSvgPath,
|
|
2570
2546
|
calcAnimationValues,
|
|
2571
|
-
camelCaseToKebabWordIfNeeded,
|
|
2572
|
-
clamp,
|
|
2573
2547
|
clampSeekMs,
|
|
2574
2548
|
compareWireVersion,
|
|
2575
|
-
composeTransformParts,
|
|
2576
2549
|
controlModeTakesOverTrigger,
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
createDiagnostics,
|
|
2580
|
-
createPathSampler,
|
|
2550
|
+
convertWireDocument,
|
|
2551
|
+
createAdapterAnimator,
|
|
2581
2552
|
createRunClock,
|
|
2582
|
-
cubicBezier,
|
|
2583
|
-
deepClone,
|
|
2584
2553
|
describeSchema,
|
|
2585
2554
|
diagnoseDocument,
|
|
2586
|
-
|
|
2587
|
-
diffInEffect,
|
|
2588
|
-
downgradePlayerDocument,
|
|
2589
|
-
extendedPathForBrowser,
|
|
2555
|
+
downgradeWireDocument,
|
|
2590
2556
|
flattenAnimatorTimeline,
|
|
2591
2557
|
foldTimelineOverride,
|
|
2592
2558
|
formatWireVersion,
|
|
2593
2559
|
generateNewIds,
|
|
2594
|
-
generateUniqueId,
|
|
2595
2560
|
getAnimatorConfig,
|
|
2596
2561
|
getBindings,
|
|
2597
2562
|
getChildren,
|
|
2598
|
-
|
|
2599
|
-
getNormalizedBindings,
|
|
2600
|
-
getNormalizedProps,
|
|
2601
|
-
interpolateValue,
|
|
2563
|
+
getDefinitions,
|
|
2602
2564
|
isNativeForced,
|
|
2603
|
-
|
|
2604
|
-
isPxElementFileFormatDeep,
|
|
2605
|
-
isScrollTimeline,
|
|
2565
|
+
isPxDocument,
|
|
2606
2566
|
isValidPlaybackRate,
|
|
2607
|
-
|
|
2608
|
-
kfEasing,
|
|
2609
|
-
kfValue,
|
|
2610
|
-
layoutGlyphTextChars,
|
|
2567
|
+
isValidPxDocument,
|
|
2611
2568
|
materializeAllInTree,
|
|
2612
|
-
|
|
2613
|
-
materializeGlyphTextAlongPath,
|
|
2614
|
-
materializeMotionPathInPropAnim,
|
|
2569
|
+
materializeNodeEffects,
|
|
2615
2570
|
mayUseNativeScrollTimeline,
|
|
2616
2571
|
mergeAnimatorConfig,
|
|
2617
|
-
mergeStaticTransformIntoAnimDef,
|
|
2618
2572
|
nestAnimatorTimeline,
|
|
2573
|
+
normalizeBindings,
|
|
2619
2574
|
parseWireVersion,
|
|
2620
|
-
planSchemaRelease,
|
|
2621
2575
|
progressSpanMs,
|
|
2622
2576
|
progressToTimeMs,
|
|
2623
2577
|
px,
|
|
2624
2578
|
readWireVersion,
|
|
2625
|
-
releaseLogProblems,
|
|
2626
|
-
reportDocumentDiagnostics,
|
|
2627
2579
|
resolveControlMode,
|
|
2628
2580
|
resolveTimelineEngine,
|
|
2629
2581
|
resolveTrigger,
|
|
2630
|
-
reverseEasing,
|
|
2631
|
-
sanitizeAttributeValue,
|
|
2632
|
-
schemaFieldUniverse,
|
|
2633
2582
|
schemaKeys,
|
|
2634
|
-
scrollOffsetProgress,
|
|
2635
|
-
scrollPhaseInterval,
|
|
2636
|
-
scrollResolveAxis,
|
|
2637
|
-
scrollTotalDurationMs,
|
|
2638
|
-
scrollViewProgress,
|
|
2639
2583
|
seekCeilingMs,
|
|
2640
|
-
splitEasing,
|
|
2641
|
-
subdivideCubicBezier,
|
|
2642
2584
|
timeToProgress,
|
|
2643
|
-
|
|
2585
|
+
toDomProps,
|
|
2644
2586
|
validateDocument,
|
|
2645
2587
|
validateNodeEffects,
|
|
2646
|
-
|
|
2588
|
+
wireVersionAdvice
|
|
2647
2589
|
};
|
|
2648
2590
|
//# sourceMappingURL=index.js.map
|