aptechka 0.52.0 → 0.52.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/lib/{Tweened-BSC-evuL.js → Tweened-BWPx3jJR.js} +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/{easings-Bni3YAAW.js → easings-BEmRlrDd.js} +15 -15
- package/lib/morph/Morph.d.ts +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +60 -57
- package/lib/scroll/index.js +2 -2
- package/lib/scroll-Benkuq-t.js +36 -0
- package/lib/scroll-DAhSpkhR.cjs +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +114 -121
- package/package.json +1 -1
- package/lib/scroll-H9zqFeML.cjs +0 -1
- package/lib/scroll-myLAt-Tq.js +0 -28
|
@@ -15,7 +15,7 @@ var c = (a, r, e) => r in a ? O(a, r, { enumerable: !0, configurable: !0, writab
|
|
|
15
15
|
}, g = (a, r) => b(a, x(r));
|
|
16
16
|
var A = (a, r, e) => r.has(a) || f("Cannot " + e);
|
|
17
17
|
var m = (a, r, e) => (A(a, r, "read from private field"), e ? e.call(a) : r.get(a)), n = (a, r, e) => r.has(a) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, e), u = (a, r, e, i) => (A(a, r, "write to private field"), i ? i.call(a, e) : r.set(a, e), e);
|
|
18
|
-
import { l as h, e as T } from "./easings-
|
|
18
|
+
import { l as h, e as T } from "./easings-BEmRlrDd.js";
|
|
19
19
|
import { c as q } from "./math-BOBiC4TN.js";
|
|
20
20
|
import { p as w } from "./number-DwCxt_Ck.js";
|
|
21
21
|
import { n as z } from "./polyfills-DJrTJQky.js";
|
package/lib/animation/index.js
CHANGED
package/lib/controls/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import { i as b } from "../index-euf5anj6.js";
|
|
|
8
8
|
import { g as J } from "../dom-CVWzyXPH.js";
|
|
9
9
|
import { ticker as A } from "../ticker/index.js";
|
|
10
10
|
import "../Store-swP_0ymB.js";
|
|
11
|
-
import {
|
|
12
|
-
import { T as ie } from "../Tweened-
|
|
11
|
+
import { a as te } from "../easings-BEmRlrDd.js";
|
|
12
|
+
import { T as ie } from "../Tweened-BWPx3jJR.js";
|
|
13
13
|
import { s as se } from "../gestures-CcXV6fCp.js";
|
|
14
14
|
import { p as he } from "../number-DwCxt_Ck.js";
|
|
15
15
|
import { TICK_ORDER as ae } from "../order/index.js";
|
|
@@ -18,21 +18,21 @@ const n = (e) => e, s = (e) => e * e, a = (e) => e * (2 - e), r = (e) => e < 0.5
|
|
|
18
18
|
linear: n
|
|
19
19
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
s as a,
|
|
22
|
+
a as b,
|
|
23
|
+
r as c,
|
|
24
|
+
u as d,
|
|
25
25
|
x as e,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
o as f,
|
|
27
|
+
c as g,
|
|
28
|
+
O as h,
|
|
29
|
+
i,
|
|
30
|
+
I as j,
|
|
31
|
+
Q as k,
|
|
32
32
|
n as l,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
p,
|
|
37
|
-
|
|
33
|
+
b as m,
|
|
34
|
+
l as n,
|
|
35
|
+
p as o,
|
|
36
|
+
d as p,
|
|
37
|
+
g as q
|
|
38
38
|
};
|
package/lib/morph/Morph.d.ts
CHANGED
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var vt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),Lt=r=>{throw TypeError(r)};var et=(r,t,s)=>t.has(r)||Lt("Cannot "+s);var e=(r,t,s)=>(et(r,t,"read from private field"),s?s.call(r):t.get(r)),o=(r,t,s)=>t.has(r)?Lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),a=(r,t,s,i)=>(et(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),d=(r,t,s)=>(et(r,t,"access private method"),s);var H=(r,t,s)=>new Promise((i,u)=>{var f=p=>{try{T(s.next(p))}catch(h){u(h)}},M=p=>{try{T(s.throw(p))}catch(h){u(h)}},T=p=>p.done?i(p.value):Promise.resolve(p.value).then(f,M);T((s=s.apply(r,t)).next())});var St=(r,t,s)=>(t=r[vt("asyncIterator")])?t.call(r):(r=r[vt("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=f=>new Promise((M,T,p)=>(f=u.call(r,f),p=f.done,Promise.resolve(f.value).then(h=>M({value:h,done:p}),T)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bt=require("../index-Cqw2NKev.cjs"),_=require("../events-KVanG9sR.cjs"),xt=require("../polyfills-Df4r-ETT.cjs"),Nt=require("../scroll-H9zqFeML.cjs"),X=require("../url-D1CgmwZ_.cjs"),Dt=require("../css-value-parser/index.cjs");class Pt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}bt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Pt);var b,c,x,j,I;class yt{constructor(t,s){o(this,b);o(this,c);o(this,x);o(this,j,t=>{t.preventDefault();const s=e(this,c).getAttribute("data-history-action")||"push",i=e(this,c).hasAttribute("data-center-scroll"),u=getComputedStyle(e(this,c)).getPropertyValue("--offset-scroll").trim(),f=u?Dt.cssValueParser.parse(u):void 0,M=e(this,c).hasAttribute("data-revalidate"),T=e(this,c).hasAttribute("data-keep-search-parameters");e(this,b).navigate(e(this,x),{historyAction:s,centerScroll:i,offsetScroll:f,revalidate:M,keepSearchParameters:T})});o(this,I,()=>{e(this,b).prefetch(e(this,x)),e(this,c).removeEventListener("pointerenter",e(this,I))});a(this,b,s),a(this,c,t),a(this,x,e(this,c).getAttribute("href")||"/"),e(this,c).addEventListener("click",e(this,j)),this.checkCurrent(location.pathname),e(this,c).hasAttribute("data-prefetch")&&e(this,c).addEventListener("pointerenter",e(this,I))}get element(){return e(this,c)}checkCurrent(t){const s=e(this,b).normalizePath(t),i=e(this,b).normalizePath(e(this,x));e(this,c).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,c).classList.add("current"):i.pathname===s.pathname?e(this,c).classList.add("current"):e(this,c).classList.remove("current")}destroy(){e(this,c).removeEventListener("click",e(this,j)),e(this,c).removeEventListener("pointerenter",e(this,I)),e(this,c).classList.remove("current")}}b=new WeakMap,c=new WeakMap,x=new WeakMap,j=new WeakMap,I=new WeakMap;var N,V,E,D,R,P;class wt{constructor(t,s,i){o(this,N);o(this,V);o(this,E,{x:0,y:0});o(this,D);o(this,R,null);o(this,P,null);a(this,N,t),a(this,V,s),a(this,D,i.cloneNode(!0))}get pathname(){return e(this,V)}get scrollState(){return e(this,E)}get document(){return e(this,P)}cloneDocument(){a(this,P,(e(this,R)||e(this,D)).cloneNode(!0))}get title(){let t="";if(e(this,P).title)t=e(this,P).title;else{const s=e(this,P).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,V)}return t}clearScrollState(){e(this,E).x=0,e(this,E).y=0}clearDocumentState(){a(this,R,null)}saveScrollState(){e(this,D).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,E).x=0,e(this,E).y=0):(e(this,E).x=e(this,N).scrollElement.scrollLeft,e(this,E).y=e(this,N).scrollElement.scrollTop)}saveDocumentState(){e(this,D).documentElement.hasAttribute("data-no-page-restoration")?a(this,R,null):a(this,R,document.cloneNode(!0))}restoreScrollPosition(){e(this,N).scrollElement.scroll({top:e(this,E).y,left:e(this,E).x})}}N=new WeakMap,V=new WeakMap,E=new WeakMap,D=new WeakMap,R=new WeakMap,P=new WeakMap;var A,U,g,Z,k,m,K,q,C,L,B,z,l,st,it,rt,At,nt,ot,at,lt,$,O;class Rt{constructor(t){o(this,l);o(this,A,null);o(this,U,null);o(this,g,[]);o(this,Z,new DOMParser);o(this,k);o(this,m,null);o(this,K);o(this,q,[]);o(this,C,!1);o(this,L,null);o(this,B,new Map);o(this,z,null);o(this,$,t=>H(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),a(this,C,!0),yield this.navigate(t.state.path,{historyAction:"none"}),a(this,C,!1))}));o(this,O,()=>{const t=e(this,L).scrollTop,s=e(this,L).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),_.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(bt.isBrowser){a(this,A,{base:X.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body"}),a(this,U,d(this,l,rt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,m,s.pathname),e(this,B).set(e(this,m),new wt(this,e(this,m),document)),document.documentElement.setAttribute("data-current-pathname",e(this,m)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,$)),X.changeHistory({action:"replace",pathname:e(this,m),searchParameters:s.parameters||location.search,hash:s.hash}),a(this,z,new Pt),d(this,l,at).call(this,document)}}get currentPathname(){return e(this,m)}get previousPathname(){return e(this,K)}get links(){return e(this,g)}get scrollElement(){return e(this,L)}normalizePath(t){return X.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t){return H(this,null,function*(){const s=this.normalizePath(t);d(this,l,it).call(this,s.pathname)})}navigate(T){return H(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:f,keepSearchParameters:M}={}){var ct;if(e(this,q).length)return;const p=this.normalizePath(((ct=this.pathnameModifier)==null?void 0:ct.call(this,t))||t);let{pathname:h,hash:Y,parameters:kt,leaf:Ct}=p;if(e(this,k)===h||e(this,m)===h){e(this,C)||d(this,l,lt).call(this,Y||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}a(this,k,h),e(this,g).forEach(F=>{F.checkCurrent(h)});try{let F=!0;if(this.preprocessor)try{yield new Promise((n,y)=>{var w;(w=this.preprocessor)==null||w.call(this,{pathname:h,resolve:n,reject:y})})}catch(n){n?console.error(n):console.log("Route change canceled"),F=!1}if(!F||e(this,k)!==h){e(this,g).forEach(n=>{n.checkCurrent(e(this,m))});return}const ht=yield d(this,l,st).call(this,e(this,m)),S=yield d(this,l,st).call(this,h,f);if(e(this,k)!==h){e(this,g).forEach(n=>{n.checkCurrent(e(this,m))});return}ht.saveScrollState(),ht.saveDocumentState(),e(this,C)||(S.clearScrollState(),S.clearDocumentState()),S.cloneDocument(),e(this,z).textContent=S.title,document.body.appendChild(e(this,z));const ut={pathname:h};_.dispatchEvent(document,"morphStart",{detail:ut});const dt=Array.from(document.head.children),mt=Array.from(S.document.head.children),ft=d(this,l,At).call(this,dt,mt),Mt=d(this,l,nt).call(this,dt,ft),G=d(this,l,nt).call(this,mt,ft);G.forEach((n,y)=>{if(n.tagName==="SCRIPT"&&n.getAttribute("src")){const w=document.createElement("script");w.type="module",w.src=n.getAttribute("src"),G[y]=w}}),G.forEach(n=>{document.head.appendChild(n)});const tt=G.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(d(this,l,ot).call(this,n))return!0});e(this,A).waitForHeadToLoad&&tt.length&&(yield new Promise(n=>H(this,null,function*(){let y=0;try{for(var w=St(tt),Et,W,gt;Et=!(W=yield w.next()).done;Et=!1){const J=W.value;J.onload=()=>{y++,y===tt.length&&n()}}}catch(W){gt=[W]}finally{try{Et&&(W=w.return)&&(yield W.call(w))}finally{if(gt)throw gt[0]}}})));const pt=[];Mt.forEach(n=>{n.hasAttribute("data-permanent")||(d(this,l,ot).call(this,n)?pt.push(n):n.remove())});const Tt=d(this,l,rt).call(this,S.document.body);d(this,l,at).call(this,S.document),document.documentElement.setAttribute("data-current-pathname",h),document.documentElement.setAttribute("data-current-leaf",Ct),X.changeHistory({action:s,pathname:h,searchParameters:kt||(M?location.search:""),hash:Y}),e(this,z).remove(),a(this,K,e(this,m)),a(this,m,h),e(this,U).forEach((n,y)=>{const w=Tt[y],Et=getComputedStyle(n).getPropertyValue("--morph-duration"),W=[...w.childNodes];if(Et){const gt=[...n.childNodes];gt.forEach(v=>{v instanceof HTMLElement&&v.classList.add("old")}),W.forEach(v=>{v instanceof HTMLElement&&v.classList.add("new")}),n.prepend(...W),xt.requestIdleCallback(()=>{W.forEach(v=>{v instanceof HTMLElement&&v.classList.add("in")})});const J={morphElement:n,pathname:h};_.dispatchEvent(document,"morphNewChildrenAdded",{detail:J});const Ht=new Promise(v=>{setTimeout(()=>{gt.forEach(Q=>Q.remove()),W.forEach(Q=>{Q instanceof HTMLElement&&Q.classList.remove("in","new")}),_.dispatchEvent(document,"morphOldChildrenRemoved",{detail:J}),v()},(parseFloat(Et)||0)*1e3+10)});e(this,q).push(Ht)}else n.innerHTML="",n.append(...W)}),Y?(S.clearScrollState(),d(this,l,lt).call(this,Y,{centerScroll:i,offsetScroll:u})):e(this,C)&&S.restoreScrollPosition(),yield Promise.all(e(this,q)),pt.forEach(n=>n.remove()),a(this,q,[]),this.findLinks(),_.dispatchEvent(document,"morphComplete",{detail:ut}),window.dispatchEvent(new Event("resize"))}catch(F){console.error(F)}a(this,k,void 0)})}addLink(t){e(this,g).push(new yt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){a(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var i;return((i=s.getAttribute("href"))==null?void 0:i.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")&&s.getAttribute("target")!=="_blank"});e(this,g).forEach(s=>s.destroy()),a(this,g,t.map(s=>new yt(s,this)))}}A=new WeakMap,U=new WeakMap,g=new WeakMap,Z=new WeakMap,k=new WeakMap,m=new WeakMap,K=new WeakMap,q=new WeakMap,C=new WeakMap,L=new WeakMap,B=new WeakMap,z=new WeakMap,l=new WeakSet,st=function(t,s=!1){return H(this,null,function*(){let i=e(this,B).get(t);return(!i||s)&&(i=yield d(this,l,it).call(this,t)),i})},it=function(t){return H(this,null,function*(){const i=yield(yield fetch(t)).text(),u=e(this,Z).parseFromString(i,"text/html"),f=new wt(this,t,u);return e(this,B).set(t,f),f})},rt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},At=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},nt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},ot=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},at=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,O)),a(this,L,t.querySelector(e(this,A).scrollSelector)||t.documentElement),(i=e(this,L))==null||i.addEventListener("scroll",e(this,O)),e(this,O).call(this)},lt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Nt.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},$=new WeakMap,O=new WeakMap;exports.Morph=Rt;
|
|
1
|
+
"use strict";var vt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),Lt=r=>{throw TypeError(r)};var et=(r,t,s)=>t.has(r)||Lt("Cannot "+s);var e=(r,t,s)=>(et(r,t,"read from private field"),s?s.call(r):t.get(r)),o=(r,t,s)=>t.has(r)?Lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),a=(r,t,s,i)=>(et(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),d=(r,t,s)=>(et(r,t,"access private method"),s);var H=(r,t,s)=>new Promise((i,u)=>{var f=p=>{try{T(s.next(p))}catch(h){u(h)}},M=p=>{try{T(s.throw(p))}catch(h){u(h)}},T=p=>p.done?i(p.value):Promise.resolve(p.value).then(f,M);T((s=s.apply(r,t)).next())});var St=(r,t,s)=>(t=r[vt("asyncIterator")])?t.call(r):(r=r[vt("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=f=>new Promise((M,T,p)=>(f=u.call(r,f),p=f.done,Promise.resolve(f.value).then(h=>M({value:h,done:p}),T)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pt=require("../index-Cqw2NKev.cjs"),_=require("../events-KVanG9sR.cjs"),Nt=require("../polyfills-Df4r-ETT.cjs"),yt=require("../scroll-DAhSpkhR.cjs"),X=require("../url-D1CgmwZ_.cjs"),Dt=require("../css-value-parser/index.cjs");class At extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Pt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",At);var P,c,x,j,I;class wt{constructor(t,s){o(this,P);o(this,c);o(this,x);o(this,j,t=>{t.preventDefault();const s=e(this,c).getAttribute("data-history-action")||"push",i=e(this,c).hasAttribute("data-center-scroll"),u=getComputedStyle(e(this,c)).getPropertyValue("--offset-scroll").trim(),f=u?Dt.cssValueParser.parse(u):void 0,M=e(this,c).hasAttribute("data-revalidate"),T=e(this,c).hasAttribute("data-keep-search-parameters");e(this,P).navigate(e(this,x),{historyAction:s,centerScroll:i,offsetScroll:f,revalidate:M,keepSearchParameters:T})});o(this,I,()=>{e(this,P).prefetch(e(this,x)),e(this,c).removeEventListener("pointerenter",e(this,I))});a(this,P,s),a(this,c,t),a(this,x,e(this,c).getAttribute("href")||"/"),e(this,c).addEventListener("click",e(this,j)),this.checkCurrent(location.pathname),e(this,c).hasAttribute("data-prefetch")&&e(this,c).addEventListener("pointerenter",e(this,I))}get element(){return e(this,c)}checkCurrent(t){const s=e(this,P).normalizePath(t),i=e(this,P).normalizePath(e(this,x));e(this,c).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,c).classList.add("current"):i.pathname===s.pathname?e(this,c).classList.add("current"):e(this,c).classList.remove("current")}destroy(){e(this,c).removeEventListener("click",e(this,j)),e(this,c).removeEventListener("pointerenter",e(this,I)),e(this,c).classList.remove("current")}}P=new WeakMap,c=new WeakMap,x=new WeakMap,j=new WeakMap,I=new WeakMap;var N,V,E,D,R,A;class bt{constructor(t,s,i){o(this,N);o(this,V);o(this,E,{x:0,y:0});o(this,D);o(this,R,null);o(this,A,null);a(this,N,t),a(this,V,s),a(this,D,i.cloneNode(!0))}get pathname(){return e(this,V)}get scrollState(){return e(this,E)}get document(){return e(this,A)}cloneDocument(){a(this,A,(e(this,R)||e(this,D)).cloneNode(!0))}get title(){let t="";if(e(this,A).title)t=e(this,A).title;else{const s=e(this,A).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,V)}return t}clearScrollState(){e(this,E).x=0,e(this,E).y=0}clearDocumentState(){a(this,R,null)}saveScrollState(){e(this,D).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,E).x=0,e(this,E).y=0):(e(this,E).x=e(this,N).scrollElement.scrollLeft,e(this,E).y=e(this,N).scrollElement.scrollTop)}saveDocumentState(){e(this,D).documentElement.hasAttribute("data-no-page-restoration")?a(this,R,null):a(this,R,document.cloneNode(!0))}restoreScrollPosition(){e(this,N).scrollElement.scroll({top:e(this,E).y,left:e(this,E).x})}}N=new WeakMap,V=new WeakMap,E=new WeakMap,D=new WeakMap,R=new WeakMap,A=new WeakMap;var k,U,g,Z,C,m,K,q,y,L,B,z,l,st,it,rt,kt,nt,ot,at,lt,$,O;class Rt{constructor(t){o(this,l);o(this,k,null);o(this,U,null);o(this,g,[]);o(this,Z,new DOMParser);o(this,C);o(this,m,null);o(this,K);o(this,q,[]);o(this,y,!1);o(this,L,null);o(this,B,new Map);o(this,z,null);o(this,$,t=>H(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),a(this,y,!0),yield this.navigate(t.state.path,{historyAction:"none"}),a(this,y,!1))}));o(this,O,()=>{const t=e(this,L).scrollTop,s=e(this,L).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),_.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(Pt.isBrowser){a(this,k,{base:X.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body"}),a(this,U,d(this,l,rt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,m,s.pathname),e(this,B).set(e(this,m),new bt(this,e(this,m),document)),document.documentElement.setAttribute("data-current-pathname",e(this,m)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,$)),X.changeHistory({action:"replace",pathname:e(this,m),searchParameters:s.parameters||location.search,hash:s.hash}),a(this,z,new At),d(this,l,at).call(this,document)}}get currentPathname(){return e(this,m)}get previousPathname(){return e(this,K)}get links(){return e(this,g)}get scrollElement(){return e(this,L)}get isPopstateNavigation(){return e(this,y)}normalizePath(t){return X.splitPath(t,{base:e(this,k).base,trailingSlash:e(this,k).trailingSlash})}prefetch(t){return H(this,null,function*(){const s=this.normalizePath(t);d(this,l,it).call(this,s.pathname)})}navigate(T){return H(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:f,keepSearchParameters:M}={}){var ct;if(e(this,q).length)return;const p=this.normalizePath(((ct=this.pathnameModifier)==null?void 0:ct.call(this,t))||t);let{pathname:h,hash:Y,parameters:Ct,leaf:Mt}=p;if(e(this,C)===h||e(this,m)===h){e(this,y)||d(this,l,lt).call(this,Y||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}a(this,C,h),e(this,g).forEach(F=>{F.checkCurrent(h)});try{let F=!0;if(this.preprocessor)try{yield new Promise((n,w)=>{var b;(b=this.preprocessor)==null||b.call(this,{pathname:h,resolve:n,reject:w})})}catch(n){n?console.error(n):console.log("Route change canceled"),F=!1}if(!F||e(this,C)!==h){e(this,g).forEach(n=>{n.checkCurrent(e(this,m))});return}const ht=yield d(this,l,st).call(this,e(this,m)),S=yield d(this,l,st).call(this,h,f);if(e(this,C)!==h){e(this,g).forEach(n=>{n.checkCurrent(e(this,m))});return}ht.saveScrollState(),ht.saveDocumentState(),e(this,y)||(S.clearScrollState(),S.clearDocumentState()),S.cloneDocument(),e(this,z).textContent=S.title,document.body.appendChild(e(this,z));const ut={pathname:h};_.dispatchEvent(document,"morphStart",{detail:ut});const dt=Array.from(document.head.children),mt=Array.from(S.document.head.children),ft=d(this,l,kt).call(this,dt,mt),Tt=d(this,l,nt).call(this,dt,ft),G=d(this,l,nt).call(this,mt,ft);G.forEach((n,w)=>{if(n.tagName==="SCRIPT"&&n.getAttribute("src")){const b=document.createElement("script");b.type="module",b.src=n.getAttribute("src"),G[w]=b}}),G.forEach(n=>{document.head.appendChild(n)});const tt=G.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(d(this,l,ot).call(this,n))return!0});e(this,k).waitForHeadToLoad&&tt.length&&(yield new Promise(n=>H(this,null,function*(){let w=0;try{for(var b=St(tt),Et,W,gt;Et=!(W=yield b.next()).done;Et=!1){const J=W.value;J.onload=()=>{w++,w===tt.length&&n()}}}catch(W){gt=[W]}finally{try{Et&&(W=b.return)&&(yield W.call(b))}finally{if(gt)throw gt[0]}}}))),yield yt.wait(10);const pt=[];Tt.forEach(n=>{n.hasAttribute("data-permanent")||(d(this,l,ot).call(this,n)?pt.push(n):n.remove())});const Ht=d(this,l,rt).call(this,S.document.body);d(this,l,at).call(this,S.document),document.documentElement.setAttribute("data-current-pathname",h),document.documentElement.setAttribute("data-current-leaf",Mt),X.changeHistory({action:s,pathname:h,searchParameters:Ct||(M?location.search:""),hash:Y}),e(this,z).remove(),a(this,K,e(this,m)),a(this,m,h),e(this,U).forEach((n,w)=>{const b=Ht[w],Et=getComputedStyle(n).getPropertyValue("--morph-duration"),W=[...b.childNodes];if(Et){const gt=[...n.childNodes];gt.forEach(v=>{v instanceof HTMLElement&&v.classList.add("old")}),W.forEach(v=>{v instanceof HTMLElement&&v.classList.add("new")}),n.prepend(...W),Nt.requestIdleCallback(()=>{W.forEach(v=>{v instanceof HTMLElement&&v.classList.add("in")})});const J={morphElement:n,pathname:h};_.dispatchEvent(document,"morphNewChildrenAdded",{detail:J});const xt=new Promise(v=>{setTimeout(()=>{gt.forEach(Q=>Q.remove()),W.forEach(Q=>{Q instanceof HTMLElement&&Q.classList.remove("in","new")}),_.dispatchEvent(document,"morphOldChildrenRemoved",{detail:J}),v()},(parseFloat(Et)||0)*1e3+10)});e(this,q).push(xt)}else n.innerHTML="",n.append(...W)}),Y?(S.clearScrollState(),d(this,l,lt).call(this,Y,{centerScroll:i,offsetScroll:u})):e(this,y)&&S.restoreScrollPosition(),yield Promise.all(e(this,q)),pt.forEach(n=>n.remove()),a(this,q,[]),this.findLinks(),_.dispatchEvent(document,"morphComplete",{detail:ut}),window.dispatchEvent(new Event("resize"))}catch(F){console.error(F)}a(this,C,void 0)})}addLink(t){e(this,g).push(new wt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){a(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var i;return((i=s.getAttribute("href"))==null?void 0:i.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")&&s.getAttribute("target")!=="_blank"});e(this,g).forEach(s=>s.destroy()),a(this,g,t.map(s=>new wt(s,this)))}}k=new WeakMap,U=new WeakMap,g=new WeakMap,Z=new WeakMap,C=new WeakMap,m=new WeakMap,K=new WeakMap,q=new WeakMap,y=new WeakMap,L=new WeakMap,B=new WeakMap,z=new WeakMap,l=new WeakSet,st=function(t,s=!1){return H(this,null,function*(){let i=e(this,B).get(t);return(!i||s)&&(i=yield d(this,l,it).call(this,t)),i})},it=function(t){return H(this,null,function*(){const i=yield(yield fetch(t)).text(),u=e(this,Z).parseFromString(i,"text/html"),f=new bt(this,t,u);return e(this,B).set(t,f),f})},rt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},kt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},nt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},ot=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},at=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,O)),a(this,L,t.querySelector(e(this,k).scrollSelector)||t.documentElement),(i=e(this,L))==null||i.addEventListener("scroll",e(this,O)),e(this,O).call(this)},lt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&yt.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},$=new WeakMap,O=new WeakMap;exports.Morph=Rt;
|
package/lib/morph/index.js
CHANGED
|
@@ -23,9 +23,9 @@ var Lt = (r, t, s) => (t = r[gt("asyncIterator")]) ? t.call(r) : (r = r[gt("iter
|
|
|
23
23
|
import { i as bt } from "../index-euf5anj6.js";
|
|
24
24
|
import { d as U } from "../events-CsVF98U6.js";
|
|
25
25
|
import { r as xt } from "../polyfills-DJrTJQky.js";
|
|
26
|
-
import {
|
|
27
|
-
import { n as
|
|
28
|
-
import { cssValueParser as
|
|
26
|
+
import { w as Nt, s as Dt } from "../scroll-Benkuq-t.js";
|
|
27
|
+
import { n as Rt, c as St, s as zt } from "../url-B6BNcw6_.js";
|
|
28
|
+
import { cssValueParser as qt } from "../css-value-parser/index.js";
|
|
29
29
|
class Pt extends HTMLElement {
|
|
30
30
|
connectedCallback() {
|
|
31
31
|
const t = {
|
|
@@ -38,20 +38,20 @@ class Pt extends HTMLElement {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
bt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Pt);
|
|
41
|
-
var
|
|
42
|
-
class
|
|
41
|
+
var P, h, x, j, I;
|
|
42
|
+
class wt {
|
|
43
43
|
constructor(t, s) {
|
|
44
|
-
o(this,
|
|
44
|
+
o(this, P);
|
|
45
45
|
o(this, h);
|
|
46
46
|
o(this, x);
|
|
47
47
|
o(this, j, (t) => {
|
|
48
48
|
t.preventDefault();
|
|
49
49
|
const s = e(this, h).getAttribute(
|
|
50
50
|
"data-history-action"
|
|
51
|
-
) || "push", i = e(this, h).hasAttribute("data-center-scroll"), u = getComputedStyle(e(this, h)).getPropertyValue("--offset-scroll").trim(), f = u ?
|
|
51
|
+
) || "push", i = e(this, h).hasAttribute("data-center-scroll"), u = getComputedStyle(e(this, h)).getPropertyValue("--offset-scroll").trim(), f = u ? qt.parse(u) : void 0, T = e(this, h).hasAttribute("data-revalidate"), M = e(this, h).hasAttribute(
|
|
52
52
|
"data-keep-search-parameters"
|
|
53
53
|
);
|
|
54
|
-
e(this,
|
|
54
|
+
e(this, P).navigate(e(this, x), {
|
|
55
55
|
historyAction: s,
|
|
56
56
|
centerScroll: i,
|
|
57
57
|
offsetScroll: f,
|
|
@@ -60,31 +60,31 @@ class yt {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
o(this, I, () => {
|
|
63
|
-
e(this,
|
|
63
|
+
e(this, P).prefetch(e(this, x)), e(this, h).removeEventListener("pointerenter", e(this, I));
|
|
64
64
|
});
|
|
65
|
-
a(this,
|
|
65
|
+
a(this, P, s), a(this, h, t), a(this, x, e(this, h).getAttribute("href") || "/"), e(this, h).addEventListener("click", e(this, j)), this.checkCurrent(location.pathname), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, I));
|
|
66
66
|
}
|
|
67
67
|
get element() {
|
|
68
68
|
return e(this, h);
|
|
69
69
|
}
|
|
70
70
|
checkCurrent(t) {
|
|
71
|
-
const s = e(this,
|
|
71
|
+
const s = e(this, P).normalizePath(t), i = e(this, P).normalizePath(e(this, x));
|
|
72
72
|
e(this, h).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? e(this, h).classList.add("current") : i.pathname === s.pathname ? e(this, h).classList.add("current") : e(this, h).classList.remove("current");
|
|
73
73
|
}
|
|
74
74
|
destroy() {
|
|
75
75
|
e(this, h).removeEventListener("click", e(this, j)), e(this, h).removeEventListener("pointerenter", e(this, I)), e(this, h).classList.remove("current");
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
var N, V, E, D, R,
|
|
80
|
-
class
|
|
78
|
+
P = new WeakMap(), h = new WeakMap(), x = new WeakMap(), j = new WeakMap(), I = new WeakMap();
|
|
79
|
+
var N, V, E, D, R, A;
|
|
80
|
+
class yt {
|
|
81
81
|
constructor(t, s, i) {
|
|
82
82
|
o(this, N);
|
|
83
83
|
o(this, V);
|
|
84
84
|
o(this, E, { x: 0, y: 0 });
|
|
85
85
|
o(this, D);
|
|
86
86
|
o(this, R, null);
|
|
87
|
-
o(this,
|
|
87
|
+
o(this, A, null);
|
|
88
88
|
a(this, N, t), a(this, V, s), a(this, D, i.cloneNode(!0));
|
|
89
89
|
}
|
|
90
90
|
get pathname() {
|
|
@@ -94,17 +94,17 @@ class wt {
|
|
|
94
94
|
return e(this, E);
|
|
95
95
|
}
|
|
96
96
|
get document() {
|
|
97
|
-
return e(this,
|
|
97
|
+
return e(this, A);
|
|
98
98
|
}
|
|
99
99
|
cloneDocument() {
|
|
100
|
-
a(this,
|
|
100
|
+
a(this, A, (e(this, R) || e(this, D)).cloneNode(!0));
|
|
101
101
|
}
|
|
102
102
|
get title() {
|
|
103
103
|
let t = "";
|
|
104
|
-
if (e(this,
|
|
105
|
-
t = e(this,
|
|
104
|
+
if (e(this, A).title)
|
|
105
|
+
t = e(this, A).title;
|
|
106
106
|
else {
|
|
107
|
-
const s = e(this,
|
|
107
|
+
const s = e(this, A).querySelector("h1");
|
|
108
108
|
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, V);
|
|
109
109
|
}
|
|
110
110
|
return t;
|
|
@@ -132,26 +132,26 @@ class wt {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
N = new WeakMap(), V = new WeakMap(), E = new WeakMap(), D = new WeakMap(), R = new WeakMap(),
|
|
136
|
-
var
|
|
137
|
-
class
|
|
135
|
+
N = new WeakMap(), V = new WeakMap(), E = new WeakMap(), D = new WeakMap(), R = new WeakMap(), A = new WeakMap();
|
|
136
|
+
var k, K, g, X, C, m, Y, z, w, L, B, q, l, et, st, it, At, rt, nt, ot, at, Z, O;
|
|
137
|
+
class jt {
|
|
138
138
|
constructor(t) {
|
|
139
139
|
o(this, l);
|
|
140
|
-
o(this,
|
|
140
|
+
o(this, k, null);
|
|
141
141
|
o(this, K, null);
|
|
142
142
|
o(this, g, []);
|
|
143
143
|
o(this, X, new DOMParser());
|
|
144
|
-
o(this,
|
|
144
|
+
o(this, C);
|
|
145
145
|
o(this, m, null);
|
|
146
146
|
o(this, Y);
|
|
147
147
|
o(this, z, []);
|
|
148
|
-
o(this,
|
|
148
|
+
o(this, w, !1);
|
|
149
149
|
o(this, L, null);
|
|
150
150
|
o(this, B, /* @__PURE__ */ new Map());
|
|
151
151
|
o(this, q, null);
|
|
152
152
|
o(this, Z, (t) => H(this, null, function* () {
|
|
153
153
|
var s;
|
|
154
|
-
(s = t.state) != null && s.path && (t.preventDefault(), a(this,
|
|
154
|
+
(s = t.state) != null && s.path && (t.preventDefault(), a(this, w, !0), yield this.navigate(t.state.path, { historyAction: "none" }), a(this, w, !1));
|
|
155
155
|
}));
|
|
156
156
|
o(this, O, () => {
|
|
157
157
|
const t = e(this, L).scrollTop, s = e(this, L).scrollLeft;
|
|
@@ -163,8 +163,8 @@ class Ut {
|
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
if (bt) {
|
|
166
|
-
a(this,
|
|
167
|
-
base:
|
|
166
|
+
a(this, k, {
|
|
167
|
+
base: Rt(t == null ? void 0 : t.base),
|
|
168
168
|
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
169
169
|
cachePages: (t == null ? void 0 : t.cachePages) !== !1,
|
|
170
170
|
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
@@ -175,7 +175,7 @@ class Ut {
|
|
|
175
175
|
);
|
|
176
176
|
a(this, m, s.pathname), e(this, B).set(
|
|
177
177
|
e(this, m),
|
|
178
|
-
new
|
|
178
|
+
new yt(this, e(this, m), document)
|
|
179
179
|
), document.documentElement.setAttribute(
|
|
180
180
|
"data-current-pathname",
|
|
181
181
|
e(this, m)
|
|
@@ -202,10 +202,13 @@ class Ut {
|
|
|
202
202
|
get scrollElement() {
|
|
203
203
|
return e(this, L);
|
|
204
204
|
}
|
|
205
|
+
get isPopstateNavigation() {
|
|
206
|
+
return e(this, w);
|
|
207
|
+
}
|
|
205
208
|
normalizePath(t) {
|
|
206
|
-
return
|
|
207
|
-
base: e(this,
|
|
208
|
-
trailingSlash: e(this,
|
|
209
|
+
return zt(t, {
|
|
210
|
+
base: e(this, k).base,
|
|
211
|
+
trailingSlash: e(this, k).trailingSlash
|
|
209
212
|
});
|
|
210
213
|
}
|
|
211
214
|
prefetch(t) {
|
|
@@ -227,15 +230,15 @@ class Ut {
|
|
|
227
230
|
return;
|
|
228
231
|
const p = this.normalizePath(((lt = this.pathnameModifier) == null ? void 0 : lt.call(this, t)) || t);
|
|
229
232
|
let { pathname: c, hash: _, parameters: kt, leaf: Ct } = p;
|
|
230
|
-
if (e(this,
|
|
231
|
-
e(this,
|
|
233
|
+
if (e(this, C) === c || e(this, m) === c) {
|
|
234
|
+
e(this, w) || d(this, l, at).call(this, _ || 0, {
|
|
232
235
|
centerScroll: i,
|
|
233
236
|
offsetScroll: u,
|
|
234
237
|
behavior: "smooth"
|
|
235
238
|
});
|
|
236
239
|
return;
|
|
237
240
|
}
|
|
238
|
-
a(this,
|
|
241
|
+
a(this, C, c), e(this, g).forEach((F) => {
|
|
239
242
|
F.checkCurrent(c);
|
|
240
243
|
});
|
|
241
244
|
try {
|
|
@@ -243,8 +246,8 @@ class Ut {
|
|
|
243
246
|
if (this.preprocessor)
|
|
244
247
|
try {
|
|
245
248
|
yield new Promise((n, y) => {
|
|
246
|
-
var
|
|
247
|
-
(
|
|
249
|
+
var b;
|
|
250
|
+
(b = this.preprocessor) == null || b.call(this, {
|
|
248
251
|
pathname: c,
|
|
249
252
|
resolve: n,
|
|
250
253
|
reject: y
|
|
@@ -253,20 +256,20 @@ class Ut {
|
|
|
253
256
|
} catch (n) {
|
|
254
257
|
n ? console.error(n) : console.log("Route change canceled"), F = !1;
|
|
255
258
|
}
|
|
256
|
-
if (!F || e(this,
|
|
259
|
+
if (!F || e(this, C) !== c) {
|
|
257
260
|
e(this, g).forEach((n) => {
|
|
258
261
|
n.checkCurrent(e(this, m));
|
|
259
262
|
});
|
|
260
263
|
return;
|
|
261
264
|
}
|
|
262
265
|
const ht = yield d(this, l, et).call(this, e(this, m)), S = yield d(this, l, et).call(this, c, f);
|
|
263
|
-
if (e(this,
|
|
266
|
+
if (e(this, C) !== c) {
|
|
264
267
|
e(this, g).forEach((n) => {
|
|
265
268
|
n.checkCurrent(e(this, m));
|
|
266
269
|
});
|
|
267
270
|
return;
|
|
268
271
|
}
|
|
269
|
-
ht.saveScrollState(), ht.saveDocumentState(), e(this,
|
|
272
|
+
ht.saveScrollState(), ht.saveDocumentState(), e(this, w) || (S.clearScrollState(), S.clearDocumentState()), S.cloneDocument(), e(this, q).textContent = S.title, document.body.appendChild(e(this, q));
|
|
270
273
|
const ct = {
|
|
271
274
|
pathname: c
|
|
272
275
|
};
|
|
@@ -276,8 +279,8 @@ class Ut {
|
|
|
276
279
|
const ut = Array.from(document.head.children), dt = Array.from(S.document.head.children), mt = d(this, l, At).call(this, ut, dt), Tt = d(this, l, rt).call(this, ut, mt), G = d(this, l, rt).call(this, dt, mt);
|
|
277
280
|
G.forEach((n, y) => {
|
|
278
281
|
if (n.tagName === "SCRIPT" && n.getAttribute("src")) {
|
|
279
|
-
const
|
|
280
|
-
|
|
282
|
+
const b = document.createElement("script");
|
|
283
|
+
b.type = "module", b.src = n.getAttribute("src"), G[y] = b;
|
|
281
284
|
}
|
|
282
285
|
}), G.forEach((n) => {
|
|
283
286
|
document.head.appendChild(n);
|
|
@@ -288,10 +291,10 @@ class Ut {
|
|
|
288
291
|
if (d(this, l, nt).call(this, n))
|
|
289
292
|
return !0;
|
|
290
293
|
});
|
|
291
|
-
e(this,
|
|
294
|
+
e(this, k).waitForHeadToLoad && $.length && (yield new Promise((n) => H(this, null, function* () {
|
|
292
295
|
let y = 0;
|
|
293
296
|
try {
|
|
294
|
-
for (var
|
|
297
|
+
for (var b = Lt($), pt, W, Et; pt = !(W = yield b.next()).done; pt = !1) {
|
|
295
298
|
const J = W.value;
|
|
296
299
|
J.onload = () => {
|
|
297
300
|
y++, y === $.length && n();
|
|
@@ -301,13 +304,13 @@ class Ut {
|
|
|
301
304
|
Et = [W];
|
|
302
305
|
} finally {
|
|
303
306
|
try {
|
|
304
|
-
pt && (W =
|
|
307
|
+
pt && (W = b.return) && (yield W.call(b));
|
|
305
308
|
} finally {
|
|
306
309
|
if (Et)
|
|
307
310
|
throw Et[0];
|
|
308
311
|
}
|
|
309
312
|
}
|
|
310
|
-
})));
|
|
313
|
+
}))), yield Nt(10);
|
|
311
314
|
const ft = [];
|
|
312
315
|
Tt.forEach((n) => {
|
|
313
316
|
n.hasAttribute("data-permanent") || (d(this, l, nt).call(this, n) ? ft.push(n) : n.remove());
|
|
@@ -319,7 +322,7 @@ class Ut {
|
|
|
319
322
|
searchParameters: kt || (T ? location.search : ""),
|
|
320
323
|
hash: _
|
|
321
324
|
}), e(this, q).remove(), a(this, Y, e(this, m)), a(this, m, c), e(this, K).forEach((n, y) => {
|
|
322
|
-
const
|
|
325
|
+
const b = Mt[y], pt = getComputedStyle(n).getPropertyValue("--morph-duration"), W = [...b.childNodes];
|
|
323
326
|
if (pt) {
|
|
324
327
|
const Et = [...n.childNodes];
|
|
325
328
|
Et.forEach((v) => {
|
|
@@ -350,17 +353,17 @@ class Ut {
|
|
|
350
353
|
e(this, z).push(Ht);
|
|
351
354
|
} else
|
|
352
355
|
n.innerHTML = "", n.append(...W);
|
|
353
|
-
}), _ ? (S.clearScrollState(), d(this, l, at).call(this, _, { centerScroll: i, offsetScroll: u })) : e(this,
|
|
356
|
+
}), _ ? (S.clearScrollState(), d(this, l, at).call(this, _, { centerScroll: i, offsetScroll: u })) : e(this, w) && S.restoreScrollPosition(), yield Promise.all(e(this, z)), ft.forEach((n) => n.remove()), a(this, z, []), this.findLinks(), U(document, "morphComplete", {
|
|
354
357
|
detail: ct
|
|
355
358
|
}), window.dispatchEvent(new Event("resize"));
|
|
356
359
|
} catch (F) {
|
|
357
360
|
console.error(F);
|
|
358
361
|
}
|
|
359
|
-
a(this,
|
|
362
|
+
a(this, C, void 0);
|
|
360
363
|
});
|
|
361
364
|
}
|
|
362
365
|
addLink(t) {
|
|
363
|
-
e(this, g).push(new
|
|
366
|
+
e(this, g).push(new wt(t, this));
|
|
364
367
|
}
|
|
365
368
|
addLinks(t) {
|
|
366
369
|
t.forEach((s) => {
|
|
@@ -379,17 +382,17 @@ class Ut {
|
|
|
379
382
|
return ((i = s.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]") && s.getAttribute("target") !== "_blank";
|
|
380
383
|
}
|
|
381
384
|
);
|
|
382
|
-
e(this, g).forEach((s) => s.destroy()), a(this, g, t.map((s) => new
|
|
385
|
+
e(this, g).forEach((s) => s.destroy()), a(this, g, t.map((s) => new wt(s, this)));
|
|
383
386
|
}
|
|
384
387
|
}
|
|
385
|
-
|
|
388
|
+
k = new WeakMap(), K = new WeakMap(), g = new WeakMap(), X = new WeakMap(), C = new WeakMap(), m = new WeakMap(), Y = new WeakMap(), z = new WeakMap(), w = new WeakMap(), L = new WeakMap(), B = new WeakMap(), q = new WeakMap(), l = new WeakSet(), et = function(t, s = !1) {
|
|
386
389
|
return H(this, null, function* () {
|
|
387
390
|
let i = e(this, B).get(t);
|
|
388
391
|
return (!i || s) && (i = yield d(this, l, st).call(this, t)), i;
|
|
389
392
|
});
|
|
390
393
|
}, st = function(t) {
|
|
391
394
|
return H(this, null, function* () {
|
|
392
|
-
const i = yield (yield fetch(t)).text(), u = e(this, X).parseFromString(i, "text/html"), f = new
|
|
395
|
+
const i = yield (yield fetch(t)).text(), u = e(this, X).parseFromString(i, "text/html"), f = new yt(this, t, u);
|
|
393
396
|
return e(this, B).set(t, f), f;
|
|
394
397
|
});
|
|
395
398
|
}, it = function(t) {
|
|
@@ -414,10 +417,10 @@ A = new WeakMap(), K = new WeakMap(), g = new WeakMap(), X = new WeakMap(), k =
|
|
|
414
417
|
(s = e(this, L)) == null || s.removeEventListener(
|
|
415
418
|
"scroll",
|
|
416
419
|
e(this, O)
|
|
417
|
-
), a(this, L, t.querySelector(e(this,
|
|
420
|
+
), a(this, L, t.querySelector(e(this, k).scrollSelector) || t.documentElement), (i = e(this, L)) == null || i.addEventListener("scroll", e(this, O)), e(this, O).call(this);
|
|
418
421
|
}, at = function(t, s) {
|
|
419
422
|
const i = typeof t == "string" ? document.getElementById(t) : t;
|
|
420
|
-
(typeof i == "number" || i) &&
|
|
423
|
+
(typeof i == "number" || i) && Dt(i, {
|
|
421
424
|
scrollElement: e(this, L),
|
|
422
425
|
behavior: (s == null ? void 0 : s.behavior) || "instant",
|
|
423
426
|
center: s == null ? void 0 : s.centerScroll,
|
|
@@ -425,5 +428,5 @@ A = new WeakMap(), K = new WeakMap(), g = new WeakMap(), X = new WeakMap(), k =
|
|
|
425
428
|
});
|
|
426
429
|
}, Z = new WeakMap(), O = new WeakMap();
|
|
427
430
|
export {
|
|
428
|
-
|
|
431
|
+
jt as Morph
|
|
429
432
|
};
|
package/lib/scroll/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var ye = (d, n, e) => n.has(d) || Te("Cannot " + e);
|
|
|
16
16
|
var t = (d, n, e) => (ye(d, n, "read from private field"), e ? e.call(d) : n.get(d)), s = (d, n, e) => n.has(d) ? Te("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(d) : n.set(d, e), h = (d, n, e, i) => (ye(d, n, "write to private field"), i ? i.call(d, e) : n.set(d, e), e), c = (d, n, e) => (ye(d, n, "access private method"), e);
|
|
17
17
|
import { S as Ge } from "../Store-swP_0ymB.js";
|
|
18
18
|
import { i as H } from "../index-euf5anj6.js";
|
|
19
|
-
import {
|
|
19
|
+
import { q as Ke } from "../easings-BEmRlrDd.js";
|
|
20
20
|
import { d as ee } from "../events-CsVF98U6.js";
|
|
21
21
|
import { d as Re } from "../function-C10DGppn.js";
|
|
22
22
|
import { c as Oe } from "../jss-DtnXPEnq.js";
|
|
@@ -26,7 +26,7 @@ import { p as _e, l as Ze } from "../number-DwCxt_Ck.js";
|
|
|
26
26
|
import "../ticker/index.js";
|
|
27
27
|
import { TICK_ORDER as je, RESIZE_ORDER as we } from "../order/index.js";
|
|
28
28
|
import { D as Je } from "../Damped-GyAS-U-z.js";
|
|
29
|
-
import { T as Qe } from "../Tweened-
|
|
29
|
+
import { T as Qe } from "../Tweened-BWPx3jJR.js";
|
|
30
30
|
import { WheelControls as Xe, KeyboardControls as Ye, DragControls as ts, AutoplayControls as es } from "../controls/index.js";
|
|
31
31
|
import { windowResizer as Rt } from "../window-resizer/index.js";
|
|
32
32
|
import { scrollEntries as vt } from "../scroll-entries/index.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { g as r, f as u } from "./dom-CVWzyXPH.js";
|
|
2
|
+
import { a as c } from "./layout-DpZo-I0y.js";
|
|
3
|
+
import "./index-euf5anj6.js";
|
|
4
|
+
function y(e) {
|
|
5
|
+
return new Promise((o) => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
o();
|
|
8
|
+
}, e);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function E(e, {
|
|
12
|
+
behavior: o = "instant",
|
|
13
|
+
offset: i = 0,
|
|
14
|
+
center: m = !1,
|
|
15
|
+
scrollElement: s
|
|
16
|
+
} = {}) {
|
|
17
|
+
var l;
|
|
18
|
+
let n, f = s, a = s;
|
|
19
|
+
if (typeof e == "number")
|
|
20
|
+
n = e;
|
|
21
|
+
else {
|
|
22
|
+
const t = r(e);
|
|
23
|
+
t && (f = t, a = s || u(t), n = c(t));
|
|
24
|
+
}
|
|
25
|
+
if (f && a && typeof n == "number") {
|
|
26
|
+
const t = (typeof i == "number" ? i : ((l = r(i)) == null ? void 0 : l.offsetHeight) || 0) * -1, p = m ? innerHeight / 2 * -1 + f.offsetHeight / 2 : 0;
|
|
27
|
+
a.scroll({
|
|
28
|
+
top: n + t + p,
|
|
29
|
+
behavior: o
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
E as s,
|
|
35
|
+
y as w
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./dom-JBOkFLTh.cjs"),m=require("./layout-Ctc2p3uz.cjs");require("./index-Cqw2NKev.cjs");function g(t){return new Promise(i=>{setTimeout(()=>{i()},t)})}function p(t,{behavior:i="instant",offset:o=0,center:a=!1,scrollElement:l}={}){var u;let n,s=l,f=l;if(typeof t=="number")n=t;else{const e=r.getElement(t);e&&(s=e,f=l||r.findScrollParentElement(e),n=m.getCumulativeOffsetTop(e))}if(s&&f&&typeof n=="number"){const e=(typeof o=="number"?o:((u=r.getElement(o))==null?void 0:u.offsetHeight)||0)*-1,c=a?innerHeight/2*-1+s.offsetHeight/2:0;f.scroll({top:n+e+c,behavior:i})}}exports.scrollToElement=p;exports.wait=g;
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),y=require("../index-Cqw2NKev.cjs"),d=require("../canvas-CU5Xjahf.cjs"),g=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),r=require("../easings-GegIwET5.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),y=require("../index-Cqw2NKev.cjs"),d=require("../canvas-CU5Xjahf.cjs"),g=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),r=require("../easings-GegIwET5.cjs"),w=require("../events-KVanG9sR.cjs"),C=require("../file-DSpfWdd9.cjs"),I=require("../function-MthRj-GJ.cjs"),Q=require("../gestures-C7gbKx11.cjs"),O=require("../jss-CRBgdvJ3.cjs"),m=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),f=require("../number-0243DApo.cjs"),l=require("../object-CCiXnER2.cjs"),T=require("../polyfills-Df4r-ETT.cjs"),S=require("../scroll-DAhSpkhR.cjs"),c=require("../string-DUXXtU8v.cjs"),E=require("../style-At6aDoqG.cjs"),u=require("../url-D1CgmwZ_.cjs");function B(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function D(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let s=0;s<n;s++){const a=(s+e)%n;o[a]=t[s]}return o}function A(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,a)).toFixed(o))} ${s[a]}`}function R(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function N(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function x(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?x(t,o.slice(4,-1)):o}}function M(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(s=>{const a=x(o,s);a&&(e[s]=a)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function j(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function k(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function U(t,e,n,o){let s,a=!1,b=0;const v=()=>{clearInterval(s),o!=null&&o.restartCounter&&(b=0),a&&(s=setInterval(()=>{n(b++)},e))},P=y.intersector.subscribe(t,q=>{a=q.isIntersecting,v()});return()=>{P(),clearInterval(s)}}exports.parseAttribute=h.parseAttribute;exports.parseAttributeValue=h.parseAttributeValue;exports.isBrowser=y.isBrowser;exports.contain=d.contain;exports.cover=d.cover;exports.fixPosition=d.fixPosition;exports.measureText=d.measureText;exports.getPointerPosition=g.getPointerPosition;exports.normalize=g.normalize;exports.screenToCartesian=g.screenToCartesian;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getAllParentElements=p.getAllParentElements;exports.getElement=p.getElement;exports.easeInCubic=r.easeInCubic;exports.easeInExpo=r.easeInExpo;exports.easeInOutCubic=r.easeInOutCubic;exports.easeInOutExpo=r.easeInOutExpo;exports.easeInOutQuad=r.easeInOutQuad;exports.easeInOutQuart=r.easeInOutQuart;exports.easeInOutQuint=r.easeInOutQuint;exports.easeInQuad=r.easeInQuad;exports.easeInQuart=r.easeInQuart;exports.easeInQuint=r.easeInQuint;exports.easeOutCubic=r.easeOutCubic;exports.easeOutExpo=r.easeOutExpo;exports.easeOutQuad=r.easeOutQuad;exports.easeOutQuart=r.easeOutQuart;exports.easeOutQuint=r.easeOutQuint;exports.linear=r.linear;exports.dispatchEvent=w.dispatchEvent;exports.createJSONAndSave=C.createJSONAndSave;exports.downloadURI=C.downloadURI;exports.debounce=I.debounce;exports.throttle=I.throttle;exports.setupDrag=Q.setupDrag;exports.createStylesheet=O.createStylesheet;exports.styleToString=O.styleToString;exports.getCumulativeOffsetLeft=m.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=m.getCumulativeOffsetTop;exports.getCumulativePosition=m.getCumulativePosition;exports.getStickyOffset=m.getStickyOffset;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.loopNumber=f.loopNumber;exports.preciseNumber=f.preciseNumber;exports.roundNumberTo=f.roundNumberTo;exports.toStep=f.toStep;exports.cloneDeep=l.cloneDeep;exports.compareObjects=l.compareObjects;exports.isESClass=l.isESClass;exports.isNullish=l.isNullish;exports.isObject=l.isObject;exports.mergeDeep=l.mergeDeep;exports.mixin=l.mixin;exports.omit=l.omit;exports.pick=l.pick;exports.nullishCoalescing=T.nullishCoalescing;exports.requestIdleCallback=T.requestIdleCallback;exports.scrollToElement=S.scrollToElement;exports.wait=S.wait;exports.camelToKebab=c.camelToKebab;exports.capitalize=c.capitalize;exports.declension=c.declension;exports.decodeHtmlEntities=c.decodeHtmlEntities;exports.generateId=c.generateId;exports.isUppercase=c.isUppercase;exports.kebabToCamel=c.kebabToCamel;exports.snakeToDotted=c.snakeToDotted;exports.toPascalCase=c.toPascalCase;exports.uncapitalize=c.uncapitalize;exports.getElementTransitionDurationMS=E.getElementTransitionDurationMS;exports.getElementTransitionDurationS=E.getElementTransitionDurationS;exports.changeHistory=u.changeHistory;exports.normalizeBase=u.normalizeBase;exports.parseSearchParameters=u.parseSearchParameters;exports.splitPath=u.splitPath;exports.updateSearchParameter=u.updateSearchParameter;exports.cloneTemplateContent=V;exports.copyTextToClipboard=R;exports.decode=k;exports.dotCircleCollision=z;exports.dotRectCollision=N;exports.encode=j;exports.formatBytes=A;exports.getRootVariables=M;exports.insert=B;exports.setIntervalOnIntersection=U;exports.shiftArray=D;
|
package/lib/utils/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as w, p as O } from "../attributes-69we3byR.js";
|
|
2
2
|
import { a as f } from "../index-euf5anj6.js";
|
|
3
|
-
import { i as
|
|
4
|
-
import { a as
|
|
5
|
-
import { g as
|
|
6
|
-
import { b as
|
|
7
|
-
import {
|
|
8
|
-
import { d as
|
|
9
|
-
import { c as
|
|
10
|
-
import { d as
|
|
11
|
-
import { s as
|
|
12
|
-
import { c as
|
|
13
|
-
import { g as
|
|
14
|
-
import { e as
|
|
15
|
-
import { l as
|
|
16
|
-
import { c as
|
|
17
|
-
import { n as
|
|
18
|
-
import { s as
|
|
3
|
+
import { i as B } from "../index-euf5anj6.js";
|
|
4
|
+
import { a as Q, c as R, f as D, m as M } from "../canvas-DeZ0SLUJ.js";
|
|
5
|
+
import { g as z, n as F, s as V } from "../coordinates-CgdGoSYs.js";
|
|
6
|
+
import { b as k, f as U, a as q, g as $ } from "../dom-CVWzyXPH.js";
|
|
7
|
+
import { d as K, o as W, g as G, q as J, c as L, j as Y, n as Z, a as X, h as _, k as ee, f as te, p as ae, b as se, i as oe, m as re, l as ne } from "../easings-BEmRlrDd.js";
|
|
8
|
+
import { d as ce } from "../events-CsVF98U6.js";
|
|
9
|
+
import { c as ue, d as fe } from "../file-GHShUlue.js";
|
|
10
|
+
import { d as de, t as me } from "../function-C10DGppn.js";
|
|
11
|
+
import { s as ge } from "../gestures-CcXV6fCp.js";
|
|
12
|
+
import { c as he, s as ye } from "../jss-DtnXPEnq.js";
|
|
13
|
+
import { g as Ie, a as ve, b as Ee, c as Se } from "../layout-DpZo-I0y.js";
|
|
14
|
+
import { e as we, f as Oe, c as Pe, d as Be, l as Ae, m as Qe, r as Re, b as De, a as Me, s as Ne } from "../math-BOBiC4TN.js";
|
|
15
|
+
import { l as Fe, p as Ve, r as je, t as ke } from "../number-DwCxt_Ck.js";
|
|
16
|
+
import { c as qe, d as $e, i as He, b as Ke, a as We, m as Ge, e as Je, o as Le, p as Ye } from "../object-D6MVWB4l.js";
|
|
17
|
+
import { n as Xe, r as _e } from "../polyfills-DJrTJQky.js";
|
|
18
|
+
import { s as tt, w as at } from "../scroll-Benkuq-t.js";
|
|
19
19
|
import { c as ot, a as rt, b as nt, d as it, g as ct, i as lt, k as ut, s as ft, t as pt, u as dt } from "../string-BlMQbe8b.js";
|
|
20
20
|
import { g as xt, a as gt } from "../style-j2TwriJ_.js";
|
|
21
21
|
import { c as ht, n as yt, p as Ct, s as It, u as vt } from "../url-B6BNcw6_.js";
|
|
22
|
-
function d(t, e, ...
|
|
23
|
-
return [...t.slice(0, e), ...
|
|
22
|
+
function d(t, e, ...a) {
|
|
23
|
+
return [...t.slice(0, e), ...a, ...t.slice(e)];
|
|
24
24
|
}
|
|
25
25
|
function m(t, e) {
|
|
26
|
-
const
|
|
27
|
-
e = e %
|
|
28
|
-
const
|
|
29
|
-
for (let o = 0; o <
|
|
30
|
-
const r = (o + e) %
|
|
31
|
-
|
|
26
|
+
const a = t.length;
|
|
27
|
+
e = e % a;
|
|
28
|
+
const s = new Array(a);
|
|
29
|
+
for (let o = 0; o < a; o++) {
|
|
30
|
+
const r = (o + e) % a;
|
|
31
|
+
s[r] = t[o];
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return s;
|
|
34
34
|
}
|
|
35
35
|
function x(t, e = 2) {
|
|
36
36
|
if (!+t) return "0 Bytes";
|
|
37
|
-
const
|
|
37
|
+
const a = 1024, s = e < 0 ? 0 : e, o = [
|
|
38
38
|
"Bytes",
|
|
39
39
|
"KiB",
|
|
40
40
|
"MiB",
|
|
@@ -44,8 +44,8 @@ function x(t, e = 2) {
|
|
|
44
44
|
"EiB",
|
|
45
45
|
"ZiB",
|
|
46
46
|
"YiB"
|
|
47
|
-
], r = Math.floor(Math.log(t) / Math.log(
|
|
48
|
-
return `${parseFloat((t / Math.pow(
|
|
47
|
+
], r = Math.floor(Math.log(t) / Math.log(a));
|
|
48
|
+
return `${parseFloat((t / Math.pow(a, r)).toFixed(s))} ${o[r]}`;
|
|
49
49
|
}
|
|
50
50
|
function g(t) {
|
|
51
51
|
if (navigator.clipboard)
|
|
@@ -59,8 +59,8 @@ function g(t) {
|
|
|
59
59
|
e.value = t, e.style.position = "fixed", e.style.top = "0", e.style.left = "0", document.body.appendChild(e), e.select();
|
|
60
60
|
try {
|
|
61
61
|
document.execCommand("copy") ? console.log("Text copied to clipboard successfully!") : console.error("Failed to copy text to clipboard.");
|
|
62
|
-
} catch (
|
|
63
|
-
console.error("Failed to copy text to clipboard:",
|
|
62
|
+
} catch (a) {
|
|
63
|
+
console.error("Failed to copy text to clipboard:", a);
|
|
64
64
|
}
|
|
65
65
|
document.body.removeChild(e);
|
|
66
66
|
}
|
|
@@ -72,23 +72,23 @@ function h(t, e) {
|
|
|
72
72
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
|
|
73
73
|
}
|
|
74
74
|
function i(t, e) {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
return
|
|
75
|
+
const a = t.style.getPropertyValue(e);
|
|
76
|
+
if (a) {
|
|
77
|
+
const s = a.toString();
|
|
78
|
+
return s.startsWith("var") ? i(t, s.slice(4, -1)) : s;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
function y(...t) {
|
|
82
82
|
const e = {};
|
|
83
|
-
return Array.from(document.styleSheets).forEach((
|
|
84
|
-
Array.from(
|
|
85
|
-
|
|
86
|
-
const r = i(
|
|
83
|
+
return Array.from(document.styleSheets).forEach((a) => {
|
|
84
|
+
Array.from(a.cssRules).forEach((s) => {
|
|
85
|
+
s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((o) => {
|
|
86
|
+
const r = i(s, o);
|
|
87
87
|
r && (e[o] = r);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
}), t.forEach((
|
|
91
|
-
e[
|
|
90
|
+
}), t.forEach((a) => {
|
|
91
|
+
e[a] || console.warn(`variable named ${a} not found`);
|
|
92
92
|
}), e;
|
|
93
93
|
}
|
|
94
94
|
function C(t) {
|
|
@@ -99,25 +99,18 @@ function I(t) {
|
|
|
99
99
|
const e = window.unescape(encodeURIComponent(t));
|
|
100
100
|
return window.btoa(e);
|
|
101
101
|
}
|
|
102
|
-
function v(t) {
|
|
103
|
-
return new Promise((e) => {
|
|
104
|
-
setTimeout(() => {
|
|
105
|
-
e();
|
|
106
|
-
}, t);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function T(t, e) {
|
|
102
|
+
function v(t, e) {
|
|
110
103
|
if (t) {
|
|
111
|
-
const
|
|
112
|
-
return
|
|
104
|
+
const s = t.content.cloneNode(!0).firstElementChild;
|
|
105
|
+
return s && (e == null || e(s)), s;
|
|
113
106
|
}
|
|
114
107
|
return null;
|
|
115
108
|
}
|
|
116
|
-
function E(t, e,
|
|
109
|
+
function E(t, e, a, s) {
|
|
117
110
|
let o, r = !1, n = 0;
|
|
118
111
|
const c = () => {
|
|
119
|
-
clearInterval(o),
|
|
120
|
-
|
|
112
|
+
clearInterval(o), s != null && s.restartCounter && (n = 0), r && (o = setInterval(() => {
|
|
113
|
+
a(n++);
|
|
121
114
|
}, e));
|
|
122
115
|
}, l = f.subscribe(t, (u) => {
|
|
123
116
|
r = u.isIntersecting, c();
|
|
@@ -127,101 +120,101 @@ function E(t, e, s, a) {
|
|
|
127
120
|
};
|
|
128
121
|
}
|
|
129
122
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
123
|
+
we as calculateDistance,
|
|
124
|
+
Oe as calculateDistanceWithRadius,
|
|
132
125
|
ot as camelToKebab,
|
|
133
126
|
rt as capitalize,
|
|
134
127
|
ht as changeHistory,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
Pe as clamp,
|
|
129
|
+
qe as cloneDeep,
|
|
130
|
+
v as cloneTemplateContent,
|
|
131
|
+
$e as compareObjects,
|
|
132
|
+
Q as contain,
|
|
140
133
|
g as copyTextToClipboard,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
134
|
+
R as cover,
|
|
135
|
+
ue as createJSONAndSave,
|
|
136
|
+
he as createStylesheet,
|
|
137
|
+
Be as damp,
|
|
138
|
+
de as debounce,
|
|
146
139
|
nt as declension,
|
|
147
140
|
I as decode,
|
|
148
141
|
it as decodeHtmlEntities,
|
|
149
|
-
|
|
142
|
+
ce as dispatchEvent,
|
|
150
143
|
h as dotCircleCollision,
|
|
151
144
|
b as dotRectCollision,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
145
|
+
fe as downloadURI,
|
|
146
|
+
K as easeInCubic,
|
|
147
|
+
W as easeInExpo,
|
|
148
|
+
G as easeInOutCubic,
|
|
149
|
+
J as easeInOutExpo,
|
|
150
|
+
L as easeInOutQuad,
|
|
151
|
+
Y as easeInOutQuart,
|
|
152
|
+
Z as easeInOutQuint,
|
|
153
|
+
X as easeInQuad,
|
|
154
|
+
_ as easeInQuart,
|
|
155
|
+
ee as easeInQuint,
|
|
156
|
+
te as easeOutCubic,
|
|
164
157
|
ae as easeOutExpo,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
158
|
+
se as easeOutQuad,
|
|
159
|
+
oe as easeOutQuart,
|
|
160
|
+
re as easeOutQuint,
|
|
168
161
|
C as encode,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
162
|
+
k as findParentElement,
|
|
163
|
+
U as findScrollParentElement,
|
|
164
|
+
D as fixPosition,
|
|
172
165
|
x as formatBytes,
|
|
173
166
|
ct as generateId,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
q as getAllParentElements,
|
|
168
|
+
Ie as getCumulativeOffsetLeft,
|
|
169
|
+
ve as getCumulativeOffsetTop,
|
|
177
170
|
Ee as getCumulativePosition,
|
|
178
|
-
|
|
171
|
+
$ as getElement,
|
|
179
172
|
xt as getElementTransitionDurationMS,
|
|
180
173
|
gt as getElementTransitionDurationS,
|
|
181
|
-
|
|
174
|
+
z as getPointerPosition,
|
|
182
175
|
y as getRootVariables,
|
|
183
176
|
Se as getStickyOffset,
|
|
184
177
|
d as insert,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
178
|
+
B as isBrowser,
|
|
179
|
+
He as isESClass,
|
|
180
|
+
Ke as isNullish,
|
|
181
|
+
We as isObject,
|
|
189
182
|
lt as isUppercase,
|
|
190
183
|
ut as kebabToCamel,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
184
|
+
Ae as lerp,
|
|
185
|
+
ne as linear,
|
|
186
|
+
Fe as loopNumber,
|
|
187
|
+
Qe as mapRange,
|
|
188
|
+
M as measureText,
|
|
189
|
+
Ge as mergeDeep,
|
|
190
|
+
Je as mixin,
|
|
191
|
+
F as normalize,
|
|
199
192
|
yt as normalizeBase,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
193
|
+
Xe as nullishCoalescing,
|
|
194
|
+
Le as omit,
|
|
195
|
+
w as parseAttribute,
|
|
196
|
+
O as parseAttributeValue,
|
|
204
197
|
Ct as parseSearchParameters,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
198
|
+
Ye as pick,
|
|
199
|
+
Ve as preciseNumber,
|
|
200
|
+
_e as requestIdleCallback,
|
|
201
|
+
Re as round,
|
|
202
|
+
je as roundNumberTo,
|
|
203
|
+
V as screenToCartesian,
|
|
204
|
+
tt as scrollToElement,
|
|
212
205
|
E as setIntervalOnIntersection,
|
|
213
|
-
|
|
206
|
+
ge as setupDrag,
|
|
214
207
|
m as shiftArray,
|
|
215
|
-
|
|
216
|
-
|
|
208
|
+
De as smootherstep,
|
|
209
|
+
Me as smoothstep,
|
|
217
210
|
ft as snakeToDotted,
|
|
218
211
|
It as splitPath,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
Ne as step,
|
|
213
|
+
ye as styleToString,
|
|
214
|
+
me as throttle,
|
|
222
215
|
pt as toPascalCase,
|
|
223
|
-
|
|
216
|
+
ke as toStep,
|
|
224
217
|
dt as uncapitalize,
|
|
225
218
|
vt as updateSearchParameter,
|
|
226
|
-
|
|
219
|
+
at as wait
|
|
227
220
|
};
|
package/package.json
CHANGED
package/lib/scroll-H9zqFeML.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("./dom-JBOkFLTh.cjs"),m=require("./layout-Ctc2p3uz.cjs");require("./index-Cqw2NKev.cjs");function g(n,{behavior:u="instant",offset:o=0,center:c=!1,scrollElement:l}={}){var r;let t,i=l,s=l;if(typeof n=="number")t=n;else{const e=f.getElement(n);e&&(i=e,s=l||f.findScrollParentElement(e),t=m.getCumulativeOffsetTop(e))}if(i&&s&&typeof t=="number"){const e=(typeof o=="number"?o:((r=f.getElement(o))==null?void 0:r.offsetHeight)||0)*-1,a=c?innerHeight/2*-1+i.offsetHeight/2:0;s.scroll({top:t+e+a,behavior:u})}}exports.scrollToElement=g;
|
package/lib/scroll-myLAt-Tq.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { g as l, f as c } from "./dom-CVWzyXPH.js";
|
|
2
|
-
import { a as g } from "./layout-DpZo-I0y.js";
|
|
3
|
-
import "./index-euf5anj6.js";
|
|
4
|
-
function E(n, {
|
|
5
|
-
behavior: m = "instant",
|
|
6
|
-
offset: o = 0,
|
|
7
|
-
center: p = !1,
|
|
8
|
-
scrollElement: f
|
|
9
|
-
} = {}) {
|
|
10
|
-
var a;
|
|
11
|
-
let e, i = f, s = f;
|
|
12
|
-
if (typeof n == "number")
|
|
13
|
-
e = n;
|
|
14
|
-
else {
|
|
15
|
-
const t = l(n);
|
|
16
|
-
t && (i = t, s = f || c(t), e = g(t));
|
|
17
|
-
}
|
|
18
|
-
if (i && s && typeof e == "number") {
|
|
19
|
-
const t = (typeof o == "number" ? o : ((a = l(o)) == null ? void 0 : a.offsetHeight) || 0) * -1, r = p ? innerHeight / 2 * -1 + i.offsetHeight / 2 : 0;
|
|
20
|
-
s.scroll({
|
|
21
|
-
top: e + t + r,
|
|
22
|
-
behavior: m
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
E as s
|
|
28
|
-
};
|