@hyperframes/parsers 0.8.133 → 0.8.135

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, b as ArcPathSegment, u as GSAP_DEFAULT_DURATION, a as GsapAnimation, h as GsapKeyframesData, G as GsapMethod, i as GsapPercentageKeyframe, c as GsapProvenance, d as GsapProvenanceKind, K as KeyframeEditability, j as PROPERTY_GROUPS, P as ParsedGsap, k as PropertyGroupName, S as SUPPORTED_EASES, l as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, m as classifyPropertyGroup, n as classifyTweenPropertyGroup, f as editabilityForProvenance, o as getAnimationsForElementId, p as gsapAnimationsToKeyframes, q as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-CfSXM_Ez.js';
3
+ export { A as ArcPathConfig, a as ArcPathSegment, u as GSAP_DEFAULT_DURATION, G as GsapAnimation, c as GsapKeyframesData, d as GsapMethod, e as GsapPercentageKeyframe, n as GsapProvenance, o as GsapProvenanceKind, K as KeyframeEditability, f as PROPERTY_GROUPS, P as ParsedGsap, g as PropertyGroupName, S as SUPPORTED_EASES, h as SUPPORTED_PROPS, w as SourcedGsapPercentageKeyframe, r as SplitAnimationsOptions, t as SplitAnimationsResult, i as classifyPropertyGroup, j as classifyTweenPropertyGroup, q as editabilityForProvenance, k as getAnimationsForElementId, l as gsapAnimationsToKeyframes, m as keyframesToGsapAnimations, s as serializeGsapAnimations, v as validateCompositionGsap } from './gsapSerialize-WJrRO8uT.js';
4
4
  export { isStudioHoldSet } from './gsapParser.js';
5
5
  export { getObjectArrayKeyframeTiming } from './gsapParserExports.js';
6
6
  export { SPRING_PRESETS, SpringPreset, generateSpringEaseData } from './springEase.js';
package/dist/index.js CHANGED
@@ -306,6 +306,10 @@ function serializeValue(value) {
306
306
  if (typeof value === "string") return JSON.stringify(value);
307
307
  return String(value);
308
308
  }
309
+ function plainPercentKey(percentage) {
310
+ const text = Math.abs(percentage) < 1e-6 ? percentage.toFixed(20).replace(/\.?0+$/, "") : String(percentage);
311
+ return `${text}%`;
312
+ }
309
313
  function safeJsKey(key) {
310
314
  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : JSON.stringify(key);
311
315
  }
@@ -1841,9 +1845,6 @@ function tweenCallToAnimation(call, scope, source, identifierBindings) {
1841
1845
  properties[key] = val;
1842
1846
  }
1843
1847
  }
1844
- if (keyframesData && typeof vars.easeEach === "string") {
1845
- keyframesData.easeEach = vars.easeEach;
1846
- }
1847
1848
  if (motionPathResult) {
1848
1849
  const { waypoints } = motionPathResult;
1849
1850
  if (!keyframesData) {
@@ -3540,7 +3541,7 @@ function keyframesEntry(anim) {
3540
3541
  const kfs = (anim.keyframes?.keyframes ?? []).map((k) => {
3541
3542
  const body = propEntries(k.properties);
3542
3543
  if (k.ease) body.push(`ease: ${serializeValue(k.ease)}`);
3543
- return `"${k.percentage}%": { ${body.join(", ")} }`;
3544
+ return `${JSON.stringify(plainPercentKey(k.percentage))}: { ${body.join(", ")} }`;
3544
3545
  });
3545
3546
  if (anim.keyframes?.easeEach) kfs.push(`easeEach: ${serializeValue(anim.keyframes.easeEach)}`);
3546
3547
  return `keyframes: { ${kfs.join(", ")} }`;