aptechka 0.1.11 → 0.1.14
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/animation/Tweened.d.ts +0 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +7 -10
- package/lib/morph/Morph.d.ts +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +120 -108
- package/lib/utils/cssom.d.ts +5 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +97 -85
- package/package.json +1 -1
|
@@ -10,7 +10,6 @@ export declare class Tweened extends Animated {
|
|
|
10
10
|
start(): void;
|
|
11
11
|
pause(): void;
|
|
12
12
|
stop(): void;
|
|
13
|
-
get max(): import("../store").Store<number, keyof import("../store").StoreManagers, import("../store").StoreEntry<number>>;
|
|
14
13
|
protected update(): void;
|
|
15
14
|
protected handleAnimationFrame(e: TickerCallbackEntry): void;
|
|
16
15
|
}
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.defineProperty,c=Object.defineProperties;var l=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var i=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))g.call(t,e)&&i(a,e,t[e]);if(r)for(var e of r(t))A.call(t,e)&&i(a,e,t[e]);return a},s=(a,t)=>c(a,l(t));var m=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Animated-Bf-gPIQM.cjs"),F=require("../easings-DsS5-Kqc.cjs"),f=require("../Damped-BwpMU9Gi.cjs");class q extends d.Animated{constructor(e){super(s(n({},e),{min:(e==null?void 0:e.min)||0,max:(e==null?void 0:e.max)||1e3}));m(this,"easing");this.easing=(e==null?void 0:e.easing)||F.linear}start(){this.listenAnimationFrame()}pause(){this.unlistenAnimationFrame()}stop(){this.reset()}update(){const e=(this.target-this.min.current)/(this.delta||1),h=this.easing(e);this.current=this.min.current+h*this.delta}handleAnimationFrame(e){this.shift(e.elapsed),(e.elapsed&&this.current===0||this.current===this.delta)&&this.unlistenAnimationFrame()}}exports.Animated=d.Animated;exports.Damped=f.Damped;exports.Tweened=q;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var d = Object.defineProperty, l = Object.defineProperties;
|
|
2
2
|
var u = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var c = Object.prototype.hasOwnProperty,
|
|
4
|
+
var c = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var r = (a, t, e) => t in a ? d(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, s = (a, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
7
|
c.call(t, e) && r(a, e, t[e]);
|
|
8
8
|
if (i)
|
|
9
9
|
for (var e of i(t))
|
|
10
|
-
|
|
10
|
+
A.call(t, e) && r(a, e, t[e]);
|
|
11
11
|
return a;
|
|
12
12
|
}, m = (a, t) => l(a, u(t));
|
|
13
13
|
var n = (a, t, e) => (r(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
-
import { A as
|
|
15
|
-
import { l as
|
|
14
|
+
import { A as f } from "../Animated-Br_4OSth.js";
|
|
15
|
+
import { l as g } from "../easings-BKi40vHz.js";
|
|
16
16
|
import { D as b } from "../Damped-urvryQLo.js";
|
|
17
|
-
class w extends
|
|
17
|
+
class w extends f {
|
|
18
18
|
constructor(e) {
|
|
19
19
|
super(m(s({}, e), {
|
|
20
20
|
min: (e == null ? void 0 : e.min) || 0,
|
|
21
21
|
max: (e == null ? void 0 : e.max) || 1e3
|
|
22
22
|
}));
|
|
23
23
|
n(this, "easing");
|
|
24
|
-
this.easing = (e == null ? void 0 : e.easing) ||
|
|
24
|
+
this.easing = (e == null ? void 0 : e.easing) || g;
|
|
25
25
|
}
|
|
26
26
|
start() {
|
|
27
27
|
this.listenAnimationFrame();
|
|
@@ -32,9 +32,6 @@ class w extends g {
|
|
|
32
32
|
stop() {
|
|
33
33
|
this.reset();
|
|
34
34
|
}
|
|
35
|
-
get max() {
|
|
36
|
-
return super.max;
|
|
37
|
-
}
|
|
38
35
|
update() {
|
|
39
36
|
const e = (this.target - this.min.current) / (this.delta || 1), h = this.easing(e);
|
|
40
37
|
this.current = this.min.current + h * this.delta;
|
|
@@ -44,7 +41,7 @@ class w extends g {
|
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
export {
|
|
47
|
-
|
|
44
|
+
f as Animated,
|
|
48
45
|
b as Damped,
|
|
49
46
|
w as Tweened
|
|
50
47
|
};
|
package/lib/morph/Morph.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export declare class Morph {
|
|
|
22
22
|
constructor(parameters?: MorphParameters);
|
|
23
23
|
beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
|
|
24
24
|
afterNavigationEvent(callback: MorphNavigationCallback): () => void;
|
|
25
|
+
prefetch(pathname: string): Promise<Document>;
|
|
25
26
|
navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
|
|
26
27
|
}
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var nt=Object.defineProperty;var V=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s);var ot=(s,t,e)=>t in s?nt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var _=(s,t,e)=>(ot(s,typeof t!="symbol"?t+"":t,e),e),m=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var i=(s,t,e)=>(m(s,t,"read from private field"),e?e.call(s):t.get(s)),n=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},r=(s,t,e,o)=>(m(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);var f=(s,t,e)=>(m(s,t,"access private method"),e);var T=(s,t,e)=>new Promise((o,c)=>{var l=u=>{try{g(e.next(u))}catch(v){c(v)}},y=u=>{try{g(e.throw(u))}catch(v){c(v)}},g=u=>u.done?o(u.value):Promise.resolve(u.value).then(l,y);g((e=e.apply(s,t)).next())});var X=(s,t,e)=>(t=s[V("asyncIterator")])?t.call(s):(s=s[V("iterator")](),t={},e=(o,c)=>(c=s[o])&&(t[o]=l=>new Promise((y,g,u)=>(l=c.call(s,l),u=l.done,Promise.resolve(l.value).then(v=>y({value:v,done:u}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("../notifier/index.cjs"),rt=require("../browser-CpzFX2xg.cjs");var M,d,w,N,P,S;class ht{constructor(t,e){n(this,M,void 0);n(this,d,void 0);n(this,w,void 0);n(this,N,void 0);n(this,P,t=>{t.preventDefault(),i(this,M).navigate(i(this,w),i(this,N))});n(this,S,()=>{i(this,M).prefetch(i(this,w))});r(this,M,e),r(this,d,t),r(this,w,i(this,d).getAttribute("href")||"/"),r(this,N,i(this,d).getAttribute("data-history-action")||"push"),i(this,d).addEventListener("click",i(this,P)),i(this,w)===location.pathname&&i(this,d).classList.add("current"),i(this,d).hasAttribute("data-prefetch")&&i(this,d).addEventListener("pointerenter",i(this,S))}destroy(){i(this,d).removeEventListener("click",i(this,P)),i(this,d).removeEventListener("pointerenter",i(this,S)),i(this,d).classList.remove("current")}}M=new WeakMap,d=new WeakMap,w=new WeakMap,N=new WeakMap,P=new WeakMap,S=new WeakMap;var a,k,A,C,x,j,E,L,H,D,q,R,z,p,$,W,G,F,J,B,tt,O,Q,K;class ct{constructor(t){n(this,R);n(this,p);n(this,W);n(this,F);n(this,B);n(this,O);n(this,a,null);n(this,k,null);n(this,A,null);n(this,C,null);n(this,x,[]);n(this,j,new DOMParser);n(this,E,new Map);n(this,L,void 0);n(this,H,null);_(this,"preprocessor");_(this,"postprocessor");n(this,D,new Z.Notifier);n(this,q,new Z.Notifier);n(this,K,t=>{t.state&&this.navigate(t.state,"none")});rt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,i(this,a)+"/")):r(this,a,"/"),r(this,k,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,A,(t==null?void 0:t.cachePages)!==!1),r(this,C,f(this,F,J).call(this,document)),r(this,H,location.pathname),f(this,W,G).call(this),addEventListener("popstate",i(this,K)))}beforeNavigationEvent(t){return i(this,D).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){return f(this,R,z).call(this,t)})}navigate(t,e="push"){return T(this,null,function*(){var c;if(t=f(this,p,$).call(this,t),i(this,L)===t||i(this,H)===t)return;r(this,L,t);const o=i(this,E).has(t);try{let l=!0;if(this.preprocessor)try{yield new Promise((h,b)=>{var I;(I=this.preprocessor)==null||I.call(this,{pathname:t,resolve:h,reject:b,isCached:o})})}catch(h){h?console.error(h):console.log("Route change canceled"),l=!1}if(i(this,D).notify({pathname:t,isCached:o}),!l||i(this,L)!==t)return;const y=i(this,E).get(t)||(yield f(this,R,z).call(this,t));if(i(this,L)!==t)return;const g=Array.from(document.head.children),u=Array.from(y.head.cloneNode(!0).children),v=f(this,B,tt).call(this,g,u),et=f(this,O,Q).call(this,g,v),U=f(this,O,Q).call(this,u,v);et.forEach(h=>h.remove()),U.forEach(h=>document.head.appendChild(h));const Y=U.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,k)&&Y.length&&(yield new Promise(h=>T(this,null,function*(){let b=0;try{for(var I=X(Y),dt,ft,at;dt=!(ft=yield I.next()).done;dt=!1){const st=ft.value;st.onload=()=>{b++,b===Y.length&&h()}}}catch(ft){at=[ft]}finally{try{dt&&(ft=I.return)&&(yield ft.call(I))}finally{if(at)throw at[0]}}})));const it=f(this,F,J).call(this,y);i(this,C).forEach((h,b)=>{const I=it[b];h.innerHTML=I.innerHTML}),r(this,H,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),f(this,W,G).call(this),(c=this.postprocessor)==null||c.call(this,{pathname:t,isCached:o}),i(this,q).notify({pathname:t,isCached:o})}catch(l){console.error(l)}r(this,L,void 0)})}}a=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,x=new WeakMap,j=new WeakMap,E=new WeakMap,L=new WeakMap,H=new WeakMap,D=new WeakMap,q=new WeakMap,R=new WeakSet,z=function(t){return T(this,null,function*(){const e=i(this,E).get(t);if(e)return e;const c=yield(yield fetch(t)).text(),l=i(this,j).parseFromString(c,"text/html");return i(this,A)&&i(this,E).set(t,l),l})},p=new WeakSet,$=function(t){return t=t.replace(i(this,a),""),t.startsWith("/")&&(t=t.slice(1)),i(this,a)+t},W=new WeakSet,G=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var o;return(o=e.getAttribute("href"))==null?void 0:o.startsWith("/")});i(this,x).forEach(e=>e.destroy()),r(this,x,t.map(e=>new ht(e,this)))},F=new WeakSet,J=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},B=new WeakSet,tt=function(t,e){return t.filter(o=>e.find(c=>c.outerHTML===o.outerHTML))},O=new WeakSet,Q=function(t,e){return t.filter(o=>!e.find(c=>c.outerHTML===o.outerHTML))},K=new WeakMap;exports.Morph=ct;
|
package/lib/morph/index.js
CHANGED
|
@@ -1,179 +1,191 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var j = (
|
|
5
|
-
if (!t.has(
|
|
1
|
+
var ot = Object.defineProperty;
|
|
2
|
+
var X = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s);
|
|
3
|
+
var nt = (s, t, e) => t in s ? ot(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
4
|
+
var j = (s, t, e) => (nt(s, typeof t != "symbol" ? t + "" : t, e), e), z = (s, t, e) => {
|
|
5
|
+
if (!t.has(s))
|
|
6
6
|
throw TypeError("Cannot " + e);
|
|
7
7
|
};
|
|
8
|
-
var
|
|
9
|
-
if (t.has(
|
|
8
|
+
var i = (s, t, e) => (z(s, t, "read from private field"), e ? e.call(s) : t.get(s)), o = (s, t, e) => {
|
|
9
|
+
if (t.has(s))
|
|
10
10
|
throw TypeError("Cannot add the same private member more than once");
|
|
11
|
-
t instanceof WeakSet ? t.add(
|
|
12
|
-
}, r = (
|
|
13
|
-
var d = (
|
|
14
|
-
var
|
|
15
|
-
var
|
|
11
|
+
t instanceof WeakSet ? t.add(s) : t.set(s, e);
|
|
12
|
+
}, r = (s, t, e, n) => (z(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e);
|
|
13
|
+
var d = (s, t, e) => (z(s, t, "access private method"), e);
|
|
14
|
+
var T = (s, t, e) => new Promise((n, c) => {
|
|
15
|
+
var l = (f) => {
|
|
16
16
|
try {
|
|
17
|
-
g(e.next(
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
g(e.next(f));
|
|
18
|
+
} catch (L) {
|
|
19
|
+
c(L);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, y = (f) => {
|
|
22
22
|
try {
|
|
23
|
-
g(e.throw(
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
g(e.throw(f));
|
|
24
|
+
} catch (L) {
|
|
25
|
+
c(L);
|
|
26
26
|
}
|
|
27
|
-
}, g = (
|
|
28
|
-
g((e = e.apply(
|
|
27
|
+
}, g = (f) => f.done ? n(f.value) : Promise.resolve(f.value).then(l, y);
|
|
28
|
+
g((e = e.apply(s, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
31
|
-
import { Notifier as
|
|
32
|
-
import { i as
|
|
33
|
-
var
|
|
34
|
-
class
|
|
30
|
+
var Z = (s, t, e) => (t = s[X("asyncIterator")]) ? t.call(s) : (s = s[X("iterator")](), t = {}, e = (n, c) => (c = s[n]) && (t[n] = (l) => new Promise((y, g, f) => (l = c.call(s, l), f = l.done, Promise.resolve(l.value).then((L) => y({ value: L, done: f }), g)))), e("next"), e("return"), t);
|
|
31
|
+
import { Notifier as _ } from "../notifier/index.js";
|
|
32
|
+
import { i as rt } from "../browser-0zX67oeU.js";
|
|
33
|
+
var H, u, E, N, P, S;
|
|
34
|
+
class ht {
|
|
35
35
|
constructor(t, e) {
|
|
36
|
-
o(this,
|
|
37
|
-
o(this,
|
|
38
|
-
o(this,
|
|
39
|
-
o(this,
|
|
40
|
-
o(this,
|
|
41
|
-
t.preventDefault(),
|
|
36
|
+
o(this, H, void 0);
|
|
37
|
+
o(this, u, void 0);
|
|
38
|
+
o(this, E, void 0);
|
|
39
|
+
o(this, N, void 0);
|
|
40
|
+
o(this, P, (t) => {
|
|
41
|
+
t.preventDefault(), i(this, H).navigate(i(this, E), i(this, N));
|
|
42
|
+
});
|
|
43
|
+
o(this, S, () => {
|
|
44
|
+
i(this, H).prefetch(i(this, E));
|
|
42
45
|
});
|
|
43
|
-
r(this,
|
|
46
|
+
r(this, H, e), r(this, u, t), r(this, E, i(this, u).getAttribute("href") || "/"), r(this, N, i(this, u).getAttribute(
|
|
47
|
+
"data-history-action"
|
|
48
|
+
) || "push"), i(this, u).addEventListener("click", i(this, P)), i(this, E) === location.pathname && i(this, u).classList.add("current"), i(this, u).hasAttribute("data-prefetch") && i(this, u).addEventListener("pointerenter", i(this, S));
|
|
44
49
|
}
|
|
45
50
|
destroy() {
|
|
46
|
-
|
|
51
|
+
i(this, u).removeEventListener("click", i(this, P)), i(this, u).removeEventListener("pointerenter", i(this, S)), i(this, u).classList.remove("current");
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
var a,
|
|
54
|
+
H = new WeakMap(), u = new WeakMap(), E = new WeakMap(), N = new WeakMap(), P = new WeakMap(), S = new WeakMap();
|
|
55
|
+
var a, k, A, C, x, I, w, v, M, D, R, W, G, O, $, m, J, F, Q, B, tt, p, U, K;
|
|
51
56
|
class ut {
|
|
52
57
|
constructor(t) {
|
|
53
|
-
o(this,
|
|
58
|
+
o(this, W);
|
|
54
59
|
o(this, O);
|
|
55
|
-
o(this, D);
|
|
56
60
|
o(this, m);
|
|
61
|
+
o(this, F);
|
|
57
62
|
o(this, B);
|
|
58
|
-
o(this,
|
|
63
|
+
o(this, p);
|
|
59
64
|
o(this, a, null);
|
|
60
|
-
o(this, P, null);
|
|
61
|
-
o(this, S, null);
|
|
62
65
|
o(this, k, null);
|
|
63
|
-
o(this,
|
|
64
|
-
o(this,
|
|
65
|
-
o(this,
|
|
66
|
-
o(this,
|
|
67
|
-
o(this,
|
|
66
|
+
o(this, A, null);
|
|
67
|
+
o(this, C, null);
|
|
68
|
+
o(this, x, []);
|
|
69
|
+
o(this, I, new DOMParser());
|
|
70
|
+
o(this, w, /* @__PURE__ */ new Map());
|
|
71
|
+
o(this, v, void 0);
|
|
72
|
+
o(this, M, null);
|
|
68
73
|
j(this, "preprocessor");
|
|
69
74
|
j(this, "postprocessor");
|
|
70
|
-
o(this,
|
|
71
|
-
o(this,
|
|
75
|
+
o(this, D, new _());
|
|
76
|
+
o(this, R, new _());
|
|
72
77
|
o(this, K, (t) => {
|
|
73
78
|
t.state && this.navigate(t.state, "none");
|
|
74
79
|
});
|
|
75
|
-
|
|
80
|
+
rt && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, i(this, a) + "/")) : r(this, a, "/"), r(this, k, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, A, (t == null ? void 0 : t.cachePages) !== !1), r(this, C, d(this, F, Q).call(this, document)), r(this, M, location.pathname), d(this, m, J).call(this), addEventListener("popstate", i(this, K)));
|
|
76
81
|
}
|
|
77
82
|
beforeNavigationEvent(t) {
|
|
78
|
-
return
|
|
83
|
+
return i(this, D).subscribe(t);
|
|
79
84
|
}
|
|
80
85
|
afterNavigationEvent(t) {
|
|
81
|
-
return
|
|
86
|
+
return i(this, R).subscribe(t);
|
|
87
|
+
}
|
|
88
|
+
prefetch(t) {
|
|
89
|
+
return T(this, null, function* () {
|
|
90
|
+
return d(this, W, G).call(this, t);
|
|
91
|
+
});
|
|
82
92
|
}
|
|
83
93
|
navigate(t, e = "push") {
|
|
84
|
-
return
|
|
85
|
-
var
|
|
86
|
-
if (t = d(this, O, $).call(this, t),
|
|
94
|
+
return T(this, null, function* () {
|
|
95
|
+
var c;
|
|
96
|
+
if (t = d(this, O, $).call(this, t), i(this, v) === t || i(this, M) === t)
|
|
87
97
|
return;
|
|
88
|
-
r(this,
|
|
89
|
-
const n =
|
|
98
|
+
r(this, v, t);
|
|
99
|
+
const n = i(this, w).has(t);
|
|
90
100
|
try {
|
|
91
|
-
let
|
|
101
|
+
let l = !0;
|
|
92
102
|
if (this.preprocessor)
|
|
93
103
|
try {
|
|
94
|
-
yield new Promise((
|
|
95
|
-
var
|
|
96
|
-
(
|
|
104
|
+
yield new Promise((h, b) => {
|
|
105
|
+
var q;
|
|
106
|
+
(q = this.preprocessor) == null || q.call(this, { pathname: t, resolve: h, reject: b, isCached: n });
|
|
97
107
|
});
|
|
98
|
-
} catch (
|
|
99
|
-
|
|
108
|
+
} catch (h) {
|
|
109
|
+
h ? console.error(h) : console.log("Route change canceled"), l = !1;
|
|
100
110
|
}
|
|
101
|
-
if (
|
|
111
|
+
if (i(this, D).notify({
|
|
102
112
|
pathname: t,
|
|
103
113
|
isCached: n
|
|
104
|
-
}), !
|
|
114
|
+
}), !l || i(this, v) !== t)
|
|
105
115
|
return;
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
116
|
+
const y = i(this, w).get(t) || (yield d(this, W, G).call(this, t));
|
|
117
|
+
if (i(this, v) !== t)
|
|
108
118
|
return;
|
|
109
|
-
const g = Array.from(document.head.children),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
const g = Array.from(document.head.children), f = Array.from(
|
|
120
|
+
y.head.cloneNode(!0).children
|
|
121
|
+
), L = d(this, B, tt).call(this, g, f), et = d(this, p, U).call(this, g, L), V = d(this, p, U).call(this, f, L);
|
|
122
|
+
et.forEach((h) => h.remove()), V.forEach((h) => document.head.appendChild(h));
|
|
123
|
+
const Y = V.filter(
|
|
124
|
+
(h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
|
|
113
125
|
);
|
|
114
|
-
|
|
115
|
-
let
|
|
126
|
+
i(this, k) && Y.length && (yield new Promise((h) => T(this, null, function* () {
|
|
127
|
+
let b = 0;
|
|
116
128
|
try {
|
|
117
|
-
for (var
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
for (var q = Z(Y), gt, Lt, vt; gt = !(Lt = yield q.next()).done; gt = !1) {
|
|
130
|
+
const st = Lt.value;
|
|
131
|
+
st.onload = () => {
|
|
132
|
+
b++, b === Y.length && h();
|
|
121
133
|
};
|
|
122
134
|
}
|
|
123
|
-
} catch (
|
|
124
|
-
|
|
135
|
+
} catch (Lt) {
|
|
136
|
+
vt = [Lt];
|
|
125
137
|
} finally {
|
|
126
138
|
try {
|
|
127
|
-
|
|
139
|
+
gt && (Lt = q.return) && (yield Lt.call(q));
|
|
128
140
|
} finally {
|
|
129
|
-
if (
|
|
130
|
-
throw
|
|
141
|
+
if (vt)
|
|
142
|
+
throw vt[0];
|
|
131
143
|
}
|
|
132
144
|
}
|
|
133
145
|
})));
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}), r(this,
|
|
139
|
-
} catch (
|
|
140
|
-
console.error(
|
|
146
|
+
const it = d(this, F, Q).call(this, y);
|
|
147
|
+
i(this, C).forEach((h, b) => {
|
|
148
|
+
const q = it[b];
|
|
149
|
+
h.innerHTML = q.innerHTML;
|
|
150
|
+
}), r(this, M, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, m, J).call(this), (c = this.postprocessor) == null || c.call(this, { pathname: t, isCached: n }), i(this, R).notify({ pathname: t, isCached: n });
|
|
151
|
+
} catch (l) {
|
|
152
|
+
console.error(l);
|
|
141
153
|
}
|
|
142
|
-
r(this,
|
|
154
|
+
r(this, v, void 0);
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
|
-
a = new WeakMap(),
|
|
147
|
-
return
|
|
148
|
-
const e =
|
|
158
|
+
a = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), x = new WeakMap(), I = new WeakMap(), w = new WeakMap(), v = new WeakMap(), M = new WeakMap(), D = new WeakMap(), R = new WeakMap(), W = new WeakSet(), G = function(t) {
|
|
159
|
+
return T(this, null, function* () {
|
|
160
|
+
const e = i(this, w).get(t);
|
|
149
161
|
if (e)
|
|
150
162
|
return e;
|
|
151
|
-
const
|
|
152
|
-
return
|
|
163
|
+
const c = yield (yield fetch(t)).text(), l = i(this, I).parseFromString(c, "text/html");
|
|
164
|
+
return i(this, A) && i(this, w).set(t, l), l;
|
|
153
165
|
});
|
|
154
166
|
}, O = new WeakSet(), $ = function(t) {
|
|
155
|
-
return t = t.replace(
|
|
156
|
-
},
|
|
157
|
-
const t = [
|
|
158
|
-
(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
},
|
|
167
|
+
return t = t.replace(i(this, a), ""), t.startsWith("/") && (t = t.slice(1)), i(this, a) + t;
|
|
168
|
+
}, m = new WeakSet(), J = function() {
|
|
169
|
+
const t = [
|
|
170
|
+
...document.documentElement.querySelectorAll("a")
|
|
171
|
+
].filter((e) => {
|
|
172
|
+
var n;
|
|
173
|
+
return (n = e.getAttribute("href")) == null ? void 0 : n.startsWith("/");
|
|
174
|
+
});
|
|
175
|
+
i(this, x).forEach((e) => e.destroy()), r(this, x, t.map((e) => new ht(e, this)));
|
|
176
|
+
}, F = new WeakSet(), Q = function(t) {
|
|
165
177
|
const e = t.querySelectorAll("[data-morph]");
|
|
166
178
|
return e.length ? [...e] : [t.body];
|
|
167
|
-
}, B = new WeakSet(),
|
|
179
|
+
}, B = new WeakSet(), tt = function(t, e) {
|
|
168
180
|
return t.filter(
|
|
169
181
|
(n) => e.find(
|
|
170
|
-
(
|
|
182
|
+
(c) => c.outerHTML === n.outerHTML
|
|
171
183
|
)
|
|
172
184
|
);
|
|
173
|
-
},
|
|
185
|
+
}, p = new WeakSet(), U = function(t, e) {
|
|
174
186
|
return t.filter(
|
|
175
187
|
(n) => !e.find(
|
|
176
|
-
(
|
|
188
|
+
(c) => c.outerHTML === n.outerHTML
|
|
177
189
|
)
|
|
178
190
|
);
|
|
179
191
|
}, K = new WeakMap();
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),x=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs"),a=require("../easings-DsS5-Kqc.cjs"),y=require("../events-Crwi8fz6.cjs"),E=require("../file-EevnUtRj.cjs"),g=require("../function-MthRj-GJ.cjs"),h=require("../layout-8ryRAMGJ.cjs"),o=require("../math-GDWEqu7y.cjs"),f=require("../number-yVpzMdbQ.cjs"),u=require("../object-C1ph624j.cjs"),l=require("../string-vBu90jhV.cjs"),O=require("../style-At6aDoqG.cjs");function I(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function S(t,e){const n=t.measureText(e),i=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent,s=n.width;return{height:i,width:s}}function w(t){return Math.floor(t)+.5}function Q(t,e,n,i,s,r){let m=t/e,C=n/i,c=0,d=0;return s=typeof s=="undefined"?.5:s,r=typeof r=="undefined"?.5:r,m>C?(c=i,d=i*m):(d=n,c=n/m),[(n-d)*s,(i-c)*r,d,c]}function T(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function v(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function D(t,e,n=!1){let i=t.x-e.width/2,s=e.height/2-t.y;return n&&(i=i/(e.width/2),s=s/(e.height/2)),{x:i,y:s}}function P(t,e){const n=t.x/e.x,i=t.y/e.y;return{x:n,y:i}}function q(t,e){return e=e||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-e.x)/e.width*e.width,y:(t.y-e.y)/e.height*e.height}}function R(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(i=>{i instanceof CSSStyleRule&&i.selectorText===":root"&&t.forEach(s=>{const r=i.styleMap.get(s);r?e[s]=r.toString():console.warn(`variable named ${s} not found`)})})}),e}function A(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function N(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=x.isBrowser;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getElement=p.getElement;exports.easeInCubic=a.easeInCubic;exports.easeInExpo=a.easeInExpo;exports.easeInOutCubic=a.easeInOutCubic;exports.easeInOutExpo=a.easeInOutExpo;exports.easeInOutQuad=a.easeInOutQuad;exports.easeInOutQuart=a.easeInOutQuart;exports.easeInOutQuint=a.easeInOutQuint;exports.easeInQuad=a.easeInQuad;exports.easeInQuart=a.easeInQuart;exports.easeInQuint=a.easeInQuint;exports.easeOutCubic=a.easeOutCubic;exports.easeOutExpo=a.easeOutExpo;exports.easeOutQuad=a.easeOutQuad;exports.easeOutQuart=a.easeOutQuart;exports.easeOutQuint=a.easeOutQuint;exports.linear=a.linear;exports.dispatchSizeChangeEvent=y.dispatchSizeChangeEvent;exports.createJSONAndSave=E.createJSONAndSave;exports.debounce=g.debounce;exports.throttle=g.throttle;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.calculateDistance=o.calculateDistance;exports.calculateDistanceWithRadius=o.calculateDistanceWithRadius;exports.clamp=o.clamp;exports.damp=o.damp;exports.lerp=o.lerp;exports.mapRange=o.mapRange;exports.round=o.round;exports.smootherstep=o.smootherstep;exports.smoothstep=o.smoothstep;exports.step=o.step;exports.preciseNumber=f.preciseNumber;exports.roundNumberTo=f.roundNumberTo;exports.cloneDeep=u.cloneDeep;exports.compareObjects=u.compareObjects;exports.isESClass=u.isESClass;exports.isNullish=u.isNullish;exports.isObject=u.isObject;exports.mergeDeep=u.mergeDeep;exports.omit=u.omit;exports.pick=u.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;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.cover=Q;exports.decode=N;exports.dotCircleCollision=v;exports.dotRectCollision=T;exports.encode=A;exports.fixPosition=w;exports.getPointerPosition=q;exports.getRootVariables=R;exports.insert=I;exports.measureText=S;exports.normalize=P;exports.screenToCartesian=D;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { isBrowser } from './browser';
|
|
|
4
4
|
export { measureText, fixPosition, cover } from './canvas';
|
|
5
5
|
export { dotRectCollision, dotCircleCollision } from './collisions';
|
|
6
6
|
export { screenToCartesian, normalize, getPointerPosition } from './coordinates';
|
|
7
|
+
export { getRootVariables } from './cssom';
|
|
7
8
|
export { encode, decode } from './decoding';
|
|
8
9
|
export { findParentElement, getElement, findScrollParentElement, type ElementOrSelector, } from './dom';
|
|
9
10
|
export { linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInExpo, easeOutExpo, easeInOutExpo, type EasingFunction, } from './easings';
|
package/lib/utils/index.js
CHANGED
|
@@ -1,139 +1,151 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as
|
|
3
|
-
import { f as
|
|
4
|
-
import { c as
|
|
1
|
+
import { a as S, p as I } from "../attributes-69we3byR.js";
|
|
2
|
+
import { i as Q } from "../browser-0zX67oeU.js";
|
|
3
|
+
import { f as D, a as T, g as P } from "../dom-BY7JhTx5.js";
|
|
4
|
+
import { c as k, n as B, f as M, p as N, b as j, i as z, m as U, e as V, g as q, j as J, d as K, o as $, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
|
|
5
5
|
import { d as Z } from "../events-_C2CztxR.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as
|
|
8
|
-
import { g as
|
|
9
|
-
import { e as
|
|
10
|
-
import { p as
|
|
11
|
-
import { c as
|
|
12
|
-
import { c as
|
|
13
|
-
import { g as ze, a as
|
|
14
|
-
function
|
|
15
|
-
return [...
|
|
6
|
+
import { c as H } from "../file-lxi_oXJf.js";
|
|
7
|
+
import { d as ee, t as te } from "../function-C10DGppn.js";
|
|
8
|
+
import { g as se, a as ne, b as oe } from "../layout-HoBT_Da2.js";
|
|
9
|
+
import { e as re, f as ue, c as le, d as ce, l as de, m as me, r as pe, b as fe, a as xe, s as he } from "../math-BOBiC4TN.js";
|
|
10
|
+
import { p as be, r as ye } from "../number-Bo5RdrA1.js";
|
|
11
|
+
import { c as Ce, d as Oe, i as Ee, b as Se, a as Ie, m as Re, o as Qe, p as ve } from "../object-DIPjdukP.js";
|
|
12
|
+
import { c as Te, a as Pe, g as Ae, k as ke, s as Be, t as Me, u as Ne } from "../string-3lAkpJJP.js";
|
|
13
|
+
import { g as ze, a as Ue } from "../style-j2TwriJ_.js";
|
|
14
|
+
function c(t, e, ...a) {
|
|
15
|
+
return [...t.slice(0, e), ...a, ...t.slice(e)];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
17
|
+
function d(t, e) {
|
|
18
|
+
const a = t.measureText(e), s = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent, n = a.width;
|
|
19
19
|
return {
|
|
20
20
|
height: s,
|
|
21
21
|
width: n
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function m(
|
|
25
|
-
return Math.floor(
|
|
24
|
+
function m(t) {
|
|
25
|
+
return Math.floor(t) + 0.5;
|
|
26
26
|
}
|
|
27
|
-
function p(
|
|
28
|
-
let
|
|
29
|
-
return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o,
|
|
30
|
-
(
|
|
27
|
+
function p(t, e, a, s, n, o) {
|
|
28
|
+
let u = t / e, l = a / s, i = 0, r = 0;
|
|
29
|
+
return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, u > l ? (i = s, r = s * u) : (r = a, i = a / u), [
|
|
30
|
+
(a - r) * n,
|
|
31
31
|
(s - i) * o,
|
|
32
|
-
|
|
32
|
+
r,
|
|
33
33
|
i
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function f(t, e) {
|
|
37
|
+
return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return Math.sqrt((
|
|
39
|
+
function x(t, e) {
|
|
40
|
+
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
|
|
41
41
|
}
|
|
42
|
-
function h(
|
|
43
|
-
let s =
|
|
44
|
-
return
|
|
42
|
+
function h(t, e, a = !1) {
|
|
43
|
+
let s = t.x - e.width / 2, n = e.height / 2 - t.y;
|
|
44
|
+
return a && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
|
|
45
45
|
}
|
|
46
|
-
function g(
|
|
47
|
-
const
|
|
48
|
-
return { x:
|
|
46
|
+
function g(t, e) {
|
|
47
|
+
const a = t.x / e.x, s = t.y / e.y;
|
|
48
|
+
return { x: a, y: s };
|
|
49
49
|
}
|
|
50
|
-
function b(
|
|
50
|
+
function b(t, e) {
|
|
51
51
|
return e = e || {
|
|
52
52
|
x: 0,
|
|
53
53
|
y: 0,
|
|
54
54
|
width: document.documentElement.offsetWidth,
|
|
55
55
|
height: innerHeight
|
|
56
56
|
}, {
|
|
57
|
-
x: (
|
|
58
|
-
y: (
|
|
57
|
+
x: (t.x - e.x) / e.width * e.width,
|
|
58
|
+
y: (t.y - e.y) / e.height * e.height
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const e =
|
|
61
|
+
function y(...t) {
|
|
62
|
+
const e = {};
|
|
63
|
+
return Array.from(document.styleSheets).forEach((a) => {
|
|
64
|
+
Array.from(a.cssRules).forEach((s) => {
|
|
65
|
+
s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((n) => {
|
|
66
|
+
const o = s.styleMap.get(n);
|
|
67
|
+
o ? e[n] = o.toString() : console.warn(`variable named ${n} not found`);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}), e;
|
|
71
|
+
}
|
|
72
|
+
function w(t) {
|
|
73
|
+
const e = window.atob(t);
|
|
63
74
|
return decodeURIComponent(window.escape(e));
|
|
64
75
|
}
|
|
65
|
-
function
|
|
66
|
-
const e = window.unescape(encodeURIComponent(
|
|
76
|
+
function C(t) {
|
|
77
|
+
const e = window.unescape(encodeURIComponent(t));
|
|
67
78
|
return window.btoa(e);
|
|
68
79
|
}
|
|
69
80
|
export {
|
|
70
|
-
|
|
81
|
+
re as calculateDistance,
|
|
71
82
|
ue as calculateDistanceWithRadius,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
Te as camelToKebab,
|
|
84
|
+
Pe as capitalize,
|
|
85
|
+
le as clamp,
|
|
86
|
+
Ce as cloneDeep,
|
|
87
|
+
Oe as compareObjects,
|
|
77
88
|
p as cover,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
H as createJSONAndSave,
|
|
90
|
+
ce as damp,
|
|
91
|
+
ee as debounce,
|
|
92
|
+
C as decode,
|
|
82
93
|
Z as dispatchSizeChangeEvent,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
x as dotCircleCollision,
|
|
95
|
+
f as dotRectCollision,
|
|
96
|
+
k as easeInCubic,
|
|
86
97
|
B as easeInExpo,
|
|
87
|
-
|
|
98
|
+
M as easeInOutCubic,
|
|
88
99
|
N as easeInOutExpo,
|
|
89
100
|
j as easeInOutQuad,
|
|
90
101
|
z as easeInOutQuart,
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
U as easeInOutQuint,
|
|
103
|
+
V as easeInQuad,
|
|
93
104
|
q as easeInQuart,
|
|
94
105
|
J as easeInQuint,
|
|
95
106
|
K as easeOutCubic,
|
|
96
|
-
|
|
107
|
+
$ as easeOutExpo,
|
|
97
108
|
F as easeOutQuad,
|
|
98
109
|
G as easeOutQuart,
|
|
99
110
|
W as easeOutQuint,
|
|
100
111
|
w as encode,
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
D as findParentElement,
|
|
113
|
+
T as findScrollParentElement,
|
|
103
114
|
m as fixPosition,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
Ae as generateId,
|
|
116
|
+
se as getCumulativeOffsetLeft,
|
|
117
|
+
ne as getCumulativeOffsetTop,
|
|
118
|
+
oe as getCumulativePosition,
|
|
119
|
+
P as getElement,
|
|
109
120
|
ze as getElementTransitionDurationMS,
|
|
110
|
-
|
|
121
|
+
Ue as getElementTransitionDurationS,
|
|
111
122
|
b as getPointerPosition,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
y as getRootVariables,
|
|
124
|
+
c as insert,
|
|
125
|
+
Q as isBrowser,
|
|
126
|
+
Ee as isESClass,
|
|
127
|
+
Se as isNullish,
|
|
128
|
+
Ie as isObject,
|
|
129
|
+
ke as kebabToCamel,
|
|
118
130
|
de as lerp,
|
|
119
131
|
X as linear,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
me as mapRange,
|
|
133
|
+
d as measureText,
|
|
134
|
+
Re as mergeDeep,
|
|
123
135
|
g as normalize,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
Qe as omit,
|
|
137
|
+
S as parseAttribute,
|
|
138
|
+
I as parseAttributeValue,
|
|
139
|
+
ve as pick,
|
|
140
|
+
be as preciseNumber,
|
|
141
|
+
pe as round,
|
|
142
|
+
ye as roundNumberTo,
|
|
131
143
|
h as screenToCartesian,
|
|
132
|
-
|
|
144
|
+
fe as smootherstep,
|
|
133
145
|
xe as smoothstep,
|
|
134
146
|
Be as snakeToDotted,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
he as step,
|
|
148
|
+
te as throttle,
|
|
149
|
+
Me as toPascalCase,
|
|
138
150
|
Ne as uncapitalize
|
|
139
151
|
};
|