ddd-react 1.10.10 → 1.10.11
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 +139 -132
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { D as u, 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)
|
|
@@ -39,19 +39,19 @@ function b(e, t) {
|
|
|
39
39
|
}
|
|
40
40
|
return !1;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
function o(
|
|
44
|
-
const
|
|
45
|
-
n ? t.call(n,
|
|
42
|
+
function M(e, t, r, n = null) {
|
|
43
|
+
function o(s) {
|
|
44
|
+
const i = s;
|
|
45
|
+
n ? t.call(n, i) : t(i);
|
|
46
46
|
}
|
|
47
47
|
return r.addEventListener(e, o), o;
|
|
48
48
|
}
|
|
49
49
|
function I(e = {}, t, r = null) {
|
|
50
50
|
const n = {};
|
|
51
|
-
return Object.entries(e).forEach(([o,
|
|
52
|
-
n[o] =
|
|
51
|
+
return Object.entries(e).forEach(([o, s]) => {
|
|
52
|
+
n[o] = M(
|
|
53
53
|
o,
|
|
54
|
-
|
|
54
|
+
s,
|
|
55
55
|
t,
|
|
56
56
|
r
|
|
57
57
|
);
|
|
@@ -65,23 +65,23 @@ function $(e = {}, t) {
|
|
|
65
65
|
function p(e) {
|
|
66
66
|
const { type: t } = e;
|
|
67
67
|
switch (t) {
|
|
68
|
-
case
|
|
68
|
+
case u.TEXT: {
|
|
69
69
|
q(e);
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
|
-
case
|
|
72
|
+
case u.ELEMENT: {
|
|
73
73
|
G(e);
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
|
-
case
|
|
76
|
+
case u.FRAGMENT: {
|
|
77
77
|
_(e);
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
80
|
-
case
|
|
80
|
+
case u.COMPONENT: {
|
|
81
81
|
e.component?.unmount();
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
|
-
case
|
|
84
|
+
case u.PORTAL: {
|
|
85
85
|
X(e);
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
@@ -106,7 +106,7 @@ function X(e) {
|
|
|
106
106
|
const { children: t } = e;
|
|
107
107
|
t && t.forEach(p);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function N(e, t, r) {
|
|
110
110
|
e.style[t] = r.toString();
|
|
111
111
|
}
|
|
112
112
|
function J(e, t) {
|
|
@@ -114,11 +114,11 @@ function J(e, t) {
|
|
|
114
114
|
}
|
|
115
115
|
function K(e, t) {
|
|
116
116
|
const { class: r, style: n, ...o } = t;
|
|
117
|
-
r && W(e, r), n && Object.entries(n).forEach(([
|
|
118
|
-
|
|
117
|
+
r && W(e, r), n && Object.entries(n).forEach(([s, i]) => {
|
|
118
|
+
N(e, s, i);
|
|
119
119
|
});
|
|
120
|
-
for (const [
|
|
121
|
-
w(e,
|
|
120
|
+
for (const [s, i] of Object.entries(o))
|
|
121
|
+
w(e, s, i);
|
|
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() {
|
|
@@ -165,27 +165,27 @@ function C(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
|
-
case
|
|
170
|
+
case u.TEXT: {
|
|
171
171
|
z(e, t, r);
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
|
-
case
|
|
174
|
+
case u.ELEMENT: {
|
|
175
175
|
Z(e, t, r, n);
|
|
176
176
|
break;
|
|
177
177
|
}
|
|
178
|
-
case
|
|
178
|
+
case u.FRAGMENT: {
|
|
179
179
|
Q(e, t, r, n);
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
|
-
case
|
|
182
|
+
case u.COMPONENT: {
|
|
183
183
|
tt(e, t, r, n);
|
|
184
184
|
const o = e.component;
|
|
185
|
-
o &&
|
|
185
|
+
o && d(() => o.didMount());
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
|
-
case
|
|
188
|
+
case u.PORTAL: {
|
|
189
189
|
et(e, n);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
@@ -199,23 +199,23 @@ function z(e, t, r) {
|
|
|
199
199
|
}
|
|
200
200
|
function Q(e, t, r, n) {
|
|
201
201
|
const { children: o } = e;
|
|
202
|
-
e.el = t, o?.forEach((
|
|
203
|
-
|
|
202
|
+
e.el = t, o?.forEach((s, i) => {
|
|
203
|
+
h(s, t, r != null ? r + i : null, n);
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
function Z(e, t, r, n) {
|
|
207
|
-
const { tag: o, children:
|
|
208
|
-
V(
|
|
209
|
-
|
|
210
|
-
}), L(
|
|
207
|
+
const { tag: o, children: s } = e, c = o === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", o) : document.createElement(o);
|
|
208
|
+
V(c, e, n), e.el = c, s?.forEach((a) => {
|
|
209
|
+
h(a, c, null, n);
|
|
210
|
+
}), L(c, t, r);
|
|
211
211
|
}
|
|
212
212
|
function V(e, t, r) {
|
|
213
213
|
const { props: n, events: o } = C(t);
|
|
214
214
|
n.ref && typeof n.ref == "object" && "current" in n.ref && (n.ref.current = e, delete n.ref), t.listeners = I(o, e, r), K(e, n);
|
|
215
215
|
}
|
|
216
216
|
function tt(e, t, r, n) {
|
|
217
|
-
const o = e.tag, { props:
|
|
218
|
-
|
|
217
|
+
const o = e.tag, { props: s } = C(e), i = new o(s, n);
|
|
218
|
+
i.mount(t, r), e.component = i, e.el = i.firstElement || null;
|
|
219
219
|
}
|
|
220
220
|
function L(e, t, r) {
|
|
221
221
|
if (r == null) {
|
|
@@ -230,65 +230,65 @@ function L(e, t, r) {
|
|
|
230
230
|
function et(e, t) {
|
|
231
231
|
const { children: r, container: n } = e;
|
|
232
232
|
r?.forEach((o) => {
|
|
233
|
-
|
|
233
|
+
h(o, n, null, t);
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
function j(e, t) {
|
|
237
237
|
if (e.type !== t.type)
|
|
238
238
|
return !1;
|
|
239
|
-
if (e.type ===
|
|
239
|
+
if (e.type === u.ELEMENT) {
|
|
240
240
|
const r = e, n = t, {
|
|
241
241
|
tag: o,
|
|
242
|
-
props: { key:
|
|
242
|
+
props: { key: s }
|
|
243
243
|
} = r, {
|
|
244
|
-
tag:
|
|
245
|
-
props: { key:
|
|
244
|
+
tag: i,
|
|
245
|
+
props: { key: c }
|
|
246
246
|
} = n;
|
|
247
|
-
return o ===
|
|
247
|
+
return o === i && s === c;
|
|
248
248
|
}
|
|
249
|
-
if (e.type ===
|
|
250
|
-
const r = e, n = t, { tag: o } = r, { tag:
|
|
251
|
-
return o ===
|
|
249
|
+
if (e.type === u.COMPONENT) {
|
|
250
|
+
const r = e, n = t, { tag: o } = r, { tag: s } = n;
|
|
251
|
+
return o === s;
|
|
252
252
|
}
|
|
253
|
-
if (e.type ===
|
|
253
|
+
if (e.type === u.PORTAL) {
|
|
254
254
|
const r = e, n = t;
|
|
255
255
|
return r.container === n.container;
|
|
256
256
|
}
|
|
257
257
|
return !0;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
const r = Object.keys(e), n = Object.keys(t), o = [],
|
|
261
|
-
for (const
|
|
262
|
-
|
|
259
|
+
function S(e, t) {
|
|
260
|
+
const r = Object.keys(e), n = Object.keys(t), o = [], s = [];
|
|
261
|
+
for (const i of n)
|
|
262
|
+
i in e ? e[i] !== t[i] && s.push(i) : o.push(i);
|
|
263
263
|
return {
|
|
264
264
|
added: o,
|
|
265
|
-
removed: r.filter((
|
|
266
|
-
updated:
|
|
265
|
+
removed: r.filter((i) => !(i in t)),
|
|
266
|
+
updated: s
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function rt(e) {
|
|
270
270
|
return e !== "";
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function A(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
277
|
const o = nt(r, e.el);
|
|
278
|
-
return p(e),
|
|
278
|
+
return p(e), h(t, r, o, n), t;
|
|
279
279
|
}
|
|
280
280
|
switch (t.el = e.el, t.type) {
|
|
281
|
-
case
|
|
281
|
+
case u.TEXT:
|
|
282
282
|
return ot(e, t), t;
|
|
283
|
-
case
|
|
283
|
+
case u.ELEMENT: {
|
|
284
284
|
st(e, t, n);
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
|
-
case
|
|
287
|
+
case u.COMPONENT: {
|
|
288
288
|
at(e, t);
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
291
|
-
case
|
|
291
|
+
case u.PORTAL: {
|
|
292
292
|
ft(e, t, n);
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
@@ -307,23 +307,23 @@ function ot(e, t) {
|
|
|
307
307
|
function st(e, t, r) {
|
|
308
308
|
const n = e.el, {
|
|
309
309
|
class: o,
|
|
310
|
-
style:
|
|
311
|
-
on:
|
|
312
|
-
...
|
|
310
|
+
style: s,
|
|
311
|
+
on: i,
|
|
312
|
+
...c
|
|
313
313
|
} = e.props ?? {}, {
|
|
314
314
|
class: a,
|
|
315
315
|
style: l,
|
|
316
316
|
on: f,
|
|
317
|
-
...
|
|
317
|
+
...E
|
|
318
318
|
} = t.props ?? {}, { listeners: v } = e;
|
|
319
|
-
it(n,
|
|
319
|
+
it(n, c, E), ct(n, o, a), ut(
|
|
320
320
|
n,
|
|
321
|
-
|
|
321
|
+
s,
|
|
322
322
|
l
|
|
323
|
-
), t.listeners =
|
|
323
|
+
), t.listeners = lt(
|
|
324
324
|
n,
|
|
325
325
|
v,
|
|
326
|
-
|
|
326
|
+
i ?? {},
|
|
327
327
|
f ?? {},
|
|
328
328
|
r
|
|
329
329
|
);
|
|
@@ -331,37 +331,37 @@ function st(e, t, r) {
|
|
|
331
331
|
function it(e, t = {}, r = {}) {
|
|
332
332
|
const n = t.ref, o = r.ref;
|
|
333
333
|
n !== o && (n && typeof n == "object" && "current" in n && (n.current = null), o && typeof o == "object" && "current" in o && (o.current = e));
|
|
334
|
-
const
|
|
335
|
-
delete
|
|
336
|
-
const { added:
|
|
334
|
+
const s = { ...t }, i = { ...r };
|
|
335
|
+
delete s.ref, delete i.ref;
|
|
336
|
+
const { added: c, removed: a, updated: l } = S(s, i);
|
|
337
337
|
for (const f of a)
|
|
338
338
|
D(e, f);
|
|
339
|
-
for (const f of
|
|
340
|
-
w(e, f,
|
|
339
|
+
for (const f of c.concat(l))
|
|
340
|
+
w(e, f, i[f]);
|
|
341
341
|
}
|
|
342
342
|
function ct(e, t, r) {
|
|
343
|
-
const n = k(t), o = k(r), { added:
|
|
344
|
-
|
|
343
|
+
const n = k(t), o = k(r), { added: s, removed: i } = x(n, o);
|
|
344
|
+
i.length > 0 && e.classList.remove(...i), s.length > 0 && e.classList.add(...s);
|
|
345
345
|
}
|
|
346
346
|
function k(e = "") {
|
|
347
|
-
return Array.isArray(e) ? e.filter(
|
|
348
|
-
}
|
|
349
|
-
function
|
|
350
|
-
const { added: n, removed: o, updated:
|
|
351
|
-
for (const
|
|
352
|
-
J(e,
|
|
353
|
-
for (const
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
function
|
|
357
|
-
const { removed:
|
|
358
|
-
for (const l of
|
|
347
|
+
return Array.isArray(e) ? e.filter(A) : String(e).split(/(\s+)/).filter(A);
|
|
348
|
+
}
|
|
349
|
+
function ut(e, t = {}, r = {}) {
|
|
350
|
+
const { added: n, removed: o, updated: s } = S(t, r);
|
|
351
|
+
for (const i of o)
|
|
352
|
+
J(e, i);
|
|
353
|
+
for (const i of n.concat(s))
|
|
354
|
+
N(e, i, r[i]);
|
|
355
|
+
}
|
|
356
|
+
function lt(e, t = {}, r = {}, n = {}, o = null) {
|
|
357
|
+
const { removed: s, added: i, updated: c } = S(r, n);
|
|
358
|
+
for (const l of s.concat(c)) {
|
|
359
359
|
const f = t?.[l];
|
|
360
360
|
f && e.removeEventListener(l, f);
|
|
361
361
|
}
|
|
362
362
|
const a = {};
|
|
363
|
-
for (const l of
|
|
364
|
-
a[l] =
|
|
363
|
+
for (const l of i.concat(c))
|
|
364
|
+
a[l] = M(
|
|
365
365
|
l,
|
|
366
366
|
n[l],
|
|
367
367
|
e,
|
|
@@ -370,27 +370,27 @@ function ut(e, t = {}, r = {}, n = {}, o = null) {
|
|
|
370
370
|
return a;
|
|
371
371
|
}
|
|
372
372
|
function F(e, t, r) {
|
|
373
|
-
const n = m(e), o = m(t),
|
|
374
|
-
for (const a of
|
|
375
|
-
if (a.op ===
|
|
373
|
+
const n = m(e), o = m(t), s = e.el, i = R(n, o, j), c = r?.offset ?? 0;
|
|
374
|
+
for (const a of i)
|
|
375
|
+
if (a.op === g.NOOP) {
|
|
376
376
|
const { originalIndex: l, index: f } = a;
|
|
377
|
-
|
|
377
|
+
y(n[l], o[f], s, r);
|
|
378
378
|
}
|
|
379
|
-
for (const a of
|
|
379
|
+
for (const a of i)
|
|
380
380
|
switch (a.op) {
|
|
381
|
-
case
|
|
382
|
-
const { from: l, index: f } = a,
|
|
383
|
-
|
|
381
|
+
case g.MOVE: {
|
|
382
|
+
const { from: l, index: f } = a, E = n[l].el, v = s.childNodes[f + c];
|
|
383
|
+
E && (s.insertBefore(E, v), y(n[l], o[f], s, r));
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
case
|
|
386
|
+
case g.REMOVE: {
|
|
387
387
|
const { item: l } = a;
|
|
388
388
|
p(l);
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
|
-
case
|
|
391
|
+
case g.ADD: {
|
|
392
392
|
const { index: l, item: f } = a;
|
|
393
|
-
|
|
393
|
+
h(f, s, l + c, r);
|
|
394
394
|
break;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
@@ -401,7 +401,7 @@ function at(e, t) {
|
|
|
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);
|
|
@@ -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
|
});
|
|
@@ -461,13 +461,13 @@ class T {
|
|
|
461
461
|
return b(t, r);
|
|
462
462
|
}
|
|
463
463
|
get elements() {
|
|
464
|
-
return this.vdom == null ? [] : this.vdom.type ===
|
|
464
|
+
return this.vdom == null ? [] : this.vdom.type === u.FRAGMENT ? m(this.vdom).flatMap((t) => t.type === u.COMPONENT && t.component ? t.component.elements : t.el ? [t.el] : []) : this.vdom.el ? [this.vdom.el] : [];
|
|
465
465
|
}
|
|
466
466
|
get firstElement() {
|
|
467
467
|
return this.elements[0];
|
|
468
468
|
}
|
|
469
469
|
get offset() {
|
|
470
|
-
return this.vdom?.type ===
|
|
470
|
+
return this.vdom?.type === u.FRAGMENT && this.hostEl && this.firstElement ? Array.from(this.hostEl.children).indexOf(this.firstElement) : 0;
|
|
471
471
|
}
|
|
472
472
|
updateProps(t) {
|
|
473
473
|
const n = { ...this.getDefaultProps(), ...this.props, ...t }, o = this.props;
|
|
@@ -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
|
}
|
|
@@ -540,22 +540,31 @@ class T {
|
|
|
540
540
|
const n = this.findClosestErrorBoundary();
|
|
541
541
|
if (console.log("errorBoundary", n), n) {
|
|
542
542
|
console.log("Found error boundary");
|
|
543
|
-
const i = n.
|
|
544
|
-
if (
|
|
543
|
+
const s = n.constructor, i = { ...n.state };
|
|
544
|
+
if (s.getDerivedStateFromError) {
|
|
545
545
|
console.log("Calling getDerivedStateFromError");
|
|
546
|
-
const
|
|
547
|
-
n.state = { ...n.state, ...
|
|
546
|
+
const c = s.getDerivedStateFromError(t);
|
|
547
|
+
n.state = { ...n.state, ...c };
|
|
548
548
|
}
|
|
549
549
|
if (n.hostEl) {
|
|
550
|
-
console.log("Rendering fallback UI")
|
|
550
|
+
console.log("Rendering fallback UI");
|
|
551
551
|
try {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
552
|
+
const c = n.render();
|
|
553
|
+
if (c)
|
|
554
|
+
if (n.vdom) {
|
|
555
|
+
console.log("ErrorBoundary already mounted, patching");
|
|
556
|
+
const a = n.vdom;
|
|
557
|
+
n.vdom = y(a, c, n.hostEl, n), d(() => {
|
|
558
|
+
n.didCatch(t, {
|
|
559
|
+
phase: r,
|
|
560
|
+
failedComponent: this.constructor.name,
|
|
561
|
+
componentStack: this.getComponentStack()
|
|
562
|
+
}), n.didUpdate(n.props, i);
|
|
563
|
+
});
|
|
564
|
+
} else {
|
|
565
|
+
for (console.log("Mounting ErrorBoundary fallback (first time)"); n.hostEl.firstChild; )
|
|
557
566
|
n.hostEl.removeChild(n.hostEl.firstChild);
|
|
558
|
-
|
|
567
|
+
h(c, n.hostEl, null, n.parent), n.vdom = c, n.isMounted = !0, d(() => {
|
|
559
568
|
n.didCatch(t, {
|
|
560
569
|
phase: r,
|
|
561
570
|
failedComponent: this.constructor.name,
|
|
@@ -563,10 +572,8 @@ class T {
|
|
|
563
572
|
}), n.didMount();
|
|
564
573
|
});
|
|
565
574
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
} catch (s) {
|
|
569
|
-
console.error("Error during ErrorBoundary recovery:", s), n.parent && n.parent.handleError(s, r);
|
|
575
|
+
} catch (c) {
|
|
576
|
+
console.error("Error during ErrorBoundary recovery:", c), n.parent && n.parent.handleError(c, r);
|
|
570
577
|
}
|
|
571
578
|
}
|
|
572
579
|
return;
|
|
@@ -574,19 +581,19 @@ class T {
|
|
|
574
581
|
console.log("No error boundary found, handling locally");
|
|
575
582
|
const o = this.constructor;
|
|
576
583
|
if (o.getDerivedStateFromError) {
|
|
577
|
-
const
|
|
578
|
-
this.state = { ...this.state, ...
|
|
584
|
+
const s = o.getDerivedStateFromError(t);
|
|
585
|
+
this.state = { ...this.state, ...s };
|
|
579
586
|
}
|
|
580
|
-
|
|
587
|
+
d(() => {
|
|
581
588
|
if (this.didCatch(t, {
|
|
582
589
|
phase: r,
|
|
583
590
|
componentStack: this.getComponentStack()
|
|
584
591
|
}), this.hostEl && this.isMounted)
|
|
585
592
|
try {
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
} catch (
|
|
589
|
-
console.error("Error during error recovery render:",
|
|
593
|
+
const s = this.render();
|
|
594
|
+
s && y(this.vdom, s, this.hostEl, this);
|
|
595
|
+
} catch (s) {
|
|
596
|
+
console.error("Error during error recovery render:", s);
|
|
590
597
|
}
|
|
591
598
|
});
|
|
592
599
|
}
|
|
@@ -615,7 +622,7 @@ function yt(e) {
|
|
|
615
622
|
isProvider = !0;
|
|
616
623
|
render() {
|
|
617
624
|
let o = [];
|
|
618
|
-
return Array.isArray(this.props.children) ? o = this.props.children : this.props.children ? o = [this.props.children] : o = [],
|
|
625
|
+
return Array.isArray(this.props.children) ? o = this.props.children : this.props.children ? o = [this.props.children] : o = [], U(o);
|
|
619
626
|
}
|
|
620
627
|
}
|
|
621
628
|
class r extends T {
|
|
@@ -647,7 +654,7 @@ function yt(e) {
|
|
|
647
654
|
function Et(e, t) {
|
|
648
655
|
if (!t)
|
|
649
656
|
throw new Error("Container element is not provided for rendering.");
|
|
650
|
-
|
|
657
|
+
h(e, t);
|
|
651
658
|
}
|
|
652
659
|
function gt(e = null) {
|
|
653
660
|
return {
|
|
@@ -656,7 +663,7 @@ function gt(e = null) {
|
|
|
656
663
|
}
|
|
657
664
|
function vt(e, t) {
|
|
658
665
|
const r = Array.isArray(e) ? e : [e];
|
|
659
|
-
return
|
|
666
|
+
return B(r, t);
|
|
660
667
|
}
|
|
661
668
|
export {
|
|
662
669
|
T as Component,
|
|
@@ -664,7 +671,7 @@ export {
|
|
|
664
671
|
vt as createPortal,
|
|
665
672
|
gt as createRef,
|
|
666
673
|
Pt as h,
|
|
667
|
-
|
|
674
|
+
U as hFragment,
|
|
668
675
|
Ot as hString,
|
|
669
676
|
Et as render
|
|
670
677
|
};
|