@yoltra/react 0.7.0 → 0.8.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/README.es.md +56 -9
- package/README.md +55 -9
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +455 -374
- package/dist/index.mjs.map +1 -1
- package/dist/types/createYoltra.d.ts +64 -3
- package/dist/types/hooks/createHooks.d.ts +11 -1
- package/dist/types/hooks/hooks.d.ts +11 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @yoltra/react v0.
|
|
2
|
+
* @yoltra/react v0.8.0
|
|
3
3
|
* (c) 2026 Manu Ramirez <@pixerael>
|
|
4
4
|
* License: MIT */
|
|
5
|
-
import
|
|
6
|
-
import { createStore as
|
|
7
|
-
const
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
|
|
5
|
+
import Te, { createContext as ye, useRef as _, useMemo as w, useCallback as ve, useSyncExternalStore as J, useEffect as je, useContext as ke } from "react";
|
|
6
|
+
import { createStore as Oe } from "@yoltra/core";
|
|
7
|
+
const be = ye(null);
|
|
8
|
+
var q = { exports: {} }, V = {};
|
|
9
|
+
var ie;
|
|
10
|
+
function xe() {
|
|
11
|
+
if (ie) return V;
|
|
12
|
+
ie = 1;
|
|
13
13
|
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
14
|
-
function n(o, s
|
|
14
|
+
function n(c, o, s) {
|
|
15
15
|
var u = null;
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
} else
|
|
21
|
-
return
|
|
16
|
+
if (s !== void 0 && (u = "" + s), o.key !== void 0 && (u = "" + o.key), "key" in o) {
|
|
17
|
+
s = {};
|
|
18
|
+
for (var i in o)
|
|
19
|
+
i !== "key" && (s[i] = o[i]);
|
|
20
|
+
} else s = o;
|
|
21
|
+
return o = s.ref, {
|
|
22
22
|
$$typeof: r,
|
|
23
|
-
type:
|
|
23
|
+
type: c,
|
|
24
24
|
key: u,
|
|
25
|
-
ref:
|
|
26
|
-
props:
|
|
25
|
+
ref: o !== void 0 ? o : null,
|
|
26
|
+
props: s
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return V.Fragment = e, V.jsx = n, V.jsxs = n, V;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var G = {};
|
|
32
32
|
var ae;
|
|
33
|
-
function
|
|
33
|
+
function Ne() {
|
|
34
34
|
return ae || (ae = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
35
35
|
function r(t) {
|
|
36
36
|
if (t == null) return null;
|
|
37
37
|
if (typeof t == "function")
|
|
38
|
-
return t.$$typeof ===
|
|
38
|
+
return t.$$typeof === O ? null : t.displayName || t.name || null;
|
|
39
39
|
if (typeof t == "string") return t;
|
|
40
40
|
switch (t) {
|
|
41
|
-
case
|
|
41
|
+
case h:
|
|
42
42
|
return "Fragment";
|
|
43
|
-
case
|
|
43
|
+
case T:
|
|
44
44
|
return "Profiler";
|
|
45
|
-
case
|
|
45
|
+
case P:
|
|
46
46
|
return "StrictMode";
|
|
47
|
-
case
|
|
47
|
+
case j:
|
|
48
48
|
return "Suspense";
|
|
49
|
-
case
|
|
49
|
+
case C:
|
|
50
50
|
return "SuspenseList";
|
|
51
|
-
case
|
|
51
|
+
case v:
|
|
52
52
|
return "Activity";
|
|
53
53
|
}
|
|
54
54
|
if (typeof t == "object")
|
|
55
55
|
switch (typeof t.tag == "number" && console.error(
|
|
56
56
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
57
57
|
), t.$$typeof) {
|
|
58
|
-
case
|
|
58
|
+
case E:
|
|
59
59
|
return "Portal";
|
|
60
|
-
case
|
|
60
|
+
case A:
|
|
61
61
|
return (t.displayName || "Context") + ".Provider";
|
|
62
|
-
case
|
|
62
|
+
case R:
|
|
63
63
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
64
|
-
case
|
|
64
|
+
case $:
|
|
65
65
|
var a = t.render;
|
|
66
66
|
return t = t.displayName, t || (t = a.displayName || a.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
67
|
-
case
|
|
67
|
+
case I:
|
|
68
68
|
return a = t.displayName || null, a !== null ? a : r(t.type) || "Memo";
|
|
69
|
-
case
|
|
69
|
+
case Y:
|
|
70
70
|
a = t._payload, t = t._init;
|
|
71
71
|
try {
|
|
72
72
|
return r(t(a));
|
|
@@ -87,17 +87,17 @@ function we() {
|
|
|
87
87
|
}
|
|
88
88
|
if (a) {
|
|
89
89
|
a = console;
|
|
90
|
-
var
|
|
91
|
-
return
|
|
90
|
+
var m = a.error, S = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
91
|
+
return m.call(
|
|
92
92
|
a,
|
|
93
93
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
-
|
|
94
|
+
S
|
|
95
95
|
), e(t);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (t ===
|
|
100
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
98
|
+
function c(t) {
|
|
99
|
+
if (t === h) return "<>";
|
|
100
|
+
if (typeof t == "object" && t !== null && t.$$typeof === Y)
|
|
101
101
|
return "<...>";
|
|
102
102
|
try {
|
|
103
103
|
var a = r(t);
|
|
@@ -106,48 +106,48 @@ function we() {
|
|
|
106
106
|
return "<...>";
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
var t =
|
|
109
|
+
function o() {
|
|
110
|
+
var t = D.A;
|
|
111
111
|
return t === null ? null : t.getOwner();
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function s() {
|
|
114
114
|
return Error("react-stack-top-frame");
|
|
115
115
|
}
|
|
116
116
|
function u(t) {
|
|
117
|
-
if (
|
|
117
|
+
if (x.call(t, "key")) {
|
|
118
118
|
var a = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
119
119
|
if (a && a.isReactWarning) return !1;
|
|
120
120
|
}
|
|
121
121
|
return t.key !== void 0;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
function
|
|
125
|
-
|
|
123
|
+
function i(t, a) {
|
|
124
|
+
function m() {
|
|
125
|
+
ne || (ne = !0, console.error(
|
|
126
126
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
127
127
|
a
|
|
128
128
|
));
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
get:
|
|
130
|
+
m.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
131
|
+
get: m,
|
|
132
132
|
configurable: !0
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function d() {
|
|
136
136
|
var t = r(this.type);
|
|
137
|
-
return
|
|
137
|
+
return oe[t] || (oe[t] = !0, console.error(
|
|
138
138
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
139
139
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
143
|
-
$$typeof:
|
|
141
|
+
function b(t, a, m, S, M, k, H, Z) {
|
|
142
|
+
return m = k.ref, t = {
|
|
143
|
+
$$typeof: p,
|
|
144
144
|
type: t,
|
|
145
145
|
key: a,
|
|
146
146
|
props: k,
|
|
147
|
-
_owner:
|
|
148
|
-
}, (
|
|
147
|
+
_owner: M
|
|
148
|
+
}, (m !== void 0 ? m : null) !== null ? Object.defineProperty(t, "ref", {
|
|
149
149
|
enumerable: !1,
|
|
150
|
-
get:
|
|
150
|
+
get: d
|
|
151
151
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
152
152
|
configurable: !1,
|
|
153
153
|
enumerable: !1,
|
|
@@ -162,140 +162,140 @@ function we() {
|
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: H
|
|
166
166
|
}), Object.defineProperty(t, "_debugTask", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
|
-
value:
|
|
170
|
+
value: Z
|
|
171
171
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
for (
|
|
179
|
-
|
|
180
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
function f(t, a, m, S, M, k, H, Z) {
|
|
174
|
+
var g = a.children;
|
|
175
|
+
if (g !== void 0)
|
|
176
|
+
if (S)
|
|
177
|
+
if (te(g)) {
|
|
178
|
+
for (S = 0; S < g.length; S++)
|
|
179
|
+
l(g[S]);
|
|
180
|
+
Object.freeze && Object.freeze(g);
|
|
181
181
|
} else
|
|
182
182
|
console.error(
|
|
183
183
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
184
184
|
);
|
|
185
|
-
else
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
return
|
|
185
|
+
else l(g);
|
|
186
|
+
if (x.call(a, "key")) {
|
|
187
|
+
g = r(t);
|
|
188
|
+
var z = Object.keys(a).filter(function(_e) {
|
|
189
|
+
return _e !== "key";
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
S = 0 < z.length ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}", ue[g + S] || (z = 0 < z.length ? "{" + z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
192
192
|
`A props object containing a "key" prop is being spread into JSX:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s {...props} />
|
|
195
195
|
React keys must be passed directly to JSX without using spread:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s key={someKey} {...props} />`,
|
|
198
|
-
b,
|
|
199
198
|
S,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
g,
|
|
200
|
+
z,
|
|
201
|
+
g
|
|
202
|
+
), ue[g + S] = !0);
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
for (var
|
|
207
|
-
|
|
208
|
-
} else
|
|
209
|
-
return
|
|
210
|
-
|
|
204
|
+
if (g = null, m !== void 0 && (n(m), g = "" + m), u(a) && (n(a.key), g = "" + a.key), "key" in a) {
|
|
205
|
+
m = {};
|
|
206
|
+
for (var K in a)
|
|
207
|
+
K !== "key" && (m[K] = a[K]);
|
|
208
|
+
} else m = a;
|
|
209
|
+
return g && i(
|
|
210
|
+
m,
|
|
211
211
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
212
|
-
),
|
|
212
|
+
), b(
|
|
213
213
|
t,
|
|
214
|
-
|
|
214
|
+
g,
|
|
215
215
|
k,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
M,
|
|
217
|
+
o(),
|
|
218
|
+
m,
|
|
219
|
+
H,
|
|
220
|
+
Z
|
|
221
221
|
);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
typeof t == "object" && t !== null && t.$$typeof ===
|
|
223
|
+
function l(t) {
|
|
224
|
+
typeof t == "object" && t !== null && t.$$typeof === p && t._store && (t._store.validated = 1);
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var y = Te, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), E = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), T = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), A = /* @__PURE__ */ Symbol.for("react.context"), $ = /* @__PURE__ */ Symbol.for("react.forward_ref"), j = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), I = /* @__PURE__ */ Symbol.for("react.memo"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), v = /* @__PURE__ */ Symbol.for("react.activity"), O = /* @__PURE__ */ Symbol.for("react.client.reference"), D = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, te = Array.isArray, L = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
|
-
|
|
229
|
+
y = {
|
|
230
230
|
react_stack_bottom_frame: function(t) {
|
|
231
231
|
return t();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var k = 1e4 >
|
|
240
|
-
return
|
|
234
|
+
var ne, oe = {}, se = y.react_stack_bottom_frame.bind(
|
|
235
|
+
y,
|
|
236
|
+
s
|
|
237
|
+
)(), ce = L(c(s)), ue = {};
|
|
238
|
+
G.Fragment = h, G.jsx = function(t, a, m, S, M) {
|
|
239
|
+
var k = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
240
|
+
return f(
|
|
241
241
|
t,
|
|
242
242
|
a,
|
|
243
|
-
|
|
243
|
+
m,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
k ? Error("react-stack-top-frame") :
|
|
248
|
-
k ?
|
|
245
|
+
S,
|
|
246
|
+
M,
|
|
247
|
+
k ? Error("react-stack-top-frame") : se,
|
|
248
|
+
k ? L(c(t)) : ce
|
|
249
249
|
);
|
|
250
|
-
},
|
|
251
|
-
var k = 1e4 >
|
|
252
|
-
return
|
|
250
|
+
}, G.jsxs = function(t, a, m, S, M) {
|
|
251
|
+
var k = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return f(
|
|
253
253
|
t,
|
|
254
254
|
a,
|
|
255
|
-
|
|
255
|
+
m,
|
|
256
256
|
!0,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
k ? Error("react-stack-top-frame") :
|
|
260
|
-
k ?
|
|
257
|
+
S,
|
|
258
|
+
M,
|
|
259
|
+
k ? Error("react-stack-top-frame") : se,
|
|
260
|
+
k ? L(c(t)) : ce
|
|
261
261
|
);
|
|
262
262
|
};
|
|
263
|
-
})()),
|
|
263
|
+
})()), G;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
267
|
-
return
|
|
265
|
+
var le;
|
|
266
|
+
function $e() {
|
|
267
|
+
return le || (le = 1, process.env.NODE_ENV === "production" ? q.exports = xe() : q.exports = Ne()), q.exports;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
270
|
-
const
|
|
271
|
-
function
|
|
272
|
-
process.env.NODE_ENV !== "production" && (
|
|
269
|
+
var Ee = $e();
|
|
270
|
+
const Ke = ({ store: r, children: e }) => /* @__PURE__ */ Ee.jsx(be.Provider, { value: r, children: e }), fe = /* @__PURE__ */ new Set();
|
|
271
|
+
function Ce(r, e) {
|
|
272
|
+
process.env.NODE_ENV !== "production" && (fe.has(r) || (fe.add(r), console.warn(e)));
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function B(r) {
|
|
275
275
|
return r.includes("*");
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function N(r) {
|
|
278
278
|
return r.replace(/^\./, "");
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Ie(r) {
|
|
281
|
+
return N(r).split(".").filter(Boolean);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Ye(r) {
|
|
284
284
|
const e = (n) => `${n.length}:${n}`;
|
|
285
285
|
return r.map((n) => {
|
|
286
|
-
const
|
|
287
|
-
return e(n.reducer) + e(String(
|
|
286
|
+
const c = Array.isArray(n.property) ? n.property : [n.property];
|
|
287
|
+
return e(n.reducer) + e(String(c.length)) + c.map(e).join("");
|
|
288
288
|
}).join("");
|
|
289
289
|
}
|
|
290
290
|
const Se = /* @__PURE__ */ Symbol("yoltra.pathSegments");
|
|
291
|
-
function
|
|
291
|
+
function ge(r) {
|
|
292
292
|
const e = () => {
|
|
293
293
|
};
|
|
294
294
|
return new Proxy(e, {
|
|
295
|
-
get(n,
|
|
296
|
-
if (
|
|
297
|
-
if (typeof
|
|
298
|
-
return
|
|
295
|
+
get(n, c) {
|
|
296
|
+
if (c === Se) return r;
|
|
297
|
+
if (typeof c != "symbol")
|
|
298
|
+
return ge([...r, String(c)]);
|
|
299
299
|
},
|
|
300
300
|
apply() {
|
|
301
301
|
throw new Error(
|
|
@@ -304,104 +304,129 @@ function Ee(r) {
|
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const e = r(
|
|
309
|
-
return
|
|
307
|
+
function De(r) {
|
|
308
|
+
const e = r(ge([])), n = e?.[Se], o = (Array.isArray(n) ? n : []).join(".");
|
|
309
|
+
return o === "" && Ce(
|
|
310
310
|
"yoltra.toDottedPath.empty",
|
|
311
311
|
"[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."
|
|
312
|
-
),
|
|
312
|
+
), o;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function X(r, e) {
|
|
315
315
|
if (!e) return r;
|
|
316
316
|
let n = r;
|
|
317
|
-
for (const
|
|
317
|
+
for (const c of Ie(e)) {
|
|
318
318
|
if (n == null) return;
|
|
319
|
-
n = n[
|
|
319
|
+
n = n[c];
|
|
320
320
|
}
|
|
321
321
|
return n;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
|
|
325
|
-
o.current = r;
|
|
326
|
-
const s = P(e);
|
|
327
|
-
s.current = e;
|
|
328
|
-
const c = E(
|
|
329
|
-
() => ({ has: !1, value: void 0 }),
|
|
330
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
331
|
-
n
|
|
332
|
-
);
|
|
333
|
-
return me(() => {
|
|
334
|
-
const u = o.current();
|
|
335
|
-
return (!c.has || !s.current(c.value, u)) && (c.has = !0, c.value = u), c.value;
|
|
336
|
-
}, [c]);
|
|
323
|
+
function F(r) {
|
|
324
|
+
return typeof r == "object" && r !== null;
|
|
337
325
|
}
|
|
338
|
-
function
|
|
326
|
+
function Me(r, e) {
|
|
327
|
+
const n = e.split("."), c = [], o = (s, u, i) => {
|
|
328
|
+
if (u === n.length) {
|
|
329
|
+
c.push(i.join("."));
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const d = n[u];
|
|
333
|
+
if (d === "**") {
|
|
334
|
+
if (o(s, u + 1, i), !F(s)) return;
|
|
335
|
+
for (const b of Object.keys(s)) o(s[b], u, [...i, b]);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (d === "*") {
|
|
339
|
+
if (!F(s)) return;
|
|
340
|
+
for (const b of Object.keys(s)) o(s[b], u + 1, [...i, b]);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
F(s) && Object.prototype.hasOwnProperty.call(s, d) && o(s[d], u + 1, [...i, d]);
|
|
344
|
+
};
|
|
345
|
+
return o(r, 0, []), c;
|
|
346
|
+
}
|
|
347
|
+
const Q = /* @__PURE__ */ new WeakSet();
|
|
348
|
+
function Fe(r, e, n, c) {
|
|
349
|
+
if (n.length === 0) return;
|
|
350
|
+
let o = r, s = e;
|
|
351
|
+
for (let u = 0; u < n.length - 1; u++) {
|
|
352
|
+
const i = n[u], d = F(s) ? s[i] : void 0, b = o[i];
|
|
353
|
+
if (F(b)) {
|
|
354
|
+
if (!Q.has(b)) {
|
|
355
|
+
const f = Array.isArray(b) ? [...b] : { ...b };
|
|
356
|
+
Q.add(f), o[i] = f;
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
const f = Array.isArray(d) ? [] : {};
|
|
360
|
+
Q.add(f), o[i] = f;
|
|
361
|
+
}
|
|
362
|
+
o = o[i], s = d;
|
|
363
|
+
}
|
|
364
|
+
o[n[n.length - 1]] = c;
|
|
365
|
+
}
|
|
366
|
+
function We(r, e) {
|
|
367
|
+
const n = {};
|
|
368
|
+
for (const { reducer: c, property: o } of e) {
|
|
369
|
+
const s = F(r) ? r[c] : void 0;
|
|
370
|
+
if (o === "") {
|
|
371
|
+
n[c] = s;
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
const u = B(o) ? Me(s, o) : [o];
|
|
375
|
+
for (const i of u)
|
|
376
|
+
Fe(n, r, [c, ...i.split(".")], X(s, i));
|
|
377
|
+
}
|
|
378
|
+
return n;
|
|
379
|
+
}
|
|
380
|
+
function Ae(r, e, n = []) {
|
|
381
|
+
const c = () => e.map((o) => `{ reducer: "${o.reducer}", property: "${o.property}" }`).join(", ");
|
|
382
|
+
return new Proxy(r, {
|
|
383
|
+
get(o, s, u) {
|
|
384
|
+
if (typeof s == "symbol" || s === "toJSON" || s === "constructor")
|
|
385
|
+
return Reflect.get(o, s, u);
|
|
386
|
+
if (!Object.prototype.hasOwnProperty.call(o, s)) {
|
|
387
|
+
const d = [...n, String(s)].join(".");
|
|
388
|
+
throw new Error(
|
|
389
|
+
`[yoltra] useAtomicProps read "${d}", which it did not subscribe to. The selector only receives the paths declared alongside it, so this read would be \`undefined\` in production and the component would never re-render when it changed. Declared: [${c()}]. Add "${d}" to the list, or stop reading it.`
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
const i = Reflect.get(o, s, u);
|
|
393
|
+
return F(i) && !Array.isArray(i) ? Ae(i, e, [...n, String(s)]) : i;
|
|
394
|
+
},
|
|
395
|
+
has: (o, s) => Reflect.has(o, s)
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function ze(r, e) {
|
|
339
399
|
if (Object.is(r, e)) return !0;
|
|
340
400
|
if (!r || !e) return !1;
|
|
341
|
-
const n = Object.keys(r),
|
|
342
|
-
if (n.length !==
|
|
343
|
-
for (const
|
|
344
|
-
if (!Object.is(r[
|
|
401
|
+
const n = Object.keys(r), c = Object.keys(e);
|
|
402
|
+
if (n.length !== c.length) return !1;
|
|
403
|
+
for (const o of n)
|
|
404
|
+
if (!Object.is(r[o], e[o])) return !1;
|
|
345
405
|
return !0;
|
|
346
406
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const n = q(), o = E(() => (c) => n.subscribe(c), [n]), s = V(
|
|
357
|
-
() => r(n.getState()),
|
|
358
|
-
e,
|
|
359
|
-
[n]
|
|
360
|
-
);
|
|
361
|
-
return I(o, s, s);
|
|
362
|
-
}
|
|
363
|
-
function Ce(r, e, n = Object.is) {
|
|
364
|
-
const o = q(), s = E(() => {
|
|
365
|
-
const h = x(r.property);
|
|
366
|
-
return { reducer: r.reducer, property: h };
|
|
367
|
-
}, [r.reducer, r.property]), c = E(
|
|
368
|
-
() => (h) => o.connect(
|
|
369
|
-
{ reducer: s.reducer, property: s.property },
|
|
370
|
-
() => h()
|
|
371
|
-
),
|
|
372
|
-
[o, s]
|
|
373
|
-
), u = L(s.property), d = V(
|
|
374
|
-
() => {
|
|
375
|
-
const _ = o.getState()[s.reducer];
|
|
376
|
-
return u ? _ : U(_, s.property);
|
|
377
|
-
},
|
|
378
|
-
n,
|
|
379
|
-
[o, s]
|
|
407
|
+
function pe(r, e, n) {
|
|
408
|
+
const c = _(r);
|
|
409
|
+
c.current = r;
|
|
410
|
+
const o = _(e);
|
|
411
|
+
o.current = e;
|
|
412
|
+
const s = w(
|
|
413
|
+
() => ({ has: !1, value: void 0 }),
|
|
414
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
415
|
+
n
|
|
380
416
|
);
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
function Be(r, e, n, o = "committed") {
|
|
387
|
-
const s = q(), c = P(n);
|
|
388
|
-
c.current = n, he(() => s.onEvent(
|
|
389
|
-
r,
|
|
390
|
-
e,
|
|
391
|
-
(u, d, h, _) => {
|
|
392
|
-
c.current(u, d, h, _);
|
|
393
|
-
},
|
|
394
|
-
o
|
|
395
|
-
), [s, r, e, o]);
|
|
417
|
+
return ve(() => {
|
|
418
|
+
const u = c.current();
|
|
419
|
+
return (!s.has || !o.current(s.value, u)) && (s.has = !0, s.value = u), s.value;
|
|
420
|
+
}, [s]);
|
|
396
421
|
}
|
|
397
|
-
function
|
|
422
|
+
function Le(r) {
|
|
398
423
|
return r == null || r <= 0 ? null : Date.now() + r;
|
|
399
424
|
}
|
|
400
|
-
function
|
|
425
|
+
function Ve(r) {
|
|
401
426
|
return r === null ? null : r === void 0 || r <= 0 ? 0 : Date.now() + r;
|
|
402
427
|
}
|
|
403
|
-
const
|
|
404
|
-
class
|
|
428
|
+
const Ge = 2e3;
|
|
429
|
+
class Je {
|
|
405
430
|
store = /* @__PURE__ */ new Map();
|
|
406
431
|
/**
|
|
407
432
|
* Marks a key as most recently used, and evicts the coldest entries past the cap.
|
|
@@ -418,7 +443,7 @@ class De {
|
|
|
418
443
|
}
|
|
419
444
|
/** @internal */
|
|
420
445
|
evict() {
|
|
421
|
-
for (; this.store.size >
|
|
446
|
+
for (; this.store.size > Ge; ) {
|
|
422
447
|
const e = this.store.keys().next();
|
|
423
448
|
if (e.done === !0) return;
|
|
424
449
|
const n = this.store.get(e.value);
|
|
@@ -433,28 +458,28 @@ class De {
|
|
|
433
458
|
get size() {
|
|
434
459
|
return this.store.size;
|
|
435
460
|
}
|
|
436
|
-
read(e, n,
|
|
437
|
-
const
|
|
438
|
-
if (u && u.status === "ready" && (u.expiresAt == null || u.expiresAt >
|
|
461
|
+
read(e, n, c, o) {
|
|
462
|
+
const s = Date.now(), u = this.store.get(e);
|
|
463
|
+
if (u && u.status === "ready" && (u.expiresAt == null || u.expiresAt > s))
|
|
439
464
|
return this.touch(e), this.store.set(e, u), u.value;
|
|
440
465
|
if (u && u.status === "pending")
|
|
441
466
|
throw u.promise;
|
|
442
467
|
if (u && u.status === "error") {
|
|
443
468
|
if (u.delivered !== !0)
|
|
444
469
|
throw this.store.set(e, { ...u, delivered: !0 }), u.error;
|
|
445
|
-
if (u.expiresAt === null || u.expiresAt >
|
|
470
|
+
if (u.expiresAt === null || u.expiresAt > s) throw u.error;
|
|
446
471
|
this.store.delete(e);
|
|
447
472
|
}
|
|
448
|
-
const
|
|
449
|
-
this.store.set(e, { status: "ready", value:
|
|
450
|
-
}).catch((
|
|
473
|
+
const i = Promise.resolve().then(n).then((d) => {
|
|
474
|
+
this.store.set(e, { status: "ready", value: d, expiresAt: Le(c) });
|
|
475
|
+
}).catch((d) => {
|
|
451
476
|
this.store.set(e, {
|
|
452
477
|
status: "error",
|
|
453
|
-
error:
|
|
454
|
-
expiresAt:
|
|
478
|
+
error: d,
|
|
479
|
+
expiresAt: Ve(o)
|
|
455
480
|
});
|
|
456
481
|
});
|
|
457
|
-
throw this.store.set(e, { status: "pending", promise:
|
|
482
|
+
throw this.store.set(e, { status: "pending", promise: i, expiresAt: null }), this.evict(), i;
|
|
458
483
|
}
|
|
459
484
|
invalidate(e) {
|
|
460
485
|
this.store.delete(e);
|
|
@@ -472,7 +497,7 @@ class De {
|
|
|
472
497
|
*/
|
|
473
498
|
invalidatePathKey(e) {
|
|
474
499
|
for (const n of this.store.keys())
|
|
475
|
-
|
|
500
|
+
me(n) === e && this.store.delete(n);
|
|
476
501
|
}
|
|
477
502
|
/**
|
|
478
503
|
* Drops every entry that reads from `reducer`, in any store.
|
|
@@ -486,219 +511,275 @@ class De {
|
|
|
486
511
|
*/
|
|
487
512
|
invalidateReducer(e) {
|
|
488
513
|
const n = `${e}::`;
|
|
489
|
-
for (const
|
|
490
|
-
|
|
514
|
+
for (const c of this.store.keys())
|
|
515
|
+
me(c).split("||").some((o) => o.startsWith(n)) && this.store.delete(c);
|
|
491
516
|
}
|
|
492
517
|
clear() {
|
|
493
518
|
this.store.clear();
|
|
494
519
|
}
|
|
495
520
|
}
|
|
496
|
-
const
|
|
497
|
-
let
|
|
498
|
-
function
|
|
499
|
-
let e =
|
|
500
|
-
return e === void 0 && (e = `s${++
|
|
521
|
+
const W = new Je(), de = /* @__PURE__ */ new WeakMap();
|
|
522
|
+
let Ue = 0;
|
|
523
|
+
function we(r) {
|
|
524
|
+
let e = de.get(r);
|
|
525
|
+
return e === void 0 && (e = `s${++Ue}`, de.set(r, e)), e;
|
|
501
526
|
}
|
|
502
|
-
function
|
|
527
|
+
function me(r) {
|
|
503
528
|
return r.slice(r.indexOf("::") + 2);
|
|
504
529
|
}
|
|
505
|
-
function
|
|
506
|
-
const
|
|
507
|
-
return n ? `${r}::${
|
|
508
|
-
}
|
|
509
|
-
function
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
}), [o, s,
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
const
|
|
530
|
+
function ee(r, e, n) {
|
|
531
|
+
const c = Array.isArray(e) ? e.map(N).sort().join("|") : N(e);
|
|
532
|
+
return n ? `${r}::${c}::${n}` : `${r}::${c}`;
|
|
533
|
+
}
|
|
534
|
+
function qe(r, e, n) {
|
|
535
|
+
const c = r(), o = e.reducer, s = N(e.property), u = `${we(c)}::${ee(o, s, n.key)}`, i = w(() => (l) => c.connect({ reducer: o, property: s }, () => {
|
|
536
|
+
W.invalidate(u), l();
|
|
537
|
+
}), [c, o, s, u]), d = _(n);
|
|
538
|
+
d.current = n;
|
|
539
|
+
const b = w(() => {
|
|
540
|
+
const l = B(s);
|
|
516
541
|
return () => {
|
|
517
|
-
const
|
|
518
|
-
return
|
|
542
|
+
const p = c.getState()[o], E = l ? p : X(p, s), h = d.current;
|
|
543
|
+
return W.read(u, () => h.load(E, p), h.staleTime ?? 0, h.errorTtlMs);
|
|
519
544
|
};
|
|
520
|
-
}, [o, s,
|
|
521
|
-
const
|
|
545
|
+
}, [c, o, s, u]), f = w(() => {
|
|
546
|
+
const l = B(s);
|
|
522
547
|
return () => {
|
|
523
|
-
const
|
|
524
|
-
return
|
|
548
|
+
const p = c.getState()[o];
|
|
549
|
+
return l ? p : X(p, s);
|
|
525
550
|
};
|
|
526
|
-
}, [o, s
|
|
527
|
-
return
|
|
528
|
-
}
|
|
529
|
-
function
|
|
530
|
-
const
|
|
531
|
-
() => e.map((
|
|
532
|
-
reducer:
|
|
533
|
-
property: Array.isArray(
|
|
551
|
+
}, [c, o, s]);
|
|
552
|
+
return J(i, b, f);
|
|
553
|
+
}
|
|
554
|
+
function Be(r, e, n) {
|
|
555
|
+
const c = r(), o = w(
|
|
556
|
+
() => e.map((f) => ({
|
|
557
|
+
reducer: f.reducer,
|
|
558
|
+
property: Array.isArray(f.property) ? f.property.map((l) => N(l)) : N(f.property)
|
|
534
559
|
})),
|
|
535
560
|
// `specs` is a fresh reference each render; keying the memo on its JSON
|
|
536
561
|
// signature is intentional and already covers `specs`.
|
|
537
562
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
538
563
|
[JSON.stringify(e)]
|
|
539
|
-
),
|
|
540
|
-
const
|
|
541
|
-
return `${
|
|
542
|
-
}, [
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
},
|
|
564
|
+
), s = w(() => {
|
|
565
|
+
const f = o.map((l) => ee(l.reducer, l.property)).sort().join("||");
|
|
566
|
+
return `${we(c)}::${n.key ? `${f}::${n.key}` : f}`;
|
|
567
|
+
}, [c, o, n.key]), u = w(() => (f) => {
|
|
568
|
+
const l = () => {
|
|
569
|
+
W.invalidate(s), f();
|
|
570
|
+
}, y = o.map((p) => c.connect(p, l));
|
|
546
571
|
return () => {
|
|
547
|
-
for (const
|
|
572
|
+
for (const p of y) p();
|
|
548
573
|
};
|
|
549
|
-
}, [o, s
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
const
|
|
553
|
-
return
|
|
554
|
-
}, [
|
|
555
|
-
return
|
|
556
|
-
const
|
|
557
|
-
return
|
|
574
|
+
}, [c, o, s]), i = _(n);
|
|
575
|
+
i.current = n;
|
|
576
|
+
const d = w(() => () => {
|
|
577
|
+
const f = c.getState(), l = i.current;
|
|
578
|
+
return W.read(s, () => l.load(f), l.staleTime ?? 0, l.errorTtlMs);
|
|
579
|
+
}, [c, s]);
|
|
580
|
+
return J(u, d, () => {
|
|
581
|
+
const f = i.current.load(c.getState());
|
|
582
|
+
return f instanceof Promise ? void 0 : f;
|
|
558
583
|
});
|
|
559
584
|
}
|
|
560
|
-
function
|
|
561
|
-
|
|
585
|
+
function Qe(r, e, n) {
|
|
586
|
+
W.invalidatePathKey(ee(r, e, n));
|
|
562
587
|
}
|
|
563
|
-
function
|
|
564
|
-
|
|
588
|
+
function er(r) {
|
|
589
|
+
W.invalidateReducer(r);
|
|
565
590
|
}
|
|
566
|
-
function
|
|
567
|
-
|
|
591
|
+
function rr() {
|
|
592
|
+
W.clear();
|
|
568
593
|
}
|
|
569
|
-
function
|
|
594
|
+
function Xe(r) {
|
|
570
595
|
return {
|
|
571
|
-
useSuspenseAtomicProp: (
|
|
572
|
-
useSuspenseAtomicProps: (
|
|
596
|
+
useSuspenseAtomicProp: (c, o) => qe(r, c, o),
|
|
597
|
+
useSuspenseAtomicProps: (c, o) => Be(r, c, o)
|
|
573
598
|
};
|
|
574
599
|
}
|
|
575
|
-
function
|
|
600
|
+
function Pe(r) {
|
|
576
601
|
function e() {
|
|
577
|
-
const
|
|
578
|
-
if (!
|
|
602
|
+
const l = ke(r);
|
|
603
|
+
if (!l)
|
|
579
604
|
throw new Error(
|
|
580
605
|
"[yoltra] No store in context. Wrap your tree in <StoreProvider store={...}>, or use the hooks returned by createYoltra (which default to their own store)."
|
|
581
606
|
);
|
|
582
|
-
return
|
|
607
|
+
return l;
|
|
583
608
|
}
|
|
584
609
|
function n() {
|
|
585
610
|
return e().emit;
|
|
586
611
|
}
|
|
587
|
-
function
|
|
588
|
-
const
|
|
589
|
-
return
|
|
612
|
+
function c(l, y = Object.is) {
|
|
613
|
+
const p = e(), E = w(() => (P) => p.subscribe(P), [p]), h = pe(() => l(p.getState()), y, [p]);
|
|
614
|
+
return J(E, h, h);
|
|
590
615
|
}
|
|
591
|
-
const
|
|
592
|
-
const
|
|
593
|
-
() => (
|
|
594
|
-
{ reducer:
|
|
595
|
-
() =>
|
|
616
|
+
const s = (l, y, p) => {
|
|
617
|
+
const E = e(), h = typeof l == "string", P = h ? l : l.reducer, T = h ? De(y) : l.property, R = h ? void 0 : y, A = w(() => ({ reducer: P, property: N(T) }), [P, T]), $ = w(
|
|
618
|
+
() => (I) => E.connect(
|
|
619
|
+
{ reducer: A.reducer, property: A.property },
|
|
620
|
+
() => I()
|
|
596
621
|
),
|
|
597
|
-
[
|
|
598
|
-
),
|
|
622
|
+
[E, A]
|
|
623
|
+
), j = B(A.property), C = pe(
|
|
599
624
|
() => {
|
|
600
|
-
const
|
|
601
|
-
return
|
|
625
|
+
const Y = E.getState()[A.reducer], v = j ? Y : X(Y, A.property);
|
|
626
|
+
return R ? R(v) : v;
|
|
602
627
|
},
|
|
603
|
-
|
|
604
|
-
[
|
|
628
|
+
p ?? Object.is,
|
|
629
|
+
[E, A]
|
|
605
630
|
);
|
|
606
|
-
return
|
|
607
|
-
},
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
reducer:
|
|
614
|
-
property: Array.isArray(
|
|
615
|
-
})), [
|
|
616
|
-
() => (
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
},
|
|
631
|
+
return J($, C, C);
|
|
632
|
+
}, i = (l, y, p = Object.is) => {
|
|
633
|
+
const E = e(), h = _(0), P = _(void 0), T = _(-1), R = _(!1), A = _(y);
|
|
634
|
+
A.current = y;
|
|
635
|
+
const $ = _(p);
|
|
636
|
+
$.current = p;
|
|
637
|
+
const j = w(() => l.map((v) => ({
|
|
638
|
+
reducer: v.reducer,
|
|
639
|
+
property: Array.isArray(v.property) ? v.property.map((O) => N(O)) : N(v.property)
|
|
640
|
+
})), [Ye(l)]), C = w(
|
|
641
|
+
() => (v) => {
|
|
642
|
+
const O = () => {
|
|
643
|
+
h.current++, v();
|
|
644
|
+
}, D = j.flatMap((x) => (Array.isArray(x.property) ? x.property : [x.property]).map((L) => E.connect({ reducer: x.reducer, property: L }, O)));
|
|
620
645
|
return () => {
|
|
621
|
-
for (const
|
|
646
|
+
for (const x of D) x();
|
|
622
647
|
};
|
|
623
648
|
},
|
|
624
|
-
[
|
|
625
|
-
),
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
649
|
+
[E, j]
|
|
650
|
+
), I = w(
|
|
651
|
+
() => j.flatMap(
|
|
652
|
+
(v) => (Array.isArray(v.property) ? v.property : [v.property]).map((O) => ({
|
|
653
|
+
reducer: v.reducer,
|
|
654
|
+
property: O
|
|
655
|
+
}))
|
|
656
|
+
),
|
|
657
|
+
[j]
|
|
658
|
+
), Y = ve(() => {
|
|
659
|
+
if (T.current !== h.current || !R.current) {
|
|
660
|
+
const v = We(E.getState(), I), O = process.env.NODE_ENV !== "production" ? Ae(v, I) : v, D = A.current(O);
|
|
661
|
+
(!R.current || !$.current(P.current, D)) && (P.current = D, R.current = !0), T.current = h.current;
|
|
629
662
|
}
|
|
630
|
-
return
|
|
631
|
-
}, [
|
|
632
|
-
return
|
|
633
|
-
},
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
663
|
+
return P.current;
|
|
664
|
+
}, [E, I]);
|
|
665
|
+
return J(C, Y, Y);
|
|
666
|
+
}, d = (l, y, p, E = "committed", h) => {
|
|
667
|
+
const P = e(), T = _(p);
|
|
668
|
+
T.current = p;
|
|
669
|
+
const R = h?.duringReplay === !0;
|
|
670
|
+
je(() => P.onEvent(
|
|
671
|
+
l,
|
|
672
|
+
y,
|
|
673
|
+
(A, $, j, C) => {
|
|
674
|
+
T.current(
|
|
675
|
+
A,
|
|
676
|
+
$,
|
|
640
677
|
j,
|
|
641
|
-
|
|
642
|
-
R,
|
|
643
|
-
O
|
|
678
|
+
C
|
|
644
679
|
);
|
|
645
680
|
},
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
681
|
+
E,
|
|
682
|
+
{ duringReplay: R }
|
|
683
|
+
), [P, l, y, E, R]);
|
|
684
|
+
}, { useSuspenseAtomicProp: b, useSuspenseAtomicProps: f } = Xe(e);
|
|
649
685
|
return {
|
|
650
686
|
useStore: e,
|
|
651
687
|
useEmit: n,
|
|
652
|
-
useSelector:
|
|
653
|
-
useAtomicProp:
|
|
654
|
-
useAtomicProps:
|
|
655
|
-
useEvent:
|
|
656
|
-
useSuspenseAtomicProp:
|
|
657
|
-
useSuspenseAtomicProps:
|
|
658
|
-
shallowEqual:
|
|
688
|
+
useSelector: c,
|
|
689
|
+
useAtomicProp: s,
|
|
690
|
+
useAtomicProps: i,
|
|
691
|
+
useEvent: d,
|
|
692
|
+
useSuspenseAtomicProp: b,
|
|
693
|
+
useSuspenseAtomicProps: f,
|
|
694
|
+
shallowEqual: ze
|
|
659
695
|
};
|
|
660
696
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
return
|
|
664
|
-
|
|
697
|
+
let he = null;
|
|
698
|
+
function U() {
|
|
699
|
+
return he ??= Pe(
|
|
700
|
+
be
|
|
701
|
+
), he;
|
|
702
|
+
}
|
|
703
|
+
function tr() {
|
|
704
|
+
return U().useStore();
|
|
705
|
+
}
|
|
706
|
+
function nr() {
|
|
707
|
+
return U().useEmit();
|
|
708
|
+
}
|
|
709
|
+
function or(r, e = Object.is) {
|
|
710
|
+
return U().useSelector(r, e);
|
|
711
|
+
}
|
|
712
|
+
function re(r, e, n = Object.is) {
|
|
713
|
+
return U().useAtomicProp(r, e, n);
|
|
714
|
+
}
|
|
715
|
+
function sr(r, e, n, c = "committed", o) {
|
|
716
|
+
U().useEvent(r, e, n, c, o);
|
|
717
|
+
}
|
|
718
|
+
function cr(r) {
|
|
719
|
+
const e = Oe(r), n = ye(e);
|
|
720
|
+
return Re(e, n);
|
|
721
|
+
}
|
|
722
|
+
function Re(r, e) {
|
|
723
|
+
const n = Pe(e), c = ({
|
|
724
|
+
store: s,
|
|
665
725
|
children: u
|
|
666
|
-
}) => /* @__PURE__ */
|
|
726
|
+
}) => /* @__PURE__ */ Ee.jsx(e.Provider, { value: s ?? r, children: u }), o = () => Re(r, e);
|
|
727
|
+
return {
|
|
728
|
+
store: r,
|
|
729
|
+
StoreContext: e,
|
|
730
|
+
StoreProvider: c,
|
|
731
|
+
...n,
|
|
732
|
+
withSlice: (s, u, i) => (r.registerSlice(s, u, i), o()),
|
|
733
|
+
withMiddleware: (s) => (r.registerMiddleware(s), o()),
|
|
734
|
+
withEffect: (s) => (r.registerEffect(s), o())
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function ur(r, e, n, c) {
|
|
738
|
+
return r.withSlice(e, n, c);
|
|
739
|
+
}
|
|
740
|
+
function ir(r, e) {
|
|
741
|
+
return r.withMiddleware(e);
|
|
742
|
+
}
|
|
743
|
+
function ar(r, e) {
|
|
744
|
+
return r.withEffect(e);
|
|
667
745
|
}
|
|
668
|
-
function
|
|
669
|
-
return
|
|
746
|
+
function lr(r, e) {
|
|
747
|
+
return re({
|
|
670
748
|
reducer: r,
|
|
671
749
|
property: e.idsPath
|
|
672
750
|
});
|
|
673
751
|
}
|
|
674
|
-
function
|
|
675
|
-
return
|
|
752
|
+
function fr(r, e, n) {
|
|
753
|
+
return re({
|
|
676
754
|
reducer: r,
|
|
677
755
|
property: e.pathTo(n)
|
|
678
756
|
});
|
|
679
757
|
}
|
|
680
|
-
function
|
|
681
|
-
return
|
|
758
|
+
function pr(r, e, n, c) {
|
|
759
|
+
return re({
|
|
682
760
|
reducer: r,
|
|
683
|
-
property: e.pathTo(n,
|
|
761
|
+
property: e.pathTo(n, c)
|
|
684
762
|
});
|
|
685
763
|
}
|
|
686
764
|
export {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
765
|
+
be as StoreContext,
|
|
766
|
+
Ke as StoreProvider,
|
|
767
|
+
rr as clearSuspenseCache,
|
|
768
|
+
Pe as createHooks,
|
|
769
|
+
cr as createYoltra,
|
|
770
|
+
Qe as invalidateAtomicProp,
|
|
771
|
+
er as invalidateAtomicPropsByReducer,
|
|
772
|
+
ze as shallowEqual,
|
|
773
|
+
W as suspenseCache,
|
|
774
|
+
nr as useEmit,
|
|
775
|
+
fr as useEntity,
|
|
776
|
+
pr as useEntityField,
|
|
777
|
+
lr as useEntityIds,
|
|
778
|
+
sr as useEvent,
|
|
779
|
+
or as useSelector,
|
|
780
|
+
tr as useStore,
|
|
781
|
+
ar as withEffect,
|
|
782
|
+
ir as withMiddleware,
|
|
783
|
+
ur as withSlice
|
|
703
784
|
};
|
|
704
785
|
//# sourceMappingURL=index.mjs.map
|