@ssgoi/core 6.6.1 → 6.6.2
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/README.md
CHANGED
|
@@ -42,11 +42,12 @@ npm install @ssgoi/react
|
|
|
42
42
|
|
|
43
43
|
### Add Transitions in 30 Seconds
|
|
44
44
|
|
|
45
|
-
#### 1. Wrap your app
|
|
45
|
+
#### 1. Wrap your React app
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
48
|
import { Ssgoi } from "@ssgoi/react";
|
|
49
49
|
import { fade } from "@ssgoi/react/view-transitions";
|
|
50
|
+
import { SsgoiTransitionBoundary } from "./ssgoi-transition-boundary";
|
|
50
51
|
|
|
51
52
|
const config = {
|
|
52
53
|
transitions: [fade({ paths: ["/", "/about"] })],
|
|
@@ -55,19 +56,20 @@ const config = {
|
|
|
55
56
|
export default function App() {
|
|
56
57
|
return (
|
|
57
58
|
<Ssgoi config={config}>
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
<SsgoiTransitionBoundary className="relative z-0 min-h-dvh bg-white">
|
|
60
|
+
{/* Your app */}
|
|
61
|
+
</SsgoiTransitionBoundary>
|
|
60
62
|
</Ssgoi>
|
|
61
63
|
);
|
|
62
64
|
}
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
#### 2.
|
|
67
|
+
#### 2. Keep React pages unmarked
|
|
66
68
|
|
|
67
69
|
```tsx
|
|
68
70
|
export default function HomePage() {
|
|
69
71
|
return (
|
|
70
|
-
<main
|
|
72
|
+
<main>
|
|
71
73
|
<h1>Welcome</h1>
|
|
72
74
|
{/* Page content */}
|
|
73
75
|
</main>
|
|
@@ -75,6 +77,50 @@ export default function HomePage() {
|
|
|
75
77
|
}
|
|
76
78
|
```
|
|
77
79
|
|
|
80
|
+
For React adapters, create one router-specific `SsgoiTransitionBoundary` utility in your layout.
|
|
81
|
+
It reads the current pathname internally, sets the transition boundary key, and
|
|
82
|
+
uses that pathname as a logical page id matched by config such as
|
|
83
|
+
`/products/*`. Use `/products/**` when the parent path itself should match too.
|
|
84
|
+
|
|
85
|
+
Next.js implementation:
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
"use client";
|
|
89
|
+
|
|
90
|
+
import { type ElementType, type ReactNode } from "react";
|
|
91
|
+
import { usePathname } from "next/navigation";
|
|
92
|
+
|
|
93
|
+
export function SsgoiTransitionBoundary({
|
|
94
|
+
children,
|
|
95
|
+
as,
|
|
96
|
+
className,
|
|
97
|
+
}: {
|
|
98
|
+
children: ReactNode;
|
|
99
|
+
as?: ElementType;
|
|
100
|
+
className?: string;
|
|
101
|
+
}) {
|
|
102
|
+
const pathname = usePathname();
|
|
103
|
+
const Component = as ?? "div";
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<Component
|
|
107
|
+
key={pathname}
|
|
108
|
+
data-ssgoi-transition={pathname}
|
|
109
|
+
className={className}
|
|
110
|
+
>
|
|
111
|
+
{children}
|
|
112
|
+
</Component>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
React Router and TanStack Router use the same component body with their own
|
|
118
|
+
pathname hook.
|
|
119
|
+
|
|
120
|
+
For SvelteKit, Nuxt/Vue, Solid, and Angular, mark each routed page boundary
|
|
121
|
+
directly with `data-ssgoi-transition` instead of using a layout-level utility.
|
|
122
|
+
The value can be a hard-coded logical id; it only has to match your config.
|
|
123
|
+
|
|
78
124
|
**That's it!** Your configured pages now transition smoothly with a fade effect.
|
|
79
125
|
|
|
80
126
|
## Advanced Transitions
|
package/dist/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ot=Object.defineProperty;var _t=(t,s,e)=>s in t?Ot(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var F=(t,s,e)=>_t(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("./multi-animation-uzEnQnrG.cjs");class St extends J.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const n=this.child;if(this.child=e,this._settled=!1,n){const a=n.getPose();n.complete(),e.matchInto(a)}e.playbackRate=this.playbackRate;const l=e.onComplete;e.onComplete=()=>{l==null||l(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const p=e.onUpdate;e.onUpdate=a=>{var g;p==null||p(a),(g=this.onUpdate)==null||g.call(this,a),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 n;return((n=this.child)==null?void 0:n.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 n;(n=this.child)==null||n.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 kt=(t,s)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=s==null?void 0:s.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},yt=new Set(["auto","scroll","overlay"]),Dt=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s);if(yt.has(e.overflowY)||yt.has(e.overflowX))return s;s=s.parentElement}return document.documentElement},Nt=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return s;s=s.parentElement}return document.body};function Ht(t){const s=Object.keys(t);return Promise.all(s.map(e=>t[e])).then(e=>{const n={};return s.forEach((l,p)=>{n[l]=e[p]}),n})}function It(t){const s=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...s]}function K(t,s){if(s==="*")return!0;if(s.endsWith("/*")){const e=s.slice(0,-1);return t.startsWith(e)&&t.length>e.length}return t===s}function Wt(t,s,e){for(const n of e)if(K(t,n.from)&&K(s,n.to))return n.transition;for(const n of e)if((n.from==="*"||K(t,n.from))&&(n.to==="*"||K(s,n.to)))return n.transition;return null}const Ft=768,Kt=10,Bt=10;function Xt(t={}){const{preserveScroll:s=u=>u}=t,e=typeof s=="function"?s:()=>s;let n=null,l=!1,p=!1;const a=()=>{const u=(n==null?void 0:n.clientWidth)??0,c=u>0?u:typeof window<"u"?window.innerWidth:0;return c>0&&c<Ft},g=()=>(p||(l=a(),p=!0),l),v=u=>{var E;const c=e(g());if(c===!1)return{preserves:!1,shared:!1,storageKey:`path:${u}`};if(c===!0)return{preserves:!0,shared:!1,storageKey:`path:${u}`};const m=((E=c.exclude)==null?void 0:E.some(T=>K(u,T)))??!1,w=!m&&!!c.key;return{preserves:!m,shared:w,storageKey:w?`shared:${c.key}`:`path:${u}`}},C=u=>v(u).preserves;let x=null;const b=new Map;let M=null,L=!1,H=0;const I=()=>{n&&M&&!L&&b.set(v(M).storageKey,{x:n.scrollLeft,y:n.scrollTop})},z=u=>{if(!n)return;const c=v(u);if(c.preserves&&c.shared&&!b.has(c.storageKey))return;const m=c.preserves&&b.has(c.storageKey)?b.get(c.storageKey):{x:0,y:0};let w=0;const E=()=>{if(!n)return;n.scrollTo({top:m.y,left:m.x}),!(Math.abs(n.scrollTop-m.y)<1&&Math.abs(n.scrollLeft-m.x)<1)&&w<Kt&&(w++,requestAnimationFrame(E))};requestAnimationFrame(E)};return{initializeContext:(u,c)=>{L=!0;const m=++H;x=u,n||(n=Dt(u),l=a(),p=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{l=a()}).observe(n),(n===document.documentElement?window:n).addEventListener("scroll",I,{passive:!0})),M=c,z(c);let w=0;const E=()=>{m===H&&(w++,w>=Bt?L=!1:requestAnimationFrame(E))};requestAnimationFrame(E)},calculateScrollOffset:(u,c)=>{const m=u?v(u).storageKey:null,w=m&&b.has(m)?b.get(m):{x:0,y:0},E=c?v(c):null,T=E!=null&&E.preserves?E.storageKey:null,N=T&&b.has(T)?b.get(T):{x:0,y:0};return{x:-N.x+w.x,y:-N.y+w.y}},evictScrollPosition:u=>{b.delete(v(u).storageKey)},shouldPreserve:C,getScrollContainer:()=>n,getPositionedParentElement:()=>x?Nt(x):document.body,getScrollPosition:u=>{const c=u?v(u).storageKey:null;return c&&b.has(c)?b.get(c):{x:0,y:0}},getIsMobile:g}}const pt=30,gt=8,mt=1.2,vt=30,zt=600;function $t(){let t=null,s=!1,e=!1,n=null,l=null,p=!1;const a=(d,f)=>{for(let h=0;h<d.length;h++){const S=d.item(h);if(S&&S.identifier===f)return S}return null},g=()=>{n!==null&&(clearTimeout(n),n=null)},v=()=>{l!==null&&(clearTimeout(l),l=null)},C=()=>{s=!0,e=!0,g(),v(),n=setTimeout(()=>{s=!1,e=!1,n=null},zt)},x=d=>{if(d.touches.length!==1){t=null;return}const f=d.touches.item(0);if(!f){t=null;return}const h=window.innerWidth,S=f.clientX<=pt,O=f.clientX>=h-pt;if(!S&&!O){t=null;return}t={identifier:f.identifier,startX:f.clientX,startY:f.clientY,fromLeftEdge:S,moved:!1}},b=d=>{if(!t)return;if(d.touches.length!==1){t=null;return}const f=a(d.touches,t.identifier);if(!f){t=null;return}const h=f.clientX-t.startX,S=f.clientY-t.startY,O=Math.abs(h),u=Math.abs(S);if(u>gt&&u>O*mt){t=null;return}const c=t.fromLeftEdge?h>0:h<0;O>gt&&O>u*mt&&c&&(t.moved=!0)},M=d=>{if(!t)return;const f=a(d.changedTouches,t.identifier);if(!f){t=null;return}const h=f.clientX-t.startX,S=t.fromLeftEdge?h>0:h<0;if(t.moved&&S&&Math.abs(h)>=vt){C(),t=null;return}t.moved&&Math.abs(h)>=vt&&C(),t=null},L=()=>{t&&(t.moved&&C(),t=null)};return{initialize:()=>{if(typeof window>"u"||p)return;p=!0;const d={passive:!0,capture:!0};window.addEventListener("touchstart",x,d),window.addEventListener("touchmove",b,d),window.addEventListener("touchend",M,d),window.addEventListener("touchcancel",L,d)},destroy:()=>{if(typeof window>"u"||!p)return;p=!1;const d={capture:!0};window.removeEventListener("touchstart",x,d),window.removeEventListener("touchmove",b,d),window.removeEventListener("touchend",M,d),window.removeEventListener("touchcancel",L,d),g(),v(),t=null,s=!1,e=!1},isSwipeBack:()=>{const d=s||e;return d&&g(),d},onPageEnter:()=>{s=!1,g(),v(),l=setTimeout(()=>{e=!1,l=null},0)}}}function qt(){let t=null;function s(){var n,l;t&&((n=t.outResolve)==null||n.call(t,null),(l=t.inResolve)==null||l.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){s();return}const n={from:t.from,to:t.to};t.outResolve(n),t.inResolve(n),t=null}}return{trigger(n,l){var a;l==="out"&&(t==null?void 0:t.to)===n&&!t.from&&((a=t.inResolve)==null||a.call(t,null),t={}),t&&(l==="out"&&t.from&&t.from!==n||l==="in"&&t.to&&t.to!==n)&&s(),t||(t={}),l==="out"?t.from=n:t.to=n},get(n){return new Promise(l=>{t||(t={}),n==="out"?t.outResolve=l:t.inResolve=l,e()})}}}const X=new Map;let G=null,bt=!1;function wt(t,s){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(s))}for(const e of Array.from(t.childNodes))wt(e,s)}function Vt(){if(bt||typeof document>"u")return;bt=!0,G=new MutationObserver(s=>{for(const e of s){const n={parent:e.target,nextSibling:e.nextSibling};for(const l of Array.from(e.removedNodes))wt(l,n)}});const t=()=>{G==null||G.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function Ut(t,s){return Vt(),X.set(t,s),()=>{X.delete(t)}}const rt=new WeakMap;let j=null;const Z="none !important";function B(t){const s=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${s} !important`:s}function Yt(){return j||(j=new MutationObserver(t=>{for(const s of t){const e=s.target,n=rt.get(e);if(!n)continue;const l=B(e);l!==n.accounted&&(n.accounted=l,l===Z?(n.reactHidden=!0,n.onHide()):l!=="none"&&n.reactHidden&&(n.reactHidden=!1,n.onShow()))}}),j)}function Gt(t,s){const e=B(t),n={accounted:e,reactHidden:e===Z,onHide:s.onHide,onShow:s.onShow};return rt.set(t,n),Yt().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return B(t)===Z},setDisplay(l,p=!1){l===null?t.style.removeProperty("display"):t.style.setProperty("display",l,p?"important":""),n.accounted=B(t)},sync(){n.accounted=B(t),n.reactHidden=n.accounted===Z},stop(){rt.delete(t)}}}function jt(t){return Array.isArray(t)}function Tt(t){const s=[];for(const e of t)jt(e)?s.push(...Tt(e)):s.push(e);return s}function Zt(t,s={}){const{transitions:e=[],middleware:n=(o,i)=>({from:o,to:i}),preserveScroll:l=o=>o}=t,p=s.host??new St,a=qt(),g=typeof e=="function"?e:()=>e,v=$t();v.initialize();const{initializeContext:C,calculateScrollOffset:x,evictScrollPosition:b,shouldPreserve:M,getScrollContainer:L,getPositionedParentElement:H,getScrollPosition:I,getIsMobile:z}=Xt({preserveScroll:l}),$=new Map,d=()=>{const o=z();let i=$.get(o);return i||(i=It(Tt(g({isMobile:o}))),$.set(o,i)),i};let f=null,h=null;const S=new WeakMap,O=o=>{S.set(o,{parent:o.parentNode,nextSibling:o.nextSibling})},u=o=>{const i=S.get(o);return i||{parent:o.parentNode,nextSibling:o.nextSibling}},c=new WeakMap,m=new WeakMap;let w=0;const E=o=>{const i=typeof getComputedStyle<"u"?getComputedStyle(o).display:"";return i&&i!=="none"?i:"block"},T=(o,i)=>{i.visibleDisplay=o.style.getPropertyValue("display"),i.computedDisplay=E(o)},N=(o,i)=>{if(m.get(o)!==i)return;m.delete(o);const r=c.get(o);r&&(r.savedCss!==null&&(o.style.cssText=r.savedCss,r.savedCss=null),r.intent==="hidden"?r.vis.setDisplay("none",!0):r.visibleDisplay?(r.vis.setDisplay(r.visibleDisplay,!1),T(o,r)):(r.vis.setDisplay(null),T(o,r)))},Rt=(o,i,r,y,P)=>{const R=y.element,_=P.element,k=(y.mode??"unmount")==="hidden",{parent:V,nextSibling:tt}=y.parent?{parent:y.parent,nextSibling:y.nextSibling}:u(R),U=x(i,r),et={scrollOffset:U,from:{scroll:I(i)},to:{scroll:I(r)},get scrollingElement(){return L()||document.documentElement},get positionedParent(){return H()}};let A;if(k){A=R,A.style.top=`${-1*((U==null?void 0:U.y)??0)}px`;const D=c.get(_);D&&D.savedCss===null&&(D.savedCss=_.style.cssText)}else A=R,kt(A,et);M(i)||b(i);const Y=k?++w:0;k&&(m.set(_,Y),m.set(R,Y));const dt=Promise.resolve(A),ft=Promise.resolve(_),ht=[],xt={from:dt,to:ft,context:et,createElement:((D,nt="div")=>{const W=document.createElement(nt);return W.setAttribute("data-ssgoi-id",D),ht.push(W),W})},Lt=Promise.resolve(o.prepare?o.prepare(xt):{});Ht({from:dt,to:ft,extras:Lt}).then(({from:D,to:nt,extras:W})=>{!k&&V&&(tt&&V.contains(tt)?V.insertBefore(A,tt):V.appendChild(A));const st=o.animation({from:D,to:nt,context:et,...W}),ot=st.onComplete;st.onComplete=()=>{ot==null||ot(),k?(N(R,Y),N(_,Y)):A.parentNode&&A.parentNode.removeChild(A);for(const it of ht)it.parentNode&&it.parentNode.removeChild(it)},p.attach(st)})},q=(o,i)=>{const r=v.isSwipeBack();a.trigger(o,i),a.get(i).then(y=>{if(i==="in"&&v.onPageEnter(),!y)return;if(r){i==="out"&&y.from&&!M(y.from)&&b(y.from),f=null,h=null;return}if(i!=="in")return;const{from:P,to:R}=n(y.from,y.to),_=Wt(P,R,d()),Q=f,k=h;f=null,h=null,!(!_||!Q||!k)&&Rt(_,P,R,Q,k)})},At=(o,i)=>{const r=c.get(o);if(!r)return;const y=r.intent==="hidden";if(r.intent="hidden",r.savedCss===null&&(r.savedCss=o.style.cssText),r.vis.setDisplay(r.computedDisplay||"block",!0),o.style.position="absolute",o.style.width="100%",o.style.left="0",y)return;const P=u(o);f={element:o,parent:P.parent,nextSibling:P.nextSibling,mode:"hidden"};const R=o.getAttribute("data-ssgoi-transition")??i;q(R,"out")},Mt=(o,i)=>{const r=c.get(o);if(!r||r.intent==="visible")return;r.intent="visible",T(o,r),r.savedCss!==null&&(o.style.cssText=r.savedCss,r.visibleDisplay?r.vis.setDisplay(r.visibleDisplay,!1):r.vis.setDisplay(null)),C(o,i),h={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling};const y=o.getAttribute("data-ssgoi-transition")??i;q(y,"in")},Ct=(o,i,r)=>{const y=c.get(o);if(y&&(y.vis.stop(),c.delete(o),m.delete(o),y.intent==="hidden")){(f==null?void 0:f.element)===o&&(f=null),(h==null?void 0:h.element)===o&&(h=null);return}const P=r??u(o);f={element:o,parent:P.parent,nextSibling:P.nextSibling,mode:"unmount"};const R=o.getAttribute("data-ssgoi-transition")??i;q(R,"out")},ct=new WeakSet,at=(o,i)=>{if(ct.has(i))return;ct.add(i),O(i);const r=Gt(i,{onHide:()=>At(i,o),onShow:()=>Mt(i,o)}),y={vis:r,savedCss:null,intent:r.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};c.set(i,y),r.isHidden||(T(i,y),C(i,o),h={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling},q(o,"in")),Ut(i,P=>Ct(i,o,P))},ut=new Map;return{register:at,refFor:o=>{let i=ut.get(o);return i||(i=r=>{r&&at(o,r)},ut.set(o,i)),i}}}const Pt="data-ssgoi-root",Jt=`[${Pt}]`,lt="data-ssgoi-transition",Et=`[${lt}]`,Qt="[data-ssgoi-clone]";function te(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ee(t){return t.nodeType===Node.ELEMENT_NODE}function ne(t){return t instanceof HTMLElement}function se(t,s){if(!te())return()=>{};t.setAttribute(Pt,"");const e=a=>a.closest(Jt)===t,n=a=>{if(!ne(a)||!e(a)||a.closest(Qt))return;const g=a.getAttribute(lt);g!==null&&s.register(g,a)},l=a=>{if(ee(a)){a.matches(Et)&&n(a);for(const g of a.querySelectorAll(Et))n(g)}},p=new MutationObserver(a=>{for(const g of a){if(g.type==="attributes"){n(g.target);continue}for(const v of g.addedNodes)l(v)}});return p.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[lt]}),l(t),()=>p.disconnect()}exports.Animation=J.Animation;exports.MultiAnimation=J.MultiAnimation;exports.WebAnimation=J.WebAnimation;exports.HostAnimation=St;exports.createSggoiTransitionContext=Zt;exports.observeSsgoiTransitions=se;
|
|
1
|
+
"use strict";var Nt=Object.defineProperty;var kt=(t,s,e)=>s in t?Nt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var z=(t,s,e)=>kt(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./multi-animation-uzEnQnrG.cjs");class Pt extends j.Animation{constructor(){super(...arguments);z(this,"child",null);z(this,"_state","idle");z(this,"_settled",!1);z(this,"listeners",new Set)}attach(e){const n=this.child;if(this.child=e,this._settled=!1,n){const l=n.getPose();n.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const r=e.onComplete;e.onComplete=()=>{r==null||r(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const u=e.onUpdate;e.onUpdate=l=>{var d;u==null||u(l),(d=this.onUpdate)==null||d.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 n;return((n=this.child)==null?void 0:n.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 n;(n=this.child)==null||n.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 It=(t,s)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=s==null?void 0:s.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},mt=new Set(["auto","scroll","overlay"]),Ht=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s);if(mt.has(e.overflowY)||mt.has(e.overflowX))return s;s=s.parentElement}return document.documentElement},Wt=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return s;s=s.parentElement}return document.body};function zt(t){const s=Object.keys(t);return Promise.all(s.map(e=>t[e])).then(e=>{const n={};return s.forEach((r,u)=>{n[r]=e[u]}),n})}function Bt(t){const s=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...s]}const Ft=1e6,gt=100,Kt=10;function Xt(t){const s=t.trim(),e=s.indexOf("#"),n=s.indexOf("?"),r=[e,n].filter(u=>u>=0).reduce((u,l)=>Math.min(u,l),s.length);return s.slice(0,r)}function at(t){const s=Xt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(s))return at(new URL(s).pathname)}catch{}const n=(s.startsWith("/")?s:`/${s}`).replace(/\/+/g,"/");return(n.length>1?n.replace(/\/+$/g,""):n)||"/"}function $t(t){const s=t.trim();return s==="*"?"*":at(s)}function ot(t){return t==="/"?[]:t.slice(1).split("/")}function qt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function rt(t,s){const e=at(t),n=$t(s);if(n==="*")return{matched:!0,specificity:0};if(e===n)return{matched:!0,specificity:Ft+ot(n).length*gt};const r=ot(e),u=ot(n);let l=0;for(let d=0;d<u.length;d++){const y=u[d],M=r[d],R=d===u.length-1;if(y===void 0)return{matched:!1,specificity:0};if((y==="*"||y==="**")&&R)return{matched:y==="**"?r.length>=d:r.length>d,specificity:l};if(M===void 0)return{matched:!1,specificity:0};if(y==="*"||qt(y)){l+=Kt;continue}if(y!==M)return{matched:!1,specificity:0};l+=gt}return{matched:r.length===u.length,specificity:l}}function Ut(t,s){return rt(t,s).matched}function Vt(t,s,e){let n;for(const r of e){const u=rt(t,r.from);if(!u.matched)continue;const l=rt(s,r.to);if(!l.matched)continue;const d=u.specificity+l.specificity;(!n||d>n.specificity)&&(n={transition:r.transition,specificity:d})}return(n==null?void 0:n.transition)??null}const Gt=768,Yt=10,Zt=10;function jt(t={}){const{preserveScroll:s=f=>f}=t,e=typeof s=="function"?s:()=>s;let n=null,r=!1,u=!1;const l=()=>{const f=(n==null?void 0:n.clientWidth)??0,a=f>0?f:typeof window<"u"?window.innerWidth:0;return a>0&&a<Gt},d=()=>(u||(r=l(),u=!0),r),y=f=>{var S;const a=e(d());if(a===!1)return{preserves:!1,shared:!1,storageKey:`path:${f}`};if(a===!0)return{preserves:!0,shared:!1,storageKey:`path:${f}`};const v=((S=a.exclude)==null?void 0:S.some(w=>Ut(f,w)))??!1,T=!v&&!!a.key;return{preserves:!v,shared:T,storageKey:T?`shared:${a.key}`:`path:${f}`}},M=f=>y(f).preserves;let R=null;const b=new Map;let x=null,O=!1,I=0;const H=()=>{n&&x&&!O&&b.set(y(x).storageKey,{x:n.scrollLeft,y:n.scrollTop})},K=f=>{if(!n)return;const a=y(f);if(a.preserves&&a.shared&&!b.has(a.storageKey))return;const v=a.preserves&&b.has(a.storageKey)?b.get(a.storageKey):{x:0,y:0};let T=0;const S=()=>{if(!n)return;n.scrollTo({top:v.y,left:v.x}),!(Math.abs(n.scrollTop-v.y)<1&&Math.abs(n.scrollLeft-v.x)<1)&&T<Yt&&(T++,requestAnimationFrame(S))};requestAnimationFrame(S)};return{initializeContext:(f,a)=>{O=!0;const v=++I;R=f,n||(n=Ht(f),r=l(),u=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{r=l()}).observe(n),(n===document.documentElement?window:n).addEventListener("scroll",H,{passive:!0})),x=a,K(a);let T=0;const S=()=>{v===I&&(T++,T>=Zt?O=!1:requestAnimationFrame(S))};requestAnimationFrame(S)},calculateScrollOffset:(f,a)=>{const v=f?y(f).storageKey:null,T=v&&b.has(v)?b.get(v):{x:0,y:0},S=a?y(a):null,w=S!=null&&S.preserves?S.storageKey:null,k=w&&b.has(w)?b.get(w):{x:0,y:0};return{x:-k.x+T.x,y:-k.y+T.y}},evictScrollPosition:f=>{b.delete(y(f).storageKey)},shouldPreserve:M,getScrollContainer:()=>n,getPositionedParentElement:()=>R?Wt(R):document.body,getScrollPosition:f=>{const a=f?y(f).storageKey:null;return a&&b.has(a)?b.get(a):{x:0,y:0}},getIsMobile:d}}const vt=30,bt=8,St=1.2,Et=30,Qt=600;function Jt(){let t=null,s=!1,e=!1,n=null,r=null,u=!1;const l=(h,p)=>{for(let m=0;m<h.length;m++){const E=h.item(m);if(E&&E.identifier===p)return E}return null},d=()=>{n!==null&&(clearTimeout(n),n=null)},y=()=>{r!==null&&(clearTimeout(r),r=null)},M=()=>{s=!0,e=!0,d(),y(),n=setTimeout(()=>{s=!1,e=!1,n=null},Qt)},R=h=>{if(h.touches.length!==1){t=null;return}const p=h.touches.item(0);if(!p){t=null;return}const m=window.innerWidth,E=p.clientX<=vt,L=p.clientX>=m-vt;if(!E&&!L){t=null;return}t={identifier:p.identifier,startX:p.clientX,startY:p.clientY,fromLeftEdge:E,moved:!1}},b=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const p=l(h.touches,t.identifier);if(!p){t=null;return}const m=p.clientX-t.startX,E=p.clientY-t.startY,L=Math.abs(m),f=Math.abs(E);if(f>bt&&f>L*St){t=null;return}const a=t.fromLeftEdge?m>0:m<0;L>bt&&L>f*St&&a&&(t.moved=!0)},x=h=>{if(!t)return;const p=l(h.changedTouches,t.identifier);if(!p){t=null;return}const m=p.clientX-t.startX,E=t.fromLeftEdge?m>0:m<0;if(t.moved&&E&&Math.abs(m)>=Et){M(),t=null;return}t.moved&&Math.abs(m)>=Et&&M(),t=null},O=()=>{t&&(t.moved&&M(),t=null)};return{initialize:()=>{if(typeof window>"u"||u)return;u=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",R,h),window.addEventListener("touchmove",b,h),window.addEventListener("touchend",x,h),window.addEventListener("touchcancel",O,h)},destroy:()=>{if(typeof window>"u"||!u)return;u=!1;const h={capture:!0};window.removeEventListener("touchstart",R,h),window.removeEventListener("touchmove",b,h),window.removeEventListener("touchend",x,h),window.removeEventListener("touchcancel",O,h),d(),y(),t=null,s=!1,e=!1},isSwipeBack:()=>{const h=s||e;return h&&d(),h},onPageEnter:()=>{s=!1,d(),y(),r=setTimeout(()=>{e=!1,r=null},0)}}}function te(){let t=null;function s(){var n,r;t&&((n=t.outResolve)==null||n.call(t,null),(r=t.inResolve)==null||r.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){s();return}const n={from:t.from,to:t.to};t.outResolve(n),t.inResolve(n),t=null}}return{trigger(n,r){var l;r==="out"&&(t==null?void 0:t.to)===n&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(r==="out"&&t.from&&t.from!==n||r==="in"&&t.to&&t.to!==n)&&s(),t||(t={}),r==="out"?t.from=n:t.to=n},get(n){return new Promise(r=>{t||(t={}),n==="out"?t.outResolve=r:t.inResolve=r,e()})}}}const F=new Map;let G=null,Tt=!1;function At(t,s){if(t instanceof HTMLElement&&F.has(t)&&!t.isConnected){const e=F.get(t);F.delete(t),queueMicrotask(()=>e(s))}for(const e of Array.from(t.childNodes))At(e,s)}function ee(){if(Tt||typeof document>"u")return;Tt=!0,G=new MutationObserver(s=>{for(const e of s){const n={parent:e.target,nextSibling:e.nextSibling};for(const r of Array.from(e.removedNodes))At(r,n)}});const t=()=>{G==null||G.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ne(t,s){return ee(),F.set(t,s),()=>{F.delete(t)}}const ct=new WeakMap;let Y=null;const Z="none !important";function B(t){const s=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${s} !important`:s}function se(){return Y||(Y=new MutationObserver(t=>{for(const s of t){const e=s.target,n=ct.get(e);if(!n)continue;const r=B(e);r!==n.accounted&&(n.accounted=r,r===Z?(n.reactHidden=!0,n.onHide()):r!=="none"&&n.reactHidden&&(n.reactHidden=!1,n.onShow()))}}),Y)}function ie(t,s){const e=B(t),n={accounted:e,reactHidden:e===Z,onHide:s.onHide,onShow:s.onShow};return ct.set(t,n),se().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return B(t)===Z},setDisplay(r,u=!1){r===null?t.style.removeProperty("display"):t.style.setProperty("display",r,u?"important":""),n.accounted=B(t)},sync(){n.accounted=B(t),n.reactHidden=n.accounted===Z},stop(){ct.delete(t)}}}function oe(t){return Array.isArray(t)}function Mt(t){const s=[];for(const e of t)oe(e)?s.push(...Mt(e)):s.push(e);return s}function re(t,s={}){const{transitions:e=[],middleware:n=(i,o)=>({from:i,to:o}),preserveScroll:r=i=>i}=t,u=s.host??new Pt,l=te(),d=typeof e=="function"?e:()=>e,y=Jt();y.initialize();const{initializeContext:M,calculateScrollOffset:R,evictScrollPosition:b,shouldPreserve:x,getScrollContainer:O,getPositionedParentElement:I,getScrollPosition:H,getIsMobile:K}=jt({preserveScroll:r}),X=new Map,h=()=>{const i=K();let o=X.get(i);return o||(o=Bt(Mt(d({isMobile:i}))),X.set(i,o)),o};let p=null,m=null;const E=new WeakMap,L=i=>{E.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},f=i=>{const o=E.get(i);return o||{parent:i.parentNode,nextSibling:i.nextSibling}},a=new WeakMap,v=new WeakMap;let T=0;const S=i=>{const o=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return o&&o!=="none"?o:"block"},w=(i,o)=>{o.visibleDisplay=i.style.getPropertyValue("display"),o.computedDisplay=S(i)},k=(i,o)=>{if(v.get(i)!==o)return;v.delete(i);const c=a.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),w(i,c)):(c.vis.setDisplay(null),w(i,c)))},Ct=(i,o,c,g,P)=>{const A=g.element,_=P.element,D=(g.mode??"unmount")==="hidden",{parent:q,nextSibling:J}=g.parent?{parent:g.parent,nextSibling:g.nextSibling}:f(A),U=R(o,c),tt={scrollOffset:U,from:{scroll:H(o)},to:{scroll:H(c)},get scrollingElement(){return O()||document.documentElement},get positionedParent(){return I()}};let C;if(D){C=A,C.style.top=`${-1*((U==null?void 0:U.y)??0)}px`;const N=a.get(_);N&&N.savedCss===null&&(N.savedCss=_.style.cssText)}else C=A,It(C,tt);x(o)||b(o);const V=D?++T:0;D&&(v.set(_,V),v.set(A,V));const ht=Promise.resolve(C),pt=Promise.resolve(_),yt=[],_t={from:ht,to:pt,context:tt,createElement:((N,et="div")=>{const W=document.createElement(et);return W.setAttribute("data-ssgoi-id",N),yt.push(W),W})},Dt=Promise.resolve(i.prepare?i.prepare(_t):{});zt({from:ht,to:pt,extras:Dt}).then(({from:N,to:et,extras:W})=>{!D&&q&&(J&&q.contains(J)?q.insertBefore(C,J):q.appendChild(C));const nt=i.animation({from:N,to:et,context:tt,...W}),st=nt.onComplete;nt.onComplete=()=>{st==null||st(),D?(k(A,V),k(_,V)):C.parentNode&&C.parentNode.removeChild(C);for(const it of yt)it.parentNode&&it.parentNode.removeChild(it)},u.attach(nt)})},$=(i,o)=>{const c=y.isSwipeBack();l.trigger(i,o),l.get(o).then(g=>{if(o==="in"&&y.onPageEnter(),!g)return;if(c){o==="out"&&g.from&&!x(g.from)&&b(g.from),p=null,m=null;return}if(o!=="in")return;const{from:P,to:A}=n(g.from,g.to),_=Vt(P,A,h()),Q=p,D=m;p=null,m=null,!(!_||!Q||!D)&&Ct(_,P,A,Q,D)})},xt=(i,o)=>{const c=a.get(i);if(!c)return;const g=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",g)return;const P=f(i);p={element:i,parent:P.parent,nextSibling:P.nextSibling,mode:"hidden"};const A=i.getAttribute("data-ssgoi-transition")??o;$(A,"out")},Ot=(i,o)=>{const c=a.get(i);if(!c||c.intent==="visible")return;c.intent="visible",w(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),M(i,o),m={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const g=i.getAttribute("data-ssgoi-transition")??o;$(g,"in")},Lt=(i,o,c)=>{const g=a.get(i);if(g&&(g.vis.stop(),a.delete(i),v.delete(i),g.intent==="hidden")){(p==null?void 0:p.element)===i&&(p=null),(m==null?void 0:m.element)===i&&(m=null);return}const P=c??f(i);p={element:i,parent:P.parent,nextSibling:P.nextSibling,mode:"unmount"};const A=i.getAttribute("data-ssgoi-transition")??o;$(A,"out")},ut=new WeakSet,dt=(i,o)=>{if(ut.has(o))return;ut.add(o),L(o);const c=ie(o,{onHide:()=>xt(o,i),onShow:()=>Ot(o,i)}),g={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};a.set(o,g),c.isHidden||(w(o,g),M(o,i),m={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling},$(i,"in")),ne(o,P=>Lt(o,i,P))},ft=new Map;return{register:dt,refFor:i=>{let o=ft.get(i);return o||(o=c=>{c&&dt(i,c)},ft.set(i,o)),o}}}const Rt="data-ssgoi-root",ce=`[${Rt}]`,lt="data-ssgoi-transition",wt=`[${lt}]`,le="[data-ssgoi-clone]";function ae(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ue(t){return t.nodeType===Node.ELEMENT_NODE}function de(t){return t instanceof HTMLElement}function fe(t,s){if(!ae())return()=>{};t.setAttribute(Rt,"");const e=l=>l.closest(ce)===t,n=l=>{if(!de(l)||!e(l)||l.closest(le))return;const d=l.getAttribute(lt);d!==null&&s.register(d,l)},r=l=>{if(ue(l)){l.matches(wt)&&n(l);for(const d of l.querySelectorAll(wt))n(d)}},u=new MutationObserver(l=>{for(const d of l){if(d.type==="attributes"){n(d.target);continue}for(const y of d.addedNodes)r(y)}});return u.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[lt]}),r(t),()=>u.disconnect()}exports.Animation=j.Animation;exports.MultiAnimation=j.MultiAnimation;exports.WebAnimation=j.WebAnimation;exports.HostAnimation=Pt;exports.createSggoiTransitionContext=re;exports.observeSsgoiTransitions=fe;
|
package/dist/internal.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { A as
|
|
5
|
-
import { M as
|
|
6
|
-
class
|
|
1
|
+
var _t = Object.defineProperty;
|
|
2
|
+
var Dt = (t, s, e) => s in t ? _t(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
3
|
+
var z = (t, s, e) => Dt(t, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { A as Nt } from "./multi-animation-Ch5rI3rB.js";
|
|
5
|
+
import { M as be, W as Se } from "./multi-animation-Ch5rI3rB.js";
|
|
6
|
+
class kt extends Nt {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
z(this, "child", null);
|
|
10
|
+
z(this, "_state", "idle");
|
|
11
|
+
z(this, "_settled", !1);
|
|
12
|
+
z(this, "listeners", /* @__PURE__ */ new Set());
|
|
13
13
|
}
|
|
14
14
|
attach(e) {
|
|
15
15
|
const n = this.child;
|
|
16
16
|
if (this.child = e, this._settled = !1, n) {
|
|
17
|
-
const
|
|
18
|
-
n.complete(), e.matchInto(
|
|
17
|
+
const l = n.getPose();
|
|
18
|
+
n.complete(), e.matchInto(l);
|
|
19
19
|
}
|
|
20
20
|
e.playbackRate = this.playbackRate;
|
|
21
|
-
const
|
|
21
|
+
const r = e.onComplete;
|
|
22
22
|
e.onComplete = () => {
|
|
23
|
-
|
|
23
|
+
r == null || r(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
e.onUpdate = (
|
|
27
|
-
var
|
|
28
|
-
|
|
25
|
+
const u = e.onUpdate;
|
|
26
|
+
e.onUpdate = (l) => {
|
|
27
|
+
var d;
|
|
28
|
+
u == null || u(l), (d = this.onUpdate) == null || d.call(this, l), this.notify();
|
|
29
29
|
}, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
|
|
30
30
|
}
|
|
31
31
|
play() {
|
|
@@ -98,19 +98,19 @@ class _t extends Ot {
|
|
|
98
98
|
for (const e of this.listeners) e();
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const It = (t, s) => {
|
|
102
102
|
var e;
|
|
103
103
|
t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = s == null ? void 0 : s.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
|
|
104
|
-
},
|
|
104
|
+
}, yt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Ht = (t) => {
|
|
105
105
|
let s = t.parentElement;
|
|
106
106
|
for (; s && s !== document.body; ) {
|
|
107
107
|
const e = window.getComputedStyle(s);
|
|
108
|
-
if (
|
|
108
|
+
if (yt.has(e.overflowY) || yt.has(e.overflowX))
|
|
109
109
|
return s;
|
|
110
110
|
s = s.parentElement;
|
|
111
111
|
}
|
|
112
112
|
return document.documentElement;
|
|
113
|
-
},
|
|
113
|
+
}, Wt = (t) => {
|
|
114
114
|
let s = t.parentElement;
|
|
115
115
|
for (; s && s !== document.body; ) {
|
|
116
116
|
const e = window.getComputedStyle(s).position;
|
|
@@ -120,16 +120,16 @@ const kt = (t, s) => {
|
|
|
120
120
|
}
|
|
121
121
|
return document.body;
|
|
122
122
|
};
|
|
123
|
-
function
|
|
123
|
+
function zt(t) {
|
|
124
124
|
const s = Object.keys(t);
|
|
125
125
|
return Promise.all(s.map((e) => t[e])).then((e) => {
|
|
126
126
|
const n = {};
|
|
127
|
-
return s.forEach((
|
|
128
|
-
n[
|
|
127
|
+
return s.forEach((r, u) => {
|
|
128
|
+
n[r] = e[u];
|
|
129
129
|
}), n;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Bt(t) {
|
|
133
133
|
const s = t.filter((e) => e.symmetric).map((e) => ({
|
|
134
134
|
from: e.to,
|
|
135
135
|
to: e.from,
|
|
@@ -137,203 +137,260 @@ function It(t) {
|
|
|
137
137
|
}));
|
|
138
138
|
return [...t, ...s];
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
const Ft = 1e6, mt = 100, Kt = 10;
|
|
141
|
+
function Xt(t) {
|
|
142
|
+
const s = t.trim(), e = s.indexOf("#"), n = s.indexOf("?"), r = [e, n].filter((u) => u >= 0).reduce((u, l) => Math.min(u, l), s.length);
|
|
143
|
+
return s.slice(0, r);
|
|
144
|
+
}
|
|
145
|
+
function lt(t) {
|
|
146
|
+
const s = Xt(t);
|
|
147
|
+
try {
|
|
148
|
+
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(s))
|
|
149
|
+
return lt(new URL(s).pathname);
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
const n = (s.startsWith("/") ? s : `/${s}`).replace(/\/+/g, "/");
|
|
153
|
+
return (n.length > 1 ? n.replace(/\/+$/g, "") : n) || "/";
|
|
154
|
+
}
|
|
155
|
+
function $t(t) {
|
|
156
|
+
const s = t.trim();
|
|
157
|
+
return s === "*" ? "*" : lt(s);
|
|
158
|
+
}
|
|
159
|
+
function it(t) {
|
|
160
|
+
return t === "/" ? [] : t.slice(1).split("/");
|
|
161
|
+
}
|
|
162
|
+
function Ut(t) {
|
|
163
|
+
return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
|
|
164
|
+
}
|
|
165
|
+
function ot(t, s) {
|
|
166
|
+
const e = lt(t), n = $t(s);
|
|
167
|
+
if (n === "*")
|
|
168
|
+
return { matched: !0, specificity: 0 };
|
|
169
|
+
if (e === n)
|
|
170
|
+
return {
|
|
171
|
+
matched: !0,
|
|
172
|
+
specificity: Ft + it(n).length * mt
|
|
173
|
+
};
|
|
174
|
+
const r = it(e), u = it(n);
|
|
175
|
+
let l = 0;
|
|
176
|
+
for (let d = 0; d < u.length; d++) {
|
|
177
|
+
const y = u[d], R = r[d], A = d === u.length - 1;
|
|
178
|
+
if (y === void 0)
|
|
179
|
+
return { matched: !1, specificity: 0 };
|
|
180
|
+
if ((y === "*" || y === "**") && A)
|
|
181
|
+
return {
|
|
182
|
+
matched: y === "**" ? r.length >= d : r.length > d,
|
|
183
|
+
specificity: l
|
|
184
|
+
};
|
|
185
|
+
if (R === void 0)
|
|
186
|
+
return { matched: !1, specificity: 0 };
|
|
187
|
+
if (y === "*" || Ut(y)) {
|
|
188
|
+
l += Kt;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (y !== R)
|
|
192
|
+
return { matched: !1, specificity: 0 };
|
|
193
|
+
l += mt;
|
|
146
194
|
}
|
|
147
|
-
return
|
|
195
|
+
return {
|
|
196
|
+
matched: r.length === u.length,
|
|
197
|
+
specificity: l
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function qt(t, s) {
|
|
201
|
+
return ot(t, s).matched;
|
|
148
202
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
203
|
+
function Vt(t, s, e) {
|
|
204
|
+
let n;
|
|
205
|
+
for (const r of e) {
|
|
206
|
+
const u = ot(t, r.from);
|
|
207
|
+
if (!u.matched) continue;
|
|
208
|
+
const l = ot(s, r.to);
|
|
209
|
+
if (!l.matched) continue;
|
|
210
|
+
const d = u.specificity + l.specificity;
|
|
211
|
+
(!n || d > n.specificity) && (n = { transition: r.transition, specificity: d });
|
|
212
|
+
}
|
|
213
|
+
return (n == null ? void 0 : n.transition) ?? null;
|
|
157
214
|
}
|
|
158
|
-
const
|
|
159
|
-
function
|
|
160
|
-
const { preserveScroll: s = (
|
|
161
|
-
let n = null,
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
},
|
|
166
|
-
var
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
return { preserves: !1, shared: !1, storageKey: `path:${
|
|
170
|
-
if (
|
|
171
|
-
return { preserves: !0, shared: !1, storageKey: `path:${
|
|
172
|
-
const
|
|
215
|
+
const Gt = 768, Yt = 10, Zt = 10;
|
|
216
|
+
function Qt(t = {}) {
|
|
217
|
+
const { preserveScroll: s = (f) => f } = t, e = typeof s == "function" ? s : () => s;
|
|
218
|
+
let n = null, r = !1, u = !1;
|
|
219
|
+
const l = () => {
|
|
220
|
+
const f = (n == null ? void 0 : n.clientWidth) ?? 0, a = f > 0 ? f : typeof window < "u" ? window.innerWidth : 0;
|
|
221
|
+
return a > 0 && a < Gt;
|
|
222
|
+
}, d = () => (u || (r = l(), u = !0), r), y = (f) => {
|
|
223
|
+
var S;
|
|
224
|
+
const a = e(d());
|
|
225
|
+
if (a === !1)
|
|
226
|
+
return { preserves: !1, shared: !1, storageKey: `path:${f}` };
|
|
227
|
+
if (a === !0)
|
|
228
|
+
return { preserves: !0, shared: !1, storageKey: `path:${f}` };
|
|
229
|
+
const v = ((S = a.exclude) == null ? void 0 : S.some((T) => qt(f, T))) ?? !1, w = !v && !!a.key;
|
|
173
230
|
return {
|
|
174
|
-
preserves: !
|
|
175
|
-
shared:
|
|
176
|
-
storageKey:
|
|
231
|
+
preserves: !v,
|
|
232
|
+
shared: w,
|
|
233
|
+
storageKey: w ? `shared:${a.key}` : `path:${f}`
|
|
177
234
|
};
|
|
178
|
-
},
|
|
179
|
-
let
|
|
235
|
+
}, R = (f) => y(f).preserves;
|
|
236
|
+
let A = null;
|
|
180
237
|
const b = /* @__PURE__ */ new Map();
|
|
181
|
-
let x = null, L = !1,
|
|
182
|
-
const
|
|
183
|
-
n && x && !L && b.set(
|
|
238
|
+
let x = null, L = !1, I = 0;
|
|
239
|
+
const H = () => {
|
|
240
|
+
n && x && !L && b.set(y(x).storageKey, {
|
|
184
241
|
x: n.scrollLeft,
|
|
185
242
|
y: n.scrollTop
|
|
186
243
|
});
|
|
187
|
-
},
|
|
244
|
+
}, K = (f) => {
|
|
188
245
|
if (!n) return;
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
246
|
+
const a = y(f);
|
|
247
|
+
if (a.preserves && a.shared && !b.has(a.storageKey))
|
|
191
248
|
return;
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
const
|
|
249
|
+
const v = a.preserves && b.has(a.storageKey) ? b.get(a.storageKey) : { x: 0, y: 0 };
|
|
250
|
+
let w = 0;
|
|
251
|
+
const S = () => {
|
|
195
252
|
if (!n) return;
|
|
196
253
|
n.scrollTo({
|
|
197
|
-
top:
|
|
198
|
-
left:
|
|
199
|
-
}), !(Math.abs(n.scrollTop -
|
|
254
|
+
top: v.y,
|
|
255
|
+
left: v.x
|
|
256
|
+
}), !(Math.abs(n.scrollTop - v.y) < 1 && Math.abs(n.scrollLeft - v.x) < 1) && w < Yt && (w++, requestAnimationFrame(S));
|
|
200
257
|
};
|
|
201
|
-
requestAnimationFrame(
|
|
258
|
+
requestAnimationFrame(S);
|
|
202
259
|
};
|
|
203
260
|
return {
|
|
204
|
-
initializeContext: (
|
|
261
|
+
initializeContext: (f, a) => {
|
|
205
262
|
L = !0;
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll",
|
|
263
|
+
const v = ++I;
|
|
264
|
+
A = f, n || (n = Ht(f), r = l(), u = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
|
|
265
|
+
r = l();
|
|
266
|
+
}).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll", H, {
|
|
210
267
|
passive: !0
|
|
211
|
-
})), x =
|
|
212
|
-
let
|
|
213
|
-
const
|
|
214
|
-
|
|
268
|
+
})), x = a, K(a);
|
|
269
|
+
let w = 0;
|
|
270
|
+
const S = () => {
|
|
271
|
+
v === I && (w++, w >= Zt ? L = !1 : requestAnimationFrame(S));
|
|
215
272
|
};
|
|
216
|
-
requestAnimationFrame(
|
|
273
|
+
requestAnimationFrame(S);
|
|
217
274
|
},
|
|
218
|
-
calculateScrollOffset: (
|
|
219
|
-
const
|
|
275
|
+
calculateScrollOffset: (f, a) => {
|
|
276
|
+
const v = f ? y(f).storageKey : null, w = v && b.has(v) ? b.get(v) : { x: 0, y: 0 }, S = a ? y(a) : null, T = S != null && S.preserves ? S.storageKey : null, k = T && b.has(T) ? b.get(T) : { x: 0, y: 0 };
|
|
220
277
|
return {
|
|
221
|
-
x: -
|
|
222
|
-
y: -
|
|
278
|
+
x: -k.x + w.x,
|
|
279
|
+
y: -k.y + w.y
|
|
223
280
|
};
|
|
224
281
|
},
|
|
225
|
-
evictScrollPosition: (
|
|
226
|
-
b.delete(
|
|
282
|
+
evictScrollPosition: (f) => {
|
|
283
|
+
b.delete(y(f).storageKey);
|
|
227
284
|
},
|
|
228
|
-
shouldPreserve:
|
|
285
|
+
shouldPreserve: R,
|
|
229
286
|
getScrollContainer: () => n,
|
|
230
|
-
getPositionedParentElement: () =>
|
|
231
|
-
getScrollPosition: (
|
|
232
|
-
const
|
|
233
|
-
return
|
|
287
|
+
getPositionedParentElement: () => A ? Wt(A) : document.body,
|
|
288
|
+
getScrollPosition: (f) => {
|
|
289
|
+
const a = f ? y(f).storageKey : null;
|
|
290
|
+
return a && b.has(a) ? b.get(a) : { x: 0, y: 0 };
|
|
234
291
|
},
|
|
235
292
|
// Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
|
|
236
293
|
// functional `transitions` config can branch on it too.
|
|
237
|
-
getIsMobile:
|
|
294
|
+
getIsMobile: d
|
|
238
295
|
};
|
|
239
296
|
}
|
|
240
|
-
const
|
|
241
|
-
function
|
|
242
|
-
let t = null, s = !1, e = !1, n = null,
|
|
243
|
-
const
|
|
244
|
-
for (let
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
297
|
+
const gt = 30, vt = 8, bt = 1.2, St = 30, jt = 600;
|
|
298
|
+
function Jt() {
|
|
299
|
+
let t = null, s = !1, e = !1, n = null, r = null, u = !1;
|
|
300
|
+
const l = (h, p) => {
|
|
301
|
+
for (let m = 0; m < h.length; m++) {
|
|
302
|
+
const E = h.item(m);
|
|
303
|
+
if (E && E.identifier === p) return E;
|
|
247
304
|
}
|
|
248
305
|
return null;
|
|
249
|
-
},
|
|
306
|
+
}, d = () => {
|
|
250
307
|
n !== null && (clearTimeout(n), n = null);
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
s = !0, e = !0,
|
|
308
|
+
}, y = () => {
|
|
309
|
+
r !== null && (clearTimeout(r), r = null);
|
|
310
|
+
}, R = () => {
|
|
311
|
+
s = !0, e = !0, d(), y(), n = setTimeout(() => {
|
|
255
312
|
s = !1, e = !1, n = null;
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
if (
|
|
313
|
+
}, jt);
|
|
314
|
+
}, A = (h) => {
|
|
315
|
+
if (h.touches.length !== 1) {
|
|
259
316
|
t = null;
|
|
260
317
|
return;
|
|
261
318
|
}
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
319
|
+
const p = h.touches.item(0);
|
|
320
|
+
if (!p) {
|
|
264
321
|
t = null;
|
|
265
322
|
return;
|
|
266
323
|
}
|
|
267
|
-
const
|
|
268
|
-
if (!
|
|
324
|
+
const m = window.innerWidth, E = p.clientX <= gt, O = p.clientX >= m - gt;
|
|
325
|
+
if (!E && !O) {
|
|
269
326
|
t = null;
|
|
270
327
|
return;
|
|
271
328
|
}
|
|
272
329
|
t = {
|
|
273
|
-
identifier:
|
|
274
|
-
startX:
|
|
275
|
-
startY:
|
|
276
|
-
fromLeftEdge:
|
|
330
|
+
identifier: p.identifier,
|
|
331
|
+
startX: p.clientX,
|
|
332
|
+
startY: p.clientY,
|
|
333
|
+
fromLeftEdge: E,
|
|
277
334
|
moved: !1
|
|
278
335
|
};
|
|
279
|
-
}, b = (
|
|
336
|
+
}, b = (h) => {
|
|
280
337
|
if (!t) return;
|
|
281
|
-
if (
|
|
338
|
+
if (h.touches.length !== 1) {
|
|
282
339
|
t = null;
|
|
283
340
|
return;
|
|
284
341
|
}
|
|
285
|
-
const
|
|
286
|
-
if (!
|
|
342
|
+
const p = l(h.touches, t.identifier);
|
|
343
|
+
if (!p) {
|
|
287
344
|
t = null;
|
|
288
345
|
return;
|
|
289
346
|
}
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
347
|
+
const m = p.clientX - t.startX, E = p.clientY - t.startY, O = Math.abs(m), f = Math.abs(E);
|
|
348
|
+
if (f > vt && f > O * bt) {
|
|
292
349
|
t = null;
|
|
293
350
|
return;
|
|
294
351
|
}
|
|
295
|
-
const
|
|
296
|
-
O >
|
|
297
|
-
}, x = (
|
|
352
|
+
const a = t.fromLeftEdge ? m > 0 : m < 0;
|
|
353
|
+
O > vt && O > f * bt && a && (t.moved = !0);
|
|
354
|
+
}, x = (h) => {
|
|
298
355
|
if (!t) return;
|
|
299
|
-
const
|
|
300
|
-
if (!
|
|
356
|
+
const p = l(h.changedTouches, t.identifier);
|
|
357
|
+
if (!p) {
|
|
301
358
|
t = null;
|
|
302
359
|
return;
|
|
303
360
|
}
|
|
304
|
-
const
|
|
305
|
-
if (t.moved &&
|
|
306
|
-
|
|
361
|
+
const m = p.clientX - t.startX, E = t.fromLeftEdge ? m > 0 : m < 0;
|
|
362
|
+
if (t.moved && E && Math.abs(m) >= St) {
|
|
363
|
+
R(), t = null;
|
|
307
364
|
return;
|
|
308
365
|
}
|
|
309
|
-
t.moved && Math.abs(
|
|
366
|
+
t.moved && Math.abs(m) >= St && R(), t = null;
|
|
310
367
|
}, L = () => {
|
|
311
|
-
t && (t.moved &&
|
|
368
|
+
t && (t.moved && R(), t = null);
|
|
312
369
|
};
|
|
313
370
|
return { initialize: () => {
|
|
314
|
-
if (typeof window > "u" ||
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
window.addEventListener("touchstart",
|
|
371
|
+
if (typeof window > "u" || u) return;
|
|
372
|
+
u = !0;
|
|
373
|
+
const h = { passive: !0, capture: !0 };
|
|
374
|
+
window.addEventListener("touchstart", A, h), window.addEventListener("touchmove", b, h), window.addEventListener("touchend", x, h), window.addEventListener("touchcancel", L, h);
|
|
318
375
|
}, destroy: () => {
|
|
319
|
-
if (typeof window > "u" || !
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
window.removeEventListener("touchstart",
|
|
376
|
+
if (typeof window > "u" || !u) return;
|
|
377
|
+
u = !1;
|
|
378
|
+
const h = { capture: !0 };
|
|
379
|
+
window.removeEventListener("touchstart", A, h), window.removeEventListener("touchmove", b, h), window.removeEventListener("touchend", x, h), window.removeEventListener("touchcancel", L, h), d(), y(), t = null, s = !1, e = !1;
|
|
323
380
|
}, isSwipeBack: () => {
|
|
324
|
-
const
|
|
325
|
-
return
|
|
381
|
+
const h = s || e;
|
|
382
|
+
return h && d(), h;
|
|
326
383
|
}, onPageEnter: () => {
|
|
327
|
-
s = !1,
|
|
328
|
-
e = !1,
|
|
384
|
+
s = !1, d(), y(), r = setTimeout(() => {
|
|
385
|
+
e = !1, r = null;
|
|
329
386
|
}, 0);
|
|
330
387
|
} };
|
|
331
388
|
}
|
|
332
|
-
function
|
|
389
|
+
function te() {
|
|
333
390
|
let t = null;
|
|
334
391
|
function s() {
|
|
335
|
-
var n,
|
|
336
|
-
t && ((n = t.outResolve) == null || n.call(t, null), (
|
|
392
|
+
var n, r;
|
|
393
|
+
t && ((n = t.outResolve) == null || n.call(t, null), (r = t.inResolve) == null || r.call(t, null), t = null);
|
|
337
394
|
}
|
|
338
395
|
function e() {
|
|
339
396
|
if (t != null && t.from && (t != null && t.to) && (t != null && t.outResolve) && (t != null && t.inResolve)) {
|
|
@@ -346,37 +403,37 @@ function Vt() {
|
|
|
346
403
|
}
|
|
347
404
|
}
|
|
348
405
|
return {
|
|
349
|
-
trigger(n,
|
|
350
|
-
var
|
|
351
|
-
|
|
406
|
+
trigger(n, r) {
|
|
407
|
+
var l;
|
|
408
|
+
r === "out" && (t == null ? void 0 : t.to) === n && !t.from && ((l = t.inResolve) == null || l.call(t, null), t = {}), t && (r === "out" && t.from && t.from !== n || r === "in" && t.to && t.to !== n) && s(), t || (t = {}), r === "out" ? t.from = n : t.to = n;
|
|
352
409
|
},
|
|
353
410
|
get(n) {
|
|
354
|
-
return new Promise((
|
|
355
|
-
t || (t = {}), n === "out" ? t.outResolve =
|
|
411
|
+
return new Promise((r) => {
|
|
412
|
+
t || (t = {}), n === "out" ? t.outResolve = r : t.inResolve = r, e();
|
|
356
413
|
});
|
|
357
414
|
}
|
|
358
415
|
};
|
|
359
416
|
}
|
|
360
|
-
const
|
|
361
|
-
let G = null,
|
|
362
|
-
function
|
|
363
|
-
if (t instanceof HTMLElement &&
|
|
364
|
-
const e =
|
|
365
|
-
|
|
417
|
+
const F = /* @__PURE__ */ new Map();
|
|
418
|
+
let G = null, Et = !1;
|
|
419
|
+
function Tt(t, s) {
|
|
420
|
+
if (t instanceof HTMLElement && F.has(t) && !t.isConnected) {
|
|
421
|
+
const e = F.get(t);
|
|
422
|
+
F.delete(t), queueMicrotask(() => e(s));
|
|
366
423
|
}
|
|
367
424
|
for (const e of Array.from(t.childNodes))
|
|
368
|
-
|
|
425
|
+
Tt(e, s);
|
|
369
426
|
}
|
|
370
|
-
function
|
|
371
|
-
if (
|
|
372
|
-
|
|
427
|
+
function ee() {
|
|
428
|
+
if (Et || typeof document > "u") return;
|
|
429
|
+
Et = !0, G = new MutationObserver((s) => {
|
|
373
430
|
for (const e of s) {
|
|
374
431
|
const n = {
|
|
375
432
|
parent: e.target,
|
|
376
433
|
nextSibling: e.nextSibling
|
|
377
434
|
};
|
|
378
|
-
for (const
|
|
379
|
-
|
|
435
|
+
for (const r of Array.from(e.removedNodes))
|
|
436
|
+
Tt(r, n);
|
|
380
437
|
}
|
|
381
438
|
});
|
|
382
439
|
const t = () => {
|
|
@@ -384,295 +441,295 @@ function qt() {
|
|
|
384
441
|
};
|
|
385
442
|
document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
|
|
386
443
|
}
|
|
387
|
-
function
|
|
388
|
-
return
|
|
389
|
-
|
|
444
|
+
function ne(t, s) {
|
|
445
|
+
return ee(), F.set(t, s), () => {
|
|
446
|
+
F.delete(t);
|
|
390
447
|
};
|
|
391
448
|
}
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
const
|
|
449
|
+
const rt = /* @__PURE__ */ new WeakMap();
|
|
450
|
+
let Y = null;
|
|
451
|
+
const Z = "none !important";
|
|
395
452
|
function B(t) {
|
|
396
453
|
const s = t.style.getPropertyValue("display");
|
|
397
454
|
return t.style.getPropertyPriority("display") ? `${s} !important` : s;
|
|
398
455
|
}
|
|
399
|
-
function
|
|
400
|
-
return
|
|
456
|
+
function se() {
|
|
457
|
+
return Y || (Y = new MutationObserver((t) => {
|
|
401
458
|
for (const s of t) {
|
|
402
|
-
const e = s.target, n =
|
|
459
|
+
const e = s.target, n = rt.get(e);
|
|
403
460
|
if (!n) continue;
|
|
404
|
-
const
|
|
405
|
-
|
|
461
|
+
const r = B(e);
|
|
462
|
+
r !== n.accounted && (n.accounted = r, r === Z ? (n.reactHidden = !0, n.onHide()) : r !== "none" && n.reactHidden && (n.reactHidden = !1, n.onShow()));
|
|
406
463
|
}
|
|
407
|
-
}),
|
|
464
|
+
}), Y);
|
|
408
465
|
}
|
|
409
|
-
function
|
|
466
|
+
function ie(t, s) {
|
|
410
467
|
const e = B(t), n = {
|
|
411
468
|
accounted: e,
|
|
412
|
-
reactHidden: e ===
|
|
469
|
+
reactHidden: e === Z,
|
|
413
470
|
onHide: s.onHide,
|
|
414
471
|
onShow: s.onShow
|
|
415
472
|
};
|
|
416
|
-
return
|
|
473
|
+
return rt.set(t, n), se().observe(t, {
|
|
417
474
|
attributes: !0,
|
|
418
475
|
attributeFilter: ["style"]
|
|
419
476
|
}), {
|
|
420
477
|
get isHidden() {
|
|
421
|
-
return B(t) ===
|
|
478
|
+
return B(t) === Z;
|
|
422
479
|
},
|
|
423
|
-
setDisplay(
|
|
424
|
-
|
|
480
|
+
setDisplay(r, u = !1) {
|
|
481
|
+
r === null ? t.style.removeProperty("display") : t.style.setProperty(
|
|
425
482
|
"display",
|
|
426
|
-
|
|
427
|
-
|
|
483
|
+
r,
|
|
484
|
+
u ? "important" : ""
|
|
428
485
|
), n.accounted = B(t);
|
|
429
486
|
},
|
|
430
487
|
sync() {
|
|
431
|
-
n.accounted = B(t), n.reactHidden = n.accounted ===
|
|
488
|
+
n.accounted = B(t), n.reactHidden = n.accounted === Z;
|
|
432
489
|
},
|
|
433
490
|
stop() {
|
|
434
|
-
|
|
491
|
+
rt.delete(t);
|
|
435
492
|
}
|
|
436
493
|
};
|
|
437
494
|
}
|
|
438
|
-
function
|
|
495
|
+
function oe(t) {
|
|
439
496
|
return Array.isArray(t);
|
|
440
497
|
}
|
|
441
|
-
function
|
|
498
|
+
function Pt(t) {
|
|
442
499
|
const s = [];
|
|
443
500
|
for (const e of t)
|
|
444
|
-
|
|
501
|
+
oe(e) ? s.push(...Pt(e)) : s.push(e);
|
|
445
502
|
return s;
|
|
446
503
|
}
|
|
447
|
-
function
|
|
504
|
+
function ye(t, s = {}) {
|
|
448
505
|
const {
|
|
449
506
|
transitions: e = [],
|
|
450
|
-
middleware: n = (
|
|
451
|
-
preserveScroll:
|
|
452
|
-
} = t,
|
|
453
|
-
|
|
507
|
+
middleware: n = (i, o) => ({ from: i, to: o }),
|
|
508
|
+
preserveScroll: r = (i) => i
|
|
509
|
+
} = t, u = s.host ?? new kt(), l = te(), d = typeof e == "function" ? e : () => e, y = Jt();
|
|
510
|
+
y.initialize();
|
|
454
511
|
const {
|
|
455
|
-
initializeContext:
|
|
456
|
-
calculateScrollOffset:
|
|
512
|
+
initializeContext: R,
|
|
513
|
+
calculateScrollOffset: A,
|
|
457
514
|
evictScrollPosition: b,
|
|
458
515
|
shouldPreserve: x,
|
|
459
516
|
getScrollContainer: L,
|
|
460
|
-
getPositionedParentElement:
|
|
461
|
-
getScrollPosition:
|
|
462
|
-
getIsMobile:
|
|
463
|
-
} =
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
return
|
|
467
|
-
|
|
468
|
-
),
|
|
517
|
+
getPositionedParentElement: I,
|
|
518
|
+
getScrollPosition: H,
|
|
519
|
+
getIsMobile: K
|
|
520
|
+
} = Qt({ preserveScroll: r }), X = /* @__PURE__ */ new Map(), h = () => {
|
|
521
|
+
const i = K();
|
|
522
|
+
let o = X.get(i);
|
|
523
|
+
return o || (o = Bt(
|
|
524
|
+
Pt(d({ isMobile: i }))
|
|
525
|
+
), X.set(i, o)), o;
|
|
469
526
|
};
|
|
470
|
-
let
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
parent:
|
|
474
|
-
nextSibling:
|
|
527
|
+
let p = null, m = null;
|
|
528
|
+
const E = /* @__PURE__ */ new WeakMap(), O = (i) => {
|
|
529
|
+
E.set(i, {
|
|
530
|
+
parent: i.parentNode,
|
|
531
|
+
nextSibling: i.nextSibling
|
|
475
532
|
});
|
|
476
|
-
},
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
parent:
|
|
480
|
-
nextSibling:
|
|
533
|
+
}, f = (i) => {
|
|
534
|
+
const o = E.get(i);
|
|
535
|
+
return o || {
|
|
536
|
+
parent: i.parentNode,
|
|
537
|
+
nextSibling: i.nextSibling
|
|
481
538
|
};
|
|
482
|
-
},
|
|
483
|
-
let
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
return
|
|
487
|
-
}, T = (
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
if (
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
const
|
|
496
|
-
scrollOffset:
|
|
497
|
-
from: { scroll:
|
|
498
|
-
to: { scroll:
|
|
539
|
+
}, a = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap();
|
|
540
|
+
let w = 0;
|
|
541
|
+
const S = (i) => {
|
|
542
|
+
const o = typeof getComputedStyle < "u" ? getComputedStyle(i).display : "";
|
|
543
|
+
return o && o !== "none" ? o : "block";
|
|
544
|
+
}, T = (i, o) => {
|
|
545
|
+
o.visibleDisplay = i.style.getPropertyValue("display"), o.computedDisplay = S(i);
|
|
546
|
+
}, k = (i, o) => {
|
|
547
|
+
if (v.get(i) !== o) return;
|
|
548
|
+
v.delete(i);
|
|
549
|
+
const c = a.get(i);
|
|
550
|
+
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), T(i, c)) : (c.vis.setDisplay(null), T(i, c)));
|
|
551
|
+
}, Rt = (i, o, c, g, P) => {
|
|
552
|
+
const M = g.element, _ = P.element, D = (g.mode ?? "unmount") === "hidden", { parent: U, nextSibling: j } = g.parent ? { parent: g.parent, nextSibling: g.nextSibling } : f(M), q = A(o, c), J = {
|
|
553
|
+
scrollOffset: q,
|
|
554
|
+
from: { scroll: H(o) },
|
|
555
|
+
to: { scroll: H(c) },
|
|
499
556
|
get scrollingElement() {
|
|
500
557
|
return L() || document.documentElement;
|
|
501
558
|
},
|
|
502
559
|
get positionedParent() {
|
|
503
|
-
return
|
|
560
|
+
return I();
|
|
504
561
|
}
|
|
505
562
|
};
|
|
506
|
-
let
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
563
|
+
let C;
|
|
564
|
+
if (D) {
|
|
565
|
+
C = M, C.style.top = `${-1 * ((q == null ? void 0 : q.y) ?? 0)}px`;
|
|
566
|
+
const N = a.get(_);
|
|
567
|
+
N && N.savedCss === null && (N.savedCss = _.style.cssText);
|
|
511
568
|
} else
|
|
512
|
-
|
|
513
|
-
x(
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
from:
|
|
518
|
-
to:
|
|
519
|
-
context:
|
|
520
|
-
createElement: ((
|
|
521
|
-
const W = document.createElement(
|
|
522
|
-
return W.setAttribute("data-ssgoi-id",
|
|
569
|
+
C = M, It(C, J);
|
|
570
|
+
x(o) || b(o);
|
|
571
|
+
const V = D ? ++w : 0;
|
|
572
|
+
D && (v.set(_, V), v.set(M, V));
|
|
573
|
+
const ft = Promise.resolve(C), ht = Promise.resolve(_), pt = [], Lt = {
|
|
574
|
+
from: ft,
|
|
575
|
+
to: ht,
|
|
576
|
+
context: J,
|
|
577
|
+
createElement: ((N, tt = "div") => {
|
|
578
|
+
const W = document.createElement(tt);
|
|
579
|
+
return W.setAttribute("data-ssgoi-id", N), pt.push(W), W;
|
|
523
580
|
})
|
|
524
|
-
},
|
|
525
|
-
|
|
581
|
+
}, Ot = Promise.resolve(
|
|
582
|
+
i.prepare ? i.prepare(Lt) : {}
|
|
526
583
|
);
|
|
527
|
-
|
|
528
|
-
from:
|
|
529
|
-
to:
|
|
530
|
-
extras:
|
|
531
|
-
}).then(({ from:
|
|
532
|
-
!
|
|
533
|
-
const
|
|
534
|
-
from:
|
|
535
|
-
to:
|
|
536
|
-
context:
|
|
584
|
+
zt({
|
|
585
|
+
from: ft,
|
|
586
|
+
to: ht,
|
|
587
|
+
extras: Ot
|
|
588
|
+
}).then(({ from: N, to: tt, extras: W }) => {
|
|
589
|
+
!D && U && (j && U.contains(j) ? U.insertBefore(C, j) : U.appendChild(C));
|
|
590
|
+
const et = i.animation({
|
|
591
|
+
from: N,
|
|
592
|
+
to: tt,
|
|
593
|
+
context: J,
|
|
537
594
|
...W
|
|
538
|
-
}),
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
for (const
|
|
542
|
-
|
|
543
|
-
},
|
|
595
|
+
}), nt = et.onComplete;
|
|
596
|
+
et.onComplete = () => {
|
|
597
|
+
nt == null || nt(), D ? (k(M, V), k(_, V)) : C.parentNode && C.parentNode.removeChild(C);
|
|
598
|
+
for (const st of pt)
|
|
599
|
+
st.parentNode && st.parentNode.removeChild(st);
|
|
600
|
+
}, u.attach(et);
|
|
544
601
|
});
|
|
545
|
-
},
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
if (
|
|
549
|
-
if (
|
|
550
|
-
|
|
602
|
+
}, $ = (i, o) => {
|
|
603
|
+
const c = y.isSwipeBack();
|
|
604
|
+
l.trigger(i, o), l.get(o).then((g) => {
|
|
605
|
+
if (o === "in" && y.onPageEnter(), !g) return;
|
|
606
|
+
if (c) {
|
|
607
|
+
o === "out" && g.from && !x(g.from) && b(g.from), p = null, m = null;
|
|
551
608
|
return;
|
|
552
609
|
}
|
|
553
|
-
if (
|
|
554
|
-
const { from:
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
), _ =
|
|
558
|
-
R,
|
|
610
|
+
if (o !== "in") return;
|
|
611
|
+
const { from: P, to: M } = n(
|
|
612
|
+
g.from,
|
|
613
|
+
g.to
|
|
614
|
+
), _ = Vt(
|
|
559
615
|
P,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
616
|
+
M,
|
|
617
|
+
h()
|
|
618
|
+
), Q = p, D = m;
|
|
619
|
+
p = null, m = null, !(!_ || !Q || !D) && Rt(_, P, M, Q, D);
|
|
563
620
|
});
|
|
564
|
-
},
|
|
565
|
-
const
|
|
566
|
-
if (!
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
element:
|
|
572
|
-
parent:
|
|
573
|
-
nextSibling:
|
|
621
|
+
}, At = (i, o) => {
|
|
622
|
+
const c = a.get(i);
|
|
623
|
+
if (!c) return;
|
|
624
|
+
const g = c.intent === "hidden";
|
|
625
|
+
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", g) return;
|
|
626
|
+
const P = f(i);
|
|
627
|
+
p = {
|
|
628
|
+
element: i,
|
|
629
|
+
parent: P.parent,
|
|
630
|
+
nextSibling: P.nextSibling,
|
|
574
631
|
mode: "hidden"
|
|
575
632
|
};
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
},
|
|
579
|
-
const
|
|
580
|
-
if (!
|
|
581
|
-
|
|
582
|
-
element:
|
|
583
|
-
parent:
|
|
584
|
-
nextSibling:
|
|
633
|
+
const M = i.getAttribute("data-ssgoi-transition") ?? o;
|
|
634
|
+
$(M, "out");
|
|
635
|
+
}, Ct = (i, o) => {
|
|
636
|
+
const c = a.get(i);
|
|
637
|
+
if (!c || c.intent === "visible") return;
|
|
638
|
+
c.intent = "visible", T(i, c), c.savedCss !== null && (i.style.cssText = c.savedCss, c.visibleDisplay ? c.vis.setDisplay(c.visibleDisplay, !1) : c.vis.setDisplay(null)), R(i, o), m = {
|
|
639
|
+
element: i,
|
|
640
|
+
parent: i.parentElement,
|
|
641
|
+
nextSibling: i.nextElementSibling
|
|
585
642
|
};
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
(
|
|
643
|
+
const g = i.getAttribute("data-ssgoi-transition") ?? o;
|
|
644
|
+
$(g, "in");
|
|
645
|
+
}, xt = (i, o, c) => {
|
|
646
|
+
const g = a.get(i);
|
|
647
|
+
if (g && (g.vis.stop(), a.delete(i), v.delete(i), g.intent === "hidden")) {
|
|
648
|
+
(p == null ? void 0 : p.element) === i && (p = null), (m == null ? void 0 : m.element) === i && (m = null);
|
|
592
649
|
return;
|
|
593
650
|
}
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
element:
|
|
597
|
-
parent:
|
|
598
|
-
nextSibling:
|
|
651
|
+
const P = c ?? f(i);
|
|
652
|
+
p = {
|
|
653
|
+
element: i,
|
|
654
|
+
parent: P.parent,
|
|
655
|
+
nextSibling: P.nextSibling,
|
|
599
656
|
mode: "unmount"
|
|
600
657
|
};
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
},
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
onHide: () =>
|
|
608
|
-
onShow: () =>
|
|
609
|
-
}),
|
|
610
|
-
vis:
|
|
658
|
+
const M = i.getAttribute("data-ssgoi-transition") ?? o;
|
|
659
|
+
$(M, "out");
|
|
660
|
+
}, at = /* @__PURE__ */ new WeakSet(), ut = (i, o) => {
|
|
661
|
+
if (at.has(o)) return;
|
|
662
|
+
at.add(o), O(o);
|
|
663
|
+
const c = ie(o, {
|
|
664
|
+
onHide: () => At(o, i),
|
|
665
|
+
onShow: () => Ct(o, i)
|
|
666
|
+
}), g = {
|
|
667
|
+
vis: c,
|
|
611
668
|
savedCss: null,
|
|
612
|
-
intent:
|
|
669
|
+
intent: c.isHidden ? "hidden" : "visible",
|
|
613
670
|
visibleDisplay: "",
|
|
614
671
|
computedDisplay: "block"
|
|
615
672
|
};
|
|
616
|
-
|
|
617
|
-
element:
|
|
618
|
-
parent:
|
|
619
|
-
nextSibling:
|
|
620
|
-
},
|
|
621
|
-
},
|
|
622
|
-
return { register:
|
|
623
|
-
let
|
|
624
|
-
return
|
|
625
|
-
|
|
626
|
-
},
|
|
673
|
+
a.set(o, g), c.isHidden || (T(o, g), R(o, i), m = {
|
|
674
|
+
element: o,
|
|
675
|
+
parent: o.parentElement,
|
|
676
|
+
nextSibling: o.nextElementSibling
|
|
677
|
+
}, $(i, "in")), ne(o, (P) => xt(o, i, P));
|
|
678
|
+
}, dt = /* @__PURE__ */ new Map();
|
|
679
|
+
return { register: ut, refFor: (i) => {
|
|
680
|
+
let o = dt.get(i);
|
|
681
|
+
return o || (o = (c) => {
|
|
682
|
+
c && ut(i, c);
|
|
683
|
+
}, dt.set(i, o)), o;
|
|
627
684
|
} };
|
|
628
685
|
}
|
|
629
|
-
const
|
|
630
|
-
function
|
|
686
|
+
const Mt = "data-ssgoi-root", re = `[${Mt}]`, ct = "data-ssgoi-transition", wt = `[${ct}]`, ce = "[data-ssgoi-clone]";
|
|
687
|
+
function le() {
|
|
631
688
|
return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
|
|
632
689
|
}
|
|
633
|
-
function
|
|
690
|
+
function ae(t) {
|
|
634
691
|
return t.nodeType === Node.ELEMENT_NODE;
|
|
635
692
|
}
|
|
636
|
-
function
|
|
693
|
+
function ue(t) {
|
|
637
694
|
return t instanceof HTMLElement;
|
|
638
695
|
}
|
|
639
|
-
function
|
|
640
|
-
if (!
|
|
696
|
+
function me(t, s) {
|
|
697
|
+
if (!le()) return () => {
|
|
641
698
|
};
|
|
642
|
-
t.setAttribute(
|
|
643
|
-
const e = (
|
|
644
|
-
if (!
|
|
699
|
+
t.setAttribute(Mt, "");
|
|
700
|
+
const e = (l) => l.closest(re) === t, n = (l) => {
|
|
701
|
+
if (!ue(l) || !e(l) || l.closest(ce))
|
|
645
702
|
return;
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
if (
|
|
650
|
-
|
|
651
|
-
for (const
|
|
652
|
-
n(
|
|
703
|
+
const d = l.getAttribute(ct);
|
|
704
|
+
d !== null && s.register(d, l);
|
|
705
|
+
}, r = (l) => {
|
|
706
|
+
if (ae(l)) {
|
|
707
|
+
l.matches(wt) && n(l);
|
|
708
|
+
for (const d of l.querySelectorAll(wt))
|
|
709
|
+
n(d);
|
|
653
710
|
}
|
|
654
|
-
},
|
|
655
|
-
for (const
|
|
656
|
-
if (
|
|
657
|
-
n(
|
|
711
|
+
}, u = new MutationObserver((l) => {
|
|
712
|
+
for (const d of l) {
|
|
713
|
+
if (d.type === "attributes") {
|
|
714
|
+
n(d.target);
|
|
658
715
|
continue;
|
|
659
716
|
}
|
|
660
|
-
for (const
|
|
661
|
-
|
|
717
|
+
for (const y of d.addedNodes)
|
|
718
|
+
r(y);
|
|
662
719
|
}
|
|
663
720
|
});
|
|
664
|
-
return
|
|
721
|
+
return u.observe(t, {
|
|
665
722
|
childList: !0,
|
|
666
723
|
subtree: !0,
|
|
667
724
|
attributes: !0,
|
|
668
|
-
attributeFilter: [
|
|
669
|
-
}),
|
|
725
|
+
attributeFilter: [ct]
|
|
726
|
+
}), r(t), () => u.disconnect();
|
|
670
727
|
}
|
|
671
728
|
export {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
729
|
+
Nt as Animation,
|
|
730
|
+
kt as HostAnimation,
|
|
731
|
+
be as MultiAnimation,
|
|
732
|
+
Se as WebAnimation,
|
|
733
|
+
ye as createSggoiTransitionContext,
|
|
734
|
+
me as observeSsgoiTransitions
|
|
678
735
|
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { TransitionConfig } from '../types/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Matches a path against a pattern
|
|
4
|
-
* Supports exact matches and
|
|
4
|
+
* Supports exact matches, wildcard patterns, and common route segment params
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* matchPath('/products', '/products') // true
|
|
8
8
|
* matchPath('/products/123', '/products/*') // true
|
|
9
|
+
* matchPath('/products', '/products/**') // true
|
|
10
|
+
* matchPath('/products/123/reviews', '/products/**') // true
|
|
11
|
+
* matchPath('/products/123', '/products/:id') // true
|
|
12
|
+
* matchPath('/products/123', '/products/[id]') // true
|
|
13
|
+
* matchPath('/products/123', '/products/{id}') // true
|
|
9
14
|
* matchPath('/products/123', '/products') // false
|
|
10
15
|
* matchPath('/anything', '*') // true
|
|
11
16
|
*/
|
|
@@ -13,8 +18,9 @@ export declare function matchPath(path: string, pattern: string): boolean;
|
|
|
13
18
|
/**
|
|
14
19
|
* Finds a matching transition configuration for the given from and to paths
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
21
|
+
* Chooses the most specific matching config. Exact paths outrank wildcard
|
|
22
|
+
* paths, deeper static wildcard prefixes outrank broader fallbacks, and equal
|
|
23
|
+
* specificity preserves the original config order.
|
|
18
24
|
*/
|
|
19
25
|
export declare function findMatchingTransition(from: string, to: string, transitions: Array<{
|
|
20
26
|
from: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AA6H/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC,GACD,gBAAgB,GAAG,IAAI,CAsBzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/core",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
"!dist/**/*.test.*",
|
|
33
33
|
"!dist/**/*.spec.*"
|
|
34
34
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"dev": "vite",
|
|
37
|
-
"watch": "vite build --watch",
|
|
38
|
-
"build": "tsc && vite build",
|
|
39
|
-
"preview": "vite preview",
|
|
40
|
-
"prepare": "pnpm run build",
|
|
41
|
-
"lint": "eslint .",
|
|
42
|
-
"test": "vitest",
|
|
43
|
-
"test:ui": "vitest --ui",
|
|
44
|
-
"test:run": "vitest run",
|
|
45
|
-
"test:coverage": "vitest run --coverage"
|
|
46
|
-
},
|
|
47
35
|
"keywords": [
|
|
48
36
|
"page-transition",
|
|
49
37
|
"page-transitions",
|
|
@@ -88,5 +76,16 @@
|
|
|
88
76
|
"vite": "^6.0.7",
|
|
89
77
|
"vite-plugin-dts": "^4.5.0",
|
|
90
78
|
"vitest": "^3.2.4"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"dev": "vite",
|
|
82
|
+
"watch": "vite build --watch",
|
|
83
|
+
"build": "tsc && vite build",
|
|
84
|
+
"preview": "vite preview",
|
|
85
|
+
"lint": "eslint .",
|
|
86
|
+
"test": "vitest",
|
|
87
|
+
"test:ui": "vitest --ui",
|
|
88
|
+
"test:run": "vitest run",
|
|
89
|
+
"test:coverage": "vitest run --coverage"
|
|
91
90
|
}
|
|
92
|
-
}
|
|
91
|
+
}
|