react-state-custom 1.0.30 → 1.0.32
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.md +57 -28
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +331 -314
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/state-utils/createAutoCtx.d.ts +6 -1
- package/dist/state-utils/createRootCtx.d.ts +7 -3
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -49,22 +49,22 @@ var I;
|
|
|
49
49
|
function re() {
|
|
50
50
|
return I || (I = 1, process.env.NODE_ENV === "production" ? j.exports = ne() : j.exports = ie()), j.exports;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
52
|
+
var y = re();
|
|
53
53
|
function H(n, e) {
|
|
54
|
-
let t = null, s = function(...
|
|
54
|
+
let t = null, s = function(...o) {
|
|
55
55
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
56
|
-
n(...
|
|
56
|
+
n(...o);
|
|
57
57
|
}, e);
|
|
58
58
|
};
|
|
59
59
|
return s.cancel = () => clearTimeout(t), s;
|
|
60
60
|
}
|
|
61
61
|
function oe(n) {
|
|
62
62
|
const e = /* @__PURE__ */ new Map(), t = function(...s) {
|
|
63
|
-
const
|
|
64
|
-
if (e.has(
|
|
65
|
-
return e.get(
|
|
63
|
+
const o = JSON.stringify(s);
|
|
64
|
+
if (e.has(o))
|
|
65
|
+
return e.get(o);
|
|
66
66
|
const i = n(...s);
|
|
67
|
-
return e.set(
|
|
67
|
+
return e.set(o, i), i;
|
|
68
68
|
};
|
|
69
69
|
return t.cache = e, t;
|
|
70
70
|
}
|
|
@@ -74,7 +74,7 @@ const F = () => Math.random().toString().slice(2), ae = (n) => {
|
|
|
74
74
|
id: F()
|
|
75
75
|
});
|
|
76
76
|
let t = !1;
|
|
77
|
-
return t = t || !n != !e.current.values, t = t || n?.length != e.current.values?.length, t = t || n?.some((s,
|
|
77
|
+
return t = t || !n != !e.current.values, t = t || n?.length != e.current.values?.length, t = t || n?.some((s, o) => s != e.current.values[o]), t && (e.current.values = n, e.current.id = F()), e.current.id;
|
|
78
78
|
}, M = "@--change-event";
|
|
79
79
|
class le extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
@@ -123,7 +123,7 @@ class ce extends EventTarget {
|
|
|
123
123
|
*/
|
|
124
124
|
subscribe(e, t) {
|
|
125
125
|
const s = ({
|
|
126
|
-
event:
|
|
126
|
+
event: o,
|
|
127
127
|
value: i
|
|
128
128
|
}) => {
|
|
129
129
|
t(i);
|
|
@@ -134,9 +134,9 @@ class ce extends EventTarget {
|
|
|
134
134
|
const t = (s) => {
|
|
135
135
|
if (s instanceof G) {
|
|
136
136
|
const {
|
|
137
|
-
value:
|
|
137
|
+
value: o
|
|
138
138
|
} = s;
|
|
139
|
-
e(
|
|
139
|
+
e(o.event, this.data);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
return this.addEventListener(String(M), t), () => this.removeEventListener(String(M), t);
|
|
@@ -150,71 +150,71 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
|
|
|
150
150
|
}, 100);
|
|
151
151
|
}), [e]), e;
|
|
152
152
|
}, Y = (n, ...e) => {
|
|
153
|
-
const t =
|
|
153
|
+
const t = y.c(6), s = e;
|
|
154
154
|
new Error("[ctx] useRegistryChecker failed " + JSON.stringify({
|
|
155
155
|
names: s,
|
|
156
156
|
ctx: n?.name ?? "undefined"
|
|
157
157
|
}));
|
|
158
|
-
let
|
|
159
|
-
t[0] !== n || t[1] !== s ? (
|
|
158
|
+
let o;
|
|
159
|
+
t[0] !== n || t[1] !== s ? (o = () => {
|
|
160
160
|
if (n)
|
|
161
161
|
return s.some((l) => n.registry.has(l)), s.forEach((l) => n.registry.add(l)), () => {
|
|
162
162
|
s.forEach((l) => n.registry.delete(l));
|
|
163
163
|
};
|
|
164
|
-
}, t[0] = n, t[1] = s, t[2] =
|
|
164
|
+
}, t[0] = n, t[1] = s, t[2] = o) : o = t[2];
|
|
165
165
|
let i;
|
|
166
|
-
t[3] !== n || t[4] !== s.length ? (i = [n, s.length], t[3] = n, t[4] = s.length, t[5] = i) : i = t[5], w(
|
|
167
|
-
},
|
|
168
|
-
const s =
|
|
169
|
-
let
|
|
170
|
-
s[0] !== n || s[1] !== e || s[2] !== t ? (
|
|
166
|
+
t[3] !== n || t[4] !== s.length ? (i = [n, s.length], t[3] = n, t[4] = s.length, t[5] = i) : i = t[5], w(o, i);
|
|
167
|
+
}, Le = (n, e, t) => {
|
|
168
|
+
const s = y.c(5);
|
|
169
|
+
let o, i;
|
|
170
|
+
s[0] !== n || s[1] !== e || s[2] !== t ? (o = () => {
|
|
171
171
|
n && n.data[e] != t && n.publish(e, t);
|
|
172
|
-
}, i = [e, t, n], s[0] = n, s[1] = e, s[2] = t, s[3] =
|
|
172
|
+
}, i = [e, t, n], s[0] = n, s[1] = e, s[2] = t, s[3] = o, s[4] = i) : (o = s[3], i = s[4]), w(o, i), Y(n, e);
|
|
173
173
|
}, ue = (n, e, t) => {
|
|
174
|
-
const s =
|
|
174
|
+
const s = y.c(11), o = t === void 0 ? 0 : t;
|
|
175
175
|
let i;
|
|
176
176
|
s[0] !== n?.data || s[1] !== e ? (i = () => ({
|
|
177
177
|
value: n?.data?.[e]
|
|
178
178
|
}), s[0] = n?.data, s[1] = e, s[2] = i) : i = s[2];
|
|
179
179
|
const [l, a] = N(i), {
|
|
180
|
-
value:
|
|
180
|
+
value: r
|
|
181
181
|
} = l;
|
|
182
182
|
let u;
|
|
183
|
-
s[3] !== n || s[4] !==
|
|
183
|
+
s[3] !== n || s[4] !== o || s[5] !== e || s[6] !== r ? (u = () => {
|
|
184
184
|
if (n) {
|
|
185
|
-
const d =
|
|
186
|
-
value:
|
|
187
|
-
}) : H((
|
|
188
|
-
value:
|
|
189
|
-
}),
|
|
190
|
-
return
|
|
185
|
+
const d = o == 0 ? (p) => a({
|
|
186
|
+
value: p
|
|
187
|
+
}) : H((p) => a({
|
|
188
|
+
value: p
|
|
189
|
+
}), o), f = n.subscribe(e, d);
|
|
190
|
+
return r != n.data[e] && a({
|
|
191
191
|
value: n.data[e]
|
|
192
192
|
}), () => {
|
|
193
193
|
f();
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
}, s[3] = n, s[4] =
|
|
196
|
+
}, s[3] = n, s[4] = o, s[5] = e, s[6] = r, s[7] = u) : u = s[7];
|
|
197
197
|
let c;
|
|
198
198
|
return s[8] !== n || s[9] !== e ? (c = [e, n], s[8] = n, s[9] = e, s[10] = c) : c = s[10], w(u, c), n?.data[e];
|
|
199
|
-
},
|
|
200
|
-
const [, s] = N(0),
|
|
199
|
+
}, Ae = (n, e, t) => {
|
|
200
|
+
const [, s] = N(0), o = x(() => t(n?.data[e]), [t, n?.data[e]]);
|
|
201
201
|
return w(() => {
|
|
202
202
|
if (n) {
|
|
203
|
-
let i =
|
|
204
|
-
let
|
|
205
|
-
|
|
203
|
+
let i = o, l = () => {
|
|
204
|
+
let r = t(n.data[e]);
|
|
205
|
+
r != i && (i = r, s((u) => u + 1));
|
|
206
206
|
}, a = n.subscribe(e, l);
|
|
207
207
|
return l(), () => a();
|
|
208
208
|
}
|
|
209
|
-
}, [e, n]),
|
|
209
|
+
}, [e, n]), o;
|
|
210
210
|
}, q = (n, ...e) => {
|
|
211
211
|
w(() => {
|
|
212
212
|
if (n)
|
|
213
213
|
for (let [t, s] of e)
|
|
214
214
|
n.data[t] != s && n.publish(t, s);
|
|
215
215
|
}, [n, ae(e.flat())]), Y(n, ...e.map((t) => t[0]));
|
|
216
|
-
},
|
|
217
|
-
const t =
|
|
216
|
+
}, Ke = (n, ...e) => {
|
|
217
|
+
const t = y.c(18), s = e, [, o] = N(0);
|
|
218
218
|
let i;
|
|
219
219
|
if (t[0] !== n?.data || t[1] !== s) {
|
|
220
220
|
let c;
|
|
@@ -223,20 +223,20 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
|
|
|
223
223
|
i = t[2];
|
|
224
224
|
const l = i;
|
|
225
225
|
let a;
|
|
226
|
-
t[5] !== n || t[6] !== s || t[7] !== l || t[8] !==
|
|
226
|
+
t[5] !== n || t[6] !== s || t[7] !== l || t[8] !== o ? (a = () => {
|
|
227
227
|
if (n) {
|
|
228
228
|
let c = l;
|
|
229
229
|
const d = H(() => {
|
|
230
230
|
const g = s.map((h) => n?.data?.[h]);
|
|
231
|
-
s.some((h,
|
|
232
|
-
}, 1), f = s.map((g) => n.subscribe(g, d)),
|
|
231
|
+
s.some((h, m) => c[m] != g[m]) && (c = g, o(he));
|
|
232
|
+
}, 1), f = s.map((g) => n.subscribe(g, d)), p = setTimeout(d, 1);
|
|
233
233
|
return () => {
|
|
234
|
-
clearTimeout(
|
|
234
|
+
clearTimeout(p), d.cancel(), f.forEach(de);
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
}, t[5] = n, t[6] = s, t[7] = l, t[8] =
|
|
238
|
-
let
|
|
239
|
-
t[10] !== n || t[11] !== s ? (
|
|
237
|
+
}, t[5] = n, t[6] = s, t[7] = l, t[8] = o, t[9] = a) : a = t[9];
|
|
238
|
+
let r;
|
|
239
|
+
t[10] !== n || t[11] !== s ? (r = [n, ...s], t[10] = n, t[11] = s, t[12] = r) : r = t[12], w(a, r);
|
|
240
240
|
let u;
|
|
241
241
|
if (t[13] !== s || t[14] !== l) {
|
|
242
242
|
let c;
|
|
@@ -244,30 +244,30 @@ const k = oe((n) => new ce(n)), z = (n = "noname") => {
|
|
|
244
244
|
} else
|
|
245
245
|
u = t[15];
|
|
246
246
|
return u;
|
|
247
|
-
},
|
|
248
|
-
const s =
|
|
247
|
+
}, Me = (n, e, ...t) => {
|
|
248
|
+
const s = y.c(14), o = e === void 0 ? 50 : e, i = t, [, l] = N(0);
|
|
249
249
|
let a;
|
|
250
250
|
if (s[0] !== n?.data || s[1] !== i) {
|
|
251
251
|
let d;
|
|
252
252
|
s[3] !== n?.data ? (d = (f) => n?.data?.[f], s[3] = n?.data, s[4] = d) : d = s[4], a = i.map(d), s[0] = n?.data, s[1] = i, s[2] = a;
|
|
253
253
|
} else
|
|
254
254
|
a = s[2];
|
|
255
|
-
const
|
|
255
|
+
const r = a;
|
|
256
256
|
let u;
|
|
257
|
-
s[5] !== n || s[6] !==
|
|
257
|
+
s[5] !== n || s[6] !== o || s[7] !== i || s[8] !== r || s[9] !== l ? (u = () => {
|
|
258
258
|
if (n) {
|
|
259
|
-
let d =
|
|
259
|
+
let d = r;
|
|
260
260
|
const f = H(() => {
|
|
261
|
-
const h = i.map((
|
|
262
|
-
i.some((
|
|
263
|
-
},
|
|
261
|
+
const h = i.map((m) => n?.data?.[m]);
|
|
262
|
+
i.some((m, b) => d[b] != h[b]) && (d = h, l(fe));
|
|
263
|
+
}, o), p = i.map((h) => n.subscribe(h, f)), g = setTimeout(f, 1);
|
|
264
264
|
return () => {
|
|
265
|
-
clearTimeout(g), f.cancel(),
|
|
265
|
+
clearTimeout(g), f.cancel(), p.forEach(pe);
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
}, s[5] = n, s[6] =
|
|
268
|
+
}, s[5] = n, s[6] = o, s[7] = i, s[8] = r, s[9] = l, s[10] = u) : u = s[10];
|
|
269
269
|
let c;
|
|
270
|
-
return s[11] !== n || s[12] !== i ? (c = [n, ...i], s[11] = n, s[12] = i, s[13] = c) : c = s[13], w(u, c),
|
|
270
|
+
return s[11] !== n || s[12] !== i ? (c = [n, ...i], s[11] = n, s[12] = i, s[13] = c) : c = s[13], w(u, c), r;
|
|
271
271
|
};
|
|
272
272
|
function he(n) {
|
|
273
273
|
return n + 1;
|
|
@@ -286,294 +286,309 @@ const J = (n = void 0) => Object.keys(n ?? {}).sort().map((e) => {
|
|
|
286
286
|
if (t !== null && (typeof t == "object" || typeof t == "function"))
|
|
287
287
|
throw new Error(`Parameter "${e}" must be a primitive value (string, number, bigint, null, or undefined), but received ${typeof t}`);
|
|
288
288
|
return e + "=" + t;
|
|
289
|
-
}).join("&"),
|
|
290
|
-
const t = (a) => [n, J(a)].filter(Boolean).join("?"), s = /* @__PURE__ */ new Set(),
|
|
291
|
-
const
|
|
292
|
-
let
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
}).join("&"), me = (n, e) => {
|
|
290
|
+
const t = (a) => [n, J(a)].filter(Boolean).join("?"), s = /* @__PURE__ */ new Set(), o = (a) => {
|
|
291
|
+
const r = y.c(7), u = t(a), c = z(u);
|
|
292
|
+
let d;
|
|
293
|
+
r[0] !== c.data ? (d = {
|
|
294
|
+
...c.data
|
|
295
|
+
}, r[0] = c.data, r[1] = d) : d = r[1];
|
|
296
|
+
const f = e(a, d);
|
|
297
|
+
let p;
|
|
298
|
+
r[2] === Symbol.for("react.memo_cache_sentinel") ? (p = new Error(), r[2] = p) : p = r[2];
|
|
299
|
+
const g = p.stack;
|
|
297
300
|
let h;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
r[3] !== f ? (h = Object.entries(f), r[3] = f, r[4] = h) : h = r[4], q(c, ...h);
|
|
302
|
+
let m;
|
|
303
|
+
return r[5] !== u ? (m = () => {
|
|
304
|
+
if (s.has(u)) {
|
|
305
|
+
const b = new Error("RootContext " + u + " are mounted more than once");
|
|
306
|
+
throw b.stack = g, b;
|
|
302
307
|
}
|
|
303
|
-
return s.add(
|
|
304
|
-
s.delete(
|
|
308
|
+
return s.add(u), () => {
|
|
309
|
+
s.delete(u);
|
|
305
310
|
};
|
|
306
|
-
},
|
|
311
|
+
}, r[5] = u, r[6] = m) : m = r[6], w(m), f;
|
|
307
312
|
}, i = (a) => {
|
|
308
|
-
const
|
|
313
|
+
const r = y.c(1);
|
|
309
314
|
let u;
|
|
310
|
-
return
|
|
315
|
+
return r[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ v($, {}), r[0] = u) : u = r[0], u;
|
|
311
316
|
}, l = (a) => {
|
|
312
|
-
const
|
|
317
|
+
const r = y.c(3), u = o(a);
|
|
313
318
|
let c;
|
|
314
|
-
return
|
|
319
|
+
return r[0] !== a || r[1] !== u ? (c = /* @__PURE__ */ v(i, { ...a, ...u }), r[0] = a, r[1] = u, r[2] = c) : c = r[2], c;
|
|
315
320
|
};
|
|
316
|
-
return
|
|
321
|
+
return o.displayName = `useState[${n}]`, l.displayName = `StateContainer[${n}]`, i.displayName = `Debug[${n}]`, {
|
|
317
322
|
name: n,
|
|
318
323
|
getCtxName: t,
|
|
319
|
-
useRootState:
|
|
324
|
+
useRootState: o,
|
|
320
325
|
Root: l,
|
|
321
326
|
/**
|
|
322
327
|
* Strict consumer: throws if the corresponding Root for these props isn't mounted.
|
|
323
328
|
* Use in development/tests to fail fast when wiring is incorrect.
|
|
324
329
|
*/
|
|
325
330
|
useCtxStateStrict: (a) => {
|
|
326
|
-
const
|
|
331
|
+
const r = t(a), u = x(() => new Error().stack, []);
|
|
327
332
|
return w(() => {
|
|
328
|
-
if (!s.has(
|
|
329
|
-
const c = new Error("RootContext [" +
|
|
333
|
+
if (!s.has(r)) {
|
|
334
|
+
const c = new Error("RootContext [" + r + "] is not mounted");
|
|
330
335
|
throw c.stack = u, c;
|
|
331
336
|
}
|
|
332
|
-
}, [
|
|
337
|
+
}, [r]), z(r);
|
|
333
338
|
},
|
|
334
339
|
/**
|
|
335
340
|
* Lenient consumer: schedules a console.error if the Root isn't mounted instead of throwing.
|
|
336
341
|
* Useful in production to avoid hard crashes while still surfacing misconfiguration.
|
|
337
342
|
*/
|
|
338
343
|
useCtxState: (a) => {
|
|
339
|
-
const
|
|
344
|
+
const r = t(a), u = x(() => new Error().stack, []);
|
|
340
345
|
return w(() => {
|
|
341
|
-
if (!s.has(
|
|
342
|
-
const c = new Error("RootContext [" +
|
|
346
|
+
if (!s.has(r)) {
|
|
347
|
+
const c = new Error("RootContext [" + r + "] is not mounted");
|
|
343
348
|
c.stack = u;
|
|
344
349
|
let d = setTimeout(() => console.error(c), 1e3);
|
|
345
350
|
return () => clearTimeout(d);
|
|
346
351
|
}
|
|
347
|
-
}, [s.has(
|
|
352
|
+
}, [s.has(r)]), z(r);
|
|
348
353
|
}
|
|
349
354
|
};
|
|
350
|
-
},
|
|
351
|
-
const e =
|
|
355
|
+
}, ge = (n) => {
|
|
356
|
+
const [, e] = N(0), {
|
|
357
|
+
proxy: t,
|
|
358
|
+
finalGetter: s,
|
|
359
|
+
openGetter: o,
|
|
360
|
+
clean: i
|
|
361
|
+
} = x(() => {
|
|
362
|
+
const l = /* @__PURE__ */ new Set(), a = {}, r = /* @__PURE__ */ new Map(), u = new Proxy(n?.data, {
|
|
363
|
+
get(h, m) {
|
|
364
|
+
if (c)
|
|
365
|
+
return l.add(m), a[m] = h[m];
|
|
366
|
+
throw new Error("useQuickSubscribe: Cannot access context data outside render phase. Destructure needed properties immediately during render.");
|
|
367
|
+
},
|
|
368
|
+
ownKeys(h) {
|
|
369
|
+
return console.warn("useQuickSubscribe: Rest object operations aren't recommended as they bypass selective subscription and may cause performance issues"), Reflect.ownKeys(h);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
let c = !0, d = H(() => {
|
|
373
|
+
[...l.values()].some((h) => a[h] != n?.data?.[h]) && e((h) => h + 1);
|
|
374
|
+
}, 0), f = () => {
|
|
375
|
+
c = !0, l.clear();
|
|
376
|
+
}, p = () => {
|
|
377
|
+
c = !1, [...l.values()].filter((h) => !r.has(h)).forEach((h) => {
|
|
378
|
+
r.set(h, n?.subscribe(h, d));
|
|
379
|
+
}), [...r.keys()].filter((h) => !l.has(h)).forEach((h) => {
|
|
380
|
+
r.get(h)?.(), r.delete(h);
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
return {
|
|
384
|
+
proxy: u,
|
|
385
|
+
finalGetter: p,
|
|
386
|
+
openGetter: f,
|
|
387
|
+
clean: () => {
|
|
388
|
+
f(), p(), e((h) => h + 1);
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
}, [n]);
|
|
392
|
+
return o(), setTimeout(s, 0), w(() => () => i(), [i]), t;
|
|
393
|
+
}, ve = (n) => {
|
|
394
|
+
const e = y.c(1);
|
|
352
395
|
let t;
|
|
353
396
|
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ v($, {}), e[0] = t) : t = e[0], t;
|
|
354
|
-
},
|
|
397
|
+
}, be = ({
|
|
355
398
|
useStateFn: n,
|
|
356
399
|
params: e,
|
|
357
400
|
debugging: t
|
|
358
401
|
}) => {
|
|
359
402
|
const s = n(e);
|
|
360
|
-
return t ? /* @__PURE__ */ v(
|
|
361
|
-
},
|
|
403
|
+
return t ? /* @__PURE__ */ v(ve, { ...s }) : /* @__PURE__ */ v($, {});
|
|
404
|
+
}, Ue = ({
|
|
362
405
|
Wrapper: n = te,
|
|
363
406
|
debugging: e = !1
|
|
364
407
|
}) => {
|
|
365
|
-
const t = z("auto-ctx"), [s,
|
|
366
|
-
const
|
|
367
|
-
return
|
|
368
|
-
...
|
|
369
|
-
[
|
|
370
|
-
...f
|
|
371
|
-
useStateFn:
|
|
372
|
-
params: u
|
|
408
|
+
const t = z("auto-ctx"), [s, o] = N({}), i = ee((a, r, u, c = 0, d = void 0) => {
|
|
409
|
+
const f = [a, J(u)].filter(Boolean).join("?");
|
|
410
|
+
return o((p) => ({
|
|
411
|
+
...p,
|
|
412
|
+
[f]: {
|
|
413
|
+
...p[f] ?? {
|
|
414
|
+
useStateFn: r,
|
|
415
|
+
params: u,
|
|
416
|
+
AttatchedComponent: d
|
|
373
417
|
},
|
|
374
|
-
counter: (f
|
|
418
|
+
counter: (p[f]?.counter ?? 0) + 1,
|
|
375
419
|
keepUntil: void 0,
|
|
376
|
-
useStateFn:
|
|
420
|
+
useStateFn: r,
|
|
421
|
+
AttatchedComponent: d
|
|
377
422
|
}
|
|
378
|
-
})), () =>
|
|
379
|
-
[
|
|
380
|
-
...
|
|
423
|
+
})), () => o(({
|
|
424
|
+
[f]: p,
|
|
425
|
+
...g
|
|
381
426
|
}) => ({
|
|
382
|
-
...
|
|
383
|
-
...
|
|
384
|
-
[
|
|
385
|
-
...
|
|
386
|
-
counter:
|
|
387
|
-
keepUntil:
|
|
427
|
+
...g,
|
|
428
|
+
...p?.counter > 1 || c > 0 ? {
|
|
429
|
+
[f]: {
|
|
430
|
+
...p,
|
|
431
|
+
counter: p.counter - 1,
|
|
432
|
+
keepUntil: p.counter > 1 ? void 0 : Date.now() + c
|
|
388
433
|
}
|
|
389
434
|
} : {}
|
|
390
435
|
}));
|
|
391
436
|
}, []), l = x(() => Object.entries(s).filter(([, {
|
|
392
437
|
counter: a,
|
|
393
|
-
keepUntil:
|
|
394
|
-
}]) => a <= 0 &&
|
|
438
|
+
keepUntil: r
|
|
439
|
+
}]) => a <= 0 && r).toSorted(([, {
|
|
395
440
|
keepUntil: a = 0
|
|
396
441
|
}], [, {
|
|
397
|
-
keepUntil:
|
|
398
|
-
}]) => a -
|
|
442
|
+
keepUntil: r = 0
|
|
443
|
+
}]) => a - r)?.at(0), [s]);
|
|
399
444
|
return w(() => {
|
|
400
445
|
if (l) {
|
|
401
446
|
const [a, {
|
|
402
|
-
keepUntil:
|
|
447
|
+
keepUntil: r
|
|
403
448
|
}] = l;
|
|
404
|
-
if (typeof
|
|
449
|
+
if (typeof r > "u") throw new Error("Invalid state mgr");
|
|
405
450
|
let u = setTimeout(() => {
|
|
406
|
-
|
|
451
|
+
o(({
|
|
407
452
|
[a]: c,
|
|
408
453
|
...d
|
|
409
454
|
}) => d);
|
|
410
|
-
}, Math.max(0,
|
|
455
|
+
}, Math.max(0, r - Date.now()));
|
|
411
456
|
return () => {
|
|
412
457
|
clearTimeout(u);
|
|
413
458
|
};
|
|
414
459
|
}
|
|
415
460
|
}, [l]), q(t, ["subscribe", i], ["state", s]), /* @__PURE__ */ v($, { children: Object.entries(s).filter(([, {
|
|
416
461
|
counter: a,
|
|
417
|
-
keepUntil:
|
|
418
|
-
}]) => a > 0 ||
|
|
419
|
-
useStateFn:
|
|
420
|
-
params: u
|
|
421
|
-
|
|
422
|
-
}
|
|
462
|
+
keepUntil: r = 0
|
|
463
|
+
}]) => a > 0 || r >= Date.now()).map(([a, {
|
|
464
|
+
useStateFn: r,
|
|
465
|
+
params: u,
|
|
466
|
+
AttatchedComponent: c
|
|
467
|
+
}]) => /* @__PURE__ */ R(n, { children: [
|
|
468
|
+
/* @__PURE__ */ v(be, { params: u, useStateFn: r, debugging: e }, a),
|
|
469
|
+
c && /* @__PURE__ */ v(c, { ...u }, "attatch_" + a)
|
|
470
|
+
] }, a)) });
|
|
471
|
+
}, Se = ({
|
|
423
472
|
useRootState: n,
|
|
424
473
|
getCtxName: e,
|
|
425
474
|
name: t
|
|
426
|
-
}, s = 0) =>
|
|
427
|
-
|
|
428
|
-
const
|
|
429
|
-
return w(() =>
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const l = /* @__PURE__ */ new Set(), a = {}, o = /* @__PURE__ */ new Map(), u = new Proxy(n?.data, {
|
|
439
|
-
get(h, p) {
|
|
440
|
-
if (c)
|
|
441
|
-
return l.add(p), a[p] = h[p];
|
|
442
|
-
throw new Error("useQuickSubscribe: Cannot access context data outside render phase. Destructure needed properties immediately during render.");
|
|
443
|
-
},
|
|
444
|
-
ownKeys(h) {
|
|
445
|
-
return console.warn("useQuickSubscribe: Rest object operations aren't recommended as they bypass selective subscription and may cause performance issues"), Reflect.ownKeys(h);
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
let c = !0, d = H(() => {
|
|
449
|
-
[...l.values()].some((h) => a[h] != n?.data?.[h]) && e((h) => h + 1);
|
|
450
|
-
}, 0), f = () => {
|
|
451
|
-
c = !0, l.clear();
|
|
452
|
-
}, m = () => {
|
|
453
|
-
c = !1, [...l.values()].filter((h) => !o.has(h)).forEach((h) => {
|
|
454
|
-
o.set(h, n?.subscribe(h, d));
|
|
455
|
-
}), [...o.keys()].filter((h) => !l.has(h)).forEach((h) => {
|
|
456
|
-
o.get(h)?.(), o.delete(h);
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
return {
|
|
460
|
-
proxy: u,
|
|
461
|
-
finalGetter: m,
|
|
462
|
-
openGetter: f,
|
|
463
|
-
clean: () => {
|
|
464
|
-
f(), m(), e((h) => h + 1);
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
}, [n]);
|
|
468
|
-
return r(), setTimeout(s, 0), w(() => () => i(), [i]), t;
|
|
469
|
-
};
|
|
470
|
-
function ve(n) {
|
|
471
|
-
const e = _.c(4);
|
|
475
|
+
}, s = 0, o = void 0) => {
|
|
476
|
+
const i = (l) => {
|
|
477
|
+
const a = e(l), r = ue(z("auto-ctx"), "subscribe");
|
|
478
|
+
return w(() => r?.(t, n, l, s, o), [n, r, t, a, s, o]), z(a);
|
|
479
|
+
};
|
|
480
|
+
return {
|
|
481
|
+
useCtxState: i,
|
|
482
|
+
useStore: (l) => ge(i(l))
|
|
483
|
+
};
|
|
484
|
+
}, Be = (n, e, t = 0, s = void 0) => Se(me(n, e), t, s);
|
|
485
|
+
function Ee(n) {
|
|
486
|
+
const e = y.c(4);
|
|
472
487
|
let t;
|
|
473
|
-
e[0] !== n ? (t = n ?
|
|
488
|
+
e[0] !== n ? (t = n ? we(n.trim().toLowerCase().split(" "), "gi") : void 0, e[0] = n, e[1] = t) : t = e[1];
|
|
474
489
|
const s = t;
|
|
475
|
-
let
|
|
476
|
-
return e[2] !== s ? (
|
|
490
|
+
let o;
|
|
491
|
+
return e[2] !== s ? (o = {
|
|
477
492
|
highlight: s
|
|
478
|
-
}, e[2] = s, e[3] =
|
|
493
|
+
}, e[2] = s, e[3] = o) : o = e[3], o;
|
|
479
494
|
}
|
|
480
|
-
function
|
|
495
|
+
function Ce(n) {
|
|
481
496
|
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
482
497
|
}
|
|
483
|
-
function
|
|
484
|
-
const t = n.map(
|
|
498
|
+
function we(n, e = "gi") {
|
|
499
|
+
const t = n.map(Ce).join("|");
|
|
485
500
|
return new RegExp(`(${t})`, e);
|
|
486
501
|
}
|
|
487
|
-
function
|
|
502
|
+
function ye(n, e) {
|
|
488
503
|
const t = [];
|
|
489
504
|
let s = 0;
|
|
490
|
-
for (const
|
|
491
|
-
const [i] =
|
|
505
|
+
for (const o of n.matchAll(e)) {
|
|
506
|
+
const [i] = o, l = o.index;
|
|
492
507
|
l > s && t.push(n.slice(s, l)), t.push(/* @__PURE__ */ v("mark", { children: i }, l)), s = l + i.length;
|
|
493
508
|
}
|
|
494
509
|
return s < n.length && t.push(n.slice(s)), t;
|
|
495
510
|
}
|
|
496
511
|
const X = D.createContext({
|
|
497
512
|
highlight: void 0
|
|
498
|
-
}),
|
|
499
|
-
const e =
|
|
513
|
+
}), _e = (n) => {
|
|
514
|
+
const e = y.c(3), {
|
|
500
515
|
children: t,
|
|
501
516
|
highlight: s
|
|
502
|
-
} = n,
|
|
517
|
+
} = n, o = Ee(s);
|
|
503
518
|
let i;
|
|
504
|
-
return e[0] !== t || e[1] !==
|
|
505
|
-
},
|
|
506
|
-
const e =
|
|
519
|
+
return e[0] !== t || e[1] !== o ? (i = /* @__PURE__ */ v(X.Provider, { value: o, children: t }), e[0] = t, e[1] = o, e[2] = i) : i = e[2], i;
|
|
520
|
+
}, Ne = (n) => {
|
|
521
|
+
const e = y.c(5), {
|
|
507
522
|
text: t
|
|
508
523
|
} = n, {
|
|
509
524
|
highlight: s
|
|
510
525
|
} = se(X);
|
|
511
|
-
let
|
|
512
|
-
e[0] !== s || e[1] !== t ? (
|
|
513
|
-
const i =
|
|
526
|
+
let o;
|
|
527
|
+
e[0] !== s || e[1] !== t ? (o = s ? ye(t, s) : t, e[0] = s, e[1] = t, e[2] = o) : o = e[2];
|
|
528
|
+
const i = o;
|
|
514
529
|
let l;
|
|
515
530
|
return e[3] !== i ? (l = /* @__PURE__ */ v($, { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
|
|
516
531
|
}, Q = (n) => {
|
|
517
|
-
const e =
|
|
532
|
+
const e = y.c(5), {
|
|
518
533
|
name: t,
|
|
519
534
|
value: s
|
|
520
535
|
} = n;
|
|
521
|
-
let
|
|
536
|
+
let o;
|
|
522
537
|
try {
|
|
523
538
|
let a;
|
|
524
539
|
e[0] !== t || e[1] !== s ? (a = JSON.stringify({
|
|
525
540
|
[t]: s
|
|
526
|
-
}, null, 2), e[0] = t, e[1] = s, e[2] = a) : a = e[2],
|
|
541
|
+
}, null, 2), e[0] = t, e[1] = s, e[2] = a) : a = e[2], o = a;
|
|
527
542
|
} catch (a) {
|
|
528
|
-
|
|
543
|
+
o = String(a);
|
|
529
544
|
}
|
|
530
|
-
const i =
|
|
545
|
+
const i = o;
|
|
531
546
|
let l;
|
|
532
547
|
return e[3] !== i ? (l = /* @__PURE__ */ v("pre", { children: i }), e[3] = i, e[4] = l) : l = e[4], l;
|
|
533
|
-
},
|
|
534
|
-
const e =
|
|
535
|
-
let t, s,
|
|
548
|
+
}, De = (n) => {
|
|
549
|
+
const e = y.c(26);
|
|
550
|
+
let t, s, o, i;
|
|
536
551
|
if (e[0] !== n) {
|
|
537
552
|
const {
|
|
538
553
|
selectedKey: S,
|
|
539
|
-
setKey:
|
|
540
|
-
currentKey:
|
|
554
|
+
setKey: E,
|
|
555
|
+
currentKey: C,
|
|
541
556
|
highlight: O,
|
|
542
|
-
...
|
|
557
|
+
..._
|
|
543
558
|
} = n;
|
|
544
|
-
|
|
559
|
+
o = S, i = E, t = C, s = _, e[0] = n, e[1] = t, e[2] = s, e[3] = o, e[4] = i;
|
|
545
560
|
} else
|
|
546
|
-
t = e[1], s = e[2],
|
|
561
|
+
t = e[1], s = e[2], o = e[3], i = e[4];
|
|
547
562
|
let l;
|
|
548
563
|
e[5] !== t ? (l = k(t), e[5] = t, e[6] = l) : l = e[6];
|
|
549
|
-
const a = l,
|
|
564
|
+
const a = l, r = P(void 0);
|
|
550
565
|
let u, c;
|
|
551
566
|
e[7] !== a ? (u = () => {
|
|
552
|
-
if (
|
|
567
|
+
if (r.current) {
|
|
553
568
|
const S = H(() => {
|
|
554
|
-
|
|
569
|
+
r.current && (r.current?.classList.add("state-key-updated"), requestAnimationFrame(() => r.current?.classList.remove("state-key-updated")));
|
|
555
570
|
}, 5);
|
|
556
571
|
return a.subscribeAll(S);
|
|
557
572
|
}
|
|
558
|
-
}, c = [a,
|
|
559
|
-
const d = t ==
|
|
573
|
+
}, c = [a, r], e[7] = a, e[8] = u, e[9] = c) : (u = e[8], c = e[9]), w(u, c);
|
|
574
|
+
const d = t == o;
|
|
560
575
|
let f;
|
|
561
576
|
e[10] !== t || e[11] !== i ? (f = () => i(t), e[10] = t, e[11] = i, e[12] = f) : f = e[12];
|
|
562
|
-
const
|
|
577
|
+
const p = String(t);
|
|
563
578
|
let g;
|
|
564
|
-
e[13] !==
|
|
579
|
+
e[13] !== p ? (g = /* @__PURE__ */ v("div", { className: "state-key-name", children: /* @__PURE__ */ v(Ne, { text: p }) }), e[13] = p, e[14] = g) : g = e[14];
|
|
565
580
|
let h;
|
|
566
581
|
e[15] !== a.data ? (h = Object.keys(a.data), e[15] = a.data, e[16] = h) : h = e[16];
|
|
567
|
-
let
|
|
568
|
-
e[17] !== h.length ? (
|
|
582
|
+
let m;
|
|
583
|
+
e[17] !== h.length ? (m = /* @__PURE__ */ R("div", { className: "state-key-meta", children: [
|
|
569
584
|
h.length,
|
|
570
585
|
" items"
|
|
571
|
-
] }), e[17] = h.length, e[18] =
|
|
586
|
+
] }), e[17] = h.length, e[18] = m) : m = e[18];
|
|
572
587
|
let b;
|
|
573
|
-
return e[19] !== t || e[20] !== s || e[21] !== d || e[22] !== f || e[23] !== g || e[24] !==
|
|
588
|
+
return e[19] !== t || e[20] !== s || e[21] !== d || e[22] !== f || e[23] !== g || e[24] !== m ? (b = /* @__PURE__ */ R("div", { ref: r, className: "state-key", title: t, "data-active": d, onClick: f, ...s, children: [
|
|
574
589
|
g,
|
|
575
|
-
|
|
576
|
-
] }), e[19] = t, e[20] = s, e[21] = d, e[22] = f, e[23] = g, e[24] =
|
|
590
|
+
m
|
|
591
|
+
] }), e[19] = t, e[20] = s, e[21] = d, e[22] = f, e[23] = g, e[24] = m, e[25] = b) : b = e[25], b;
|
|
577
592
|
};
|
|
578
593
|
function T() {
|
|
579
594
|
return T = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -584,7 +599,7 @@ function T() {
|
|
|
584
599
|
return n;
|
|
585
600
|
}, T.apply(null, arguments);
|
|
586
601
|
}
|
|
587
|
-
function
|
|
602
|
+
function Re(n, e) {
|
|
588
603
|
if (n == null) return {};
|
|
589
604
|
var t = {};
|
|
590
605
|
for (var s in n) if ({}.hasOwnProperty.call(n, s)) {
|
|
@@ -593,7 +608,7 @@ function ye(n, e) {
|
|
|
593
608
|
}
|
|
594
609
|
return t;
|
|
595
610
|
}
|
|
596
|
-
var
|
|
611
|
+
var Te = ["prefixCls", "className", "children", "mode", "visiable", "visible", "renderBar", "lineBar", "disable", "onDragEnd", "onDragging"];
|
|
597
612
|
class U extends D.Component {
|
|
598
613
|
constructor(e) {
|
|
599
614
|
super(e), this.state = {
|
|
@@ -609,8 +624,8 @@ class U extends D.Component {
|
|
|
609
624
|
onMouseDown(e, t) {
|
|
610
625
|
if (!(!t.target || !this.warpper)) {
|
|
611
626
|
this.paneNumber = e, this.startX = t.clientX, this.startY = t.clientY, this.move = !0, this.target = t.target.parentNode;
|
|
612
|
-
var s = this.target.previousElementSibling,
|
|
613
|
-
this.boxWidth = this.warpper.clientWidth, this.boxHeight = this.warpper.clientHeight, s && (this.preWidth = s.clientWidth, this.preHeight = s.clientHeight),
|
|
627
|
+
var s = this.target.previousElementSibling, o = this.target.nextElementSibling;
|
|
628
|
+
this.boxWidth = this.warpper.clientWidth, this.boxHeight = this.warpper.clientHeight, s && (this.preWidth = s.clientWidth, this.preHeight = s.clientHeight), o && (this.nextWidth = o.clientWidth, this.nextHeight = o.clientHeight), window.addEventListener("mousemove", this.onDragging), window.addEventListener("mouseup", this.onDragEnd, !1), this.setState({
|
|
614
629
|
dragging: !0
|
|
615
630
|
});
|
|
616
631
|
}
|
|
@@ -623,16 +638,16 @@ class U extends D.Component {
|
|
|
623
638
|
var {
|
|
624
639
|
mode: t,
|
|
625
640
|
onDragging: s
|
|
626
|
-
} = this.props,
|
|
641
|
+
} = this.props, o = this.target.nextElementSibling, i = this.target.previousElementSibling, l = e.clientX - this.startX, a = e.clientY - this.startY;
|
|
627
642
|
if (this.preSize = 0, this.nextSize = 0, t === "horizontal") {
|
|
628
643
|
if (this.preSize = this.preWidth + l > -1 ? this.preWidth + l : 0, this.nextSize = this.nextWidth - l > -1 ? this.nextWidth - l : 0, this.preSize === 0 || this.nextSize === 0)
|
|
629
644
|
return;
|
|
630
|
-
this.preSize = (this.preSize / this.boxWidth >= 1 ? 1 : this.preSize / this.boxWidth) * 100, this.nextSize = (this.nextSize / this.boxWidth >= 1 ? 1 : this.nextSize / this.boxWidth) * 100, i &&
|
|
645
|
+
this.preSize = (this.preSize / this.boxWidth >= 1 ? 1 : this.preSize / this.boxWidth) * 100, this.nextSize = (this.nextSize / this.boxWidth >= 1 ? 1 : this.nextSize / this.boxWidth) * 100, i && o && (i.style.width = this.preSize + "%", o.style.width = this.nextSize + "%");
|
|
631
646
|
}
|
|
632
647
|
if (t === "vertical" && this.preHeight + a > -1 && this.nextHeight - a > -1) {
|
|
633
648
|
if (this.preSize = this.preHeight + a > -1 ? this.preHeight + a : 0, this.nextSize = this.nextHeight - a > -1 ? this.nextHeight - a : 0, this.preSize = (this.preSize / this.boxHeight >= 1 ? 1 : this.preSize / this.boxHeight) * 100, this.nextSize = (this.nextSize / this.boxHeight >= 1 ? 1 : this.nextSize / this.boxHeight) * 100, this.preSize === 0 || this.nextSize === 0)
|
|
634
649
|
return;
|
|
635
|
-
i &&
|
|
650
|
+
i && o && (i.style.height = this.preSize + "%", o.style.height = this.nextSize + "%");
|
|
636
651
|
}
|
|
637
652
|
s && s(this.preSize, this.nextSize, this.paneNumber);
|
|
638
653
|
}
|
|
@@ -648,36 +663,36 @@ class U extends D.Component {
|
|
|
648
663
|
render() {
|
|
649
664
|
var e, t = this.props, {
|
|
650
665
|
prefixCls: s,
|
|
651
|
-
className:
|
|
666
|
+
className: o,
|
|
652
667
|
children: i,
|
|
653
668
|
mode: l,
|
|
654
669
|
visible: a = (e = this.props.visible) != null ? e : this.props.visiable,
|
|
655
|
-
renderBar:
|
|
670
|
+
renderBar: r,
|
|
656
671
|
lineBar: u,
|
|
657
672
|
disable: c
|
|
658
|
-
} = t, d =
|
|
673
|
+
} = t, d = Re(t, Te), {
|
|
659
674
|
dragging: f
|
|
660
|
-
} = this.state,
|
|
675
|
+
} = this.state, p = [s, o, s + "-" + l, f ? "dragging" : null].filter(Boolean).join(" ").trim(), g = D.Children.toArray(i);
|
|
661
676
|
return /* @__PURE__ */ v("div", T({
|
|
662
|
-
className:
|
|
677
|
+
className: p
|
|
663
678
|
}, d, {
|
|
664
679
|
ref: (h) => this.warpper = h,
|
|
665
|
-
children: D.Children.map(g, (h,
|
|
680
|
+
children: D.Children.map(g, (h, m) => {
|
|
666
681
|
var b = Object.assign({}, h.props, {
|
|
667
682
|
className: [s + "-pane", h.props.className].filter(Boolean).join(" ").trim(),
|
|
668
683
|
style: T({}, h.props.style)
|
|
669
|
-
}), S = a === !0 || a && a.includes(
|
|
684
|
+
}), S = a === !0 || a && a.includes(m + 1) || !1, E = {
|
|
670
685
|
className: [s + "-bar", u ? s + "-line-bar" : null, u ? null : s + "-large-bar"].filter(Boolean).join(" ").trim()
|
|
671
686
|
};
|
|
672
|
-
(c === !0 || c && c.includes(
|
|
673
|
-
var
|
|
674
|
-
return
|
|
675
|
-
onMouseDown: this.onMouseDown.bind(this,
|
|
676
|
-
})) :
|
|
677
|
-
onMouseDown: this.onMouseDown.bind(this,
|
|
687
|
+
(c === !0 || c && c.includes(m + 1)) && (E.className = [E.className, c ? "disable" : null].filter(Boolean).join(" ").trim());
|
|
688
|
+
var C = null;
|
|
689
|
+
return m !== 0 && S && r ? C = r(T({}, E, {
|
|
690
|
+
onMouseDown: this.onMouseDown.bind(this, m + 1)
|
|
691
|
+
})) : m !== 0 && S && (C = /* @__PURE__ */ D.createElement("div", T({}, E), /* @__PURE__ */ v("div", {
|
|
692
|
+
onMouseDown: this.onMouseDown.bind(this, m + 1)
|
|
678
693
|
}))), /* @__PURE__ */ R(D.Fragment, {
|
|
679
|
-
children: [
|
|
680
|
-
},
|
|
694
|
+
children: [C, /* @__PURE__ */ D.cloneElement(h, T({}, b))]
|
|
695
|
+
}, m);
|
|
681
696
|
})
|
|
682
697
|
}));
|
|
683
698
|
}
|
|
@@ -687,108 +702,108 @@ U.defaultProps = {
|
|
|
687
702
|
visiable: !0,
|
|
688
703
|
mode: "horizontal"
|
|
689
704
|
};
|
|
690
|
-
const L = k.cache,
|
|
691
|
-
const e =
|
|
705
|
+
const L = k.cache, ze = (n) => {
|
|
706
|
+
const e = y.c(27), {
|
|
692
707
|
Component: t
|
|
693
|
-
} = n, [s,
|
|
708
|
+
} = n, [s, o] = N($e), [i, l] = N(""), [a, r] = N("");
|
|
694
709
|
let u, c;
|
|
695
710
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
696
|
-
const
|
|
697
|
-
|
|
711
|
+
const _ = setInterval(() => {
|
|
712
|
+
o(He);
|
|
698
713
|
}, 50);
|
|
699
|
-
return () => clearInterval(
|
|
714
|
+
return () => clearInterval(_);
|
|
700
715
|
}, c = [L], e[0] = u, e[1] = c) : (u = e[0], c = e[1]), w(u, c);
|
|
701
716
|
let d;
|
|
702
717
|
e[2] !== i ? (d = i.toLowerCase().split(" "), e[2] = i, e[3] = d) : d = e[3];
|
|
703
718
|
const f = d;
|
|
704
|
-
let
|
|
705
|
-
e[4] !== f ? (
|
|
706
|
-
const W =
|
|
719
|
+
let p;
|
|
720
|
+
e[4] !== f ? (p = (_) => {
|
|
721
|
+
const W = _.toLowerCase();
|
|
707
722
|
return f.every((Z) => W.includes(Z));
|
|
708
|
-
}, e[4] = f, e[5] =
|
|
709
|
-
const g =
|
|
723
|
+
}, e[4] = f, e[5] = p) : p = e[5];
|
|
724
|
+
const g = p;
|
|
710
725
|
let h;
|
|
711
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (
|
|
712
|
-
let
|
|
713
|
-
e[7] !== i ? (
|
|
726
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (h = (_) => l(_.target.value), e[6] = h) : h = e[6];
|
|
727
|
+
let m;
|
|
728
|
+
e[7] !== i ? (m = /* @__PURE__ */ v("input", { placeholder: "Type to Filter ...", className: "state-filter", value: i, onChange: h }), e[7] = i, e[8] = m) : m = e[8];
|
|
714
729
|
let b;
|
|
715
730
|
if (e[9] !== s || e[10] !== g || e[11] !== a) {
|
|
716
|
-
let
|
|
717
|
-
e[13] !== a ? (
|
|
731
|
+
let _;
|
|
732
|
+
e[13] !== a ? (_ = (W) => /* @__PURE__ */ v(De, { selectedKey: a, setKey: r, currentKey: W }, W), e[13] = a, e[14] = _) : _ = e[14], b = s.map(Oe).filter(ke).filter(g).map(_), e[9] = s, e[10] = g, e[11] = a, e[12] = b;
|
|
718
733
|
} else
|
|
719
734
|
b = e[12];
|
|
720
735
|
let S;
|
|
721
|
-
e[15] !== i || e[16] !== b ? (S = /* @__PURE__ */ v(
|
|
722
|
-
let C;
|
|
723
|
-
e[18] !== p || e[19] !== S ? (C = /* @__PURE__ */ R("div", { className: "state-list", children: [
|
|
724
|
-
p,
|
|
725
|
-
S
|
|
726
|
-
] }), e[18] = p, e[19] = S, e[20] = C) : C = e[20];
|
|
736
|
+
e[15] !== i || e[16] !== b ? (S = /* @__PURE__ */ v(_e, { highlight: i, children: b }), e[15] = i, e[16] = b, e[17] = S) : S = e[17];
|
|
727
737
|
let E;
|
|
728
|
-
e[
|
|
738
|
+
e[18] !== m || e[19] !== S ? (E = /* @__PURE__ */ R("div", { className: "state-list", children: [
|
|
739
|
+
m,
|
|
740
|
+
S
|
|
741
|
+
] }), e[18] = m, e[19] = S, e[20] = E) : E = e[20];
|
|
742
|
+
let C;
|
|
743
|
+
e[21] !== t || e[22] !== a ? (C = /* @__PURE__ */ v("div", { className: "state-view", children: /* @__PURE__ */ v(xe, { dataKey: a, Component: t }, a) }), e[21] = t, e[22] = a, e[23] = C) : C = e[23];
|
|
729
744
|
let O;
|
|
730
|
-
return e[24] !==
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
] }), e[24] =
|
|
734
|
-
},
|
|
735
|
-
const e =
|
|
745
|
+
return e[24] !== C || e[25] !== E ? (O = /* @__PURE__ */ R(U, { mode: "horizontal", className: "main-panel", children: [
|
|
746
|
+
E,
|
|
747
|
+
C
|
|
748
|
+
] }), e[24] = C, e[25] = E, e[26] = O) : O = e[26], O;
|
|
749
|
+
}, xe = (n) => {
|
|
750
|
+
const e = y.c(11), {
|
|
736
751
|
dataKey: t,
|
|
737
752
|
Component: s
|
|
738
|
-
} = n,
|
|
753
|
+
} = n, o = s === void 0 ? Q : s;
|
|
739
754
|
let i;
|
|
740
755
|
e[0] !== t ? (i = k(t), e[0] = t, e[1] = i) : i = e[1];
|
|
741
756
|
const l = i, a = l?.data;
|
|
742
|
-
let
|
|
743
|
-
e[2] !== a ? (
|
|
757
|
+
let r;
|
|
758
|
+
e[2] !== a ? (r = {
|
|
744
759
|
...a
|
|
745
|
-
}, e[2] = a, e[3] =
|
|
746
|
-
const [u, c] = N(
|
|
760
|
+
}, e[2] = a, e[3] = r) : r = e[3];
|
|
761
|
+
const [u, c] = N(r);
|
|
747
762
|
let d, f;
|
|
748
763
|
e[4] !== l ? (d = () => {
|
|
749
764
|
const g = H(c, 5);
|
|
750
|
-
return l.subscribeAll((h,
|
|
751
|
-
...
|
|
765
|
+
return l.subscribeAll((h, m) => g({
|
|
766
|
+
...m
|
|
752
767
|
}));
|
|
753
768
|
}, f = [l], e[4] = l, e[5] = d, e[6] = f) : (d = e[5], f = e[6]), w(d, f);
|
|
754
|
-
let
|
|
755
|
-
return e[7] !==
|
|
769
|
+
let p;
|
|
770
|
+
return e[7] !== o || e[8] !== u || e[9] !== t ? (p = /* @__PURE__ */ v(o, { value: u, name: t }), e[7] = o, e[8] = u, e[9] = t, e[10] = p) : p = e[10], p;
|
|
756
771
|
};
|
|
757
|
-
function
|
|
772
|
+
function $e() {
|
|
758
773
|
return [...L.keys()];
|
|
759
774
|
}
|
|
760
|
-
function
|
|
775
|
+
function He(n) {
|
|
761
776
|
return n.length != L.size ? [...L.keys()] : n;
|
|
762
777
|
}
|
|
763
|
-
function
|
|
778
|
+
function Oe(n) {
|
|
764
779
|
return JSON.parse(n)?.[0];
|
|
765
780
|
}
|
|
766
|
-
function
|
|
781
|
+
function ke(n) {
|
|
767
782
|
return n != "auto-ctx" && n;
|
|
768
783
|
}
|
|
769
|
-
const
|
|
770
|
-
const e =
|
|
771
|
-
let t, s,
|
|
784
|
+
const Ve = (n) => {
|
|
785
|
+
const e = y.c(29);
|
|
786
|
+
let t, s, o;
|
|
772
787
|
e[0] !== n ? ({
|
|
773
788
|
toggleButton: s,
|
|
774
|
-
Component:
|
|
789
|
+
Component: o,
|
|
775
790
|
...t
|
|
776
|
-
} = n, e[0] = n, e[1] = t, e[2] = s, e[3] =
|
|
777
|
-
const i =
|
|
778
|
-
let
|
|
779
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
791
|
+
} = n, e[0] = n, e[1] = t, e[2] = s, e[3] = o) : (t = e[1], s = e[2], o = e[3]);
|
|
792
|
+
const i = o === void 0 ? Q : o, [l, a] = N(!1);
|
|
793
|
+
let r;
|
|
794
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (r = () => a(!0), e[4] = r) : r = e[4];
|
|
780
795
|
const u = t?.children ?? "Toggle Dev Tool";
|
|
781
796
|
let c;
|
|
782
|
-
e[5] !== l || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ v("button", { className: "react-state-dev-btn", "data-active": l, onClick:
|
|
797
|
+
e[5] !== l || e[6] !== t || e[7] !== u ? (c = /* @__PURE__ */ v("button", { className: "react-state-dev-btn", "data-active": l, onClick: r, ...t, children: u }), e[5] = l, e[6] = t, e[7] = u, e[8] = c) : c = e[8];
|
|
783
798
|
let d;
|
|
784
799
|
e[9] === Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
785
800
|
height: "100%"
|
|
786
801
|
}, e[9] = d) : d = e[9];
|
|
787
802
|
const f = l ? "66.66%" : "100%";
|
|
788
|
-
let
|
|
789
|
-
e[10] !== f ? (
|
|
803
|
+
let p;
|
|
804
|
+
e[10] !== f ? (p = /* @__PURE__ */ v("div", { style: {
|
|
790
805
|
height: f
|
|
791
|
-
} }), e[10] = f, e[11] =
|
|
806
|
+
} }), e[10] = f, e[11] = p) : p = e[11];
|
|
792
807
|
const g = l ? "33.33%" : "0";
|
|
793
808
|
let h;
|
|
794
809
|
e[12] !== g ? (h = {
|
|
@@ -796,41 +811,43 @@ const Be = (n) => {
|
|
|
796
811
|
backgroundColor: "var(--rs-bg-color)",
|
|
797
812
|
position: "relative"
|
|
798
813
|
}, e[12] = g, e[13] = h) : h = e[13];
|
|
799
|
-
let
|
|
800
|
-
e[14] !== l ? (
|
|
814
|
+
let m;
|
|
815
|
+
e[14] !== l ? (m = l && /* @__PURE__ */ v("button", { className: "close-btn", onClick: () => a(!1), children: "[x]" }), e[14] = l, e[15] = m) : m = e[15];
|
|
801
816
|
let b;
|
|
802
|
-
e[16] !== i || e[17] !== l ? (b = l && /* @__PURE__ */ v(
|
|
817
|
+
e[16] !== i || e[17] !== l ? (b = l && /* @__PURE__ */ v(ze, { Component: i }), e[16] = i, e[17] = l, e[18] = b) : b = e[18];
|
|
803
818
|
let S;
|
|
804
|
-
e[19] !== h || e[20] !==
|
|
805
|
-
p,
|
|
806
|
-
b
|
|
807
|
-
] }), e[19] = h, e[20] = p, e[21] = b, e[22] = S) : S = e[22];
|
|
808
|
-
let C;
|
|
809
|
-
e[23] !== S || e[24] !== m ? (C = /* @__PURE__ */ v("div", { className: "react-state-dev-container", children: /* @__PURE__ */ R(U, { mode: "vertical", style: d, children: [
|
|
819
|
+
e[19] !== h || e[20] !== m || e[21] !== b ? (S = /* @__PURE__ */ R("div", { className: "react-state-dev-panel", style: h, children: [
|
|
810
820
|
m,
|
|
811
|
-
|
|
812
|
-
] })
|
|
821
|
+
b
|
|
822
|
+
] }), e[19] = h, e[20] = m, e[21] = b, e[22] = S) : S = e[22];
|
|
813
823
|
let E;
|
|
814
|
-
|
|
824
|
+
e[23] !== S || e[24] !== p ? (E = /* @__PURE__ */ v("div", { className: "react-state-dev-container", children: /* @__PURE__ */ R(U, { mode: "vertical", style: d, children: [
|
|
825
|
+
p,
|
|
826
|
+
S
|
|
827
|
+
] }) }), e[23] = S, e[24] = p, e[25] = E) : E = e[25];
|
|
828
|
+
let C;
|
|
829
|
+
return e[26] !== E || e[27] !== c ? (C = /* @__PURE__ */ R($, { children: [
|
|
815
830
|
c,
|
|
816
|
-
|
|
817
|
-
] }), e[26] =
|
|
831
|
+
E
|
|
832
|
+
] }), e[26] = E, e[27] = c, e[28] = C) : C = e[28], C;
|
|
818
833
|
};
|
|
819
834
|
export {
|
|
820
|
-
|
|
835
|
+
Ue as AutoRootCtx,
|
|
821
836
|
ce as Context,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
837
|
+
Ve as DevToolContainer,
|
|
838
|
+
Se as createAutoCtx,
|
|
839
|
+
me as createRootCtx,
|
|
840
|
+
Be as createStore,
|
|
825
841
|
k as getContext,
|
|
842
|
+
J as paramsToId,
|
|
826
843
|
ae as useArrayChangeId,
|
|
827
844
|
z as useDataContext,
|
|
828
|
-
|
|
845
|
+
Le as useDataSource,
|
|
829
846
|
q as useDataSourceMultiple,
|
|
830
847
|
ue as useDataSubscribe,
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
848
|
+
Ke as useDataSubscribeMultiple,
|
|
849
|
+
Me as useDataSubscribeMultipleWithDebounce,
|
|
850
|
+
Ae as useDataSubscribeWithTransform,
|
|
851
|
+
ge as useQuickSubscribe
|
|
835
852
|
};
|
|
836
853
|
//# sourceMappingURL=index.es.js.map
|