@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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { C as CompositionVariable, T as TimelineElement, a as CanvasResolution, K as Keyframe, S as StageZoomKeyframe, V as ValidationResult } from './types-Ejqndkej.js';
2
2
  export { A as AddElementData, b as Asset, B as BooleanVariable, c as CANVAS_DIMENSIONS, d as COMPOSITION_VARIABLE_TYPES, e as ColorVariable, f as CompositionAPI, g as CompositionAsset, h as CompositionSpec, i as CompositionVariableBase, j as CompositionVariableType, D as DEFAULT_DURATIONS, E as ElementKeyframes, k as EnumVariable, F as FontVariable, I as ImageVariable, l as KeyframeProperties, M as MediaElementType, m as MediaFile, N as NumberVariable, P as PlayerAPI, R as ResolvedResolutionFlag, n as StageZoom, o as StringVariable, p as TIMELINE_COLORS, q as TimelineCompositionElement, r as TimelineElementBase, s as TimelineElementType, t as TimelineMediaElement, u as TimelineTextElement, v as VALID_CANVAS_RESOLUTIONS, W as WaveformData, w as getDefaultStageZoom, x as isAspectAgnosticResolutionAlias, y as isCompositionElement, z as isMediaElement, G as isTextElement, H as normalizeResolutionFlag, J as resolveResolutionFlagPair } from './types-Ejqndkej.js';
3
- 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-CVwsMItk.js';
3
+ 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';
4
4
  export { isStudioHoldSet } from './gsapParser.js';
5
5
  export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
6
6
  export { parseGsapScriptAcorn as parseGsapScript } from './gsapParserAcorn.js';
package/dist/index.js CHANGED
@@ -128,6 +128,22 @@ var SUPPORTED_PROPS = [
128
128
  // DOM content (number counters, text roll-ups)
129
129
  "innerText"
130
130
  ];
131
+ var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
132
+ var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set([
133
+ "onComplete",
134
+ "onStart",
135
+ "onUpdate",
136
+ "onRepeat"
137
+ ]);
138
+ var EXTRAS_KEYS = /* @__PURE__ */ new Set([
139
+ "stagger",
140
+ "yoyo",
141
+ "repeat",
142
+ "repeatDelay",
143
+ "snap",
144
+ "overwrite",
145
+ "immediateRender"
146
+ ]);
131
147
  var PROPERTY_GROUPS = {
132
148
  position: /* @__PURE__ */ new Set(["x", "y", "xPercent", "yPercent"]),
133
149
  scale: /* @__PURE__ */ new Set(["scale", "scaleX", "scaleY"]),
@@ -1534,17 +1550,6 @@ function findTimelineVar(ast, scope) {
1534
1550
  });
1535
1551
  return { timelineVar, ref, timelineCount, defaults };
1536
1552
  }
1537
- var BUILTIN_VAR_KEYS = /* @__PURE__ */ new Set(["duration", "ease", "delay"]);
1538
- var DROPPED_VAR_KEYS = /* @__PURE__ */ new Set(["onComplete", "onStart", "onUpdate", "onRepeat"]);
1539
- var EXTRAS_KEYS = /* @__PURE__ */ new Set([
1540
- "stagger",
1541
- "yoyo",
1542
- "repeat",
1543
- "repeatDelay",
1544
- "snap",
1545
- "overwrite",
1546
- "immediateRender"
1547
- ]);
1548
1553
  function isTimelineRootedCall(callNode, ref) {
1549
1554
  let obj = callNode.callee?.object;
1550
1555
  while (obj?.type === "CallExpression") {
@@ -1664,11 +1669,12 @@ function computeKeyframesTotalDuration(varsNode, scope, source) {
1664
1669
  }
1665
1670
  return getObjectArrayKeyframeTiming(durations)?.totalDuration;
1666
1671
  }
1672
+ var isFullyReadableStep = (el) => el?.type === "ObjectExpression" && !el.properties.some((p) => p.type === "SpreadElement");
1667
1673
  function parseObjectArrayKeyframes(node, scope, source) {
1668
1674
  const elements = node.elements ?? [];
1669
1675
  const raw = [];
1670
1676
  for (const el of elements) {
1671
- if (!el || el.type !== "ObjectExpression") continue;
1677
+ if (!isFullyReadableStep(el)) return void 0;
1672
1678
  const record = objectExpressionToRecord(el, scope, source);
1673
1679
  const properties = {};
1674
1680
  let duration;
@@ -1680,6 +1686,8 @@ function parseObjectArrayKeyframes(node, scope, source) {
1680
1686
  ease = v;
1681
1687
  } else if (typeof v === "number" || typeof v === "string") {
1682
1688
  properties[k] = v;
1689
+ } else {
1690
+ return void 0;
1683
1691
  }
1684
1692
  }
1685
1693
  raw.push({ properties, duration, ease });