@ptolemy2002/react-proxy-context 2.3.5 → 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 X, 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 Rr from "@ptolemy2002/react-force-rerender";
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
5
  import Er from "@ptolemy2002/react-hook-result";
6
- import { partialMemo as gr } from "@ptolemy2002/react-utils";
7
- var ue = { exports: {} }, J = {};
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, g = Symbol.for("react.element"), C = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, T = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
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
22
  function l(i, s, j) {
23
- var m, h = {}, x = null, A = null;
24
- j !== void 0 && (x = "" + j), s.key !== void 0 && (x = "" + s.key), s.ref !== void 0 && (A = s.ref);
25
- for (m in s) y.call(s, m) && !R.hasOwnProperty(m) && (h[m] = s[m]);
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
26
  if (i && i.defaultProps) for (m in s = i.defaultProps, s) h[m] === void 0 && (h[m] = s[m]);
27
- return { $$typeof: g, type: i, key: x, ref: A, props: h, _owner: T.current };
27
+ return { $$typeof: _, type: i, key: x, ref: D, props: h, _owner: T.current };
28
28
  }
29
- return J.Fragment = C, J.jsx = l, J.jsxs = l, 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,57 +38,57 @@ 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, g = Symbol.for("react.element"), C = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), R = 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"), A = Symbol.for("react.offscreen"), M = Symbol.iterator, p = "@@iterator";
45
- function P(e) {
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
+ function S(e) {
46
46
  if (e === null || typeof e != "object")
47
47
  return null;
48
48
  var r = M && e[M] || e[p];
49
49
  return typeof r == "function" ? r : null;
50
50
  }
51
- var d = 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
- w("error", e, t);
56
+ O("error", e, t);
57
57
  }
58
58
  }
