lithent 1.21.2 → 1.21.3
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/dist/lithent.mjs +157 -165
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/examples/dist/assets/index-CLyQ20Qs.js +2 -0
- package/examples/dist/assets/index-CLyQ20Qs.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/tests/core-nullUpdater.test.tsx +60 -1
- package/src/wDom.ts +5 -32
- package/ssr/package.json +1 -1
- package/examples/dist/assets/index-DYJGSNhf.js +0 -2
- package/examples/dist/assets/index-DYJGSNhf.js.map +0 -1
package/dist/lithent.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const h = Symbol.for("lithentWDomSymbol"), P = { value: "" }, v = { value: null }, a = { value: !1 },
|
|
2
|
-
let
|
|
1
|
+
const h = Symbol.for("lithentWDomSymbol"), P = { value: "" }, v = { value: null }, a = { value: !1 }, u = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakSet();
|
|
2
|
+
let W = !1;
|
|
3
3
|
const Ce = (e) => {
|
|
4
|
-
|
|
4
|
+
u.set(e, {
|
|
5
5
|
vd: { value: null },
|
|
6
6
|
up: () => {
|
|
7
7
|
},
|
|
@@ -14,123 +14,123 @@ const Ce = (e) => {
|
|
|
14
14
|
wdCB: []
|
|
15
15
|
// WDom creation callback queue
|
|
16
16
|
});
|
|
17
|
-
}, d = () => v.value,
|
|
18
|
-
const n =
|
|
17
|
+
}, d = () => v.value, Z = (e, t) => {
|
|
18
|
+
const n = u.get(e);
|
|
19
19
|
return n ? n[t] : null;
|
|
20
20
|
}, ve = (e) => {
|
|
21
21
|
v.value = e;
|
|
22
22
|
}, ke = (e) => {
|
|
23
23
|
v.value = e, Ce(e);
|
|
24
24
|
}, Ct = (e) => {
|
|
25
|
-
|
|
26
|
-
}, Re = () =>
|
|
27
|
-
const t =
|
|
25
|
+
W = e;
|
|
26
|
+
}, Re = () => W, D = (e) => {
|
|
27
|
+
const t = u.get(e);
|
|
28
28
|
t && (t.umts.forEach((n) => n()), t.umts = []);
|
|
29
29
|
}, vt = (e) => {
|
|
30
|
-
|
|
31
|
-
}, i = (e) => e.getParent && e.getParent(), x = Object.entries,
|
|
30
|
+
D(e), u.delete(e);
|
|
31
|
+
}, i = (e) => e.getParent && e.getParent(), x = Object.entries, ee = Object.keys, k = (e) => typeof e == "object" && e !== null, N = Object.assign, kt = (e) => k(e) && !Array.isArray(e) && !Object.getOwnPropertySymbols(e).includes(h), R = (e) => k(e) && !("resolve" in e), S = (e, t) => R(e) && e.type === t, Pe = (e, t) => "ctor" in e ? e.ctor === (t && t.ctor) : e === (t && t.ctor), xe = (e, t) => !!(R(e) && t && t.type === "f" && t.children && t.children.length === (e.children && e.children.length)), Se = (e, t) => !!(R(e) && t && t.type === "e" && t.tag === e.tag && t.children && t.children.length === (e.children && e.children.length)), $ = (e, t) => !!(R(e) && t && t.type === e.type), Me = (e, t) => !!(R(e) && t && t.type === e.type && (C((e.children || [])[0]) && C((t.children || [])[0]) || t.children && e.children && t.children.length === e.children.length)), p = (e) => (e && e.compProps && e.compProps.key) ?? (e && e.props && e.props.key), y = (e) => e && ["f", "l"].includes(e), b = (e) => typeof e == "function" && !te(e) || k(e) && "resolve" in e, te = (e) => typeof e == "function" && e === J, Ee = (e) => R(e) && !e.type, C = (e) => ne(p(e)), ne = (e) => e != null, V = (e, t) => e === "style" && k(t), Te = (e, t) => e === "ref" && k(t), Ne = (e, t) => {
|
|
32
32
|
const n = Object.getOwnPropertyDescriptor(
|
|
33
33
|
e.constructor.prototype,
|
|
34
34
|
t
|
|
35
35
|
);
|
|
36
36
|
return n && n.get && n.set;
|
|
37
|
-
}, be = (e) =>
|
|
37
|
+
}, be = (e) => b(e) ? "c" : S(e, "f") ? "f" : S(e, "e") ? "e" : S(e, "l") ? "l" : S(e, "t") ? "t" : "et", Le = {
|
|
38
38
|
c: Pe,
|
|
39
|
-
l:
|
|
40
|
-
t:
|
|
39
|
+
l: Me,
|
|
40
|
+
t: $,
|
|
41
41
|
e: Se,
|
|
42
42
|
f: xe,
|
|
43
|
-
et:
|
|
44
|
-
},
|
|
43
|
+
et: $
|
|
44
|
+
}, ce = (e) => {
|
|
45
45
|
const t = d();
|
|
46
46
|
if (t) {
|
|
47
|
-
const n =
|
|
47
|
+
const n = u.get(t);
|
|
48
48
|
n && n.umts.push(e);
|
|
49
49
|
}
|
|
50
|
-
},
|
|
50
|
+
}, L = (e) => {
|
|
51
51
|
const { compKey: t } = e;
|
|
52
|
-
t && Fe(t),
|
|
53
|
-
},
|
|
52
|
+
t && Fe(t), se(e);
|
|
53
|
+
}, se = (e) => {
|
|
54
54
|
(e.children || []).forEach((t) => {
|
|
55
|
-
t.compKey ?
|
|
55
|
+
t.compKey ? L(t) : se(t);
|
|
56
56
|
});
|
|
57
57
|
}, Fe = (e) => {
|
|
58
|
-
|
|
58
|
+
D(e), Re() || u.delete(e);
|
|
59
59
|
};
|
|
60
|
-
let
|
|
60
|
+
let Q = [];
|
|
61
61
|
const Ue = (e) => {
|
|
62
|
-
e.compKey &&
|
|
63
|
-
},
|
|
64
|
-
|
|
62
|
+
e.compKey && Q.push(e);
|
|
63
|
+
}, M = () => {
|
|
64
|
+
Q.forEach((e) => Oe(e)), Q = [];
|
|
65
65
|
}, Rt = (e) => {
|
|
66
66
|
const t = d();
|
|
67
67
|
if (t) {
|
|
68
|
-
const n =
|
|
68
|
+
const n = u.get(t);
|
|
69
69
|
n && n.mts.push(e);
|
|
70
70
|
}
|
|
71
71
|
}, Oe = (e) => {
|
|
72
72
|
const { compKey: t } = e;
|
|
73
73
|
if (t) {
|
|
74
|
-
const n =
|
|
74
|
+
const n = u.get(t);
|
|
75
75
|
if (!n) return;
|
|
76
76
|
const { mts: c, upS: r } = n;
|
|
77
77
|
v.value = t, r && (r.value = 0), c && (n.mts = [], c.forEach((s) => {
|
|
78
78
|
const o = s();
|
|
79
|
-
o &&
|
|
79
|
+
o && ce(o);
|
|
80
80
|
}));
|
|
81
81
|
}
|
|
82
82
|
}, Pt = (e) => {
|
|
83
83
|
const t = d();
|
|
84
84
|
if (t) {
|
|
85
|
-
const n =
|
|
85
|
+
const n = u.get(t);
|
|
86
86
|
n && n.wdCB.push(e);
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, Ae = (e) => {
|
|
89
89
|
const { compKey: t } = e;
|
|
90
90
|
if (t) {
|
|
91
|
-
const n =
|
|
91
|
+
const n = u.get(t), c = n && n.wdCB;
|
|
92
92
|
v.value = t, c && c.length > 0 && (n.wdCB = [], c.forEach((r) => {
|
|
93
93
|
const s = r();
|
|
94
|
-
s && typeof s == "function" &&
|
|
94
|
+
s && typeof s == "function" && ce(s);
|
|
95
95
|
}));
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, K = (e, t = () => []) => {
|
|
98
98
|
const n = d();
|
|
99
99
|
if (!n) return;
|
|
100
|
-
const c =
|
|
100
|
+
const c = u.get(n);
|
|
101
101
|
if (!c) return;
|
|
102
102
|
const { upD: r, upS: s } = c, o = r[s.value], l = t();
|
|
103
103
|
if (o && Be(o, l)) {
|
|
104
|
-
const
|
|
105
|
-
|
|
104
|
+
const f = e();
|
|
105
|
+
f && c.upCB.push(f);
|
|
106
106
|
}
|
|
107
107
|
r[s.value] = l, s.value += 1;
|
|
108
|
-
},
|
|
108
|
+
}, ge = (e) => {
|
|
109
109
|
const { compKey: t } = e;
|
|
110
110
|
if (t) {
|
|
111
|
-
const n =
|
|
111
|
+
const n = u.get(t);
|
|
112
112
|
if (!n) return;
|
|
113
113
|
const { upCB: c, upS: r } = n;
|
|
114
114
|
v.value = t, r && (r.value = 0), e.ctor && c && (n.upCB = [], c.forEach((s) => s()));
|
|
115
115
|
}
|
|
116
|
-
}, Be = (e, t) => e.length ? e.some((n, c) => n !== t[c]) : !0,
|
|
116
|
+
}, Be = (e, t) => e.length ? e.some((n, c) => n !== t[c]) : !0, E = () => new DocumentFragment(), Qe = (e) => document.createElement(e), xt = (e, t, n, c) => {
|
|
117
117
|
e.isRoot = !0, t = t || document.body, e.we = t;
|
|
118
|
-
const r =
|
|
119
|
-
return n ? (e.ae = n, t.insertBefore(r, n)) : c || (t.tagName === "HTML" ? t.replaceWith(r) : t.appendChild(r)),
|
|
120
|
-
const s =
|
|
121
|
-
o !== e &&
|
|
118
|
+
const r = U(e, c);
|
|
119
|
+
return n ? (e.ae = n, t.insertBefore(r, n)) : c || (t.tagName === "HTML" ? t.replaceWith(r) : t.appendChild(r)), M(), () => {
|
|
120
|
+
const s = u.get(e.compProps || {}), o = s && s.vd.value || e;
|
|
121
|
+
o !== e && L(o), F(o), je(o);
|
|
122
122
|
};
|
|
123
|
-
},
|
|
124
|
-
e.props && e.el &&
|
|
125
|
-
|
|
123
|
+
}, F = (e) => {
|
|
124
|
+
e.props && e.el && ue(e.props, e.el), (e.children || []).forEach((t) => {
|
|
125
|
+
F(t);
|
|
126
126
|
});
|
|
127
|
-
}, je = (e) =>
|
|
128
|
-
e.op && e.el &&
|
|
129
|
-
const t = i(e), n = e.isRoot ? e.we : t ?
|
|
130
|
-
n &&
|
|
127
|
+
}, je = (e) => re(e, e.we), G = (e) => {
|
|
128
|
+
e.op && e.el && ue(e.op, e.el);
|
|
129
|
+
const t = i(e), n = e.isRoot ? e.we : t ? O(t) : void 0;
|
|
130
|
+
n && re(e, n);
|
|
131
|
+
}, re = (e, t) => {
|
|
132
|
+
t && e.el && (e.el.nodeType === 11 || (e == null ? void 0 : e.tag) === "portal" ? oe(e) : [1, 3].includes(e.el.nodeType) && t.removeChild(e.el), delete e.el);
|
|
131
133
|
}, oe = (e, t) => {
|
|
132
|
-
t && e.el && (e.el.nodeType === 11 || (e == null ? void 0 : e.tag) === "portal" ? le(e) : [1, 3].includes(e.el.nodeType) && t.removeChild(e.el), delete e.el);
|
|
133
|
-
}, le = (e, t) => {
|
|
134
134
|
(e && e.oc || e && e.children || []).forEach(
|
|
135
135
|
(n) => {
|
|
136
136
|
const c = n.el && n.el.nodeType;
|
|
@@ -138,51 +138,51 @@ const Ue = (e) => {
|
|
|
138
138
|
if ([1, 3].includes(c)) {
|
|
139
139
|
const r = n.el;
|
|
140
140
|
r.tagName === "HTML" ? r.innerHTML = "" : r.remove();
|
|
141
|
-
} else c === 11 &&
|
|
141
|
+
} else c === 11 && oe(n);
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
|
-
},
|
|
145
|
-
|
|
144
|
+
}, j = (e) => {
|
|
145
|
+
G(e), T(e);
|
|
146
146
|
}, qe = (e) => {
|
|
147
|
-
|
|
147
|
+
I(e);
|
|
148
148
|
const t = i(e);
|
|
149
149
|
if (!t) {
|
|
150
150
|
if (e.isRoot) {
|
|
151
|
-
const n =
|
|
151
|
+
const n = q(e);
|
|
152
152
|
T(e, n);
|
|
153
153
|
}
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
if (t.nr !== "L") {
|
|
157
|
-
const n =
|
|
157
|
+
const n = q(e);
|
|
158
158
|
T(e, n);
|
|
159
159
|
}
|
|
160
160
|
}, T = (e, t) => {
|
|
161
|
-
t || (t =
|
|
161
|
+
t || (t = U(e));
|
|
162
162
|
const n = i(e);
|
|
163
163
|
if (!n || !n.type) {
|
|
164
|
-
e.isRoot && e.we && t && e.tag !== "portal" && (e.ae ? e.we.insertBefore(t, e.ae) : e.we.tagName === "HTML" ? e.we.replaceWith(t) : e.we.appendChild(t),
|
|
164
|
+
e.isRoot && e.we && t && e.tag !== "portal" && (e.ae ? e.we.insertBefore(t, e.ae) : e.we.tagName === "HTML" ? e.we.replaceWith(t) : e.we.appendChild(t), M());
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
const c =
|
|
168
|
-
t && c && (e.tag !== "portal" && (s ? c.insertBefore(t, s) : c.appendChild(t)),
|
|
169
|
-
},
|
|
170
|
-
const c =
|
|
167
|
+
const c = O(n), s = n.type === "l" && n.nr && n.nr !== "L" ? _(n, i(n)) : _(e, n);
|
|
168
|
+
t && c && (e.tag !== "portal" && (s ? c.insertBefore(t, s) : c.appendChild(t)), M());
|
|
169
|
+
}, q = (e) => y(e.type) ? (e && e.children || []).reduce((t, n) => {
|
|
170
|
+
const c = q(n);
|
|
171
171
|
return c && t.appendChild(c), t;
|
|
172
|
-
},
|
|
173
|
-
const n = t.children || [], r = n.indexOf(e) + 1, s = n.slice(r), o =
|
|
172
|
+
}, E()) : e.el, _ = (e, t) => {
|
|
173
|
+
const n = t.children || [], r = n.indexOf(e) + 1, s = n.slice(r), o = le(s), l = t.type || "";
|
|
174
174
|
if (o)
|
|
175
175
|
return o;
|
|
176
176
|
if (!t.isRoot && y(l))
|
|
177
|
-
return
|
|
177
|
+
return _(t, i(t));
|
|
178
178
|
if (t.isRoot && y(l) && t.ae)
|
|
179
179
|
return t.ae;
|
|
180
|
-
},
|
|
180
|
+
}, le = (e) => e.reduce(
|
|
181
181
|
(t, n) => {
|
|
182
182
|
if (t) return t;
|
|
183
183
|
const { type: c, el: r } = n;
|
|
184
184
|
if (c && y(c)) {
|
|
185
|
-
const s =
|
|
185
|
+
const s = le(n.children || []);
|
|
186
186
|
if (s) return s;
|
|
187
187
|
}
|
|
188
188
|
return r && r.nodeType !== 11 ? r : t;
|
|
@@ -191,65 +191,65 @@ const Ue = (e) => {
|
|
|
191
191
|
), _e = (e) => {
|
|
192
192
|
const t = i(e), n = e.el;
|
|
193
193
|
if (e.isRoot && !t && n) {
|
|
194
|
-
|
|
194
|
+
j(e);
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
if (t && t.type && n)
|
|
198
198
|
if (n.nodeType === 11)
|
|
199
|
-
|
|
199
|
+
j(e);
|
|
200
200
|
else {
|
|
201
|
-
const c =
|
|
202
|
-
c && e.tag !== "portal" && c.replaceChild(r, n),
|
|
201
|
+
const c = O(t), r = U(e);
|
|
202
|
+
c && e.tag !== "portal" && c.replaceChild(r, n), M();
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, ue = (e, t) => {
|
|
205
205
|
x(e || {}).forEach(([n, c]) => {
|
|
206
206
|
n.match(/^on/) && t.removeEventListener(
|
|
207
207
|
n.slice(2).toLowerCase(),
|
|
208
208
|
c
|
|
209
209
|
);
|
|
210
210
|
});
|
|
211
|
-
},
|
|
211
|
+
}, I = (e) => {
|
|
212
212
|
if (e.type === "t") {
|
|
213
213
|
ze(e);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
if (e.el) {
|
|
217
217
|
const { op: t, props: n } = e;
|
|
218
|
-
|
|
218
|
+
pe(n, e.el, t), delete e.op, e.tag === "input" && (e.el.value = String(
|
|
219
219
|
n && n.value || ""
|
|
220
220
|
));
|
|
221
221
|
}
|
|
222
|
-
(e.children || []).forEach((t) =>
|
|
223
|
-
},
|
|
222
|
+
(e.children || []).forEach((t) => fe(t)), ge(e);
|
|
223
|
+
}, fe = (e) => {
|
|
224
224
|
const { nr: t } = e;
|
|
225
225
|
t !== void 0 && t !== "N" && (Ie[t](e), delete e.nr, delete e.oc, delete e.op);
|
|
226
226
|
}, Ie = {
|
|
227
227
|
A: T,
|
|
228
|
-
D:
|
|
228
|
+
D: G,
|
|
229
229
|
R: _e,
|
|
230
|
-
U:
|
|
231
|
-
S:
|
|
230
|
+
U: I,
|
|
231
|
+
S: j,
|
|
232
232
|
T: qe,
|
|
233
|
-
L:
|
|
233
|
+
L: I
|
|
234
234
|
}, ze = (e) => {
|
|
235
235
|
e.el && (e.el.nodeValue = String(e.text));
|
|
236
|
-
},
|
|
236
|
+
}, pe = (e, t, n, c) => {
|
|
237
237
|
const r = n || {};
|
|
238
238
|
x(e || {}).forEach(([s, o]) => {
|
|
239
239
|
if (o === r[s]) {
|
|
240
240
|
delete r[s];
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
|
-
c && s.match(/^on/) ?
|
|
243
|
+
c && s.match(/^on/) ? m(
|
|
244
244
|
t,
|
|
245
245
|
s,
|
|
246
246
|
o,
|
|
247
247
|
r[s]
|
|
248
|
-
) : (s === "key" || o === r[s] || s === "portal" && k(o) || (s === "innerHTML" && typeof o == "string" ? t.innerHTML = o :
|
|
248
|
+
) : (s === "key" || o === r[s] || s === "portal" && k(o) || (s === "innerHTML" && typeof o == "string" ? t.innerHTML = o : V(s, o) ? Je(
|
|
249
249
|
o,
|
|
250
|
-
|
|
250
|
+
V(s, r.style) ? r.style : {},
|
|
251
251
|
t
|
|
252
|
-
) : Te(s, o) ? o.value = t : s.match(/^on/) ?
|
|
252
|
+
) : Te(s, o) ? o.value = t : s.match(/^on/) ? m(
|
|
253
253
|
t,
|
|
254
254
|
s,
|
|
255
255
|
o,
|
|
@@ -259,52 +259,52 @@ const Ue = (e) => {
|
|
|
259
259
|
t,
|
|
260
260
|
o
|
|
261
261
|
))), delete r[s]);
|
|
262
|
-
}),
|
|
262
|
+
}), ee(r).forEach(
|
|
263
263
|
(s) => t.removeAttribute(s)
|
|
264
264
|
);
|
|
265
|
-
}, He = (e, t, n) => P.value && e !== "xmlns" ? t.setAttributeNS(null, e, n) : t.setAttribute(e, n),
|
|
265
|
+
}, He = (e, t, n) => P.value && e !== "xmlns" ? t.setAttributeNS(null, e, n) : t.setAttribute(e, n), U = (e, t) => {
|
|
266
266
|
let n;
|
|
267
|
-
const { type: c, tag: r, text: s, props: o, children: l = [] } = e,
|
|
268
|
-
if (
|
|
267
|
+
const { type: c, tag: r, text: s, props: o, children: l = [] } = e, f = y(c);
|
|
268
|
+
if (Ae(e), r === "svg" && (P.value = String(o && o.xmlns)), t)
|
|
269
269
|
n = e.el;
|
|
270
270
|
else {
|
|
271
271
|
if (!c)
|
|
272
|
-
n =
|
|
273
|
-
else if (
|
|
274
|
-
n =
|
|
272
|
+
n = E();
|
|
273
|
+
else if (f)
|
|
274
|
+
n = E();
|
|
275
275
|
else if (c === "e" && r)
|
|
276
276
|
r === "portal" && o && o.portal ? n = o.portal : n = P.value ? document.createElementNS(P.value, r) : Qe(r);
|
|
277
|
-
else if (c === "t" &&
|
|
277
|
+
else if (c === "t" && ne(s))
|
|
278
278
|
n = document.createTextNode(String(s));
|
|
279
279
|
else
|
|
280
280
|
throw Error("Invalid wDom");
|
|
281
281
|
e.el = n;
|
|
282
282
|
}
|
|
283
|
-
return Ge(l, n, t),
|
|
283
|
+
return Ge(l, n, t), pe(o, n, null, t), Ue(e), r === "svg" && (P.value = ""), n;
|
|
284
284
|
}, Ge = (e, t, n) => {
|
|
285
285
|
const c = e.reduce((r, s) => {
|
|
286
286
|
if (s.type) {
|
|
287
|
-
const o =
|
|
287
|
+
const o = U(s, n);
|
|
288
288
|
s.tag !== "portal" && !n && r.appendChild(o);
|
|
289
289
|
}
|
|
290
290
|
return r;
|
|
291
|
-
},
|
|
291
|
+
}, E());
|
|
292
292
|
!n && t && c.hasChildNodes() && t.appendChild(c);
|
|
293
|
-
},
|
|
293
|
+
}, m = (e, t, n, c) => {
|
|
294
294
|
const r = t.slice(2).toLowerCase();
|
|
295
295
|
c !== n && (c && e.removeEventListener(r, c), n && e.addEventListener(r, n));
|
|
296
296
|
}, Je = (e, t, n) => {
|
|
297
297
|
const c = { ...t }, r = n instanceof HTMLElement ? n : null, s = r == null ? void 0 : r.style;
|
|
298
298
|
if (!s) return;
|
|
299
299
|
const o = s;
|
|
300
|
-
x(e).forEach(([l,
|
|
301
|
-
o[l] =
|
|
300
|
+
x(e).forEach(([l, f]) => {
|
|
301
|
+
o[l] = f, delete c[l];
|
|
302
302
|
}), x(c).forEach(([l]) => {
|
|
303
303
|
o[l] = "";
|
|
304
304
|
});
|
|
305
|
-
},
|
|
305
|
+
}, O = (e) => {
|
|
306
306
|
const t = y(e.type);
|
|
307
|
-
return e.isRoot && t ? e.we : t ?
|
|
307
|
+
return e.isRoot && t ? e.we : t ? O(i(e)) : e.el;
|
|
308
308
|
}, A = (e, t) => Xe(
|
|
309
309
|
e,
|
|
310
310
|
Le[be(e)](e, t),
|
|
@@ -321,9 +321,9 @@ const Ue = (e) => {
|
|
|
321
321
|
n
|
|
322
322
|
)), c.nr = r, Ye(c, n, r), !s && n && (n.il = !0, delete n.children), (n == null ? void 0 : n.tag) === "portal" && (c.tag = "portal"), c;
|
|
323
323
|
}, Ye = (e, t, n) => {
|
|
324
|
-
n !== "A" && t && (e.el = t.el), (n === "D" || n === "R" || n === "S") && (t && (
|
|
324
|
+
n !== "A" && t && (e.el = t.el), (n === "D" || n === "R" || n === "S") && (t && (L(t), F(t)), e.oc = t && t.children), e.op = t && t.props;
|
|
325
325
|
}, Ze = (e, t, n) => {
|
|
326
|
-
if (
|
|
326
|
+
if (Ee(e)) return "D";
|
|
327
327
|
if (e.type === "t" && t && e.text === (n && n.text) || e === n) return "N";
|
|
328
328
|
if (!(n && n.type)) return "A";
|
|
329
329
|
const s = i(n), o = !e.isRoot && s && s.type === "l" && C(e);
|
|
@@ -342,16 +342,16 @@ const Ue = (e) => {
|
|
|
342
342
|
(o, l) => p(o) === p(c[l])
|
|
343
343
|
)), s;
|
|
344
344
|
}, Ve = (e, t) => {
|
|
345
|
-
e && t !== e && (
|
|
345
|
+
e && t !== e && (ee(e).forEach((n) => delete e[n]), x(t || {}).forEach(([n, c]) => e[n] = c));
|
|
346
346
|
}, Ke = (e, t) => {
|
|
347
347
|
e && (e.splice(0, e.length), t && t.forEach((n) => e.push(n)));
|
|
348
348
|
}, me = (e, t) => {
|
|
349
349
|
const { compProps: n, compChild: c } = e, { props: r, children: s } = t;
|
|
350
350
|
return n && Ve(n, r), c && s && c !== s && Ke(c, s), e.reRender && e.reRender();
|
|
351
|
-
}, we = (e, t, n) =>
|
|
352
|
-
(t) =>
|
|
351
|
+
}, we = (e, t, n) => b(e) ? t && n ? me(n, e) : e.resolve() : e, We = (e, t, n) => t && n ? et(e, n) : De(e), De = (e) => (e.children || []).map(
|
|
352
|
+
(t) => N(A(t), { getParent: () => e })
|
|
353
353
|
), et = (e, t) => e.type === "l" && C((e.children || [])[0]) ? tt(e, t) : (e.children || []).map(
|
|
354
|
-
(n, c) =>
|
|
354
|
+
(n, c) => N(A(n, (t.children || [])[c]), {
|
|
355
355
|
getParent: () => e
|
|
356
356
|
})
|
|
357
357
|
), tt = (e, t) => {
|
|
@@ -360,7 +360,7 @@ const Ue = (e) => {
|
|
|
360
360
|
t
|
|
361
361
|
);
|
|
362
362
|
return c.forEach((r) => {
|
|
363
|
-
|
|
363
|
+
L(r), F(r), G(r);
|
|
364
364
|
}), n;
|
|
365
365
|
}, nt = (e, t) => {
|
|
366
366
|
const n = [...t.children || []];
|
|
@@ -370,39 +370,39 @@ const Ue = (e) => {
|
|
|
370
370
|
}), n];
|
|
371
371
|
}, ct = (e, t) => t.find(
|
|
372
372
|
(n) => p(n) === p(e)
|
|
373
|
-
),
|
|
374
|
-
let
|
|
373
|
+
), z = /* @__PURE__ */ new Map();
|
|
374
|
+
let H = !1;
|
|
375
375
|
const st = (e, t) => {
|
|
376
|
-
const n =
|
|
376
|
+
const n = u.get(e);
|
|
377
377
|
n && (n.up = () => {
|
|
378
|
-
|
|
378
|
+
z.set(e, t), H || (H = !0, queueMicrotask(rt));
|
|
379
379
|
});
|
|
380
|
-
},
|
|
381
|
-
const t =
|
|
380
|
+
}, ie = (e) => () => {
|
|
381
|
+
const t = u.get(e), n = t && t.up;
|
|
382
382
|
return n ? (n(), !0) : !1;
|
|
383
383
|
}, rt = () => {
|
|
384
|
-
|
|
384
|
+
z.forEach((e) => {
|
|
385
385
|
e();
|
|
386
|
-
}),
|
|
386
|
+
}), z.clear(), H = !1;
|
|
387
387
|
}, St = (e, t = () => []) => {
|
|
388
388
|
const n = d();
|
|
389
389
|
if (!n) return;
|
|
390
|
-
const c =
|
|
391
|
-
c && (c.upR.push(() =>
|
|
390
|
+
const c = u.get(n);
|
|
391
|
+
c && (c.upR.push(() => K(e, t)), K(e, t));
|
|
392
392
|
}, ot = () => {
|
|
393
393
|
const e = d();
|
|
394
394
|
if (!e) return;
|
|
395
|
-
const t =
|
|
395
|
+
const t = u.get(e), n = t && t.upR;
|
|
396
396
|
n && n.length && n.forEach((c) => c());
|
|
397
|
-
},
|
|
397
|
+
}, J = (e, ...t) => ({
|
|
398
398
|
type: "f",
|
|
399
399
|
// fragment
|
|
400
400
|
[h]: !0,
|
|
401
401
|
children: t
|
|
402
402
|
}), lt = (e, t, ...n) => {
|
|
403
|
-
const c = { value: void 0 }, r =
|
|
404
|
-
return
|
|
405
|
-
},
|
|
403
|
+
const c = { value: void 0 }, r = de(c, n), s = pt(e, t || {}, r);
|
|
404
|
+
return b(s) || (c.value = s), s;
|
|
405
|
+
}, Mt = (e, t) => lt("portal", { portal: t }, e), Et = (e) => (t, n) => e, Tt = (e) => (t, n) => (w.add(e), e), ut = (e, t, n) => {
|
|
406
406
|
const c = (r, s) => {
|
|
407
407
|
if (!(!r || s.has(r))) {
|
|
408
408
|
if (s.add(r), r.compChild) {
|
|
@@ -417,17 +417,17 @@ const st = (e, t) => {
|
|
|
417
417
|
if (c.il)
|
|
418
418
|
return;
|
|
419
419
|
a.value = !0;
|
|
420
|
-
const r = ae(e, t, n), s = A(r, c), { isRoot: o, getParent: l, we:
|
|
420
|
+
const r = ae(e, t, n), s = A(r, c), { isRoot: o, getParent: l, we: f, ae: g } = c;
|
|
421
421
|
if (s.getParent = l, !o && l) {
|
|
422
|
-
const
|
|
423
|
-
|
|
422
|
+
const B = l(), X = B && B.children || [], Y = X.indexOf(c);
|
|
423
|
+
Y !== -1 && X.splice(Y, 1, s), ut(B, c, s);
|
|
424
424
|
} else
|
|
425
|
-
s.isRoot = !0, s.we =
|
|
426
|
-
a.value = !1,
|
|
425
|
+
s.isRoot = !0, s.we = f, s.ae = g;
|
|
426
|
+
a.value = !1, fe(s);
|
|
427
427
|
}, pt = (e, t, n) => {
|
|
428
|
-
if (
|
|
429
|
-
return
|
|
430
|
-
if (
|
|
428
|
+
if (te(e))
|
|
429
|
+
return J(t, ...n);
|
|
430
|
+
if (b(e)) {
|
|
431
431
|
const c = ae(e, t, n);
|
|
432
432
|
return a.value ? c : c.resolve();
|
|
433
433
|
}
|
|
@@ -439,13 +439,13 @@ const st = (e, t) => {
|
|
|
439
439
|
props: t,
|
|
440
440
|
children: n
|
|
441
441
|
};
|
|
442
|
-
},
|
|
443
|
-
(n) =>
|
|
444
|
-
),
|
|
442
|
+
}, de = (e, t) => t.map(
|
|
443
|
+
(n) => N(he(n), { getParent: () => e.value })
|
|
444
|
+
), he = (e) => {
|
|
445
445
|
if (e == null || e === !1)
|
|
446
446
|
return { type: null, [h]: !0 };
|
|
447
447
|
if (Array.isArray(e)) {
|
|
448
|
-
const t = { value: void 0 }, n =
|
|
448
|
+
const t = { value: void 0 }, n = de(t, e), c = {
|
|
449
449
|
type: "l",
|
|
450
450
|
// loop (array mapping)
|
|
451
451
|
[h]: !0,
|
|
@@ -461,10 +461,10 @@ const st = (e, t) => {
|
|
|
461
461
|
const s = e(t, n);
|
|
462
462
|
let o;
|
|
463
463
|
if (typeof s == "function") {
|
|
464
|
-
const
|
|
465
|
-
o =
|
|
464
|
+
const f = s;
|
|
465
|
+
o = w.has(f) ? f(t, n) : f(ie(c), t, n);
|
|
466
466
|
} else
|
|
467
|
-
o = (
|
|
467
|
+
o = (f) => e(f, n);
|
|
468
468
|
const l = dt(
|
|
469
469
|
o,
|
|
470
470
|
c,
|
|
@@ -477,17 +477,17 @@ const st = (e, t) => {
|
|
|
477
477
|
const c = e, r = n, s = it(e, t, r);
|
|
478
478
|
return { ctor: c, props: t, children: r, resolve: s };
|
|
479
479
|
}, dt = (e, t, n, c, r) => {
|
|
480
|
-
const s = (
|
|
480
|
+
const s = (g) => he(e(g)), { wrappedComponentMaker: o, customNode: l } = yt(
|
|
481
481
|
s,
|
|
482
482
|
c
|
|
483
|
-
),
|
|
483
|
+
), f = ht(
|
|
484
484
|
o,
|
|
485
485
|
t,
|
|
486
486
|
n,
|
|
487
487
|
c,
|
|
488
488
|
r
|
|
489
489
|
);
|
|
490
|
-
return ye(l, t, n, c, r,
|
|
490
|
+
return ye(l, t, n, c, r, f), l;
|
|
491
491
|
}, ht = (e, t, n, c, r) => {
|
|
492
492
|
const s = () => at(e, t, n, c, r, s);
|
|
493
493
|
return s;
|
|
@@ -496,21 +496,13 @@ const st = (e, t) => {
|
|
|
496
496
|
const o = e(c);
|
|
497
497
|
return ye(o, t, n, c, r, s), o;
|
|
498
498
|
}, yt = (e, t) => {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return { wrappedComponentMaker: e, customNode: n };
|
|
502
|
-
const c = (r) => {
|
|
503
|
-
const s = e(r);
|
|
504
|
-
if (!s || !s.reRender) {
|
|
505
|
-
const l = X(s), u = N({}, l);
|
|
506
|
-
return l.getParent = () => u, u;
|
|
507
|
-
}
|
|
508
|
-
const o = N({}, s);
|
|
499
|
+
const n = (r) => {
|
|
500
|
+
const s = e(r), o = J({}, s);
|
|
509
501
|
return s.getParent = () => o, o;
|
|
510
|
-
};
|
|
511
|
-
return
|
|
502
|
+
}, c = n(t);
|
|
503
|
+
return { wrappedComponentMaker: n, customNode: c };
|
|
512
504
|
}, ye = (e, t, n, c, r, s) => {
|
|
513
|
-
|
|
505
|
+
N(e, {
|
|
514
506
|
compProps: c,
|
|
515
507
|
compChild: r,
|
|
516
508
|
ctor: n,
|
|
@@ -524,27 +516,27 @@ const st = (e, t) => {
|
|
|
524
516
|
e.compChild || r,
|
|
525
517
|
e
|
|
526
518
|
)
|
|
527
|
-
),
|
|
519
|
+
), Z(t, "vd") && (Z(t, "vd").value = e);
|
|
528
520
|
}, Nt = (e) => ({ value: e }), bt = () => Promise.resolve(), Lt = () => {
|
|
529
521
|
const e = d();
|
|
530
|
-
return e ?
|
|
522
|
+
return e ? ie(e) : () => !1;
|
|
531
523
|
};
|
|
532
524
|
export {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
525
|
+
J as Fragment,
|
|
526
|
+
u as componentMap,
|
|
527
|
+
ie as componentUpdate,
|
|
536
528
|
vt as disposeComponentEntry,
|
|
537
529
|
d as getComponentKey,
|
|
538
|
-
|
|
530
|
+
Z as getComponentSubInfo,
|
|
539
531
|
lt as h,
|
|
540
532
|
kt as isPropType,
|
|
541
533
|
Tt as lmount,
|
|
542
|
-
|
|
543
|
-
|
|
534
|
+
w as lmountComponentSet,
|
|
535
|
+
Et as mount,
|
|
544
536
|
Rt as mountCallback,
|
|
545
537
|
Pt as mountReadyCallback,
|
|
546
538
|
bt as nextTick,
|
|
547
|
-
|
|
539
|
+
Mt as portal,
|
|
548
540
|
Nt as ref,
|
|
549
541
|
xt as render,
|
|
550
542
|
ft as replaceWDom,
|