ddd-react 1.10.3 → 1.10.4
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 +76 -70
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as c, e as m, a as F, A as
|
|
1
|
+
import { D as c, e as m, a as F, 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)
|
|
@@ -204,10 +204,10 @@ function Q(e, t, r, n) {
|
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
function Z(e, t, r, n) {
|
|
207
|
-
const { tag: s, children: i } = e,
|
|
208
|
-
V(
|
|
209
|
-
h(
|
|
210
|
-
}), L(
|
|
207
|
+
const { tag: s, children: i } = e, l = s === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", s) : document.createElement(s);
|
|
208
|
+
V(l, e, n), e.el = l, i?.forEach((a) => {
|
|
209
|
+
h(a, l, null, n);
|
|
210
|
+
}), L(l, t, r);
|
|
211
211
|
}
|
|
212
212
|
function V(e, t, r) {
|
|
213
213
|
const { props: n, events: s } = A(t);
|
|
@@ -242,9 +242,9 @@ function j(e, t) {
|
|
|
242
242
|
props: { key: i }
|
|
243
243
|
} = r, {
|
|
244
244
|
tag: o,
|
|
245
|
-
props: { key:
|
|
245
|
+
props: { key: l }
|
|
246
246
|
} = n;
|
|
247
|
-
return s === o && i ===
|
|
247
|
+
return s === o && i === l;
|
|
248
248
|
}
|
|
249
249
|
if (e.type === c.COMPONENT) {
|
|
250
250
|
const r = e, n = t, { tag: s } = r, { tag: i } = n;
|
|
@@ -285,11 +285,11 @@ function y(e, t, r, n = null) {
|
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
287
|
case c.COMPONENT: {
|
|
288
|
-
|
|
288
|
+
at(e, t);
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
291
291
|
case c.PORTAL: {
|
|
292
|
-
|
|
292
|
+
ft(e, t, n);
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
@@ -309,22 +309,22 @@ function ot(e, t, r) {
|
|
|
309
309
|
class: s,
|
|
310
310
|
style: i,
|
|
311
311
|
on: o,
|
|
312
|
-
...
|
|
312
|
+
...l
|
|
313
313
|
} = e.props ?? {}, {
|
|
314
|
-
class:
|
|
314
|
+
class: a,
|
|
315
315
|
style: u,
|
|
316
|
-
on:
|
|
316
|
+
on: f,
|
|
317
317
|
...E
|
|
318
|
-
} = t.props ?? {}, { listeners:
|
|
319
|
-
it(n,
|
|
318
|
+
} = t.props ?? {}, { listeners: v } = e;
|
|
319
|
+
it(n, l, E), ct(n, s, a), ut(
|
|
320
320
|
n,
|
|
321
321
|
i,
|
|
322
322
|
u
|
|
323
|
-
), t.listeners =
|
|
323
|
+
), t.listeners = lt(
|
|
324
324
|
n,
|
|
325
|
-
|
|
325
|
+
v,
|
|
326
326
|
o ?? {},
|
|
327
|
-
|
|
327
|
+
f ?? {},
|
|
328
328
|
r
|
|
329
329
|
);
|
|
330
330
|
}
|
|
@@ -333,11 +333,11 @@ function it(e, t = {}, r = {}) {
|
|
|
333
333
|
n !== s && (n && typeof n == "object" && "current" in n && (n.current = null), s && typeof s == "object" && "current" in s && (s.current = e));
|
|
334
334
|
const i = { ...t }, o = { ...r };
|
|
335
335
|
delete i.ref, delete o.ref;
|
|
336
|
-
const { added:
|
|
337
|
-
for (const
|
|
338
|
-
D(e,
|
|
339
|
-
for (const
|
|
340
|
-
w(e,
|
|
336
|
+
const { added: l, removed: a, updated: u } = S(i, o);
|
|
337
|
+
for (const f of a)
|
|
338
|
+
D(e, f);
|
|
339
|
+
for (const f of l.concat(u))
|
|
340
|
+
w(e, f, o[f]);
|
|
341
341
|
}
|
|
342
342
|
function ct(e, t, r) {
|
|
343
343
|
const n = T(t), s = T(r), { added: i, removed: o } = x(n, s);
|
|
@@ -353,53 +353,53 @@ function ut(e, t = {}, r = {}) {
|
|
|
353
353
|
for (const o of n.concat(i))
|
|
354
354
|
M(e, o, r[o]);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const { removed: i, added: o, updated:
|
|
358
|
-
for (const u of i.concat(
|
|
359
|
-
const
|
|
360
|
-
|
|
356
|
+
function lt(e, t = {}, r = {}, n = {}, s = null) {
|
|
357
|
+
const { removed: i, added: o, updated: l } = S(r, n);
|
|
358
|
+
for (const u of i.concat(l)) {
|
|
359
|
+
const f = t?.[u];
|
|
360
|
+
f && e.removeEventListener(u, f);
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
for (const u of o.concat(
|
|
364
|
-
|
|
362
|
+
const a = {};
|
|
363
|
+
for (const u of o.concat(l))
|
|
364
|
+
a[u] = N(
|
|
365
365
|
u,
|
|
366
366
|
n[u],
|
|
367
367
|
e,
|
|
368
368
|
s
|
|
369
369
|
);
|
|
370
|
-
return
|
|
370
|
+
return a;
|
|
371
371
|
}
|
|
372
372
|
function R(e, t, r) {
|
|
373
|
-
const n = m(e), s = m(t), i = e.el, o = F(n, s, j),
|
|
374
|
-
for (const
|
|
375
|
-
if (
|
|
376
|
-
const { originalIndex: u, index:
|
|
377
|
-
y(n[u], s[
|
|
373
|
+
const n = m(e), s = m(t), i = e.el, o = F(n, s, j), l = r?.offset ?? 0;
|
|
374
|
+
for (const a of o)
|
|
375
|
+
if (a.op === g.NOOP) {
|
|
376
|
+
const { originalIndex: u, index: f } = a;
|
|
377
|
+
y(n[u], s[f], i, r);
|
|
378
378
|
}
|
|
379
|
-
for (const
|
|
380
|
-
switch (
|
|
381
|
-
case
|
|
382
|
-
const { from: u, index:
|
|
383
|
-
E && (i.insertBefore(E,
|
|
379
|
+
for (const a of o)
|
|
380
|
+
switch (a.op) {
|
|
381
|
+
case g.MOVE: {
|
|
382
|
+
const { from: u, index: f } = a, E = n[u].el, v = i.childNodes[f + l];
|
|
383
|
+
E && (i.insertBefore(E, v), y(n[u], s[f], i, r));
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
|
-
case
|
|
387
|
-
const { item: u } =
|
|
386
|
+
case g.REMOVE: {
|
|
387
|
+
const { item: u } = a;
|
|
388
388
|
p(u);
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
|
-
case
|
|
392
|
-
const { index: u, item:
|
|
393
|
-
h(
|
|
391
|
+
case g.ADD: {
|
|
392
|
+
const { index: u, item: f } = a;
|
|
393
|
+
h(f, i, u + l, r);
|
|
394
394
|
break;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function at(e, t) {
|
|
399
399
|
const { component: r } = e, { props: n } = A(t);
|
|
400
400
|
r.updateProps(n), t.component = r, t.el = r.firstElement;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function ft(e, t, r) {
|
|
403
403
|
if (e.container !== t.container) {
|
|
404
404
|
p(e), h(t, document.body, null, r);
|
|
405
405
|
return;
|
|
@@ -538,27 +538,33 @@ class k {
|
|
|
538
538
|
handleError(t, r) {
|
|
539
539
|
console.log("handleError");
|
|
540
540
|
const n = this.findClosestErrorBoundary();
|
|
541
|
-
if (console.log("errorBoundary", n),
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
541
|
+
if (console.log("errorBoundary", n), console.log(1), n) {
|
|
542
|
+
if (console.log(2), n.isMounted) {
|
|
543
|
+
console.log(3);
|
|
544
|
+
const i = n.constructor;
|
|
545
|
+
if (i.getDerivedStateFromError) {
|
|
546
|
+
console.log(4);
|
|
547
|
+
const o = i.getDerivedStateFromError(t);
|
|
548
|
+
n.state = { ...n.state, ...o };
|
|
549
|
+
}
|
|
550
|
+
if (n.didCatch(t, {
|
|
551
|
+
phase: r,
|
|
552
|
+
failedComponent: this.constructor.name,
|
|
553
|
+
componentStack: this.getComponentStack()
|
|
554
|
+
}), n.hostEl && n.vdom) {
|
|
555
|
+
console.log(5);
|
|
556
|
+
try {
|
|
557
|
+
console.log(6);
|
|
558
|
+
const o = n.render();
|
|
559
|
+
o && (console.log(7), y(n.vdom, o, n.hostEl, n));
|
|
560
|
+
} catch (o) {
|
|
561
|
+
console.log(8), console.error("Error during ErrorBoundary recovery:", o);
|
|
557
562
|
}
|
|
558
|
-
} catch (o) {
|
|
559
|
-
console.error("Error during ErrorBoundary recovery:", o);
|
|
560
563
|
}
|
|
564
|
+
}
|
|
565
|
+
return;
|
|
561
566
|
}
|
|
567
|
+
console.log(9);
|
|
562
568
|
const s = this.constructor;
|
|
563
569
|
if (s.getDerivedStateFromError) {
|
|
564
570
|
const i = s.getDerivedStateFromError(t);
|
|
@@ -636,20 +642,20 @@ function Et(e, t) {
|
|
|
636
642
|
throw new Error("Container element is not provided for rendering.");
|
|
637
643
|
h(e, t);
|
|
638
644
|
}
|
|
639
|
-
function
|
|
645
|
+
function gt(e = null) {
|
|
640
646
|
return {
|
|
641
647
|
current: e
|
|
642
648
|
};
|
|
643
649
|
}
|
|
644
|
-
function
|
|
650
|
+
function vt(e, t) {
|
|
645
651
|
const r = Array.isArray(e) ? e : [e];
|
|
646
652
|
return B(r, t);
|
|
647
653
|
}
|
|
648
654
|
export {
|
|
649
655
|
k as Component,
|
|
650
656
|
yt as createContext,
|
|
651
|
-
|
|
652
|
-
|
|
657
|
+
vt as createPortal,
|
|
658
|
+
gt as createRef,
|
|
653
659
|
Pt as h,
|
|
654
660
|
U as hFragment,
|
|
655
661
|
Ot as hString,
|