@ptolemy2002/react-proxy-context 2.3.4 → 2.3.6

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.d.ts CHANGED
@@ -23,7 +23,7 @@ export type ProxyContextProviderProps<T> = {
23
23
  proxyRef?: React.MutableRefObject<T>;
24
24
  };
25
25
  export declare function createProxyContextProvider<T extends object | null>(contextClass: ProxyContext<T>): import('react').MemoExoticComponent<import('react').FunctionComponent<ProxyContextProviderProps<T> & {
26
- renderDeps?: any[];
26
+ renderDeps?: unknown[] | null | false;
27
27
  }>>;
28
28
  export type UseProxyContextResult<T> = HookResultData<{
29
29
  value: T;
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
- import Fe, { createContext as vr, useRef as ie, useImperativeHandle as pr, useCallback as L, useContext as br, useSyncExternalStore as yr } from "react";
2
- import { nanoid as mr } from "nanoid";
3
- import V from "is-callable";
4
- import Er from "@ptolemy2002/react-force-rerender";
5
- import Rr from "@ptolemy2002/react-hook-result";
6
- import { partialMemo as gr } from "@ptolemy2002/react-utils";
7
- var ue = { exports: {} }, J = {};
1
+ import Fe, { createContext as dr, useRef as H, useImperativeHandle as vr, useCallback as V, useContext as pr, useSyncExternalStore as br } from "react";
2
+ import { nanoid as yr } from "nanoid";
3
+ import L from "is-callable";
4
+ import mr from "@ptolemy2002/react-force-rerender";
5
+ import Er from "@ptolemy2002/react-hook-result";
6
+ import { partialMemo as Rr } from "@ptolemy2002/react-utils";
7
+ var oe = { exports: {} }, B = {};
8
8
  /**
9
9
  * @license React
10
10
  * react-jsx-runtime.production.min.js
@@ -14,21 +14,21 @@ var ue = { exports: {} }, J = {};
14
14
  * This source code is licensed under the MIT license found in the
15
15
  * LICENSE file in the root directory of this source tree.
16
16
  */
17
- var De;
18
- function hr() {
19
- if (De) return J;
20
- De = 1;
21
- var E = Fe, R = Symbol.for("react.element"), C = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, T = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
22
- function y(i, s, j) {
23
- var b, h = {}, w = null, I = null;
24
- j !== void 0 && (w = "" + j), s.key !== void 0 && (w = "" + s.key), s.ref !== void 0 && (I = s.ref);
25
- for (b in s) m.call(s, b) && !g.hasOwnProperty(b) && (h[b] = s[b]);
26
- if (i && i.defaultProps) for (b in s = i.defaultProps, s) h[b] === void 0 && (h[b] = s[b]);
27
- return { $$typeof: R, type: i, key: w, ref: I, props: h, _owner: T.current };
17
+ var ke;
18
+ function _r() {
19
+ if (ke) return B;
20
+ ke = 1;
21
+ var R = Fe, _ = Symbol.for("react.element"), C = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, T = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
22
+ function l(i, s, j) {
23
+ var m, h = {}, x = null, D = null;
24
+ j !== void 0 && (x = "" + j), s.key !== void 0 && (x = "" + s.key), s.ref !== void 0 && (D = s.ref);
25
+ for (m in s) y.call(s, m) && !E.hasOwnProperty(m) && (h[m] = s[m]);
26
+ if (i && i.defaultProps) for (m in s = i.defaultProps, s) h[m] === void 0 && (h[m] = s[m]);
27
+ return { $$typeof: _, type: i, key: x, ref: D, props: h, _owner: T.current };
28
28
  }
29
- return J.Fragment = C, J.jsx = y, J.jsxs = y, J;
29
+ return B.Fragment = C, B.jsx = l, B.jsxs = l, B;
30
30
  }
31
- var q = {};
31
+ var J = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -38,91 +38,91 @@ var q = {};
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;
42
- function _r() {
43
- return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
44
- var E = Fe, R = Symbol.for("react.element"), C = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), i = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), M = Symbol.iterator, v = "@@iterator";
41
+ var De;
42
+ function hr() {
43
+ return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var R = Fe, _ = Symbol.for("react.element"), C = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), i = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), M = Symbol.iterator, p = "@@iterator";
45
45
  function S(e) {
46
46
  if (e === null || typeof e != "object")
47
47
  return null;
48
- var r = M && e[M] || e[v];
48
+ var r = M && e[M] || e[p];
49
49
  return typeof r == "function" ? r : null;
50
50
  }
51
- var l = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function c(e) {
51
+ var d = R.__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
- P("error", e, t);
56
+ O("error", e, t);
57
57
  }
58
58
  }
