@ptolemy2002/react-proxy-context 2.1.2 → 2.1.3

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.
Files changed (2) hide show
  1. package/dist/main.js +304 -300
  2. package/package.json +1 -1
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 Ae, { useEffect as Ie, createContext as br, useRef as H, useImperativeHandle as yr, useCallback as ie, 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 L from "is-callable";
4
+ import $e 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 ue = { exports: {} }, N = {};
8
8
  /**
9
9
  * @license React
10
10
  * react-jsx-runtime.production.min.js
@@ -14,21 +14,21 @@ var se = { exports: {} }, B = {};
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 Fe;
17
+ var De;
18
18
  function Er() {
19
- if (Fe) return B;
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 };
19
+ if (De) return N;
20
+ De = 1;
21
+ var y = Ae, _ = Symbol.for("react.element"), k = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, x = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
22
+ function E(c, s, T) {
23
+ var v, S = {}, O = null, b = null;
24
+ T !== void 0 && (O = "" + T), s.key !== void 0 && (O = "" + s.key), s.ref !== void 0 && (b = s.ref);
25
+ for (v in s) h.call(s, v) && !R.hasOwnProperty(v) && (S[v] = s[v]);
26
+ if (c && c.defaultProps) for (v in s = c.defaultProps, s) S[v] === void 0 && (S[v] = s[v]);
27
+ return { $$typeof: _, type: c, key: O, ref: b, props: S, _owner: x.current };
28
28
  }
29
- return B.Fragment = k, B.jsx = S, B.jsxs = S, B;
29
+ return N.Fragment = k, N.jsx = E, N.jsxs = E, N;
30
30
  }
31
- var J = {};
31
+ var B = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -38,91 +38,91 @@ 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 Fe;
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 Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var y = Ae, _ = Symbol.for("react.element"), k = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), c = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), D = Symbol.iterator, C = "@@iterator";
45
+ function j(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 p = y.__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();
62
- u !== "" && (r += "%s", t = t.concat([u]));
63
- var c = t.map(function(i) {
64
- return String(i);
61
+ var n = p.ReactDebugCurrentFrame, i = n.getStackAddendum();
62
+ i !== "" && (r += "%s", t = t.concat([i]));
63
+ var u = t.map(function(o) {
64
+ return String(o);
65
65
  });
66
- c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
66
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
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 $ = !1, J = !1, We = !1, Ye = !1, Le = !1, se;
70
+ se = 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 === h || e === R || Le || e === x || e === T || e === v || Ye || e === b || $ || J || We || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === S || e.$$typeof === E || e.$$typeof === c || 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 === se || e.getModuleId !== void 0));
77
77
  }
78
78
  function Me(e, r, t) {
79
79
  var n = e.displayName;
80
80
  if (n)
81
81
  return n;
82
- var u = r.displayName || r.name || "";
83
- return u !== "" ? t + "(" + u + ")" : t;
82
+ var i = r.displayName || r.name || "";
83
+ return i !== "" ? t + "(" + i + ")" : t;
84
84
  }
85
- function fe(e) {
85
+ function ce(e) {
86
86
  return e.displayName || "Context";
87
87
  }
88
- function O(e) {
88
+ function w(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 h:
97
97
  return "Fragment";
98
98
  case k:
99
99
  return "Portal";
100
- case p:
100
+ case R:
101
101
  return "Profiler";
102
- case C:
102
+ case x:
103
103
  return "StrictMode";
104
- case d:
104
+ case T:
105
105
  return "Suspense";
106
106
  case v:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof e == "object")
110
110
  switch (e.$$typeof) {
111
- case y:
111
+ case c:
112
112
  var r = e;
113
- return fe(r) + ".Consumer";
114
- case S:
113
+ return ce(r) + ".Consumer";
114
+ case E:
115
115
  var t = e;
116
- return fe(t._context) + ".Provider";
117
- case o:
116
+ return ce(t._context) + ".Provider";
117
+ case s:
118
118
  return Me(e, e.render, "ForwardRef");
119
- case P:
119
+ case S:
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 : w(e.type) || "Memo";
122
+ case O: {
123
+ var i = e, u = i._payload, o = i._init;
124
124
  try {
125
- return O(i(c));
125
+ return w(o(u));
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 F = Object.assign, V = 0, fe, le, de, ve, pe, be, ye;
134
+ function me() {
135
135
  }
136
- Re.__reactDisabledLog = !0;
136
+ me.__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
+ fe = console.log, le = console.info, de = console.warn, ve = console.error, pe = console.group, be = console.groupCollapsed, ye = console.groupEnd;
141
141
  var e = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
144
- value: Re,
144
+ value: me,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -154,12 +154,12 @@ 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,
@@ -167,186 +167,186 @@ function _r() {
167
167
  };
168
168
  Object.defineProperties(console, {
169
169
  log: F({}, e, {
170
- value: le
170
+ value: fe
171
171
  }),
172
172
  info: F({}, e, {
173
- value: de
173
+ value: le
174
174
  }),
175
175
  warn: F({}, e, {
176
- value: ve
176
+ value: de
177
177
  }),
178
178
  error: F({}, e, {
179
- value: pe
179
+ value: ve
180
180
  }),
181
181
  group: F({}, e, {
182
- value: be
182
+ value: pe
183
183
  }),
184
184
  groupCollapsed: F({}, e, {
185
- value: ye
185
+ value: be
186
186
  }),
187
187
  groupEnd: F({}, e, {
188
- value: me
188
+ value: ye
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 X = p.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
- } catch (u) {
202
- var n = u.stack.trim().match(/\n( *(at )?)/);
203
- Q = n && n[1] || "";
201
+ } catch (i) {
202
+ var n = i.stack.trim().match(/\n( *(at )?)/);
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
211
  var Be = typeof WeakMap == "function" ? WeakMap : Map;
212
- G = new Be();
212
+ K = new Be();
213
213
  }
214
- function ge(e, r) {
215
- if (!e || ee)
214
+ function Re(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;
224
- var u = Error.prepareStackTrace;
223
+ Q = !0;
224
+ var i = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
- var c;
227
- c = Z.current, Z.current = null, Ue();
226
+ var u;
227
+ u = X.current, X.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 (g) {
241
+ n = g;
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 (g) {
248
+ n = g;
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 (g) {
256
+ n = g;
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(`
260
+ } catch (g) {
261
+ if (g && n && typeof g.stack == "string") {
262
+ for (var a = g.stack.split(`
263
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)
264
+ `), l = a.length - 1, d = m.length - 1; l >= 1 && d >= 0 && a[l] !== m[d]; )
265
+ d--;
266
+ for (; l >= 1 && d >= 0; l--, d--)
267
+ if (a[l] !== m[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] !== m[d]) {
271
+ var P = `
272
+ ` + a[l].replace(" at new ", " at ");
273
+ return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, P), P;
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
+ Q = !1, X.current = u, Ne(), Error.prepareStackTrace = i;
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 Y = e ? e.displayName || e.name : "", A = Y ? q(Y) : "";
283
+ return typeof e == "function" && K.set(e, A), A;
284
284
  }
285
285
  function Je(e, r, t) {
286
- return ge(e, !1);
286
+ return Re(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 G(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 Re(e, qe(e));
297
297
  if (typeof e == "string")
298
- return K(e);
298
+ return q(e);
299
299
  switch (e) {
300
- case d:
301
- return K("Suspense");
300
+ case T:
301
+ return q("Suspense");
302
302
  case v:
303
- return K("SuspenseList");
303
+ return q("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: {
312
- var n = e, u = n._payload, c = n._init;
309
+ case S:
310
+ return G(e.type, r, t);
311
+ case O: {
312
+ var n = e, i = n._payload, u = n._init;
313
313
  try {
314
- return z(c(u), r, t);
314
+ return G(u(i), 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, ge = {}, he = p.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
- Ee.setExtraStackFrame(t);
324
+ var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
325
+ he.setExtraStackFrame(t);
326
326
  } else
327
- Ee.setExtraStackFrame(null);
327
+ he.setExtraStackFrame(null);
328
328
  }
329
- function Ke(e, r, t, n, u) {
329
+ function Ke(e, r, t, n, i) {
330
330
  {
331
- var c = Function.call.bind(U);
332
- for (var i in e)
333
- if (c(e, i)) {
331
+ var u = Function.call.bind(M);
332
+ for (var o in e)
333
+ if (u(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`.");
336
+ if (typeof e[o] != "function") {
337
+ var m = 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
338
  throw m.name = "Invariant Violation", m;
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) && (z(i), 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 ge) && (ge[a.message] = !0, z(i), f("Failed %s type: %s", t, a.message), z(null));
345
345
  }
346
346
  }
347
347
  }
348
348
  var Ge = Array.isArray;
349
- function re(e) {
349
+ function ee(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 Ee(e), !1;
361
361
  } catch {
362
362
  return !0;
363
363
  }
364
364
  }
365
- function _e(e) {
365
+ function Ee(e) {
366
366
  return "" + e;
367
367
  }
368
- function Te(e) {
368
+ function _e(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)), Ee(e);
371
371
  }
372
- var N = g.ReactCurrentOwner, Xe = {
372
+ var U = p.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
+ }, Te, Pe, re;
378
+ re = {};
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 = w(U.current.type);
398
+ re[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', w(U.current.type), e.ref), re[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
+ Te || (Te = !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
+ Pe || (Pe = !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,7 +420,7 @@ 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, i, u, o) {
424
424
  var a = {
425
425
  // This tag allows us to uniquely identify this as a React Element
426
426
  $$typeof: _,
@@ -428,9 +428,9 @@ function _r() {
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
- _owner: c
433
+ _owner: u
434
434
  };
435
435
  return a._store = {}, Object.defineProperty(a._store, "validated", {
436
436
  configurable: !1,
@@ -446,44 +446,44 @@ function _r() {
446
446
  configurable: !1,
447
447
  enumerable: !1,
448
448
  writable: !1,
449
- value: u
449
+ value: i
450
450
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
451
451
  };
452
- function ar(e, r, t, n, u) {
452
+ function ar(e, r, t, n, i) {
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));
456
- for (c in r)
457
- U.call(r, c) && !Xe.hasOwnProperty(c) && (i[c] = r[c]);
454
+ var u, o = {}, a = null, m = null;
455
+ t !== void 0 && (_e(t), a = "" + t), Qe(r) && (_e(r.key), a = "" + r.key), Ze(r) && (m = r.ref, er(r, i));
456
+ for (u in r)
457
+ M.call(r, u) && !Xe.hasOwnProperty(u) && (o[u] = r[u]);
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 (u in l)
461
+ o[u] === void 0 && (o[u] = l[u]);
462
462
  }
463
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);
464
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
+ a && rr(o, d), m && tr(o, d);
466
466
  }
467
- return nr(e, a, m, u, n, N.current, i);
467
+ return nr(e, a, m, i, n, U.current, o);
468
468
  }
469
469
  }
470
- var ne = g.ReactCurrentOwner, Ce = g.ReactDebugCurrentFrame;
471
- function Y(e) {
470
+ var te = p.ReactCurrentOwner, Se = p.ReactDebugCurrentFrame;
471
+ function W(e) {
472
472
  if (e) {
473
- var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
474
- Ce.setExtraStackFrame(t);
473
+ var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
474
+ Se.setExtraStackFrame(t);
475
475
  } else
476
- Ce.setExtraStackFrame(null);
476
+ Se.setExtraStackFrame(null);
477
477
  }
478
- var ae;
479
- ae = !1;
480
- function oe(e) {
478
+ var ne;
479
+ ne = !1;
480
+ function ae(e) {
481
481
  return typeof e == "object" && e !== null && e.$$typeof === _;
482
482
  }
483
- function Se() {
483
+ function Ce() {
484
484
  {
485
- if (ne.current) {
486
- var e = O(ne.current.type);
485
+ if (te.current) {
486
+ var e = w(te.current.type);
487
487
  if (e)
488
488
  return `
489
489
 
@@ -495,10 +495,10 @@ Check the render method of \`` + e + "`.";
495
495
  function or(e) {
496
496
  return "";
497
497
  }
498
- var Oe = {};
498
+ var xe = {};
499
499
  function ir(e) {
500
500
  {
501
- var r = Se();
501
+ var r = Ce();
502
502
  if (!r) {
503
503
  var t = typeof e == "string" ? e : e.displayName || e.name;
504
504
  t && (r = `
@@ -508,35 +508,35 @@ Check the top-level render call using <` + t + ">.");
508
508
  return r;
509
509
  }
510
510
  }
511
- function we(e, r) {
511
+ function Oe(e, r) {
512
512
  {
513
513
  if (!e._store || e._store.validated || e.key != null)
514
514
  return;
515
515
  e._store.validated = !0;
516
516
  var t = ir(r);
517
- if (Oe[t])
517
+ if (xe[t])
518
518
  return;
519
- Oe[t] = !0;
519
+ xe[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 !== te.current && (n = " It was passed a child from " + w(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
522
  }
523
523
  }
524
- function je(e, r) {
524
+ function we(e, r) {
525
525
  {
526
526
  if (typeof e != "object")
527
527
  return;
528
- if (re(e))
528
+ if (ee(e))
529
529
  for (var t = 0; t < e.length; t++) {
530
530
  var n = e[t];
531
- oe(n) && we(n, r);
531
+ ae(n) && Oe(n, r);
532
532
  }
533
- else if (oe(e))
533
+ else if (ae(e))
534
534
  e._store && (e._store.validated = !0);
535
535
  else if (e) {
536
- var u = x(e);
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);
536
+ var i = j(e);
537
+ if (typeof i == "function" && i !== e.entries)
538
+ for (var u = i.call(e), o; !(o = u.next()).done; )
539
+ ae(o.value) && Oe(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 === S))
554
554
  t = r.propTypes;
555
555
  else
556
556
  return;
557
557
  if (t) {
558
- var n = O(r);
558
+ var n = w(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 && !ne) {
561
+ ne = !0;
562
+ var i = w(r);
563
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "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,146 +570,150 @@ 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
+ W(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(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 && (W(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
578
578
  }
579
579
  }
580
- var ke = {};
581
- function De(e, r, t, n, u, c) {
580
+ var je = {};
581
+ function ke(e, r, t, n, i, u) {
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
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);
588
+ m ? a += m : a += Ce();
589
+ var l;
590
+ e === null ? l = "null" : ee(e) ? l = "array" : e !== void 0 && e.$$typeof === _ ? (l = "<" + (w(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, i, u);
593
+ if (d == null)
594
+ return d;
595
+ if (o) {
596
+ var P = r.children;
597
+ if (P !== 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 (ee(P)) {
600
+ for (var Y = 0; Y < P.length; Y++)
601
+ we(P[Y], e);
602
+ Object.freeze && Object.freeze(P);
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
+ we(P, 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 A = w(e), g = 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
+ }), oe = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
612
+ if (!je[A + oe]) {
613
+ var vr = g.length > 0 ? "{" + g.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} />`, oe, A, vr, A), je[A + oe] = !0;
620
620
  }
621
621
  }
622
- return e === T ? sr(l) : ur(l), l;
622
+ return e === h ? 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 ke(e, r, t, !0);
627
627
  }
628
628
  function fr(e, r, t) {
629
- return De(e, r, t, !1);
629
+ return ke(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 = h, 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" ? ue.exports = Er() : ue.exports = _r();
636
+ var Tr = ue.exports;
637
+ function Pr(y) {
638
+ Ie(() => {
639
+ y();
640
640
  }, []);
641
641
  }
642
- function xr(b) {
643
- $e(() => b, []);
642
+ function Sr(y) {
643
+ Ie(() => y, []);
644
644
  }
645
- function Dr(b) {
645
+ function Dr(y) {
646
646
  if (typeof Proxy > "u") throw new Error("Proxy is not supported in this environment.");
647
647
  const _ = br(
648
648
  void 0
649
649
  );
650
- return _.name = b, _;
650
+ return _.name = y, _;
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 Fr(y) {
653
+ return hr(
654
+ ({
655
+ children: _,
656
+ value: k,
657
+ onChangeProp: h,
658
+ onChangeReinit: x,
659
+ proxyRef: R
660
+ }) => {
661
+ const E = H({}), c = H(), s = H({}), T = $e();
662
+ yr(R, () => c.current, [c.current]);
663
+ const v = ie((b, D, C) => {
664
+ const j = Rr();
665
+ return E.current[j] = {
666
+ id: j,
667
+ deps: C,
668
+ propCallback: b,
669
+ reinitCallback: D
670
+ }, j;
671
+ }, []), S = ie((b) => {
672
+ delete E.current[b];
673
+ }, []), O = ie((b) => {
674
+ if (b !== c.current) {
675
+ const D = c.current;
676
+ b !== null ? c.current = new Proxy(b, {
677
+ get: function(C, j) {
678
+ const p = Reflect.get(C, j, b);
679
+ return L(p) ? p.bind(c.current) : p;
680
+ },
681
+ set: function(C, j, p) {
682
+ const f = j, I = C[f];
683
+ return Reflect.set(C, f, p, b), p = C[f], Object.values(E.current).forEach(($) => {
684
+ (!$.deps || $.deps.includes(f) && I !== p || $.deps.some((J) => L(J) && J(f, p, I, b))) && $.propCallback(f, p, I);
685
+ }), L(h) && h(f, p, I), !0;
686
+ }
687
+ }) : c.current = b, Object.values(E.current).forEach((C) => {
688
+ C.reinitCallback(c.current, D);
689
+ }), L(x) && x(c.current, D), T();
690
+ }
691
+ return s.current.obj = c.current, c.current;
692
+ }, [h, x]);
693
+ return c.current === void 0 && (c.current = O(k)), s.current.obj = c.current, s.current.set = O, s.current.subscribe = v, s.current.unsubscribe = S, /* @__PURE__ */ Tr.jsx(y.Provider, { value: s.current, children: _ });
694
+ },
695
+ ["children", "onChangeProp", "onChangeReinit", "proxyRef"],
696
+ y.name + ".Provider"
697
+ );
694
698
  }
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.`);
699
+ function Ar(y, _ = [], k, h, x = !0) {
700
+ const R = mr(y), E = $e(), c = H(null);
701
+ if (R === void 0)
702
+ throw new Error(`No ${y.name} provider found.`);
699
703
  return Pr(() => {
700
- y.current = p == null ? void 0 : p.subscribe(
701
- (o, d, v) => {
702
- S(), V(k) && k(o, d, v);
704
+ c.current = R == null ? void 0 : R.subscribe(
705
+ (s, T, v) => {
706
+ E(), L(k) && k(s, T, v);
703
707
  },
704
- (o, d) => {
705
- C && S(), V(T) && T(o, d);
708
+ (s, T) => {
709
+ x && E(), L(h) && h(s, T);
706
710
  },
707
711
  _
708
712
  );
709
- }), xr(() => {
710
- p.unsubscribe(y.current);
713
+ }), Sr(() => {
714
+ R.unsubscribe(c.current);
711
715
  }), new gr(
712
- { value: p.obj, set: p.set },
716
+ { value: R.obj, set: R.set },
713
717
  ["value", "set"]
714
718
  );
715
719
  }
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.1.3",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",