@hyperframes/parsers 0.8.138 → 0.8.140

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.
@@ -26,11 +26,11 @@ interface HoldScope {
26
26
  touched: (animation: GsapAnimation) => boolean;
27
27
  held: (selector: string) => ReadonlyMap<string, unknown>;
28
28
  }
29
- /** The tweens an edit touched (not in `previous`; none without it), and what the script's holds already pin. */
29
+ /** The tweens an edit touched (not in `previous`; all without it), and what the script's holds already pin. */
30
30
  declare function holdScope(before: readonly GsapAnimation[], previous: readonly GsapAnimation[] | null): HoldScope;
31
31
  /**
32
- * What a Studio hold pins from t=0: a keyframed tween's 0% position props before a later start, and the position and
33
- * size of a lone key (GSAP renders none) only where this edit made it or a hold already pins it, minus earlier tweens.
32
+ * What a Studio hold pins from t=0, only for a tween this edit touched or a hold already pins: the 0% position props
33
+ * before a later start, and the position and size of a lone key (GSAP renders none), minus earlier tweens.
34
34
  */
35
35
  declare function keyframeHoldForAnimation(animation: GsapAnimation, animations: readonly GsapAnimation[], scope: HoldScope): Record<string, number> | null;
36
36
  declare const SUPPORTED_EASES: string[];
@@ -1,4 +1,4 @@
1
- import { G as GsapAnimation, A as ArcPathConfig, r as SplitAnimationsOptions, t as SplitAnimationsResult, a as ArcPathSegment } from './gsapSerialize-WJrRO8uT.js';
1
+ import { G as GsapAnimation, A as ArcPathConfig, r as SplitAnimationsOptions, t as SplitAnimationsResult, a as ArcPathSegment } from './gsapSerialize-DPyyDPBC.js';
2
2
  import './types-Ejqndkej.js';
3
3
 
4
4
  type TweenTarget = Pick<GsapAnimation, "targetSelector" | "hasPartialSelector">;
@@ -67,7 +67,7 @@ function holdScope(before, previous) {
67
67
  held.set(a.targetSelector, props);
68
68
  }
69
69
  return {
70
- touched: (a) => previous !== null && !kept.has(tweenSignature(a)),
70
+ touched: (a) => previous === null || !kept.has(tweenSignature(a)),
71
71
  held: (selector) => held.get(selector) ?? /* @__PURE__ */ new Map()
72
72
  };
73
73
  }
@@ -85,7 +85,8 @@ function keyframeHoldForAnimation(animation, animations, scope) {
85
85
  const touched = scope.touched(animation);
86
86
  const pinned = scope.held(animation.targetSelector);
87
87
  const kept = (property, value) => touched ? pinned.has(property) : pinned.get(property) === value;
88
- const pins = (group, property, value) => group === "position" && start > 1e-3 || (group === "position" || group === "size") && (lone && touched || kept(property, value));
88
+ const startsLate = start > 1e-3;
89
+ const pins = (group, property, value) => (group === "position" || group === "size") && ((lone || group === "position" && startsLate) && touched || kept(property, value));
89
90
  const hold = {};
90
91
  for (const [property, value] of Object.entries(atStart.properties)) {
91
92
  if (!pins(classifyPropertyGroup(property), property, value) || typeof value !== "number")