@hyperframes/parsers 0.8.125 → 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.
@@ -1,5 +1,5 @@
1
- import { g as ParsedGsap, c as GsapMethod, G as GsapAnimation } from './gsapSerialize-CVwsMItk.js';
2
- export { A as ArcPathConfig, a as ArcPathSegment, e as GsapProvenance, f as GsapProvenanceKind, K as KeyframeEditability, M as MotionPathShape, t as buildArcPath, o as editabilityForProvenance } from './gsapSerialize-CVwsMItk.js';
1
+ import { g as ParsedGsap, c as GsapMethod, G as GsapAnimation } from './gsapSerialize-CFUDcLqX.js';
2
+ export { A as ArcPathConfig, a as ArcPathSegment, e as GsapProvenance, f as GsapProvenanceKind, K as KeyframeEditability, M as MotionPathShape, t as buildArcPath, o as editabilityForProvenance } from './gsapSerialize-CFUDcLqX.js';
3
3
  import './types-Ejqndkej.js';
4
4
 
5
5
  interface TweenCallInfo {
@@ -3,6 +3,22 @@ import * as acorn from "acorn";
3
3
  import * as acornWalk from "acorn-walk";
4
4
 
5
5
  // src/gsapConstants.ts
6
+ var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
7
+ var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set([
8
+ "onComplete",
9
+ "onStart",
10
+ "onUpdate",
11
+ "onRepeat"
12
+ ]);
13
+ var EXTRAS_KEYS = /* @__PURE__ */ new Set([
14
+ "stagger",
15
+ "yoyo",
16
+ "repeat",
17
+ "repeatDelay",
18
+ "snap",
19
+ "overwrite",
20
+ "immediateRender"
21
+ ]);
6
22
  var PROPERTY_GROUPS = {
7
23
  position: /* @__PURE__ */ new Set(["x", "y", "xPercent", "yPercent"]),
8
24
  scale: /* @__PURE__ */ new Set(["scale", "scaleX", "scaleY"]),
@@ -1126,17 +1142,6 @@ function findTimelineVar(ast, scope) {
1126
1142
  });
1127
1143
  return { timelineVar, ref, timelineCount, defaults };
1128
1144
  }
1129
- var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
1130
- var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set(["onComplete", "onStart", "onUpdate", "onRepeat"]);
1131
- var EXTRAS_KEYS = /* @__PURE__ */ new Set([
1132
- "stagger",
1133
- "yoyo",
1134
- "repeat",
1135
- "repeatDelay",
1136
- "snap",
1137
- "overwrite",
1138
- "immediateRender"
1139
- ]);
1140
1145
  function isTimelineRootedCall(callNode, ref) {
1141
1146
  let obj = callNode.callee?.object;
1142
1147
  while (obj?.type === "CallExpression") {
@@ -1256,11 +1261,12 @@ function computeKeyframesTotalDuration(varsNode, scope, source) {
1256
1261
  }
1257
1262
  return getObjectArrayKeyframeTiming(durations)?.totalDuration;
1258
1263
  }
1264
+ var isFullyReadableStep = (el) => el?.type === "ObjectExpression" && !el.properties.some((p) => p.type === "SpreadElement");
1259
1265
  function parseObjectArrayKeyframes(node, scope, source) {
1260
1266
  const elements = node.elements ?? [];
1261
1267
  const raw = [];
1262
1268
  for (const el of elements) {
1263
- if (!el || el.type !== "ObjectExpression") continue;
1269
+ if (!isFullyReadableStep(el)) return void 0;
1264
1270
  const record = objectExpressionToRecord(el, scope, source);
1265
1271
  const properties = {};
1266
1272
  let duration;
@@ -1272,6 +1278,8 @@ function parseObjectArrayKeyframes(node, scope, source) {
1272
1278
  ease = v;
1273
1279
  } else if (typeof v === "number" || typeof v === "string") {
1274
1280
  properties[k] = v;
1281
+ } else {
1282
+ return void 0;
1275
1283
  }
1276
1284
  }
1277
1285
  raw.push({ properties, duration, ease });