react-easy-loading 0.3.1 → 0.3.2

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/main.esm.js CHANGED
@@ -1,46 +1,54 @@
1
1
  /*!
2
- * react-easy-loading v0.3.1
2
+ * react-easy-loading v0.3.2
3
3
  * (c) Hichem Taboukouyout
4
4
  * Released under the MIT License.
5
5
  * Github: github.com/HichemTab-tech/react-easy-loading
6
6
  */
7
7
 
8
- import { jsx as p, jsxs as $, Fragment as w } from "react/jsx-runtime";
9
- import { createContext as F, useEffect as O, useRef as j, useMemo as D, useSyncExternalStore as W, useContext as z } from "react";
10
- const k = {}, C = {}, ne = (a, e) => {
11
- k[a] = e;
12
- }, ie = (a, e) => {
13
- C[a] = e;
8
+ import { jsx as p, jsxs as I, Fragment as S } from "react/jsx-runtime";
9
+ import { createContext as B, useEffect as C, useRef as k, useMemo as A, useSyncExternalStore as W, useContext as z } from "react";
10
+ const V = {}, j = {}, ae = (a, e) => {
11
+ V[a] = e;
12
+ }, oe = (a, e) => {
13
+ j[a] = e;
14
14
  };
15
- let V = /* @__PURE__ */ p("div", { children: "Loading..." }), R = (a, e) => /* @__PURE__ */ $("div", { children: [
15
+ let R = /* @__PURE__ */ p("div", { children: "Loading..." }), M = (a, e) => /* @__PURE__ */ I("div", { children: [
16
16
  /* @__PURE__ */ p("h3", { children: "Errors:" }),
17
17
  /* @__PURE__ */ p("ul", { children: a?.map((s, i) => /* @__PURE__ */ p("li", { children: s }, i)) }),
18
18
  /* @__PURE__ */ p("button", { onClick: e, disabled: !e, children: "Retry" })
19
19
  ] });
20
- const ae = (a) => {
21
- V = a;
22
- }, oe = (a) => {
20
+ const ue = (a) => {
23
21
  R = a;
24
- }, I = () => V, K = () => R, P = (a, e) => M(I, k, a, e);
25
- function B(a, e) {
26
- return M(K, C, a, e);
22
+ }, ce = (a) => {
23
+ M = a;
24
+ }, N = () => R, T = () => M, P = (a, e) => $(N, V, a, e);
25
+ function F(a, e) {
26
+ return $(T, j, a, e);
27
27
  }
28
- function M(a, e, s, i) {
28
+ function $(a, e, s, i) {
29
29
  return i ? typeof i == "string" ? e[i] ?? i : i : i === null ? null : s ? typeof s == "string" ? e[s] ?? s : s : a();
30
30
  }
31
- function L(a, ...e) {
31
+ function b(a, ...e) {
32
32
  return typeof a == "function" ? a(...e) : a;
33
33
  }
34
- const U = (...a) => {
35
- }, b = (a) => {
34
+ const K = (...a) => {
35
+ }, D = (a) => {
36
36
  if (!a) throw new Error("Value is empty");
37
37
  return a;
38
- }, q = () => Math.random().toString(36).substring(2, 15), N = F(void 0), T = () => z(N), A = [];
38
+ }, U = () => Math.random().toString(36).substring(2, 15), q = B(void 0), G = () => z(q), _ = [], w = /* @__PURE__ */ Symbol.for("react-shared-states.manager");
39
+ function H(a, e = () => null) {
40
+ const s = globalThis;
41
+ return s[w] || (s[w] = {}), s[w][a] || (s[w][a] = new d(e)), s[w][a];
42
+ }
39
43
  class d {
40
44
  constructor(e = () => null) {
41
45
  this.defaultValue = e;
42
46
  }
43
47
  data = /* @__PURE__ */ new Map();
48
+ static INSTANCES = /* @__PURE__ */ new Map();
49
+ static getInstance(e, s = () => null) {
50
+ return H(e, s);
51
+ }
44
52
  addListener(e, s, i) {
45
53
  const r = d.prefix(e, s), t = this.data.get(r);
46
54
  t && t.listeners.push(i);
@@ -63,11 +71,11 @@ class d {
63
71
  }
64
72
  createStatic(e, s, i) {
65
73
  const r = i ?? "_global", t = {
66
- key: q(),
74
+ key: U(),
67
75
  prefix: r,
68
76
  ...e
69
77
  };
70
- return A.push(t), this.init(t.key, t.prefix, s, !0), this.defaultValue = () => s, t;
78
+ return _.push(t), this.init(t.key, t.prefix, s, !0), this.defaultValue = () => s, t;
71
79
  }
72
80
  initStatic(e) {
73
81
  const { key: s, prefix: i } = e;
@@ -84,7 +92,7 @@ class d {
84
92
  i || this.callListeners(e, s);
85
93
  const o = this.data.get(t);
86
94
  if (o && (this.data.delete(t), o.isStatic && !r)) {
87
- const u = A.find((n) => n.key === e && n.prefix === s);
95
+ const u = _.find((n) => n.key === e && n.prefix === s);
88
96
  u && this.initStatic(u);
89
97
  }
90
98
  }
@@ -109,14 +117,14 @@ class d {
109
117
  return [s[0], s.slice(1).join("//")];
110
118
  }
111
119
  useEffect(e, s, i = null) {
112
- O(() => () => {
113
- i?.(), U(`[${d.prefix(e, s)}]`, "unmount effect");
120
+ C(() => () => {
121
+ i?.(), K(`[${d.prefix(e, s)}]`, "unmount effect");
114
122
  const r = this.get(e, s);
115
123
  r && r.listeners?.length === 0 && this.clear(e, s);
116
124
  }, [e, s]);
117
125
  }
118
126
  }
119
- class G {
127
+ class J {
120
128
  constructor(e) {
121
129
  this.sharedData = e;
122
130
  }
@@ -126,7 +134,7 @@ class G {
126
134
  const { key: u, prefix: n } = e;
127
135
  i = u, r = n;
128
136
  } else
129
- i = b(e);
137
+ i = D(e);
130
138
  const t = r || "_global", o = this.sharedData.get(i, t);
131
139
  return o ? { value: o.value, key: i, prefix: t } : {
132
140
  key: i,
@@ -143,7 +151,7 @@ class G {
143
151
  const { key: u, prefix: n } = e;
144
152
  r = u, t = n;
145
153
  } else
146
- r = b(e);
154
+ r = D(e);
147
155
  const o = t || "_global";
148
156
  this.sharedData.init(r, o, s), this.sharedData.setValue(r, o, s), this.sharedData.callListeners(r, o);
149
157
  }
@@ -154,9 +162,11 @@ class G {
154
162
  this.set(r.key, t, r.prefix);
155
163
  }
156
164
  }
165
+ // noinspection JSUnusedGlobalSymbols
157
166
  clearAll() {
158
167
  this.sharedData.clearAll();
159
168
  }
169
+ // noinspection JSUnusedGlobalSymbols
160
170
  clearScope(e) {
161
171
  const s = e || "_global";
162
172
  this.sharedData.data.forEach((i, r) => {
@@ -164,6 +174,7 @@ class G {
164
174
  t === s && (this.sharedData.clear(o, t), this.sharedData.callListeners(o, t));
165
175
  });
166
176
  }
177
+ // noinspection JSUnusedGlobalSymbols
167
178
  resolve(e) {
168
179
  const { key: s, prefix: i } = e;
169
180
  return this.get(s, i);
@@ -172,10 +183,12 @@ class G {
172
183
  let i, r;
173
184
  typeof e == "string" ? (i = e, r = s || "_global") : (i = e.key, r = e.prefix), this.sharedData.clear(i, r);
174
185
  }
186
+ // noinspection JSUnusedGlobalSymbols
175
187
  has(e, s = "_global") {
176
188
  const i = s || "_global";
177
189
  return !!this.sharedData.has(e, i);
178
190
  }
191
+ // noinspection JSUnusedGlobalSymbols
179
192
  getAll() {
180
193
  const e = {};
181
194
  return this.sharedData.data.forEach((s, i) => {
@@ -190,19 +203,19 @@ class G {
190
203
  };
191
204
  }
192
205
  }
193
- const H = (a) => {
194
- const e = T();
206
+ const Q = (a) => {
207
+ const e = G();
195
208
  return {
196
209
  prefix: a ?? e?.scopeName ?? "_global"
197
210
  };
198
211
  };
199
- function J(a) {
212
+ function X(a) {
200
213
  return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
201
214
  }
202
- var S, _;
203
- function Q() {
204
- if (_) return S;
205
- _ = 1;
215
+ var L, O;
216
+ function Y() {
217
+ if (O) return L;
218
+ O = 1;
206
219
  var a = typeof Element < "u", e = typeof Map == "function", s = typeof Set == "function", i = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
207
220
  function r(t, o) {
208
221
  if (t === o) return !0;
@@ -215,18 +228,18 @@ function Q() {
215
228
  if (!r(t[n], o[n])) return !1;
216
229
  return !0;
217
230
  }
218
- var f;
231
+ var l;
219
232
  if (e && t instanceof Map && o instanceof Map) {
220
233
  if (t.size !== o.size) return !1;
221
- for (f = t.entries(); !(n = f.next()).done; )
234
+ for (l = t.entries(); !(n = l.next()).done; )
222
235
  if (!o.has(n.value[0])) return !1;
223
- for (f = t.entries(); !(n = f.next()).done; )
236
+ for (l = t.entries(); !(n = l.next()).done; )
224
237
  if (!r(n.value[1], o.get(n.value[0]))) return !1;
225
238
  return !0;
226
239
  }
227
240
  if (s && t instanceof Set && o instanceof Set) {
228
241
  if (t.size !== o.size) return !1;
229
- for (f = t.entries(); !(n = f.next()).done; )
242
+ for (l = t.entries(); !(n = l.next()).done; )
230
243
  if (!o.has(n.value[0])) return !1;
231
244
  return !0;
232
245
  }
@@ -250,7 +263,7 @@ function Q() {
250
263
  }
251
264
  return t !== t && o !== o;
252
265
  }
253
- return S = function(t, o) {
266
+ return L = function(t, o) {
254
267
  try {
255
268
  return r(t, o);
256
269
  } catch (u) {
@@ -258,47 +271,49 @@ function Q() {
258
271
  return console.warn("react-fast-compare cannot handle circular refs"), !1;
259
272
  throw u;
260
273
  }
261
- }, S;
274
+ }, L;
262
275
  }
263
- var X = Q();
264
- const Y = /* @__PURE__ */ J(X), x = new d(), h = new G(x), Z = (a, e) => x.createStatic({ initialValue: a }, a, e);
276
+ var Z = Y();
277
+ const ee = /* @__PURE__ */ X(Z), x = d.getInstance("sharedStatesManager"), h = new J(x), te = (a, e) => x.createStatic({ initialValue: a }, a, e);
265
278
  function E(a, e, s) {
266
279
  let i, r = s;
267
280
  if (typeof a != "string") {
268
- const { key: f, prefix: l } = a;
269
- i = f, r = l;
281
+ const { key: l, prefix: f } = a;
282
+ i = l, r = f;
270
283
  } else
271
- i = b(a);
272
- const { prefix: t } = H(r), o = j(void 0), u = D(() => (f) => (x.init(i, t, void 0), x.addListener(i, t, f), () => {
273
- x.removeListener(i, t, f);
274
- }), [i, t]), n = D(() => () => {
275
- const f = x.get(i, t)?.value, l = e(f);
276
- return Y(o.current, l) ? o.current : (o.current = l, l);
284
+ i = D(a);
285
+ const { prefix: t } = Q(r), o = k(void 0), u = A(() => (l) => (x.init(i, t, void 0), x.addListener(i, t, l), () => {
286
+ x.removeListener(i, t, l);
287
+ }), [i, t]), n = A(() => () => {
288
+ const l = x.get(i, t)?.value, f = e(l);
289
+ return ee(o.current, f) ? o.current : (o.current = f, f);
277
290
  }, [i, t, e]), c = W(u, n);
278
291
  return x.useEffect(i, t), c;
279
292
  }
280
- const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
293
+ d.getInstance("SharedFunctionValue");
294
+ d.getInstance("SharedSubscription");
295
+ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, re = ({
281
296
  initialState: a = "loading",
282
297
  defaultFallback: e,
283
298
  defaultErrorFallback: s,
284
299
  defaultRetry: i
285
300
  } = {}) => {
286
- const r = Z({
301
+ const r = te({
287
302
  state: a,
288
303
  retry: i
289
304
  }), t = (n) => {
290
305
  let c = u.get();
291
- return new Promise((f, l) => {
306
+ return new Promise((l, f) => {
292
307
  if (m(u.get(), n)) {
293
- f();
308
+ l();
294
309
  return;
295
310
  }
296
311
  const g = h.subscribe(r, () => {
297
- m(u.get(), n) ? (g(), f()) : c !== u.get() && l();
312
+ m(u.get(), n) ? (g(), l()) : c !== u.get() && f();
298
313
  });
299
314
  });
300
315
  }, o = function(n, c = () => []) {
301
- return (f) => E(r, (g) => m(g.state, n)) ? /* @__PURE__ */ p(w, { children: L(f.children, ...c()) }) : null;
316
+ return (l) => E(r, (g) => m(g.state, n)) ? /* @__PURE__ */ p(S, { children: b(l.children, ...c()) }) : null;
302
317
  }, u = {
303
318
  //hooks
304
319
  use: () => E(r, (n) => n.state),
@@ -346,11 +361,11 @@ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
346
361
  whenFinished: () => t(["success", "error"]),
347
362
  // wrap a promise
348
363
  wrap(n) {
349
- const c = () => new Promise((f, l) => {
364
+ const c = () => new Promise((l, f) => {
350
365
  u.clearErrors(), u.set("loading"), n().then((g) => {
351
- u.set("success"), f(g);
366
+ u.set("success"), l(g);
352
367
  }).catch((g) => {
353
- u.set("error"), g && u.setErrors([g]), l(g);
368
+ u.set("error"), g && u.setErrors([g]), f(g);
354
369
  });
355
370
  });
356
371
  return u.setRetry(c), c();
@@ -360,11 +375,11 @@ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
360
375
  thens: [],
361
376
  catchs: [],
362
377
  finallies: []
363
- }, f = {
364
- then: (...l) => (c.thens.push(l), f),
365
- catch_: (...l) => (c.catchs.push(l), f),
366
- finally_: (...l) => (c.finallies.push(l), f),
367
- start: () => new Promise((l, g) => {
378
+ }, l = {
379
+ then: (...f) => (c.thens.push(f), l),
380
+ catch_: (...f) => (c.catchs.push(f), l),
381
+ finally_: (...f) => (c.finallies.push(f), l),
382
+ start: () => new Promise((f, g) => {
368
383
  u.clearErrors(), u.set("loading");
369
384
  let v = n();
370
385
  v.then(() => {
@@ -378,23 +393,23 @@ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
378
393
  v.catch(...y);
379
394
  for (const y of c.finallies)
380
395
  v.finally(...y);
381
- v.then(l, g);
396
+ v.then(f, g);
382
397
  })
383
398
  };
384
- return u.setRetry(f.start), f;
399
+ return u.setRetry(l.start), l;
385
400
  },
386
401
  // components
387
402
  // - show when
388
- ShowWhenLoaded: ({ children: n, fallback: c, errorFallback: f }) => {
389
- const l = E(r, (g) => g.state);
390
- return l === "idle" ? null : (c = P(e, c), f = B(s, f === !0 ? void 0 : f), l === "loading" ? /* @__PURE__ */ p(w, { children: c }) : l === "error" ? /* @__PURE__ */ p(w, { children: L(f, u.getErrors() ?? [], () => u.retry()) }) : /* @__PURE__ */ p(w, { children: n }));
403
+ ShowWhenLoaded: ({ children: n, fallback: c, errorFallback: l }) => {
404
+ const f = E(r, (g) => g.state);
405
+ return f === "idle" ? null : (c = P(e, c), l = F(s, l === !0 ? void 0 : l), f === "loading" ? /* @__PURE__ */ p(S, { children: c }) : f === "error" ? /* @__PURE__ */ p(S, { children: b(l, u.getErrors() ?? [], () => u.retry()) }) : /* @__PURE__ */ p(S, { children: n }));
391
406
  },
392
407
  ShowWhileLoading: o("loading"),
393
408
  ShowWhenError: o("error", () => [u.getErrors() ?? [], () => u.retry()]),
394
409
  ShowWhenFinish: o(["error", "success"], () => [u.getErrors(), () => u.retry()]),
395
410
  ShowWhen: ({ children: n, state: c }) => {
396
- const f = o(c);
397
- return /* @__PURE__ */ p(f, { children: n });
411
+ const l = o(c);
412
+ return /* @__PURE__ */ p(l, { children: n });
398
413
  },
399
414
  destroy: () => {
400
415
  h.clear(r);
@@ -408,16 +423,16 @@ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
408
423
  __get__id: () => `loading_id//${r.prefix}/${r.key}`
409
424
  };
410
425
  return u;
411
- }, te = (a) => ee(typeof a == "string" ? {
426
+ }, se = (a) => re(typeof a == "string" ? {
412
427
  initialState: a
413
- } : a), ue = (a = {}) => {
414
- const e = j(void 0);
415
- return e.current || (e.current = te(a)), O(() => () => {
428
+ } : a), le = (a = {}) => {
429
+ const e = k(void 0);
430
+ return e.current || (e.current = se(a)), C(() => () => {
416
431
  e.current.destroy(), e.current = void 0;
417
432
  }, []), e.current;
418
- }, ce = ({ of: a, fallback: e, errorFallback: s, children: i }) => {
433
+ }, fe = ({ of: a, fallback: e, errorFallback: s, children: i }) => {
419
434
  const r = a.map((t) => t.use());
420
- return e = P(void 0, e), r.some((t) => t === "loading") ? e : r.every((t) => t !== "loading") ? r.some((t) => t === "error") ? (s = B(void 0, s), /* @__PURE__ */ p(w, { children: L(
435
+ return e = P(void 0, e), r.some((t) => t === "loading") ? e : r.every((t) => t !== "loading") ? r.some((t) => t === "error") ? (s = F(void 0, s), /* @__PURE__ */ p(S, { children: b(
421
436
  s,
422
437
  a.reduce((t, o) => [...t, ...o.getErrors() ?? []], []),
423
438
  () => {
@@ -425,21 +440,21 @@ const m = (a, e) => Array.isArray(e) && e.includes(a) || a === e, ee = ({
425
440
  t.isError() && t.retry();
426
441
  });
427
442
  }
428
- ) })) : /* @__PURE__ */ p(w, { children: i }) : null;
443
+ ) })) : /* @__PURE__ */ p(S, { children: i }) : null;
429
444
  };
430
445
  export {
431
- ce as AllLoaded,
432
- ee as createLoading,
433
- C as errorFallbacks,
434
- k as fallbacks,
435
- K as getDefaultErrorFallback,
436
- I as getDefaultFallback,
437
- L as reactNodeOrFunctionValue,
438
- oe as registerDefaultErrorFallback,
439
- ae as registerDefaultFallback,
440
- ie as registerErrorFallback,
441
- ne as registerFallback,
442
- B as resolveErrorFallback,
446
+ fe as AllLoaded,
447
+ re as createLoading,
448
+ j as errorFallbacks,
449
+ V as fallbacks,
450
+ T as getDefaultErrorFallback,
451
+ N as getDefaultFallback,
452
+ b as reactNodeOrFunctionValue,
453
+ ce as registerDefaultErrorFallback,
454
+ ue as registerDefaultFallback,
455
+ oe as registerErrorFallback,
456
+ ae as registerFallback,
457
+ F as resolveErrorFallback,
443
458
  P as resolveLoadingFallback,
444
- ue as useCreateLocalLoading
459
+ le as useCreateLocalLoading
445
460
  };
package/dist/main.min.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * react-easy-loading v0.3.1
2
+ * react-easy-loading v0.3.2
3
3
  * (c) Hichem Taboukouyout
4
4
  * Released under the MIT License.
5
5
  * Github: github.com/HichemTab-tech/react-easy-loading
6
6
  */
7
7
 
8
- (function(d,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],u):(d=typeof globalThis<"u"?globalThis:d||self,u(d.ReactEasyLoading={},d.jsxRuntime,d.React))})(this,(function(d,u,v){"use strict";const D={},k={},W=(a,e)=>{D[a]=e},T=(a,e)=>{k[a]=e};let O=u.jsx("div",{children:"Loading..."}),C=(a,e)=>u.jsxs("div",{children:[u.jsx("h3",{children:"Errors:"}),u.jsx("ul",{children:a?.map((s,i)=>u.jsx("li",{children:s},i))}),u.jsx("button",{onClick:e,disabled:!e,children:"Retry"})]});const q=a=>{O=a},z=a=>{C=a},V=()=>O,j=()=>C,F=(a,e)=>P(V,D,a,e);function A(a,e){return P(j,k,a,e)}function P(a,e,s,i){return i?typeof i=="string"?e[i]??i:i:i===null?null:s?typeof s=="string"?e[s]??s:s:a()}function w(a,...e){return typeof a=="function"?a(...e):a}const I=(...a)=>{},_=a=>{if(!a)throw new Error("Value is empty");return a},K=()=>Math.random().toString(36).substring(2,15),N=v.createContext(void 0),U=()=>v.useContext(N),M=[];class y{constructor(e=()=>null){this.defaultValue=e}data=new Map;addListener(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&t.listeners.push(i)}removeListener(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&(t.listeners=t.listeners.filter(o=>o!==i))}callListeners(e,s){const i=y.prefix(e,s),r=this.data.get(i);r&&r.listeners.forEach(t=>t())}init(e,s,i,r=!1){const t=y.prefix(e,s);this.data.has(t)||this.data.set(t,{value:i,isStatic:r||void 0,listeners:[]})}createStatic(e,s,i){const r=i??"_global",t={key:K(),prefix:r,...e};return M.push(t),this.init(t.key,t.prefix,s,!0),this.defaultValue=()=>s,t}initStatic(e){const{key:s,prefix:i}=e;this.init(s,i,this.defaultValue(),!0)}clearAll(e=!1,s=!1){this.data.forEach((i,r)=>{const[t,o]=y.extractPrefix(r);this.clear(o,t,e,s)})}clear(e,s,i=!1,r=!1){const t=y.prefix(e,s);i||this.callListeners(e,s);const o=this.data.get(t);if(o&&(this.data.delete(t),o.isStatic&&!r)){const l=M.find(n=>n.key===e&&n.prefix===s);l&&this.initStatic(l)}}get(e,s){let i=this.has(e,s);if(i)return this.data.get(i)}setValue(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&(t.value=i,this.data.set(r,t))}has(e,s){return this.data.has(y.prefix(e,s))?y.prefix(e,s):this.data.has(y.prefix(e,"_global"))?y.prefix(e,"_global"):void 0}static prefix(e,s){if(e.includes("//"))throw new Error("key cannot contain '//'");return`${s}//${e}`}static extractPrefix(e){const s=e.split("//");return[s[0],s.slice(1).join("//")]}useEffect(e,s,i=null){v.useEffect(()=>()=>{i?.(),I(`[${y.prefix(e,s)}]`,"unmount effect");const r=this.get(e,s);r&&r.listeners?.length===0&&this.clear(e,s)},[e,s])}}class G{constructor(e){this.sharedData=e}_get(e,s){let i,r=s;if(typeof e!="string"){const{key:l,prefix:n}=e;i=l,r=n}else i=_(e);const t=r||"_global",o=this.sharedData.get(i,t);return o?{value:o.value,key:i,prefix:t}:{key:i,prefix:t,value:void 0}}get(e,s){return this._get(e,s).value}set(e,s,i){let r,t=i;if(typeof e!="string"){const{key:l,prefix:n}=e;r=l,t=n}else r=_(e);const o=t||"_global";this.sharedData.init(r,o,s),this.sharedData.setValue(r,o,s),this.sharedData.callListeners(r,o)}update(e,s,i){const r=this._get(e,i);if(r){const t=s(r.value);this.set(r.key,t,r.prefix)}}clearAll(){this.sharedData.clearAll()}clearScope(e){const s=e||"_global";this.sharedData.data.forEach((i,r)=>{const[t,o]=y.extractPrefix(r);t===s&&(this.sharedData.clear(o,t),this.sharedData.callListeners(o,t))})}resolve(e){const{key:s,prefix:i}=e;return this.get(s,i)}clear(e,s){let i,r;typeof e=="string"?(i=e,r=s||"_global"):(i=e.key,r=e.prefix),this.sharedData.clear(i,r)}has(e,s="_global"){const i=s||"_global";return!!this.sharedData.has(e,i)}getAll(){const e={};return this.sharedData.data.forEach((s,i)=>{const[r,t]=y.extractPrefix(i);e[r]=e[r]||{},e[r][t]=s.value}),e}subscribe(e,s,i){let r,t;return typeof e=="string"?(r=e,t=i||"_global"):(r=e.key,t=e.prefix),this.sharedData.addListener(r,t,s),()=>{this.sharedData.removeListener(r,t,s)}}}const H=a=>{const e=U();return{prefix:a??e?.scopeName??"_global"}};function J(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var m,B;function Q(){if(B)return m;B=1;var a=typeof Element<"u",e=typeof Map=="function",s=typeof Set=="function",i=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function r(t,o){if(t===o)return!0;if(t&&o&&typeof t=="object"&&typeof o=="object"){if(t.constructor!==o.constructor)return!1;var l,n,c;if(Array.isArray(t)){if(l=t.length,l!=o.length)return!1;for(n=l;n--!==0;)if(!r(t[n],o[n]))return!1;return!0}var f;if(e&&t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(f=t.entries();!(n=f.next()).done;)if(!o.has(n.value[0]))return!1;for(f=t.entries();!(n=f.next()).done;)if(!r(n.value[1],o.get(n.value[0])))return!1;return!0}if(s&&t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(f=t.entries();!(n=f.next()).done;)if(!o.has(n.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(o)){if(l=t.length,l!=o.length)return!1;for(n=l;n--!==0;)if(t[n]!==o[n])return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof o.valueOf=="function")return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof o.toString=="function")return t.toString()===o.toString();if(c=Object.keys(t),l=c.length,l!==Object.keys(o).length)return!1;for(n=l;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,c[n]))return!1;if(a&&t instanceof Element)return!1;for(n=l;n--!==0;)if(!((c[n]==="_owner"||c[n]==="__v"||c[n]==="__o")&&t.$$typeof)&&!r(t[c[n]],o[c[n]]))return!1;return!0}return t!==t&&o!==o}return m=function(t,o){try{return r(t,o)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},m}var X=Q();const Y=J(X),x=new y,g=new G(x),Z=(a,e)=>x.createStatic({initialValue:a},a,e);function b(a,e,s){let i,r=s;if(typeof a!="string"){const{key:f,prefix:h}=a;i=f,r=h}else i=_(a);const{prefix:t}=H(r),o=v.useRef(void 0),l=v.useMemo(()=>f=>(x.init(i,t,void 0),x.addListener(i,t,f),()=>{x.removeListener(i,t,f)}),[i,t]),n=v.useMemo(()=>()=>{const f=x.get(i,t)?.value,h=e(f);return Y(o.current,h)?o.current:(o.current=h,h)},[i,t,e]),c=v.useSyncExternalStore(l,n);return x.useEffect(i,t),c}const S=(a,e)=>Array.isArray(e)&&e.includes(a)||a===e,$=({initialState:a="loading",defaultFallback:e,defaultErrorFallback:s,defaultRetry:i}={})=>{const r=Z({state:a,retry:i}),t=n=>{let c=l.get();return new Promise((f,h)=>{if(S(l.get(),n)){f();return}const p=g.subscribe(r,()=>{S(l.get(),n)?(p(),f()):c!==l.get()&&h()})})},o=function(n,c=()=>[]){return f=>b(r,p=>S(p.state,n))?u.jsx(u.Fragment,{children:w(f.children,...c())}):null},l={use:()=>b(r,n=>n.state),useIsLoading:()=>b(r,n=>n.state)==="loading",useErrors:()=>b(r,n=>n.errors),useContext:()=>b(r,n=>n.context),set:n=>g.update(r,c=>({...c,state:n})),retry:n=>(g.get(r).retry??n)?.(),isLoading:()=>g.get(r).state==="loading",isIdle:()=>g.get(r).state==="idle",isSuccess:()=>g.get(r).state==="success",isError:()=>g.get(r).state==="error",isFinished:()=>g.get(r).state==="success"||g.get(r).state==="error",is:n=>S(l.get(),n),hasErrors:()=>g.get(r).errors!==void 0,get:()=>g.get(r).state,getErrors:()=>g.get(r).errors,getContext:()=>g.get(r).context,reset:()=>g.set(r,{state:a}),addError:n=>{g.update(r,c=>({...c,errors:[...c.errors??[],n]}))},setContext:n=>{g.update(r,c=>({...c,context:n}))},setErrors:n=>{g.update(r,c=>({...c,errors:n}))},clearErrors:()=>{g.update(r,n=>({...n,errors:void 0}))},setRetry:n=>g.update(r,c=>({...c,retry:n})),whenLoaded:()=>t("success").catch(n=>{throw new Error("loading failed",{cause:n})}),whenFinished:()=>t(["success","error"]),wrap(n){const c=()=>new Promise((f,h)=>{l.clearErrors(),l.set("loading"),n().then(p=>{l.set("success"),f(p)}).catch(p=>{l.set("error"),p&&l.setErrors([p]),h(p)})});return l.setRetry(c),c()},wrapWithControl(n){const c={thens:[],catchs:[],finallies:[]},f={then:(...h)=>(c.thens.push(h),f),catch_:(...h)=>(c.catchs.push(h),f),finally_:(...h)=>(c.finallies.push(h),f),start:()=>new Promise((h,p)=>{l.clearErrors(),l.set("loading");let L=n();L.then(()=>{l.set("success")}),L.catch(E=>{l.set("error"),E&&l.setErrors([E])});for(const E of c.thens)L.then(...E);for(const E of c.catchs)L.catch(...E);for(const E of c.finallies)L.finally(...E);L.then(h,p)})};return l.setRetry(f.start),f},ShowWhenLoaded:({children:n,fallback:c,errorFallback:f})=>{const h=b(r,p=>p.state);return h==="idle"?null:(c=F(e,c),f=A(s,f===!0?void 0:f),h==="loading"?u.jsx(u.Fragment,{children:c}):h==="error"?u.jsx(u.Fragment,{children:w(f,l.getErrors()??[],()=>l.retry())}):u.jsx(u.Fragment,{children:n}))},ShowWhileLoading:o("loading"),ShowWhenError:o("error",()=>[l.getErrors()??[],()=>l.retry()]),ShowWhenFinish:o(["error","success"],()=>[l.getErrors(),()=>l.retry()]),ShowWhen:({children:n,state:c})=>{const f=o(c);return u.jsx(f,{children:n})},destroy:()=>{g.clear(r)},__get__id:()=>`loading_id//${r.prefix}/${r.key}`};return l},R=a=>$(typeof a=="string"?{initialState:a}:a),ee=(a={})=>{const e=v.useRef(void 0);return e.current||(e.current=R(a)),v.useEffect(()=>()=>{e.current.destroy(),e.current=void 0},[]),e.current},te=({of:a,fallback:e,errorFallback:s,children:i})=>{const r=a.map(t=>t.use());return e=F(void 0,e),r.some(t=>t==="loading")?e:r.every(t=>t!=="loading")?r.some(t=>t==="error")?(s=A(void 0,s),u.jsx(u.Fragment,{children:w(s,a.reduce((t,o)=>[...t,...o.getErrors()??[]],[]),()=>{a.map(t=>{t.isError()&&t.retry()})})})):u.jsx(u.Fragment,{children:i}):null};d.AllLoaded=te,d.createLoading=$,d.errorFallbacks=k,d.fallbacks=D,d.getDefaultErrorFallback=j,d.getDefaultFallback=V,d.reactNodeOrFunctionValue=w,d.registerDefaultErrorFallback=z,d.registerDefaultFallback=q,d.registerErrorFallback=T,d.registerFallback=W,d.resolveErrorFallback=A,d.resolveLoadingFallback=F,d.useCreateLocalLoading=ee,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
8
+ (function(d,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],f):(d=typeof globalThis<"u"?globalThis:d||self,f(d.ReactEasyLoading={},d.jsxRuntime,d.React))})(this,(function(d,f,v){"use strict";const F={},k={},B=(a,e)=>{F[a]=e},N=(a,e)=>{k[a]=e};let C=f.jsx("div",{children:"Loading..."}),V=(a,e)=>f.jsxs("div",{children:[f.jsx("h3",{children:"Errors:"}),f.jsx("ul",{children:a?.map((s,i)=>f.jsx("li",{children:s},i))}),f.jsx("button",{onClick:e,disabled:!e,children:"Retry"})]});const W=a=>{C=a},z=a=>{V=a},M=()=>C,P=()=>V,A=(a,e)=>j(M,F,a,e);function m(a,e){return j(P,k,a,e)}function j(a,e,s,i){return i?typeof i=="string"?e[i]??i:i:i===null?null:s?typeof s=="string"?e[s]??s:s:a()}function L(a,...e){return typeof a=="function"?a(...e):a}const q=(...a)=>{},_=a=>{if(!a)throw new Error("Value is empty");return a},K=()=>Math.random().toString(36).substring(2,15),U=v.createContext(void 0),G=()=>v.useContext(U),T=[],w=Symbol.for("react-shared-states.manager");function H(a,e=()=>null){const s=globalThis;return s[w]||(s[w]={}),s[w][a]||(s[w][a]=new y(e)),s[w][a]}class y{constructor(e=()=>null){this.defaultValue=e}data=new Map;static INSTANCES=new Map;static getInstance(e,s=()=>null){return H(e,s)}addListener(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&t.listeners.push(i)}removeListener(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&(t.listeners=t.listeners.filter(o=>o!==i))}callListeners(e,s){const i=y.prefix(e,s),r=this.data.get(i);r&&r.listeners.forEach(t=>t())}init(e,s,i,r=!1){const t=y.prefix(e,s);this.data.has(t)||this.data.set(t,{value:i,isStatic:r||void 0,listeners:[]})}createStatic(e,s,i){const r=i??"_global",t={key:K(),prefix:r,...e};return T.push(t),this.init(t.key,t.prefix,s,!0),this.defaultValue=()=>s,t}initStatic(e){const{key:s,prefix:i}=e;this.init(s,i,this.defaultValue(),!0)}clearAll(e=!1,s=!1){this.data.forEach((i,r)=>{const[t,o]=y.extractPrefix(r);this.clear(o,t,e,s)})}clear(e,s,i=!1,r=!1){const t=y.prefix(e,s);i||this.callListeners(e,s);const o=this.data.get(t);if(o&&(this.data.delete(t),o.isStatic&&!r)){const l=T.find(n=>n.key===e&&n.prefix===s);l&&this.initStatic(l)}}get(e,s){let i=this.has(e,s);if(i)return this.data.get(i)}setValue(e,s,i){const r=y.prefix(e,s),t=this.data.get(r);t&&(t.value=i,this.data.set(r,t))}has(e,s){return this.data.has(y.prefix(e,s))?y.prefix(e,s):this.data.has(y.prefix(e,"_global"))?y.prefix(e,"_global"):void 0}static prefix(e,s){if(e.includes("//"))throw new Error("key cannot contain '//'");return`${s}//${e}`}static extractPrefix(e){const s=e.split("//");return[s[0],s.slice(1).join("//")]}useEffect(e,s,i=null){v.useEffect(()=>()=>{i?.(),q(`[${y.prefix(e,s)}]`,"unmount effect");const r=this.get(e,s);r&&r.listeners?.length===0&&this.clear(e,s)},[e,s])}}class J{constructor(e){this.sharedData=e}_get(e,s){let i,r=s;if(typeof e!="string"){const{key:l,prefix:n}=e;i=l,r=n}else i=_(e);const t=r||"_global",o=this.sharedData.get(i,t);return o?{value:o.value,key:i,prefix:t}:{key:i,prefix:t,value:void 0}}get(e,s){return this._get(e,s).value}set(e,s,i){let r,t=i;if(typeof e!="string"){const{key:l,prefix:n}=e;r=l,t=n}else r=_(e);const o=t||"_global";this.sharedData.init(r,o,s),this.sharedData.setValue(r,o,s),this.sharedData.callListeners(r,o)}update(e,s,i){const r=this._get(e,i);if(r){const t=s(r.value);this.set(r.key,t,r.prefix)}}clearAll(){this.sharedData.clearAll()}clearScope(e){const s=e||"_global";this.sharedData.data.forEach((i,r)=>{const[t,o]=y.extractPrefix(r);t===s&&(this.sharedData.clear(o,t),this.sharedData.callListeners(o,t))})}resolve(e){const{key:s,prefix:i}=e;return this.get(s,i)}clear(e,s){let i,r;typeof e=="string"?(i=e,r=s||"_global"):(i=e.key,r=e.prefix),this.sharedData.clear(i,r)}has(e,s="_global"){const i=s||"_global";return!!this.sharedData.has(e,i)}getAll(){const e={};return this.sharedData.data.forEach((s,i)=>{const[r,t]=y.extractPrefix(i);e[r]=e[r]||{},e[r][t]=s.value}),e}subscribe(e,s,i){let r,t;return typeof e=="string"?(r=e,t=i||"_global"):(r=e.key,t=e.prefix),this.sharedData.addListener(r,t,s),()=>{this.sharedData.removeListener(r,t,s)}}}const Q=a=>{const e=G();return{prefix:a??e?.scopeName??"_global"}};function X(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var O,$;function Y(){if($)return O;$=1;var a=typeof Element<"u",e=typeof Map=="function",s=typeof Set=="function",i=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function r(t,o){if(t===o)return!0;if(t&&o&&typeof t=="object"&&typeof o=="object"){if(t.constructor!==o.constructor)return!1;var l,n,c;if(Array.isArray(t)){if(l=t.length,l!=o.length)return!1;for(n=l;n--!==0;)if(!r(t[n],o[n]))return!1;return!0}var u;if(e&&t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(u=t.entries();!(n=u.next()).done;)if(!o.has(n.value[0]))return!1;for(u=t.entries();!(n=u.next()).done;)if(!r(n.value[1],o.get(n.value[0])))return!1;return!0}if(s&&t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(u=t.entries();!(n=u.next()).done;)if(!o.has(n.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(o)){if(l=t.length,l!=o.length)return!1;for(n=l;n--!==0;)if(t[n]!==o[n])return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof o.valueOf=="function")return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof o.toString=="function")return t.toString()===o.toString();if(c=Object.keys(t),l=c.length,l!==Object.keys(o).length)return!1;for(n=l;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,c[n]))return!1;if(a&&t instanceof Element)return!1;for(n=l;n--!==0;)if(!((c[n]==="_owner"||c[n]==="__v"||c[n]==="__o")&&t.$$typeof)&&!r(t[c[n]],o[c[n]]))return!1;return!0}return t!==t&&o!==o}return O=function(t,o){try{return r(t,o)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},O}var Z=Y();const R=X(Z),S=y.getInstance("sharedStatesManager"),g=new J(S),ee=(a,e)=>S.createStatic({initialValue:a},a,e);function b(a,e,s){let i,r=s;if(typeof a!="string"){const{key:u,prefix:h}=a;i=u,r=h}else i=_(a);const{prefix:t}=Q(r),o=v.useRef(void 0),l=v.useMemo(()=>u=>(S.init(i,t,void 0),S.addListener(i,t,u),()=>{S.removeListener(i,t,u)}),[i,t]),n=v.useMemo(()=>()=>{const u=S.get(i,t)?.value,h=e(u);return R(o.current,h)?o.current:(o.current=h,h)},[i,t,e]),c=v.useSyncExternalStore(l,n);return S.useEffect(i,t),c}y.getInstance("SharedFunctionValue"),y.getInstance("SharedSubscription");const D=(a,e)=>Array.isArray(e)&&e.includes(a)||a===e,I=({initialState:a="loading",defaultFallback:e,defaultErrorFallback:s,defaultRetry:i}={})=>{const r=ee({state:a,retry:i}),t=n=>{let c=l.get();return new Promise((u,h)=>{if(D(l.get(),n)){u();return}const p=g.subscribe(r,()=>{D(l.get(),n)?(p(),u()):c!==l.get()&&h()})})},o=function(n,c=()=>[]){return u=>b(r,p=>D(p.state,n))?f.jsx(f.Fragment,{children:L(u.children,...c())}):null},l={use:()=>b(r,n=>n.state),useIsLoading:()=>b(r,n=>n.state)==="loading",useErrors:()=>b(r,n=>n.errors),useContext:()=>b(r,n=>n.context),set:n=>g.update(r,c=>({...c,state:n})),retry:n=>(g.get(r).retry??n)?.(),isLoading:()=>g.get(r).state==="loading",isIdle:()=>g.get(r).state==="idle",isSuccess:()=>g.get(r).state==="success",isError:()=>g.get(r).state==="error",isFinished:()=>g.get(r).state==="success"||g.get(r).state==="error",is:n=>D(l.get(),n),hasErrors:()=>g.get(r).errors!==void 0,get:()=>g.get(r).state,getErrors:()=>g.get(r).errors,getContext:()=>g.get(r).context,reset:()=>g.set(r,{state:a}),addError:n=>{g.update(r,c=>({...c,errors:[...c.errors??[],n]}))},setContext:n=>{g.update(r,c=>({...c,context:n}))},setErrors:n=>{g.update(r,c=>({...c,errors:n}))},clearErrors:()=>{g.update(r,n=>({...n,errors:void 0}))},setRetry:n=>g.update(r,c=>({...c,retry:n})),whenLoaded:()=>t("success").catch(n=>{throw new Error("loading failed",{cause:n})}),whenFinished:()=>t(["success","error"]),wrap(n){const c=()=>new Promise((u,h)=>{l.clearErrors(),l.set("loading"),n().then(p=>{l.set("success"),u(p)}).catch(p=>{l.set("error"),p&&l.setErrors([p]),h(p)})});return l.setRetry(c),c()},wrapWithControl(n){const c={thens:[],catchs:[],finallies:[]},u={then:(...h)=>(c.thens.push(h),u),catch_:(...h)=>(c.catchs.push(h),u),finally_:(...h)=>(c.finallies.push(h),u),start:()=>new Promise((h,p)=>{l.clearErrors(),l.set("loading");let x=n();x.then(()=>{l.set("success")}),x.catch(E=>{l.set("error"),E&&l.setErrors([E])});for(const E of c.thens)x.then(...E);for(const E of c.catchs)x.catch(...E);for(const E of c.finallies)x.finally(...E);x.then(h,p)})};return l.setRetry(u.start),u},ShowWhenLoaded:({children:n,fallback:c,errorFallback:u})=>{const h=b(r,p=>p.state);return h==="idle"?null:(c=A(e,c),u=m(s,u===!0?void 0:u),h==="loading"?f.jsx(f.Fragment,{children:c}):h==="error"?f.jsx(f.Fragment,{children:L(u,l.getErrors()??[],()=>l.retry())}):f.jsx(f.Fragment,{children:n}))},ShowWhileLoading:o("loading"),ShowWhenError:o("error",()=>[l.getErrors()??[],()=>l.retry()]),ShowWhenFinish:o(["error","success"],()=>[l.getErrors(),()=>l.retry()]),ShowWhen:({children:n,state:c})=>{const u=o(c);return f.jsx(u,{children:n})},destroy:()=>{g.clear(r)},__get__id:()=>`loading_id//${r.prefix}/${r.key}`};return l},te=a=>I(typeof a=="string"?{initialState:a}:a),re=(a={})=>{const e=v.useRef(void 0);return e.current||(e.current=te(a)),v.useEffect(()=>()=>{e.current.destroy(),e.current=void 0},[]),e.current},se=({of:a,fallback:e,errorFallback:s,children:i})=>{const r=a.map(t=>t.use());return e=A(void 0,e),r.some(t=>t==="loading")?e:r.every(t=>t!=="loading")?r.some(t=>t==="error")?(s=m(void 0,s),f.jsx(f.Fragment,{children:L(s,a.reduce((t,o)=>[...t,...o.getErrors()??[]],[]),()=>{a.map(t=>{t.isError()&&t.retry()})})})):f.jsx(f.Fragment,{children:i}):null};d.AllLoaded=se,d.createLoading=I,d.errorFallbacks=k,d.fallbacks=F,d.getDefaultErrorFallback=P,d.getDefaultFallback=M,d.reactNodeOrFunctionValue=L,d.registerDefaultErrorFallback=z,d.registerDefaultFallback=W,d.registerErrorFallback=N,d.registerFallback=B,d.resolveErrorFallback=m,d.resolveLoadingFallback=A,d.useCreateLocalLoading=re,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-easy-loading",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "keywords": [
@@ -33,27 +33,27 @@
33
33
  },
34
34
  "homepage": "https://github.com/HichemTab-tech/react-easy-loading#readme",
35
35
  "devDependencies": {
36
- "@tailwindcss/vite": "^4.1.14",
36
+ "@tailwindcss/vite": "^4.1.18",
37
37
  "@testing-library/dom": "^10.4.1",
38
- "@testing-library/react": "^16.3.0",
39
- "@types/node": "^25.0.2",
40
- "@types/react": "^19.2.0",
41
- "@types/react-dom": "^19.2.0",
42
- "@vitejs/plugin-react": "^5.0.4",
38
+ "@testing-library/react": "^16.3.1",
39
+ "@types/node": "^25.0.3",
40
+ "@types/react": "^19.2.7",
41
+ "@types/react-dom": "^19.2.3",
42
+ "@vitejs/plugin-react": "^5.1.2",
43
43
  "classnames": "^2.5.1",
44
- "jsdom": "^27.0.0",
45
- "react": "^19.2.0",
46
- "react-dom": "^19.2.0",
44
+ "jsdom": "^27.4.0",
45
+ "react": "^19.2.3",
46
+ "react-dom": "^19.2.3",
47
47
  "react-exposed-states": "^1.0.5",
48
- "react-shared-states": "^2.1.0",
49
- "tailwindcss": "^4.1.14",
48
+ "react-shared-states": "^2.1.2",
49
+ "tailwindcss": "^4.1.18",
50
50
  "typescript": "^5.9.3",
51
- "use-effect-skip-first": "^0.1.2",
52
- "vite": "^7.1.9",
51
+ "use-effect-skip-first": "^0.1.3",
52
+ "vite": "^7.3.0",
53
53
  "vite-plugin-banner": "^0.8.1",
54
54
  "vite-plugin-css-injected-by-js": "^3.5.2",
55
55
  "vite-plugin-dts": "^4.5.4",
56
- "vitest": "^4.0.15"
56
+ "vitest": "^4.0.16"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "vite build",