aptechka 0.4.38 → 0.4.39
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/index.cjs +1 -1
- package/lib/morph/index.js +87 -78
- package/lib/store/Store.d.ts +1 -1
- package/package.json +1 -1
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var rt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var J=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var s=(n,t,e)=>(J(n,t,"read from private field"),e?e.call(n):t.get(n)),o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},a=(n,t,e,r)=>(J(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);var m=(n,t,e)=>(J(n,t,"access private method"),e);var H=(n,t,e)=>new Promise((r,i)=>{var c=u=>{try{f(e.next(u))}catch(d){i(d)}},L=u=>{try{f(e.throw(u))}catch(d){i(d)}},f=u=>u.done?r(u.value):Promise.resolve(u.value).then(c,L);f((e=e.apply(n,t)).next())});var ot=(n,t,e)=>(t=n[rt("asyncIterator")])?t.call(n):(n=n[rt("iterator")](),t={},e=(r,i)=>(i=n[r])&&(t[r]=c=>new Promise((L,f,u)=>(c=i.call(n,c),u=c.done,Promise.resolve(c.value).then(d=>L({value:d,done:u}),f)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ht=require("../notifier/index.cjs"),mt=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var y,l,b,A,N,M;class pt{constructor(t,e){o(this,y,void 0);o(this,l,void 0);o(this,b,void 0);o(this,A,void 0);o(this,N,t=>{t.preventDefault(),s(this,y).navigate(s(this,b),s(this,A))});o(this,M,()=>{s(this,y).prefetch(s(this,b)),s(this,l).removeEventListener("pointerenter",s(this,M))});a(this,y,e),a(this,l,t),a(this,b,s(this,l).getAttribute("href")||"/"),a(this,A,s(this,l).getAttribute("data-history-action")||"push"),s(this,l).addEventListener("click",s(this,N));const r=e.normalizePath(s(this,b)),i=e.normalizePath(location.pathname);s(this,l).hasAttribute("data-include")?i.pathname.includes(r.pathname)&&s(this,l).classList.add("current"):r.pathname===i.pathname&&s(this,l).classList.add("current"),s(this,l).hasAttribute("data-prefetch")&&s(this,l).addEventListener("pointerenter",s(this,M))}destroy(){s(this,l).removeEventListener("click",s(this,N)),s(this,l).removeEventListener("pointerenter",s(this,M)),s(this,l).classList.remove("current")}}y=new WeakMap,l=new WeakMap,b=new WeakMap,A=new WeakMap,N=new WeakMap,M=new WeakMap;var p,S,C,k,W,$,w,v,P,q,x,z,Q,D,U,R,V,j,at,F,X,B;class gt{constructor(t){o(this,z);o(this,D);o(this,R);o(this,j);o(this,F);o(this,p,null);o(this,S,null);o(this,C,null);o(this,k,null);o(this,W,[]);o(this,$,new DOMParser);o(this,w,new Map);o(this,v,void 0);o(this,P,null);o(this,q,new ht.Notifier);o(this,x,new ht.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});mt.isBrowser&&(a(this,p,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(a(this,p,t.base),t.base.endsWith("/")||a(this,p,s(this,p)+"/")):a(this,p,"/"),a(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),a(this,C,(t==null?void 0:t.cachePages)!==!1),a(this,k,m(this,R,V).call(this,document.body)),a(this,P,location.pathname),m(this,D,U).call(this),addEventListener("popstate",s(this,B)))}normalizePath(t){t=t.replace(s(this,p),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),r=e[0].split("?"),i=r[0].endsWith("/")?r[0].slice(0,-1):r[0],c=s(this,p)+i,L=r==null?void 0:r[1],f=e==null?void 0:e[1];return{leaf:i,pathname:c,parameters:L,hash:f}}beforeNavigationEvent(t){return s(this,q).subscribe(t)}afterNavigationEvent(t){return s(this,x).subscribe(t)}prefetch(t){return H(this,null,function*(){const e=this.normalizePath(t);return m(this,z,Q).call(this,e.pathname)})}navigate(t,e="push"){return H(this,null,function*(){var u;const r=this.normalizePath(t);let{pathname:i,hash:c,parameters:L}=r;if(s(this,v)===i||s(this,P)===i)return;a(this,v,i);const f=s(this,w).has(i);try{let d=!0;if(s(this,q).notify({pathname:i,isCached:f}),this.preprocessor)try{yield new Promise((h,g)=>{var E;(E=this.preprocessor)==null||E.call(this,{pathname:i,resolve:h,reject:g,isCached:f})})}catch(h){h?console.error(h):console.log("Route change canceled"),d=!1}if(!d||s(this,v)!==i)return;const Z=s(this,w).get(i)||(yield m(this,z,Q).call(this,i));if(s(this,v)!==i)return;const tt=Array.from(document.head.children),et=Array.from(Z.head.cloneNode(!0).children),st=m(this,j,at).call(this,tt,et),ct=m(this,F,X).call(this,tt,st),I=m(this,F,X).call(this,et,st);ct.forEach(h=>{h.hasAttribute("data-permanent")||h.remove()}),I.forEach((h,g)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const E=document.createElement("script");E.type="module",E.src=h.getAttribute("src"),I[g]=E}}),I.forEach(h=>{document.head.appendChild(h)});const K=I.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");s(this,S)&&K.length&&(yield new Promise(h=>H(this,null,function*(){let g=0;try{for(var E=ot(K),dt,Y,T;dt=!(Y=yield E.next()).done;dt=!1){const _=Y.value;_.onload=()=>{g++,g===K.length&&h()}}}catch(Y){T=[Y]}finally{try{dt&&(Y=E.return)&&(yield Y.call(E))}finally{if(T)throw T[0]}}}))),a(this,P,i);const O=L||location.search,lt=c?c.startsWith("#")?c:"#"+c:"",ut=O?O.startsWith("?")?O:"?"+O:"",it=`${i}${lt}${ut}`;e==="push"?history.pushState(i,"",it):e==="replace"&&history.replaceState(i,"",it);const ft=m(this,R,V).call(this,Z.body.cloneNode(!0));s(this,k).forEach((h,g)=>{const E=ft[g];let dt=[...h.childNodes],Y=[...E.childNodes];dt.forEach(T=>{if(T instanceof HTMLElement){const _=T.hasAttribute("data-remain");let nt;Y=Y.filter(G=>G instanceof HTMLElement&&G.outerHTML===T.outerHTML?(nt=G,!1):!0),_&&nt||T.remove()}else T.remove()}),h.append(...Y)}),m(this,D,U).call(this),(u=this.postprocessor)==null||u.call(this,{pathname:i,isCached:f}),s(this,x).notify({pathname:i,isCached:f})}catch(d){console.error(d)}a(this,v,void 0)})}}p=new WeakMap,S=new WeakMap,C=new WeakMap,k=new WeakMap,W=new WeakMap,$=new WeakMap,w=new WeakMap,v=new WeakMap,P=new WeakMap,q=new WeakMap,x=new WeakMap,z=new WeakSet,Q=function(t){return H(this,null,function*(){const e=s(this,w).get(t);if(e)return e;const i=yield(yield fetch(t)).text(),c=s(this,$).parseFromString(i,"text/html");return s(this,C)&&s(this,w).set(t,c),c})},D=new WeakSet,U=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});s(this,W).forEach(e=>e.destroy()),a(this,W,t.map(e=>new pt(e,this)))},R=new WeakSet,V=function(t){return[...t.querySelectorAll("[data-morph]")]},j=new WeakSet,at=function(t,e){return t.filter(r=>e.find(i=>i.outerHTML===r.outerHTML))},F=new WeakSet,X=function(t,e){return t.filter(r=>!e.find(i=>i.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=gt;
|
package/lib/morph/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var rt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
|
|
2
|
+
var Q = (n, t, e) => {
|
|
3
3
|
if (!t.has(n))
|
|
4
4
|
throw TypeError("Cannot " + e);
|
|
5
5
|
};
|
|
6
|
-
var s = (n, t, e) => (
|
|
6
|
+
var s = (n, t, e) => (Q(n, t, "read from private field"), e ? e.call(n) : t.get(n)), o = (n, t, e) => {
|
|
7
7
|
if (t.has(n))
|
|
8
8
|
throw TypeError("Cannot add the same private member more than once");
|
|
9
9
|
t instanceof WeakSet ? t.add(n) : t.set(n, e);
|
|
10
|
-
}, a = (n, t, e, r) => (
|
|
11
|
-
var m = (n, t, e) => (
|
|
10
|
+
}, a = (n, t, e, r) => (Q(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
|
|
11
|
+
var m = (n, t, e) => (Q(n, t, "access private method"), e);
|
|
12
12
|
var T = (n, t, e) => new Promise((r, i) => {
|
|
13
13
|
var c = (u) => {
|
|
14
14
|
try {
|
|
@@ -25,57 +25,57 @@ var T = (n, t, e) => new Promise((r, i) => {
|
|
|
25
25
|
}, f = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(c, v);
|
|
26
26
|
f((e = e.apply(n, t)).next());
|
|
27
27
|
});
|
|
28
|
-
var
|
|
29
|
-
import { Notifier as
|
|
30
|
-
import { i as
|
|
28
|
+
var ot = (n, t, e) => (t = n[rt("asyncIterator")]) ? t.call(n) : (n = n[rt("iterator")](), t = {}, e = (r, i) => (i = n[r]) && (t[r] = (c) => new Promise((v, f, u) => (c = i.call(n, c), u = c.done, Promise.resolve(c.value).then((d) => v({ value: d, done: u }), f)))), e("next"), e("return"), t);
|
|
29
|
+
import { Notifier as ht } from "../notifier/index.js";
|
|
30
|
+
import { i as mt } from "../browser-0zX67oeU.js";
|
|
31
31
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
32
|
-
var y, l, w, A,
|
|
33
|
-
class
|
|
32
|
+
var y, l, w, A, N, M;
|
|
33
|
+
class pt {
|
|
34
34
|
constructor(t, e) {
|
|
35
35
|
o(this, y, void 0);
|
|
36
36
|
o(this, l, void 0);
|
|
37
37
|
o(this, w, void 0);
|
|
38
38
|
o(this, A, void 0);
|
|
39
|
-
o(this,
|
|
39
|
+
o(this, N, (t) => {
|
|
40
40
|
t.preventDefault(), s(this, y).navigate(s(this, w), s(this, A));
|
|
41
41
|
});
|
|
42
|
-
o(this,
|
|
43
|
-
s(this, y).prefetch(s(this, w)), s(this, l).removeEventListener("pointerenter", s(this,
|
|
42
|
+
o(this, M, () => {
|
|
43
|
+
s(this, y).prefetch(s(this, w)), s(this, l).removeEventListener("pointerenter", s(this, M));
|
|
44
44
|
});
|
|
45
45
|
a(this, y, e), a(this, l, t), a(this, w, s(this, l).getAttribute("href") || "/"), a(this, A, s(this, l).getAttribute(
|
|
46
46
|
"data-history-action"
|
|
47
|
-
) || "push"), s(this, l).addEventListener("click", s(this,
|
|
47
|
+
) || "push"), s(this, l).addEventListener("click", s(this, N));
|
|
48
48
|
const r = e.normalizePath(s(this, w)), i = e.normalizePath(location.pathname);
|
|
49
|
-
s(this, l).hasAttribute("data-include") ? i.pathname.includes(r.pathname) && s(this, l).classList.add("current") : r.pathname === i.pathname && s(this, l).classList.add("current"), s(this, l).hasAttribute("data-prefetch") && s(this, l).addEventListener("pointerenter", s(this,
|
|
49
|
+
s(this, l).hasAttribute("data-include") ? i.pathname.includes(r.pathname) && s(this, l).classList.add("current") : r.pathname === i.pathname && s(this, l).classList.add("current"), s(this, l).hasAttribute("data-prefetch") && s(this, l).addEventListener("pointerenter", s(this, M));
|
|
50
50
|
}
|
|
51
51
|
destroy() {
|
|
52
|
-
s(this, l).removeEventListener("click", s(this,
|
|
52
|
+
s(this, l).removeEventListener("click", s(this, N)), s(this, l).removeEventListener("pointerenter", s(this, M)), s(this, l).classList.remove("current");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
y = new WeakMap(), l = new WeakMap(), w = new WeakMap(), A = new WeakMap(),
|
|
56
|
-
var p,
|
|
57
|
-
class
|
|
55
|
+
y = new WeakMap(), l = new WeakMap(), w = new WeakMap(), A = new WeakMap(), N = new WeakMap(), M = new WeakMap();
|
|
56
|
+
var p, C, S, k, W, O, b, L, P, x, z, D, U, R, V, F, X, B, at, I, Z, K;
|
|
57
|
+
class wt {
|
|
58
58
|
constructor(t) {
|
|
59
|
-
o(this, z);
|
|
60
59
|
o(this, D);
|
|
61
60
|
o(this, R);
|
|
62
|
-
o(this, O);
|
|
63
61
|
o(this, F);
|
|
62
|
+
o(this, B);
|
|
63
|
+
o(this, I);
|
|
64
64
|
o(this, p, null);
|
|
65
|
-
o(this, N, null);
|
|
66
|
-
o(this, S, null);
|
|
67
65
|
o(this, C, null);
|
|
68
|
-
o(this,
|
|
69
|
-
o(this,
|
|
66
|
+
o(this, S, null);
|
|
67
|
+
o(this, k, null);
|
|
68
|
+
o(this, W, []);
|
|
69
|
+
o(this, O, new DOMParser());
|
|
70
70
|
o(this, b, /* @__PURE__ */ new Map());
|
|
71
71
|
o(this, L, void 0);
|
|
72
|
-
o(this,
|
|
73
|
-
o(this,
|
|
74
|
-
o(this,
|
|
75
|
-
o(this,
|
|
72
|
+
o(this, P, null);
|
|
73
|
+
o(this, x, new ht());
|
|
74
|
+
o(this, z, new ht());
|
|
75
|
+
o(this, K, (t) => {
|
|
76
76
|
t.state && this.navigate(t.state, "none");
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
mt && (a(this, p, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (a(this, p, t.base), t.base.endsWith("/") || a(this, p, s(this, p) + "/")) : a(this, p, "/"), a(this, C, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), a(this, S, (t == null ? void 0 : t.cachePages) !== !1), a(this, k, m(this, F, X).call(this, document.body)), a(this, P, location.pathname), m(this, R, V).call(this), addEventListener("popstate", s(this, K)));
|
|
79
79
|
}
|
|
80
80
|
normalizePath(t) {
|
|
81
81
|
t = t.replace(s(this, p), ""), t.startsWith("/") && (t = t.slice(1));
|
|
@@ -88,15 +88,15 @@ class pt {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
beforeNavigationEvent(t) {
|
|
91
|
-
return s(this,
|
|
91
|
+
return s(this, x).subscribe(t);
|
|
92
92
|
}
|
|
93
93
|
afterNavigationEvent(t) {
|
|
94
|
-
return s(this,
|
|
94
|
+
return s(this, z).subscribe(t);
|
|
95
95
|
}
|
|
96
96
|
prefetch(t) {
|
|
97
97
|
return T(this, null, function* () {
|
|
98
98
|
const e = this.normalizePath(t);
|
|
99
|
-
return m(this,
|
|
99
|
+
return m(this, D, U).call(this, e.pathname);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
navigate(t, e = "push") {
|
|
@@ -104,72 +104,82 @@ class pt {
|
|
|
104
104
|
var u;
|
|
105
105
|
const r = this.normalizePath(t);
|
|
106
106
|
let { pathname: i, hash: c, parameters: v } = r;
|
|
107
|
-
if (s(this, L) === i || s(this,
|
|
107
|
+
if (s(this, L) === i || s(this, P) === i)
|
|
108
108
|
return;
|
|
109
109
|
a(this, L, i);
|
|
110
110
|
const f = s(this, b).has(i);
|
|
111
111
|
try {
|
|
112
112
|
let d = !0;
|
|
113
|
-
if (s(this,
|
|
113
|
+
if (s(this, x).notify({
|
|
114
114
|
pathname: i,
|
|
115
115
|
isCached: f
|
|
116
116
|
}), this.preprocessor)
|
|
117
117
|
try {
|
|
118
|
-
yield new Promise((h,
|
|
119
|
-
var
|
|
120
|
-
(
|
|
118
|
+
yield new Promise((h, E) => {
|
|
119
|
+
var g;
|
|
120
|
+
(g = this.preprocessor) == null || g.call(this, { pathname: i, resolve: h, reject: E, isCached: f });
|
|
121
121
|
});
|
|
122
122
|
} catch (h) {
|
|
123
123
|
h ? console.error(h) : console.log("Route change canceled"), d = !1;
|
|
124
124
|
}
|
|
125
125
|
if (!d || s(this, L) !== i)
|
|
126
126
|
return;
|
|
127
|
-
const
|
|
127
|
+
const _ = s(this, b).get(i) || (yield m(this, D, U).call(this, i));
|
|
128
128
|
if (s(this, L) !== i)
|
|
129
129
|
return;
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
),
|
|
133
|
-
|
|
130
|
+
const tt = Array.from(document.head.children), et = Array.from(
|
|
131
|
+
_.head.cloneNode(!0).children
|
|
132
|
+
), st = m(this, B, at).call(this, tt, et), ct = m(this, I, Z).call(this, tt, st), $ = m(this, I, Z).call(this, et, st);
|
|
133
|
+
ct.forEach((h) => {
|
|
134
134
|
h.hasAttribute("data-permanent") || h.remove();
|
|
135
|
-
}),
|
|
135
|
+
}), $.forEach((h, E) => {
|
|
136
136
|
if (h.tagName === "SCRIPT" && h.getAttribute("src")) {
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const g = document.createElement("script");
|
|
138
|
+
g.type = "module", g.src = h.getAttribute("src"), $[E] = g;
|
|
139
139
|
}
|
|
140
|
-
}),
|
|
140
|
+
}), $.forEach((h) => {
|
|
141
141
|
document.head.appendChild(h);
|
|
142
142
|
});
|
|
143
|
-
const
|
|
143
|
+
const Y = $.filter(
|
|
144
144
|
(h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
|
|
145
145
|
);
|
|
146
|
-
s(this,
|
|
147
|
-
let
|
|
146
|
+
s(this, C) && Y.length && (yield new Promise((h) => T(this, null, function* () {
|
|
147
|
+
let E = 0;
|
|
148
148
|
try {
|
|
149
|
-
for (var
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
for (var g = ot(Y), dt, j, H; dt = !(j = yield g.next()).done; dt = !1) {
|
|
150
|
+
const G = j.value;
|
|
151
|
+
G.onload = () => {
|
|
152
|
+
E++, E === Y.length && h();
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
} catch (
|
|
156
|
-
|
|
155
|
+
} catch (j) {
|
|
156
|
+
H = [j];
|
|
157
157
|
} finally {
|
|
158
158
|
try {
|
|
159
|
-
|
|
159
|
+
dt && (j = g.return) && (yield j.call(g));
|
|
160
160
|
} finally {
|
|
161
|
-
if (
|
|
162
|
-
throw
|
|
161
|
+
if (H)
|
|
162
|
+
throw H[0];
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
}))), a(this,
|
|
166
|
-
const
|
|
167
|
-
e === "push" ? history.pushState(i, "",
|
|
168
|
-
const
|
|
169
|
-
s(this,
|
|
170
|
-
const
|
|
171
|
-
h.
|
|
172
|
-
|
|
165
|
+
}))), a(this, P, i);
|
|
166
|
+
const q = v || location.search, lt = c ? c.startsWith("#") ? c : "#" + c : "", ut = q ? q.startsWith("?") ? q : "?" + q : "", it = `${i}${lt}${ut}`;
|
|
167
|
+
e === "push" ? history.pushState(i, "", it) : e === "replace" && history.replaceState(i, "", it);
|
|
168
|
+
const ft = m(this, F, X).call(this, _.body.cloneNode(!0));
|
|
169
|
+
s(this, k).forEach((h, E) => {
|
|
170
|
+
const g = ft[E];
|
|
171
|
+
let dt = [...h.childNodes], j = [...g.childNodes];
|
|
172
|
+
dt.forEach((H) => {
|
|
173
|
+
if (H instanceof HTMLElement) {
|
|
174
|
+
const G = H.hasAttribute("data-remain");
|
|
175
|
+
let nt;
|
|
176
|
+
j = j.filter(
|
|
177
|
+
(J) => J instanceof HTMLElement && J.outerHTML === H.outerHTML ? (nt = J, !1) : !0
|
|
178
|
+
), G && nt || H.remove();
|
|
179
|
+
} else
|
|
180
|
+
H.remove();
|
|
181
|
+
}), h.append(...j);
|
|
182
|
+
}), m(this, R, V).call(this), (u = this.postprocessor) == null || u.call(this, { pathname: i, isCached: f }), s(this, z).notify({ pathname: i, isCached: f });
|
|
173
183
|
} catch (d) {
|
|
174
184
|
console.error(d);
|
|
175
185
|
}
|
|
@@ -177,38 +187,37 @@ class pt {
|
|
|
177
187
|
});
|
|
178
188
|
}
|
|
179
189
|
}
|
|
180
|
-
p = new WeakMap(),
|
|
190
|
+
p = new WeakMap(), C = new WeakMap(), S = new WeakMap(), k = new WeakMap(), W = new WeakMap(), O = new WeakMap(), b = new WeakMap(), L = new WeakMap(), P = new WeakMap(), x = new WeakMap(), z = new WeakMap(), D = new WeakSet(), U = function(t) {
|
|
181
191
|
return T(this, null, function* () {
|
|
182
192
|
const e = s(this, b).get(t);
|
|
183
193
|
if (e)
|
|
184
194
|
return e;
|
|
185
|
-
const i = yield (yield fetch(t)).text(), c = s(this,
|
|
195
|
+
const i = yield (yield fetch(t)).text(), c = s(this, O).parseFromString(i, "text/html");
|
|
186
196
|
return s(this, S) && s(this, b).set(t, c), c;
|
|
187
197
|
});
|
|
188
|
-
},
|
|
198
|
+
}, R = new WeakSet(), V = function() {
|
|
189
199
|
const t = [
|
|
190
200
|
...document.documentElement.querySelectorAll("a")
|
|
191
201
|
].filter((e) => {
|
|
192
202
|
var r;
|
|
193
203
|
return (r = e.getAttribute("href")) == null ? void 0 : r.startsWith("/");
|
|
194
204
|
});
|
|
195
|
-
s(this,
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}, O = new WeakSet(), it = function(t, e) {
|
|
205
|
+
s(this, W).forEach((e) => e.destroy()), a(this, W, t.map((e) => new pt(e, this)));
|
|
206
|
+
}, F = new WeakSet(), X = function(t) {
|
|
207
|
+
return [...t.querySelectorAll("[data-morph]")];
|
|
208
|
+
}, B = new WeakSet(), at = function(t, e) {
|
|
200
209
|
return t.filter(
|
|
201
210
|
(r) => e.find(
|
|
202
211
|
(i) => i.outerHTML === r.outerHTML
|
|
203
212
|
)
|
|
204
213
|
);
|
|
205
|
-
},
|
|
214
|
+
}, I = new WeakSet(), Z = function(t, e) {
|
|
206
215
|
return t.filter(
|
|
207
216
|
(r) => !e.find(
|
|
208
217
|
(i) => i.outerHTML === r.outerHTML
|
|
209
218
|
)
|
|
210
219
|
);
|
|
211
|
-
},
|
|
220
|
+
}, K = new WeakMap();
|
|
212
221
|
export {
|
|
213
|
-
|
|
222
|
+
wt as Morph
|
|
214
223
|
};
|
package/lib/store/Store.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface StorePassport<T extends StoreManagerType = StoreManagerType> {
|
|
|
55
55
|
export type StoreMiddleware<T> = (value: T) => T;
|
|
56
56
|
export interface StoreOptions<StoreType, StoreManager extends StoreManagerType = StoreManagerType> {
|
|
57
57
|
equalityCheck?: StoreEqualityCheckCallback<StoreType>;
|
|
58
|
-
passport?: StorePassport<StoreManager
|
|
58
|
+
passport?: StorePassport<StoreManager> | undefined;
|
|
59
59
|
validate?: StoreMiddleware<StoreType>;
|
|
60
60
|
skipSubscribeNotification?: boolean;
|
|
61
61
|
notifyAndClose?: boolean;
|