@ssgoi/core 6.6.3 → 6.7.0-beta.0

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/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var It=Object.defineProperty;var Ht=(t,n,e)=>n in t?It(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var F=(t,n,e)=>Ht(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./multi-animation-uzEnQnrG.cjs");class Mt extends Q.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const s=this.child;if(this.child=e,this._settled=!1,s){const l=s.getPose();s.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const o=e.onComplete;e.onComplete=()=>{o==null||o(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const a=e.onUpdate;e.onUpdate=l=>{var u;a==null||a(l),(u=this.onUpdate)==null||u.call(this,l),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var s;return((s=this.child)==null?void 0:s.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var s;(s=this.child)==null||s.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Wt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},vt=new Set(["auto","scroll","overlay"]),zt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(vt.has(e.overflowY)||vt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Bt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ft(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const s={};return n.forEach((o,a)=>{s[o]=e[a]}),s})}function Kt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}const Xt=1e6,bt=100,$t=10;function qt(t){const n=t.trim(),e=n.indexOf("#"),s=n.indexOf("?"),o=[e,s].filter(a=>a>=0).reduce((a,l)=>Math.min(a,l),n.length);return n.slice(0,o)}function ut(t){const n=qt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return ut(new URL(n).pathname)}catch{}const s=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Ut(t){const n=t.trim();return n==="*"?"*":ut(n)}function rt(t){return t==="/"?[]:t.slice(1).split("/")}function Vt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ct(t,n){const e=ut(t),s=Ut(n);if(s==="*")return{matched:!0,specificity:0};if(e===s)return{matched:!0,specificity:Xt+rt(s).length*bt};const o=rt(e),a=rt(s);let l=0;for(let u=0;u<a.length;u++){const g=a[u],b=o[u],_=u===a.length-1;if(g===void 0)return{matched:!1,specificity:0};if((g==="*"||g==="**")&&_)return{matched:g==="**"?o.length>=u:o.length>u,specificity:l};if(b===void 0)return{matched:!1,specificity:0};if(g==="*"||Vt(g)){l+=$t;continue}if(g!==b)return{matched:!1,specificity:0};l+=bt}return{matched:o.length===a.length,specificity:l}}function Gt(t,n){return ct(t,n).matched}function Yt(t,n,e){let s;for(const o of e){const a=ct(t,o.from);if(!a.matched)continue;const l=ct(n,o.to);if(!l.matched)continue;const u=a.specificity+l.specificity;(!s||u>s.specificity)&&(s={transition:o.transition,specificity:u})}return(s==null?void 0:s.transition)??null}const Zt=768,jt=10,Qt=10;function Jt(t={}){const{preserveScroll:n=f=>f,resolvePath:e=f=>f}=t,s=typeof n=="function"?n:()=>n;let o=null,a=!1,l=!1;const u=()=>{const f=(o==null?void 0:o.clientWidth)??0,d=f>0?f:typeof window<"u"?window.innerWidth:0;return d>0&&d<Zt},g=()=>(l||(a=u(),l=!0),a),b=f=>{var R;const d=e(f),y=s(g());if(y===!1)return{preserves:!1,shared:!1,storageKey:`path:${d}`};if(y===!0)return{preserves:!0,shared:!1,storageKey:`path:${d}`};const E=((R=y.exclude)==null?void 0:R.some(C=>Gt(d,C)))??!1,P=!E&&!!y.key;return{preserves:!E,shared:P,storageKey:P?`shared:${y.key}`:`path:${d}`}},_=f=>b(f).preserves;let O=null;const T=new Map;let L=null,k=!1,W=0;const $=()=>{o&&L&&!k&&T.set(b(L).storageKey,{x:o.scrollLeft,y:o.scrollTop})},z=f=>{if(!o)return;const d=b(f);if(d.preserves&&d.shared&&!T.has(d.storageKey))return;const y=d.preserves&&T.has(d.storageKey)?T.get(d.storageKey):{x:0,y:0};let E=0;const P=()=>{if(!o)return;o.scrollTo({top:y.y,left:y.x}),!(Math.abs(o.scrollTop-y.y)<1&&Math.abs(o.scrollLeft-y.x)<1)&&E<jt&&(E++,requestAnimationFrame(P))};requestAnimationFrame(P)};return{initializeContext:(f,d)=>{k=!0;const y=++W;O=f,o||(o=zt(f),a=u(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{a=u()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",$,{passive:!0})),L=d,z(d);let E=0;const P=()=>{y===W&&(E++,E>=Qt?k=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(f,d)=>{const y=f?b(f).storageKey:null,E=y&&T.has(y)?T.get(y):{x:0,y:0},P=d?b(d):null,R=P!=null&&P.preserves?P.storageKey:null,C=R&&T.has(R)?T.get(R):{x:0,y:0};return{x:-C.x+E.x,y:-C.y+E.y}},evictScrollPosition:f=>{T.delete(b(f).storageKey)},shouldPreserve:_,getScrollContainer:()=>o,getPositionedParentElement:()=>O?Bt(O):document.body,getScrollPosition:f=>{const d=f?b(f).storageKey:null;return d&&T.has(d)?T.get(d):{x:0,y:0}},getIsMobile:g}}const St=30,Et=8,Tt=1.2,wt=30,te=600;function ee(){let t=null,n=!1,e=!1,s=null,o=null,a=!1;const l=(h,v)=>{for(let S=0;S<h.length;S++){const m=h.item(S);if(m&&m.identifier===v)return m}return null},u=()=>{s!==null&&(clearTimeout(s),s=null)},g=()=>{o!==null&&(clearTimeout(o),o=null)},b=()=>{n=!0,e=!0,u(),g(),s=setTimeout(()=>{n=!1,e=!1,s=null},te)},_=h=>{if(h.touches.length!==1){t=null;return}const v=h.touches.item(0);if(!v){t=null;return}const S=window.innerWidth,m=v.clientX<=St,w=v.clientX>=S-St;if(!m&&!w){t=null;return}t={identifier:v.identifier,startX:v.clientX,startY:v.clientY,fromLeftEdge:m,moved:!1}},O=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const v=l(h.touches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=v.clientY-t.startY,w=Math.abs(S),I=Math.abs(m);if(I>Et&&I>w*Tt){t=null;return}const f=t.fromLeftEdge?S>0:S<0;w>Et&&w>I*Tt&&f&&(t.moved=!0)},T=h=>{if(!t)return;const v=l(h.changedTouches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=t.fromLeftEdge?S>0:S<0;if(t.moved&&m&&Math.abs(S)>=wt){b(),t=null;return}t.moved&&Math.abs(S)>=wt&&b(),t=null},L=()=>{t&&(t.moved&&b(),t=null)};return{initialize:()=>{if(typeof window>"u"||a)return;a=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",_,h),window.addEventListener("touchmove",O,h),window.addEventListener("touchend",T,h),window.addEventListener("touchcancel",L,h)},destroy:()=>{if(typeof window>"u"||!a)return;a=!1;const h={capture:!0};window.removeEventListener("touchstart",_,h),window.removeEventListener("touchmove",O,h),window.removeEventListener("touchend",T,h),window.removeEventListener("touchcancel",L,h),u(),g(),t=null,n=!1,e=!1},isSwipeBack:()=>{const h=n||e;return h&&u(),h},onPageEnter:()=>{n=!1,u(),g(),o=setTimeout(()=>{e=!1,o=null},0)}}}function ne(){let t=null;function n(){var s,o;t&&((s=t.outResolve)==null||s.call(t,null),(o=t.inResolve)==null||o.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const s={from:t.from,to:t.to};t.outResolve(s),t.inResolve(s),t=null}}return{trigger(s,o){var l;o==="out"&&(t==null?void 0:t.to)===s&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(o==="out"&&t.from&&t.from!==s||o==="in"&&t.to&&t.to!==s)&&n(),t||(t={}),o==="out"?t.from=s:t.to=s},get(s){return new Promise(o=>{t||(t={}),s==="out"?t.outResolve=o:t.inResolve=o,e()})}}}const X=new Map;let Y=null,Pt=!1;function Rt(t,n){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(n))}for(const e of Array.from(t.childNodes))Rt(e,n)}function se(){if(Pt||typeof document>"u")return;Pt=!0,Y=new MutationObserver(n=>{for(const e of n){const s={parent:e.target,nextSibling:e.nextSibling};for(const o of Array.from(e.removedNodes))Rt(o,s)}});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ie(t,n){return se(),X.set(t,n),()=>{X.delete(t)}}const lt=new WeakMap;let Z=null;const j="none !important";function K(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function oe(){return Z||(Z=new MutationObserver(t=>{for(const n of t){const e=n.target,s=lt.get(e);if(!s)continue;const o=K(e);o!==s.accounted&&(s.accounted=o,o===j?(s.reactHidden=!0,s.onHide()):o!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),Z)}function re(t,n){const e=K(t),s={accounted:e,reactHidden:e===j,onHide:n.onHide,onShow:n.onShow};return lt.set(t,s),oe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return K(t)===j},setDisplay(o,a=!1){o===null?t.style.removeProperty("display"):t.style.setProperty("display",o,a?"important":""),s.accounted=K(t)},sync(){s.accounted=K(t),s.reactHidden=s.accounted===j},stop(){lt.delete(t)}}}function ce(t){return Array.isArray(t)}function Ct(t){const n=[];for(const e of t)ce(e)?n.push(...Ct(e)):n.push(e);return n}function le(t,n={}){const{transitions:e=[],middleware:s=(i,r)=>({from:i,to:r}),preserveScroll:o=i=>i}=t,a=n.host??new Mt,l=ne(),u=typeof e=="function"?e:()=>e,g=ee();g.initialize();const b=new Map,_=i=>{let r=b.get(i);return r===void 0&&(r=s(i,i).from,b.set(i,r)),r},{initializeContext:O,calculateScrollOffset:T,evictScrollPosition:L,shouldPreserve:k,getScrollContainer:W,getPositionedParentElement:$,getScrollPosition:z,getIsMobile:h}=Jt({preserveScroll:o,resolvePath:_}),v=new Map,S=()=>{const i=h();let r=v.get(i);return r||(r=Kt(Ct(u({isMobile:i}))),v.set(i,r)),r};let m=null,w=null;const I=new WeakMap,f=i=>{I.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},d=i=>{const r=I.get(i);return r||{parent:i.parentNode,nextSibling:i.nextSibling}},y=new WeakMap,E=new WeakMap;let P=0;const R=i=>{const r=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return r&&r!=="none"?r:"block"},C=(i,r)=>{r.visibleDisplay=i.style.getPropertyValue("display"),r.computedDisplay=R(i)},dt=(i,r)=>{if(E.get(i)!==r)return;E.delete(i);const c=y.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),C(i,c)):(c.vis.setDisplay(null),C(i,c)))},Ot=(i,r,c,p,A)=>{const M=p.element,D=A.element,N=(p.mode??"unmount")==="hidden",{parent:U,nextSibling:tt}=p.parent?{parent:p.parent,nextSibling:p.nextSibling}:d(M),V=T(r,c),et={scrollOffset:V,from:{scroll:z(r)},to:{scroll:z(c)},get scrollingElement(){return W()||document.documentElement},get positionedParent(){return $()}};let x;if(N){x=M,x.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const H=y.get(D);H&&H.savedCss===null&&(H.savedCss=D.style.cssText)}else x=M,Wt(x,et);k(r)||L(r);const G=N?++P:0;N&&(E.set(D,G),E.set(M,G));const yt=Promise.resolve(x),mt=Promise.resolve(D),gt=[],Nt={from:yt,to:mt,context:et,createElement:((H,nt="div")=>{const B=document.createElement(nt);return B.setAttribute("data-ssgoi-id",H),gt.push(B),B})},kt=Promise.resolve(i.prepare?i.prepare(Nt):{});Ft({from:yt,to:mt,extras:kt}).then(({from:H,to:nt,extras:B})=>{!N&&U&&(tt&&U.contains(tt)?U.insertBefore(x,tt):U.appendChild(x));const st=i.animation({from:H,to:nt,context:et,...B}),it=st.onComplete;st.onComplete=()=>{it==null||it(),N?(dt(M,G),dt(D,G)):x.parentNode&&x.parentNode.removeChild(x);for(const ot of gt)ot.parentNode&&ot.parentNode.removeChild(ot)},a.attach(st)})},q=(i,r)=>{const c=g.isSwipeBack();l.trigger(i,r),l.get(r).then(p=>{if(r==="in"&&g.onPageEnter(),!p)return;if(c){r==="out"&&p.from&&!k(p.from)&&L(p.from),m=null,w=null;return}if(r!=="in")return;const{from:A,to:M}=s(p.from,p.to),D=Yt(A,M,S()),J=m,N=w;m=null,w=null,!(!D||!J||!N)&&Ot(D,p.from,p.to,J,N)})},Lt=(i,r)=>{const c=y.get(i);if(!c)return;const p=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",p)return;const A=d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"hidden"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},_t=(i,r)=>{const c=y.get(i);if(!c||c.intent==="visible")return;c.intent="visible",C(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),O(i,r),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const p=i.getAttribute("data-ssgoi-transition")??r;q(p,"in")},Dt=(i,r,c)=>{const p=y.get(i);if(p&&(p.vis.stop(),y.delete(i),E.delete(i),p.intent==="hidden")){(m==null?void 0:m.element)===i&&(m=null),(w==null?void 0:w.element)===i&&(w=null);return}const A=c??d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"unmount"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},ft=new WeakSet,ht=(i,r)=>{if(ft.has(r))return;ft.add(r),f(r);const c=re(r,{onHide:()=>Lt(r,i),onShow:()=>_t(r,i)}),p={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};y.set(r,p),c.isHidden||(C(r,p),O(r,i),w={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},q(i,"in")),ie(r,A=>Dt(r,i,A))},pt=new Map;return{register:ht,refFor:i=>{let r=pt.get(i);return r||(r=c=>{c&&ht(i,c)},pt.set(i,r)),r}}}const xt="data-ssgoi-root",ae=`[${xt}]`,at="data-ssgoi-transition",At=`[${at}]`,ue="[data-ssgoi-clone]";function de(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function fe(t){return t.nodeType===Node.ELEMENT_NODE}function he(t){return t instanceof HTMLElement}function pe(t,n){if(!de())return()=>{};t.setAttribute(xt,"");const e=l=>l.closest(ae)===t,s=l=>{if(!he(l)||!e(l)||l.closest(ue))return;const u=l.getAttribute(at);u!==null&&n.register(u,l)},o=l=>{if(fe(l)){l.matches(At)&&s(l);for(const u of l.querySelectorAll(At))s(u)}},a=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){s(u.target);continue}for(const g of u.addedNodes)o(g)}});return a.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[at]}),o(t),()=>a.disconnect()}exports.Animation=Q.Animation;exports.MultiAnimation=Q.MultiAnimation;exports.WebAnimation=Q.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=le;exports.observeSsgoiTransitions=pe;
1
+ "use strict";var It=Object.defineProperty;var Ht=(t,n,e)=>n in t?It(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var F=(t,n,e)=>Ht(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./multi-animation-qtH1IKNG.cjs");class Mt extends Q.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const s=this.child;if(this.child=e,this._settled=!1,s){const l=s.getPose();s.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const o=e.onComplete;e.onComplete=()=>{o==null||o(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const a=e.onUpdate;e.onUpdate=l=>{var u;a==null||a(l),(u=this.onUpdate)==null||u.call(this,l),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var s;return((s=this.child)==null?void 0:s.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var s;(s=this.child)==null||s.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Wt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},vt=new Set(["auto","scroll","overlay"]),zt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(vt.has(e.overflowY)||vt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Bt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ft(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const s={};return n.forEach((o,a)=>{s[o]=e[a]}),s})}function Kt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}const Xt=1e6,bt=100,$t=10;function qt(t){const n=t.trim(),e=n.indexOf("#"),s=n.indexOf("?"),o=[e,s].filter(a=>a>=0).reduce((a,l)=>Math.min(a,l),n.length);return n.slice(0,o)}function ut(t){const n=qt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return ut(new URL(n).pathname)}catch{}const s=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Ut(t){const n=t.trim();return n==="*"?"*":ut(n)}function rt(t){return t==="/"?[]:t.slice(1).split("/")}function Vt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ct(t,n){const e=ut(t),s=Ut(n);if(s==="*")return{matched:!0,specificity:0};if(e===s)return{matched:!0,specificity:Xt+rt(s).length*bt};const o=rt(e),a=rt(s);let l=0;for(let u=0;u<a.length;u++){const g=a[u],b=o[u],_=u===a.length-1;if(g===void 0)return{matched:!1,specificity:0};if((g==="*"||g==="**")&&_)return{matched:g==="**"?o.length>=u:o.length>u,specificity:l};if(b===void 0)return{matched:!1,specificity:0};if(g==="*"||Vt(g)){l+=$t;continue}if(g!==b)return{matched:!1,specificity:0};l+=bt}return{matched:o.length===a.length,specificity:l}}function Gt(t,n){return ct(t,n).matched}function Yt(t,n,e){let s;for(const o of e){const a=ct(t,o.from);if(!a.matched)continue;const l=ct(n,o.to);if(!l.matched)continue;const u=a.specificity+l.specificity;(!s||u>s.specificity)&&(s={transition:o.transition,specificity:u})}return(s==null?void 0:s.transition)??null}const Zt=768,jt=10,Qt=10;function Jt(t={}){const{preserveScroll:n=f=>f,resolvePath:e=f=>f}=t,s=typeof n=="function"?n:()=>n;let o=null,a=!1,l=!1;const u=()=>{const f=(o==null?void 0:o.clientWidth)??0,d=f>0?f:typeof window<"u"?window.innerWidth:0;return d>0&&d<Zt},g=()=>(l||(a=u(),l=!0),a),b=f=>{var R;const d=e(f),y=s(g());if(y===!1)return{preserves:!1,shared:!1,storageKey:`path:${d}`};if(y===!0)return{preserves:!0,shared:!1,storageKey:`path:${d}`};const E=((R=y.exclude)==null?void 0:R.some(C=>Gt(d,C)))??!1,P=!E&&!!y.key;return{preserves:!E,shared:P,storageKey:P?`shared:${y.key}`:`path:${d}`}},_=f=>b(f).preserves;let O=null;const T=new Map;let L=null,k=!1,W=0;const $=()=>{o&&L&&!k&&T.set(b(L).storageKey,{x:o.scrollLeft,y:o.scrollTop})},z=f=>{if(!o)return;const d=b(f);if(d.preserves&&d.shared&&!T.has(d.storageKey))return;const y=d.preserves&&T.has(d.storageKey)?T.get(d.storageKey):{x:0,y:0};let E=0;const P=()=>{if(!o)return;o.scrollTo({top:y.y,left:y.x}),!(Math.abs(o.scrollTop-y.y)<1&&Math.abs(o.scrollLeft-y.x)<1)&&E<jt&&(E++,requestAnimationFrame(P))};requestAnimationFrame(P)};return{initializeContext:(f,d)=>{k=!0;const y=++W;O=f,o||(o=zt(f),a=u(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{a=u()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",$,{passive:!0})),L=d,z(d);let E=0;const P=()=>{y===W&&(E++,E>=Qt?k=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(f,d)=>{const y=f?b(f).storageKey:null,E=y&&T.has(y)?T.get(y):{x:0,y:0},P=d?b(d):null,R=P!=null&&P.preserves?P.storageKey:null,C=R&&T.has(R)?T.get(R):{x:0,y:0};return{x:-C.x+E.x,y:-C.y+E.y}},evictScrollPosition:f=>{T.delete(b(f).storageKey)},shouldPreserve:_,getScrollContainer:()=>o,getPositionedParentElement:()=>O?Bt(O):document.body,getScrollPosition:f=>{const d=f?b(f).storageKey:null;return d&&T.has(d)?T.get(d):{x:0,y:0}},getIsMobile:g}}const St=30,Et=8,Tt=1.2,wt=30,te=600;function ee(){let t=null,n=!1,e=!1,s=null,o=null,a=!1;const l=(h,v)=>{for(let S=0;S<h.length;S++){const m=h.item(S);if(m&&m.identifier===v)return m}return null},u=()=>{s!==null&&(clearTimeout(s),s=null)},g=()=>{o!==null&&(clearTimeout(o),o=null)},b=()=>{n=!0,e=!0,u(),g(),s=setTimeout(()=>{n=!1,e=!1,s=null},te)},_=h=>{if(h.touches.length!==1){t=null;return}const v=h.touches.item(0);if(!v){t=null;return}const S=window.innerWidth,m=v.clientX<=St,w=v.clientX>=S-St;if(!m&&!w){t=null;return}t={identifier:v.identifier,startX:v.clientX,startY:v.clientY,fromLeftEdge:m,moved:!1}},O=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const v=l(h.touches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=v.clientY-t.startY,w=Math.abs(S),I=Math.abs(m);if(I>Et&&I>w*Tt){t=null;return}const f=t.fromLeftEdge?S>0:S<0;w>Et&&w>I*Tt&&f&&(t.moved=!0)},T=h=>{if(!t)return;const v=l(h.changedTouches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=t.fromLeftEdge?S>0:S<0;if(t.moved&&m&&Math.abs(S)>=wt){b(),t=null;return}t.moved&&Math.abs(S)>=wt&&b(),t=null},L=()=>{t&&(t.moved&&b(),t=null)};return{initialize:()=>{if(typeof window>"u"||a)return;a=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",_,h),window.addEventListener("touchmove",O,h),window.addEventListener("touchend",T,h),window.addEventListener("touchcancel",L,h)},destroy:()=>{if(typeof window>"u"||!a)return;a=!1;const h={capture:!0};window.removeEventListener("touchstart",_,h),window.removeEventListener("touchmove",O,h),window.removeEventListener("touchend",T,h),window.removeEventListener("touchcancel",L,h),u(),g(),t=null,n=!1,e=!1},isSwipeBack:()=>{const h=n||e;return h&&u(),h},onPageEnter:()=>{n=!1,u(),g(),o=setTimeout(()=>{e=!1,o=null},0)}}}function ne(){let t=null;function n(){var s,o;t&&((s=t.outResolve)==null||s.call(t,null),(o=t.inResolve)==null||o.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const s={from:t.from,to:t.to};t.outResolve(s),t.inResolve(s),t=null}}return{trigger(s,o){var l;o==="out"&&(t==null?void 0:t.to)===s&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(o==="out"&&t.from&&t.from!==s||o==="in"&&t.to&&t.to!==s)&&n(),t||(t={}),o==="out"?t.from=s:t.to=s},get(s){return new Promise(o=>{t||(t={}),s==="out"?t.outResolve=o:t.inResolve=o,e()})}}}const X=new Map;let Y=null,Pt=!1;function Rt(t,n){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(n))}for(const e of Array.from(t.childNodes))Rt(e,n)}function se(){if(Pt||typeof document>"u")return;Pt=!0,Y=new MutationObserver(n=>{for(const e of n){const s={parent:e.target,nextSibling:e.nextSibling};for(const o of Array.from(e.removedNodes))Rt(o,s)}});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ie(t,n){return se(),X.set(t,n),()=>{X.delete(t)}}const lt=new WeakMap;let Z=null;const j="none !important";function K(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function oe(){return Z||(Z=new MutationObserver(t=>{for(const n of t){const e=n.target,s=lt.get(e);if(!s)continue;const o=K(e);o!==s.accounted&&(s.accounted=o,o===j?(s.reactHidden=!0,s.onHide()):o!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),Z)}function re(t,n){const e=K(t),s={accounted:e,reactHidden:e===j,onHide:n.onHide,onShow:n.onShow};return lt.set(t,s),oe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return K(t)===j},setDisplay(o,a=!1){o===null?t.style.removeProperty("display"):t.style.setProperty("display",o,a?"important":""),s.accounted=K(t)},sync(){s.accounted=K(t),s.reactHidden=s.accounted===j},stop(){lt.delete(t)}}}function ce(t){return Array.isArray(t)}function Ct(t){const n=[];for(const e of t)ce(e)?n.push(...Ct(e)):n.push(e);return n}function le(t,n={}){const{transitions:e=[],middleware:s=(i,r)=>({from:i,to:r}),preserveScroll:o=i=>i}=t,a=n.host??new Mt,l=ne(),u=typeof e=="function"?e:()=>e,g=ee();g.initialize();const b=new Map,_=i=>{let r=b.get(i);return r===void 0&&(r=s(i,i).from,b.set(i,r)),r},{initializeContext:O,calculateScrollOffset:T,evictScrollPosition:L,shouldPreserve:k,getScrollContainer:W,getPositionedParentElement:$,getScrollPosition:z,getIsMobile:h}=Jt({preserveScroll:o,resolvePath:_}),v=new Map,S=()=>{const i=h();let r=v.get(i);return r||(r=Kt(Ct(u({isMobile:i}))),v.set(i,r)),r};let m=null,w=null;const I=new WeakMap,f=i=>{I.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},d=i=>{const r=I.get(i);return r||{parent:i.parentNode,nextSibling:i.nextSibling}},y=new WeakMap,E=new WeakMap;let P=0;const R=i=>{const r=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return r&&r!=="none"?r:"block"},C=(i,r)=>{r.visibleDisplay=i.style.getPropertyValue("display"),r.computedDisplay=R(i)},dt=(i,r)=>{if(E.get(i)!==r)return;E.delete(i);const c=y.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),C(i,c)):(c.vis.setDisplay(null),C(i,c)))},Ot=(i,r,c,p,A)=>{const M=p.element,D=A.element,N=(p.mode??"unmount")==="hidden",{parent:U,nextSibling:tt}=p.parent?{parent:p.parent,nextSibling:p.nextSibling}:d(M),V=T(r,c),et={scrollOffset:V,from:{scroll:z(r)},to:{scroll:z(c)},get scrollingElement(){return W()||document.documentElement},get positionedParent(){return $()}};let x;if(N){x=M,x.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const H=y.get(D);H&&H.savedCss===null&&(H.savedCss=D.style.cssText)}else x=M,Wt(x,et);k(r)||L(r);const G=N?++P:0;N&&(E.set(D,G),E.set(M,G));const yt=Promise.resolve(x),mt=Promise.resolve(D),gt=[],Nt={from:yt,to:mt,context:et,createElement:((H,nt="div")=>{const B=document.createElement(nt);return B.setAttribute("data-ssgoi-id",H),gt.push(B),B})},kt=Promise.resolve(i.prepare?i.prepare(Nt):{});Ft({from:yt,to:mt,extras:kt}).then(({from:H,to:nt,extras:B})=>{!N&&U&&(tt&&U.contains(tt)?U.insertBefore(x,tt):U.appendChild(x));const st=i.animation({from:H,to:nt,context:et,...B}),it=st.onComplete;st.onComplete=()=>{it==null||it(),N?(dt(M,G),dt(D,G)):x.parentNode&&x.parentNode.removeChild(x);for(const ot of gt)ot.parentNode&&ot.parentNode.removeChild(ot)},a.attach(st)})},q=(i,r)=>{const c=g.isSwipeBack();l.trigger(i,r),l.get(r).then(p=>{if(r==="in"&&g.onPageEnter(),!p)return;if(c){r==="out"&&p.from&&!k(p.from)&&L(p.from),m=null,w=null;return}if(r!=="in")return;const{from:A,to:M}=s(p.from,p.to),D=Yt(A,M,S()),J=m,N=w;m=null,w=null,!(!D||!J||!N)&&Ot(D,p.from,p.to,J,N)})},Lt=(i,r)=>{const c=y.get(i);if(!c)return;const p=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",p)return;const A=d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"hidden"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},_t=(i,r)=>{const c=y.get(i);if(!c||c.intent==="visible")return;c.intent="visible",C(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),O(i,r),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const p=i.getAttribute("data-ssgoi-transition")??r;q(p,"in")},Dt=(i,r,c)=>{const p=y.get(i);if(p&&(p.vis.stop(),y.delete(i),E.delete(i),p.intent==="hidden")){(m==null?void 0:m.element)===i&&(m=null),(w==null?void 0:w.element)===i&&(w=null);return}const A=c??d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"unmount"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},ft=new WeakSet,ht=(i,r)=>{if(ft.has(r))return;ft.add(r),f(r);const c=re(r,{onHide:()=>Lt(r,i),onShow:()=>_t(r,i)}),p={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};y.set(r,p),c.isHidden||(C(r,p),O(r,i),w={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},q(i,"in")),ie(r,A=>Dt(r,i,A))},pt=new Map;return{register:ht,refFor:i=>{let r=pt.get(i);return r||(r=c=>{c&&ht(i,c)},pt.set(i,r)),r}}}const xt="data-ssgoi-root",ae=`[${xt}]`,at="data-ssgoi-transition",At=`[${at}]`,ue="[data-ssgoi-clone]";function de(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function fe(t){return t.nodeType===Node.ELEMENT_NODE}function he(t){return t instanceof HTMLElement}function pe(t,n){if(!de())return()=>{};t.setAttribute(xt,"");const e=l=>l.closest(ae)===t,s=l=>{if(!he(l)||!e(l)||l.closest(ue))return;const u=l.getAttribute(at);u!==null&&n.register(u,l)},o=l=>{if(fe(l)){l.matches(At)&&s(l);for(const u of l.querySelectorAll(At))s(u)}},a=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){s(u.target);continue}for(const g of u.addedNodes)o(g)}});return a.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[at]}),o(t),()=>a.disconnect()}exports.Animation=Q.Animation;exports.MultiAnimation=Q.MultiAnimation;exports.WebAnimation=Q.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=le;exports.observeSsgoiTransitions=pe;
package/dist/internal.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var Nt = Object.defineProperty;
2
2
  var kt = (t, n, e) => n in t ? Nt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
3
  var F = (t, n, e) => kt(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { A as It } from "./multi-animation-Ch5rI3rB.js";
5
- import { M as Ee, W as we } from "./multi-animation-Ch5rI3rB.js";
4
+ import { A as It } from "./multi-animation-1FueEz2Q.js";
5
+ import { M as Ee, W as we } from "./multi-animation-1FueEz2Q.js";
6
6
  class Ht extends It {
7
7
  constructor() {
8
8
  super(...arguments);
@@ -1,45 +1,62 @@
1
- var m = Object.defineProperty;
2
- var f = (r, a, t) => a in r ? m(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t;
3
- var n = (r, a, t) => f(r, typeof a != "symbol" ? a + "" : a, t);
4
- class d {
1
+ var g = Object.defineProperty;
2
+ var y = (n, r, t) => r in n ? g(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
+ var s = (n, r, t) => y(n, typeof r != "symbol" ? r + "" : r, t);
4
+ class m {
5
5
  constructor() {
6
6
  /** Current playback rate (1 = realtime, 0 = paused, negative = backwards) */
7
- n(this, "_playbackRate", 1);
7
+ s(this, "_playbackRate", 1);
8
8
  /** Fired every frame with the most recent value. Optional. */
9
- n(this, "onUpdate");
9
+ s(this, "onUpdate");
10
10
  /** Fired once when the animation settles. */
11
- n(this, "onComplete");
11
+ s(this, "onComplete");
12
12
  }
13
13
  get playbackRate() {
14
14
  return this._playbackRate;
15
15
  }
16
- set playbackRate(a) {
17
- this._playbackRate = a;
16
+ set playbackRate(r) {
17
+ this._playbackRate = r;
18
18
  }
19
19
  }
20
- const S = 0.01, w = 0.01, g = 0.05, c = 1e3 / 60;
21
- class R extends d {
20
+ const b = 0.01, C = 0.01, v = 0.05;
21
+ function w(n) {
22
+ return new Promise((r) => {
23
+ requestAnimationFrame(() => {
24
+ requestAnimationFrame(() => {
25
+ r();
26
+ });
27
+ });
28
+ });
29
+ }
30
+ const p = 1e3 / 60;
31
+ class k extends m {
22
32
  constructor(t) {
23
33
  super();
24
- n(this, "element");
25
- n(this, "integrator");
26
- n(this, "styleFn");
27
- n(this, "lowerBound");
28
- n(this, "upperBound");
29
- n(this, "currentValue");
30
- n(this, "currentVelocity", 0);
31
- n(this, "frames", []);
32
- n(this, "waapi", null);
33
- n(this, "startTime", 0);
34
- n(this, "running", !1);
35
- n(this, "paused", !1);
36
- n(this, "settled", !1);
37
- n(this, "reversing", !1);
34
+ s(this, "element");
35
+ s(this, "integrator");
36
+ s(this, "styleFn");
37
+ s(this, "lowerBound");
38
+ s(this, "upperBound");
39
+ s(this, "currentValue");
40
+ s(this, "currentVelocity", 0);
41
+ s(this, "frames", []);
42
+ s(this, "waapi", null);
43
+ s(this, "runId", 0);
44
+ s(this, "waitingForStart", !1);
45
+ s(this, "startReady", !1);
46
+ s(this, "pendingFirstFrame");
47
+ s(this, "running", !1);
48
+ s(this, "paused", !1);
49
+ s(this, "settled", !1);
50
+ s(this, "reversing", !1);
38
51
  this.element = t.element, this.integrator = t.integrator, this.styleFn = t.style, this.lowerBound = t.lowerBound ?? 0, this.upperBound = t.upperBound ?? 1, this.currentValue = this.lowerBound, this.onUpdate = t.onUpdate, this.onComplete = t.onComplete;
39
52
  }
40
53
  play() {
41
54
  if (this.reversing = !1, this.paused && this.waapi) {
42
- this.paused = !1, this.running = !0, this.waapi.play();
55
+ if (this.paused = !1, this.running = !0, this.waitingForStart) {
56
+ this.startReady && this.playPreparedWaapi(this.waapi);
57
+ return;
58
+ }
59
+ this.waapi.play();
43
60
  return;
44
61
  }
45
62
  this.runToward(this.upperBound);
@@ -109,12 +126,12 @@ class R extends d {
109
126
  }
110
127
  getTimeline() {
111
128
  const t = this.frames.map((e) => {
112
- const i = e.position, s = this.lowerBound + this.upperBound - i;
129
+ const i = e.position, a = this.lowerBound + this.upperBound - i;
113
130
  return {
114
131
  time: e.time,
115
132
  value: e.position,
116
133
  velocity: e.velocity,
117
- style: this.styleFn(i, s)
134
+ style: this.styleFn(i, a)
118
135
  };
119
136
  });
120
137
  return [{ element: this.element, frames: t }];
@@ -125,60 +142,74 @@ class R extends d {
125
142
  }
126
143
  /* ───────────────────────────────────────────────────────── private */
127
144
  runToward(t) {
128
- var h;
129
- if (this.running && this.captureLiveState(), this.clearWaapi(), this.running = !1, this.paused = !1, this.settled = !1, this.frames = y(
145
+ var u;
146
+ if (this.running && this.captureLiveState(), this.clearWaapi(), this.running = !1, this.paused = !1, this.settled = !1, this.frames = F(
130
147
  this.integrator,
131
148
  this.currentValue,
132
149
  t,
133
150
  this.currentVelocity
134
151
  ), this.frames.length === 0) {
135
- this.currentValue = t, this.currentVelocity = 0, this.applyStyleAt(t), this.settled = !0, (h = this.onComplete) == null || h.call(this);
152
+ this.currentValue = t, this.currentVelocity = 0, this.applyStyleAt(t), this.settled = !0, (u = this.onComplete) == null || u.call(this);
136
153
  return;
137
154
  }
138
- const e = this.frames.map((o) => {
139
- const u = o.position, p = this.lowerBound + this.upperBound - u;
140
- return this.styleFn(u, p);
141
- }), i = e[0];
142
- if (i)
143
- for (const o of Object.keys(i))
144
- this.element.style[o] = "";
145
- const s = this.frames[this.frames.length - 1], l = s.time;
146
- this.waapi = this.element.animate(e, {
155
+ const e = this.frames.map((c) => {
156
+ const d = c.position, f = this.lowerBound + this.upperBound - d;
157
+ return this.styleFn(d, f);
158
+ }), i = e[0], a = this.frames[this.frames.length - 1], l = a.time, o = ++this.runId, h = this.element.animate(e, {
147
159
  duration: l,
148
- fill: "forwards",
160
+ fill: "both",
149
161
  easing: "linear",
150
162
  composite: "replace"
151
- }), this.waapi.playbackRate = this.playbackRate, this.startTime = performance.now(), this.running = !0, this.waapi.onfinish = () => {
152
- var o;
153
- this.running && (this.running = !1, this.settled = !0, this.currentValue = s.position, this.currentVelocity = 0, (o = this.onComplete) == null || o.call(this));
154
- };
163
+ });
164
+ h.playbackRate = this.playbackRate, h.pause(), h.currentTime = 0, this.waapi = h, this.waitingForStart = !0, this.startReady = !1, this.pendingFirstFrame = i, this.running = !0, h.onfinish = () => {
165
+ var c;
166
+ !this.running || this.waapi !== h || (this.running = !1, this.settled = !0, this.currentValue = a.position, this.currentVelocity = 0, (c = this.onComplete) == null || c.call(this));
167
+ }, this.startWhenReady(h, o);
155
168
  }
156
169
  clearWaapi() {
157
170
  var t;
158
- (t = this.waapi) == null || t.cancel(), this.waapi = null;
171
+ this.runId++, (t = this.waapi) == null || t.cancel(), this.waapi = null, this.waitingForStart = !1, this.startReady = !1, this.pendingFirstFrame = void 0;
159
172
  }
160
173
  captureLiveState() {
161
174
  if (this.frames.length === 0) return;
162
- const t = performance.now() - this.startTime, { position: e, velocity: i } = v(this.frames, t);
175
+ const t = S(this.waapi);
176
+ if (t === null) return;
177
+ const { position: e, velocity: i } = R(this.frames, t);
163
178
  this.currentValue = e, this.currentVelocity = i;
164
179
  }
180
+ async startWhenReady(t, e) {
181
+ try {
182
+ await t.ready, typeof requestAnimationFrame < "u" && await w(this.element);
183
+ } catch {
184
+ return;
185
+ }
186
+ this.runId !== e || this.waapi !== t || (this.startReady = !0, !(!this.running || this.paused) && this.playPreparedWaapi(t));
187
+ }
188
+ playPreparedWaapi(t) {
189
+ if (!(this.waapi !== t || !this.waitingForStart || !this.startReady)) {
190
+ if (this.pendingFirstFrame)
191
+ for (const e of Object.keys(this.pendingFirstFrame))
192
+ this.element.style[e] = "";
193
+ this.waitingForStart = !1, this.startReady = !1, this.pendingFirstFrame = void 0, t.play();
194
+ }
195
+ }
165
196
  applyStyleAt(t) {
166
197
  const e = this.lowerBound + this.upperBound - t, i = this.styleFn(t, e);
167
- for (const [s, l] of Object.entries(i))
168
- this.element.style[s] = typeof l == "number" ? String(l) : l;
198
+ for (const [a, l] of Object.entries(i))
199
+ this.element.style[a] = typeof l == "number" ? String(l) : l;
169
200
  }
170
201
  }
171
- function y(r, a, t, e) {
172
- if (a === t && e === 0) return [];
202
+ function F(n, r, t, e) {
203
+ if (r === t && e === 0) return [];
173
204
  const i = 600;
174
- let s = { position: a, velocity: e }, l = 0;
175
- const h = [];
176
- for (let o = 0; o < i; o++) {
177
- const u = o * c;
178
- if (h.push({ time: u, position: s.position, velocity: s.velocity }), s = r.step(s, t, c / 1e3), r.isSettled(s, t)) {
179
- if (l += c / 1e3, l >= g) {
180
- h.push({
181
- time: (o + 1) * c,
205
+ let a = { position: r, velocity: e }, l = 0;
206
+ const o = [];
207
+ for (let h = 0; h < i; h++) {
208
+ const u = h * p;
209
+ if (o.push({ time: u, position: a.position, velocity: a.velocity }), a = n.step(a, t, p / 1e3), n.isSettled(a, t)) {
210
+ if (l += p / 1e3, l >= v) {
211
+ o.push({
212
+ time: (h + 1) * p,
182
213
  position: t,
183
214
  velocity: 0
184
215
  });
@@ -187,35 +218,39 @@ function y(r, a, t, e) {
187
218
  } else
188
219
  l = 0;
189
220
  }
190
- return h;
221
+ return o;
191
222
  }
192
- function v(r, a) {
193
- if (r.length === 0) return { position: 0, velocity: 0 };
194
- const t = r[0], e = r[r.length - 1];
195
- if (a <= 0)
223
+ function R(n, r) {
224
+ if (n.length === 0) return { position: 0, velocity: 0 };
225
+ const t = n[0], e = n[n.length - 1];
226
+ if (r <= 0)
196
227
  return { position: t.position, velocity: t.velocity };
197
- if (a >= e.time)
228
+ if (r >= e.time)
198
229
  return { position: e.position, velocity: e.velocity };
199
- let i = 0, s = r.length - 1;
200
- for (; i < s - 1; ) {
201
- const u = i + s >> 1;
202
- r[u].time <= a ? i = u : s = u;
230
+ let i = 0, a = n.length - 1;
231
+ for (; i < a - 1; ) {
232
+ const u = i + a >> 1;
233
+ n[u].time <= r ? i = u : a = u;
203
234
  }
204
- const l = r[i], h = r[s], o = (a - l.time) / (h.time - l.time);
235
+ const l = n[i], o = n[a], h = (r - l.time) / (o.time - l.time);
205
236
  return {
206
- position: l.position + (h.position - l.position) * o,
207
- velocity: l.velocity + (h.velocity - l.velocity) * o
237
+ position: l.position + (o.position - l.position) * h,
238
+ velocity: l.velocity + (o.velocity - l.velocity) * h
208
239
  };
209
240
  }
210
- class b extends d {
241
+ function S(n) {
242
+ const r = n == null ? void 0 : n.currentTime;
243
+ return typeof r == "number" ? r : null;
244
+ }
245
+ class A extends m {
211
246
  constructor(t, e = {}) {
212
247
  super();
213
- n(this, "children");
214
- n(this, "startAt");
215
- n(this, "pendingComplete", 0);
216
- n(this, "running", !1);
217
- n(this, "pendingStartTimers", []);
218
- this.children = t, (e.mode ?? "parallel") === "sequence" ? this.startAt = t.map((i, s) => s === 0 ? 0 : 1) : this.startAt = e.startAt ?? [];
248
+ s(this, "children");
249
+ s(this, "startAt");
250
+ s(this, "pendingComplete", 0);
251
+ s(this, "running", !1);
252
+ s(this, "pendingStartTimers", []);
253
+ this.children = t, (e.mode ?? "parallel") === "sequence" ? this.startAt = t.map((i, a) => a === 0 ? 0 : 1) : this.startAt = e.startAt ?? [];
219
254
  }
220
255
  play() {
221
256
  this.startRun("play");
@@ -290,21 +325,21 @@ class b extends d {
290
325
  this.children[t][e]();
291
326
  const i = t + 1;
292
327
  if (i >= this.children.length) return;
293
- const s = this.startAt[i];
294
- if (s === void 0 || s <= 0) {
328
+ const a = this.startAt[i];
329
+ if (a === void 0 || a <= 0) {
295
330
  this.scheduleStart(i, e);
296
331
  return;
297
332
  }
298
- const l = this.children[t].findTimeForProgress(s);
333
+ const l = this.children[t].findTimeForProgress(a);
299
334
  if (l === null || l <= 0) {
300
335
  this.scheduleStart(i, e);
301
336
  return;
302
337
  }
303
- const h = Math.abs(this.playbackRate) || 1, o = l / h, u = setTimeout(() => {
338
+ const o = Math.abs(this.playbackRate) || 1, h = l / o, u = setTimeout(() => {
304
339
  this.pendingStartTimers = this.pendingStartTimers.filter(
305
- (p) => p !== u
340
+ (c) => c !== u
306
341
  ), this.running && this.scheduleStart(i, e);
307
- }, o);
342
+ }, h);
308
343
  this.pendingStartTimers.push(u);
309
344
  }
310
345
  clearPendingStartTimers() {
@@ -323,10 +358,10 @@ class b extends d {
323
358
  }
324
359
  }
325
360
  export {
326
- d as A,
327
- b as M,
328
- S as P,
329
- g as S,
330
- w as V,
331
- R as W
361
+ m as A,
362
+ A as M,
363
+ b as P,
364
+ v as S,
365
+ C as V,
366
+ k as W
332
367
  };
@@ -0,0 +1 @@
1
+ "use strict";var y=Object.defineProperty;var S=(n,r,t)=>r in n?y(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t;var s=(n,r,t)=>S(n,typeof r!="symbol"?r+"":r,t);class d{constructor(){s(this,"_playbackRate",1);s(this,"onUpdate");s(this,"onComplete")}get playbackRate(){return this._playbackRate}set playbackRate(r){this._playbackRate=r}}const v=.01,R=.01,f=.05;function T(n){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{r()})})})}const p=1e3/60;class w extends d{constructor(t){super();s(this,"element");s(this,"integrator");s(this,"styleFn");s(this,"lowerBound");s(this,"upperBound");s(this,"currentValue");s(this,"currentVelocity",0);s(this,"frames",[]);s(this,"waapi",null);s(this,"runId",0);s(this,"waitingForStart",!1);s(this,"startReady",!1);s(this,"pendingFirstFrame");s(this,"running",!1);s(this,"paused",!1);s(this,"settled",!1);s(this,"reversing",!1);this.element=t.element,this.integrator=t.integrator,this.styleFn=t.style,this.lowerBound=t.lowerBound??0,this.upperBound=t.upperBound??1,this.currentValue=this.lowerBound,this.onUpdate=t.onUpdate,this.onComplete=t.onComplete}play(){if(this.reversing=!1,this.paused&&this.waapi){if(this.paused=!1,this.running=!0,this.waitingForStart){this.startReady&&this.playPreparedWaapi(this.waapi);return}this.waapi.play();return}this.runToward(this.upperBound)}reverse(){this.reversing=!0,this.runToward(this.lowerBound)}pause(){var t;this.running&&(this.captureLiveState(),(t=this.waapi)==null||t.pause(),this.running=!1,this.paused=!0)}complete(){var t;this.clearWaapi(),this.running=!1,this.paused=!1,this.currentValue=this.upperBound,this.currentVelocity=0,this.applyStyleAt(this.currentValue),this.settled=!0,(t=this.onComplete)==null||t.call(this)}releaseFill(){this.clearWaapi()}get isAnimating(){return this.running}get isPaused(){return this.paused}get isComplete(){return this.settled}get isReversing(){return this.reversing}get progress(){this.running&&this.captureLiveState();const t=this.upperBound-this.lowerBound;if(t===0)return 0;const e=(this.currentValue-this.lowerBound)/t;return e<0?0:e>1?1:e}findTimeForProgress(t){if(this.frames.length<2)return null;const e=this.upperBound-this.lowerBound;if(e===0)return 0;for(const i of this.frames)if((i.position-this.lowerBound)/e>=t)return i.time;return this.frames[this.frames.length-1].time}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t,this.waapi&&(this.waapi.playbackRate=t)}getPose(){return this.running&&this.captureLiveState(),[{element:this.element,value:this.currentValue,velocity:this.currentVelocity}]}getTimeline(){const t=this.frames.map(e=>{const i=e.position,a=this.lowerBound+this.upperBound-i;return{time:e.time,value:e.position,velocity:e.velocity,style:this.styleFn(i,a)}});return[{element:this.element,frames:t}]}matchInto(t){const e=t.find(i=>i.element===this.element);e&&(this.currentValue=e.value,this.currentVelocity=e.velocity)}runToward(t){var u;if(this.running&&this.captureLiveState(),this.clearWaapi(),this.running=!1,this.paused=!1,this.settled=!1,this.frames=F(this.integrator,this.currentValue,t,this.currentVelocity),this.frames.length===0){this.currentValue=t,this.currentVelocity=0,this.applyStyleAt(t),this.settled=!0,(u=this.onComplete)==null||u.call(this);return}const e=this.frames.map(c=>{const m=c.position,g=this.lowerBound+this.upperBound-m;return this.styleFn(m,g)}),i=e[0],a=this.frames[this.frames.length-1],l=a.time,o=++this.runId,h=this.element.animate(e,{duration:l,fill:"both",easing:"linear",composite:"replace"});h.playbackRate=this.playbackRate,h.pause(),h.currentTime=0,this.waapi=h,this.waitingForStart=!0,this.startReady=!1,this.pendingFirstFrame=i,this.running=!0,h.onfinish=()=>{var c;!this.running||this.waapi!==h||(this.running=!1,this.settled=!0,this.currentValue=a.position,this.currentVelocity=0,(c=this.onComplete)==null||c.call(this))},this.startWhenReady(h,o)}clearWaapi(){var t;this.runId++,(t=this.waapi)==null||t.cancel(),this.waapi=null,this.waitingForStart=!1,this.startReady=!1,this.pendingFirstFrame=void 0}captureLiveState(){if(this.frames.length===0)return;const t=A(this.waapi);if(t===null)return;const{position:e,velocity:i}=b(this.frames,t);this.currentValue=e,this.currentVelocity=i}async startWhenReady(t,e){try{await t.ready,typeof requestAnimationFrame<"u"&&await T(this.element)}catch{return}this.runId!==e||this.waapi!==t||(this.startReady=!0,!(!this.running||this.paused)&&this.playPreparedWaapi(t))}playPreparedWaapi(t){if(!(this.waapi!==t||!this.waitingForStart||!this.startReady)){if(this.pendingFirstFrame)for(const e of Object.keys(this.pendingFirstFrame))this.element.style[e]="";this.waitingForStart=!1,this.startReady=!1,this.pendingFirstFrame=void 0,t.play()}}applyStyleAt(t){const e=this.lowerBound+this.upperBound-t,i=this.styleFn(t,e);for(const[a,l]of Object.entries(i))this.element.style[a]=typeof l=="number"?String(l):l}}function F(n,r,t,e){if(r===t&&e===0)return[];const i=600;let a={position:r,velocity:e},l=0;const o=[];for(let h=0;h<i;h++){const u=h*p;if(o.push({time:u,position:a.position,velocity:a.velocity}),a=n.step(a,t,p/1e3),n.isSettled(a,t)){if(l+=p/1e3,l>=f){o.push({time:(h+1)*p,position:t,velocity:0});break}}else l=0}return o}function b(n,r){if(n.length===0)return{position:0,velocity:0};const t=n[0],e=n[n.length-1];if(r<=0)return{position:t.position,velocity:t.velocity};if(r>=e.time)return{position:e.position,velocity:e.velocity};let i=0,a=n.length-1;for(;i<a-1;){const u=i+a>>1;n[u].time<=r?i=u:a=u}const l=n[i],o=n[a],h=(r-l.time)/(o.time-l.time);return{position:l.position+(o.position-l.position)*h,velocity:l.velocity+(o.velocity-l.velocity)*h}}function A(n){const r=n==null?void 0:n.currentTime;return typeof r=="number"?r:null}class C extends d{constructor(t,e={}){super();s(this,"children");s(this,"startAt");s(this,"pendingComplete",0);s(this,"running",!1);s(this,"pendingStartTimers",[]);this.children=t,(e.mode??"parallel")==="sequence"?this.startAt=t.map((i,a)=>a===0?0:1):this.startAt=e.startAt??[]}play(){this.startRun("play")}reverse(){this.startRun("reverse")}pause(){this.running=!1,this.clearPendingStartTimers();for(const t of this.children)t.pause()}complete(){var t;this.running=!1,this.clearPendingStartTimers();for(const e of this.children)e.complete();(t=this.onComplete)==null||t.call(this)}get progress(){if(this.children.length===0)return 0;let t=0;for(const e of this.children)t+=e.progress;return t/this.children.length}getPose(){return this.children.flatMap(t=>t.getPose())}getTimeline(){return this.children.flatMap(t=>t.getTimeline())}matchInto(t){}get isAnimating(){return this.children.some(t=>t.isAnimating)}get isPaused(){return this.children.some(t=>t.isPaused)&&this.children.every(t=>t.isPaused||t.isComplete)}get isComplete(){return this.children.every(t=>t.isComplete)}get isReversing(){return this.children.some(t=>t.isReversing)}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t;for(const e of this.children)e.playbackRate=t}startRun(t){if(this.running&&this.pause(),this.running=!0,this.pendingComplete=this.children.length,this.pendingComplete===0){this.handleFinished();return}for(const e of this.children){const i=e.onComplete;e.onComplete=()=>{i==null||i(),this.handleChildComplete()}}this.scheduleStart(0,t)}scheduleStart(t,e){if(!this.running||t>=this.children.length)return;this.children[t][e]();const i=t+1;if(i>=this.children.length)return;const a=this.startAt[i];if(a===void 0||a<=0){this.scheduleStart(i,e);return}const l=this.children[t].findTimeForProgress(a);if(l===null||l<=0){this.scheduleStart(i,e);return}const o=Math.abs(this.playbackRate)||1,h=l/o,u=setTimeout(()=>{this.pendingStartTimers=this.pendingStartTimers.filter(c=>c!==u),this.running&&this.scheduleStart(i,e)},h);this.pendingStartTimers.push(u)}clearPendingStartTimers(){for(const t of this.pendingStartTimers)clearTimeout(t);this.pendingStartTimers=[]}handleChildComplete(){this.pendingComplete--,this.pendingComplete<=0&&this.handleFinished()}handleFinished(){var t;this.running=!1,this.clearPendingStartTimers(),(t=this.onComplete)==null||t.call(this)}findTimeForProgress(t){return null}}exports.Animation=d;exports.MultiAnimation=C;exports.POSITION_THRESHOLD=v;exports.SETTLE_THRESHOLD=f;exports.VELOCITY_THRESHOLD=R;exports.WebAnimation=w;
@@ -7,8 +7,10 @@ import { DirectionalTransitionPaths } from '../utils';
7
7
  * - `"scale"` — the background scales down slightly behind the rising sheet.
8
8
  * This is the new name for the legacy `"background-scale"` value; the
9
9
  * underlying behavior is unchanged.
10
+ * - `"blur"` — the background blurs and recedes (subtle scale + dim) behind the
11
+ * rising sheet, the way a modal pushes the page underneath out of focus.
10
12
  */
11
- export type SheetType = "static" | "scale";
13
+ export type SheetType = "static" | "scale" | "blur";
12
14
  /**
13
15
  * Legacy public `type` value, kept for source compatibility only.
14
16
  *
@@ -26,6 +28,10 @@ export type SheetConfig = DirectionalTransitionPaths & ({
26
28
  type: "scale";
27
29
  variant?: "default";
28
30
  options?: Record<string, never>;
31
+ } | {
32
+ type: "blur";
33
+ variant?: "default";
34
+ options?: Record<string, never>;
29
35
  } | {
30
36
  /**
31
37
  * @deprecated Do not use in new code. v6 only supports `{ type, variant, options }`.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAIlB;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,0BAA0B,GAClD,CACI;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,OAAO,CAA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AE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CAAE,GACtE;IACE;;;;;OAKG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACjC,CACJ,CAAC;AAiBJ,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAUhE"}
@@ -0,0 +1,14 @@
1
+ import { SheetProvider } from '../types';
2
+ /**
3
+ * `blur` sheet tone — the background page blurs and recedes behind the rising
4
+ * sheet, the way a modal pushes the page underneath out of focus.
5
+ *
6
+ * The blur lives on a *separate* overlay layer (a `backdrop-filter` between the
7
+ * background and the sheet) rather than on the background element itself. That
8
+ * keeps the frost uniform and decoupled from the background's clip + scale —
9
+ * applying `filter: blur` directly to the clipped/scaled page would hard-cut
10
+ * the blur halo at the clip edge and ride the scale transform. The background
11
+ * only carries the recede (a small scale + dim); the overlay owns the blur.
12
+ */
13
+ export declare function createBlurProvider(): SheetProvider;
14
+ //# sourceMappingURL=blur.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/sheet/provider/blur.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA8B9C;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,aAAa,CAwClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/sheet/provider/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAG5D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/sheet/provider/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAI5D,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import { TransitionConfig } from '../../types/index.ts';
2
2
  import { SheetOptions } from './types';
3
3
  export type { SheetOptions, SheetType } from './types';
4
- export declare const sheet: (options?: SheetOptions) => TransitionConfig;
4
+ /** Prepare → animation hand-off: the optional backdrop-filter overlay layer. */
5
+ interface SheetExtras {
6
+ overlay?: HTMLElement;
7
+ }
8
+ export declare const sheet: (options?: SheetOptions) => TransitionConfig<SheetExtras>;
5
9
  //# sourceMappingURL=transition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/sheet/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAS/C,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,SAAS,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKvD,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,gBAgLlD,CAAC"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/sheet/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAS/C,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,SAAS,CAAC;AAEvD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKvD,gFAAgF;AAChF,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,eAAO,MAAM,KAAK,GAChB,UAAS,YAAiB,KACzB,gBAAgB,CAAC,WAAW,CA+O9B,CAAC"}
@@ -9,7 +9,7 @@ import { PhysicsOptions } from '../../types/index.ts';
9
9
  *
10
10
  * @internal
11
11
  */
12
- export type SheetType = "static" | "background-scale";
12
+ export type SheetType = "static" | "background-scale" | "blur";
13
13
  export type SheetDirection = "enter" | "exit";
14
14
  export interface SheetOptions {
15
15
  type?: SheetType;
@@ -21,9 +21,24 @@ export interface SheetBackgroundConfig {
21
21
  enterStyle: (t: number, u: number) => SheetStyle;
22
22
  exitStyle: (t: number) => SheetStyle;
23
23
  }
24
+ /**
25
+ * A separate full-viewport layer that sits *between* the background page and
26
+ * the foreground sheet (at `Z_OVERLAY`). Used by the `blur` tone to drive a
27
+ * `backdrop-filter` independently of the background's own clip + scale — the
28
+ * background recedes (clipped, scaled) while this layer frosts it uniformly,
29
+ * the way the zoom `blur` tone separates its blur overlay from the tile.
30
+ */
31
+ export interface SheetOverlayConfig {
32
+ willChange: string;
33
+ initialStyle: Record<string, string>;
34
+ /** `progress` is the raw animation t (0 → 1) for the active direction. */
35
+ style: (direction: SheetDirection, progress: number) => SheetStyle;
36
+ }
24
37
  export interface SheetProvider {
25
38
  enterPhysics: PhysicsOptions;
26
39
  exitPhysics: PhysicsOptions;
27
40
  background: SheetBackgroundConfig;
41
+ /** Only set by tones that need a backdrop-filter layer (currently `blur`). */
42
+ overlay?: SheetOverlayConfig;
28
43
  }
29
44
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/sheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAA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,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,0EAA0E;IAC1E,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAC;CACpE;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,qBAAqB,CAAC;IAClC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC;AAkEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAehD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC;AAqEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CA2BhD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/zoom/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAW/D,OAAO,KAAK,EACV,qBAAqB,EAGrB,UAAU,EAKX,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAsT5E,eAAO,MAAM,IAAI,GACf,SAAS,qBAAqB,KAC7B,gBAAgB,CAAC,UAAU,CAqG7B,CAAC"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/zoom/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAW/D,OAAO,KAAK,EACV,qBAAqB,EAGrB,UAAU,EAKX,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAsT5E,eAAO,MAAM,IAAI,GACf,SAAS,qBAAqB,KAC7B,gBAAgB,CAAC,UAAU,CAsG7B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { PhysicsOptions } from '../../types/index.ts';
1
+ import { PhysicsOptions, SsgoiTransitionContext } from '../../types/index.ts';
2
2
  import { Animation } from '../../animation';
3
3
  export type ZoomType = "expand" | "static" | "blur";
4
4
  export type ZoomVariant = "default" | "fade";
@@ -82,6 +82,11 @@ export interface ZoomContributeCtx {
82
82
  input: ZoomAnimationInput;
83
83
  physics: PhysicsOptions;
84
84
  extras: ZoomExtras;
85
+ /**
86
+ * Full transition context — strategies that stage viewport-aligned layers
87
+ * (the blur overlay) need the live scroll position + scrolling element.
88
+ */
89
+ context: SsgoiTransitionContext;
85
90
  /**
86
91
  * Mutation registry. Strategies push restore callbacks here; the
87
92
  * dispatcher fires them on completion. Keeps cleanup local to each
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/zoom/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMjD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAS7C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;CACtB;AAMD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,eAAe,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,C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AAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAE9D;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,EAAE,CAAC;CACtD"}
@@ -14,4 +14,22 @@ export declare function getViewportRect(context: SsgoiTransitionContext, side: "
14
14
  width: number;
15
15
  height: number;
16
16
  };
17
+ /**
18
+ * Vertical placement for an absolute backdrop-filter overlay that lives inside
19
+ * `positionedParent` but must cover the scrolling element's visible viewport
20
+ * regardless of scroll (the blur tone of sheet / zoom).
21
+ *
22
+ * Unlike {@link getViewportRect} — which sizes a page element's own clipped
23
+ * slice in its own box — the overlay is a separate layer whose absolute
24
+ * coordinates are relative to `positionedParent`. During a transition the
25
+ * container is scrolled to the chosen side's position, so an `inset: 0` overlay
26
+ * would ride that scroll and leave the bottom `scroll.y` px unblurred. To land
27
+ * the overlay at the live viewport top instead, its content-space `top` backs
28
+ * out both the scroll (`scroll.y`) and `positionedParent`'s own offset within
29
+ * the scroller (`offsetTop`); its height is the full viewport (`clientHeight`).
30
+ */
31
+ export declare function getOverlayRect(context: SsgoiTransitionContext, side: "from" | "to"): {
32
+ top: number;
33
+ height: number;
34
+ };
17
35
  //# sourceMappingURL=get-viewport-rect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-viewport-rect.d.ts","sourceRoot":"","sources":["../../src/lib/utils/get-viewport-rect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGrD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,GAAG,IAAI;;;;;EAcpB"}
1
+ {"version":3,"file":"get-viewport-rect.d.ts","sourceRoot":"","sources":["../../src/lib/utils/get-viewport-rect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGrD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,GAAG,IAAI;;;;;EAcpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,GAAG,IAAI;;;EAYpB"}