@hyperframes/parsers 0.8.126 → 0.8.127
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/gsapConstants.d.ts +1 -1
- package/dist/gsapConstants.js +23 -0
- package/dist/gsapConstants.js.map +1 -1
- package/dist/gsapParser.d.ts +2 -2
- package/dist/gsapParser.js +20 -12
- package/dist/gsapParser.js.map +1 -1
- package/dist/gsapParserAcorn.d.ts +2 -2
- package/dist/gsapParserAcorn.js +20 -12
- package/dist/gsapParserAcorn.js.map +1 -1
- package/dist/gsapParserExports.d.ts +1 -1
- package/dist/gsapParserExports.js +20 -12
- package/dist/gsapParserExports.js.map +1 -1
- package/dist/{gsapSerialize-CVwsMItk.d.ts → gsapSerialize-CFUDcLqX.d.ts} +7 -1
- package/dist/gsapWriterAcorn.d.ts +1 -1
- package/dist/gsapWriterAcorn.js +24 -29
- package/dist/gsapWriterAcorn.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ArcPathConfig, a as ArcPathSegment, G as GsapAnimation, b as GsapKeyframesData, c as GsapMethod, d as GsapPercentageKeyframe, e as GsapProvenance, f as GsapProvenanceKind, K as KeyframeEditability, P as PROPERTY_GROUPS, g as ParsedGsap, h as PropertyGroupName, S as SUPPORTED_EASES, i as SUPPORTED_PROPS, j as SourcedGsapPercentageKeyframe, k as SplitAnimationsOptions, l as SplitAnimationsResult, m as classifyPropertyGroup, n as classifyTweenPropertyGroup, o as editabilityForProvenance, p as getAnimationsForElementId, q as gsapAnimationsToKeyframes, r as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-
|
|
1
|
+
export { A as ArcPathConfig, a as ArcPathSegment, G as GsapAnimation, b as GsapKeyframesData, c as GsapMethod, d as GsapPercentageKeyframe, e as GsapProvenance, f as GsapProvenanceKind, K as KeyframeEditability, P as PROPERTY_GROUPS, g as ParsedGsap, h as PropertyGroupName, S as SUPPORTED_EASES, i as SUPPORTED_PROPS, j as SourcedGsapPercentageKeyframe, k as SplitAnimationsOptions, l as SplitAnimationsResult, m as classifyPropertyGroup, n as classifyTweenPropertyGroup, o as editabilityForProvenance, p as getAnimationsForElementId, q as gsapAnimationsToKeyframes, r as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-CFUDcLqX.js';
|
|
2
2
|
export { isStudioHoldSet } from './gsapParser.js';
|
|
3
3
|
export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
|
|
4
4
|
export { parseGsapScriptAcorn as parseGsapScript } from './gsapParserAcorn.js';
|
|
@@ -39,6 +39,22 @@ var SUPPORTED_PROPS = [
|
|
|
39
39
|
// DOM content (number counters, text roll-ups)
|
|
40
40
|
"innerText"
|
|
41
41
|
];
|
|
42
|
+
var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
|
|
43
|
+
var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set([
|
|
44
|
+
"onComplete",
|
|
45
|
+
"onStart",
|
|
46
|
+
"onUpdate",
|
|
47
|
+
"onRepeat"
|
|
48
|
+
]);
|
|
49
|
+
var EXTRAS_KEYS = /* @__PURE__ */ new Set([
|
|
50
|
+
"stagger",
|
|
51
|
+
"yoyo",
|
|
52
|
+
"repeat",
|
|
53
|
+
"repeatDelay",
|
|
54
|
+
"snap",
|
|
55
|
+
"overwrite",
|
|
56
|
+
"immediateRender"
|
|
57
|
+
]);
|
|
42
58
|
var PROPERTY_GROUPS = {
|
|
43
59
|
position: /* @__PURE__ */ new Set(["x", "y", "xPercent", "yPercent"]),
|
|
44
60
|
scale: /* @__PURE__ */ new Set(["scale", "scaleX", "scaleY"]),
|
|
@@ -1445,17 +1461,6 @@ function findTimelineVar(ast, scope) {
|
|
|
1445
1461
|
});
|
|
1446
1462
|
return { timelineVar, ref, timelineCount, defaults };
|
|
1447
1463
|
}
|
|
1448
|
-
var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
|
|
1449
|
-
var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set(["onComplete", "onStart", "onUpdate", "onRepeat"]);
|
|
1450
|
-
var EXTRAS_KEYS = /* @__PURE__ */ new Set([
|
|
1451
|
-
"stagger",
|
|
1452
|
-
"yoyo",
|
|
1453
|
-
"repeat",
|
|
1454
|
-
"repeatDelay",
|
|
1455
|
-
"snap",
|
|
1456
|
-
"overwrite",
|
|
1457
|
-
"immediateRender"
|
|
1458
|
-
]);
|
|
1459
1464
|
function isTimelineRootedCall(callNode, ref) {
|
|
1460
1465
|
let obj = callNode.callee?.object;
|
|
1461
1466
|
while (obj?.type === "CallExpression") {
|
|
@@ -1575,11 +1580,12 @@ function computeKeyframesTotalDuration(varsNode, scope, source) {
|
|
|
1575
1580
|
}
|
|
1576
1581
|
return getObjectArrayKeyframeTiming(durations)?.totalDuration;
|
|
1577
1582
|
}
|
|
1583
|
+
var isFullyReadableStep = (el) => el?.type === "ObjectExpression" && !el.properties.some((p) => p.type === "SpreadElement");
|
|
1578
1584
|
function parseObjectArrayKeyframes(node, scope, source) {
|
|
1579
1585
|
const elements = node.elements ?? [];
|
|
1580
1586
|
const raw = [];
|
|
1581
1587
|
for (const el of elements) {
|
|
1582
|
-
if (!el
|
|
1588
|
+
if (!isFullyReadableStep(el)) return void 0;
|
|
1583
1589
|
const record = objectExpressionToRecord(el, scope, source);
|
|
1584
1590
|
const properties = {};
|
|
1585
1591
|
let duration;
|
|
@@ -1591,6 +1597,8 @@ function parseObjectArrayKeyframes(node, scope, source) {
|
|
|
1591
1597
|
ease = v;
|
|
1592
1598
|
} else if (typeof v === "number" || typeof v === "string") {
|
|
1593
1599
|
properties[k] = v;
|
|
1600
|
+
} else {
|
|
1601
|
+
return void 0;
|
|
1594
1602
|
}
|
|
1595
1603
|
}
|
|
1596
1604
|
raw.push({ properties, duration, ease });
|