ddd-react 1.10.2 → 1.10.3

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 +18 -17
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { D as c, e as b, a as x, A as v, b as F, h as U, c as B } from "./h-BbaMkkC7.mjs";
1
+ import { D as c, e as m, a as F, A as v, 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
- function m(e, t) {
3
+ function b(e, t) {
4
4
  if (e === null || t === null || e === void 0 || t === void 0)
5
5
  return e === t;
6
6
  if (typeof e != typeof t)
@@ -14,7 +14,7 @@ function m(e, t) {
14
14
  if (e.length !== t.length)
15
15
  return !1;
16
16
  for (let n = 0; n < e.length; ++n)
17
- if (!m(e[n], t[n]))
17
+ if (!b(e[n], t[n]))
18
18
  return !1;
19
19
  return !0;
20
20
  }
@@ -32,7 +32,7 @@ function m(e, t) {
32
32
  return !1;
33
33
  for (let n = 0; n < r.length; ++n) {
34
34
  const s = r[n];
35
- if (!(s === "_owner" && e.$$typeof) && !m(e[s], t[s]))
35
+ if (!(s === "_owner" && e.$$typeof) && !b(e[s], t[s]))
36
36
  return !1;
37
37
  }
38
38
  return !0;
@@ -269,7 +269,7 @@ function S(e, t) {
269
269
  function rt(e) {
270
270
  return e !== "";
271
271
  }
272
- function T(e) {
272
+ function C(e) {
273
273
  return rt(e.trim());
274
274
  }
275
275
  function y(e, t, r, n = null) {
@@ -340,11 +340,11 @@ function it(e, t = {}, r = {}) {
340
340
  w(e, l, o[l]);
341
341
  }
342
342
  function ct(e, t, r) {
343
- const n = k(t), s = k(r), { added: i, removed: o } = F(n, s);
343
+ const n = T(t), s = T(r), { added: i, removed: o } = x(n, s);
344
344
  o.length > 0 && e.classList.remove(...o), i.length > 0 && e.classList.add(...i);
345
345
  }
346
- function k(e = "") {
347
- return Array.isArray(e) ? e.filter(T) : String(e).split(/(\s+)/).filter(T);
346
+ function T(e = "") {
347
+ return Array.isArray(e) ? e.filter(C) : String(e).split(/(\s+)/).filter(C);
348
348
  }
349
349
  function ut(e, t = {}, r = {}) {
350
350
  const { added: n, removed: s, updated: i } = S(t, r);
@@ -370,7 +370,7 @@ function at(e, t = {}, r = {}, n = {}, s = null) {
370
370
  return f;
371
371
  }
372
372
  function R(e, t, r) {
373
- const n = b(e), s = b(t), i = e.el, o = x(n, s, j), a = r?.offset ?? 0;
373
+ const n = m(e), s = m(t), i = e.el, o = F(n, s, j), a = r?.offset ?? 0;
374
374
  for (const f of o)
375
375
  if (f.op === v.NOOP) {
376
376
  const { originalIndex: u, index: l } = f;
@@ -407,7 +407,7 @@ function lt(e, t, r) {
407
407
  R(e, t, r);
408
408
  }
409
409
  const ht = (e) => e.isProvider, dt = (e) => e.isConsumer;
410
- class C {
410
+ class k {
411
411
  isMounted = !1;
412
412
  vdom = null;
413
413
  hostEl = null;
@@ -458,10 +458,10 @@ class C {
458
458
  return console.error("Uncaught error:", t, r), this.error = t, Promise.resolve();
459
459
  }
460
460
  shouldComponentUpdate(t, r) {
461
- return m(t, r);
461
+ return b(t, r);
462
462
  }
463
463
  get elements() {
464
- return this.vdom == null ? [] : this.vdom.type === c.FRAGMENT ? b(this.vdom).flatMap((t) => t.type === c.COMPONENT && t.component ? t.component.elements : t.el ? [t.el] : []) : this.vdom.el ? [this.vdom.el] : [];
464
+ return this.vdom == null ? [] : this.vdom.type === c.FRAGMENT ? m(this.vdom).flatMap((t) => t.type === c.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];
@@ -536,8 +536,9 @@ class C {
536
536
  return this.constructor.defaultProps || {};
537
537
  }
538
538
  handleError(t, r) {
539
+ console.log("handleError");
539
540
  const n = this.findClosestErrorBoundary();
540
- if (n && n.isMounted) {
541
+ if (console.log("errorBoundary", n), n && n.isMounted) {
541
542
  const i = n.constructor;
542
543
  if (i.getDerivedStateFromError) {
543
544
  const o = i.getDerivedStateFromError(t);
@@ -593,18 +594,18 @@ class C {
593
594
  return null;
594
595
  }
595
596
  isErrorBoundary() {
596
- return this.constructor.getDerivedStateFromError !== void 0;
597
+ return console.log("isErrorBoundary"), console.log("this.constructor as typeof Component", this.constructor), console.log("(this.constructor as typeof Component).getDerivedStateFromError", this.constructor.getDerivedStateFromError), this.constructor.getDerivedStateFromError !== void 0;
597
598
  }
598
599
  }
599
600
  function yt(e) {
600
- class t extends C {
601
+ class t extends k {
601
602
  isProvider = !0;
602
603
  render() {
603
604
  let s = [];
604
605
  return Array.isArray(this.props.children) ? s = this.props.children : this.props.children ? s = [this.props.children] : s = [], U(s);
605
606
  }
606
607
  }
607
- class r extends C {
608
+ class r extends k {
608
609
  static contextType = {
609
610
  Provider: t,
610
611
  defaultValue: e
@@ -645,7 +646,7 @@ function gt(e, t) {
645
646
  return B(r, t);
646
647
  }
647
648
  export {
648
- C as Component,
649
+ k as Component,
649
650
  yt as createContext,
650
651
  gt as createPortal,
651
652
  vt as createRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-react",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 1",
6
6
  "type-check": "tsc --noEmit",