ddd-react 1.10.10 → 1.10.12
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/index.mjs +165 -173
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as c, e as m, a as R, A as
|
|
1
|
+
import { D as c, e as m, a as R, A as g, b as x, h as U, c as B } from "./h-BbaMkkC7.mjs";
|
|
2
2
|
import { d as Pt, f as Ot } from "./h-BbaMkkC7.mjs";
|
|
3
3
|
function b(e, t) {
|
|
4
4
|
if (e === null || t === null || e === void 0 || t === void 0)
|
|
@@ -31,8 +31,8 @@ function b(e, t) {
|
|
|
31
31
|
if (!Object.prototype.hasOwnProperty.call(t, r[n]))
|
|
32
32
|
return !1;
|
|
33
33
|
for (let n = 0; n < r.length; ++n) {
|
|
34
|
-
const
|
|
35
|
-
if (!(
|
|
34
|
+
const s = r[n];
|
|
35
|
+
if (!(s === "_owner" && e.$$typeof) && !b(e[s], t[s]))
|
|
36
36
|
return !1;
|
|
37
37
|
}
|
|
38
38
|
return !0;
|
|
@@ -40,17 +40,17 @@ function b(e, t) {
|
|
|
40
40
|
return !1;
|
|
41
41
|
}
|
|
42
42
|
function N(e, t, r, n = null) {
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
n ? t.call(n,
|
|
43
|
+
function s(i) {
|
|
44
|
+
const o = i;
|
|
45
|
+
n ? t.call(n, o) : t(o);
|
|
46
46
|
}
|
|
47
|
-
return r.addEventListener(e,
|
|
47
|
+
return r.addEventListener(e, s), s;
|
|
48
48
|
}
|
|
49
49
|
function I(e = {}, t, r = null) {
|
|
50
50
|
const n = {};
|
|
51
|
-
return Object.entries(e).forEach(([
|
|
52
|
-
n[
|
|
53
|
-
|
|
51
|
+
return Object.entries(e).forEach(([s, i]) => {
|
|
52
|
+
n[s] = N(
|
|
53
|
+
s,
|
|
54
54
|
i,
|
|
55
55
|
t,
|
|
56
56
|
r
|
|
@@ -95,8 +95,8 @@ function q(e) {
|
|
|
95
95
|
t && t.remove();
|
|
96
96
|
}
|
|
97
97
|
function G(e) {
|
|
98
|
-
const { el: t, children: r, listeners: n, props:
|
|
99
|
-
|
|
98
|
+
const { el: t, children: r, listeners: n, props: s } = e;
|
|
99
|
+
s?.ref && typeof s.ref == "object" && "current" in s.ref && (s.ref.current = null), t && t.remove(), r && r.forEach(p), n && t && ($(n, t), delete e.listeners);
|
|
100
100
|
}
|
|
101
101
|
function _(e) {
|
|
102
102
|
const { children: t } = e;
|
|
@@ -113,12 +113,12 @@ function J(e, t) {
|
|
|
113
113
|
e.style[t] = null;
|
|
114
114
|
}
|
|
115
115
|
function K(e, t) {
|
|
116
|
-
const { class: r, style: n, ...
|
|
117
|
-
r && W(e, r), n && Object.entries(n).forEach(([i,
|
|
118
|
-
M(e, i,
|
|
116
|
+
const { class: r, style: n, ...s } = t;
|
|
117
|
+
r && W(e, r), n && Object.entries(n).forEach(([i, o]) => {
|
|
118
|
+
M(e, i, o);
|
|
119
119
|
});
|
|
120
|
-
for (const [i,
|
|
121
|
-
w(e, i,
|
|
120
|
+
for (const [i, o] of Object.entries(s))
|
|
121
|
+
w(e, i, o);
|
|
122
122
|
}
|
|
123
123
|
function W(e, t) {
|
|
124
124
|
if (e instanceof SVGElement) {
|
|
@@ -135,7 +135,7 @@ function D(e, t) {
|
|
|
135
135
|
}
|
|
136
136
|
let P = !1;
|
|
137
137
|
const O = [];
|
|
138
|
-
function
|
|
138
|
+
function d(e) {
|
|
139
139
|
O.push(e), Y();
|
|
140
140
|
}
|
|
141
141
|
function Y() {
|
|
@@ -161,11 +161,11 @@ function H() {
|
|
|
161
161
|
}
|
|
162
162
|
P = !1;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function A(e) {
|
|
165
165
|
const { on: t = {}, ...r } = e.props;
|
|
166
166
|
return delete r.key, { props: r, events: t };
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function h(e, t, r = null, n = null) {
|
|
169
169
|
switch (e.type) {
|
|
170
170
|
case c.TEXT: {
|
|
171
171
|
z(e, t, r);
|
|
@@ -181,8 +181,8 @@ function d(e, t, r = null, n = null) {
|
|
|
181
181
|
}
|
|
182
182
|
case c.COMPONENT: {
|
|
183
183
|
tt(e, t, r, n);
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const s = e.component;
|
|
185
|
+
s && d(() => s.didMount());
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
case c.PORTAL: {
|
|
@@ -194,28 +194,28 @@ function d(e, t, r = null, n = null) {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
function z(e, t, r) {
|
|
197
|
-
const { value: n } = e,
|
|
198
|
-
e.el =
|
|
197
|
+
const { value: n } = e, s = document.createTextNode(n);
|
|
198
|
+
e.el = s, L(s, t, r);
|
|
199
199
|
}
|
|
200
200
|
function Q(e, t, r, n) {
|
|
201
|
-
const { children:
|
|
202
|
-
e.el = t,
|
|
203
|
-
|
|
201
|
+
const { children: s } = e;
|
|
202
|
+
e.el = t, s?.forEach((i, o) => {
|
|
203
|
+
h(i, t, r != null ? r + o : null, n);
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
function Z(e, t, r, n) {
|
|
207
|
-
const { tag:
|
|
208
|
-
V(
|
|
209
|
-
|
|
210
|
-
}), L(
|
|
207
|
+
const { tag: s, children: i } = e, a = s === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", s) : document.createElement(s);
|
|
208
|
+
V(a, e, n), e.el = a, i?.forEach((l) => {
|
|
209
|
+
h(l, a, null, n);
|
|
210
|
+
}), L(a, t, r);
|
|
211
211
|
}
|
|
212
212
|
function V(e, t, r) {
|
|
213
|
-
const { props: n, events:
|
|
214
|
-
n.ref && typeof n.ref == "object" && "current" in n.ref && (n.ref.current = e, delete n.ref), t.listeners = I(
|
|
213
|
+
const { props: n, events: s } = A(t);
|
|
214
|
+
n.ref && typeof n.ref == "object" && "current" in n.ref && (n.ref.current = e, delete n.ref), t.listeners = I(s, e, r), K(e, n);
|
|
215
215
|
}
|
|
216
216
|
function tt(e, t, r, n) {
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const s = e.tag, { props: i } = A(e), o = new s(i, n);
|
|
218
|
+
o.mount(t, r), e.component = o, e.el = o.firstElement || null;
|
|
219
219
|
}
|
|
220
220
|
function L(e, t, r) {
|
|
221
221
|
if (r == null) {
|
|
@@ -229,8 +229,8 @@ function L(e, t, r) {
|
|
|
229
229
|
}
|
|
230
230
|
function et(e, t) {
|
|
231
231
|
const { children: r, container: n } = e;
|
|
232
|
-
r?.forEach((
|
|
233
|
-
|
|
232
|
+
r?.forEach((s) => {
|
|
233
|
+
h(s, n, null, t);
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
function j(e, t) {
|
|
@@ -238,17 +238,17 @@ function j(e, t) {
|
|
|
238
238
|
return !1;
|
|
239
239
|
if (e.type === c.ELEMENT) {
|
|
240
240
|
const r = e, n = t, {
|
|
241
|
-
tag:
|
|
241
|
+
tag: s,
|
|
242
242
|
props: { key: i }
|
|
243
243
|
} = r, {
|
|
244
|
-
tag:
|
|
245
|
-
props: { key:
|
|
244
|
+
tag: o,
|
|
245
|
+
props: { key: a }
|
|
246
246
|
} = n;
|
|
247
|
-
return
|
|
247
|
+
return s === o && i === a;
|
|
248
248
|
}
|
|
249
249
|
if (e.type === c.COMPONENT) {
|
|
250
|
-
const r = e, n = t, { tag:
|
|
251
|
-
return
|
|
250
|
+
const r = e, n = t, { tag: s } = r, { tag: i } = n;
|
|
251
|
+
return s === i;
|
|
252
252
|
}
|
|
253
253
|
if (e.type === c.PORTAL) {
|
|
254
254
|
const r = e, n = t;
|
|
@@ -256,36 +256,36 @@ function j(e, t) {
|
|
|
256
256
|
}
|
|
257
257
|
return !0;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
const r = Object.keys(e), n = Object.keys(t),
|
|
261
|
-
for (const
|
|
262
|
-
|
|
259
|
+
function S(e, t) {
|
|
260
|
+
const r = Object.keys(e), n = Object.keys(t), s = [], i = [];
|
|
261
|
+
for (const o of n)
|
|
262
|
+
o in e ? e[o] !== t[o] && i.push(o) : s.push(o);
|
|
263
263
|
return {
|
|
264
|
-
added:
|
|
265
|
-
removed: r.filter((
|
|
264
|
+
added: s,
|
|
265
|
+
removed: r.filter((o) => !(o in t)),
|
|
266
266
|
updated: i
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function rt(e) {
|
|
270
270
|
return e !== "";
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function C(e) {
|
|
273
273
|
return rt(e.trim());
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function y(e, t, r, n = null) {
|
|
276
276
|
if (!j(e, t)) {
|
|
277
|
-
const
|
|
278
|
-
return p(e),
|
|
277
|
+
const s = nt(r, e.el);
|
|
278
|
+
return p(e), h(t, r, s, n), t;
|
|
279
279
|
}
|
|
280
280
|
switch (t.el = e.el, t.type) {
|
|
281
281
|
case c.TEXT:
|
|
282
|
-
return
|
|
282
|
+
return st(e, t), t;
|
|
283
283
|
case c.ELEMENT: {
|
|
284
|
-
|
|
284
|
+
ot(e, t, n);
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
287
|
case c.COMPONENT: {
|
|
288
|
-
|
|
288
|
+
lt(e, t);
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
291
291
|
case c.PORTAL: {
|
|
@@ -300,114 +300,114 @@ function nt(e, t) {
|
|
|
300
300
|
const r = Array.from(e.childNodes).indexOf(t);
|
|
301
301
|
return r < 0 ? null : r;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
const r = e.el, { value: n } = e, { value:
|
|
305
|
-
n !==
|
|
303
|
+
function st(e, t) {
|
|
304
|
+
const r = e.el, { value: n } = e, { value: s } = t;
|
|
305
|
+
n !== s && r && (r.nodeValue = s);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function ot(e, t, r) {
|
|
308
308
|
const n = e.el, {
|
|
309
|
-
class:
|
|
309
|
+
class: s,
|
|
310
310
|
style: i,
|
|
311
|
-
on:
|
|
312
|
-
...
|
|
311
|
+
on: o,
|
|
312
|
+
...a
|
|
313
313
|
} = e.props ?? {}, {
|
|
314
|
-
class:
|
|
315
|
-
style:
|
|
314
|
+
class: l,
|
|
315
|
+
style: u,
|
|
316
316
|
on: f,
|
|
317
|
-
...
|
|
317
|
+
...E
|
|
318
318
|
} = t.props ?? {}, { listeners: v } = e;
|
|
319
|
-
it(n,
|
|
319
|
+
it(n, a, E), ct(n, s, l), ut(
|
|
320
320
|
n,
|
|
321
321
|
i,
|
|
322
|
-
|
|
323
|
-
), t.listeners =
|
|
322
|
+
u
|
|
323
|
+
), t.listeners = at(
|
|
324
324
|
n,
|
|
325
325
|
v,
|
|
326
|
-
|
|
326
|
+
o ?? {},
|
|
327
327
|
f ?? {},
|
|
328
328
|
r
|
|
329
329
|
);
|
|
330
330
|
}
|
|
331
331
|
function it(e, t = {}, r = {}) {
|
|
332
|
-
const n = t.ref,
|
|
333
|
-
n !==
|
|
334
|
-
const i = { ...t },
|
|
335
|
-
delete i.ref, delete
|
|
336
|
-
const { added:
|
|
337
|
-
for (const f of
|
|
332
|
+
const n = t.ref, s = r.ref;
|
|
333
|
+
n !== s && (n && typeof n == "object" && "current" in n && (n.current = null), s && typeof s == "object" && "current" in s && (s.current = e));
|
|
334
|
+
const i = { ...t }, o = { ...r };
|
|
335
|
+
delete i.ref, delete o.ref;
|
|
336
|
+
const { added: a, removed: l, updated: u } = S(i, o);
|
|
337
|
+
for (const f of l)
|
|
338
338
|
D(e, f);
|
|
339
|
-
for (const f of
|
|
340
|
-
w(e, f,
|
|
339
|
+
for (const f of a.concat(u))
|
|
340
|
+
w(e, f, o[f]);
|
|
341
341
|
}
|
|
342
342
|
function ct(e, t, r) {
|
|
343
|
-
const n =
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
function
|
|
347
|
-
return Array.isArray(e) ? e.filter(
|
|
348
|
-
}
|
|
349
|
-
function
|
|
350
|
-
const { added: n, removed:
|
|
351
|
-
for (const
|
|
352
|
-
J(e,
|
|
353
|
-
for (const
|
|
354
|
-
M(e,
|
|
355
|
-
}
|
|
356
|
-
function
|
|
357
|
-
const { removed: i, added:
|
|
358
|
-
for (const
|
|
359
|
-
const f = t?.[
|
|
360
|
-
f && e.removeEventListener(
|
|
361
|
-
}
|
|
362
|
-
const
|
|
363
|
-
for (const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
n[
|
|
343
|
+
const n = T(t), s = T(r), { added: i, removed: o } = x(n, s);
|
|
344
|
+
o.length > 0 && e.classList.remove(...o), i.length > 0 && e.classList.add(...i);
|
|
345
|
+
}
|
|
346
|
+
function T(e = "") {
|
|
347
|
+
return Array.isArray(e) ? e.filter(C) : String(e).split(/(\s+)/).filter(C);
|
|
348
|
+
}
|
|
349
|
+
function ut(e, t = {}, r = {}) {
|
|
350
|
+
const { added: n, removed: s, updated: i } = S(t, r);
|
|
351
|
+
for (const o of s)
|
|
352
|
+
J(e, o);
|
|
353
|
+
for (const o of n.concat(i))
|
|
354
|
+
M(e, o, r[o]);
|
|
355
|
+
}
|
|
356
|
+
function at(e, t = {}, r = {}, n = {}, s = null) {
|
|
357
|
+
const { removed: i, added: o, updated: a } = S(r, n);
|
|
358
|
+
for (const u of i.concat(a)) {
|
|
359
|
+
const f = t?.[u];
|
|
360
|
+
f && e.removeEventListener(u, f);
|
|
361
|
+
}
|
|
362
|
+
const l = {};
|
|
363
|
+
for (const u of o.concat(a))
|
|
364
|
+
l[u] = N(
|
|
365
|
+
u,
|
|
366
|
+
n[u],
|
|
367
367
|
e,
|
|
368
|
-
|
|
368
|
+
s
|
|
369
369
|
);
|
|
370
|
-
return
|
|
370
|
+
return l;
|
|
371
371
|
}
|
|
372
372
|
function F(e, t, r) {
|
|
373
|
-
const n = m(e),
|
|
374
|
-
for (const
|
|
375
|
-
if (
|
|
376
|
-
const { originalIndex:
|
|
377
|
-
|
|
373
|
+
const n = m(e), s = m(t), i = e.el, o = R(n, s, j), a = r?.offset ?? 0;
|
|
374
|
+
for (const l of o)
|
|
375
|
+
if (l.op === g.NOOP) {
|
|
376
|
+
const { originalIndex: u, index: f } = l;
|
|
377
|
+
y(n[u], s[f], i, r);
|
|
378
378
|
}
|
|
379
|
-
for (const
|
|
380
|
-
switch (
|
|
381
|
-
case
|
|
382
|
-
const { from:
|
|
383
|
-
|
|
379
|
+
for (const l of o)
|
|
380
|
+
switch (l.op) {
|
|
381
|
+
case g.MOVE: {
|
|
382
|
+
const { from: u, index: f } = l, E = n[u].el, v = i.childNodes[f + a];
|
|
383
|
+
E && (i.insertBefore(E, v), y(n[u], s[f], i, r));
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
case
|
|
387
|
-
const { item:
|
|
388
|
-
p(
|
|
386
|
+
case g.REMOVE: {
|
|
387
|
+
const { item: u } = l;
|
|
388
|
+
p(u);
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
|
-
case
|
|
392
|
-
const { index:
|
|
393
|
-
|
|
391
|
+
case g.ADD: {
|
|
392
|
+
const { index: u, item: f } = l;
|
|
393
|
+
h(f, i, u + a, r);
|
|
394
394
|
break;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
const { component: r } = e, { props: n } =
|
|
398
|
+
function lt(e, t) {
|
|
399
|
+
const { component: r } = e, { props: n } = A(t);
|
|
400
400
|
r.updateProps(n), t.component = r, t.el = r.firstElement;
|
|
401
401
|
}
|
|
402
402
|
function ft(e, t, r) {
|
|
403
403
|
if (e.container !== t.container) {
|
|
404
|
-
p(e),
|
|
404
|
+
p(e), h(t, document.body, null, r);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
F(e, t, r);
|
|
408
408
|
}
|
|
409
409
|
const dt = (e) => e.isProvider, ht = (e) => e.isConsumer;
|
|
410
|
-
class
|
|
410
|
+
class k {
|
|
411
411
|
isMounted = !1;
|
|
412
412
|
vdom = null;
|
|
413
413
|
hostEl = null;
|
|
@@ -433,7 +433,7 @@ class T {
|
|
|
433
433
|
r !== -1 && (this.dependencies.splice(r, 1), t.subscribedProvider = null);
|
|
434
434
|
}
|
|
435
435
|
notify() {
|
|
436
|
-
|
|
436
|
+
d(() => {
|
|
437
437
|
this.dependencies.forEach(({ consumer: t }) => {
|
|
438
438
|
t.isMounted && t.updateContext() && t.patch(t.props, t.state);
|
|
439
439
|
});
|
|
@@ -470,8 +470,8 @@ class T {
|
|
|
470
470
|
return this.vdom?.type === c.FRAGMENT && this.hostEl && this.firstElement ? Array.from(this.hostEl.children).indexOf(this.firstElement) : 0;
|
|
471
471
|
}
|
|
472
472
|
updateProps(t) {
|
|
473
|
-
const n = { ...this.getDefaultProps(), ...this.props, ...t },
|
|
474
|
-
this.props = n, !this.shouldComponentUpdate(
|
|
473
|
+
const n = { ...this.getDefaultProps(), ...this.props, ...t }, s = this.props;
|
|
474
|
+
this.props = n, !this.shouldComponentUpdate(s, n) && (dt(this) && this.notify(), this.patch(s, this.state));
|
|
475
475
|
}
|
|
476
476
|
setState(t) {
|
|
477
477
|
const r = this.state;
|
|
@@ -485,22 +485,22 @@ class T {
|
|
|
485
485
|
throw new Error("Component is already mounted");
|
|
486
486
|
ht(this) && !this.subscribedProvider && this.subscribeToProvider(), this.updateContext();
|
|
487
487
|
try {
|
|
488
|
-
this.vdom = this.render(), this.hostEl = t,
|
|
488
|
+
this.vdom = this.render(), this.hostEl = t, this.isMounted = !0, h(this.vdom, t, r, this);
|
|
489
489
|
} catch (n) {
|
|
490
490
|
this.handleError(n, "mount");
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
unmount() {
|
|
494
|
-
this.isMounted && (
|
|
494
|
+
this.isMounted && (d(() => this.willUnmount()), this.subscribedProvider && this.subscribedProvider.removeDependency({ consumer: this }), this.dependencies.forEach(({ consumer: t }) => {
|
|
495
495
|
t.subscribedProvider = null;
|
|
496
|
-
}), this.dependencies = [], this.vdom && p(this.vdom),
|
|
496
|
+
}), this.dependencies = [], this.vdom && p(this.vdom), d(() => this.didUnmount()), this.vdom = null, this.hostEl = null, this.isMounted = !1, this.error = null);
|
|
497
497
|
}
|
|
498
498
|
patch(t, r) {
|
|
499
499
|
if (!(!this.isMounted || !this.hostEl || !this.vdom) && !this.error) {
|
|
500
|
-
|
|
500
|
+
d(() => this.willUpdate(this.props, this.state));
|
|
501
501
|
try {
|
|
502
502
|
const n = this.render();
|
|
503
|
-
this.vdom =
|
|
503
|
+
this.vdom = y(this.vdom, n, this.hostEl, this), d(() => this.didUpdate(t, r));
|
|
504
504
|
} catch (n) {
|
|
505
505
|
this.handleError(n, "patch");
|
|
506
506
|
}
|
|
@@ -543,48 +543,40 @@ class T {
|
|
|
543
543
|
const i = n.constructor;
|
|
544
544
|
if (i.getDerivedStateFromError) {
|
|
545
545
|
console.log("Calling getDerivedStateFromError");
|
|
546
|
-
const
|
|
547
|
-
n.state = { ...n.state, ...
|
|
546
|
+
const o = i.getDerivedStateFromError(t);
|
|
547
|
+
n.state = { ...n.state, ...o };
|
|
548
548
|
}
|
|
549
|
-
if (n.hostEl) {
|
|
550
|
-
console.log("Rendering fallback UI")
|
|
549
|
+
if (n.hostEl && n.isMounted) {
|
|
550
|
+
console.log("Rendering fallback UI");
|
|
551
551
|
try {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
componentStack: this.getComponentStack()
|
|
563
|
-
}), n.didMount();
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
} else
|
|
567
|
-
console.error("ErrorBoundary.render() returned null or undefined!");
|
|
568
|
-
} catch (s) {
|
|
569
|
-
console.error("Error during ErrorBoundary recovery:", s), n.parent && n.parent.handleError(s, r);
|
|
552
|
+
const o = n.render();
|
|
553
|
+
o && (n.vdom = y(n.vdom, o, n.hostEl, n), d(() => {
|
|
554
|
+
n.didCatch(t, {
|
|
555
|
+
phase: r,
|
|
556
|
+
failedComponent: this.constructor.name,
|
|
557
|
+
componentStack: this.getComponentStack()
|
|
558
|
+
});
|
|
559
|
+
}));
|
|
560
|
+
} catch (o) {
|
|
561
|
+
console.error("Error during ErrorBoundary recovery:", o), n.parent && n.parent.handleError(o, r);
|
|
570
562
|
}
|
|
571
563
|
}
|
|
572
564
|
return;
|
|
573
565
|
}
|
|
574
566
|
console.log("No error boundary found, handling locally");
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const i =
|
|
567
|
+
const s = this.constructor;
|
|
568
|
+
if (s.getDerivedStateFromError) {
|
|
569
|
+
const i = s.getDerivedStateFromError(t);
|
|
578
570
|
this.state = { ...this.state, ...i };
|
|
579
571
|
}
|
|
580
|
-
|
|
572
|
+
d(() => {
|
|
581
573
|
if (this.didCatch(t, {
|
|
582
574
|
phase: r,
|
|
583
575
|
componentStack: this.getComponentStack()
|
|
584
576
|
}), this.hostEl && this.isMounted)
|
|
585
577
|
try {
|
|
586
578
|
const i = this.render();
|
|
587
|
-
i &&
|
|
579
|
+
i && y(this.vdom, i, this.hostEl, this);
|
|
588
580
|
} catch (i) {
|
|
589
581
|
console.error("Error during error recovery render:", i);
|
|
590
582
|
}
|
|
@@ -611,31 +603,31 @@ class T {
|
|
|
611
603
|
}
|
|
612
604
|
}
|
|
613
605
|
function yt(e) {
|
|
614
|
-
class t extends
|
|
606
|
+
class t extends k {
|
|
615
607
|
isProvider = !0;
|
|
616
608
|
render() {
|
|
617
|
-
let
|
|
618
|
-
return Array.isArray(this.props.children) ?
|
|
609
|
+
let s = [];
|
|
610
|
+
return Array.isArray(this.props.children) ? s = this.props.children : this.props.children ? s = [this.props.children] : s = [], U(s);
|
|
619
611
|
}
|
|
620
612
|
}
|
|
621
|
-
class r extends
|
|
613
|
+
class r extends k {
|
|
622
614
|
static contextType = {
|
|
623
615
|
Provider: t,
|
|
624
616
|
defaultValue: e
|
|
625
617
|
};
|
|
626
618
|
isConsumer = !0;
|
|
627
619
|
render() {
|
|
628
|
-
let
|
|
629
|
-
if (Array.isArray(
|
|
630
|
-
if (
|
|
631
|
-
|
|
620
|
+
let s = this.props.children;
|
|
621
|
+
if (Array.isArray(s))
|
|
622
|
+
if (s.length === 1 && typeof s[0] == "function")
|
|
623
|
+
s = s[0];
|
|
632
624
|
else
|
|
633
625
|
throw new Error(
|
|
634
626
|
"Consumer: expected single function child, got array"
|
|
635
627
|
);
|
|
636
|
-
if (typeof
|
|
628
|
+
if (typeof s != "function")
|
|
637
629
|
throw new Error("Consumer: children is not a function");
|
|
638
|
-
return
|
|
630
|
+
return s(this.context);
|
|
639
631
|
}
|
|
640
632
|
}
|
|
641
633
|
return {
|
|
@@ -647,7 +639,7 @@ function yt(e) {
|
|
|
647
639
|
function Et(e, t) {
|
|
648
640
|
if (!t)
|
|
649
641
|
throw new Error("Container element is not provided for rendering.");
|
|
650
|
-
|
|
642
|
+
h(e, t);
|
|
651
643
|
}
|
|
652
644
|
function gt(e = null) {
|
|
653
645
|
return {
|
|
@@ -656,15 +648,15 @@ function gt(e = null) {
|
|
|
656
648
|
}
|
|
657
649
|
function vt(e, t) {
|
|
658
650
|
const r = Array.isArray(e) ? e : [e];
|
|
659
|
-
return
|
|
651
|
+
return B(r, t);
|
|
660
652
|
}
|
|
661
653
|
export {
|
|
662
|
-
|
|
654
|
+
k as Component,
|
|
663
655
|
yt as createContext,
|
|
664
656
|
vt as createPortal,
|
|
665
657
|
gt as createRef,
|
|
666
658
|
Pt as h,
|
|
667
|
-
|
|
659
|
+
U as hFragment,
|
|
668
660
|
Ot as hString,
|
|
669
661
|
Et as render
|
|
670
662
|
};
|