59
- function w(e, r, t) {
59
+ function O(e, r, t) {
60
60
  {
61
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 === y || e === R || We || e === T || e === j || e === m || $e || e === A || D || $ || Ie || 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
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;
@@ -97,7 +97,7 @@ function _r() {
97
97
  return "Fragment";
98
98
  case C:
99
99
  return "Portal";
100
- case R:
100
+ case E:
101
101
  return "Profiler";
102
102
  case T:
103
103
  return "StrictMode";
@@ -110,19 +110,19 @@ function _r() {
110
110
  switch (e.$$typeof) {
111
111
  case i:
112
112
  var r = e;
113
- return ce(r) + ".Consumer";
113
+ return ue(r) + ".Consumer";
114
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";
121
+ return n !== null ? n : F(e.type) || "Memo";
122
122
  case x: {
123
- var u = e, f = u._payload, o = u._init;
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 F = 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 = {
@@ -166,65 +166,65 @@ function _r() {
166
166
  writable: !0
167
167
  };
168
168
  Object.defineProperties(console, {
169
- log: F({}, e, {
169
+ log: A({}, e, {
170
+ value: se
171
+ }),
172
+ info: A({}, e, {
173
+ value: ce
174
+ }),
175
+ warn: A({}, e, {
170
176
  value: fe
171
177
  }),
172
- info: F({}, e, {
178
+ error: A({}, e, {
173
179
  value: le
174
180
  }),
175
- warn: F({}, e, {
181
+ group: A({}, e, {
176
182
  value: de
177
183
  }),
178
- error: F({}, e, {
184
+ groupCollapsed: A({}, e, {
179
185
  value: ve
180
186
  }),
181
- group: F({}, e, {
187
+ groupEnd: A({}, e, {
182
188
  value: pe
183
- }),
184
- groupCollapsed: F({}, e, {
185
- value: be
186
- }),
187
- groupEnd: F({}, e, {
188
- value: ye
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 Z = d.ReactCurrentDispatcher, Q;
196
- function K(e, r, t) {
195
+ var X = d.ReactCurrentDispatcher, Z;
196
+ function q(e, r, t) {
197
197
  {
198
- if (Q === void 0)
198
+ if (Z === 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
+ Z = n && n[1] || "";
204
204
  }
205
205
  return `
206
- ` + Q + e;
206
+ ` + Z + e;
207
207
  }
208
208
  }
209
- var ee = !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 Re(e, r) {
215
- if (!e || ee)
214
+ function ye(e, r) {
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
  }
222
222
  var n;
223
- ee = !0;
223
+ Q = !0;
224
224
  var u = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
- var f;
227
- f = Z.current, Z.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 (S) {
241
- n = S;
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 (S) {
248
- n = S;
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 (S) {
256
- n = S;
255
+ } catch (P) {
256
+ n = P;
257
257
  }
258
258
  e();
259
259
  }
260
- } catch (S) {
261
- if (S && n && typeof S.stack == "string") {
262
- for (var a = S.stack.split(`
263
- `), _ = n.stack.split(`
264
- `), v = a.length - 1, b = _.length - 1; v >= 1 && b >= 0 && a[v] !== _[b]; )
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
265
  b--;
266
266
  for (; v >= 1 && b >= 0; v--, b--)
267
- if (a[v] !== _[b]) {
267
+ if (a[v] !== g[b]) {
268
268
  if (v !== 1 || b !== 1)
269
269
  do
270
- if (v--, b--, b < 0 || a[v] !== _[b]) {
271
- var O = `
270
+ if (v--, b--, b < 0 || a[v] !== g[b]) {
271
+ var w = `
272
272
  ` + a[v].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;
273
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, w), w;
274
274
  }
275
275
  while (v >= 1 && b >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- ee = !1, Z.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 : "", I = Y ? K(Y) : "";
283
- return typeof e == "function" && G.set(e, I), I;
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 Re(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 Re(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");
301
+ return q("Suspense");
302
302
  case m:
303
- return K("SuspenseList");
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);
310
+ return G(e.type, r, t);
311
311
  case x: {
312
- var n = e, u = n._payload, f = n._init;
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, Ee = {}, ge = d.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
341
  } catch (v) {
342
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 Ee) && (Ee[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;
349
- function re(e) {
350
- return qe(e);
348
+ var Je = Array.isArray;
349
+ function ee(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 = d.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, te;
378
- te = {};
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
- te[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), te[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: g,
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
455
  var v = e.defaultProps;
460
- for (f in v)
461
- o[f] === void 0 && (o[f] = v[f]);
456
+ for (c in v)
457
+ o[c] === void 0 && (o[c] = v[c]);
462
458
  }
463
- if (a || _) {
459
+ if (a || g) {
464
460
  var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
- a && Qe(o, b), _ && er(o, b);
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 ne = d.ReactCurrentOwner, Se = d.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 ae;
479
- ae = !1;
480
- function oe(e) {
481
- return typeof e == "object" && e !== null && e.$$typeof === g;
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 (ne.current) {
486
- var e = k(ne.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 !== ne.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
- if (re(e))
524
+ if (ee(e))
529
525
  for (var t = 0; t < e.length; t++) {
530
526
  var n = e[t];
531
- oe(n) && Oe(n, r);
527
+ ne(n) && Oe(n, r);
532
528
  }
533
- else if (oe(e))
529
+ else if (ne(e))
534
530
  e._store && (e._store.validated = !0);
535
531
  else if (e) {
536
- var u = P(e);
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
- oe(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,176 +551,176 @@ 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 && !ae) {
561
- ae = !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();
583
+ var g = tr();
584
+ g ? a += g : a += Pe();
589
585
  var v;
590
- e === null ? v = "null" : re(e) ? v = "array" : e !== void 0 && e.$$typeof === g ? (v = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : v = 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", v, a);
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 b = tr(e, r, t, u, f);
588
+ var b = rr(e, r, t, u, c);
593
589
  if (b == null)
594
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 (re(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 I = k(e), S = Object.keys(r).filter(function(dr) {
610
- return dr !== "key";
611
- }), ie = S.length > 0 ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}";
612
- if (!je[I + ie]) {
613
- var lr = S.length > 0 ? "{" + S.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} />`, ie, I, lr, I), je[I + ie] = !0;
615
+ <%s key={someKey} {...props} />`, ae, I, fr, I), Ce[I + ae] = !0;
620
616
  }
621
617
  }
622
- return e === y ? ir(b) : or(b), b;
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 = y, 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 g = vr(
635
+ const _ = dr(
640
636
  void 0
641
637
  );
642
- return g.name = E, g;
638
+ return _.name = R, _;
643
639
  }
644
- function xr(E) {
645
- if (Array.isArray(E)) {
646
- const [g, ...C] = E;
647
- return (y, T, R) => {
648
- if (y !== g) return !1;
649
- let l = T, i = R;
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
647
  l = l == null ? void 0 : l[s], i = i == null ? void 0 : i[s];
652
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: g,
656
+ children: _,
661
657
  value: C,
662
658
  onChangeProp: y,
663
659
  onChangeReinit: T,
664
- proxyRef: R
660
+ proxyRef: E
665
661
  }) => {
666
- const l = X({}), i = X(), s = X({}), j = Rr();
667
- pr(R, () => i.current, [i.current]);
668
- const m = L((p, P, d) => {
669
- const c = mr();
670
- return l.current[c] = {
671
- id: c,
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,
672
668
  deps: d,
673
669
  propCallback: p,
674
- reinitCallback: P
675
- }, c;
676
- }, []), h = L((p) => {
670
+ reinitCallback: S
671
+ }, f;
672
+ }, []), h = V((p) => {
677
673
  delete l.current[p];
678
- }, []), x = L((p, P, d) => {
679
- Object.values(l.current).forEach((c) => {
680
- var D;
681
- const w = (D = c.deps) == null ? void 0 : D.map(xr);
682
- (!w || w.includes(p) && d !== P || w.some(
683
- ($) => V($) && $(p, P, d, i.current)
684
- )) && c.propCallback(p, P, d);
685
- }), V(y) && y(p, P, d);
686
- }, [y]), A = L((p, 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) => {
687
683
  Object.values(l.current).forEach((d) => {
688
- d.reinitCallback(p, P);
689
- }), V(T) && T(p, P);
690
- }, [T]), M = L((p) => {
684
+ d.reinitCallback(p, S);
685
+ }), L(T) && T(p, S);
686
+ }, [T]), M = V((p) => {
691
687
  if (p !== i.current) {
692
- const P = i.current;
688
+ const S = i.current;
693
689
  p !== null ? i.current = new Proxy(p, {
694
- get: function(d, c) {
695
- const w = Reflect.get(d, c, p);
696
- return V(w) ? w.bind(i.current) : w;
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(d, c, w) {
699
- const D = c, $ = d[D];
700
- return Reflect.set(d, D, w, p), w = d[D], x(D, w, $), !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 = p, A(i.current, P), j();
698
+ }) : i.current = p, D(i.current, S), j();
703
699
  }
704
700
  return s.current.obj = i.current, i.current;
705
701
  }, [y, T, x]);
706
- 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__ */ Tr.jsx(E.Provider, { value: s.current, children: g });
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, g = [], C, y, T = !0) {
713
- const R = br(E);
714
- if (R === void 0)
715
- throw new Error(`No ${E.name} provider found.`);
716
- const l = X({ value: R }), i = L((j) => {
717
- const m = R.subscribe(
718
- (h, x, A) => {
719
- l.current = { value: R }, j(), V(C) && C(h, x, A);
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
717
  (h, x) => {
722
- T && (l.current = { value: R }, j()), V(y) && y(h, x);
718
+ T && (l.current = { value: E }, j()), L(y) && y(h, x);
723
719
  },
724
- g
720
+ _
725
721
  );
726
- return () => R.unsubscribe(m);
727
- }, [g, T, C, y, R]), s = yr(
722
+ return () => E.unsubscribe(m);
723
+ }, [_, T, C, y, E]), s = br(
728
724
  i,
729
725
  () => l.current,
730
726
  () => l.current
@@ -735,8 +731,8 @@ function Ar(E, g = [], C, y, T = !0) {
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.5",
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",