transitions-refine 0.3.29 → 0.3.30

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.
Files changed (2) hide show
  1. package/demo.html +23 -1
  2. package/package.json +1 -1
package/demo.html CHANGED
@@ -5168,10 +5168,32 @@
5168
5168
  if(sp.toSuf) active=stEls.length?stEls.some(e=>safeMatches(e,sp.toSuf)):true; // open
5169
5169
  else if(sp.fromSuf) active=stEls.length?stEls.some(e=>!safeMatches(e,sp.fromSuf)):true; // close = not in fromState
5170
5170
  else active=true; // no state info → always reflect (degrades to old behavior)
5171
+ const spVars={}; // union of this phase's value vars (scale/blur/translate)
5172
+ const memberEls=[]; // {el,css} of resolved members this phase
5171
5173
  for(const mm of sp.members) for(const el of txMemberEls(mm.selector,sp.stateTarget)){
5172
5174
  if(inUI(el))continue;
5173
- if(mm.vars&&Object.keys(mm.vars).length){ const ex=desiredVars.get(el)||{}; desiredVars.set(el,{...ex,...mm.vars}); }
5175
+ if(mm.vars&&Object.keys(mm.vars).length){ const ex=desiredVars.get(el)||{}; desiredVars.set(el,{...ex,...mm.vars}); Object.assign(spVars,mm.vars); }
5174
5176
  if(active) desiredCss.set(el,mm.css);
5177
+ memberEls.push({el,css:mm.css});
5178
+ }
5179
+ // SHARED-VAR recipes (icon/text swap, page slide, …) drive the non-
5180
+ // resting look through a custom property read by SEVERAL stacked
5181
+ // members from a COMMON ANCESTOR — and the "from" member is often not
5182
+ // even a captured lane (e.g. only opacity animates at rest, so the
5183
+ // entering icon has no filter/transform lane). Writing the var inline
5184
+ // on one member can't reach its siblings, and only the captured
5185
+ // member gets the recipe timing. So when a phase carries value vars:
5186
+ // (1) set the vars on the stateTarget container — every descendant
5187
+ // member inherits them, and each state's own CSS rule
5188
+ // (active → blur(0)/scale(1); inactive → blur(var)/scale(var))
5189
+ // gates where they actually show; and
5190
+ // (2) give the same recipe timing to the member's same-slot stacked
5191
+ // siblings (element children of the same parent sharing a class)
5192
+ // so the ENTERING member animates the new filter/transform lanes
5193
+ // instead of snapping.
5194
+ if(Object.keys(spVars).length){
5195
+ for(const el of stEls){ if(inUI(el))continue; const ex=desiredVars.get(el)||{}; desiredVars.set(el,{...ex,...spVars}); }
5196
+ if(active) for(const{el,css}of memberEls){ const parent=el.parentElement; if(!parent)continue; const cls=[...(el.classList||[])]; for(const sib of Array.from(parent.children)){ if(sib===el||inUI(sib)||!sib.classList)continue; if(cls.some(c=>sib.classList.contains(c))&&!desiredCss.has(sib))desiredCss.set(sib,css); } }
5175
5197
  }
5176
5198
  }
5177
5199
  const allEls=new Set([...desiredCss.keys(),...desiredVars.keys()]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transitions-refine",
3
- "version": "0.3.29",
3
+ "version": "0.3.30",
4
4
  "description": "Live, agent-driven Refine panel for CSS/Motion transitions — injects a timeline + Refine UI and runs transitions.dev suggestions via your coding agent.",
5
5
  "type": "module",
6
6
  "bin": {