lithent 1.18.3 → 1.18.5
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 +3 -2
- package/dist/lithent.mjs +61 -62
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/universalRef.d.ts +2 -2
- package/dist/wDom.d.ts +4 -0
- package/examples/dist/assets/{index-CoLsHZbl.js → index-GZ-P6cMy.js} +2 -2
- package/examples/dist/assets/index-GZ-P6cMy.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/hook/mountCallback.ts +3 -3
- package/src/hook/unmount.ts +4 -4
- package/src/hook/updateCallback.ts +3 -3
- package/src/hook/useUpdate.ts +3 -3
- package/src/index.ts +3 -2
- package/src/render.ts +2 -2
- package/src/types/index.ts +1 -1
- package/src/utils/redraw.ts +4 -4
- package/src/utils/universalRef.ts +5 -5
- package/src/wDom.ts +2 -4
- package/examples/dist/assets/index-CoLsHZbl.js.map +0 -1
package/README.md
CHANGED
|
@@ -90,14 +90,14 @@ pnpm add lithent
|
|
|
90
90
|
|
|
91
91
|
#### Or Use CDN
|
|
92
92
|
|
|
93
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
94
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
95
|
-
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
96
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
97
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
98
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
99
|
-
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
100
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
93
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.18.5/dist/lithent.umd.js
|
|
94
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.18.5/helper/dist/lithentHelper.umd.js
|
|
95
|
+
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.18.5/ftags/dist/lithentFTags.umd.js
|
|
96
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.18.5/tag/dist/lithentTag.umd.js
|
|
97
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.18.5/dist/lithent.mjs
|
|
98
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.18.5/helper/dist/lithentHelper.mjs
|
|
99
|
+
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.18.5/ftags/dist/lithentFTags.mjs
|
|
100
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.18.5/tag/dist/lithentTag.mjs
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -122,9 +122,9 @@ import { fTags, fFragment, fMount } from 'lithent/ftags';
|
|
|
122
122
|
const { section, div, p, br, strong } = fTags;
|
|
123
123
|
|
|
124
124
|
/* UMD
|
|
125
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
126
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
127
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
125
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/dist/lithent.umd.js"></script>
|
|
126
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/helper/dist/lithentHelper.umd.js"></script>
|
|
127
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/ftags/dist/lithentFTags.umd.js"></script>
|
|
128
128
|
|
|
129
129
|
const { render } = lithent;
|
|
130
130
|
const { fTags, fMount, fFragment } = lithentFTags;
|
|
@@ -197,10 +197,10 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
197
197
|
#### With UMD
|
|
198
198
|
|
|
199
199
|
```html
|
|
200
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
201
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
202
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
203
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.18.
|
|
200
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/dist/lithent.umd.js"></script>
|
|
201
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/helper/dist/lithentHelper.umd.js"></script-->
|
|
202
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/tag/dist/lithentTag.umd.js"></script>
|
|
203
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.18.5/ftags/dist/lithentFTags.umd.js"></script-->
|
|
204
204
|
|
|
205
205
|
<div id="root"></div>
|
|
206
206
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { h, Fragment, portal, mount } from './wDom';
|
|
1
|
+
export { h, Fragment, portal, mount, replaceWDom } from './wDom';
|
|
2
2
|
export { isPropType } from './utils';
|
|
3
3
|
export { componentUpdate } from './utils/redraw';
|
|
4
|
+
export { componentMap } from './utils/universalRef';
|
|
4
5
|
export { render } from './render';
|
|
5
6
|
export { mountCallback } from './hook/mountCallback';
|
|
6
7
|
export { updateCallback } from './hook/updateCallback';
|
|
7
8
|
export { ref, nextTick } from './hook/ref';
|
|
8
|
-
export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, Component, ComponentSubKey,
|
|
9
|
+
export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, Component, ComponentSubKey, ComponentMap, Props, Renew, MiddleStateWDomChildren, MiddleStateWDom, NodePointer, Param, } from './types';
|
|
9
10
|
declare global {
|
|
10
11
|
namespace JSX {
|
|
11
12
|
interface IntrinsicElements {
|
package/dist/lithent.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const
|
|
1
|
+
const k = (e) => typeof e == "object" && !("resolve" in e), N = (e, t) => k(e) && e.type === t, de = (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
|
-
return
|
|
3
|
+
return k(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) => {
|
|
5
5
|
var s, c;
|
|
6
|
-
return
|
|
7
|
-
}, X = (e, t) =>
|
|
6
|
+
return k(e) && (t == null ? void 0 : t.type) === "element" && (t == null ? void 0 : t.tag) === e.tag && ((s = t == null ? void 0 : t.children) == null ? void 0 : s.length) === ((c = e == null ? void 0 : e.children) == null ? void 0 : c.length);
|
|
7
|
+
}, X = (e, t) => k(e) && (t == null ? void 0 : t.type) === e.type, ye = (e, t) => {
|
|
8
8
|
var s, c;
|
|
9
|
-
return
|
|
9
|
+
return k(e) && (t == null ? void 0 : t.type) === e.type && (E(o((e.children || [])[0])) && E(o(((t == null ? void 0 : t.children) || [])[0])) || ((s = t == null ? void 0 : t.children) == null ? void 0 : s.length) === ((c = e == null ? void 0 : e.children) == null ? void 0 : c.length));
|
|
10
10
|
}, o = (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
|
-
},
|
|
13
|
+
}, C = (e) => e && ["fragment", "loop"].includes(e), T = (e) => typeof e == "function" && !g(e) || typeof e == "object" && "resolve" in e, g = (e) => typeof e == "function" && e === J, m = (e) => k(e) && !e.type, E = (e) => e != null, Y = (e, t) => e === "style" && typeof t == "object", ve = (e, t) => e === "ref" && typeof t == "object", Ce = (e, t) => {
|
|
14
14
|
const s = Object.getOwnPropertyDescriptor(
|
|
15
15
|
e.constructor.prototype,
|
|
16
16
|
t
|
|
17
17
|
);
|
|
18
18
|
return s && s.get && s.set;
|
|
19
|
-
},
|
|
19
|
+
}, ke = (e) => {
|
|
20
20
|
let t = "et";
|
|
21
21
|
return T(e) ? t = "c" : N(e, "fragment") ? t = "f" : N(e, "element") ? t = "e" : N(e, "loop") ? t = "l" : N(e, "text") ? t = "t" : m(e) && (t = "et"), t;
|
|
22
|
-
},
|
|
23
|
-
c:
|
|
22
|
+
}, Re = {
|
|
23
|
+
c: de,
|
|
24
24
|
l: ye,
|
|
25
25
|
t: X,
|
|
26
26
|
e: ie,
|
|
27
27
|
f: he,
|
|
28
28
|
et: X
|
|
29
|
-
},
|
|
29
|
+
}, v = Symbol.for("lithentWDomSymbol"), R = { value: "" }, S = { value: {} }, O = { value: !1 }, f = /* @__PURE__ */ new WeakMap(), Ee = (e) => {
|
|
30
30
|
f.set(e, {
|
|
31
31
|
vd: { value: null },
|
|
32
32
|
up: () => {
|
|
@@ -40,7 +40,7 @@ const R = (e) => typeof e == "object" && !("resolve" in e), N = (e, t) => R(e) &
|
|
|
40
40
|
});
|
|
41
41
|
}, a = () => S.value, Z = (e, t) => f.get(e) ? f.get(e)[t] : null, Pe = (e) => S.value = e, Se = (e) => {
|
|
42
42
|
S.value = e, Ee(e);
|
|
43
|
-
}, y = (e) => e.getParent && e.getParent(), P = Object.entries, w = Object.keys, b = Object.assign, lt = (e) => typeof e == "object" && !Array.isArray(e) && !Object.getOwnPropertySymbols(e).includes(
|
|
43
|
+
}, y = (e) => e.getParent && e.getParent(), P = Object.entries, w = Object.keys, b = Object.assign, lt = (e) => typeof e == "object" && !Array.isArray(e) && !Object.getOwnPropertySymbols(e).includes(v), ae = (e) => {
|
|
44
44
|
f.get(a()).umts.push(e);
|
|
45
45
|
}, U = (e) => {
|
|
46
46
|
const { compKey: t } = e;
|
|
@@ -96,11 +96,11 @@ const I = () => {
|
|
|
96
96
|
t && t !== "N" && ({
|
|
97
97
|
A: G,
|
|
98
98
|
D: $,
|
|
99
|
-
R:
|
|
99
|
+
R: Ae,
|
|
100
100
|
U: B,
|
|
101
101
|
CNSU: B,
|
|
102
102
|
SR: ce,
|
|
103
|
-
SU:
|
|
103
|
+
SU: Me
|
|
104
104
|
}[t](e), delete e.needRerender, delete e.oldChildren, delete e.oldProps);
|
|
105
105
|
}, F = (e) => {
|
|
106
106
|
e.props && e.el && ue(e.props, e.el), (e.children || []).forEach((t) => {
|
|
@@ -111,7 +111,7 @@ const I = () => {
|
|
|
111
111
|
}, $ = (e) => {
|
|
112
112
|
e.oldProps && e.el && ue(e.oldProps, e.el), te(
|
|
113
113
|
e,
|
|
114
|
-
|
|
114
|
+
M(y(e))
|
|
115
115
|
);
|
|
116
116
|
}, te = (e, t) => {
|
|
117
117
|
var s, c;
|
|
@@ -124,7 +124,7 @@ const I = () => {
|
|
|
124
124
|
});
|
|
125
125
|
}, ce = (e) => {
|
|
126
126
|
$(e), G(e);
|
|
127
|
-
},
|
|
127
|
+
}, Me = (e) => {
|
|
128
128
|
if (B(e), y(e).needRerender !== "CNSU") {
|
|
129
129
|
const s = ne(e);
|
|
130
130
|
G(e, s);
|
|
@@ -133,33 +133,33 @@ const I = () => {
|
|
|
133
133
|
t || (t = L(e));
|
|
134
134
|
const s = y(e);
|
|
135
135
|
if (s.type) {
|
|
136
|
-
const c =
|
|
136
|
+
const c = M(s), n = s.type === "loop" && s.needRerender && s.needRerender !== "CNSU" ? j(s, y(s)) : j(e, s);
|
|
137
137
|
t && c && (e.tag !== "portal" && (n ? c.insertBefore(t, n) : c.appendChild(t)), I());
|
|
138
138
|
}
|
|
139
|
-
}, ne = (e) =>
|
|
139
|
+
}, ne = (e) => C(e.type) ? ((e == null ? void 0 : e.children) || []).reduce((t, s) => {
|
|
140
140
|
const c = ne(s);
|
|
141
141
|
return c && t.appendChild(c), t;
|
|
142
142
|
}, z()) : e.el, j = (e, t) => {
|
|
143
143
|
const s = t.children || [], r = s.indexOf(e) + 1, n = s.slice(r), u = re(n), l = t.type || "";
|
|
144
144
|
if (u)
|
|
145
145
|
return u;
|
|
146
|
-
if (!t.isRoot &&
|
|
146
|
+
if (!t.isRoot && C(l))
|
|
147
147
|
return j(t, y(t));
|
|
148
|
-
if (t.isRoot &&
|
|
148
|
+
if (t.isRoot && C(l) && t.afterElement)
|
|
149
149
|
return t.afterElement;
|
|
150
150
|
}, re = (e) => e.reduce(
|
|
151
151
|
(t, s) => {
|
|
152
|
-
const c = s.type, r = s.el, n = c &&
|
|
152
|
+
const c = s.type, r = s.el, n = c && C(c);
|
|
153
153
|
return t || (n ? re(s.children || []) : r && r.nodeType !== 11 ? r : t);
|
|
154
154
|
},
|
|
155
155
|
void 0
|
|
156
|
-
),
|
|
156
|
+
), Ae = (e) => {
|
|
157
157
|
const t = y(e), s = e.el;
|
|
158
158
|
if (t.type && s)
|
|
159
159
|
if (s.nodeType === 11)
|
|
160
160
|
ce(e);
|
|
161
161
|
else {
|
|
162
|
-
const c =
|
|
162
|
+
const c = M(t), r = L(e);
|
|
163
163
|
c && e.tag !== "portal" && c.replaceChild(r, s), I();
|
|
164
164
|
}
|
|
165
165
|
}, ue = (e, t) => {
|
|
@@ -196,12 +196,12 @@ const I = () => {
|
|
|
196
196
|
u,
|
|
197
197
|
Y(n, r.style) ? r.style : {},
|
|
198
198
|
t
|
|
199
|
-
) :
|
|
199
|
+
) : ve(n, u) ? u.value = t : n.match(/^on/) ? K(
|
|
200
200
|
t,
|
|
201
201
|
n,
|
|
202
202
|
u,
|
|
203
203
|
r[n]
|
|
204
|
-
) : n && (n !== "type" &&
|
|
204
|
+
) : n && (n !== "type" && Ce(t, n) ? t[n] = u : Qe(
|
|
205
205
|
Fe(n),
|
|
206
206
|
t,
|
|
207
207
|
u
|
|
@@ -210,11 +210,11 @@ const I = () => {
|
|
|
210
210
|
(n) => t.removeAttribute(n)
|
|
211
211
|
);
|
|
212
212
|
}, Qe = (e, t, s) => {
|
|
213
|
-
|
|
213
|
+
R.value && e !== "xmlns" ? t.setAttributeNS(null, e, s) : t.setAttribute(e, s);
|
|
214
214
|
}, L = (e, t) => {
|
|
215
215
|
let s;
|
|
216
|
-
const { type: c, tag: r, text: n, props: u, children: l = [] } = e, h =
|
|
217
|
-
return r === "svg" && (
|
|
216
|
+
const { type: c, tag: r, text: n, props: u, children: l = [] } = e, h = C(c);
|
|
217
|
+
return r === "svg" && (R.value = String(u == null ? void 0 : u.xmlns)), t ? s = e.el : (h ? s = z() : c === "element" && r ? r === "portal" && (u != null && u.portal) ? s = u.portal : s = R.value ? document.createElementNS(R.value, r) : V(r) : c === "text" && E(n) ? s = document.createTextNode(String(n)) : s = V("e"), e.el = s), je(l, s, t), le(u, s, null, t), Ne(e), r === "svg" && (R.value = ""), s;
|
|
218
218
|
}, je = (e, t, s) => {
|
|
219
219
|
const c = e.reduce(
|
|
220
220
|
(r, n) => {
|
|
@@ -237,12 +237,12 @@ const I = () => {
|
|
|
237
237
|
}), P(c).forEach(
|
|
238
238
|
([n]) => r[n] = ""
|
|
239
239
|
));
|
|
240
|
-
},
|
|
241
|
-
const t =
|
|
242
|
-
return e.isRoot && t ? e.wrapElement : t ?
|
|
243
|
-
},
|
|
240
|
+
}, M = (e) => {
|
|
241
|
+
const t = C(e.type);
|
|
242
|
+
return e.isRoot && t ? e.wrapElement : t ? M(y(e)) : e.el;
|
|
243
|
+
}, A = (e, t) => qe(
|
|
244
244
|
e,
|
|
245
|
-
ke
|
|
245
|
+
Re[ke(e)](e, t),
|
|
246
246
|
t
|
|
247
247
|
), qe = (e, t, s) => {
|
|
248
248
|
const c = Xe(e, t, s), r = [
|
|
@@ -254,9 +254,9 @@ const I = () => {
|
|
|
254
254
|
}, _e = (e, t, s) => {
|
|
255
255
|
s !== "A" && t && (e.el = t.el), s && ["D", "R", "SR"].includes(s) && (t && (U(t), F(t)), e.oldChildren = t == null ? void 0 : t.children), e.oldProps = t == null ? void 0 : t.props;
|
|
256
256
|
}, Ie = (e, t, s) => {
|
|
257
|
-
const c = s && s.type, r = m(e), n = e.isRoot, u = s && y(s), l = !n && (u == null ? void 0 : u.type), h = o(e),
|
|
258
|
-
let
|
|
259
|
-
return r ?
|
|
257
|
+
const c = s && s.type, r = m(e), n = e.isRoot, u = s && y(s), l = !n && (u == null ? void 0 : u.type), h = o(e), d = l === "loop" && E(h), i = e.type === "text" && t && e.text === (s == null ? void 0 : s.text), x = e === s;
|
|
258
|
+
let p;
|
|
259
|
+
return r ? p = "D" : i || x ? p = "N" : c ? t ? p = d ? "SU" : "U" : p = d ? "SR" : "R" : p = "A", e.type === "loop" && p === "U" && s && ze(e, s) && (p = "CNSU"), p;
|
|
260
260
|
}, ze = (e, t) => {
|
|
261
261
|
const s = [...(t == null ? void 0 : t.children) || []], c = [...(e == null ? void 0 : e.children) || []].filter(
|
|
262
262
|
(u) => s.find((l) => o(u) === o(l))
|
|
@@ -275,9 +275,9 @@ const I = () => {
|
|
|
275
275
|
const { compProps: s, compChild: c } = e, { props: r, children: n } = t;
|
|
276
276
|
return s && $e(s, r), c && Ge(c, n), e.reRender && e.reRender();
|
|
277
277
|
}, Xe = (e, t, s) => T(e) ? t && s ? Je(s, e) : e.resolve() : e, Ye = (e, t, s) => t && s ? He(e, s) : Ze(e), Ze = (e) => (e.children || []).map(
|
|
278
|
-
(t) => b(
|
|
278
|
+
(t) => b(A(t), { getParent: () => e })
|
|
279
279
|
), He = (e, t) => e.type === "loop" && E(o((e.children || [])[0])) ? Ve(e, t) : (e.children || []).map(
|
|
280
|
-
(s, c) => b(
|
|
280
|
+
(s, c) => b(A(s, (t.children || [])[c]), {
|
|
281
281
|
getParent: () => e
|
|
282
282
|
})
|
|
283
283
|
), Ve = (e, t) => {
|
|
@@ -291,7 +291,7 @@ const I = () => {
|
|
|
291
291
|
}, Ke = (e, t) => {
|
|
292
292
|
const s = [...e.children || []], c = [...t.children || []];
|
|
293
293
|
return [s.map((n) => {
|
|
294
|
-
const u = ge(n, c), l =
|
|
294
|
+
const u = ge(n, c), l = A(n, u);
|
|
295
295
|
return u && c.splice(c.indexOf(u), 1), l.getParent = () => e, l;
|
|
296
296
|
}), c];
|
|
297
297
|
}, ge = (e, t) => t.find(
|
|
@@ -311,7 +311,7 @@ const me = (e, t) => {
|
|
|
311
311
|
q.forEach((e) => {
|
|
312
312
|
e();
|
|
313
313
|
}), q.clear(), _ = !1;
|
|
314
|
-
},
|
|
314
|
+
}, pt = (e, t = () => []) => {
|
|
315
315
|
f.get(a()).upR.push(() => H(e, t)), H(e, t);
|
|
316
316
|
}, De = () => {
|
|
317
317
|
var t;
|
|
@@ -319,28 +319,28 @@ const me = (e, t) => {
|
|
|
319
319
|
e != null && e.length && e.forEach((s) => s());
|
|
320
320
|
}, J = (e, ...t) => ({
|
|
321
321
|
type: "fragment",
|
|
322
|
-
[
|
|
322
|
+
[v]: !0,
|
|
323
323
|
children: t
|
|
324
324
|
}), et = (e, t, ...s) => {
|
|
325
|
-
const c = { value: void 0 }, r = t || {}, n =
|
|
325
|
+
const c = { value: void 0 }, r = t || {}, n = pe(c, s), u = rt(e, r, n);
|
|
326
326
|
return T(u) || (c.value = u), u;
|
|
327
|
-
},
|
|
327
|
+
}, dt = (e, t) => et("portal", { portal: t }, e), ht = (e) => (t, s) => e, tt = (e, t, s, c) => {
|
|
328
328
|
var i;
|
|
329
329
|
if (c.isLegacy)
|
|
330
330
|
return;
|
|
331
331
|
O.value = !0;
|
|
332
|
-
const r = fe(e, t, s), n =
|
|
332
|
+
const r = fe(e, t, s), n = A(r, c), { isRoot: u, getParent: l, wrapElement: h, afterElement: d } = c;
|
|
333
333
|
if (n.getParent = l, !u && l) {
|
|
334
|
-
const x = ((i = l()) == null ? void 0 : i.children) || [],
|
|
335
|
-
x.splice(
|
|
334
|
+
const x = ((i = l()) == null ? void 0 : i.children) || [], p = x.indexOf(c);
|
|
335
|
+
x.splice(p, 1, n);
|
|
336
336
|
} else
|
|
337
|
-
n.isRoot = !0, n.wrapElement = h, n.afterElement =
|
|
337
|
+
n.isRoot = !0, n.wrapElement = h, n.afterElement = d;
|
|
338
338
|
O.value = !1, ee(n);
|
|
339
339
|
}, fe = (e, t, s) => ({ tagName: e.name, ctor: e, props: t, children: s, resolve: (u = t) => {
|
|
340
340
|
Se(u);
|
|
341
|
-
const l = e(t, s),
|
|
341
|
+
const l = e(t, s), d = (typeof l == "function" ? l : () => () => l)(we(u), t, s);
|
|
342
342
|
return st(
|
|
343
|
-
|
|
343
|
+
d,
|
|
344
344
|
u,
|
|
345
345
|
e,
|
|
346
346
|
t,
|
|
@@ -349,8 +349,8 @@ const me = (e, t) => {
|
|
|
349
349
|
} }), st = (e, t, s, c, r) => {
|
|
350
350
|
let n = e, u = e(c);
|
|
351
351
|
u.reRender && (n = (h) => {
|
|
352
|
-
const
|
|
353
|
-
return
|
|
352
|
+
const d = e(h), i = J({}, d);
|
|
353
|
+
return d.getParent = () => i, i;
|
|
354
354
|
}, u = n(c));
|
|
355
355
|
const l = ct(
|
|
356
356
|
n,
|
|
@@ -375,10 +375,7 @@ const me = (e, t) => {
|
|
|
375
375
|
tagName: s.name,
|
|
376
376
|
compKey: t,
|
|
377
377
|
reRender: n
|
|
378
|
-
}), me(
|
|
379
|
-
t,
|
|
380
|
-
() => tt(s, c, r, e)
|
|
381
|
-
), Z(t, "vd") && (Z(t, "vd").value = e);
|
|
378
|
+
}), me(t, () => tt(s, c, r, e)), Z(t, "vd") && (Z(t, "vd").value = e);
|
|
382
379
|
}, rt = (e, t, s) => {
|
|
383
380
|
if (g(e))
|
|
384
381
|
return J(t, ...s);
|
|
@@ -388,38 +385,40 @@ const me = (e, t) => {
|
|
|
388
385
|
}
|
|
389
386
|
return {
|
|
390
387
|
type: "element",
|
|
391
|
-
[
|
|
388
|
+
[v]: !0,
|
|
392
389
|
tag: e,
|
|
393
390
|
props: t,
|
|
394
391
|
children: s
|
|
395
392
|
};
|
|
396
|
-
},
|
|
393
|
+
}, pe = (e, t) => t.map(
|
|
397
394
|
(s) => b(ut(s), { getParent: () => e.value })
|
|
398
395
|
), ut = (e) => {
|
|
399
396
|
if (e == null || e === !1)
|
|
400
|
-
return { type: null, [
|
|
397
|
+
return { type: null, [v]: !0 };
|
|
401
398
|
if (Array.isArray(e)) {
|
|
402
|
-
const t = { value: void 0 }, s =
|
|
399
|
+
const t = { value: void 0 }, s = pe(t, e), c = {
|
|
403
400
|
type: "loop",
|
|
404
|
-
[
|
|
401
|
+
[v]: !0,
|
|
405
402
|
children: s
|
|
406
403
|
};
|
|
407
404
|
return t.value = c, c;
|
|
408
405
|
} else if (typeof e == "string" || typeof e == "number")
|
|
409
|
-
return { type: "text", [
|
|
406
|
+
return { type: "text", [v]: !0, text: e };
|
|
410
407
|
return e;
|
|
411
408
|
}, it = (e) => ({ value: e }), yt = () => Promise.resolve();
|
|
412
409
|
export {
|
|
413
410
|
J as Fragment,
|
|
411
|
+
f as componentMap,
|
|
414
412
|
we as componentUpdate,
|
|
415
413
|
et as h,
|
|
416
414
|
lt as isPropType,
|
|
417
415
|
ht as mount,
|
|
418
416
|
ft as mountCallback,
|
|
419
417
|
yt as nextTick,
|
|
420
|
-
|
|
418
|
+
dt as portal,
|
|
421
419
|
it as ref,
|
|
422
420
|
ot as render,
|
|
423
|
-
|
|
421
|
+
tt as replaceWDom,
|
|
422
|
+
pt as updateCallback
|
|
424
423
|
};
|
|
425
424
|
//# sourceMappingURL=lithent.mjs.map
|