@yoltra/react 0.4.0 → 0.5.0

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @yoltra/react v0.4.0
2
+ * @yoltra/react v0.5.0
3
3
  * (c) 2026 Manu Ramirez <@pixerael>
4
4
  * License: MIT
5
5
  * Homepage: https://yoltra.dev
@@ -7,10 +7,10 @@
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree
9
9
  */
10
- var ge = Object.defineProperty;
11
- var _e = (t, e, n) => e in t ? ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
10
+ var Pe = Object.defineProperty;
11
+ var _e = (t, e, n) => e in t ? Pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
12
12
  var ue = (t, e, n) => _e(t, typeof e != "symbol" ? e + "" : e, n);
13
- import we, { createContext as me, useRef as g, useMemo as A, useCallback as he, useEffect as ve, useSyncExternalStore as I, useContext as ye } from "react";
13
+ import we, { createContext as me, useRef as P, useMemo as A, useCallback as he, useEffect as ve, useSyncExternalStore as I, useContext as ye } from "react";
14
14
  import { createStore as Te } from "@yoltra/core";
15
15
  const be = me(null);
16
16
  var G = { exports: {} }, z = {};
@@ -83,7 +83,7 @@ function xe() {
83
83
  ), r.$$typeof) {
84
84
  case y:
85
85
  return "Portal";
86
- case P:
86
+ case g:
87
87
  return (r.displayName || "Context") + ".Provider";
88
88
  case w:
89
89
  return (r._context.displayName || "Context") + ".Consumer";
@@ -211,8 +211,8 @@ function xe() {
211
211
  else i(E);
212
212
  if (X.call(a, "key")) {
213
213
  E = t(r);
214
- var M = Object.keys(a).filter(function(Pe) {
215
- return Pe !== "key";
214
+ var M = Object.keys(a).filter(function(ge) {
215
+ return ge !== "key";
216
216
  });
217
217
  S = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", ce[E + S] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
218
218
  `A props object containing a "key" prop is being spread into JSX:
@@ -249,7 +249,7 @@ React keys must be passed directly to JSX without using spread:
249
249
  function i(r) {
250
250
  typeof r == "object" && r !== null && r.$$typeof === l && r._store && (r._store.validated = 1);
251
251
  }
252
- var d = we, l = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), P = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), T = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, q = Array.isArray, H = console.createTask ? console.createTask : function() {
252
+ var d = we, l = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), g = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), T = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, q = Array.isArray, H = console.createTask ? console.createTask : function() {
253
253
  return null;
254
254
  };
255
255
  d = {
@@ -334,7 +334,7 @@ function $e(t) {
334
334
  const e = t(Ae([])), n = e != null ? e[Ee] : void 0, s = (Array.isArray(n) ? n : []).join(".");
335
335
  return s === "" && Oe(
336
336
  "yoltra.toDottedPath.empty",
337
- "[yoltra] A typed path accessor recorded no property access, so it will subscribe to the entire slice. The accessor must be a plain member chain like `p => p.items[0].title` and cannot return a computed value or a default. For a whole-slice or dynamic subscription, use the `{ reducer, property }` string form instead."
337
+ "[yoltra] A typed path accessor recorded no property access, so it subscribed to the slice root. That fires only when the slice's whole value is replaced — which for a slice holding an object means never, since its changes are reported at their leaves. The accessor must be a plain member chain like `p => p.items[0].title` and cannot return a computed value or a default. For a dynamic subscription, or for a slice whose state is a single value, use the `{ reducer, property }` string form instead."
338
338
  ), s;
339
339
  }
340
340
  function U(t, e) {
@@ -347,9 +347,9 @@ function U(t, e) {
347
347
  return n;
348
348
  }
349
349
  function V(t, e, n) {
350
- const o = g(t);
350
+ const o = P(t);
351
351
  o.current = t;
352
- const s = g(e);
352
+ const s = P(e);
353
353
  s.current = e;
354
354
  const c = A(
355
355
  () => ({ has: !1, value: void 0 }),
@@ -410,7 +410,7 @@ function ee(t, e, n = Object.is) {
410
410
  return Ye(t, e, n);
411
411
  }
412
412
  function Ke(t, e, n, o = "committed") {
413
- const s = J(), c = g(n);
413
+ const s = J(), c = P(n);
414
414
  c.current = n, ve(() => s.onEvent(
415
415
  t,
416
416
  e,
@@ -537,7 +537,7 @@ function te(t, e, n) {
537
537
  function Ge(t, e, n) {
538
538
  const o = t(), s = e.reducer, c = x(e.property), u = `${Re(o)}::${te(s, c, n.key)}`, m = A(() => (i) => o.connect({ reducer: s, property: c }, () => {
539
539
  Y.invalidate(u), i();
540
- }), [o, s, c, u]), v = g(n);
540
+ }), [o, s, c, u]), v = P(n);
541
541
  v.current = n;
542
542
  const _ = A(() => {
543
543
  const i = L(c);
@@ -575,7 +575,7 @@ function Le(t, e, n) {
575
575
  return () => {
576
576
  for (const l of d) l();
577
577
  };
578
- }, [o, s, c]), m = g(n);
578
+ }, [o, s, c]), m = P(n);
579
579
  m.current = n;
580
580
  const v = A(() => () => {
581
581
  var d;
@@ -619,25 +619,25 @@ function Ve(t) {
619
619
  return I(y, h, h);
620
620
  }
621
621
  const c = (i, d, l) => {
622
- const y = e(), h = typeof i == "string", b = h ? i : i.reducer, j = h ? $e(d) : i.property, w = h ? void 0 : d, P = A(() => ({ reducer: b, property: x(j) }), [b, j]), O = A(
622
+ const y = e(), h = typeof i == "string", b = h ? i : i.reducer, j = h ? $e(d) : i.property, w = h ? void 0 : d, g = A(() => ({ reducer: b, property: x(j) }), [b, j]), O = A(
623
623
  () => ($) => y.connect(
624
- { reducer: P.reducer, property: P.property },
624
+ { reducer: g.reducer, property: g.property },
625
625
  () => $()
626
626
  ),
627
- [y, P]
628
- ), D = L(P.property), F = V(
627
+ [y, g]
628
+ ), D = L(g.property), F = V(
629
629
  () => {
630
- const R = y.getState()[P.reducer], N = D ? R : U(R, P.property);
630
+ const R = y.getState()[g.reducer], N = D ? R : U(R, g.property);
631
631
  return w ? w(N) : N;
632
632
  },
633
633
  l != null ? l : Object.is,
634
- [y, P]
634
+ [y, g]
635
635
  );
636
636
  return I(O, F, F);
637
637
  }, m = (i, d, l = Object.is) => {
638
- const y = e(), h = g(0), b = g(void 0), j = g(-1), w = g(!1), P = g(d);
639
- P.current = d;
640
- const O = g(l);
638
+ const y = e(), h = P(0), b = P(void 0), j = P(-1), w = P(!1), g = P(d);
639
+ g.current = d;
640
+ const O = P(l);
641
641
  O.current = l;
642
642
  const D = A(() => i.map((R) => ({
643
643
  reducer: R.reducer,
@@ -654,22 +654,22 @@ function Ve(t) {
654
654
  [y, D]
655
655
  ), $ = he(() => {
656
656
  if (j.current !== h.current || !w.current) {
657
- const R = P.current(y.getState());
657
+ const R = g.current(y.getState());
658
658
  (!w.current || !O.current(b.current, R)) && (b.current = R, w.current = !0), j.current = h.current;
659
659
  }
660
660
  return b.current;
661
661
  }, [y]);
662
662
  return I(F, $, $);
663
663
  }, v = (i, d, l, y = "committed") => {
664
- const h = e(), b = g(l);
664
+ const h = e(), b = P(l);
665
665
  b.current = l, ve(() => h.onEvent(
666
666
  i,
667
667
  d,
668
- (j, w, P, O) => {
668
+ (j, w, g, O) => {
669
669
  b.current(
670
670
  j,
671
671
  w,
672
- P,
672
+ g,
673
673
  O
674
674
  );
675
675
  },