59
- function P(e, r, t) {
59
+ function O(e, r, t) {
60
60
  {
61
- var n = l.ReactDebugCurrentFrame, u = n.getStackAddendum();
61
+ var n = d.ReactDebugCurrentFrame, u = n.getStackAddendum();
62
62
  u !== "" && (r += "%s", t = t.concat([u]));
63
- var f = t.map(function(o) {
63
+ var c = t.map(function(o) {
64
64
  return String(o);
65
65
  });
66
- f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
66
+ c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
67
67
  }
68
68
  }
69
- var D = !1, $ = !1, Ie = !1, $e = !1, We = !1, se;
70
- se = Symbol.for("react.module.reference");
71
- function Ye(e) {
72
- return !!(typeof e == "string" || typeof e == "function" || e === m || e === g || We || e === T || e === j || e === b || $e || e === I || D || $ || Ie || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === h || e.$$typeof === y || e.$$typeof === i || e.$$typeof === s || // This needs to include all possible module reference object
69
+ var k = !1, $ = !1, Ae = !1, Ie = !1, $e = !1, ie;
70
+ ie = Symbol.for("react.module.reference");
71
+ function We(e) {
72
+ return !!(typeof e == "string" || typeof e == "function" || e === y || e === E || $e || e === T || e === j || e === m || Ie || e === D || k || $ || Ae || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === h || e.$$typeof === l || 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 === se || e.getModuleId !== void 0));
76
+ e.$$typeof === ie || e.getModuleId !== void 0));
77
77
  }
78
- function Le(e, r, t) {
78
+ function Ye(e, r, t) {
79
79
  var n = e.displayName;
80
80
  if (n)
81
81
  return n;
82
82
  var u = r.displayName || r.name || "";
83
83
  return u !== "" ? t + "(" + u + ")" : t;
84
84
  }
85
- function ce(e) {
85
+ function ue(e) {
86
86
  return e.displayName || "Context";
87
87
  }
88
- function k(e) {
88
+ function F(e) {
89
89
  if (e == null)
90
90
  return null;
91
- if (typeof e.tag == "number" && c("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 m:
96
+ case y:
97
97
  return "Fragment";
98
98
  case C:
99
99
  return "Portal";
100
- case g:
100
+ case E:
101
101
  return "Profiler";
102
102
  case T:
103
103
  return "StrictMode";
104
104
  case j:
105
105
  return "Suspense";
106
- case b:
106
+ case m:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof e == "object")
110
110
  switch (e.$$typeof) {
111
111
  case i:
112
112
  var r = e;
113
- return ce(r) + ".Consumer";
114
- case y:
113
+ return ue(r) + ".Consumer";
114
+ case l:
115
115
  var t = e;
116
- return ce(t._context) + ".Provider";
116
+ return ue(t._context) + ".Provider";
117
117
  case s:
118
- return Le(e, e.render, "ForwardRef");
118
+ return Ye(e, e.render, "ForwardRef");
119
119
  case h:
120
120
  var n = e.displayName || null;
121
- return n !== null ? n : k(e.type) || "Memo";
122
- case w: {
123
- var u = e, f = u._payload, o = u._init;
121
+ return n !== null ? n : F(e.type) || "Memo";
122
+ case x: {
123
+ var u = e, c = u._payload, o = u._init;
124
124
  try {
125
- return k(o(f));
125
+ return F(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 A = Object.assign, U = 0, fe, le, de, ve, pe, be, ye;
134
- function me() {
133
+ var A = Object.assign, U = 0, se, ce, fe, le, de, ve, pe;
134
+ function be() {
135
135
  }
136
- me.__reactDisabledLog = !0;
136
+ be.__reactDisabledLog = !0;
137
137
  function Ve() {
138
138
  {
139
139
  if (U === 0) {
140
- fe = console.log, le = console.info, de = console.warn, ve = console.error, pe = console.group, be = console.groupCollapsed, ye = console.groupEnd;
140
+ se = console.log, ce = console.info, fe = console.warn, le = console.error, de = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
141
141
  var e = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
144
- value: me,
144
+ value: be,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -157,7 +157,7 @@ function _r() {
157
157
  U++;
158
158
  }
159
159
  }
160
- function Me() {
160
+ function Le() {
161
161
  {
162
162
  if (U--, U === 0) {
163
163
  var e = {
@@ -167,33 +167,33 @@ function _r() {
167
167
  };
168
168
  Object.defineProperties(console, {
169
169
  log: A({}, e, {
170
- value: fe
170
+ value: se
171
171
  }),
172
172
  info: A({}, e, {
173
- value: le
173
+ value: ce
174
174
  }),
175
175
  warn: A({}, e, {
176
- value: de
176
+ value: fe
177
177
  }),
178
178
  error: A({}, e, {
179
- value: ve
179
+ value: le
180
180
  }),
181
181
  group: A({}, e, {
182
- value: pe
182
+ value: de
183
183
  }),
184
184
  groupCollapsed: A({}, e, {
185
- value: be
185
+ value: ve
186
186
  }),
187
187
  groupEnd: A({}, e, {
188
- value: ye
188
+ value: pe
189
189
  })
190
190
  });
191
191
  }
192
- U < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ U < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var X = l.ReactCurrentDispatcher, Z;
196
- function K(e, r, t) {
195
+ var X = d.ReactCurrentDispatcher, Z;
196
+ function q(e, r, t) {
197
197
  {
198
198
  if (Z === void 0)
199
199
  try {
@@ -206,16 +206,16 @@ function _r() {
206
206
  ` + Z + e;
207
207
  }
208
208
  }
209
- var Q = !1, G;
209
+ var Q = !1, K;
210
210
  {
211
- var Ue = typeof WeakMap == "function" ? WeakMap : Map;
212
- G = new Ue();
211
+ var Me = typeof WeakMap == "function" ? WeakMap : Map;
212
+ K = new Me();
213
213
  }
214
- function Ee(e, r) {
214
+ function ye(e, r) {
215
215
  if (!e || Q)
216
216
  return "";
217
217
  {
218
- var t = G.get(e);
218
+ var t = K.get(e);
219
219
  if (t !== void 0)
220
220
  return t;
221
221
  }
@@ -223,8 +223,8 @@ function _r() {
223
223
  Q = !0;
224
224
  var u = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
- var f;
227
- f = X.current, X.current = null, Ve();
226
+ var c;
227
+ c = X.current, X.current = null, Ve();
228
228
  try {
229
229
  if (r) {
230
230
  var o = function() {
@@ -237,146 +237,145 @@ function _r() {
237
237
  }), typeof Reflect == "object" && Reflect.construct) {
238
238
  try {
239
239
  Reflect.construct(o, []);
240
- } catch (x) {
241
- n = x;
240
+ } catch (P) {
241
+ n = P;
242
242
  }
243
243
  Reflect.construct(e, [], o);
244
244
  } else {
245
245
  try {
246
246
  o.call();
247
- } catch (x) {
248
- n = x;
247
+ } catch (P) {
248
+ n = P;
249
249
  }
250
250
  e.call(o.prototype);
251
251
  }
252
252
  } else {
253
253
  try {
254
254
  throw Error();
255
- } catch (x) {
256
- n = x;
255
+ } catch (P) {
256
+ n = P;
257
257
  }
258
258
  e();
259
259
  }
260
- } catch (x) {
261
- if (x && n && typeof x.stack == "string") {
262
- for (var a = x.stack.split(`
263
- `), _ = n.stack.split(`
264
- `), d = a.length - 1, p = _.length - 1; d >= 1 && p >= 0 && a[d] !== _[p]; )
265
- p--;
266
- for (; d >= 1 && p >= 0; d--, p--)
267
- if (a[d] !== _[p]) {
268
- if (d !== 1 || p !== 1)
260
+ } catch (P) {
261
+ if (P && n && typeof P.stack == "string") {
262
+ for (var a = P.stack.split(`
263
+ `), g = n.stack.split(`
264
+ `), v = a.length - 1, b = g.length - 1; v >= 1 && b >= 0 && a[v] !== g[b]; )
265
+ b--;
266
+ for (; v >= 1 && b >= 0; v--, b--)
267
+ if (a[v] !== g[b]) {
268
+ if (v !== 1 || b !== 1)
269
269
  do
270
- if (d--, p--, p < 0 || a[d] !== _[p]) {
271
- var O = `
272
- ` + a[d].replace(" at new ", " at ");
273
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, O), O;
270
+ if (v--, b--, b < 0 || a[v] !== g[b]) {
271
+ var w = `
272
+ ` + a[v].replace(" at new ", " at ");
273
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, w), w;
274
274
  }
275
- while (d >= 1 && p >= 0);
275
+ while (v >= 1 && b >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- Q = !1, X.current = f, Me(), Error.prepareStackTrace = u;
280
+ Q = !1, X.current = c, Le(), Error.prepareStackTrace = u;
281
281
  }
282
- var Y = e ? e.displayName || e.name : "", F = Y ? K(Y) : "";
283
- return typeof e == "function" && G.set(e, F), F;
282
+ var Y = e ? e.displayName || e.name : "", I = Y ? q(Y) : "";
283
+ return typeof e == "function" && K.set(e, I), I;
284
284
  }
285
- function Ne(e, r, t) {
286
- return Ee(e, !1);
285
+ function Ue(e, r, t) {
286
+ return ye(e, !1);
287
287
  }
288
- function Be(e) {
288
+ function Ne(e) {
289
289
  var r = e.prototype;
290
290
  return !!(r && r.isReactComponent);
291
291
  }
292
- function z(e, r, t) {
292
+ function G(e, r, t) {
293
293
  if (e == null)
294
294
  return "";
295
295
  if (typeof e == "function")
296
- return Ee(e, Be(e));
296
+ return ye(e, Ne(e));
297
297
  if (typeof e == "string")
298
- return K(e);
298
+ return q(e);
299
299
  switch (e) {
300
300
  case j:
301
- return K("Suspense");
302
- case b:
303
- return K("SuspenseList");
301
+ return q("Suspense");
302
+ case m:
303
+ return q("SuspenseList");
304
304
  }
305
305
  if (typeof e == "object")
306
306
  switch (e.$$typeof) {
307
307
  case s:
308
- return Ne(e.render);
308
+ return Ue(e.render);
309
309
  case h:
310
- return z(e.type, r, t);
311
- case w: {
312
- var n = e, u = n._payload, f = n._init;
310
+ return G(e.type, r, t);
311
+ case x: {
312
+ var n = e, u = n._payload, c = n._init;
313
313
  try {
314
- return z(f(u), r, t);
314
+ return G(c(u), r, t);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var N = Object.prototype.hasOwnProperty, Re = {}, ge = l.ReactDebugCurrentFrame;
322
- function H(e) {
321
+ var N = Object.prototype.hasOwnProperty, me = {}, Ee = d.ReactDebugCurrentFrame;
322
+ function z(e) {
323
323
  if (e) {
324
- var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
325
- ge.setExtraStackFrame(t);
324
+ var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
325
+ Ee.setExtraStackFrame(t);
326
326
  } else
327
- ge.setExtraStackFrame(null);
327
+ Ee.setExtraStackFrame(null);
328
328
  }
329
- function Je(e, r, t, n, u) {
329
+ function Be(e, r, t, n, u) {
330
330
  {
331
- var f = Function.call.bind(N);
331
+ var c = Function.call.bind(N);
332
332
  for (var o in e)
333
- if (f(e, o)) {
333
+ if (c(e, o)) {
334
334
  var a = void 0;
335
335
  try {
336
336
  if (typeof e[o] != "function") {
337
- var _ = 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 _.name = "Invariant Violation", _;
337
+ var g = 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 g.name = "Invariant Violation", g;
339
339
  }
340
340
  a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (d) {
342
- a = d;
341
+ } catch (v) {
342
+ a = v;
343
343
  }
344
- a && !(a instanceof Error) && (H(u), c("%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), H(null)), a instanceof Error && !(a.message in Re) && (Re[a.message] = !0, H(u), c("Failed %s type: %s", t, a.message), H(null));
344
+ a && !(a instanceof Error) && (z(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), z(null)), a instanceof Error && !(a.message in me) && (me[a.message] = !0, z(u), f("Failed %s type: %s", t, a.message), z(null));
345
345
  }
346
346
  }
347
347
  }
348
- var qe = Array.isArray;
348
+ var Je = Array.isArray;
349
349
  function ee(e) {
350
- return qe(e);
350
+ return Je(e);
351
351
  }
352
- function Ke(e) {
352
+ function qe(e) {
353
353
  {
354
354
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
355
355
  return t;
356
356
  }
357
357
  }
358
- function Ge(e) {
358
+ function Ke(e) {
359
359
  try {
360
- return he(e), !1;
360
+ return Re(e), !1;
361
361
  } catch {
362
362
  return !0;
363
363
  }
364
364
  }
365
- function he(e) {
365
+ function Re(e) {
366
366
  return "" + e;
367
367
  }
368
368
  function _e(e) {
369
- if (Ge(e))
370
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), he(e);
369
+ if (Ke(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.", qe(e)), Re(e);
371
371
  }
372
- var B = l.ReactCurrentOwner, ze = {
372
+ var he = d.ReactCurrentOwner, Ge = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
376
376
  __source: !0
377
- }, Te, xe, re;
378
- re = {};
379
- function He(e) {
377
+ }, ge, Te;
378
+ function ze(e) {
380
379
  if (N.call(e, "ref")) {
381
380
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
382
381
  if (r && r.isReactWarning)
@@ -384,7 +383,7 @@ function _r() {
384
383
  }
385
384
  return e.ref !== void 0;
386
385
  }
387
- function Xe(e) {
386
+ function He(e) {
388
387
  if (N.call(e, "key")) {
389
388
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
390
389
  if (r && r.isReactWarning)
@@ -392,16 +391,13 @@ function _r() {
392
391
  }
393
392
  return e.key !== void 0;
394
393
  }
395
- function Ze(e, r) {
396
- if (typeof e.ref == "string" && B.current && r && B.current.stateNode !== r) {
397
- var t = k(B.current.type);
398
- re[t] || (c('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', k(B.current.type), e.ref), re[t] = !0);
399
- }
394
+ function Xe(e, r) {
395
+ typeof e.ref == "string" && he.current;
400
396
  }
401
- function Qe(e, r) {
397
+ function Ze(e, r) {
402
398
  {
403
399
  var t = function() {
404
- Te || (Te = !0, c("%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));
400
+ ge || (ge = !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
401
  };
406
402
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
407
403
  get: t,
@@ -409,10 +405,10 @@ function _r() {
409
405
  });
410
406
  }
411
407
  }
412
- function er(e, r) {
408
+ function Qe(e, r) {
413
409
  {
414
410
  var t = function() {
415
- xe || (xe = !0, c("%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));
411
+ Te || (Te = !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
412
  };
417
413
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
418
414
  get: t,
@@ -420,17 +416,17 @@ function _r() {
420
416
  });
421
417
  }
422
418
  }
423
- var rr = function(e, r, t, n, u, f, o) {
419
+ var er = function(e, r, t, n, u, c, o) {
424
420
  var a = {
425
421
  // This tag allows us to uniquely identify this as a React Element
426
- $$typeof: R,
422
+ $$typeof: _,
427
423
  // Built-in properties that belong on the element
428
424
  type: e,
429
425
  key: r,
430
426
  ref: t,
431
427
  props: o,
432
428
  // Record the component responsible for creating this element.
433
- _owner: f
429
+ _owner: c
434
430
  };
435
431
  return a._store = {}, Object.defineProperty(a._store, "validated", {
436
432
  configurable: !1,
@@ -449,41 +445,41 @@ function _r() {
449
445
  value: u
450
446
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
451
447
  };
452
- function tr(e, r, t, n, u) {
448
+ function rr(e, r, t, n, u) {
453
449
  {
454
- var f, o = {}, a = null, _ = null;
455
- t !== void 0 && (_e(t), a = "" + t), Xe(r) && (_e(r.key), a = "" + r.key), He(r) && (_ = r.ref, Ze(r, u));
456
- for (f in r)
457
- N.call(r, f) && !ze.hasOwnProperty(f) && (o[f] = r[f]);
450
+ var c, o = {}, a = null, g = null;
451
+ t !== void 0 && (_e(t), a = "" + t), He(r) && (_e(r.key), a = "" + r.key), ze(r) && (g = r.ref, Xe(r, u));
452
+ for (c in r)
453
+ N.call(r, c) && !Ge.hasOwnProperty(c) && (o[c] = r[c]);
458
454
  if (e && e.defaultProps) {
459
- var d = e.defaultProps;
460
- for (f in d)
461
- o[f] === void 0 && (o[f] = d[f]);
455
+ var v = e.defaultProps;
456
+ for (c in v)
457
+ o[c] === void 0 && (o[c] = v[c]);
462
458
  }
463
- if (a || _) {
464
- var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
- a && Qe(o, p), _ && er(o, p);
459
+ if (a || g) {
460
+ var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
461
+ a && Ze(o, b), g && Qe(o, b);
466
462
  }
467
- return rr(e, a, _, u, n, B.current, o);
463
+ return er(e, a, g, u, n, he.current, o);
468
464
  }
469
465
  }
470
- var te = l.ReactCurrentOwner, Se = l.ReactDebugCurrentFrame;
466
+ var re = d.ReactCurrentOwner, xe = d.ReactDebugCurrentFrame;
471
467
  function W(e) {
472
468
  if (e) {
473
- var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
474
- Se.setExtraStackFrame(t);
469
+ var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
470
+ xe.setExtraStackFrame(t);
475
471
  } else
476
- Se.setExtraStackFrame(null);
472
+ xe.setExtraStackFrame(null);
477
473
  }
478
- var ne;
479
- ne = !1;
480
- function ae(e) {
481
- return typeof e == "object" && e !== null && e.$$typeof === R;
474
+ var te;
475
+ te = !1;
476
+ function ne(e) {
477
+ return typeof e == "object" && e !== null && e.$$typeof === _;
482
478
  }
483
479
  function Pe() {
484
480
  {
485
- if (te.current) {
486
- var e = k(te.current.type);
481
+ if (re.current) {
482
+ var e = F(re.current.type);
487
483
  if (e)
488
484
  return `
489
485
 
@@ -492,11 +488,11 @@ Check the render method of \`` + e + "`.";
492
488
  return "";
493
489
  }
494
490
  }
495
- function nr(e) {
491
+ function tr(e) {
496
492
  return "";
497
493
  }
498
- var we = {};
499
- function ar(e) {
494
+ var Se = {};
495
+ function nr(e) {
500
496
  {
501
497
  var r = Pe();
502
498
  if (!r) {
@@ -513,34 +509,34 @@ Check the top-level render call using <` + t + ">.");
513
509
  if (!e._store || e._store.validated || e.key != null)
514
510
  return;
515
511
  e._store.validated = !0;
516
- var t = ar(r);
517
- if (we[t])
512
+ var t = nr(r);
513
+ if (Se[t])
518
514
  return;
519
- we[t] = !0;
515
+ Se[t] = !0;
520
516
  var n = "";
521
- e && e._owner && e._owner !== te.current && (n = " It was passed a child from " + k(e._owner.type) + "."), W(e), c('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), W(null);
517
+ e && e._owner && e._owner !== re.current && (n = " It was passed a child from " + F(e._owner.type) + "."), W(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), W(null);
522
518
  }
523
519
  }
524
- function Ce(e, r) {
520
+ function we(e, r) {
525
521
  {
526
522
  if (typeof e != "object")
527
523
  return;
528
524
  if (ee(e))
529
525
  for (var t = 0; t < e.length; t++) {
530
526
  var n = e[t];
531
- ae(n) && Oe(n, r);
527
+ ne(n) && Oe(n, r);
532
528
  }
533
- else if (ae(e))
529
+ else if (ne(e))
534
530
  e._store && (e._store.validated = !0);
535
531
  else if (e) {
536
532
  var u = S(e);
537
533
  if (typeof u == "function" && u !== e.entries)
538
- for (var f = u.call(e), o; !(o = f.next()).done; )
539
- ae(o.value) && Oe(o.value, r);
534
+ for (var c = u.call(e), o; !(o = c.next()).done; )
535
+ ne(o.value) && Oe(o.value, r);
540
536
  }
541
537
  }
542
538
  }
543
- function or(e) {
539
+ function ar(e) {
544
540
  {
545
541
  var r = e.type;
546
542
  if (r == null || typeof r == "string")
@@ -555,188 +551,188 @@ Check the top-level render call using <` + t + ">.");
555
551
  else
556
552
  return;
557
553
  if (t) {
558
- var n = k(r);
559
- Je(t, e.props, "prop", n, e);
560
- } else if (r.PropTypes !== void 0 && !ne) {
561
- ne = !0;
562
- var u = k(r);
563
- c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
554
+ var n = F(r);
555
+ Be(t, e.props, "prop", n, e);
556
+ } else if (r.PropTypes !== void 0 && !te) {
557
+ te = !0;
558
+ var u = F(r);
559
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
564
560
  }
565
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
+ 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
562
  }
567
563
  }
568
- function ir(e) {
564
+ function or(e) {
569
565
  {
570
566
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
571
567
  var n = r[t];
572
568
  if (n !== "children" && n !== "key") {
573
- W(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(null);
569
+ W(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(null);
574
570
  break;
575
571
  }
576
572
  }
577
- e.ref !== null && (W(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
573
+ e.ref !== null && (W(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
578
574
  }
579
575
  }
580
- var je = {};
581
- function ke(e, r, t, n, u, f) {
576
+ var Ce = {};
577
+ function je(e, r, t, n, u, c) {
582
578
  {
583
- var o = Ye(e);
579
+ var o = We(e);
584
580
  if (!o) {
585
581
  var a = "";
586
582
  (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 _ = nr();
588
- _ ? a += _ : a += Pe();
589
- var d;
590
- e === null ? d = "null" : ee(e) ? d = "array" : e !== void 0 && e.$$typeof === R ? (d = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
583
+ var g = tr();
584
+ g ? a += g : a += Pe();
585
+ var v;
586
+ e === null ? v = "null" : ee(e) ? v = "array" : e !== void 0 && e.$$typeof === _ ? (v = "<" + (F(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : v = 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", v, a);
591
587
  }
592
- var p = tr(e, r, t, u, f);
593
- if (p == null)
594
- return p;
588
+ var b = rr(e, r, t, u, c);
589
+ if (b == null)
590
+ return b;
595
591
  if (o) {
596
- var O = r.children;
597
- if (O !== void 0)
592
+ var w = r.children;
593
+ if (w !== void 0)
598
594
  if (n)
599
- if (ee(O)) {
600
- for (var Y = 0; Y < O.length; Y++)
601
- Ce(O[Y], e);
602
- Object.freeze && Object.freeze(O);
595
+ if (ee(w)) {
596
+ for (var Y = 0; Y < w.length; Y++)
597
+ we(w[Y], e);
598
+ Object.freeze && Object.freeze(w);
603
599
  } else
604
- c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
600
+ 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
601
  else
606
- Ce(O, e);
602
+ we(w, e);
607
603
  }
608
604
  if (N.call(r, "key")) {
609
- var F = k(e), x = Object.keys(r).filter(function(dr) {
610
- return dr !== "key";
611
- }), oe = x.length > 0 ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}";
612
- if (!je[F + oe]) {
613
- var lr = x.length > 0 ? "{" + x.join(": ..., ") + ": ...}" : "{}";
614
- c(`A props object containing a "key" prop is being spread into JSX:
605
+ var I = F(e), P = Object.keys(r).filter(function(lr) {
606
+ return lr !== "key";
607
+ }), ae = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
608
+ if (!Ce[I + ae]) {
609
+ var fr = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
610
+ f(`A props object containing a "key" prop is being spread into JSX:
615
611
  let props = %s;
616
612
  <%s {...props} />
617
613
  React keys must be passed directly to JSX without using spread:
618
614
  let props = %s;
619
- <%s key={someKey} {...props} />`, oe, F, lr, F), je[F + oe] = !0;
615
+ <%s key={someKey} {...props} />`, ae, I, fr, I), Ce[I + ae] = !0;
620
616
  }
621
617
  }
622
- return e === m ? ir(p) : or(p), p;
618
+ return e === y ? or(b) : ar(b), b;
623
619
  }
624
620
  }
625
- function ur(e, r, t) {
626
- return ke(e, r, t, !0);
621
+ function ir(e, r, t) {
622
+ return je(e, r, t, !0);
627
623
  }
628
- function sr(e, r, t) {
629
- return ke(e, r, t, !1);
624
+ function ur(e, r, t) {
625
+ return je(e, r, t, !1);
630
626
  }
631
- var cr = sr, fr = ur;
632
- q.Fragment = m, q.jsx = cr, q.jsxs = fr;
633
- }()), q;
627
+ var sr = ur, cr = ir;
628
+ J.Fragment = y, J.jsx = sr, J.jsxs = cr;
629
+ }()), J;
634
630
  }
635
- process.env.NODE_ENV === "production" ? ue.exports = hr() : ue.exports = _r();
636
- var Tr = ue.exports;
637
- function kr(E) {
631
+ process.env.NODE_ENV === "production" ? oe.exports = _r() : oe.exports = hr();
632
+ var gr = oe.exports;
633
+ function jr(R) {
638
634
  if (typeof Proxy > "u") throw new Error("Proxy is not supported in this environment.");
639
- const R = vr(
635
+ const _ = dr(
640
636
  void 0
641
637
  );
642
- return R.name = E, R;
638
+ return _.name = R, _;
643
639
  }
644
- function xr(E) {
645
- if (Array.isArray(E)) {
646
- const [R, ...C] = E;
647
- return (m, T, g) => {
648
- if (m !== R) return !1;
649
- let y = T, i = g;
640
+ function Tr(R) {
641
+ if (Array.isArray(R)) {
642
+ const [_, ...C] = R;
643
+ return (y, T, E) => {
644
+ if (y !== _) return !1;
645
+ let l = T, i = E;
650
646
  for (const s of C)
651
- y = y == null ? void 0 : y[s], i = i == null ? void 0 : i[s];
652
- return y !== i;
647
+ l = l == null ? void 0 : l[s], i = i == null ? void 0 : i[s];
648
+ return l !== i;
653
649
  };
654
650
  }
655
- return E;
651
+ return R;
656
652
  }
657
- function Dr(E) {
658
- return gr(
653
+ function kr(R) {
654
+ return Rr(
659
655
  ({
660
- children: R,
656
+ children: _,
661
657
  value: C,
662
- onChangeProp: m,
658
+ onChangeProp: y,
663
659
  onChangeReinit: T,
664
- proxyRef: g
660
+ proxyRef: E
665
661
  }) => {
666
- const y = ie({}), i = ie(), s = ie({}), j = Er();
667
- pr(g, () => i.current, [i.current]);
668
- const b = L((v, S, l) => {
669
- const c = mr();
670
- return y.current[c] = {
671
- id: c,
672
- deps: l,
673
- propCallback: v,
662
+ const l = H({}), i = H(), s = H({}), j = mr();
663
+ vr(E, () => i.current, [i.current]);
664
+ const m = V((p, S, d) => {
665
+ const f = yr();
666
+ return l.current[f] = {
667
+ id: f,
668
+ deps: d,
669
+ propCallback: p,
674
670
  reinitCallback: S
675
- }, c;
676
- }, []), h = L((v) => {
677
- delete y.current[v];
678
- }, []), w = L((v, S, l) => {
679
- Object.values(y.current).forEach((c) => {
680
- var D;
681
- const P = (D = c.deps) == null ? void 0 : D.map(xr);
682
- (!P || P.includes(v) && l !== S || P.some(
683
- ($) => V($) && $(v, S, l, i.current)
684
- )) && c.propCallback(v, S, l);
685
- }), V(m) && m(v, S, l);
686
- }, [m]), I = L((v, S) => {
687
- Object.values(y.current).forEach((l) => {
688
- l.reinitCallback(v, S);
689
- }), V(T) && T(v, S);
690
- }, [T]), M = L((v) => {
691
- if (v !== i.current) {
671
+ }, f;
672
+ }, []), h = V((p) => {
673
+ delete l.current[p];
674
+ }, []), x = V((p, S, d) => {
675
+ Object.values(l.current).forEach((f) => {
676
+ var k;
677
+ const O = (k = f.deps) == null ? void 0 : k.map(Tr);
678
+ (!O || O.includes(p) && d !== S || O.some(
679
+ ($) => L($) && $(p, S, d, i.current)
680
+ )) && f.propCallback(p, S, d);
681
+ }), L(y) && y(p, S, d);
682
+ }, [y]), D = V((p, S) => {
683
+ Object.values(l.current).forEach((d) => {
684
+ d.reinitCallback(p, S);
685
+ }), L(T) && T(p, S);
686
+ }, [T]), M = V((p) => {
687
+ if (p !== i.current) {
692
688
  const S = i.current;
693
- v !== null ? i.current = new Proxy(v, {
694
- get: function(l, c) {
695
- const P = Reflect.get(l, c, v);
696
- return V(P) ? P.bind(i.current) : P;
689
+ p !== null ? i.current = new Proxy(p, {
690
+ get: function(d, f) {
691
+ const O = Reflect.get(d, f, p);
692
+ return L(O) ? O.bind(i.current) : O;
697
693
  },
698
- set: function(l, c, P) {
699
- const D = c, $ = l[D];
700
- return Reflect.set(l, D, P, v), P = l[D], w(D, P, $), !0;
694
+ set: function(d, f, O) {
695
+ const k = f, $ = d[k];
696
+ return Reflect.set(d, k, O, p), O = d[k], x(k, O, $), !0;
701
697
  }
702
- }) : i.current = v, I(i.current, S), j();
698
+ }) : i.current = p, D(i.current, S), j();
703
699
  }
704
700
  return s.current.obj = i.current, i.current;
705
- }, [m, T, w]);
706
- return i.current === void 0 && (i.current = M(C)), s.current.obj = i.current, s.current.set = M, s.current.subscribe = b, s.current.unsubscribe = h, /* @__PURE__ */ Tr.jsx(E.Provider, { value: s.current, children: R });
701
+ }, [y, T, x]);
702
+ return i.current === void 0 && (i.current = M(C)), s.current.obj = i.current, s.current.set = M, s.current.subscribe = m, s.current.unsubscribe = h, /* @__PURE__ */ gr.jsx(R.Provider, { value: s.current, children: _ });
707
703
  },
708
704
  ["children", "onChangeProp", "onChangeReinit", "proxyRef"],
709
- E.name + ".Provider"
705
+ R.name + ".Provider"
710
706
  );
711
707
  }
712
- function Ar(E, R = [], C, m, T = !0) {
713
- const g = br(E);
714
- if (g === void 0)
715
- throw new Error(`No ${E.name} provider found.`);
716
- const y = L((s) => {
717
- const j = g.subscribe(
718
- (b, h, w) => {
719
- s(), V(C) && C(b, h, w);
708
+ function Dr(R, _ = [], C, y, T = !0) {
709
+ const E = pr(R);
710
+ if (E === void 0)
711
+ throw new Error(`No ${R.name} provider found.`);
712
+ const l = H({ value: E }), i = V((j) => {
713
+ const m = E.subscribe(
714
+ (h, x, D) => {
715
+ l.current = { value: E }, j(), L(C) && C(h, x, D);
720
716
  },
721
- (b, h) => {
722
- T && s(), V(m) && m(b, h);
717
+ (h, x) => {
718
+ T && (l.current = { value: E }, j()), L(y) && y(h, x);
723
719
  },
724
- R
720
+ _
725
721
  );
726
- return () => g.unsubscribe(j);
727
- }, [R, T, C, m, g]), i = yr(
728
- y,
729
- () => g,
730
- () => g
722
+ return () => E.unsubscribe(m);
723
+ }, [_, T, C, y, E]), s = br(
724
+ i,
725
+ () => l.current,
726
+ () => l.current
731
727
  );
732
- return new Rr(
733
- { value: i.obj, set: i.set },
728
+ return new Er(
729
+ { value: s.value.obj, set: s.value.set },
734
730
  ["value", "set"]
735
731
  );
736
732
  }
737
733
  export {
738
- kr as createProxyContext,
739
- Dr as createProxyContextProvider,
740
- xr as evaluateDependency,
741
- Ar as useProxyContext
734
+ jr as createProxyContext,
735
+ kr as createProxyContextProvider,
736
+ Tr as evaluateDependency,
737
+ Dr as useProxyContext
742
738
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ptolemy2002/react-proxy-context",
3
3
  "private": false,
4
- "version": "2.3.4",
4
+ "version": "2.3.6",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -46,6 +46,7 @@
46
46
  "@types/babel__traverse": "^7.20.6",
47
47
  "@types/eslint__js": "~8.42.3",
48
48
  "@types/is-callable": "~1.1.2",
49
+ "@types/jsdom": "~21.1.7",
49
50
  "@types/less": "~3.0.6",
50
51
  "@types/node": "^22.7.4",
51
52
  "@types/prop-types": "^15.7.13",