@ptolemy2002/react-proxy-context 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +17 -17
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Ie, { useEffect as $e, createContext as br, useRef as X, useImperativeHandle as yr, useCallback as ue, useContext as mr } from "react";
|
|
2
2
|
import { nanoid as Rr } from "nanoid";
|
|
3
|
-
import
|
|
3
|
+
import V from "is-callable";
|
|
4
4
|
import We from "@ptolemy2002/react-force-rerender";
|
|
5
5
|
import gr from "@ptolemy2002/react-hook-result";
|
|
6
6
|
import { partialMemo as hr } from "@ptolemy2002/react-utils";
|
|
@@ -68,14 +68,14 @@ function _r() {
|
|
|
68
68
|
}
|
|
69
69
|
var $ = !1, W = !1, q = !1, Ye = !1, Le = !1, ce;
|
|
70
70
|
ce = Symbol.for("react.module.reference");
|
|
71
|
-
function
|
|
71
|
+
function Ve(e) {
|
|
72
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
|
|
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
76
|
e.$$typeof === ce || e.getModuleId !== void 0));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Me(e, r, t) {
|
|
79
79
|
var n = e.displayName;
|
|
80
80
|
if (n)
|
|
81
81
|
return n;
|
|
@@ -115,7 +115,7 @@ function _r() {
|
|
|
115
115
|
var t = e;
|
|
116
116
|
return fe(t._context) + ".Provider";
|
|
117
117
|
case o:
|
|
118
|
-
return
|
|
118
|
+
return Me(e, e.render, "ForwardRef");
|
|
119
119
|
case P:
|
|
120
120
|
var n = e.displayName || null;
|
|
121
121
|
return n !== null ? n : O(e.type) || "Memo";
|
|
@@ -130,13 +130,13 @@ function _r() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var F = Object.assign,
|
|
133
|
+
var F = Object.assign, M = 0, le, de, ve, pe, be, ye, me;
|
|
134
134
|
function Re() {
|
|
135
135
|
}
|
|
136
136
|
Re.__reactDisabledLog = !0;
|
|
137
137
|
function Ue() {
|
|
138
138
|
{
|
|
139
|
-
if (
|
|
139
|
+
if (M === 0) {
|
|
140
140
|
le = console.log, de = console.info, ve = console.warn, pe = console.error, be = console.group, ye = console.groupCollapsed, me = console.groupEnd;
|
|
141
141
|
var e = {
|
|
142
142
|
configurable: !0,
|
|
@@ -154,12 +154,12 @@ function _r() {
|
|
|
154
154
|
groupEnd: e
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
M++;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
function Ne() {
|
|
161
161
|
{
|
|
162
|
-
if (
|
|
162
|
+
if (M--, M === 0) {
|
|
163
163
|
var e = {
|
|
164
164
|
configurable: !0,
|
|
165
165
|
enumerable: !0,
|
|
@@ -189,7 +189,7 @@ function _r() {
|
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
M < 0 && s("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
var Z = g.ReactCurrentDispatcher, Q;
|
|
@@ -580,7 +580,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
580
580
|
var ke = {};
|
|
581
581
|
function De(e, r, t, n, u, c) {
|
|
582
582
|
{
|
|
583
|
-
var i =
|
|
583
|
+
var i = Ve(e);
|
|
584
584
|
if (!i) {
|
|
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.");
|
|
@@ -675,22 +675,22 @@ function Fr(b) {
|
|
|
675
675
|
R !== null ? o.current = new Proxy(R, {
|
|
676
676
|
get: function(x, g) {
|
|
677
677
|
const s = Reflect.get(x, g, R);
|
|
678
|
-
return
|
|
678
|
+
return V(s) ? s.bind(o.current) : s;
|
|
679
679
|
},
|
|
680
680
|
set: function(x, g, s) {
|
|
681
681
|
const j = g, $ = x[j];
|
|
682
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) =>
|
|
684
|
-
}),
|
|
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
685
|
}
|
|
686
686
|
}) : o.current = R, Object.values(y.current).forEach((x) => {
|
|
687
687
|
x.reinitCallback(o.current, I);
|
|
688
|
-
}),
|
|
688
|
+
}), V(p) && p(o.current, I), v();
|
|
689
689
|
}
|
|
690
690
|
return d.current.obj = o.current, o.current;
|
|
691
691
|
}, [C, p]);
|
|
692
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
|
|
693
|
+
}, ["children", "onChangeProp", "onChangeReinit", "proxyRef"], `${b.name}Provider`);
|
|
694
694
|
}
|
|
695
695
|
function Ar(b, _ = [], k, T, C = !0) {
|
|
696
696
|
const p = mr(b), S = We(), y = X(null);
|
|
@@ -699,10 +699,10 @@ function Ar(b, _ = [], k, T, C = !0) {
|
|
|
699
699
|
return Pr(() => {
|
|
700
700
|
y.current = p == null ? void 0 : p.subscribe(
|
|
701
701
|
(o, d, v) => {
|
|
702
|
-
S(),
|
|
702
|
+
S(), V(k) && k(o, d, v);
|
|
703
703
|
},
|
|
704
704
|
(o, d) => {
|
|
705
|
-
C && S(),
|
|
705
|
+
C && S(), V(T) && T(o, d);
|
|
706
706
|
},
|
|
707
707
|
_
|
|
708
708
|
);
|