aptechka 0.42.8 → 0.42.10
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 +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +157 -156
- 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/source/SourceManager.d.ts +1 -0
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +84 -81
- 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
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var ht=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ct=n=>{throw TypeError(n)};var U=(n,t,i)=>t.has(n)||ct("Cannot "+i);var e=(n,t,i)=>(U(n,t,"read from private field"),i?i.call(n):t.get(n)),r=(n,t,i)=>t.has(n)?ct("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(U(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),y=(n,t,i)=>(U(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,d)=>{var u=f=>{try{L(i.next(f))}catch(P){d(P)}},o=f=>{try{L(i.throw(f))}catch(P){d(P)}},L=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,o);L((i=i.apply(n,t)).next())});var lt=(n,t,i)=>(t=n[ht("asyncIterator")])?t.call(n):(n=n[ht("iterator")](),t={},i=(s,d)=>(d=n[s])&&(t[s]=u=>new Promise((o,L,f)=>(u=d.call(n,u),f=u.done,Promise.resolve(u.value).then(P=>o({value:P,done:f}),L)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const gt=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),Y=require("../url-CHQeS8b5.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class ut{constructor(t,i){r(this,T);r(this,h);r(this,p);r(this,q);r(this,x);r(this,H);r(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});r(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,o;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),d=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(L=>i.normalizePath(L.trim()).pathname)),e(this,h).hasAttribute("data-include")?d.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===d.pathname||(o=e(this,H))!=null&&o.includes(d.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,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,_,S,E,G,M,b,g,B,F,v,m,X,Z,mt,$,J;class Lt{constructor(t){r(this,m);r(this,I,null);r(this,O,null);r(this,R,null);r(this,_,!1);r(this,S,null);r(this,E,[]);r(this,G,new DOMParser);r(this,M,new Map);r(this,b);r(this,g,null);r(this,B);r(this,F);r(this,v,[]);r(this,J,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(gt.isBrowser){c(this,I,Y.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,_,(t==null?void 0:t.trailingSlash)||!1),c(this,S,y(this,m,Z).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,g,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,g)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,J)),Y.changeHistory("replace",e(this,g),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,g)}get previousPathname(){return e(this,B)}get currentState(){return e(this,F)}get links(){return e(this,E)}normalizePath(t){return Y.splitPath(t,e(this,I),e(this,_))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return y(this,m,X).call(this,i.pathname)})}navigate(d){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var tt;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:o,hash:L,parameters:f,leaf:P}=u;if(e(this,b)===o||e(this,g)===o)return;c(this,F,s),c(this,b,o);const N=e(this,M).has(o);try{dt.loading.add("__morph");let W=!0;if(V.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:o,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((a,w)=>{var A;(A=this.preprocessor)==null||A.call(this,{pathname:o,resolve:a,reject:w,isCached:N,state:s})})}catch(a){a?console.error(a):console.log("Route change canceled"),W=!1}if(!W||e(this,b)!==o)return;const et=e(this,M).get(o)||(yield y(this,m,X).call(this,o));if(e(this,b)!==o)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=y(this,m,mt).call(this,it,st),ft=y(this,m,$).call(this,it,nt),j=y(this,m,$).call(this,st,nt);j.forEach((a,w)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const A=document.createElement("script");A.type="module",A.src=a.getAttribute("src"),j[w]=A}}),j.forEach(a=>{document.head.appendChild(a)});const Q=j.filter(a=>!a.hasAttribute("data-no-waiting")&&(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,O)&&Q.length&&(yield new Promise(a=>z(this,null,function*(){let w=0;try{for(var A=lt(Q),at,C,rt;at=!(C=yield A.next()).done;at=!1){const K=C.value;K.onload=()=>{w++,w===Q.length&&a()}}}catch(C){rt=[C]}finally{try{at&&(C=A.return)&&(yield C.call(A))}finally{if(rt)throw rt[0]}}}))),ft.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,B,e(this,g)),c(this,g,o),Y.changeHistory(i,o,f,L);const pt=y(this,m,Z).call(this,et.body.cloneNode(!0));e(this,v).forEach(a=>clearTimeout(a)),c(this,v,[]),e(this,S).forEach((a,w)=>{const A=pt[w],at=getComputedStyle(a).getPropertyValue("--morph-duration"),C=[...A.childNodes];if(at){const rt=[...a.childNodes];rt.forEach(l=>{l instanceof HTMLElement&&l.classList.add("old")}),C.forEach(l=>{l instanceof HTMLElement&&l.classList.add("new")}),a.append(...C),setTimeout(()=>{C.forEach(l=>{l instanceof HTMLElement&&l.classList.add("in")})},10);const K={element:a,pathname:o,isCached:N,state:s};V.dispatchEvent(document,"morphBeforeElementOut",{detail:K});const ot=setTimeout(()=>{rt.forEach(l=>l.remove()),C.forEach(l=>{l instanceof HTMLElement&&(l.classList.remove("new","in"),l.classList.add("current"))}),V.dispatchEvent(document,"morphAfterElementOut",{detail:K}),c(this,v,e(this,v).filter(l=>l!==ot))},(parseFloat(at)||0)*1e3+10);e(this,v).push(ot)}else a.innerHTML="",a.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",P),(tt=this.postprocessor)==null||tt.call(this,{pathname:o,isCached:N,state:s}),V.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:o,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(W){console.error(W)}c(this,b,void 0)})}addLink(t){e(this,E).push(new ut(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")&&!i.closest("[data-morph-skip]")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new ut(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,_=new WeakMap,S=new WeakMap,E=new WeakMap,G=new WeakMap,M=new WeakMap,b=new WeakMap,g=new WeakMap,B=new WeakMap,F=new WeakMap,v=new WeakMap,m=new WeakSet,X=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const d=yield(yield fetch(t)).text(),u=e(this,G).parseFromString(d,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},Z=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},mt=function(t,i){return t.filter(s=>i.find(d=>d.outerHTML===s.outerHTML))},$=function(t,i){return t.filter(s=>!i.find(d=>d.outerHTML===s.outerHTML))},J=new WeakMap;exports.Morph=Lt;
|
package/lib/morph/index.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ot = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ht = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (n, t,
|
|
6
|
-
var z = (n, t,
|
|
4
|
+
var Q = (n, t, i) => t.has(n) || ht("Cannot " + i);
|
|
5
|
+
var e = (n, t, i) => (Q(n, t, "read from private field"), i ? i.call(n) : t.get(n)), r = (n, t, i) => t.has(n) ? ht("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, i), c = (n, t, i, s) => (Q(n, t, "write to private field"), s ? s.call(n, i) : t.set(n, i), i), P = (n, t, i) => (Q(n, t, "access private method"), i);
|
|
6
|
+
var z = (n, t, i) => new Promise((s, d) => {
|
|
7
7
|
var u = (f) => {
|
|
8
8
|
try {
|
|
9
|
-
g(
|
|
9
|
+
g(i.next(f));
|
|
10
10
|
} catch (b) {
|
|
11
|
-
|
|
11
|
+
d(b);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, o = (f) => {
|
|
14
14
|
try {
|
|
15
|
-
g(
|
|
15
|
+
g(i.throw(f));
|
|
16
16
|
} catch (b) {
|
|
17
|
-
|
|
17
|
+
d(b);
|
|
18
18
|
}
|
|
19
|
-
}, g = (f) => f.done ?
|
|
20
|
-
g((
|
|
19
|
+
}, g = (f) => f.done ? s(f.value) : Promise.resolve(f.value).then(u, o);
|
|
20
|
+
g((i = i.apply(n, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
import { i as
|
|
24
|
-
import { d as
|
|
25
|
-
import { n as
|
|
22
|
+
var ct = (n, t, i) => (t = n[ot("asyncIterator")]) ? t.call(n) : (n = n[ot("iterator")](), t = {}, i = (s, d) => (d = n[s]) && (t[s] = (u) => new Promise((o, g, f) => (u = d.call(n, u), f = u.done, Promise.resolve(u.value).then((b) => o({ value: b, done: f }), g)))), i("next"), i("return"), t);
|
|
23
|
+
import { i as Lt } from "../browser-0zX67oeU.js";
|
|
24
|
+
import { d as Y } from "../events-CsVF98U6.js";
|
|
25
|
+
import { n as gt, c as lt, s as Et } from "../url-DqQuzXwT.js";
|
|
26
26
|
import { loading as dt } from "../loading/index.js";
|
|
27
27
|
var T, h, p, x, D, H, I, M;
|
|
28
|
-
class
|
|
29
|
-
constructor(t,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
t.preventDefault(), e(this, T).links.forEach((
|
|
38
|
-
var
|
|
39
|
-
e(this, p) === e(
|
|
28
|
+
class ut {
|
|
29
|
+
constructor(t, i) {
|
|
30
|
+
r(this, T);
|
|
31
|
+
r(this, h);
|
|
32
|
+
r(this, p);
|
|
33
|
+
r(this, x);
|
|
34
|
+
r(this, D);
|
|
35
|
+
r(this, H);
|
|
36
|
+
r(this, I, (t) => {
|
|
37
|
+
t.preventDefault(), e(this, T).links.forEach((i) => {
|
|
38
|
+
var s;
|
|
39
|
+
e(this, p) === e(i, p) || (s = e(i, H)) != null && s.includes(e(this, p)) ? e(i, h).classList.add("clicked") : e(i, h).classList.remove("clicked");
|
|
40
40
|
}), e(this, T).navigate(e(this, p), {
|
|
41
41
|
historyAction: e(this, x),
|
|
42
42
|
state: e(this, D)
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
r(this, M, () => {
|
|
46
46
|
e(this, T).prefetch(e(this, p)), e(this, h).removeEventListener("pointerenter", e(this, M));
|
|
47
47
|
});
|
|
48
|
-
var u,
|
|
49
|
-
c(this, T,
|
|
48
|
+
var u, o;
|
|
49
|
+
c(this, T, i), c(this, h, t), c(this, p, e(this, h).getAttribute("href") || "/"), c(this, x, e(this, h).getAttribute(
|
|
50
50
|
"data-history-action"
|
|
51
51
|
) || "push"), c(this, D, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, I));
|
|
52
|
-
const
|
|
53
|
-
c(this, H, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) =>
|
|
52
|
+
const s = i.normalizePath(e(this, p)), d = i.normalizePath(location.pathname);
|
|
53
|
+
c(this, H, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) => i.normalizePath(g.trim()).pathname)), e(this, h).hasAttribute("data-include") ? d.pathname.includes(s.pathname) && e(this, h).classList.add("current") : s.pathname === d.pathname || (o = e(this, H)) != null && o.includes(d.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, M));
|
|
54
54
|
}
|
|
55
55
|
get element() {
|
|
56
56
|
return e(this, h);
|
|
@@ -60,41 +60,42 @@ class lt {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
T = new WeakMap(), h = new WeakMap(), p = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), I = new WeakMap(), M = new WeakMap();
|
|
63
|
-
var R, B, F,
|
|
64
|
-
class
|
|
63
|
+
var R, B, F, O, S, E, j, k, y, L, _, q, v, m, U, X, mt, Z, G;
|
|
64
|
+
class bt {
|
|
65
65
|
constructor(t) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
r(this, m);
|
|
67
|
+
r(this, R, null);
|
|
68
|
+
r(this, B, null);
|
|
69
|
+
r(this, F, null);
|
|
70
|
+
r(this, O, !1);
|
|
71
|
+
r(this, S, null);
|
|
72
|
+
r(this, E, []);
|
|
73
|
+
r(this, j, new DOMParser());
|
|
74
|
+
r(this, k, /* @__PURE__ */ new Map());
|
|
75
|
+
r(this, y);
|
|
76
|
+
r(this, L, null);
|
|
77
|
+
r(this, _);
|
|
78
|
+
r(this, q);
|
|
79
|
+
r(this, v, []);
|
|
80
|
+
r(this, G, (t) => {
|
|
80
81
|
t.state && this.navigate(t.state, { historyAction: "none" });
|
|
81
82
|
});
|
|
82
|
-
if (
|
|
83
|
-
c(this, R,
|
|
84
|
-
const
|
|
85
|
-
c(this, L,
|
|
83
|
+
if (Lt) {
|
|
84
|
+
c(this, R, gt(t == null ? void 0 : t.base)), c(this, B, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, F, (t == null ? void 0 : t.cachePages) !== !1), c(this, O, (t == null ? void 0 : t.trailingSlash) || !1), c(this, S, P(this, m, X).call(this, document.body));
|
|
85
|
+
const i = this.normalizePath(location.pathname);
|
|
86
|
+
c(this, L, i.pathname), document.documentElement.setAttribute(
|
|
86
87
|
"data-current-pathname",
|
|
87
88
|
e(this, L)
|
|
88
89
|
), document.documentElement.setAttribute(
|
|
89
90
|
"data-current-leaf",
|
|
90
|
-
|
|
91
|
-
), this.findLinks(), addEventListener("popstate", e(this,
|
|
91
|
+
i.leaf
|
|
92
|
+
), this.findLinks(), addEventListener("popstate", e(this, G)), lt(
|
|
92
93
|
"replace",
|
|
93
94
|
e(this, L),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
), e(this,
|
|
97
|
-
|
|
95
|
+
i.parameters,
|
|
96
|
+
i.hash
|
|
97
|
+
), e(this, S).map((s) => [...s.children]).flat().forEach((s) => {
|
|
98
|
+
s instanceof HTMLElement && s.classList.add("current");
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
101
|
}
|
|
@@ -102,186 +103,186 @@ class yt {
|
|
|
102
103
|
return e(this, L);
|
|
103
104
|
}
|
|
104
105
|
get previousPathname() {
|
|
105
|
-
return e(this,
|
|
106
|
+
return e(this, _);
|
|
106
107
|
}
|
|
107
108
|
get currentState() {
|
|
108
|
-
return e(this,
|
|
109
|
+
return e(this, q);
|
|
109
110
|
}
|
|
110
111
|
get links() {
|
|
111
112
|
return e(this, E);
|
|
112
113
|
}
|
|
113
114
|
normalizePath(t) {
|
|
114
|
-
return
|
|
115
|
+
return Et(t, e(this, R), e(this, O));
|
|
115
116
|
}
|
|
116
117
|
prefetch(t) {
|
|
117
118
|
return z(this, null, function* () {
|
|
118
|
-
const
|
|
119
|
-
return P(this, m,
|
|
119
|
+
const i = this.normalizePath(t);
|
|
120
|
+
return P(this, m, U).call(this, i.pathname);
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
|
-
navigate(
|
|
123
|
-
return z(this, arguments, function* (t, { historyAction:
|
|
124
|
-
var
|
|
123
|
+
navigate(d) {
|
|
124
|
+
return z(this, arguments, function* (t, { historyAction: i = "push", state: s } = {}) {
|
|
125
|
+
var $;
|
|
125
126
|
if (e(this, v).length)
|
|
126
127
|
return;
|
|
127
128
|
const u = this.normalizePath(t);
|
|
128
|
-
let { pathname:
|
|
129
|
-
if (e(this, y) ===
|
|
129
|
+
let { pathname: o, hash: g, parameters: f, leaf: b } = u;
|
|
130
|
+
if (e(this, y) === o || e(this, L) === o)
|
|
130
131
|
return;
|
|
131
|
-
c(this,
|
|
132
|
-
const
|
|
132
|
+
c(this, q, s), c(this, y, o);
|
|
133
|
+
const N = e(this, k).has(o);
|
|
133
134
|
try {
|
|
134
135
|
dt.add("__morph");
|
|
135
|
-
let
|
|
136
|
-
if (
|
|
136
|
+
let W = !0;
|
|
137
|
+
if (Y(document, "morphBeforeNavigation", {
|
|
137
138
|
detail: {
|
|
138
|
-
pathname:
|
|
139
|
-
isCached:
|
|
140
|
-
state:
|
|
139
|
+
pathname: o,
|
|
140
|
+
isCached: N,
|
|
141
|
+
state: s
|
|
141
142
|
}
|
|
142
143
|
}), this.preprocessor)
|
|
143
144
|
try {
|
|
144
145
|
yield new Promise((a, A) => {
|
|
145
146
|
var w;
|
|
146
|
-
(w = this.preprocessor) == null || w.call(this, { pathname:
|
|
147
|
+
(w = this.preprocessor) == null || w.call(this, { pathname: o, resolve: a, reject: A, isCached: N, state: s });
|
|
147
148
|
});
|
|
148
149
|
} catch (a) {
|
|
149
|
-
a ? console.error(a) : console.log("Route change canceled"),
|
|
150
|
+
a ? console.error(a) : console.log("Route change canceled"), W = !1;
|
|
150
151
|
}
|
|
151
|
-
if (!
|
|
152
|
+
if (!W || e(this, y) !== o)
|
|
152
153
|
return;
|
|
153
|
-
const
|
|
154
|
-
if (e(this, y) !==
|
|
154
|
+
const tt = e(this, k).get(o) || (yield P(this, m, U).call(this, o));
|
|
155
|
+
if (e(this, y) !== o)
|
|
155
156
|
return;
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
), st = P(this, m,
|
|
159
|
-
|
|
157
|
+
const et = Array.from(document.head.children), it = Array.from(
|
|
158
|
+
tt.head.cloneNode(!0).children
|
|
159
|
+
), st = P(this, m, mt).call(this, et, it), ft = P(this, m, Z).call(this, et, st), K = P(this, m, Z).call(this, it, st);
|
|
160
|
+
K.forEach((a, A) => {
|
|
160
161
|
if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
|
|
161
162
|
const w = document.createElement("script");
|
|
162
|
-
w.type = "module", w.src = a.getAttribute("src"),
|
|
163
|
+
w.type = "module", w.src = a.getAttribute("src"), K[A] = w;
|
|
163
164
|
}
|
|
164
|
-
}),
|
|
165
|
+
}), K.forEach((a) => {
|
|
165
166
|
document.head.appendChild(a);
|
|
166
167
|
});
|
|
167
|
-
const
|
|
168
|
+
const J = K.filter(
|
|
168
169
|
(a) => !a.hasAttribute("data-no-waiting") && (a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK") && a.getAttribute("rel") !== "canonical"
|
|
169
170
|
);
|
|
170
|
-
e(this, B) &&
|
|
171
|
+
e(this, B) && J.length && (yield new Promise((a) => z(this, null, function* () {
|
|
171
172
|
let A = 0;
|
|
172
173
|
try {
|
|
173
|
-
for (var w =
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
A++, A ===
|
|
174
|
+
for (var w = ct(J), nt, C, at; nt = !(C = yield w.next()).done; nt = !1) {
|
|
175
|
+
const V = C.value;
|
|
176
|
+
V.onload = () => {
|
|
177
|
+
A++, A === J.length && a();
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
|
-
} catch (
|
|
180
|
-
|
|
180
|
+
} catch (C) {
|
|
181
|
+
at = [C];
|
|
181
182
|
} finally {
|
|
182
183
|
try {
|
|
183
|
-
|
|
184
|
+
nt && (C = w.return) && (yield C.call(w));
|
|
184
185
|
} finally {
|
|
185
|
-
if (
|
|
186
|
-
throw
|
|
186
|
+
if (at)
|
|
187
|
+
throw at[0];
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
}))),
|
|
190
|
+
}))), ft.forEach((a) => {
|
|
190
191
|
a.hasAttribute("data-permanent") || a.remove();
|
|
191
|
-
}), c(this,
|
|
192
|
-
const
|
|
193
|
-
e(this, v).forEach((a) => clearTimeout(a)), c(this, v, []), e(this,
|
|
194
|
-
const w =
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}),
|
|
200
|
-
|
|
201
|
-
}), a.append(...
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
}), c(this, _, e(this, L)), c(this, L, o), lt(i, o, f, g);
|
|
193
|
+
const pt = P(this, m, X).call(this, tt.body.cloneNode(!0));
|
|
194
|
+
e(this, v).forEach((a) => clearTimeout(a)), c(this, v, []), e(this, S).forEach((a, A) => {
|
|
195
|
+
const w = pt[A], nt = getComputedStyle(a).getPropertyValue("--morph-duration"), C = [...w.childNodes];
|
|
196
|
+
if (nt) {
|
|
197
|
+
const at = [...a.childNodes];
|
|
198
|
+
at.forEach((l) => {
|
|
199
|
+
l instanceof HTMLElement && l.classList.add("old");
|
|
200
|
+
}), C.forEach((l) => {
|
|
201
|
+
l instanceof HTMLElement && l.classList.add("new");
|
|
202
|
+
}), a.append(...C), setTimeout(() => {
|
|
203
|
+
C.forEach((l) => {
|
|
204
|
+
l instanceof HTMLElement && l.classList.add("in");
|
|
204
205
|
});
|
|
205
206
|
}, 10);
|
|
206
|
-
const
|
|
207
|
+
const V = {
|
|
207
208
|
element: a,
|
|
208
|
-
pathname:
|
|
209
|
-
isCached:
|
|
210
|
-
state:
|
|
209
|
+
pathname: o,
|
|
210
|
+
isCached: N,
|
|
211
|
+
state: s
|
|
211
212
|
};
|
|
212
|
-
|
|
213
|
-
detail:
|
|
213
|
+
Y(document, "morphBeforeElementOut", {
|
|
214
|
+
detail: V
|
|
214
215
|
});
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}),
|
|
219
|
-
detail:
|
|
220
|
-
}), c(this, v, e(this, v).filter((
|
|
221
|
-
}, (parseFloat(
|
|
222
|
-
e(this, v).push(
|
|
216
|
+
const rt = setTimeout(() => {
|
|
217
|
+
at.forEach((l) => l.remove()), C.forEach((l) => {
|
|
218
|
+
l instanceof HTMLElement && (l.classList.remove("new", "in"), l.classList.add("current"));
|
|
219
|
+
}), Y(document, "morphAfterElementOut", {
|
|
220
|
+
detail: V
|
|
221
|
+
}), c(this, v, e(this, v).filter((l) => l !== rt));
|
|
222
|
+
}, (parseFloat(nt) || 0) * 1e3 + 10);
|
|
223
|
+
e(this, v).push(rt);
|
|
223
224
|
} else
|
|
224
|
-
a.innerHTML = "", a.append(...
|
|
225
|
-
}), this.findLinks(), document.documentElement.setAttribute("data-current-pathname",
|
|
225
|
+
a.innerHTML = "", a.append(...C);
|
|
226
|
+
}), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", b), ($ = this.postprocessor) == null || $.call(this, { pathname: o, isCached: N, state: s }), Y(document, "morphAfterNavigation", {
|
|
226
227
|
detail: {
|
|
227
|
-
pathname:
|
|
228
|
-
isCached:
|
|
229
|
-
state:
|
|
228
|
+
pathname: o,
|
|
229
|
+
isCached: N,
|
|
230
|
+
state: s
|
|
230
231
|
}
|
|
231
232
|
}), dt.complete("__morph");
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(
|
|
233
|
+
} catch (W) {
|
|
234
|
+
console.error(W);
|
|
234
235
|
}
|
|
235
236
|
c(this, y, void 0);
|
|
236
237
|
});
|
|
237
238
|
}
|
|
238
239
|
addLink(t) {
|
|
239
|
-
e(this, E).push(new
|
|
240
|
+
e(this, E).push(new ut(t, this));
|
|
240
241
|
}
|
|
241
242
|
addLinks(t) {
|
|
242
|
-
t.forEach((
|
|
243
|
-
this.addLink(
|
|
243
|
+
t.forEach((i) => {
|
|
244
|
+
this.addLink(i);
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
247
|
removeLink(t) {
|
|
247
|
-
c(this, E, e(this, E).filter((
|
|
248
|
+
c(this, E, e(this, E).filter((i) => i.element === t ? (i.destroy(), !1) : !0));
|
|
248
249
|
}
|
|
249
250
|
findLinks() {
|
|
250
251
|
const t = [
|
|
251
252
|
...document.documentElement.querySelectorAll("a")
|
|
252
253
|
].filter(
|
|
253
|
-
(
|
|
254
|
-
var
|
|
255
|
-
return ((
|
|
254
|
+
(i) => {
|
|
255
|
+
var s;
|
|
256
|
+
return ((s = i.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !i.hasAttribute("download") && !i.hasAttribute("data-morph-skip") && !i.closest("[data-morph-skip]");
|
|
256
257
|
}
|
|
257
258
|
);
|
|
258
|
-
e(this, E).forEach((
|
|
259
|
+
e(this, E).forEach((i) => i.destroy()), c(this, E, t.map((i) => new ut(i, this)));
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
|
-
R = new WeakMap(), B = new WeakMap(), F = new WeakMap(),
|
|
262
|
+
R = new WeakMap(), B = new WeakMap(), F = new WeakMap(), O = new WeakMap(), S = new WeakMap(), E = new WeakMap(), j = new WeakMap(), k = new WeakMap(), y = new WeakMap(), L = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), v = new WeakMap(), m = new WeakSet(), U = function(t) {
|
|
262
263
|
return z(this, null, function* () {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
return
|
|
266
|
-
const
|
|
264
|
+
const i = e(this, k).get(t);
|
|
265
|
+
if (i)
|
|
266
|
+
return i;
|
|
267
|
+
const d = yield (yield fetch(t)).text(), u = e(this, j).parseFromString(d, "text/html");
|
|
267
268
|
return e(this, F) && e(this, k).set(t, u), u;
|
|
268
269
|
});
|
|
269
|
-
},
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
},
|
|
270
|
+
}, X = function(t) {
|
|
271
|
+
const i = [...t.querySelectorAll("[data-morph]")];
|
|
272
|
+
return i.length ? i : [t];
|
|
273
|
+
}, mt = function(t, i) {
|
|
273
274
|
return t.filter(
|
|
274
|
-
(
|
|
275
|
-
(
|
|
275
|
+
(s) => i.find(
|
|
276
|
+
(d) => d.outerHTML === s.outerHTML
|
|
276
277
|
)
|
|
277
278
|
);
|
|
278
|
-
},
|
|
279
|
+
}, Z = function(t, i) {
|
|
279
280
|
return t.filter(
|
|
280
|
-
(
|
|
281
|
-
(
|
|
281
|
+
(s) => !i.find(
|
|
282
|
+
(d) => d.outerHTML === s.outerHTML
|
|
282
283
|
)
|
|
283
284
|
);
|
|
284
|
-
},
|
|
285
|
+
}, G = new WeakMap();
|
|
285
286
|
export {
|
|
286
|
-
|
|
287
|
+
bt as Morph
|
|
287
288
|
};
|
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 {
|
|
@@ -9,6 +9,7 @@ export interface SourceManagerParameters {
|
|
|
9
9
|
export declare class SourceManager extends Store<Source | undefined> {
|
|
10
10
|
#private;
|
|
11
11
|
constructor(parameters: SourceManagerParameters);
|
|
12
|
+
updateSource(parameters: SourceManagerParameters): void;
|
|
12
13
|
close(): void;
|
|
13
14
|
connect(): void;
|
|
14
15
|
disconnect(): void;
|
package/lib/source/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Z=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||Z("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),_=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../class-linked-status/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),U=require("../events-KVanG9sR.cjs"),et=require("../string-DhgS_iFl.cjs"),K=require("../loading/index.cjs"),st=require("../order/index.cjs"),J=require("../window-resizer/index.cjs"),it=require("../Store-C2J4Q87x.cjs");var $,q,O,S,u,f,M;class Q{constructor(r){i(this,$);i(this,q);i(this,O);i(this,S);i(this,u);i(this,f);i(this,M);s(this,$,r);let e=r.split(".");const o=/\b\d{1,2}x\b/g,d=e.find(p=>p.match(o)&&parseInt(p));s(this,O,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,q,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,B=/\d+mar/g,P=/\d+mir/g,H=e.find(p=>p.match(l)),n=e.find(p=>p.match(x)),b=e.find(p=>p.match(B)),W=e.find(p=>p.match(P));b?(s(this,u,parseInt(b)),s(this,f,"max"),s(this,S,`(max-aspect-ratio: ${t(this,u)})`)):W?(s(this,u,parseInt(W)),s(this,f,"max"),s(this,S,`(min-aspect-ratio: ${t(this,u)})`)):H?(s(this,u,parseInt(H)),s(this,f,"max"),s(this,S,`(max-width: ${t(this,u)}px)`)):n?(s(this,u,parseInt(n)),s(this,S,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,S,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,q,t(this,q).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,M,e[e.length-1]===t(this,q)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,$)}get name(){return t(this,q)}get density(){return t(this,O)}get query(){return t(this,S)}get extension(){return t(this,M)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}$=new WeakMap,q=new WeakMap,O=new WeakMap,S=new WeakMap,u=new WeakMap,f=new WeakMap,M=new WeakMap;let rt=0;var m,a,y,w,g,z,R,c,v,A,E,C,I,j,D,V,F;class nt extends HTMLElement{constructor(e){super();i(this,I);i(this,m,null);i(this,a,null);i(this,y,!1);i(this,w,!1);i(this,g,!1);i(this,z,"");i(this,R,"");i(this,c,new Y.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));i(this,v,null);i(this,A);i(this,E,null);i(this,C);i(this,D,e=>{const o=e[0];t(this,g)&&(!t(this,w)||this.hasAttribute("reload-source"))&&o.isIntersecting&&this.triggerLazyLoad(),o.isIntersecting?U.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(_(this,I,j).call(this,void 0),s(this,w,!1)),U.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,V,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.complete(t(this,R)),U.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,A,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,y,!0)});i(this,F,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.error(t(this,R)),U.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});s(this,C,e==null?void 0:e.sourceSetOptions),tt.isBrowser&&window.IntersectionObserver&&s(this,v,new IntersectionObserver(t(this,D)))}get consumerElement(){return t(this,a)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,E)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,w)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,w,!0),_(this,I,j).call(this,t(this,m).current))}connectedCallback(){s(this,z,`source-consumer-${++rt}`);const e=this.getAttribute("srcset")||"",o=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;o&&t(this,c).addElement(o),s(this,a,this.createConsumer()),t(this,a).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,w))&&_(this,
|
|
5
|
+
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,w))&&_(this,I,j).call(this,d.current)}),t(this,m).connect(),t(this,v).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,A)),t(this,v).disconnect(),(e=t(this,m))==null||e.close(),t(this,a)&&(t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,a).remove()),s(this,y,!1),s(this,w,!1),t(this,c).reset()}}m=new WeakMap,a=new WeakMap,y=new WeakMap,w=new WeakMap,g=new WeakMap,z=new WeakMap,R=new WeakMap,c=new WeakMap,v=new WeakMap,A=new WeakMap,E=new WeakMap,C=new WeakMap,I=new WeakSet,j=function(e){if(clearTimeout(t(this,A)),t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),e){s(this,R,`${t(this,z)}-${e.url}`);const o=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,E,o?e.url:e.name+e.extension),this.consumeSource(t(this,E)),!t(this,g)&&!t(this,y)&&K.loading.add(t(this,R)),t(this,a).onloadeddata=()=>{t(this,V).call(this)},t(this,a).onload=()=>{t(this,V).call(this)},t(this,a).onerror=()=>{t(this,F).call(this,t(this,E))}}else s(this,E,null),this.consumeSource(null)},D=new WeakMap,V=new WeakMap,F=new WeakMap;var L;class N{constructor(r,e){i(this,L);s(this,L,new Map);const o=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof r=="string"?o?r.trim().split(",").map(n=>n.trim()).filter(n=>!!n):[r]:r,l=[];d.forEach(n=>{const b=new Q(n);l.push([b.query,b])});const x=l.filter(n=>n[1].queryType.includes("max")).sort((n,b)=>b[1].queryValue-n[1].queryValue),B=l.filter(n=>n[1].queryType.includes("min")&&n[1].queryValue!==0).sort((n,b)=>n[1].queryValue-b[1].queryValue),P=l.filter(n=>n[0]==="(min-width: 0px)");(P?[...P,...x,...B]:[...x,...B]).forEach(n=>{t(this,L).has(n[0])||t(this,L).set(n[0],[]),t(this,L).get(n[0]).push(n[1])})}get mediaBuckets(){return t(this,L)}}L=new WeakMap;var T,k;class X extends it.Store{constructor(e){super(void 0);i(this,T);i(this,k,()=>{let e;t(this,T).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let o,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,o=l)}),e!=null&&e.length&&!o&&(o=e[0]),this.current=o});s(this,T,new N(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,T,new N(e.srcset,e.sourceSetOptions)),t(this,k).call(this)}close(){super.close(),this.disconnect()}connect(){J.windowResizer.subscribe(t(this,k),st.RESIZE_ORDER.SOURCE_MANAGER),t(this,k).call(this)}disconnect(){J.windowResizer.unsubscribe(t(this,k))}}T=new WeakMap,k=new WeakMap;exports.Source=Q;exports.SourceElement=nt;exports.SourceManager=X;exports.SourceSet=N;
|
package/lib/source/index.js
CHANGED
|
@@ -3,45 +3,45 @@ var W = (n) => {
|
|
|
3
3
|
};
|
|
4
4
|
var G = (n, r, e) => r.has(n) || W("Cannot " + e);
|
|
5
5
|
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), i = (n, r, e) => r.has(n) ? W("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), s = (n, r, e, o) => (G(n, r, "write to private field"), o ? o.call(n, e) : r.set(n, e), e), U = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
|
-
import { ClassLinkedStatus as
|
|
7
|
-
import { i as
|
|
6
|
+
import { ClassLinkedStatus as Q } from "../class-linked-status/index.js";
|
|
7
|
+
import { i as X } from "../browser-0zX67oeU.js";
|
|
8
8
|
import { d as D } from "../events-CsVF98U6.js";
|
|
9
|
-
import { k as
|
|
9
|
+
import { k as Y } from "../string-f0Dnk0L1.js";
|
|
10
10
|
import { loading as K } from "../loading/index.js";
|
|
11
|
-
import { RESIZE_ORDER as
|
|
11
|
+
import { RESIZE_ORDER as tt } from "../order/index.js";
|
|
12
12
|
import { windowResizer as Z } from "../window-resizer/index.js";
|
|
13
|
-
import { S as
|
|
14
|
-
var
|
|
15
|
-
class
|
|
13
|
+
import { S as et } from "../Store-Cm3LPXlx.js";
|
|
14
|
+
var C, E, O, L, u, f, k;
|
|
15
|
+
class st {
|
|
16
16
|
constructor(r) {
|
|
17
|
-
i(this, T);
|
|
18
|
-
i(this, w);
|
|
19
17
|
i(this, C);
|
|
18
|
+
i(this, E);
|
|
19
|
+
i(this, O);
|
|
20
20
|
i(this, L);
|
|
21
21
|
i(this, u);
|
|
22
22
|
i(this, f);
|
|
23
23
|
i(this, k);
|
|
24
|
-
s(this,
|
|
24
|
+
s(this, C, r);
|
|
25
25
|
let e = r.split(".");
|
|
26
26
|
const o = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(o) && parseInt(g));
|
|
27
|
-
s(this,
|
|
28
|
-
const
|
|
29
|
-
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this,
|
|
27
|
+
s(this, O, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, E, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
28
|
+
const l = /\d+max/g, x = /\d+min/g, B = /\d+mar/g, P = /\d+mir/g, _ = e.find((g) => g.match(l)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(B)), N = e.find((g) => g.match(P));
|
|
29
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, E, t(this, E).replace(
|
|
30
30
|
`.${t(this, u)}${t(this, f)}`,
|
|
31
31
|
""
|
|
32
|
-
)), s(this, k, e[e.length - 1] === t(this,
|
|
32
|
+
)), s(this, k, e[e.length - 1] === t(this, E) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
33
33
|
`.${t(this, u)}${t(this, f)}`,
|
|
34
34
|
""
|
|
35
35
|
));
|
|
36
36
|
}
|
|
37
37
|
get url() {
|
|
38
|
-
return t(this,
|
|
38
|
+
return t(this, C);
|
|
39
39
|
}
|
|
40
40
|
get name() {
|
|
41
|
-
return t(this,
|
|
41
|
+
return t(this, E);
|
|
42
42
|
}
|
|
43
43
|
get density() {
|
|
44
|
-
return t(this,
|
|
44
|
+
return t(this, O);
|
|
45
45
|
}
|
|
46
46
|
get query() {
|
|
47
47
|
return t(this, L);
|
|
@@ -56,45 +56,45 @@ class et {
|
|
|
56
56
|
return t(this, u);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
var m, a, y,
|
|
59
|
+
C = new WeakMap(), E = new WeakMap(), O = new WeakMap(), L = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
60
|
+
let it = 0;
|
|
61
|
+
var m, a, y, w, p, V, A, c, M, R, S, z, $, F, H, v, j;
|
|
62
62
|
class ft extends HTMLElement {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super();
|
|
65
|
-
i(this,
|
|
65
|
+
i(this, $);
|
|
66
66
|
i(this, m, null);
|
|
67
67
|
i(this, a, null);
|
|
68
68
|
i(this, y, !1);
|
|
69
|
-
i(this,
|
|
69
|
+
i(this, w, !1);
|
|
70
70
|
i(this, p, !1);
|
|
71
|
-
i(this,
|
|
71
|
+
i(this, V, "");
|
|
72
72
|
i(this, A, "");
|
|
73
|
-
i(this,
|
|
73
|
+
i(this, c, new Q(this, {
|
|
74
74
|
loading: !1,
|
|
75
75
|
loaded: !1,
|
|
76
76
|
error: !1,
|
|
77
77
|
clear: !1
|
|
78
78
|
}));
|
|
79
|
-
i(this,
|
|
80
|
-
i(this,
|
|
81
|
-
i(this,
|
|
82
|
-
i(this,
|
|
79
|
+
i(this, M, null);
|
|
80
|
+
i(this, R);
|
|
81
|
+
i(this, S, null);
|
|
82
|
+
i(this, z);
|
|
83
83
|
i(this, H, (e) => {
|
|
84
84
|
const o = e[0];
|
|
85
|
-
t(this, p) && (!t(this,
|
|
85
|
+
t(this, p) && (!t(this, w) || this.hasAttribute("reload-source")) && o.isIntersecting && this.triggerLazyLoad(), o.isIntersecting ? D(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (U(this, $, F).call(this, void 0), s(this, w, !1)), D(this, "sourceRelease", { custom: !0 }));
|
|
86
86
|
});
|
|
87
|
-
i(this,
|
|
88
|
-
t(this,
|
|
87
|
+
i(this, v, () => {
|
|
88
|
+
t(this, c).set("loaded", !0), t(this, c).set("error", !1), t(this, c).set("loading", !1), !t(this, p) && !t(this, y) && K.complete(t(this, A)), D(this, "sourceLoaded", { custom: !0 });
|
|
89
89
|
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
90
|
-
e ? s(this,
|
|
91
|
-
t(this,
|
|
92
|
-
}, parseFloat(e) * 1e3)) : t(this,
|
|
90
|
+
e ? s(this, R, setTimeout(() => {
|
|
91
|
+
t(this, c).set("clear", !0);
|
|
92
|
+
}, parseFloat(e) * 1e3)) : t(this, c).set("clear", !0), s(this, y, !0);
|
|
93
93
|
});
|
|
94
94
|
i(this, j, (e) => {
|
|
95
|
-
t(this,
|
|
95
|
+
t(this, c).set("loaded", !1), t(this, c).set("error", !0), t(this, c).set("loading", !1), !t(this, p) && !t(this, y) && K.error(t(this, A)), D(this, "sourceError", { custom: !0 }), s(this, y, !0);
|
|
96
96
|
});
|
|
97
|
-
s(this,
|
|
97
|
+
s(this, z, e == null ? void 0 : e.sourceSetOptions), X && window.IntersectionObserver && s(this, M, new IntersectionObserver(
|
|
98
98
|
t(this, H)
|
|
99
99
|
));
|
|
100
100
|
}
|
|
@@ -105,109 +105,112 @@ class ft extends HTMLElement {
|
|
|
105
105
|
return t(this, m);
|
|
106
106
|
}
|
|
107
107
|
get status() {
|
|
108
|
-
return t(this,
|
|
108
|
+
return t(this, c);
|
|
109
109
|
}
|
|
110
110
|
get isLazy() {
|
|
111
111
|
return t(this, p);
|
|
112
112
|
}
|
|
113
113
|
get currentURL() {
|
|
114
|
-
return t(this,
|
|
114
|
+
return t(this, S);
|
|
115
115
|
}
|
|
116
116
|
get isFirstLoadHappened() {
|
|
117
117
|
return t(this, y);
|
|
118
118
|
}
|
|
119
119
|
triggerLazyLoad() {
|
|
120
|
-
!t(this,
|
|
120
|
+
!t(this, w) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, w, !0), U(this, $, F).call(this, t(this, m).current));
|
|
121
121
|
}
|
|
122
122
|
connectedCallback() {
|
|
123
|
-
s(this,
|
|
123
|
+
s(this, V, `source-consumer-${++it}`);
|
|
124
124
|
const e = this.getAttribute("srcset") || "", o = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
125
|
-
o && t(this,
|
|
125
|
+
o && t(this, c).addElement(o), s(this, a, this.createConsumer()), t(this, a).style.cssText = `
|
|
126
126
|
display: block;
|
|
127
127
|
width: 100%;
|
|
128
128
|
height: 100%;
|
|
129
129
|
`, t(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((d) => {
|
|
130
130
|
if (d.name !== "srcset") {
|
|
131
|
-
const
|
|
132
|
-
x in t(this, a) && (t(this, a)[x] =
|
|
131
|
+
const l = d.nodeValue || "", x = Y(d.name);
|
|
132
|
+
x in t(this, a) && (t(this, a)[x] = l || !0);
|
|
133
133
|
}
|
|
134
134
|
}), this.appendChild(t(this, a)), s(this, m, new rt({
|
|
135
135
|
srcset: e,
|
|
136
|
-
sourceSetOptions: t(this,
|
|
136
|
+
sourceSetOptions: t(this, z)
|
|
137
137
|
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
138
|
-
(!t(this, p) || t(this, p) && t(this,
|
|
139
|
-
}), t(this, m).connect(), t(this,
|
|
138
|
+
(!t(this, p) || t(this, p) && t(this, w)) && U(this, $, F).call(this, d.current);
|
|
139
|
+
}), t(this, m).connect(), t(this, M).observe(this);
|
|
140
140
|
}
|
|
141
141
|
disconnectedCallback() {
|
|
142
142
|
var e;
|
|
143
|
-
clearTimeout(t(this,
|
|
143
|
+
clearTimeout(t(this, R)), t(this, M).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this, w, !1), t(this, c).reset();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(),
|
|
147
|
-
if (clearTimeout(t(this,
|
|
148
|
-
s(this, A, `${t(this,
|
|
146
|
+
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(), w = new WeakMap(), p = new WeakMap(), V = new WeakMap(), A = new WeakMap(), c = new WeakMap(), M = new WeakMap(), R = new WeakMap(), S = new WeakMap(), z = new WeakMap(), $ = new WeakSet(), F = function(e) {
|
|
147
|
+
if (clearTimeout(t(this, R)), t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, c).set("loaded", !1), t(this, c).set("error", !1), t(this, c).set("loading", !1), t(this, c).set("clear", !1), e) {
|
|
148
|
+
s(this, A, `${t(this, V)}-${e.url}`);
|
|
149
149
|
const o = this.hasAttribute("keep-source-parameters");
|
|
150
|
-
t(this,
|
|
151
|
-
t(this,
|
|
150
|
+
t(this, c).set("loading", !0), s(this, S, o ? e.url : e.name + e.extension), this.consumeSource(t(this, S)), !t(this, p) && !t(this, y) && K.add(t(this, A)), t(this, a).onloadeddata = () => {
|
|
151
|
+
t(this, v).call(this);
|
|
152
152
|
}, t(this, a).onload = () => {
|
|
153
|
-
t(this,
|
|
153
|
+
t(this, v).call(this);
|
|
154
154
|
}, t(this, a).onerror = () => {
|
|
155
|
-
t(this, j).call(this, t(this,
|
|
155
|
+
t(this, j).call(this, t(this, S));
|
|
156
156
|
};
|
|
157
157
|
} else
|
|
158
|
-
s(this,
|
|
159
|
-
}, H = new WeakMap(),
|
|
160
|
-
var
|
|
161
|
-
class
|
|
158
|
+
s(this, S, null), this.consumeSource(null);
|
|
159
|
+
}, H = new WeakMap(), v = new WeakMap(), j = new WeakMap();
|
|
160
|
+
var q;
|
|
161
|
+
class J {
|
|
162
162
|
constructor(r, e) {
|
|
163
|
-
i(this,
|
|
164
|
-
s(this,
|
|
165
|
-
const o = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof r == "string" ? o ? r.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [r] : r,
|
|
163
|
+
i(this, q);
|
|
164
|
+
s(this, q, /* @__PURE__ */ new Map());
|
|
165
|
+
const o = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof r == "string" ? o ? r.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [r] : r, l = [];
|
|
166
166
|
d.forEach((h) => {
|
|
167
|
-
const b = new
|
|
168
|
-
|
|
167
|
+
const b = new st(h);
|
|
168
|
+
l.push([b.query, b]);
|
|
169
169
|
});
|
|
170
|
-
const x =
|
|
170
|
+
const x = l.filter((h) => h[1].queryType.includes("max")).sort((h, b) => b[1].queryValue - h[1].queryValue), B = l.filter((h) => h[1].queryType.includes("min") && h[1].queryValue !== 0).sort((h, b) => h[1].queryValue - b[1].queryValue), P = l.filter((h) => h[0] === "(min-width: 0px)");
|
|
171
171
|
(P ? [...P, ...x, ...B] : [...x, ...B]).forEach((h) => {
|
|
172
|
-
t(this,
|
|
172
|
+
t(this, q).has(h[0]) || t(this, q).set(h[0], []), t(this, q).get(h[0]).push(h[1]);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
get mediaBuckets() {
|
|
176
|
-
return t(this,
|
|
176
|
+
return t(this, q);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
var
|
|
181
|
-
class rt extends
|
|
179
|
+
q = new WeakMap();
|
|
180
|
+
var T, I;
|
|
181
|
+
class rt extends et {
|
|
182
182
|
constructor(e) {
|
|
183
183
|
super(void 0);
|
|
184
|
-
i(this,
|
|
185
|
-
i(this,
|
|
184
|
+
i(this, T);
|
|
185
|
+
i(this, I, () => {
|
|
186
186
|
let e;
|
|
187
|
-
t(this,
|
|
188
|
-
matchMedia(x).matches && (e =
|
|
187
|
+
t(this, T).mediaBuckets.forEach((l, x) => {
|
|
188
|
+
matchMedia(x).matches && (e = l);
|
|
189
189
|
});
|
|
190
190
|
let o, d = 0;
|
|
191
|
-
e == null || e.forEach((
|
|
192
|
-
|
|
191
|
+
e == null || e.forEach((l) => {
|
|
192
|
+
l.density > d && l.density <= Math.max(devicePixelRatio, 1) && (d = l.density, o = l);
|
|
193
193
|
}), e != null && e.length && !o && (o = e[0]), this.current = o;
|
|
194
194
|
});
|
|
195
|
-
s(this,
|
|
195
|
+
s(this, T, new J(e.srcset, e.sourceSetOptions));
|
|
196
|
+
}
|
|
197
|
+
updateSource(e) {
|
|
198
|
+
s(this, T, new J(e.srcset, e.sourceSetOptions)), t(this, I).call(this);
|
|
196
199
|
}
|
|
197
200
|
close() {
|
|
198
201
|
super.close(), this.disconnect();
|
|
199
202
|
}
|
|
200
203
|
connect() {
|
|
201
|
-
Z.subscribe(t(this,
|
|
204
|
+
Z.subscribe(t(this, I), tt.SOURCE_MANAGER), t(this, I).call(this);
|
|
202
205
|
}
|
|
203
206
|
disconnect() {
|
|
204
|
-
Z.unsubscribe(t(this,
|
|
207
|
+
Z.unsubscribe(t(this, I));
|
|
205
208
|
}
|
|
206
209
|
}
|
|
207
|
-
|
|
210
|
+
T = new WeakMap(), I = new WeakMap();
|
|
208
211
|
export {
|
|
209
|
-
|
|
212
|
+
st as Source,
|
|
210
213
|
ft as SourceElement,
|
|
211
214
|
rt as SourceManager,
|
|
212
|
-
|
|
215
|
+
J as SourceSet
|
|
213
216
|
};
|
|
@@ -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;
|