@infinityfx/lively 4.0.0-beta.6 → 4.0.0-beta.7

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,3 +1,3 @@
1
1
  "use client";
2
- import{__rest as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import{use as r,useRef as o}from"react";import n,{AnimatableContext as i}from"../animatable.js";import{combineRefs as s}from"../core/utils.js";import u from"../hooks/use-mount-effect.js";const m={};function a(a){var{children:l,group:c,transition:d}=a,f=t(a,["children","group","transition"]);const p=r(i),g=(null==p?void 0:p.group)?`${p.group}.${c}`:c;g in m||(m[g]=new Map);const v=o(null);return u((()=>{var t,e;const r=null===(t=v.current)||void 0===t?void 0:t.timeline;if(!r)return;if(m[g].has(r)){m[g].get(r).state="mounted"}else m[g].set(r,{state:"mounted"});const o=Array.from(m[g].entries()).find((([t,e])=>"unmounted"===e.state));return o?(r.transition(o[0],d),o[1].state="collected"):r.mounted||(null===(e=v.current)||void 0===e||e.trigger("mount"),r.mounted=!0),()=>{const t=m[g].get(r);t&&(t.state="unmounted",setTimeout((()=>t.state="collected"),1))}}),[]),e(n,Object.assign({},f,{group:g,manual:!0,ref:s(v,f.ref),children:l}))}a.isLively=!0;export{a as default};
2
+ import{__rest as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import{use as o,useRef as r}from"react";import n,{AnimatableContext as i}from"../animatable.js";import{combineRefs as s}from"../core/utils.js";import u from"../hooks/use-mount-effect.js";const m={};function a(a){var{children:l,group:c,transition:d}=a,f=t(a,["children","group","transition"]);const p=o(i),g=(null==p?void 0:p.group)?`${p.group}.${c}`:c;g in m||(m[g]=new Map);const v=r(null);return u((()=>{var t,e;const o=null===(t=v.current)||void 0===t?void 0:t.timeline;if(!o)return;if(m[g].has(o)){m[g].get(o).state="mounted"}else m[g].set(o,{state:"mounted"});const r=Array.from(m[g].entries()).find((([t,e])=>"unmounted"===e.state));return r&&!o.mounted?(o.transition(r[0],d),r[1].state="collected"):o.mounted||null===(e=v.current)||void 0===e||e.trigger("mount"),o.mounted=!0,()=>{const t=m[g].get(o);t.state="unmounted",setTimeout((()=>t.state="collected"),1)}}),[]),e(n,Object.assign({},f,{group:g,manual:!0,ref:s(v,f.ref),children:l}))}a.isLively=!0;export{a as default};
3
3
  //# sourceMappingURL=morph.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinityfx/lively",
3
- "version": "4.0.0-beta.6",
3
+ "version": "4.0.0-beta.7",
4
4
  "type": "module",
5
5
  "description": "Feature complete, lightweight react animation library.",
6
6
  "main": "dist/index.js",