aptechka 0.42.9 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/morph/Morph.d.ts +3 -2
- package/lib/morph/MorphAnnouncer.d.ts +9 -0
- package/lib/morph/{Link.d.ts → MorphLink.d.ts} +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +198 -170
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +1 -1
- package/lib/url-CHQeS8b5.cjs +1 -0
- package/lib/url-DqQuzXwT.js +37 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/url.d.ts +1 -1
- package/package.json +1 -1
- package/lib/url-B5eH5z6S.js +0 -37
- package/lib/url-BiHPIsKq.cjs +0 -1
package/lib/morph/Morph.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ChangeHistoryAction } from '../utils';
|
|
2
|
-
import {
|
|
2
|
+
import { MorphLink } from './MorphLink';
|
|
3
3
|
export interface MorphParameters {
|
|
4
4
|
base?: string;
|
|
5
5
|
waitForHeadToLoad?: boolean;
|
|
6
6
|
cachePages?: boolean;
|
|
7
|
+
trailingSlash?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface MorphNavigationEntry {
|
|
9
10
|
pathname: string;
|
|
@@ -41,7 +42,7 @@ export declare class Morph {
|
|
|
41
42
|
get currentPathname(): string;
|
|
42
43
|
get previousPathname(): string | undefined;
|
|
43
44
|
get currentState(): any;
|
|
44
|
-
get links():
|
|
45
|
+
get links(): MorphLink[];
|
|
45
46
|
normalizePath(path: string): {
|
|
46
47
|
leaf: string;
|
|
47
48
|
pathname: string;
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var lt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),dt=r=>{throw TypeError(r)};var $=(r,t,s)=>t.has(r)||dt("Cannot "+s);var e=(r,t,s)=>($(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?dt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),c=(r,t,s,n)=>($(r,t,"write to private field"),n?n.call(r,s):t.set(r,s),s),y=(r,t,s)=>($(r,t,"access private method"),s);var O=(r,t,s)=>new Promise((n,l)=>{var d=m=>{try{L(s.next(m))}catch(P){l(P)}},o=m=>{try{L(s.throw(m))}catch(P){l(P)}},L=m=>m.done?n(m.value):Promise.resolve(m.value).then(d,o);L((s=s.apply(r,t)).next())});var ut=(r,t,s)=>(t=r[lt("asyncIterator")])?t.call(r):(r=r[lt("iterator")](),t={},s=(n,l)=>(l=r[n])&&(t[n]=d=>new Promise((o,L,m)=>(d=l.call(r,d),m=d.done,Promise.resolve(d.value).then(P=>o({value:P,done:m}),L)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("../browser-CpzFX2xg.cjs"),J=require("../events-KVanG9sR.cjs"),Q=require("../url-CHQeS8b5.cjs"),mt=require("../loading/index.cjs");class pt extends HTMLElement{constructor(){super()}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,n]of Object.entries(t))this.setAttribute(s,n)}}customElements.get("morph-announcer")||customElements.define("morph-announcer",pt);var T,h,g,R,D,k,_,H;class ft{constructor(t,s){a(this,T);a(this,h);a(this,g);a(this,R);a(this,D);a(this,k);a(this,_,t=>{t.preventDefault(),e(this,T).links.forEach(s=>{var n;e(this,g)===e(s,g)||(n=e(s,k))!=null&&n.includes(e(this,g))?e(s,h).classList.add("clicked"):e(s,h).classList.remove("clicked")}),e(this,T).navigate(e(this,g),{historyAction:e(this,R),state:e(this,D)})});a(this,H,()=>{e(this,T).prefetch(e(this,g)),e(this,h).removeEventListener("pointerenter",e(this,H))});var d,o;c(this,T,s),c(this,h,t),c(this,g,e(this,h).getAttribute("href")||"/"),c(this,R,e(this,h).getAttribute("data-history-action")||"push"),c(this,D,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,_));const n=s.normalizePath(e(this,g)),l=s.normalizePath(location.pathname);c(this,k,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(L=>s.normalizePath(L.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,h).classList.add("current"):n.pathname===l.pathname||(o=e(this,k))!=null&&o.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,H))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,_)),e(this,h).removeEventListener("pointerenter",e(this,H)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,g=new WeakMap,R=new WeakMap,D=new WeakMap,k=new WeakMap,_=new WeakMap,H=new WeakMap;var B,F,I,j,C,v,U,M,b,E,W,Y,S,A,u,tt,et,gt,st,X;class yt{constructor(t){a(this,u);a(this,B,null);a(this,F,null);a(this,I,null);a(this,j,!1);a(this,C,null);a(this,v,[]);a(this,U,new DOMParser);a(this,M,new Map);a(this,b);a(this,E,null);a(this,W);a(this,Y);a(this,S,[]);a(this,A,null);a(this,X,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(wt.isBrowser){c(this,B,Q.normalizeBase(t==null?void 0:t.base)),c(this,F,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,I,(t==null?void 0:t.cachePages)!==!1),c(this,j,(t==null?void 0:t.trailingSlash)||!1),c(this,C,y(this,u,et).call(this,document.body));const s=this.normalizePath(location.pathname);c(this,E,s.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,E)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,X)),Q.changeHistory("replace",e(this,E),s.parameters,s.hash),e(this,C).map(n=>[...n.children]).flat().forEach(n=>{n instanceof HTMLElement&&n.classList.add("current")}),c(this,A,new pt)}}get currentPathname(){return e(this,E)}get previousPathname(){return e(this,W)}get currentState(){return e(this,Y)}get links(){return e(this,v)}normalizePath(t){return Q.splitPath(t,e(this,B),e(this,j))}prefetch(t){return O(this,null,function*(){const s=this.normalizePath(t);return y(this,u,tt).call(this,s.pathname)})}navigate(l){return O(this,arguments,function*(t,{historyAction:s="push",state:n}={}){var it;if(e(this,S).length)return;const d=this.normalizePath(t);let{pathname:o,hash:L,parameters:m,leaf:P}=d;if(e(this,b)===o||e(this,E)===o)return;c(this,Y,n),c(this,b,o);const N=e(this,M).has(o);try{mt.loading.add("__morph");let K=!0;if(J.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:o,isCached:N,state:n}}),this.preprocessor)try{yield new Promise((i,f)=>{var w;(w=this.preprocessor)==null||w.call(this,{pathname:o,resolve:i,reject:f,isCached:N,state:n})})}catch(i){i?console.error(i):console.log("Route change canceled"),K=!1}if(!K||e(this,b)!==o)return;const x=e(this,M).get(o)||(yield y(this,u,tt).call(this,o));if(e(this,b)!==o)return;if(x.title)e(this,A).textContent=x.title;else{const i=x.querySelector("h1"),f=(i==null?void 0:i.innerText)||(i==null?void 0:i.textContent)||o;e(this,A).textContent=f}document.body.appendChild(e(this,A));const nt=Array.from(document.head.children),rt=Array.from(x.head.cloneNode(!0).children),at=y(this,u,gt).call(this,nt,rt),Et=y(this,u,st).call(this,nt,at),V=y(this,u,st).call(this,rt,at);V.forEach((i,f)=>{if(i.tagName==="SCRIPT"&&i.getAttribute("src")){const w=document.createElement("script");w.type="module",w.src=i.getAttribute("src"),V[f]=w}}),V.forEach(i=>{document.head.appendChild(i)});const Z=V.filter(i=>!i.hasAttribute("data-no-waiting")&&(i.tagName==="STYLE"||i.tagName==="SCRIPT"||i.tagName==="LINK")&&i.getAttribute("rel")!=="canonical");e(this,F)&&Z.length&&(yield new Promise(i=>O(this,null,function*(){let f=0;try{for(var w=ut(Z),ht,z,ct;ht=!(z=yield w.next()).done;ht=!1){const G=z.value;G.onload=()=>{f++,f===Z.length&&i()}}}catch(z){ct=[z]}finally{try{ht&&(z=w.return)&&(yield z.call(w))}finally{if(ct)throw ct[0]}}})));const ot=[];Et.forEach(i=>{i.hasAttribute("data-permanent")||(i.tagName==="SCRIPT"||i.tagName==="STYLE"||i.getAttribute("rel")==="stylesheet"?ot.push(i):i.remove())}),c(this,W,e(this,E)),c(this,E,o),Q.changeHistory(s,o,m,L);const Lt=y(this,u,et).call(this,x.body.cloneNode(!0));e(this,C).forEach((i,f)=>{const w=Lt[f++],ht=getComputedStyle(i).getPropertyValue("--morph-duration"),z=[...w.childNodes];if(ht){const ct=[...i.childNodes];ct.forEach(p=>{p instanceof HTMLElement&&p.classList.add("old")}),z.forEach(p=>{p instanceof HTMLElement&&p.classList.add("new")}),i.append(...z),setTimeout(()=>{z.forEach(p=>{p instanceof HTMLElement&&p.classList.add("in")})},10);const G={element:i,pathname:o,isCached:N,state:n};J.dispatchEvent(document,"morphBeforeElementOut",{detail:G});const vt=new Promise(p=>{setTimeout(()=>{ct.forEach(q=>q.remove()),z.forEach(q=>{q instanceof HTMLElement&&(q.classList.remove("new","in"),q.classList.add("current"))}),J.dispatchEvent(document,"morphAfterElementOut",{detail:G}),p()},(parseFloat(ht)||0)*1e3+10)});e(this,S).push(vt)}else i.innerHTML="",i.append(...z)}),yield Promise.all(e(this,S)),ot.forEach(i=>i.remove()),c(this,S,[]),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",P),e(this,A).remove(),(it=this.postprocessor)==null||it.call(this,{pathname:o,isCached:N,state:n}),J.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:o,isCached:N,state:n}}),mt.loading.complete("__morph")}catch(K){console.error(K)}c(this,b,void 0)})}addLink(t){e(this,v).push(new ft(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){c(this,v,e(this,v).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return((n=s.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});e(this,v).forEach(s=>s.destroy()),c(this,v,t.map(s=>new ft(s,this)))}}B=new WeakMap,F=new WeakMap,I=new WeakMap,j=new WeakMap,C=new WeakMap,v=new WeakMap,U=new WeakMap,M=new WeakMap,b=new WeakMap,E=new WeakMap,W=new WeakMap,Y=new WeakMap,S=new WeakMap,A=new WeakMap,u=new WeakSet,tt=function(t){return O(this,null,function*(){const s=e(this,M).get(t);if(s)return s;const l=yield(yield fetch(t)).text(),d=e(this,U).parseFromString(l,"text/html");return e(this,I)&&e(this,M).set(t,d),d})},et=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},gt=function(t,s){return t.filter(n=>s.find(l=>l.outerHTML===n.outerHTML))},st=function(t,s){return t.filter(n=>!s.find(l=>l.outerHTML===n.outerHTML))},X=new WeakMap;exports.Morph=yt;
|
package/lib/morph/index.js
CHANGED
|
@@ -1,86 +1,103 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var ct = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), lt = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var Z = (r, t, s) => t.has(r) || lt("Cannot " + s);
|
|
5
|
+
var e = (r, t, s) => (Z(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (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), c = (r, t, s, n) => (Z(r, t, "write to private field"), n ? n.call(r, s) : t.set(r, s), s), A = (r, t, s) => (Z(r, t, "access private method"), s);
|
|
6
|
+
var D = (r, t, s) => new Promise((n, l) => {
|
|
7
|
+
var d = (m) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch (
|
|
11
|
-
l(
|
|
9
|
+
E(s.next(m));
|
|
10
|
+
} catch (P) {
|
|
11
|
+
l(P);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, o = (m) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
l(
|
|
15
|
+
E(s.throw(m));
|
|
16
|
+
} catch (P) {
|
|
17
|
+
l(P);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, E = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(d, o);
|
|
20
|
+
E((s = s.apply(r, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
import { i as
|
|
24
|
-
import { d as
|
|
25
|
-
import { n as
|
|
26
|
-
import { loading as
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
var dt = (r, t, s) => (t = r[ct("asyncIterator")]) ? t.call(r) : (r = r[ct("iterator")](), t = {}, s = (n, l) => (l = r[n]) && (t[n] = (d) => new Promise((o, E, m) => (d = l.call(r, d), m = d.done, Promise.resolve(d.value).then((P) => o({ value: P, done: m }), E)))), s("next"), s("return"), t);
|
|
23
|
+
import { i as wt } from "../browser-0zX67oeU.js";
|
|
24
|
+
import { d as J } from "../events-CsVF98U6.js";
|
|
25
|
+
import { n as At, c as ut, s as yt } from "../url-DqQuzXwT.js";
|
|
26
|
+
import { loading as mt } from "../loading/index.js";
|
|
27
|
+
class pt extends HTMLElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
const t = {
|
|
33
|
+
"aria-live": "assertive",
|
|
34
|
+
"aria-atomic": "true",
|
|
35
|
+
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"
|
|
36
|
+
};
|
|
37
|
+
for (const [s, n] of Object.entries(t))
|
|
38
|
+
this.setAttribute(s, n);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
customElements.get("morph-announcer") || customElements.define("morph-announcer", pt);
|
|
42
|
+
var T, h, g, O, B, C, F, H;
|
|
43
|
+
class ft {
|
|
29
44
|
constructor(t, s) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
a(this, T);
|
|
46
|
+
a(this, h);
|
|
47
|
+
a(this, g);
|
|
48
|
+
a(this, O);
|
|
49
|
+
a(this, B);
|
|
50
|
+
a(this, C);
|
|
51
|
+
a(this, F, (t) => {
|
|
37
52
|
t.preventDefault(), e(this, T).links.forEach((s) => {
|
|
38
|
-
var
|
|
39
|
-
e(this,
|
|
40
|
-
}), e(this, T).navigate(e(this,
|
|
41
|
-
historyAction: e(this,
|
|
42
|
-
state: e(this,
|
|
53
|
+
var n;
|
|
54
|
+
e(this, g) === e(s, g) || (n = e(s, C)) != null && n.includes(e(this, g)) ? e(s, h).classList.add("clicked") : e(s, h).classList.remove("clicked");
|
|
55
|
+
}), e(this, T).navigate(e(this, g), {
|
|
56
|
+
historyAction: e(this, O),
|
|
57
|
+
state: e(this, B)
|
|
43
58
|
});
|
|
44
59
|
});
|
|
45
|
-
|
|
46
|
-
e(this, T).prefetch(e(this,
|
|
60
|
+
a(this, H, () => {
|
|
61
|
+
e(this, T).prefetch(e(this, g)), e(this, h).removeEventListener("pointerenter", e(this, H));
|
|
47
62
|
});
|
|
48
|
-
var
|
|
49
|
-
c(this, T, s), c(this, h, t), c(this,
|
|
63
|
+
var d, o;
|
|
64
|
+
c(this, T, s), c(this, h, t), c(this, g, e(this, h).getAttribute("href") || "/"), c(this, O, e(this, h).getAttribute(
|
|
50
65
|
"data-history-action"
|
|
51
|
-
) || "push"), c(this,
|
|
52
|
-
const
|
|
53
|
-
c(this,
|
|
66
|
+
) || "push"), c(this, B, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, F));
|
|
67
|
+
const n = s.normalizePath(e(this, g)), l = s.normalizePath(location.pathname);
|
|
68
|
+
c(this, C, (d = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : d.split(",").map((E) => s.normalizePath(E.trim()).pathname)), e(this, h).hasAttribute("data-include") ? l.pathname.includes(n.pathname) && e(this, h).classList.add("current") : n.pathname === l.pathname || (o = e(this, C)) != null && o.includes(l.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, H));
|
|
54
69
|
}
|
|
55
70
|
get element() {
|
|
56
71
|
return e(this, h);
|
|
57
72
|
}
|
|
58
73
|
destroy() {
|
|
59
|
-
e(this, h).removeEventListener("click", e(this,
|
|
74
|
+
e(this, h).removeEventListener("click", e(this, F)), e(this, h).removeEventListener("pointerenter", e(this, H)), e(this, h).classList.remove("current");
|
|
60
75
|
}
|
|
61
76
|
}
|
|
62
|
-
T = new WeakMap(), h = new WeakMap(),
|
|
63
|
-
var
|
|
64
|
-
class
|
|
77
|
+
T = new WeakMap(), h = new WeakMap(), g = new WeakMap(), O = new WeakMap(), B = new WeakMap(), C = new WeakMap(), F = new WeakMap(), H = new WeakMap();
|
|
78
|
+
var I, _, q, W, S, v, Q, M, y, L, Y, j, k, b, u, $, tt, gt, et, U;
|
|
79
|
+
class Ct {
|
|
65
80
|
constructor(t) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
a(this, u);
|
|
82
|
+
a(this, I, null);
|
|
83
|
+
a(this, _, null);
|
|
84
|
+
a(this, q, null);
|
|
85
|
+
a(this, W, !1);
|
|
86
|
+
a(this, S, null);
|
|
87
|
+
a(this, v, []);
|
|
88
|
+
a(this, Q, new DOMParser());
|
|
89
|
+
a(this, M, /* @__PURE__ */ new Map());
|
|
90
|
+
a(this, y);
|
|
91
|
+
a(this, L, null);
|
|
92
|
+
a(this, Y);
|
|
93
|
+
a(this, j);
|
|
94
|
+
a(this, k, []);
|
|
95
|
+
a(this, b, null);
|
|
96
|
+
a(this, U, (t) => {
|
|
80
97
|
t.state && this.navigate(t.state, { historyAction: "none" });
|
|
81
98
|
});
|
|
82
|
-
if (
|
|
83
|
-
c(this,
|
|
99
|
+
if (wt) {
|
|
100
|
+
c(this, I, At(t == null ? void 0 : t.base)), c(this, _, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, q, (t == null ? void 0 : t.cachePages) !== !1), c(this, W, (t == null ? void 0 : t.trailingSlash) || !1), c(this, S, A(this, u, tt).call(this, document.body));
|
|
84
101
|
const s = this.normalizePath(location.pathname);
|
|
85
102
|
c(this, L, s.pathname), document.documentElement.setAttribute(
|
|
86
103
|
"data-current-pathname",
|
|
@@ -88,155 +105,166 @@ class yt {
|
|
|
88
105
|
), document.documentElement.setAttribute(
|
|
89
106
|
"data-current-leaf",
|
|
90
107
|
s.leaf
|
|
91
|
-
), this.findLinks(), addEventListener("popstate", e(this,
|
|
108
|
+
), this.findLinks(), addEventListener("popstate", e(this, U)), ut(
|
|
92
109
|
"replace",
|
|
93
110
|
e(this, L),
|
|
94
111
|
s.parameters,
|
|
95
112
|
s.hash
|
|
96
|
-
), e(this,
|
|
97
|
-
|
|
98
|
-
});
|
|
113
|
+
), e(this, S).map((n) => [...n.children]).flat().forEach((n) => {
|
|
114
|
+
n instanceof HTMLElement && n.classList.add("current");
|
|
115
|
+
}), c(this, b, new pt());
|
|
99
116
|
}
|
|
100
117
|
}
|
|
101
118
|
get currentPathname() {
|
|
102
119
|
return e(this, L);
|
|
103
120
|
}
|
|
104
121
|
get previousPathname() {
|
|
105
|
-
return e(this,
|
|
122
|
+
return e(this, Y);
|
|
106
123
|
}
|
|
107
124
|
get currentState() {
|
|
108
|
-
return e(this,
|
|
125
|
+
return e(this, j);
|
|
109
126
|
}
|
|
110
127
|
get links() {
|
|
111
|
-
return e(this,
|
|
128
|
+
return e(this, v);
|
|
112
129
|
}
|
|
113
130
|
normalizePath(t) {
|
|
114
|
-
return
|
|
131
|
+
return yt(t, e(this, I), e(this, W));
|
|
115
132
|
}
|
|
116
133
|
prefetch(t) {
|
|
117
|
-
return
|
|
134
|
+
return D(this, null, function* () {
|
|
118
135
|
const s = this.normalizePath(t);
|
|
119
|
-
return
|
|
136
|
+
return A(this, u, $).call(this, s.pathname);
|
|
120
137
|
});
|
|
121
138
|
}
|
|
122
139
|
navigate(l) {
|
|
123
|
-
return
|
|
124
|
-
var
|
|
125
|
-
if (e(this,
|
|
140
|
+
return D(this, arguments, function* (t, { historyAction: s = "push", state: n } = {}) {
|
|
141
|
+
var st;
|
|
142
|
+
if (e(this, k).length)
|
|
126
143
|
return;
|
|
127
|
-
const
|
|
128
|
-
let { pathname:
|
|
129
|
-
if (e(this, y) ===
|
|
144
|
+
const d = this.normalizePath(t);
|
|
145
|
+
let { pathname: o, hash: E, parameters: m, leaf: P } = d;
|
|
146
|
+
if (e(this, y) === o || e(this, L) === o)
|
|
130
147
|
return;
|
|
131
|
-
c(this,
|
|
132
|
-
const
|
|
148
|
+
c(this, j, n), c(this, y, o);
|
|
149
|
+
const N = e(this, M).has(o);
|
|
133
150
|
try {
|
|
134
|
-
|
|
135
|
-
let
|
|
136
|
-
if (
|
|
151
|
+
mt.add("__morph");
|
|
152
|
+
let K = !0;
|
|
153
|
+
if (J(document, "morphBeforeNavigation", {
|
|
137
154
|
detail: {
|
|
138
|
-
pathname:
|
|
139
|
-
isCached:
|
|
140
|
-
state:
|
|
155
|
+
pathname: o,
|
|
156
|
+
isCached: N,
|
|
157
|
+
state: n
|
|
141
158
|
}
|
|
142
159
|
}), this.preprocessor)
|
|
143
160
|
try {
|
|
144
|
-
yield new Promise((
|
|
161
|
+
yield new Promise((i, f) => {
|
|
145
162
|
var w;
|
|
146
|
-
(w = this.preprocessor) == null || w.call(this, { pathname:
|
|
163
|
+
(w = this.preprocessor) == null || w.call(this, { pathname: o, resolve: i, reject: f, isCached: N, state: n });
|
|
147
164
|
});
|
|
148
|
-
} catch (
|
|
149
|
-
|
|
165
|
+
} catch (i) {
|
|
166
|
+
i ? console.error(i) : console.log("Route change canceled"), K = !1;
|
|
150
167
|
}
|
|
151
|
-
if (!
|
|
168
|
+
if (!K || e(this, y) !== o)
|
|
152
169
|
return;
|
|
153
|
-
const
|
|
154
|
-
if (e(this, y) !==
|
|
170
|
+
const x = e(this, M).get(o) || (yield A(this, u, $).call(this, o));
|
|
171
|
+
if (e(this, y) !== o)
|
|
155
172
|
return;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
173
|
+
if (x.title)
|
|
174
|
+
e(this, b).textContent = x.title;
|
|
175
|
+
else {
|
|
176
|
+
const i = x.querySelector("h1"), f = (i == null ? void 0 : i.innerText) || (i == null ? void 0 : i.textContent) || o;
|
|
177
|
+
e(this, b).textContent = f;
|
|
178
|
+
}
|
|
179
|
+
document.body.appendChild(e(this, b));
|
|
180
|
+
const it = Array.from(document.head.children), nt = Array.from(
|
|
181
|
+
x.head.cloneNode(!0).children
|
|
182
|
+
), rt = A(this, u, gt).call(this, it, nt), Lt = A(this, u, et).call(this, it, rt), V = A(this, u, et).call(this, nt, rt);
|
|
183
|
+
V.forEach((i, f) => {
|
|
184
|
+
if (i.tagName === "SCRIPT" && i.getAttribute("src")) {
|
|
161
185
|
const w = document.createElement("script");
|
|
162
|
-
w.type = "module", w.src =
|
|
186
|
+
w.type = "module", w.src = i.getAttribute("src"), V[f] = w;
|
|
163
187
|
}
|
|
164
|
-
}),
|
|
165
|
-
document.head.appendChild(
|
|
188
|
+
}), V.forEach((i) => {
|
|
189
|
+
document.head.appendChild(i);
|
|
166
190
|
});
|
|
167
|
-
const
|
|
168
|
-
(
|
|
191
|
+
const X = V.filter(
|
|
192
|
+
(i) => !i.hasAttribute("data-no-waiting") && (i.tagName === "STYLE" || i.tagName === "SCRIPT" || i.tagName === "LINK") && i.getAttribute("rel") !== "canonical"
|
|
169
193
|
);
|
|
170
|
-
e(this,
|
|
171
|
-
let
|
|
194
|
+
e(this, _) && X.length && (yield new Promise((i) => D(this, null, function* () {
|
|
195
|
+
let f = 0;
|
|
172
196
|
try {
|
|
173
|
-
for (var w =
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
197
|
+
for (var w = dt(X), ot, z, ht; ot = !(z = yield w.next()).done; ot = !1) {
|
|
198
|
+
const G = z.value;
|
|
199
|
+
G.onload = () => {
|
|
200
|
+
f++, f === X.length && i();
|
|
177
201
|
};
|
|
178
202
|
}
|
|
179
|
-
} catch (
|
|
180
|
-
|
|
203
|
+
} catch (z) {
|
|
204
|
+
ht = [z];
|
|
181
205
|
} finally {
|
|
182
206
|
try {
|
|
183
|
-
|
|
207
|
+
ot && (z = w.return) && (yield z.call(w));
|
|
184
208
|
} finally {
|
|
185
|
-
if (
|
|
186
|
-
throw
|
|
209
|
+
if (ht)
|
|
210
|
+
throw ht[0];
|
|
187
211
|
}
|
|
188
212
|
}
|
|
189
|
-
})))
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}),
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
})));
|
|
214
|
+
const at = [];
|
|
215
|
+
Lt.forEach((i) => {
|
|
216
|
+
i.hasAttribute("data-permanent") || (i.tagName === "SCRIPT" || i.tagName === "STYLE" || i.getAttribute("rel") === "stylesheet" ? at.push(i) : i.remove());
|
|
217
|
+
}), c(this, Y, e(this, L)), c(this, L, o), ut(s, o, m, E);
|
|
218
|
+
const Et = A(this, u, tt).call(this, x.body.cloneNode(!0));
|
|
219
|
+
e(this, S).forEach((i, f) => {
|
|
220
|
+
const w = Et[f++], ot = getComputedStyle(i).getPropertyValue("--morph-duration"), z = [...w.childNodes];
|
|
221
|
+
if (ot) {
|
|
222
|
+
const ht = [...i.childNodes];
|
|
223
|
+
ht.forEach((p) => {
|
|
224
|
+
p instanceof HTMLElement && p.classList.add("old");
|
|
225
|
+
}), z.forEach((p) => {
|
|
226
|
+
p instanceof HTMLElement && p.classList.add("new");
|
|
227
|
+
}), i.append(...z), setTimeout(() => {
|
|
228
|
+
z.forEach((p) => {
|
|
229
|
+
p instanceof HTMLElement && p.classList.add("in");
|
|
204
230
|
});
|
|
205
231
|
}, 10);
|
|
206
|
-
const
|
|
207
|
-
element:
|
|
208
|
-
pathname:
|
|
209
|
-
isCached:
|
|
210
|
-
state:
|
|
232
|
+
const G = {
|
|
233
|
+
element: i,
|
|
234
|
+
pathname: o,
|
|
235
|
+
isCached: N,
|
|
236
|
+
state: n
|
|
211
237
|
};
|
|
212
|
-
|
|
213
|
-
detail:
|
|
238
|
+
J(document, "morphBeforeElementOut", {
|
|
239
|
+
detail: G
|
|
240
|
+
});
|
|
241
|
+
const vt = new Promise((p) => {
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
ht.forEach((R) => R.remove()), z.forEach((R) => {
|
|
244
|
+
R instanceof HTMLElement && (R.classList.remove("new", "in"), R.classList.add("current"));
|
|
245
|
+
}), J(document, "morphAfterElementOut", {
|
|
246
|
+
detail: G
|
|
247
|
+
}), p();
|
|
248
|
+
}, (parseFloat(ot) || 0) * 1e3 + 10);
|
|
214
249
|
});
|
|
215
|
-
|
|
216
|
-
nt.forEach((d) => d.remove()), S.forEach((d) => {
|
|
217
|
-
d instanceof HTMLElement && (d.classList.remove("new", "in"), d.classList.add("current"));
|
|
218
|
-
}), V(document, "morphAfterElementOut", {
|
|
219
|
-
detail: K
|
|
220
|
-
}), c(this, v, e(this, v).filter((d) => d !== at));
|
|
221
|
-
}, (parseFloat(it) || 0) * 1e3 + 10);
|
|
222
|
-
e(this, v).push(at);
|
|
250
|
+
e(this, k).push(vt);
|
|
223
251
|
} else
|
|
224
|
-
|
|
225
|
-
}), this.findLinks(), document.documentElement.setAttribute("data-current-pathname",
|
|
252
|
+
i.innerHTML = "", i.append(...z);
|
|
253
|
+
}), yield Promise.all(e(this, k)), at.forEach((i) => i.remove()), c(this, k, []), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", P), e(this, b).remove(), (st = this.postprocessor) == null || st.call(this, { pathname: o, isCached: N, state: n }), J(document, "morphAfterNavigation", {
|
|
226
254
|
detail: {
|
|
227
|
-
pathname:
|
|
228
|
-
isCached:
|
|
229
|
-
state:
|
|
255
|
+
pathname: o,
|
|
256
|
+
isCached: N,
|
|
257
|
+
state: n
|
|
230
258
|
}
|
|
231
|
-
}),
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(
|
|
259
|
+
}), mt.complete("__morph");
|
|
260
|
+
} catch (K) {
|
|
261
|
+
console.error(K);
|
|
234
262
|
}
|
|
235
263
|
c(this, y, void 0);
|
|
236
264
|
});
|
|
237
265
|
}
|
|
238
266
|
addLink(t) {
|
|
239
|
-
e(this,
|
|
267
|
+
e(this, v).push(new ft(t, this));
|
|
240
268
|
}
|
|
241
269
|
addLinks(t) {
|
|
242
270
|
t.forEach((s) => {
|
|
@@ -244,44 +272,44 @@ class yt {
|
|
|
244
272
|
});
|
|
245
273
|
}
|
|
246
274
|
removeLink(t) {
|
|
247
|
-
c(this,
|
|
275
|
+
c(this, v, e(this, v).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
248
276
|
}
|
|
249
277
|
findLinks() {
|
|
250
278
|
const t = [
|
|
251
279
|
...document.documentElement.querySelectorAll("a")
|
|
252
280
|
].filter(
|
|
253
281
|
(s) => {
|
|
254
|
-
var
|
|
255
|
-
return ((
|
|
282
|
+
var n;
|
|
283
|
+
return ((n = s.getAttribute("href")) == null ? void 0 : n.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
|
|
256
284
|
}
|
|
257
285
|
);
|
|
258
|
-
e(this,
|
|
286
|
+
e(this, v).forEach((s) => s.destroy()), c(this, v, t.map((s) => new ft(s, this)));
|
|
259
287
|
}
|
|
260
288
|
}
|
|
261
|
-
|
|
262
|
-
return
|
|
263
|
-
const s = e(this,
|
|
289
|
+
I = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), W = new WeakMap(), S = new WeakMap(), v = new WeakMap(), Q = new WeakMap(), M = new WeakMap(), y = new WeakMap(), L = new WeakMap(), Y = new WeakMap(), j = new WeakMap(), k = new WeakMap(), b = new WeakMap(), u = new WeakSet(), $ = function(t) {
|
|
290
|
+
return D(this, null, function* () {
|
|
291
|
+
const s = e(this, M).get(t);
|
|
264
292
|
if (s)
|
|
265
293
|
return s;
|
|
266
|
-
const l = yield (yield fetch(t)).text(),
|
|
267
|
-
return e(this,
|
|
294
|
+
const l = yield (yield fetch(t)).text(), d = e(this, Q).parseFromString(l, "text/html");
|
|
295
|
+
return e(this, q) && e(this, M).set(t, d), d;
|
|
268
296
|
});
|
|
269
|
-
},
|
|
297
|
+
}, tt = function(t) {
|
|
270
298
|
const s = [...t.querySelectorAll("[data-morph]")];
|
|
271
299
|
return s.length ? s : [t];
|
|
272
|
-
},
|
|
300
|
+
}, gt = function(t, s) {
|
|
273
301
|
return t.filter(
|
|
274
|
-
(
|
|
275
|
-
(l) => l.outerHTML ===
|
|
302
|
+
(n) => s.find(
|
|
303
|
+
(l) => l.outerHTML === n.outerHTML
|
|
276
304
|
)
|
|
277
305
|
);
|
|
278
|
-
},
|
|
306
|
+
}, et = function(t, s) {
|
|
279
307
|
return t.filter(
|
|
280
|
-
(
|
|
281
|
-
(l) => l.outerHTML ===
|
|
308
|
+
(n) => !s.find(
|
|
309
|
+
(l) => l.outerHTML === n.outerHTML
|
|
282
310
|
)
|
|
283
311
|
);
|
|
284
|
-
},
|
|
312
|
+
}, U = new WeakMap();
|
|
285
313
|
export {
|
|
286
|
-
|
|
314
|
+
Ct as Morph
|
|
287
315
|
};
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var F=n=>{throw TypeError(n)};var W=(n,c,t)=>c.has(n)||F("Cannot "+t);var e=(n,c,t)=>(W(n,c,"read from private field"),t?t.call(n):c.get(n)),s=(n,c,t)=>c.has(n)?F("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,t),i=(n,c,t,h)=>(W(n,c,"write to private field"),h?h.call(n,t):c.set(n,t),t),v=(n,c,t)=>(W(n,c,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../css-property/index.cjs"),X=require("../Store-C2J4Q87x.cjs"),I=require("../events-KVanG9sR.cjs"),Y=require("../function-MthRj-GJ.cjs"),Z=require("../style-At6aDoqG.cjs"),G=require("../url-
|
|
1
|
+
"use strict";var F=n=>{throw TypeError(n)};var W=(n,c,t)=>c.has(n)||F("Cannot "+t);var e=(n,c,t)=>(W(n,c,"read from private field"),t?t.call(n):c.get(n)),s=(n,c,t)=>c.has(n)?F("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,t),i=(n,c,t,h)=>(W(n,c,"write to private field"),h?h.call(n,t):c.set(n,t),t),v=(n,c,t)=>(W(n,c,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../css-property/index.cjs"),X=require("../Store-C2J4Q87x.cjs"),I=require("../events-KVanG9sR.cjs"),Y=require("../function-MthRj-GJ.cjs"),Z=require("../style-At6aDoqG.cjs"),G=require("../url-CHQeS8b5.cjs"),J=require("../window-resizer/index.cjs"),ee=require("../browser-CpzFX2xg.cjs");var C,d,O,S,u,m,p,g,f,y,b,w,l,K,T,N,A,B,k,_,R,x,D;const a=class a extends HTMLElement{constructor(){super(...arguments);s(this,l);s(this,C);s(this,d);s(this,O);s(this,S);s(this,u);s(this,m);s(this,p);s(this,g);s(this,f);s(this,y);s(this,b);s(this,w);s(this,T);s(this,A);s(this,k);s(this,_);s(this,R);s(this,x);this.urlValue="",i(this,C,-1),i(this,d,new X.Store(!1)),i(this,u,new E.CSSProperty(this,"--history",!1)),i(this,m,new E.CSSProperty(this,"--restore",!1)),i(this,p,new E.CSSProperty(this,"--dominance",0)),i(this,g,new E.CSSProperty(this,"--group","")),i(this,f,new E.CSSProperty(this,"--click-outside",!1)),i(this,y,new E.CSSProperty(this,"--escape",!1)),i(this,b,!1),this.open=t=>{if(e(this,d).current)return;i(this,w,t==null?void 0:t.trigger),e(this,p).current&&(a.__opened=a.__opened.filter(o=>o!==this&&v(this,l,D).call(this,this,o)?(o.close(),!1):!0)),a.__opened.push(this),i(this,C,a.__opened.length-1),clearTimeout(e(this,O)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",I.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,w)}}),e(this,u).current&&e(this,b)&&history.pushState(history.state,"",e(this,l,K)),e(this,d).current=!0;const h=()=>{addEventListener("click",e(this,T)),addEventListener("keydown",e(this,A)),e(this,x).call(this),this.style.opacity="1",this.classList.add("opened"),I.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,w)}}),i(this,S,void 0),this.setAttribute("aria-hidden","false")};t!=null&&t.skipTransition?h():i(this,S,setTimeout(h,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,a.__opened=a.__opened.filter(t=>t===this?!1:!e(t,S)&&v(this,l,D).call(this,this,t)?(t.close(),!1):!0),v(this,l,N).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.setAttribute("aria-hidden","true"),this.style.opacity="0",I.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",I.dispatchEvent(this,"popoverClosed",{custom:!0})},Z.getElementTransitionDurationMS(this)+10))},i(this,T,t=>{e(this,f).current&&v(this,l,B).call(this,()=>{var U;const h=t.composedPath();if(h.find(j=>j instanceof HTMLElement&&j.hasAttribute("data-popover-content")))return;const o=h[0],z=o instanceof Node&&(this.contains(o)||((U=this.shadowRoot)==null?void 0:U.contains(o))),P=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||P)&&this.close()})}),i(this,A,t=>{e(this,y).current&&v(this,l,B).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,k,()=>{i(this,b,!1),e(this,d).current&&e(this,u).current&&!location.search.includes(this.id)?this.close():!e(this,d).current&&e(this,u).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),i(this,b,!0)}),i(this,_,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,Y.debounce(()=>{e(this,x).call(this)},10)),i(this,x,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,u)}get restore(){return e(this,m)}get dominance(){return e(this,p)}get group(){return e(this,g)}get clickOutside(){return e(this,f)}get escape(){return e(this,y)}get opened(){return e(this,d)}get lastTrigger(){return e(this,w)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d).current&&G.updateSearchParameter(this.id,t)}connectedCallback(){e(this,u).observe(),e(this,m).observe(),e(this,p).observe(),e(this,g).observe(),e(this,f).observe(),e(this,y).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("role","dialog"),this.setAttribute("aria-hidden","true"),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,k)),setTimeout(()=>{e(this,m).current?(this.urlValue=G.parseSearchParameters(location.search)[this.id],e(this,k).call(this)):(v(this,l,N).call(this),i(this,b,!0))},0),J.windowResizer.subscribe(e(this,_))}disconnectedCallback(){J.windowResizer.unsubscribe(e(this,_)),e(this,u).close(),e(this,m).close(),e(this,p).close(),e(this,g).close(),e(this,f).close(),e(this,y).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),a.__opened=a.__opened.filter(t=>t!==this),clearTimeout(e(this,O)),clearTimeout(e(this,S)),removeEventListener("popstate",e(this,k)),removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,l,N).call(this)}};C=new WeakMap,d=new WeakMap,O=new WeakMap,S=new WeakMap,u=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,l=new WeakSet,K=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},T=new WeakMap,N=function(){if(e(this,u).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,B=function(t){(a.__opened[e(this,C)-1]||a.__opened.length===1||a.__opened.filter(h=>h!==this).every(h=>e(this,p).current>h.dominance.current))&&t()},k=new WeakMap,_=new WeakMap,R=new WeakMap,x=new WeakMap,D=function(t,h){if(e(t,g).current===e(h,g).current&&t.dominance.current>=h.dominance.current)return!0},a.__opened=[];let q=a;customElements.get("e-popover")||customElements.define("e-popover",q);var r,L,V,M,$,H;class Q extends HTMLElement{constructor(){super();s(this,r);s(this,L,new E.CSSProperty(this,"--type","open"));s(this,V,()=>{this.classList.add("triggered")});s(this,M,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,$,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});ee.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,L).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,L)}get popoverElement(){return e(this,r)}connectedCallback(){var h;e(this,L).subscribe(o=>{e(this,r)instanceof q&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const P=this.getRootNode();P instanceof ShadowRoot?o=P.host.closest("[popover-target]"):P instanceof HTMLElement&&(o=P.closest("[popover-target]"))}}else t==="sibling"?o=(h=this.parentElement)==null?void 0:h.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,V)),e(this,r).addEventListener("popoverOpened",e(this,M)),e(this,r).addEventListener("popoverClosing",e(this,$)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,L).observe()}disconnectedCallback(){e(this,L).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,V)),e(this,r).removeEventListener("popoverOpened",e(this,M)),e(this,r).removeEventListener("popoverClosing",e(this,$)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,L=new WeakMap,V=new WeakMap,M=new WeakMap,$=new WeakMap,H=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",Q);exports.PopoverButtonElement=Q;exports.PopoverElement=q;
|
package/lib/popover/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { S as K } from "../Store-Cm3LPXlx.js";
|
|
|
8
8
|
import { d as z } from "../events-CsVF98U6.js";
|
|
9
9
|
import { d as Q } from "../function-C10DGppn.js";
|
|
10
10
|
import { g as X } from "../style-j2TwriJ_.js";
|
|
11
|
-
import { u as Y, p as Z } from "../url-
|
|
11
|
+
import { u as Y, p as Z } from "../url-DqQuzXwT.js";
|
|
12
12
|
import { windowResizer as G } from "../window-resizer/index.js";
|
|
13
13
|
import { i as ee } from "../browser-0zX67oeU.js";
|
|
14
14
|
var x, d, V, T, p, v, u, g, f, y, L, w, l, J, A, N, k, B, S, _, O, P, D;
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-
|
|
1
|
+
"use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-CHQeS8b5.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,C))}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
|
package/lib/router/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { URLPattern as at } from "urlpattern-polyfill";
|
|
|
24
24
|
import { Notifier as nt } from "../notifier/index.js";
|
|
25
25
|
import { i as _ } from "../browser-0zX67oeU.js";
|
|
26
26
|
import { d as ht } from "../function-C10DGppn.js";
|
|
27
|
-
import { n as rt, c as ot, s as ct } from "../url-
|
|
27
|
+
import { n as rt, c as ot, s as ct } from "../url-DqQuzXwT.js";
|
|
28
28
|
import { i as lt } from "../object-D6MVWB4l.js";
|
|
29
29
|
var y, U, A, p, d, L, k, v, E, R, M, tt;
|
|
30
30
|
class ut {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function h(t,r="",c=!1){r=r.endsWith("/")?r.slice(0,-1):r,t=t.replace(r,""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),n=e[0].split("?");let s=n[0].startsWith("/")?n[0]:"/"+n[0];c?s=!s.endsWith("/")&&s!=="/"?s+"/":s:s=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;const i=r+s,a=n==null?void 0:n[1],o=e==null?void 0:e[1];return{leaf:s,pathname:i,parameters:a,hash:o}}function p(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function f(t,r,c,e){const n=c||location.search,s=e?e.startsWith("#")?e:"#"+e:"",i=n?n.startsWith("?")?n:"?"+n:"",a=`${r}${s}${i}`;t==="push"?history.pushState(a,"",a):t==="replace"&&history.replaceState(a,"",a)}function l(t){const r=new URLSearchParams(t),c={};for(const[e,n]of r)c[e]=n;return c}function m(t,r){const c=new URL(location.href),e=(r==null?void 0:r.toString())||"";c.searchParams.set(t,e),history.replaceState(history.state,"",c.href)}exports.changeHistory=f;exports.normalizeBase=p;exports.parseSearchParameters=l;exports.splitPath=h;exports.updateSearchParameter=m;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function h(t, s = "", c = !1) {
|
|
2
|
+
s = s.endsWith("/") ? s.slice(0, -1) : s, t = t.replace(s, ""), t.startsWith("/") && (t = t.slice(1));
|
|
3
|
+
const n = t.split("#"), e = n[0].split("?");
|
|
4
|
+
let r = e[0].startsWith("/") ? e[0] : "/" + e[0];
|
|
5
|
+
c ? r = !r.endsWith("/") && r !== "/" ? r + "/" : r : r = r.endsWith("/") && r !== "/" ? r.slice(0, -1) : r;
|
|
6
|
+
const i = s + r, o = e == null ? void 0 : e[1], a = n == null ? void 0 : n[1];
|
|
7
|
+
return {
|
|
8
|
+
leaf: r,
|
|
9
|
+
pathname: i,
|
|
10
|
+
parameters: o,
|
|
11
|
+
hash: a
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function f(t = "/") {
|
|
15
|
+
return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
|
|
16
|
+
}
|
|
17
|
+
function p(t, s, c, n) {
|
|
18
|
+
const e = c || location.search, r = n ? n.startsWith("#") ? n : "#" + n : "", i = e ? e.startsWith("?") ? e : "?" + e : "", o = `${s}${r}${i}`;
|
|
19
|
+
t === "push" ? history.pushState(o, "", o) : t === "replace" && history.replaceState(o, "", o);
|
|
20
|
+
}
|
|
21
|
+
function l(t) {
|
|
22
|
+
const s = new URLSearchParams(t), c = {};
|
|
23
|
+
for (const [n, e] of s)
|
|
24
|
+
c[n] = e;
|
|
25
|
+
return c;
|
|
26
|
+
}
|
|
27
|
+
function W(t, s) {
|
|
28
|
+
const c = new URL(location.href), n = (s == null ? void 0 : s.toString()) || "";
|
|
29
|
+
c.searchParams.set(t, n), history.replaceState(history.state, "", c.href);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
p as c,
|
|
33
|
+
f as n,
|
|
34
|
+
l as p,
|
|
35
|
+
h as s,
|
|
36
|
+
W as u
|
|
37
|
+
};
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),f=require("../canvas-CU5Xjahf.cjs"),h=require("../coordinates-D8Np3cPD.cjs"),u=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),v=require("../events-KVanG9sR.cjs"),y=require("../file-DSpfWdd9.cjs"),C=require("../function-MthRj-GJ.cjs"),w=require("../gestures-DHLrn6Q8.cjs"),T=require("../jss-GJLvaNfT.cjs"),d=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-BANSrI_m.cjs"),c=require("../object-CCiXnER2.cjs"),l=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),m=require("../url-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),f=require("../canvas-CU5Xjahf.cjs"),h=require("../coordinates-D8Np3cPD.cjs"),u=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),v=require("../events-KVanG9sR.cjs"),y=require("../file-DSpfWdd9.cjs"),C=require("../function-MthRj-GJ.cjs"),w=require("../gestures-DHLrn6Q8.cjs"),T=require("../jss-GJLvaNfT.cjs"),d=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-BANSrI_m.cjs"),c=require("../object-CCiXnER2.cjs"),l=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),m=require("../url-CHQeS8b5.cjs");function q(t,e,...o){return[...t.slice(0,e),...o,...t.slice(e)]}function Q(t,e){const o=t.length;e=e%o;const n=new Array(o);for(let a=0;a<o;a++){const r=(a+e)%o;n[r]=t[a]}return n}function B(t,e=2){if(!+t)return"0 Bytes";const o=1024,n=e<0?0:e,a=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(o));return`${parseFloat((t/Math.pow(o,r)).toFixed(n))} ${a[r]}`}function D(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(o){console.error("Failed to copy text to clipboard:",o)}document.body.removeChild(e)}}function A(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function R(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function S(t,e){const o=t.style.getPropertyValue(e);if(o){const n=o.toString();return n.startsWith("var")?S(t,n.slice(4,-1)):n}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(o=>{Array.from(o.cssRules).forEach(n=>{n instanceof CSSStyleRule&&n.selectorText===":root"&&t.forEach(a=>{const r=S(n,a);r&&(e[a]=r)})})}),t.forEach(o=>{e[o]||console.warn(`variable named ${o} not found`)}),e}function z(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function M(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function j(t,{behaviour:e="instant",offset:o=0,center:n=!1}={}){var r;const a=u.getElement(t);if(a){const g=u.findScrollParentElement(a),E=d.getCumulativeOffsetTop(a),x=(typeof o=="number"?o:((r=u.getElement(o))==null?void 0:r.offsetHeight)||0)*-1,P=n?innerHeight/2*-1+a.offsetHeight/2:0;g==null||g.scroll({top:E+x+P,behavior:e})}}function U(t,e){if(t){const n=t.content.cloneNode(!0).firstElementChild;return n&&(e==null||e(n)),n}return null}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=I.isBrowser;exports.contain=f.contain;exports.cover=f.cover;exports.fixPosition=f.fixPosition;exports.measureText=f.measureText;exports.getPointerPosition=h.getPointerPosition;exports.normalize=h.normalize;exports.screenToCartesian=h.screenToCartesian;exports.findParentElement=u.findParentElement;exports.findScrollParentElement=u.findScrollParentElement;exports.getAllParentElements=u.getAllParentElements;exports.getElement=u.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.dispatchEvent=v.dispatchEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.downloadURI=y.downloadURI;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.styleToString;exports.getCumulativeOffsetLeft=d.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=d.getCumulativeOffsetTop;exports.getCumulativePosition=d.getCumulativePosition;exports.getStickyOffset=d.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=p.loopNumber;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.changeHistory=m.changeHistory;exports.normalizeBase=m.normalizeBase;exports.parseSearchParameters=m.parseSearchParameters;exports.splitPath=m.splitPath;exports.updateSearchParameter=m.updateSearchParameter;exports.cloneTemplateContent=U;exports.copyTextToClipboard=D;exports.decode=M;exports.dotCircleCollision=R;exports.dotRectCollision=A;exports.encode=z;exports.formatBytes=B;exports.getRootVariables=N;exports.insert=q;exports.scrollToElement=j;exports.shiftArray=Q;exports.wait=V;
|
package/lib/utils/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { l as Fe, n as je, p as He, r as Ue, t as ke } from "../polyfills-CxfUK5
|
|
|
17
17
|
import { c as qe, d as Ke, i as We, b as Ge, a as Je, m as Le, e as Ye, o as Ze, p as Xe } from "../object-D6MVWB4l.js";
|
|
18
18
|
import { c as et, a as tt, g as ot, i as st, k as at, s as nt, t as rt, u as it } from "../string-f0Dnk0L1.js";
|
|
19
19
|
import { g as lt, a as ut } from "../style-j2TwriJ_.js";
|
|
20
|
-
import { c as pt, n as mt, p as dt, s as xt, u as ht } from "../url-
|
|
20
|
+
import { c as pt, n as mt, p as dt, s as xt, u as ht } from "../url-DqQuzXwT.js";
|
|
21
21
|
function h(t, e, ...o) {
|
|
22
22
|
return [...t.slice(0, e), ...o, ...t.slice(e)];
|
|
23
23
|
}
|
package/lib/utils/url.d.ts
CHANGED
package/package.json
CHANGED
package/lib/url-B5eH5z6S.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function a(t, r = "") {
|
|
2
|
-
r = r.endsWith("/") ? r.slice(0, -1) : r, t = t.replace(r, ""), t.startsWith("/") && (t = t.slice(1));
|
|
3
|
-
const c = t.split("#"), s = c[0].split("?");
|
|
4
|
-
let n = s[0].startsWith("/") ? s[0] : "/" + s[0];
|
|
5
|
-
n = n.endsWith("/") && n !== "/" ? n.slice(0, -1) : n;
|
|
6
|
-
const o = r + n, i = s == null ? void 0 : s[1], e = c == null ? void 0 : c[1];
|
|
7
|
-
return {
|
|
8
|
-
leaf: n,
|
|
9
|
-
pathname: o,
|
|
10
|
-
parameters: i,
|
|
11
|
-
hash: e
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function h(t = "/") {
|
|
15
|
-
return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
|
|
16
|
-
}
|
|
17
|
-
function p(t, r, c, s) {
|
|
18
|
-
const n = c || location.search, o = s ? s.startsWith("#") ? s : "#" + s : "", i = n ? n.startsWith("?") ? n : "?" + n : "", e = `${r}${o}${i}`;
|
|
19
|
-
t === "push" ? history.pushState(e, "", e) : t === "replace" && history.replaceState(e, "", e);
|
|
20
|
-
}
|
|
21
|
-
function f(t) {
|
|
22
|
-
const r = new URLSearchParams(t), c = {};
|
|
23
|
-
for (const [s, n] of r)
|
|
24
|
-
c[s] = n;
|
|
25
|
-
return c;
|
|
26
|
-
}
|
|
27
|
-
function l(t, r) {
|
|
28
|
-
const c = new URL(location.href), s = (r == null ? void 0 : r.toString()) || "";
|
|
29
|
-
c.searchParams.set(t, s), history.replaceState(history.state, "", c.href);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
p as c,
|
|
33
|
-
h as n,
|
|
34
|
-
f as p,
|
|
35
|
-
a as s,
|
|
36
|
-
l as u
|
|
37
|
-
};
|
package/lib/url-BiHPIsKq.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function o(t,s=""){s=s.endsWith("/")?s.slice(0,-1):s,t=t.replace(s,""),t.startsWith("/")&&(t=t.slice(1));const n=t.split("#"),r=n[0].split("?");let e=r[0].startsWith("/")?r[0]:"/"+r[0];e=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;const a=s+e,i=r==null?void 0:r[1],c=n==null?void 0:n[1];return{leaf:e,pathname:a,parameters:i,hash:c}}function h(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function p(t,s,n,r){const e=n||location.search,a=r?r.startsWith("#")?r:"#"+r:"",i=e?e.startsWith("?")?e:"?"+e:"",c=`${s}${a}${i}`;t==="push"?history.pushState(c,"",c):t==="replace"&&history.replaceState(c,"",c)}function f(t){const s=new URLSearchParams(t),n={};for(const[r,e]of s)n[r]=e;return n}function l(t,s){const n=new URL(location.href),r=(s==null?void 0:s.toString())||"";n.searchParams.set(t,r),history.replaceState(history.state,"",n.href)}exports.changeHistory=p;exports.normalizeBase=h;exports.parseSearchParameters=f;exports.splitPath=o;exports.updateSearchParameter=l;
|