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.
Files changed (2) hide show
  1. package/dist/index.mjs +76 -70
  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 F, A as v, b as x, h as U, c as B } from "./h-BbaMkkC7.mjs";
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, a = s === "svg" || t instanceof SVGElement ? document.createElementNS("http://www.w3.org/2000/svg", s) : document.createElement(s);
208
- V(a, e, n), e.el = a, i?.forEach((f) => {
209
- h(f, a, null, n);
210
- }), L(a, t, r);
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: a }
245
+ props: { key: l }
246
246
  } = n;
247
- return s === o && i === a;
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
- ft(e, t);
288
+ at(e, t);
289
289
  break;
290
290
  }
291
291
  case c.PORTAL: {
292
- lt(e, t, n);
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
- ...a
312
+ ...l
313
313
  } = e.props ?? {}, {
314
- class: f,
314
+ class: a,
315
315
  style: u,
316
- on: l,
316
+ on: f,
317
317
  ...E
318
- } = t.props ?? {}, { listeners: g } = e;
319
- it(n, a, E), ct(n, s, f), ut(
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 = at(
323
+ ), t.listeners = lt(
324
324
  n,
325
- g,
325
+ v,
326
326
  o ?? {},
327
- l ?? {},
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: a, removed: f, updated: u } = S(i, o);
337
- for (const l of f)
338
- D(e, l);
339
- for (const l of a.concat(u))
340
- w(e, l, o[l]);
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 at(e, t = {}, r = {}, n = {}, s = null) {
357
- const { removed: i, added: o, updated: a } = S(r, n);
358
- for (const u of i.concat(a)) {
359
- const l = t?.[u];
360
- l && e.removeEventListener(u, l);
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 f = {};
363
- for (const u of o.concat(a))
364
- f[u] = N(
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 f;
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), a = r?.offset ?? 0;
374
- for (const f of o)
375
- if (f.op === v.NOOP) {
376
- const { originalIndex: u, index: l } = f;
377
- y(n[u], s[l], i, r);
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 f of o)
380
- switch (f.op) {
381
- case v.MOVE: {
382
- const { from: u, index: l } = f, E = n[u].el, g = i.childNodes[l + a];
383
- E && (i.insertBefore(E, g), y(n[u], s[l], i, r));
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 v.REMOVE: {
387
- const { item: u } = f;
386
+ case g.REMOVE: {
387
+ const { item: u } = a;
388
388
  p(u);
389
389
  break;
390
390
  }
391
- case v.ADD: {
392
- const { index: u, item: l } = f;
393
- h(l, i, u + a, r);
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 ft(e, t) {
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 lt(e, t, r) {
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), n && n.isMounted) {
542
- const i = n.constructor;
543
- if (i.getDerivedStateFromError) {
544
- const o = i.getDerivedStateFromError(t);
545
- n.state = { ...n.state, ...o };
546
- }
547
- if (n.didCatch(t, {
548
- phase: r,
549
- failedComponent: this.constructor.name,
550
- componentStack: this.getComponentStack()
551
- }), n.hostEl && n.vdom)
552
- try {
553
- const o = n.render();
554
- if (o) {
555
- y(n.vdom, o, n.hostEl, n);
556
- return;
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 vt(e = null) {
645
+ function gt(e = null) {
640
646
  return {
641
647
  current: e
642
648
  };
643
649
  }
644
- function gt(e, t) {
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
- gt as createPortal,
652
- vt as createRef,
657
+ vt as createPortal,
658
+ gt as createRef,
653
659
  Pt as h,
654
660
  U as hFragment,
655
661
  Ot as hString,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-react",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 1",
6
6
  "type-check": "tsc --noEmit",