lithent 1.12.0 → 1.13.1
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/README.md +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/lithent.mjs +79 -72
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/dist/wDom.d.ts +10 -0
- package/examples/dist/assets/index-lX3XWOlo.js +2 -0
- package/examples/dist/assets/index-lX3XWOlo.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/helper/dist/lithentHelper.mjs +76 -64
- package/helper/dist/lithentHelper.mjs.map +1 -1
- package/helper/dist/lithentHelper.umd.js +1 -1
- package/helper/dist/lithentHelper.umd.js.map +1 -1
- package/helper/src/hook/store.ts +40 -17
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/render.ts +21 -9
- package/src/tests/core-portal.tsx +110 -0
- package/src/wDom.ts +4 -0
- package/examples/dist/assets/index-BBugEsmo.js +0 -2
- package/examples/dist/assets/index-BBugEsmo.js.map +0 -1
package/README.md
CHANGED
|
@@ -78,14 +78,14 @@ pnpm add lithent
|
|
|
78
78
|
|
|
79
79
|
#### Or Use CDN
|
|
80
80
|
|
|
81
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
82
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
83
|
-
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
84
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
85
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
86
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
87
|
-
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
88
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
81
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.13.1/dist/lithent.umd.js
|
|
82
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.13.1/helper/dist/lithentHelper.umd.js
|
|
83
|
+
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.13.1/ftags/dist/lithentFTags.umd.js
|
|
84
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.13.1/tag/dist/lithentTag.umd.js
|
|
85
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.13.1/dist/lithent.mjs
|
|
86
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.13.1/helper/dist/lithentHelper.mjs
|
|
87
|
+
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.13.1/ftags/dist/lithentFTags.mjs
|
|
88
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.13.1/tag/dist/lithentTag.mjs
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -110,9 +110,9 @@ import { fTags, fFragment, fMount } from 'lithent/ftags';
|
|
|
110
110
|
const { section, div, p, br, strong } = fTags;
|
|
111
111
|
|
|
112
112
|
/* UMD
|
|
113
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
114
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
115
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
113
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/dist/lithent.umd.js"></script>
|
|
114
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/helper/dist/lithentHelper.umd.js"></script>
|
|
115
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/ftags/dist/lithentFTags.umd.js"></script>
|
|
116
116
|
|
|
117
117
|
const { render } = lithent;
|
|
118
118
|
const { fTags, fMount, fFragment } = lithentFTags;
|
|
@@ -184,10 +184,10 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
184
184
|
#### With UMD
|
|
185
185
|
|
|
186
186
|
```html
|
|
187
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
188
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
189
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
190
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
187
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/dist/lithent.umd.js"></script>
|
|
188
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/helper/dist/lithentHelper.umd.js"></script-->
|
|
189
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/tag/dist/lithentTag.umd.js"></script>
|
|
190
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.13.1/ftags/dist/lithentFTags.umd.js"></script-->
|
|
191
191
|
|
|
192
192
|
<div id="root"></div>
|
|
193
193
|
|
package/dist/index.d.ts
CHANGED
package/dist/lithent.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const C = (e) => typeof e == "object" && !("resolve" in e),
|
|
1
|
+
const C = (e) => typeof e == "object" && !("resolve" in e), a = (e, t) => C(e) && e.type === t, pe = (e, t) => "ctor" in e ? e.ctor === (t == null ? void 0 : t.ctor) : e === (t == null ? void 0 : t.ctor), he = (e, t) => {
|
|
2
2
|
var s, c;
|
|
3
3
|
return C(e) && (t == null ? void 0 : t.type) === "fragment" && ((s = t == null ? void 0 : t.children) == null ? void 0 : s.length) === ((c = e == null ? void 0 : e.children) == null ? void 0 : c.length);
|
|
4
4
|
}, ie = (e, t) => {
|
|
@@ -10,9 +10,9 @@ const C = (e) => typeof e == "object" && !("resolve" in e), N = (e, t) => C(e) &
|
|
|
10
10
|
}, d = (e) => {
|
|
11
11
|
var t, s;
|
|
12
12
|
return ((t = e == null ? void 0 : e.compProps) == null ? void 0 : t.key) ?? ((s = e == null ? void 0 : e.props) == null ? void 0 : s.key);
|
|
13
|
-
}, v = (e) => e && ["fragment", "loop"].includes(e),
|
|
13
|
+
}, v = (e) => e && ["fragment", "loop"].includes(e), N = (e) => typeof e == "function" && !Z(e) || typeof e == "object" && "resolve" in e, Z = (e) => typeof e == "function" && e === $, V = (e) => C(e) && !e.type, R = (e) => e != null, H = (e, t) => e === "style" && typeof t == "object", ve = (e, t) => e === "ref" && typeof t == "object", Ce = (e) => e.nodeType === 1 && e.tagName === "OPTION", ke = (e) => e.nodeType === 1 && e.tagName === "TEXTAREA", Re = (e) => e.nodeType === 1 && ["radio", "checkbox"].includes(e.type), Ee = (e) => {
|
|
14
14
|
let t = "et";
|
|
15
|
-
return
|
|
15
|
+
return N(e) ? t = "c" : a(e, "fragment") ? t = "f" : a(e, "element") ? t = "e" : a(e, "loop") ? t = "l" : a(e, "text") ? t = "t" : V(e) && (t = "et"), t;
|
|
16
16
|
}, Pe = {
|
|
17
17
|
c: pe,
|
|
18
18
|
l: ye,
|
|
@@ -20,7 +20,7 @@ const C = (e) => typeof e == "object" && !("resolve" in e), N = (e, t) => C(e) &
|
|
|
20
20
|
e: ie,
|
|
21
21
|
f: he,
|
|
22
22
|
et: G
|
|
23
|
-
}, i = (e) => e.getParent && e.getParent(), E = Object.entries, K = Object.keys,
|
|
23
|
+
}, i = (e) => e.getParent && e.getParent(), E = Object.entries, K = Object.keys, T = Object.assign, k = { value: "" }, P = { value: {} }, O = { value: !1 }, f = /* @__PURE__ */ new WeakMap(), xe = (e) => {
|
|
24
24
|
f.set(e, {
|
|
25
25
|
vd: { value: null },
|
|
26
26
|
up: () => {
|
|
@@ -32,33 +32,33 @@ const C = (e) => typeof e == "object" && !("resolve" in e), N = (e, t) => C(e) &
|
|
|
32
32
|
mts: [],
|
|
33
33
|
umts: []
|
|
34
34
|
});
|
|
35
|
-
}, x = () => P.value, g = (e, t) => f.get(e)[t], Se = (e) => P.value = e,
|
|
35
|
+
}, x = () => P.value, g = (e, t) => f.get(e)[t], Se = (e) => P.value = e, ae = (e) => {
|
|
36
36
|
P.value = e, xe(e);
|
|
37
|
-
},
|
|
37
|
+
}, Ne = (e) => {
|
|
38
38
|
f.get(x()).umts.push(e);
|
|
39
|
-
},
|
|
39
|
+
}, b = (e) => {
|
|
40
40
|
const { compKey: t } = e;
|
|
41
|
-
t &&
|
|
41
|
+
t && Te(t), m(e);
|
|
42
42
|
}, m = (e) => {
|
|
43
43
|
(e.children || []).forEach((t) => {
|
|
44
|
-
t.compKey ?
|
|
44
|
+
t.compKey ? b(t) : m(t);
|
|
45
45
|
});
|
|
46
|
-
},
|
|
46
|
+
}, Te = (e) => {
|
|
47
47
|
const t = f.get(e);
|
|
48
48
|
t && (t.umts.forEach((s) => s()), t.umts = [], f.delete(e));
|
|
49
49
|
};
|
|
50
50
|
let M = [];
|
|
51
|
-
const
|
|
52
|
-
M.forEach((e) =>
|
|
53
|
-
},
|
|
51
|
+
const _ = () => {
|
|
52
|
+
M.forEach((e) => Ue(e)), M = [];
|
|
53
|
+
}, be = (e) => {
|
|
54
54
|
e.compKey && M.push(e);
|
|
55
|
-
},
|
|
55
|
+
}, dt = (e) => f.get(x()).mts.push(e), Ue = (e) => {
|
|
56
56
|
const { compKey: t } = e;
|
|
57
57
|
if (t) {
|
|
58
58
|
const s = f.get(t), c = s == null ? void 0 : s.mts, n = s == null ? void 0 : s.upS;
|
|
59
59
|
P.value = t, n && (n.value = 0), c && (s.mts = [], c.forEach((r) => {
|
|
60
60
|
const u = r();
|
|
61
|
-
u &&
|
|
61
|
+
u && Ne(u);
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
64
64
|
}, J = (e, t = () => []) => {
|
|
@@ -74,13 +74,13 @@ const I = () => {
|
|
|
74
74
|
const s = f.get(t), c = s == null ? void 0 : s.upCB, n = s == null ? void 0 : s.upS;
|
|
75
75
|
P.value = t, n && (n.value = 0), e.ctor && c && (s.upCB = [], c.forEach((r) => r()));
|
|
76
76
|
}
|
|
77
|
-
}, Ae = (e, t) => e.length ? e.some((s, c) => s !== t[c]) : !0, Le = (e) => e === "className" ? "class" : e, w = (e) => e.replace(/^on(.*)/, (t, s) => s.toLowerCase()),
|
|
77
|
+
}, Ae = (e, t) => e.length ? e.some((s, c) => s !== t[c]) : !0, Le = (e) => e === "className" ? "class" : e, w = (e) => e.replace(/^on(.*)/, (t, s) => s.toLowerCase()), I = () => new DocumentFragment(), Y = (e) => document.createElement(e), ot = (e, t, s) => {
|
|
78
78
|
t ?? (t = document.body), e.isRoot = !0, e.wrapElement = t;
|
|
79
79
|
const c = F(e);
|
|
80
|
-
return s ? (e.afterElement = s, t.insertBefore(c, s)) : t.appendChild(c),
|
|
80
|
+
return s ? (e.afterElement = s, t.insertBefore(c, s)) : t.appendChild(c), _(), () => {
|
|
81
81
|
var r;
|
|
82
82
|
const n = (r = f.get(e.compProps || {})) == null ? void 0 : r.vd.value;
|
|
83
|
-
n &&
|
|
83
|
+
n && b(n), U(n || e), Oe(n || e);
|
|
84
84
|
};
|
|
85
85
|
}, W = (e) => {
|
|
86
86
|
const { needRerender: t } = e;
|
|
@@ -88,14 +88,14 @@ const I = () => {
|
|
|
88
88
|
A: X,
|
|
89
89
|
D: z,
|
|
90
90
|
R: Qe,
|
|
91
|
-
U:
|
|
92
|
-
CNSU:
|
|
91
|
+
U: j,
|
|
92
|
+
CNSU: j,
|
|
93
93
|
SR: te,
|
|
94
94
|
SU: Me
|
|
95
95
|
}[t](e), delete e.needRerender, delete e.oldChildren, delete e.oldProps);
|
|
96
|
-
},
|
|
96
|
+
}, U = (e) => {
|
|
97
97
|
e.props && e.el && ne(e.props, e.el), (e.children || []).forEach((t) => {
|
|
98
|
-
|
|
98
|
+
U(t);
|
|
99
99
|
});
|
|
100
100
|
}, Oe = (e) => {
|
|
101
101
|
D(e, e.wrapElement);
|
|
@@ -116,7 +116,7 @@ const I = () => {
|
|
|
116
116
|
}, te = (e) => {
|
|
117
117
|
z(e), X(e);
|
|
118
118
|
}, Me = (e) => {
|
|
119
|
-
if (
|
|
119
|
+
if (j(e), i(e).needRerender !== "CNSU") {
|
|
120
120
|
const s = se(e);
|
|
121
121
|
X(e, s);
|
|
122
122
|
}
|
|
@@ -125,12 +125,12 @@ const I = () => {
|
|
|
125
125
|
const s = i(e);
|
|
126
126
|
if (s.type) {
|
|
127
127
|
const c = A(s), r = s.type === "loop" && s.needRerender && s.needRerender !== "CNSU" ? Q(s, i(s)) : Q(e, s);
|
|
128
|
-
t && c && (r ? c.insertBefore(t, r) : c.appendChild(t),
|
|
128
|
+
t && c && (e.tag !== "portal" && (r ? c.insertBefore(t, r) : c.appendChild(t)), _());
|
|
129
129
|
}
|
|
130
130
|
}, se = (e) => v(e.type) ? ((e == null ? void 0 : e.children) || []).reduce((t, s) => {
|
|
131
131
|
const c = se(s);
|
|
132
132
|
return c && t.appendChild(c), t;
|
|
133
|
-
},
|
|
133
|
+
}, I()) : e.el, Q = (e, t) => {
|
|
134
134
|
const s = t.children || [], n = s.indexOf(e) + 1, r = s.slice(n), u = ce(r), l = t.type || "";
|
|
135
135
|
if (u)
|
|
136
136
|
return u;
|
|
@@ -151,7 +151,7 @@ const I = () => {
|
|
|
151
151
|
te(e);
|
|
152
152
|
else {
|
|
153
153
|
const c = A(t), n = F(e);
|
|
154
|
-
c && c.replaceChild(n, s),
|
|
154
|
+
c && e.tag !== "portal" && c.replaceChild(n, s), _();
|
|
155
155
|
}
|
|
156
156
|
}, ne = (e, t) => {
|
|
157
157
|
E(e || {}).forEach(([s, c]) => {
|
|
@@ -160,11 +160,11 @@ const I = () => {
|
|
|
160
160
|
c
|
|
161
161
|
);
|
|
162
162
|
});
|
|
163
|
-
},
|
|
163
|
+
}, j = (e) => {
|
|
164
164
|
var s;
|
|
165
165
|
const t = e.el;
|
|
166
166
|
if (e.type === "text") {
|
|
167
|
-
|
|
167
|
+
je(e);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
if (t) {
|
|
@@ -172,23 +172,23 @@ const I = () => {
|
|
|
172
172
|
re(n, t, c), delete e.oldProps, e.tag === "input" && (t.value = String(((s = e == null ? void 0 : e.props) == null ? void 0 : s.value) || ""));
|
|
173
173
|
}
|
|
174
174
|
(e.children || []).forEach((c) => W(c)), Fe(e);
|
|
175
|
-
},
|
|
175
|
+
}, je = (e) => {
|
|
176
176
|
const t = e.el;
|
|
177
177
|
t && (t.nodeValue = String(e.text));
|
|
178
178
|
}, re = (e, t, s) => {
|
|
179
179
|
const c = { ...s };
|
|
180
180
|
E(e || {}).forEach(([n, r]) => {
|
|
181
181
|
let u = !0;
|
|
182
|
-
n === "key" || r === c[n] || (n === "innerHTML" && typeof r == "string" ? t.innerHTML = r : H(n, r) ? ze(
|
|
182
|
+
n === "key" || r === c[n] || n === "portal" && typeof r == "object" || (n === "innerHTML" && typeof r == "string" ? t.innerHTML = r : H(n, r) ? ze(
|
|
183
183
|
r,
|
|
184
184
|
H(n, c.style) ? c.style : {},
|
|
185
185
|
t
|
|
186
|
-
) : ve(n, r) ? r.value = t : n.match(/^on/) ?
|
|
186
|
+
) : ve(n, r) ? r.value = t : n.match(/^on/) ? Ie(
|
|
187
187
|
t,
|
|
188
188
|
n,
|
|
189
189
|
r,
|
|
190
190
|
c[n]
|
|
191
|
-
) : Re(t) && n === "checked" ? t.checked = !!r : ke(t) && n === "value" ? t.value = r : Ce(t) && n === "selected" ? t.selected = !!r : n && ([u, r] = qe(r), u &&
|
|
191
|
+
) : Re(t) && n === "checked" ? t.checked = !!r : ke(t) && n === "value" ? t.value = r : Ce(t) && n === "selected" ? t.selected = !!r : n && ([u, r] = qe(r), u && Be(
|
|
192
192
|
Le(n),
|
|
193
193
|
t,
|
|
194
194
|
r
|
|
@@ -196,7 +196,7 @@ const I = () => {
|
|
|
196
196
|
}), K(c).forEach(
|
|
197
197
|
(n) => t.removeAttribute(n)
|
|
198
198
|
);
|
|
199
|
-
},
|
|
199
|
+
}, Be = (e, t, s) => {
|
|
200
200
|
k.value && e !== "xmlns" ? t.setAttributeNS(null, e, s) : t.setAttribute(e, s);
|
|
201
201
|
}, qe = (e) => {
|
|
202
202
|
let t = !0;
|
|
@@ -204,14 +204,20 @@ const I = () => {
|
|
|
204
204
|
}, F = (e) => {
|
|
205
205
|
let t;
|
|
206
206
|
const { type: s, tag: c, text: n, props: r, children: u = [] } = e, l = v(s);
|
|
207
|
-
return c === "svg" && (k.value = String(r == null ? void 0 : r.xmlns)), l ? t =
|
|
208
|
-
},
|
|
207
|
+
return c === "svg" && (k.value = String(r == null ? void 0 : r.xmlns)), l ? t = I() : s === "element" && c ? c === "portal" && (r != null && r.portal) ? t = r.portal : t = k.value ? document.createElementNS(k.value, c) : Y(c) : s === "text" && R(n) ? t = document.createTextNode(String(n)) : t = Y("e"), _e(u, t), re(r, t), e.el = t, be(e), c === "svg" && (k.value = ""), t;
|
|
208
|
+
}, _e = (e, t) => {
|
|
209
209
|
const s = e.reduce(
|
|
210
|
-
(c, n) =>
|
|
211
|
-
|
|
210
|
+
(c, n) => {
|
|
211
|
+
if (n.type) {
|
|
212
|
+
const r = F(n);
|
|
213
|
+
n.tag !== "portal" && c.appendChild(r);
|
|
214
|
+
}
|
|
215
|
+
return c;
|
|
216
|
+
},
|
|
217
|
+
I()
|
|
212
218
|
);
|
|
213
219
|
t && s.hasChildNodes() && t.appendChild(s);
|
|
214
|
-
},
|
|
220
|
+
}, Ie = (e, t, s, c) => {
|
|
215
221
|
const n = w(t);
|
|
216
222
|
c !== s && (c && e.removeEventListener(n, c), s && e.addEventListener(n, s));
|
|
217
223
|
}, ze = (e, t, s) => {
|
|
@@ -236,7 +242,7 @@ const I = () => {
|
|
|
236
242
|
], r = Ge(...n), u = r === "N";
|
|
237
243
|
return u || (c.children = Ke(...n)), c.needRerender = r, $e(c, s, r), !u && s && (s.isLegacy = !0, delete s.children), c;
|
|
238
244
|
}, $e = (e, t, s) => {
|
|
239
|
-
s !== "A" && t && (e.el = t.el), s && ["D", "R", "SR"].includes(s) && (t && (
|
|
245
|
+
s !== "A" && t && (e.el = t.el), s && ["D", "R", "SR"].includes(s) && (t && (b(t), U(t)), e.oldChildren = t == null ? void 0 : t.children), e.oldProps = t == null ? void 0 : t.props;
|
|
240
246
|
}, Ge = (e, t, s) => {
|
|
241
247
|
const c = s && s.type, n = V(e), r = e.isRoot, u = s && i(s), l = !r && (u == null ? void 0 : u.type), h = d(e), o = l === "loop" && R(h), y = e.type === "text" && t && e.text === (s == null ? void 0 : s.text), S = e === s;
|
|
242
248
|
let p;
|
|
@@ -258,10 +264,10 @@ const I = () => {
|
|
|
258
264
|
}, Ze = (e, t) => {
|
|
259
265
|
const { compProps: s, compChild: c } = e, { props: n, children: r } = t;
|
|
260
266
|
return s && Je(s, n), c && Ye(c, r), e.reRender && e.reRender();
|
|
261
|
-
}, Ve = (e, t, s) =>
|
|
262
|
-
(t) =>
|
|
267
|
+
}, Ve = (e, t, s) => N(e) ? t && s ? Ze(s, e) : e.resolve() : e, Ke = (e, t, s) => t && s ? me(e, s) : ge(e), ge = (e) => (e.children || []).map(
|
|
268
|
+
(t) => T(L(t), { getParent: () => e })
|
|
263
269
|
), me = (e, t) => e.type === "loop" && R(d((e.children || [])[0])) ? we(e, t) : (e.children || []).map(
|
|
264
|
-
(s, c) =>
|
|
270
|
+
(s, c) => T(L(s, (t.children || [])[c]), {
|
|
265
271
|
getParent: () => e
|
|
266
272
|
})
|
|
267
273
|
), we = (e, t) => {
|
|
@@ -270,7 +276,7 @@ const I = () => {
|
|
|
270
276
|
t
|
|
271
277
|
);
|
|
272
278
|
return c.forEach((n) => {
|
|
273
|
-
|
|
279
|
+
b(n), U(n), z(n);
|
|
274
280
|
}), s;
|
|
275
281
|
}, We = (e, t) => {
|
|
276
282
|
const s = [...e.children || []], c = [...t.children || []];
|
|
@@ -281,10 +287,10 @@ const I = () => {
|
|
|
281
287
|
}, De = (e, t) => t.find(
|
|
282
288
|
(s) => d(s) === d(e)
|
|
283
289
|
);
|
|
284
|
-
let
|
|
290
|
+
let B = [], q = !1;
|
|
285
291
|
const ue = (e, t) => {
|
|
286
292
|
f.get(e).up = () => {
|
|
287
|
-
|
|
293
|
+
B.push({
|
|
288
294
|
compKey: e,
|
|
289
295
|
exec: t
|
|
290
296
|
}), q || (q = !0, queueMicrotask(tt));
|
|
@@ -295,10 +301,10 @@ const ue = (e, t) => {
|
|
|
295
301
|
let s = !1;
|
|
296
302
|
return t && (t(), s = !0), s;
|
|
297
303
|
}, tt = () => {
|
|
298
|
-
|
|
304
|
+
B.forEach((e) => {
|
|
299
305
|
e.exec();
|
|
300
|
-
}),
|
|
301
|
-
},
|
|
306
|
+
}), B = [], q = !1;
|
|
307
|
+
}, pt = (e, t = () => []) => {
|
|
302
308
|
f.get(x()).upR.push(() => J(e, t)), J(e, t);
|
|
303
309
|
}, st = () => {
|
|
304
310
|
var t;
|
|
@@ -307,10 +313,10 @@ const ue = (e, t) => {
|
|
|
307
313
|
}, $ = (e, ...t) => ({
|
|
308
314
|
type: "fragment",
|
|
309
315
|
children: t
|
|
310
|
-
}),
|
|
311
|
-
const c = { value: void 0 }, n = t || {}, r = oe(c, s), u =
|
|
312
|
-
return
|
|
313
|
-
}, ht = (e) => (t, s) => e, le = (e, t, s, c) => {
|
|
316
|
+
}), ct = (e, t, ...s) => {
|
|
317
|
+
const c = { value: void 0 }, n = t || {}, r = oe(c, s), u = lt(e, n, r);
|
|
318
|
+
return N(u) || (c.value = u), u;
|
|
319
|
+
}, ht = (e, t) => ct("portal", { portal: t }, e), it = (e) => (t, s) => e, le = (e, t, s, c) => {
|
|
314
320
|
var y;
|
|
315
321
|
if (c.isLegacy)
|
|
316
322
|
return;
|
|
@@ -323,8 +329,8 @@ const ue = (e, t) => {
|
|
|
323
329
|
r.isRoot = !0, r.wrapElement = h, r.afterElement = o;
|
|
324
330
|
O.value = !1, W(r);
|
|
325
331
|
}, fe = (e, t, s) => ({ tagName: e.name, ctor: e, props: t, children: s, resolve: (u = t) => {
|
|
326
|
-
|
|
327
|
-
const h = e(t, s)(et(u), t, s), o =
|
|
332
|
+
ae(u);
|
|
333
|
+
const h = e(t, s)(et(u), t, s), o = nt(
|
|
328
334
|
h,
|
|
329
335
|
u,
|
|
330
336
|
e,
|
|
@@ -335,7 +341,7 @@ const ue = (e, t) => {
|
|
|
335
341
|
u,
|
|
336
342
|
() => le(e, t, s, y)
|
|
337
343
|
), g(u, "vd").value = o, o;
|
|
338
|
-
} }),
|
|
344
|
+
} }), nt = (e, t, s, c, n) => {
|
|
339
345
|
let r = e, u = e(c);
|
|
340
346
|
return u.reRender && (r = (l) => {
|
|
341
347
|
const h = e(l), o = $({}, h);
|
|
@@ -346,12 +352,12 @@ const ue = (e, t) => {
|
|
|
346
352
|
s,
|
|
347
353
|
c,
|
|
348
354
|
n,
|
|
349
|
-
|
|
355
|
+
rt(r, t, s, c, n)
|
|
350
356
|
), u;
|
|
351
|
-
},
|
|
352
|
-
const r = () =>
|
|
357
|
+
}, rt = (e, t, s, c, n) => {
|
|
358
|
+
const r = () => ut(e, t, s, c, n, r);
|
|
353
359
|
return r;
|
|
354
|
-
},
|
|
360
|
+
}, ut = (e, t, s, c, n, r) => {
|
|
355
361
|
Se(t), st();
|
|
356
362
|
const u = e(c);
|
|
357
363
|
return ue(
|
|
@@ -359,7 +365,7 @@ const ue = (e, t) => {
|
|
|
359
365
|
() => le(s, c, n, u)
|
|
360
366
|
), de(u, t, s, c, n, r), g(t, "vd").value = u, u;
|
|
361
367
|
}, de = (e, t, s, c, n, r) => {
|
|
362
|
-
|
|
368
|
+
T(e, {
|
|
363
369
|
compProps: c,
|
|
364
370
|
compChild: n,
|
|
365
371
|
ctor: s,
|
|
@@ -367,10 +373,10 @@ const ue = (e, t) => {
|
|
|
367
373
|
compKey: t,
|
|
368
374
|
reRender: r
|
|
369
375
|
});
|
|
370
|
-
},
|
|
376
|
+
}, lt = (e, t, s) => {
|
|
371
377
|
if (Z(e))
|
|
372
378
|
return $(t, ...s);
|
|
373
|
-
if (
|
|
379
|
+
if (N(e)) {
|
|
374
380
|
const c = fe(e, t, s);
|
|
375
381
|
return O.value ? c : c.resolve();
|
|
376
382
|
}
|
|
@@ -381,8 +387,8 @@ const ue = (e, t) => {
|
|
|
381
387
|
children: s
|
|
382
388
|
};
|
|
383
389
|
}, oe = (e, t) => t.map(
|
|
384
|
-
(s) =>
|
|
385
|
-
),
|
|
390
|
+
(s) => T(ft(s), { getParent: () => e.value })
|
|
391
|
+
), ft = (e) => {
|
|
386
392
|
if (e == null || e === !1)
|
|
387
393
|
return { type: null };
|
|
388
394
|
if (Array.isArray(e)) {
|
|
@@ -394,15 +400,16 @@ const ue = (e, t) => {
|
|
|
394
400
|
} else if (typeof e == "string" || typeof e == "number")
|
|
395
401
|
return { type: "text", text: e };
|
|
396
402
|
return e;
|
|
397
|
-
},
|
|
403
|
+
}, yt = (e) => ({ value: e }), vt = () => Promise.resolve();
|
|
398
404
|
export {
|
|
399
405
|
$ as Fragment,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
ot as
|
|
406
|
+
ct as h,
|
|
407
|
+
it as mount,
|
|
408
|
+
dt as mountCallback,
|
|
409
|
+
vt as nextTick,
|
|
410
|
+
ht as portal,
|
|
411
|
+
yt as ref,
|
|
412
|
+
ot as render,
|
|
413
|
+
pt as updateCallback
|
|
407
414
|
};
|
|
408
415
|
//# sourceMappingURL=lithent.mjs.map
|