ddd-react 1.10.9 → 1.10.10
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 +37 -36
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -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: o, children: i } = e,
|
|
208
|
-
V(
|
|
209
|
-
d(a,
|
|
210
|
-
}), L(
|
|
207
|
+
const { tag: o, children: i } = e, u = o === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", o) : document.createElement(o);
|
|
208
|
+
V(u, e, n), e.el = u, i?.forEach((a) => {
|
|
209
|
+
d(a, u, null, n);
|
|
210
|
+
}), L(u, t, r);
|
|
211
211
|
}
|
|
212
212
|
function V(e, t, r) {
|
|
213
213
|
const { props: n, events: o } = C(t);
|
|
@@ -242,9 +242,9 @@ function j(e, t) {
|
|
|
242
242
|
props: { key: i }
|
|
243
243
|
} = r, {
|
|
244
244
|
tag: s,
|
|
245
|
-
props: { key:
|
|
245
|
+
props: { key: u }
|
|
246
246
|
} = n;
|
|
247
|
-
return o === s && i ===
|
|
247
|
+
return o === s && i === u;
|
|
248
248
|
}
|
|
249
249
|
if (e.type === c.COMPONENT) {
|
|
250
250
|
const r = e, n = t, { tag: o } = r, { tag: i } = n;
|
|
@@ -309,18 +309,18 @@ function st(e, t, r) {
|
|
|
309
309
|
class: o,
|
|
310
310
|
style: i,
|
|
311
311
|
on: s,
|
|
312
|
-
...
|
|
312
|
+
...u
|
|
313
313
|
} = e.props ?? {}, {
|
|
314
314
|
class: a,
|
|
315
|
-
style:
|
|
315
|
+
style: l,
|
|
316
316
|
on: f,
|
|
317
317
|
...y
|
|
318
318
|
} = t.props ?? {}, { listeners: v } = e;
|
|
319
|
-
it(n,
|
|
319
|
+
it(n, u, y), ct(n, o, a), lt(
|
|
320
320
|
n,
|
|
321
321
|
i,
|
|
322
|
-
|
|
323
|
-
), t.listeners =
|
|
322
|
+
l
|
|
323
|
+
), t.listeners = ut(
|
|
324
324
|
n,
|
|
325
325
|
v,
|
|
326
326
|
s ?? {},
|
|
@@ -333,10 +333,10 @@ function it(e, t = {}, r = {}) {
|
|
|
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
334
|
const i = { ...t }, s = { ...r };
|
|
335
335
|
delete i.ref, delete s.ref;
|
|
336
|
-
const { added:
|
|
336
|
+
const { added: u, removed: a, updated: l } = A(i, s);
|
|
337
337
|
for (const f of a)
|
|
338
338
|
D(e, f);
|
|
339
|
-
for (const f of
|
|
339
|
+
for (const f of u.concat(l))
|
|
340
340
|
w(e, f, s[f]);
|
|
341
341
|
}
|
|
342
342
|
function ct(e, t, r) {
|
|
@@ -346,51 +346,51 @@ function ct(e, t, r) {
|
|
|
346
346
|
function k(e = "") {
|
|
347
347
|
return Array.isArray(e) ? e.filter(S) : String(e).split(/(\s+)/).filter(S);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function lt(e, t = {}, r = {}) {
|
|
350
350
|
const { added: n, removed: o, updated: i } = A(t, r);
|
|
351
351
|
for (const s of o)
|
|
352
352
|
J(e, s);
|
|
353
353
|
for (const s of n.concat(i))
|
|
354
354
|
M(e, s, r[s]);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const { removed: i, added: s, updated:
|
|
358
|
-
for (const
|
|
359
|
-
const f = t?.[
|
|
360
|
-
f && e.removeEventListener(
|
|
356
|
+
function ut(e, t = {}, r = {}, n = {}, o = null) {
|
|
357
|
+
const { removed: i, added: s, updated: u } = A(r, n);
|
|
358
|
+
for (const l of i.concat(u)) {
|
|
359
|
+
const f = t?.[l];
|
|
360
|
+
f && e.removeEventListener(l, f);
|
|
361
361
|
}
|
|
362
362
|
const a = {};
|
|
363
|
-
for (const
|
|
364
|
-
a[
|
|
365
|
-
|
|
366
|
-
n[
|
|
363
|
+
for (const l of s.concat(u))
|
|
364
|
+
a[l] = N(
|
|
365
|
+
l,
|
|
366
|
+
n[l],
|
|
367
367
|
e,
|
|
368
368
|
o
|
|
369
369
|
);
|
|
370
370
|
return a;
|
|
371
371
|
}
|
|
372
372
|
function F(e, t, r) {
|
|
373
|
-
const n = m(e), o = m(t), i = e.el, s = R(n, o, j),
|
|
373
|
+
const n = m(e), o = m(t), i = e.el, s = R(n, o, j), u = r?.offset ?? 0;
|
|
374
374
|
for (const a of s)
|
|
375
375
|
if (a.op === E.NOOP) {
|
|
376
|
-
const { originalIndex:
|
|
377
|
-
g(n[
|
|
376
|
+
const { originalIndex: l, index: f } = a;
|
|
377
|
+
g(n[l], o[f], i, r);
|
|
378
378
|
}
|
|
379
379
|
for (const a of s)
|
|
380
380
|
switch (a.op) {
|
|
381
381
|
case E.MOVE: {
|
|
382
|
-
const { from:
|
|
383
|
-
y && (i.insertBefore(y, v), g(n[
|
|
382
|
+
const { from: l, index: f } = a, y = n[l].el, v = i.childNodes[f + u];
|
|
383
|
+
y && (i.insertBefore(y, v), g(n[l], o[f], i, r));
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
386
|
case E.REMOVE: {
|
|
387
|
-
const { item:
|
|
388
|
-
p(
|
|
387
|
+
const { item: l } = a;
|
|
388
|
+
p(l);
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
391
|
case E.ADD: {
|
|
392
|
-
const { index:
|
|
393
|
-
d(f, i,
|
|
392
|
+
const { index: l, item: f } = a;
|
|
393
|
+
d(f, i, l + u, r);
|
|
394
394
|
break;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
@@ -485,7 +485,7 @@ 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, d(this.vdom, t, r, this), this.isMounted = !0;
|
|
489
489
|
} catch (n) {
|
|
490
490
|
this.handleError(n, "mount");
|
|
491
491
|
}
|
|
@@ -547,12 +547,13 @@ class T {
|
|
|
547
547
|
n.state = { ...n.state, ...s };
|
|
548
548
|
}
|
|
549
549
|
if (n.hostEl) {
|
|
550
|
-
console.log("Rendering fallback UI");
|
|
550
|
+
console.log("Rendering fallback UI"), console.log(1);
|
|
551
551
|
try {
|
|
552
|
+
console.log(2);
|
|
552
553
|
const s = n.render();
|
|
553
554
|
if (s) {
|
|
554
|
-
if (!n.vdom) {
|
|
555
|
-
for (console.log("Mounting ErrorBoundary fallback (first time)"); n.hostEl.firstChild; )
|
|
555
|
+
if (console.log(3), !n.vdom) {
|
|
556
|
+
for (console.log(4), console.log("Mounting ErrorBoundary fallback (first time)"); n.hostEl.firstChild; )
|
|
556
557
|
n.hostEl.removeChild(n.hostEl.firstChild);
|
|
557
558
|
d(s, n.hostEl, null, n.parent), n.vdom = s, n.isMounted = !0, h(() => {
|
|
558
559
|
n.didCatch(t, {
|