ddd-react 1.10.8 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +51 -50
  2. 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 E, b as x, h as U, c as B } from "./h-BbaMkkC7.mjs";
1
+ import { D as c, e as m, a as R, A as E, b as x, h as B, c as U } 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: o, children: i } = e, l = o === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", o) : document.createElement(o);
208
- V(l, e, n), e.el = l, i?.forEach((a) => {
209
- d(a, l, null, n);
210
- }), L(l, t, r);
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: l }
245
+ props: { key: u }
246
246
  } = n;
247
- return o === s && i === l;
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
- ...l
312
+ ...u
313
313
  } = e.props ?? {}, {
314
314
  class: a,
315
- style: u,
315
+ style: l,
316
316
  on: f,
317
317
  ...y
318
318
  } = t.props ?? {}, { listeners: v } = e;
319
- it(n, l, y), ct(n, o, a), ut(
319
+ it(n, u, y), ct(n, o, a), lt(
320
320
  n,
321
321
  i,
322
- u
323
- ), t.listeners = lt(
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: l, removed: a, updated: u } = A(i, s);
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 l.concat(u))
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 ut(e, t = {}, r = {}) {
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 lt(e, t = {}, r = {}, n = {}, o = null) {
357
- const { removed: i, added: s, updated: l } = A(r, n);
358
- for (const u of i.concat(l)) {
359
- const f = t?.[u];
360
- f && e.removeEventListener(u, f);
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 u of s.concat(l))
364
- a[u] = N(
365
- u,
366
- n[u],
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), l = r?.offset ?? 0;
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: u, index: f } = a;
377
- g(n[u], o[f], i, r);
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: u, index: f } = a, y = n[u].el, v = i.childNodes[f + l];
383
- y && (i.insertBefore(y, v), g(n[u], o[f], i, r));
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: u } = a;
388
- p(u);
387
+ const { item: l } = a;
388
+ p(l);
389
389
  break;
390
390
  }
391
391
  case E.ADD: {
392
- const { index: u, item: f } = a;
393
- d(f, i, u + l, r);
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, this.isMounted = !0, d(this.vdom, t, r, this);
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,23 +547,24 @@ 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
- if (s && !n.vdom) {
554
- if (n.isMounted = !0, !n.vdom) {
555
- for (console.log("Mounting ErrorBoundary fallback (first time)"); n.hostEl.firstChild; )
554
+ if (s) {
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
- d(s, n.hostEl, null, n.parent), n.vdom = s;
558
+ d(s, n.hostEl, null, n.parent), n.vdom = s, n.isMounted = !0, h(() => {
559
+ n.didCatch(t, {
560
+ phase: r,
561
+ failedComponent: this.constructor.name,
562
+ componentStack: this.getComponentStack()
563
+ }), n.didMount();
564
+ });
558
565
  }
559
- h(() => {
560
- n.didCatch(t, {
561
- phase: r,
562
- failedComponent: this.constructor.name,
563
- componentStack: this.getComponentStack()
564
- }), n.didMount();
565
- });
566
- }
566
+ } else
567
+ console.error("ErrorBoundary.render() returned null or undefined!");
567
568
  } catch (s) {
568
569
  console.error("Error during ErrorBoundary recovery:", s), n.parent && n.parent.handleError(s, r);
569
570
  }
@@ -614,7 +615,7 @@ function yt(e) {
614
615
  isProvider = !0;
615
616
  render() {
616
617
  let o = [];
617
- return Array.isArray(this.props.children) ? o = this.props.children : this.props.children ? o = [this.props.children] : o = [], U(o);
618
+ return Array.isArray(this.props.children) ? o = this.props.children : this.props.children ? o = [this.props.children] : o = [], B(o);
618
619
  }
619
620
  }
620
621
  class r extends T {
@@ -655,7 +656,7 @@ function gt(e = null) {
655
656
  }
656
657
  function vt(e, t) {
657
658
  const r = Array.isArray(e) ? e : [e];
658
- return B(r, t);
659
+ return U(r, t);
659
660
  }
660
661
  export {
661
662
  T as Component,
@@ -663,7 +664,7 @@ export {
663
664
  vt as createPortal,
664
665
  gt as createRef,
665
666
  Pt as h,
666
- U as hFragment,
667
+ B as hFragment,
667
668
  Ot as hString,
668
669
  Et as render
669
670
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-react",
3
- "version": "1.10.8",
3
+ "version": "1.10.10",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 1",
6
6
  "type-check": "tsc --noEmit",