@ptolemy2002/react-proxy-context 2.1.2 → 2.2.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.md CHANGED
@@ -22,7 +22,7 @@ type OnChangeReinitCallback<T> =
22
22
 
23
23
  type Dependency<T> = keyof T | (
24
24
  <K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean
25
- ) | null | undefined | false;
25
+ ) | null | undefined | false | [keyof T, ...PropertyKey[]]
26
26
 
27
27
  type ProxyContext<T> = ContextWithName<ProxyContextValue<T> | undefined>;
28
28
 
@@ -54,9 +54,19 @@ type UseProxyContextResult<T> = HookResultData<{
54
54
  ## Functions
55
55
  The following functions are available in the library:
56
56
 
57
+ ### evaluateDependency<T>
58
+ #### Description
59
+ Given a dependency, if it is an array instance, converts it to the equivalent function that will test for equality of a nested property. If it is not an array instance, returns the dependency as is.
60
+
61
+ #### Parameters
62
+ - `dependency` (`Dependency<T>`): The dependency to evaluate.
63
+
64
+ #### Returns
65
+ `Dependency<T>` - The evaluated dependency. If the dependency is an array, it will be converted to a function that tests for equality of a nested property.
66
+
57
67
  ### createProxyContext<T>
58
68
  #### Description
59
- Creates a new instance of the ProxyContext, essentially to be used as the context type, with the specified name. This is effectively just the normal React createContext function, but with a check to ensure that the browser supports Proxies. `T` represents the type of the object that will be stored in the context.
69
+ Creates a new instance of the ProxyContext, essentially to be used as the context type, with the specified name. This is effectively just the normal React `createContext` function, but with a check to ensure that the browser supports Proxies. `T` represents the type of the object that will be stored in the context.
60
70
 
61
71
  #### Parameters
62
72
  - `name` (String): The name of the context. This is used for debugging purposes.
@@ -88,7 +98,7 @@ A hook that uses the context provided by the `ProxyContextProvider` component. T
88
98
 
89
99
  #### Parameters
90
100
  - `contextClass` (`ProxyContext<T>`): The context class that was created using `createProxyContext`.
91
- - `deps` (`Dependency<T>[] | null`): An array of dependencies to listen to. If any of these properties on the context change, the hook will re-render. If this is falsy, any mutation will trigger a re-render. You can also specify a function that returns a boolean to determine whether to re-render. If this is null, the hook will re-render on any mutation. By default, this is an empty array.
101
+ - `deps` (`Dependency<T>[] | null`): An array of dependencies to listen to. If any of these properties on the context change, the hook will re-render. If this is falsy, any mutation will trigger a re-render. If a dependency is an array, it represents a nested property dependency. You can also specify a function that returns a boolean to determine whether to re-render. By default, this is an empty array.
92
102
  - `onChangeProp` (`OnChangePropCallback<T> | undefined`): A function that is called whenever a property of the context is changed. The first parameter is the property that was changed, the second parameter is the current value of the property, and the third parameter is the previous value of the property. This is useful for listening to changes in the provider's parent component.
93
103
  - `onChangeReinit` (`OnChangeReinitCallback<T> | undefined`): A function that is called whenever the context is reinitialized. The first parameter is the current value of the context, and the second parameter is the previous value of the context. This is useful for listening to changes in the provider's parent component.
94
104
  - `listenReinit` (`boolean`): Whether to listen to full reassignments of the context. If this is true, the hook will re-render whenever the context is reinitialized. By default, this is true.
package/dist/main.d.ts CHANGED
@@ -12,7 +12,8 @@ export type ProxyContextValue<T> = {
12
12
  unsubscribe: (id: string) => void;
13
13
  };
14
14
  export declare function createProxyContext<T>(name: string): ProxyContext<T>;
15
- export type Dependency<T> = keyof T | (<K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean) | null | undefined | false;
15
+ export type Dependency<T> = keyof T | (<K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean) | null | undefined | false | [keyof T, ...PropertyKey[]];
16
+ export declare function evaluateDependency<T>(dep: Dependency<T>): Exclude<Dependency<T>, any[]> | keyof T;
16
17
  export type ProxyContext<T> = ContextWithName<ProxyContextValue<T> | undefined>;
17
18
  export type ProxyContextProviderProps<T> = {
18
19
  children: ReactNode;
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
- import Ie, { useEffect as $e, createContext as br, useRef as X, useImperativeHandle as yr, useCallback as ue, useContext as mr } from "react";
1
+ import $e, { useEffect as We, createContext as br, useRef as Z, useImperativeHandle as yr, useCallback as se, useContext as mr } from "react";
2
2
  import { nanoid as Rr } from "nanoid";
3
- import V from "is-callable";
4
- import We from "@ptolemy2002/react-force-rerender";
3
+ import Y from "is-callable";
4
+ import Ye from "@ptolemy2002/react-force-rerender";
5
5
  import gr from "@ptolemy2002/react-hook-result";
6
6
  import { partialMemo as hr } from "@ptolemy2002/react-utils";
7
- var se = { exports: {} }, B = {};
7
+ var ce = { exports: {} }, N = {};
8
8
  /**
9
9
  * @license React
10
10
  * react-jsx-runtime.production.min.js
@@ -16,19 +16,19 @@ var se = { exports: {} }, B = {};
16
16
  */
17
17
  var Fe;
18
18
  function Er() {
19
- if (Fe) return B;
19
+ if (Fe) return N;
20
20
  Fe = 1;
21
- var b = Ie, _ = Symbol.for("react.element"), k = Symbol.for("react.fragment"), T = Object.prototype.hasOwnProperty, C = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
22
- function S(y, o, d) {
23
- var v, P = {}, w = null, D = null;
24
- d !== void 0 && (w = "" + d), o.key !== void 0 && (w = "" + o.key), o.ref !== void 0 && (D = o.ref);
25
- for (v in o) T.call(o, v) && !p.hasOwnProperty(v) && (P[v] = o[v]);
26
- if (y && y.defaultProps) for (v in o = y.defaultProps, o) P[v] === void 0 && (P[v] = o[v]);
27
- return { $$typeof: _, type: y, key: w, ref: D, props: P, _owner: C.current };
21
+ var v = $e, E = Symbol.for("react.element"), w = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, T = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
22
+ function p(i, s, P) {
23
+ var b, x = {}, O = null, R = null;
24
+ P !== void 0 && (O = "" + P), s.key !== void 0 && (O = "" + s.key), s.ref !== void 0 && (R = s.ref);
25
+ for (b in s) g.call(s, b) && !m.hasOwnProperty(b) && (x[b] = s[b]);
26
+ if (i && i.defaultProps) for (b in s = i.defaultProps, s) x[b] === void 0 && (x[b] = s[b]);
27
+ return { $$typeof: E, type: i, key: O, ref: R, props: x, _owner: T.current };
28
28
  }
29
- return B.Fragment = k, B.jsx = S, B.jsxs = S, B;
29
+ return N.Fragment = w, N.jsx = p, N.jsxs = p, N;
30
30
  }
31
- var J = {};
31
+ var B = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -38,42 +38,42 @@ var J = {};
38
38
  * This source code is licensed under the MIT license found in the
39
39
  * LICENSE file in the root directory of this source tree.
40
40
  */
41
- var Ae;
41
+ var Ie;
42
42
  function _r() {
43
- return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
44
- var b = Ie, _ = Symbol.for("react.element"), k = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), y = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), R = Symbol.iterator, I = "@@iterator";
45
- function x(e) {
43
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var v = $e, E = Symbol.for("react.element"), w = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), i = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), D = Symbol.iterator, C = "@@iterator";
45
+ function k(e) {
46
46
  if (e === null || typeof e != "object")
47
47
  return null;
48
- var r = R && e[R] || e[I];
48
+ var r = D && e[D] || e[C];
49
49
  return typeof r == "function" ? r : null;
50
50
  }
51
- var g = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function s(e) {
51
+ var y = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function f(e) {
53
53
  {
54
54
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
55
55
  t[n - 1] = arguments[n];
56
- j("error", e, t);
56
+ I("error", e, t);
57
57
  }
58
58
  }
59
- function j(e, r, t) {
59
+ function I(e, r, t) {
60
60
  {
61
- var n = g.ReactDebugCurrentFrame, u = n.getStackAddendum();
61
+ var n = y.ReactDebugCurrentFrame, u = n.getStackAddendum();
62
62
  u !== "" && (r += "%s", t = t.concat([u]));
63
- var c = t.map(function(i) {
64
- return String(i);
63
+ var c = t.map(function(o) {
64
+ return String(o);
65
65
  });
66
66
  c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
67
67
  }
68
68
  }
69
- var $ = !1, W = !1, q = !1, Ye = !1, Le = !1, ce;
70
- ce = Symbol.for("react.module.reference");
69
+ var J = !1, L = !1, q = !1, K = !1, Le = !1, fe;
70
+ fe = Symbol.for("react.module.reference");
71
71
  function Ve(e) {
72
- return !!(typeof e == "string" || typeof e == "function" || e === T || e === p || Le || e === C || e === d || e === v || Ye || e === D || $ || W || q || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === P || e.$$typeof === S || e.$$typeof === y || e.$$typeof === o || // This needs to include all possible module reference object
72
+ return !!(typeof e == "string" || typeof e == "function" || e === g || e === m || Le || e === T || e === P || e === b || K || e === R || J || L || q || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === x || e.$$typeof === p || e.$$typeof === i || e.$$typeof === s || // This needs to include all possible module reference object
73
73
  // types supported by any Flight configuration anywhere since
74
74
  // we don't know which Flight build this will end up being used
75
75
  // with.
76
- e.$$typeof === ce || e.getModuleId !== void 0));
76
+ e.$$typeof === fe || e.getModuleId !== void 0));
77
77
  }
78
78
  function Me(e, r, t) {
79
79
  var n = e.displayName;
@@ -82,47 +82,47 @@ function _r() {
82
82
  var u = r.displayName || r.name || "";
83
83
  return u !== "" ? t + "(" + u + ")" : t;
84
84
  }
85
- function fe(e) {
85
+ function le(e) {
86
86
  return e.displayName || "Context";
87
87
  }
88
- function O(e) {
88
+ function j(e) {
89
89
  if (e == null)
90
90
  return null;
91
- if (typeof e.tag == "number" && s("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
+ if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
92
  return e.displayName || e.name || null;
93
93
  if (typeof e == "string")
94
94
  return e;
95
95
  switch (e) {
96
- case T:
96
+ case g:
97
97
  return "Fragment";
98
- case k:
98
+ case w:
99
99
  return "Portal";
100
- case p:
100
+ case m:
101
101
  return "Profiler";
102
- case C:
102
+ case T:
103
103
  return "StrictMode";
104
- case d:
104
+ case P:
105
105
  return "Suspense";
106
- case v:
106
+ case b:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof e == "object")
110
110
  switch (e.$$typeof) {
111
- case y:
111
+ case i:
112
112
  var r = e;
113
- return fe(r) + ".Consumer";
114
- case S:
113
+ return le(r) + ".Consumer";
114
+ case p:
115
115
  var t = e;
116
- return fe(t._context) + ".Provider";
117
- case o:
116
+ return le(t._context) + ".Provider";
117
+ case s:
118
118
  return Me(e, e.render, "ForwardRef");
119
- case P:
119
+ case x:
120
120
  var n = e.displayName || null;
121
- return n !== null ? n : O(e.type) || "Memo";
122
- case w: {
123
- var u = e, c = u._payload, i = u._init;
121
+ return n !== null ? n : j(e.type) || "Memo";
122
+ case O: {
123
+ var u = e, c = u._payload, o = u._init;
124
124
  try {
125
- return O(i(c));
125
+ return j(o(c));
126
126
  } catch {
127
127
  return null;
128
128
  }
@@ -130,18 +130,18 @@ function _r() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var F = Object.assign, M = 0, le, de, ve, pe, be, ye, me;
134
- function Re() {
133
+ var A = Object.assign, V = 0, de, ve, pe, be, ye, me, Re;
134
+ function ge() {
135
135
  }
136
- Re.__reactDisabledLog = !0;
136
+ ge.__reactDisabledLog = !0;
137
137
  function Ue() {
138
138
  {
139
- if (M === 0) {
140
- le = console.log, de = console.info, ve = console.warn, pe = console.error, be = console.group, ye = console.groupCollapsed, me = console.groupEnd;
139
+ if (V === 0) {
140
+ de = console.log, ve = console.info, pe = console.warn, be = console.error, ye = console.group, me = console.groupCollapsed, Re = console.groupEnd;
141
141
  var e = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
144
- value: Re,
144
+ value: ge,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -154,199 +154,199 @@ function _r() {
154
154
  groupEnd: e
155
155
  });
156
156
  }
157
- M++;
157
+ V++;
158
158
  }
159
159
  }
160
160
  function Ne() {
161
161
  {
162
- if (M--, M === 0) {
162
+ if (V--, V === 0) {
163
163
  var e = {
164
164
  configurable: !0,
165
165
  enumerable: !0,
166
166
  writable: !0
167
167
  };
168
168
  Object.defineProperties(console, {
169
- log: F({}, e, {
170
- value: le
171
- }),
172
- info: F({}, e, {
169
+ log: A({}, e, {
173
170
  value: de
174
171
  }),
175
- warn: F({}, e, {
172
+ info: A({}, e, {
176
173
  value: ve
177
174
  }),
178
- error: F({}, e, {
175
+ warn: A({}, e, {
179
176
  value: pe
180
177
  }),
181
- group: F({}, e, {
178
+ error: A({}, e, {
182
179
  value: be
183
180
  }),
184
- groupCollapsed: F({}, e, {
181
+ group: A({}, e, {
185
182
  value: ye
186
183
  }),
187
- groupEnd: F({}, e, {
184
+ groupCollapsed: A({}, e, {
188
185
  value: me
186
+ }),
187
+ groupEnd: A({}, e, {
188
+ value: Re
189
189
  })
190
190
  });
191
191
  }
192
- M < 0 && s("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ V < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var Z = g.ReactCurrentDispatcher, Q;
196
- function K(e, r, t) {
195
+ var Q = y.ReactCurrentDispatcher, ee;
196
+ function G(e, r, t) {
197
197
  {
198
- if (Q === void 0)
198
+ if (ee === void 0)
199
199
  try {
200
200
  throw Error();
201
201
  } catch (u) {
202
202
  var n = u.stack.trim().match(/\n( *(at )?)/);
203
- Q = n && n[1] || "";
203
+ ee = n && n[1] || "";
204
204
  }
205
205
  return `
206
- ` + Q + e;
206
+ ` + ee + e;
207
207
  }
208
208
  }
209
- var ee = !1, G;
209
+ var re = !1, z;
210
210
  {
211
211
  var Be = typeof WeakMap == "function" ? WeakMap : Map;
212
- G = new Be();
212
+ z = new Be();
213
213
  }
214
- function ge(e, r) {
215
- if (!e || ee)
214
+ function he(e, r) {
215
+ if (!e || re)
216
216
  return "";
217
217
  {
218
- var t = G.get(e);
218
+ var t = z.get(e);
219
219
  if (t !== void 0)
220
220
  return t;
221
221
  }
222
222
  var n;
223
- ee = !0;
223
+ re = !0;
224
224
  var u = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
226
  var c;
227
- c = Z.current, Z.current = null, Ue();
227
+ c = Q.current, Q.current = null, Ue();
228
228
  try {
229
229
  if (r) {
230
- var i = function() {
230
+ var o = function() {
231
231
  throw Error();
232
232
  };
233
- if (Object.defineProperty(i.prototype, "props", {
233
+ if (Object.defineProperty(o.prototype, "props", {
234
234
  set: function() {
235
235
  throw Error();
236
236
  }
237
237
  }), typeof Reflect == "object" && Reflect.construct) {
238
238
  try {
239
- Reflect.construct(i, []);
240
- } catch (h) {
241
- n = h;
239
+ Reflect.construct(o, []);
240
+ } catch (_) {
241
+ n = _;
242
242
  }
243
- Reflect.construct(e, [], i);
243
+ Reflect.construct(e, [], o);
244
244
  } else {
245
245
  try {
246
- i.call();
247
- } catch (h) {
248
- n = h;
246
+ o.call();
247
+ } catch (_) {
248
+ n = _;
249
249
  }
250
- e.call(i.prototype);
250
+ e.call(o.prototype);
251
251
  }
252
252
  } else {
253
253
  try {
254
254
  throw Error();
255
- } catch (h) {
256
- n = h;
255
+ } catch (_) {
256
+ n = _;
257
257
  }
258
258
  e();
259
259
  }
260
- } catch (h) {
261
- if (h && n && typeof h.stack == "string") {
262
- for (var a = h.stack.split(`
263
- `), m = n.stack.split(`
264
- `), f = a.length - 1, l = m.length - 1; f >= 1 && l >= 0 && a[f] !== m[l]; )
265
- l--;
266
- for (; f >= 1 && l >= 0; f--, l--)
267
- if (a[f] !== m[l]) {
268
- if (f !== 1 || l !== 1)
260
+ } catch (_) {
261
+ if (_ && n && typeof _.stack == "string") {
262
+ for (var a = _.stack.split(`
263
+ `), h = n.stack.split(`
264
+ `), l = a.length - 1, d = h.length - 1; l >= 1 && d >= 0 && a[l] !== h[d]; )
265
+ d--;
266
+ for (; l >= 1 && d >= 0; l--, d--)
267
+ if (a[l] !== h[d]) {
268
+ if (l !== 1 || d !== 1)
269
269
  do
270
- if (f--, l--, l < 0 || a[f] !== m[l]) {
271
- var E = `
272
- ` + a[f].replace(" at new ", " at ");
273
- return e.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, E), E;
270
+ if (l--, d--, d < 0 || a[l] !== h[d]) {
271
+ var S = `
272
+ ` + a[l].replace(" at new ", " at ");
273
+ return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, S), S;
274
274
  }
275
- while (f >= 1 && l >= 0);
275
+ while (l >= 1 && d >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- ee = !1, Z.current = c, Ne(), Error.prepareStackTrace = u;
280
+ re = !1, Q.current = c, Ne(), Error.prepareStackTrace = u;
281
281
  }
282
- var L = e ? e.displayName || e.name : "", A = L ? K(L) : "";
283
- return typeof e == "function" && G.set(e, A), A;
282
+ var W = e ? e.displayName || e.name : "", F = W ? G(W) : "";
283
+ return typeof e == "function" && z.set(e, F), F;
284
284
  }
285
285
  function Je(e, r, t) {
286
- return ge(e, !1);
286
+ return he(e, !1);
287
287
  }
288
288
  function qe(e) {
289
289
  var r = e.prototype;
290
290
  return !!(r && r.isReactComponent);
291
291
  }
292
- function z(e, r, t) {
292
+ function H(e, r, t) {
293
293
  if (e == null)
294
294
  return "";
295
295
  if (typeof e == "function")
296
- return ge(e, qe(e));
296
+ return he(e, qe(e));
297
297
  if (typeof e == "string")
298
- return K(e);
298
+ return G(e);
299
299
  switch (e) {
300
- case d:
301
- return K("Suspense");
302
- case v:
303
- return K("SuspenseList");
300
+ case P:
301
+ return G("Suspense");
302
+ case b:
303
+ return G("SuspenseList");
304
304
  }
305
305
  if (typeof e == "object")
306
306
  switch (e.$$typeof) {
307
- case o:
307
+ case s:
308
308
  return Je(e.render);
309
- case P:
310
- return z(e.type, r, t);
311
- case w: {
309
+ case x:
310
+ return H(e.type, r, t);
311
+ case O: {
312
312
  var n = e, u = n._payload, c = n._init;
313
313
  try {
314
- return z(c(u), r, t);
314
+ return H(c(u), r, t);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var U = Object.prototype.hasOwnProperty, he = {}, Ee = g.ReactDebugCurrentFrame;
322
- function H(e) {
321
+ var M = Object.prototype.hasOwnProperty, Ee = {}, _e = y.ReactDebugCurrentFrame;
322
+ function X(e) {
323
323
  if (e) {
324
- var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
325
- Ee.setExtraStackFrame(t);
324
+ var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
325
+ _e.setExtraStackFrame(t);
326
326
  } else
327
- Ee.setExtraStackFrame(null);
327
+ _e.setExtraStackFrame(null);
328
328
  }
329
329
  function Ke(e, r, t, n, u) {
330
330
  {
331
- var c = Function.call.bind(U);
332
- for (var i in e)
333
- if (c(e, i)) {
331
+ var c = Function.call.bind(M);
332
+ for (var o in e)
333
+ if (c(e, o)) {
334
334
  var a = void 0;
335
335
  try {
336
- if (typeof e[i] != "function") {
337
- var m = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
- throw m.name = "Invariant Violation", m;
336
+ if (typeof e[o] != "function") {
337
+ var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw h.name = "Invariant Violation", h;
339
339
  }
340
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (f) {
342
- a = f;
340
+ a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (l) {
342
+ a = l;
343
343
  }
344
- a && !(a instanceof Error) && (H(u), s("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), H(null)), a instanceof Error && !(a.message in he) && (he[a.message] = !0, H(u), s("Failed %s type: %s", t, a.message), H(null));
344
+ a && !(a instanceof Error) && (X(u), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), X(null)), a instanceof Error && !(a.message in Ee) && (Ee[a.message] = !0, X(u), f("Failed %s type: %s", t, a.message), X(null));
345
345
  }
346
346
  }
347
347
  }
348
348
  var Ge = Array.isArray;
349
- function re(e) {
349
+ function te(e) {
350
350
  return Ge(e);
351
351
  }
352
352
  function ze(e) {
@@ -357,27 +357,27 @@ function _r() {
357
357
  }
358
358
  function He(e) {
359
359
  try {
360
- return _e(e), !1;
360
+ return Te(e), !1;
361
361
  } catch {
362
362
  return !0;
363
363
  }
364
364
  }
365
- function _e(e) {
365
+ function Te(e) {
366
366
  return "" + e;
367
367
  }
368
- function Te(e) {
368
+ function Pe(e) {
369
369
  if (He(e))
370
- return s("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), _e(e);
370
+ return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), Te(e);
371
371
  }
372
- var N = g.ReactCurrentOwner, Xe = {
372
+ var U = y.ReactCurrentOwner, Xe = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
376
376
  __source: !0
377
- }, Pe, xe, te;
378
- te = {};
377
+ }, Se, xe, ne;
378
+ ne = {};
379
379
  function Ze(e) {
380
- if (U.call(e, "ref")) {
380
+ if (M.call(e, "ref")) {
381
381
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
382
382
  if (r && r.isReactWarning)
383
383
  return !1;
@@ -385,7 +385,7 @@ function _r() {
385
385
  return e.ref !== void 0;
386
386
  }
387
387
  function Qe(e) {
388
- if (U.call(e, "key")) {
388
+ if (M.call(e, "key")) {
389
389
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
390
390
  if (r && r.isReactWarning)
391
391
  return !1;
@@ -393,15 +393,15 @@ function _r() {
393
393
  return e.key !== void 0;
394
394
  }
395
395
  function er(e, r) {
396
- if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
397
- var t = O(N.current.type);
398
- te[t] || (s('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(N.current.type), e.ref), te[t] = !0);
396
+ if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
397
+ var t = j(U.current.type);
398
+ ne[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(U.current.type), e.ref), ne[t] = !0);
399
399
  }
400
400
  }
401
401
  function rr(e, r) {
402
402
  {
403
403
  var t = function() {
404
- Pe || (Pe = !0, s("%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://reactjs.org/link/special-props)", r));
404
+ Se || (Se = !0, f("%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://reactjs.org/link/special-props)", r));
405
405
  };
406
406
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
407
407
  get: t,
@@ -412,7 +412,7 @@ function _r() {
412
412
  function tr(e, r) {
413
413
  {
414
414
  var t = function() {
415
- xe || (xe = !0, s("%s: `ref` 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://reactjs.org/link/special-props)", r));
415
+ xe || (xe = !0, f("%s: `ref` 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://reactjs.org/link/special-props)", r));
416
416
  };
417
417
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
418
418
  get: t,
@@ -420,15 +420,15 @@ function _r() {
420
420
  });
421
421
  }
422
422
  }
423
- var nr = function(e, r, t, n, u, c, i) {
423
+ var nr = function(e, r, t, n, u, c, o) {
424
424
  var a = {
425
425
  // This tag allows us to uniquely identify this as a React Element
426
- $$typeof: _,
426
+ $$typeof: E,
427
427
  // Built-in properties that belong on the element
428
428
  type: e,
429
429
  key: r,
430
430
  ref: t,
431
- props: i,
431
+ props: o,
432
432
  // Record the component responsible for creating this element.
433
433
  _owner: c
434
434
  };
@@ -451,39 +451,39 @@ function _r() {
451
451
  };
452
452
  function ar(e, r, t, n, u) {
453
453
  {
454
- var c, i = {}, a = null, m = null;
455
- t !== void 0 && (Te(t), a = "" + t), Qe(r) && (Te(r.key), a = "" + r.key), Ze(r) && (m = r.ref, er(r, u));
454
+ var c, o = {}, a = null, h = null;
455
+ t !== void 0 && (Pe(t), a = "" + t), Qe(r) && (Pe(r.key), a = "" + r.key), Ze(r) && (h = r.ref, er(r, u));
456
456
  for (c in r)
457
- U.call(r, c) && !Xe.hasOwnProperty(c) && (i[c] = r[c]);
457
+ M.call(r, c) && !Xe.hasOwnProperty(c) && (o[c] = r[c]);
458
458
  if (e && e.defaultProps) {
459
- var f = e.defaultProps;
460
- for (c in f)
461
- i[c] === void 0 && (i[c] = f[c]);
459
+ var l = e.defaultProps;
460
+ for (c in l)
461
+ o[c] === void 0 && (o[c] = l[c]);
462
462
  }
463
- if (a || m) {
464
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
- a && rr(i, l), m && tr(i, l);
463
+ if (a || h) {
464
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
+ a && rr(o, d), h && tr(o, d);
466
466
  }
467
- return nr(e, a, m, u, n, N.current, i);
467
+ return nr(e, a, h, u, n, U.current, o);
468
468
  }
469
469
  }
470
- var ne = g.ReactCurrentOwner, Ce = g.ReactDebugCurrentFrame;
471
- function Y(e) {
470
+ var ae = y.ReactCurrentOwner, Ce = y.ReactDebugCurrentFrame;
471
+ function $(e) {
472
472
  if (e) {
473
- var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
473
+ var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
474
474
  Ce.setExtraStackFrame(t);
475
475
  } else
476
476
  Ce.setExtraStackFrame(null);
477
477
  }
478
- var ae;
479
- ae = !1;
480
- function oe(e) {
481
- return typeof e == "object" && e !== null && e.$$typeof === _;
478
+ var oe;
479
+ oe = !1;
480
+ function ie(e) {
481
+ return typeof e == "object" && e !== null && e.$$typeof === E;
482
482
  }
483
- function Se() {
483
+ function we() {
484
484
  {
485
- if (ne.current) {
486
- var e = O(ne.current.type);
485
+ if (ae.current) {
486
+ var e = j(ae.current.type);
487
487
  if (e)
488
488
  return `
489
489
 
@@ -498,7 +498,7 @@ Check the render method of \`` + e + "`.";
498
498
  var Oe = {};
499
499
  function ir(e) {
500
500
  {
501
- var r = Se();
501
+ var r = we();
502
502
  if (!r) {
503
503
  var t = typeof e == "string" ? e : e.displayName || e.name;
504
504
  t && (r = `
@@ -508,7 +508,7 @@ Check the top-level render call using <` + t + ">.");
508
508
  return r;
509
509
  }
510
510
  }
511
- function we(e, r) {
511
+ function je(e, r) {
512
512
  {
513
513
  if (!e._store || e._store.validated || e.key != null)
514
514
  return;
@@ -518,25 +518,25 @@ Check the top-level render call using <` + t + ">.");
518
518
  return;
519
519
  Oe[t] = !0;
520
520
  var n = "";
521
- e && e._owner && e._owner !== ne.current && (n = " It was passed a child from " + O(e._owner.type) + "."), Y(e), s('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), Y(null);
521
+ e && e._owner && e._owner !== ae.current && (n = " It was passed a child from " + j(e._owner.type) + "."), $(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), $(null);
522
522
  }
523
523
  }
524
- function je(e, r) {
524
+ function ke(e, r) {
525
525
  {
526
526
  if (typeof e != "object")
527
527
  return;
528
- if (re(e))
528
+ if (te(e))
529
529
  for (var t = 0; t < e.length; t++) {
530
530
  var n = e[t];
531
- oe(n) && we(n, r);
531
+ ie(n) && je(n, r);
532
532
  }
533
- else if (oe(e))
533
+ else if (ie(e))
534
534
  e._store && (e._store.validated = !0);
535
535
  else if (e) {
536
- var u = x(e);
536
+ var u = k(e);
537
537
  if (typeof u == "function" && u !== e.entries)
538
- for (var c = u.call(e), i; !(i = c.next()).done; )
539
- oe(i.value) && we(i.value, r);
538
+ for (var c = u.call(e), o; !(o = c.next()).done; )
539
+ ie(o.value) && je(o.value, r);
540
540
  }
541
541
  }
542
542
  }
@@ -548,21 +548,21 @@ Check the top-level render call using <` + t + ">.");
548
548
  var t;
549
549
  if (typeof r == "function")
550
550
  t = r.propTypes;
551
- else if (typeof r == "object" && (r.$$typeof === o || // Note: Memo only checks outer props here.
551
+ else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
552
552
  // Inner props are checked in the reconciler.
553
- r.$$typeof === P))
553
+ r.$$typeof === x))
554
554
  t = r.propTypes;
555
555
  else
556
556
  return;
557
557
  if (t) {
558
- var n = O(r);
558
+ var n = j(r);
559
559
  Ke(t, e.props, "prop", n, e);
560
- } else if (r.PropTypes !== void 0 && !ae) {
561
- ae = !0;
562
- var u = O(r);
563
- s("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
560
+ } else if (r.PropTypes !== void 0 && !oe) {
561
+ oe = !0;
562
+ var u = j(r);
563
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
564
564
  }
565
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && s("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
566
566
  }
567
567
  }
568
568
  function sr(e) {
@@ -570,151 +570,173 @@ Check the top-level render call using <` + t + ">.");
570
570
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
571
571
  var n = r[t];
572
572
  if (n !== "children" && n !== "key") {
573
- Y(e), s("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), Y(null);
573
+ $(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), $(null);
574
574
  break;
575
575
  }
576
576
  }
577
- e.ref !== null && (Y(e), s("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
577
+ e.ref !== null && ($(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
578
578
  }
579
579
  }
580
- var ke = {};
581
- function De(e, r, t, n, u, c) {
580
+ var De = {};
581
+ function Ae(e, r, t, n, u, c) {
582
582
  {
583
- var i = Ve(e);
584
- if (!i) {
583
+ var o = Ve(e);
584
+ if (!o) {
585
585
  var a = "";
586
586
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
- var m = or();
588
- m ? a += m : a += Se();
589
- var f;
590
- e === null ? f = "null" : re(e) ? f = "array" : e !== void 0 && e.$$typeof === _ ? (f = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, s("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
587
+ var h = or();
588
+ h ? a += h : a += we();
589
+ var l;
590
+ e === null ? l = "null" : te(e) ? l = "array" : e !== void 0 && e.$$typeof === E ? (l = "<" + (j(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
591
591
  }
592
- var l = ar(e, r, t, u, c);
593
- if (l == null)
594
- return l;
595
- if (i) {
596
- var E = r.children;
597
- if (E !== void 0)
592
+ var d = ar(e, r, t, u, c);
593
+ if (d == null)
594
+ return d;
595
+ if (o) {
596
+ var S = r.children;
597
+ if (S !== void 0)
598
598
  if (n)
599
- if (re(E)) {
600
- for (var L = 0; L < E.length; L++)
601
- je(E[L], e);
602
- Object.freeze && Object.freeze(E);
599
+ if (te(S)) {
600
+ for (var W = 0; W < S.length; W++)
601
+ ke(S[W], e);
602
+ Object.freeze && Object.freeze(S);
603
603
  } else
604
- s("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
+ f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
605
605
  else
606
- je(E, e);
606
+ ke(S, e);
607
607
  }
608
- if (U.call(r, "key")) {
609
- var A = O(e), h = Object.keys(r).filter(function(pr) {
608
+ if (M.call(r, "key")) {
609
+ var F = j(e), _ = Object.keys(r).filter(function(pr) {
610
610
  return pr !== "key";
611
- }), ie = h.length > 0 ? "{key: someKey, " + h.join(": ..., ") + ": ...}" : "{key: someKey}";
612
- if (!ke[A + ie]) {
613
- var vr = h.length > 0 ? "{" + h.join(": ..., ") + ": ...}" : "{}";
614
- s(`A props object containing a "key" prop is being spread into JSX:
611
+ }), ue = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}";
612
+ if (!De[F + ue]) {
613
+ var vr = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}";
614
+ f(`A props object containing a "key" prop is being spread into JSX:
615
615
  let props = %s;
616
616
  <%s {...props} />
617
617
  React keys must be passed directly to JSX without using spread:
618
618
  let props = %s;
619
- <%s key={someKey} {...props} />`, ie, A, vr, A), ke[A + ie] = !0;
619
+ <%s key={someKey} {...props} />`, ue, F, vr, F), De[F + ue] = !0;
620
620
  }
621
621
  }
622
- return e === T ? sr(l) : ur(l), l;
622
+ return e === g ? sr(d) : ur(d), d;
623
623
  }
624
624
  }
625
625
  function cr(e, r, t) {
626
- return De(e, r, t, !0);
626
+ return Ae(e, r, t, !0);
627
627
  }
628
628
  function fr(e, r, t) {
629
- return De(e, r, t, !1);
629
+ return Ae(e, r, t, !1);
630
630
  }
631
631
  var lr = fr, dr = cr;
632
- J.Fragment = T, J.jsx = lr, J.jsxs = dr;
633
- }()), J;
632
+ B.Fragment = g, B.jsx = lr, B.jsxs = dr;
633
+ }()), B;
634
634
  }
635
- process.env.NODE_ENV === "production" ? se.exports = Er() : se.exports = _r();
636
- var Tr = se.exports;
637
- function Pr(b) {
638
- $e(() => {
639
- b();
635
+ process.env.NODE_ENV === "production" ? ce.exports = Er() : ce.exports = _r();
636
+ var Tr = ce.exports;
637
+ function Pr(v) {
638
+ We(() => {
639
+ v();
640
640
  }, []);
641
641
  }
642
- function xr(b) {
643
- $e(() => b, []);
642
+ function Sr(v) {
643
+ We(() => v, []);
644
644
  }
645
- function Dr(b) {
645
+ function Ar(v) {
646
646
  if (typeof Proxy > "u") throw new Error("Proxy is not supported in this environment.");
647
- const _ = br(
647
+ const E = br(
648
648
  void 0
649
649
  );
650
- return _.name = b, _;
650
+ return E.name = v, E;
651
651
  }
652
- function Fr(b) {
653
- return hr(function({
654
- children: k,
655
- value: T,
656
- onChangeProp: C,
657
- onChangeReinit: p,
658
- proxyRef: S
659
- }) {
660
- const y = X({}), o = X(), d = X({}), v = We();
661
- yr(S, () => o.current, [o.current]);
662
- const P = ue((R, I, x) => {
663
- const g = Rr();
664
- return y.current[g] = {
665
- id: g,
666
- deps: x,
667
- propCallback: R,
668
- reinitCallback: I
669
- }, g;
670
- }, []), w = ue((R) => {
671
- delete y.current[R];
672
- }, []), D = ue((R) => {
673
- if (R !== o.current) {
674
- const I = o.current;
675
- R !== null ? o.current = new Proxy(R, {
676
- get: function(x, g) {
677
- const s = Reflect.get(x, g, R);
678
- return V(s) ? s.bind(o.current) : s;
679
- },
680
- set: function(x, g, s) {
681
- const j = g, $ = x[j];
682
- return Reflect.set(x, j, s, R), s = x[j], Object.values(y.current).forEach((W) => {
683
- (!W.deps || W.deps.includes(j) && $ !== s || W.deps.some((q) => V(q) && q(j, s, $, R))) && W.propCallback(j, s, $);
684
- }), V(C) && C(j, s, $), !0;
685
- }
686
- }) : o.current = R, Object.values(y.current).forEach((x) => {
687
- x.reinitCallback(o.current, I);
688
- }), V(p) && p(o.current, I), v();
689
- }
690
- return d.current.obj = o.current, o.current;
691
- }, [C, p]);
692
- return o.current === void 0 && (o.current = D(T)), d.current.obj = o.current, d.current.set = D, d.current.subscribe = P, d.current.unsubscribe = w, /* @__PURE__ */ Tr.jsx(b.Provider, { value: d.current, children: k });
693
- }, ["children", "onChangeProp", "onChangeReinit", "proxyRef"], `${b.name}Provider`);
652
+ function xr(v) {
653
+ if (Array.isArray(v)) {
654
+ const [E, ...w] = v;
655
+ return (g, T, m) => {
656
+ if (g !== E) return !1;
657
+ let p = T, i = m;
658
+ for (const s of w)
659
+ p = p == null ? void 0 : p[s], i = i == null ? void 0 : i[s];
660
+ return p !== i;
661
+ };
662
+ }
663
+ return v;
664
+ }
665
+ function Fr(v) {
666
+ return hr(
667
+ ({
668
+ children: E,
669
+ value: w,
670
+ onChangeProp: g,
671
+ onChangeReinit: T,
672
+ proxyRef: m
673
+ }) => {
674
+ const p = Z({}), i = Z(), s = Z({}), P = Ye();
675
+ yr(m, () => i.current, [i.current]);
676
+ const b = se((R, D, C) => {
677
+ const k = Rr();
678
+ return p.current[k] = {
679
+ id: k,
680
+ deps: C,
681
+ propCallback: R,
682
+ reinitCallback: D
683
+ }, k;
684
+ }, []), x = se((R) => {
685
+ delete p.current[R];
686
+ }, []), O = se((R) => {
687
+ if (R !== i.current) {
688
+ const D = i.current;
689
+ R !== null ? i.current = new Proxy(R, {
690
+ get: function(C, k) {
691
+ const y = Reflect.get(C, k, R);
692
+ return Y(y) ? y.bind(i.current) : y;
693
+ },
694
+ set: function(C, k, y) {
695
+ const f = k, I = C[f];
696
+ return Reflect.set(C, f, y, R), y = C[f], Object.values(p.current).forEach((J) => {
697
+ var q;
698
+ const L = (q = J.deps) == null ? void 0 : q.map(xr);
699
+ (!L || L.includes(f) && I !== y || L.some(
700
+ (K) => Y(K) && K(f, y, I, R)
701
+ )) && J.propCallback(f, y, I);
702
+ }), Y(g) && g(f, y, I), !0;
703
+ }
704
+ }) : i.current = R, Object.values(p.current).forEach((C) => {
705
+ C.reinitCallback(i.current, D);
706
+ }), Y(T) && T(i.current, D), P();
707
+ }
708
+ return s.current.obj = i.current, i.current;
709
+ }, [g, T]);
710
+ return i.current === void 0 && (i.current = O(w)), s.current.obj = i.current, s.current.set = O, s.current.subscribe = b, s.current.unsubscribe = x, /* @__PURE__ */ Tr.jsx(v.Provider, { value: s.current, children: E });
711
+ },
712
+ ["children", "onChangeProp", "onChangeReinit", "proxyRef"],
713
+ v.name + ".Provider"
714
+ );
694
715
  }
695
- function Ar(b, _ = [], k, T, C = !0) {
696
- const p = mr(b), S = We(), y = X(null);
697
- if (p === void 0)
698
- throw new Error(`No ${b.name} provider found.`);
716
+ function Ir(v, E = [], w, g, T = !0) {
717
+ const m = mr(v), p = Ye(), i = Z(null);
718
+ if (m === void 0)
719
+ throw new Error(`No ${v.name} provider found.`);
699
720
  return Pr(() => {
700
- y.current = p == null ? void 0 : p.subscribe(
701
- (o, d, v) => {
702
- S(), V(k) && k(o, d, v);
721
+ i.current = m == null ? void 0 : m.subscribe(
722
+ (s, P, b) => {
723
+ p(), Y(w) && w(s, P, b);
703
724
  },
704
- (o, d) => {
705
- C && S(), V(T) && T(o, d);
725
+ (s, P) => {
726
+ T && p(), Y(g) && g(s, P);
706
727
  },
707
- _
728
+ E
708
729
  );
709
- }), xr(() => {
710
- p.unsubscribe(y.current);
730
+ }), Sr(() => {
731
+ m.unsubscribe(i.current);
711
732
  }), new gr(
712
- { value: p.obj, set: p.set },
733
+ { value: m.obj, set: m.set },
713
734
  ["value", "set"]
714
735
  );
715
736
  }
716
737
  export {
717
- Dr as createProxyContext,
738
+ Ar as createProxyContext,
718
739
  Fr as createProxyContextProvider,
719
- Ar as useProxyContext
740
+ xr as evaluateDependency,
741
+ Ir as useProxyContext
720
742
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ptolemy2002/react-proxy-context",
3
3
  "private": false,
4
- "version": "2.1.2",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",