cross-state 0.37.12 → 0.37.13
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/cjs/diff.cjs +6 -2
- package/dist/cjs/diff.cjs.map +1 -1
- package/dist/cjs/hash.cjs +5 -2
- package/dist/cjs/hash.cjs.map +1 -1
- package/dist/cjs/index.cjs +18 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/mutative/index.cjs +8 -3
- package/dist/cjs/mutative/index.cjs.map +1 -1
- package/dist/cjs/mutative/register.cjs +5 -3
- package/dist/cjs/mutative/register.cjs.map +1 -1
- package/dist/cjs/mutativeMethods.cjs +5 -2
- package/dist/cjs/mutativeMethods.cjs.map +1 -1
- package/dist/cjs/patches/index.cjs +7 -3
- package/dist/cjs/patches/index.cjs.map +1 -1
- package/dist/cjs/patches/register.cjs +5 -3
- package/dist/cjs/patches/register.cjs.map +1 -1
- package/dist/cjs/propAccess.cjs +6 -1
- package/dist/cjs/propAccess.cjs.map +1 -1
- package/dist/cjs/react/index.cjs +38 -36
- package/dist/cjs/react/index.cjs.map +1 -1
- package/dist/cjs/react/register.cjs +6 -4
- package/dist/cjs/react/register.cjs.map +1 -1
- package/dist/cjs/scope.cjs +32 -43
- package/dist/cjs/scope.cjs.map +1 -1
- package/dist/cjs/store.cjs +53 -46
- package/dist/cjs/store.cjs.map +1 -1
- package/dist/cjs/storeMethods.cjs +467 -341
- package/dist/cjs/storeMethods.cjs.map +1 -1
- package/dist/cjs/urlStore.cjs +9 -6
- package/dist/cjs/urlStore.cjs.map +1 -1
- package/dist/es/diff.mjs +5 -5
- package/dist/es/diff.mjs.map +1 -1
- package/dist/es/hash.mjs +4 -4
- package/dist/es/hash.mjs.map +1 -1
- package/dist/es/index.mjs +17 -42
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/mutative/index.mjs +1 -4
- package/dist/es/mutative/index.mjs.map +1 -1
- package/dist/es/mutative/register.mjs +3 -2
- package/dist/es/mutative/register.mjs.map +1 -1
- package/dist/es/mutativeMethods.mjs +4 -4
- package/dist/es/mutativeMethods.mjs.map +1 -1
- package/dist/es/patches/index.mjs +4 -4
- package/dist/es/patches/index.mjs.map +1 -1
- package/dist/es/patches/register.mjs +3 -2
- package/dist/es/patches/register.mjs.map +1 -1
- package/dist/es/propAccess.mjs +5 -12
- package/dist/es/propAccess.mjs.map +1 -1
- package/dist/es/react/index.mjs +36 -52
- package/dist/es/react/index.mjs.map +1 -1
- package/dist/es/react/register.mjs +4 -3
- package/dist/es/react/register.mjs.map +1 -1
- package/dist/es/scope.mjs +31 -52
- package/dist/es/scope.mjs.map +1 -1
- package/dist/es/store.mjs +52 -62
- package/dist/es/store.mjs.map +1 -1
- package/dist/es/storeMethods.mjs +455 -341
- package/dist/es/storeMethods.mjs.map +1 -1
- package/dist/es/urlStore.mjs +5 -7
- package/dist/es/urlStore.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const store = require('./store.cjs');
|
|
4
|
+
const require$$0 = require('react');
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const propAccess = require('./propAccess.cjs');
|
|
7
|
+
const hash = require('./hash.cjs');
|
|
8
|
+
|
|
7
9
|
const unwrapProxySymbol = /* @__PURE__ */ Symbol("unwrapProxy");
|
|
8
10
|
function trackingProxy(value, equals = propAccess.deepEqual) {
|
|
9
11
|
if (!propAccess.isPlainObject(value) && !Array.isArray(value)) {
|
|
@@ -76,10 +78,15 @@ function trackingProxy(value, equals = propAccess.deepEqual) {
|
|
|
76
78
|
}
|
|
77
79
|
];
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
|
|
82
|
+
var withSelector = {exports: {}};
|
|
83
|
+
|
|
80
84
|
var withSelector_production_min = {};
|
|
81
|
-
|
|
85
|
+
|
|
86
|
+
var shim = {exports: {}};
|
|
87
|
+
|
|
82
88
|
var useSyncExternalStoreShim_production_min = {};
|
|
89
|
+
|
|
83
90
|
/**
|
|
84
91
|
* @license React
|
|
85
92
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -89,50 +96,19 @@ var useSyncExternalStoreShim_production_min = {};
|
|
|
89
96
|
* This source code is licensed under the MIT license found in the
|
|
90
97
|
* LICENSE file in the root directory of this source tree.
|
|
91
98
|
*/
|
|
99
|
+
|
|
92
100
|
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
|
|
102
|
-
function q(a, b) {
|
|
103
|
-
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
104
|
-
n(function() {
|
|
105
|
-
c.value = d;
|
|
106
|
-
c.getSnapshot = b;
|
|
107
|
-
r(c) && g({ inst: c });
|
|
108
|
-
}, [a, d, b]);
|
|
109
|
-
m(function() {
|
|
110
|
-
r(c) && g({ inst: c });
|
|
111
|
-
return a(function() {
|
|
112
|
-
r(c) && g({ inst: c });
|
|
113
|
-
});
|
|
114
|
-
}, [a]);
|
|
115
|
-
p(d);
|
|
116
|
-
return d;
|
|
117
|
-
}
|
|
118
|
-
function r(a) {
|
|
119
|
-
var b = a.getSnapshot;
|
|
120
|
-
a = a.value;
|
|
121
|
-
try {
|
|
122
|
-
var d = b();
|
|
123
|
-
return !k(a, d);
|
|
124
|
-
} catch (f) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function t(a, b) {
|
|
129
|
-
return b();
|
|
130
|
-
}
|
|
131
|
-
var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
|
|
132
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
|
|
133
|
-
return useSyncExternalStoreShim_production_min;
|
|
101
|
+
|
|
102
|
+
function requireUseSyncExternalStoreShim_production_min () {
|
|
103
|
+
if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
|
|
104
|
+
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
105
|
+
var e=require$$0;function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
|
|
106
|
+
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
|
|
107
|
+
return useSyncExternalStoreShim_production_min;
|
|
134
108
|
}
|
|
109
|
+
|
|
135
110
|
var useSyncExternalStoreShim_development = {};
|
|
111
|
+
|
|
136
112
|
/**
|
|
137
113
|
* @license React
|
|
138
114
|
* use-sync-external-store-shim.development.js
|
|
@@ -142,139 +118,255 @@ var useSyncExternalStoreShim_development = {};
|
|
|
142
118
|
* This source code is licensed under the MIT license found in the
|
|
143
119
|
* LICENSE file in the root directory of this source tree.
|
|
144
120
|
*/
|
|
121
|
+
|
|
145
122
|
var hasRequiredUseSyncExternalStoreShim_development;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
123
|
+
|
|
124
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
125
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
126
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
127
|
+
|
|
128
|
+
if (process.env.NODE_ENV !== "production") {
|
|
129
|
+
(function() {
|
|
130
|
+
|
|
131
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
132
|
+
if (
|
|
133
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
134
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
135
|
+
'function'
|
|
136
|
+
) {
|
|
137
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
138
|
+
}
|
|
139
|
+
var React = require$$0;
|
|
140
|
+
|
|
141
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
142
|
+
|
|
143
|
+
function error(format) {
|
|
144
|
+
{
|
|
145
|
+
{
|
|
146
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
147
|
+
args[_key2 - 1] = arguments[_key2];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
printWarning('error', format, args);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function printWarning(level, format, args) {
|
|
156
|
+
// When changing this logic, you might want to also
|
|
157
|
+
// update consoleWithStackDev.www.js as well.
|
|
158
|
+
{
|
|
159
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
160
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
161
|
+
|
|
162
|
+
if (stack !== '') {
|
|
163
|
+
format += '%s';
|
|
164
|
+
args = args.concat([stack]);
|
|
165
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
var argsWithFormat = args.map(function (item) {
|
|
169
|
+
return String(item);
|
|
170
|
+
}); // Careful: RN currently depends on this prefix
|
|
171
|
+
|
|
172
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
173
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
174
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
175
|
+
|
|
176
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
182
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
183
|
+
*/
|
|
184
|
+
function is(x, y) {
|
|
185
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
186
|
+
;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
190
|
+
|
|
191
|
+
// dispatch for CommonJS interop named imports.
|
|
192
|
+
|
|
193
|
+
var useState = React.useState,
|
|
194
|
+
useEffect = React.useEffect,
|
|
195
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
196
|
+
useDebugValue = React.useDebugValue;
|
|
197
|
+
var didWarnOld18Alpha = false;
|
|
198
|
+
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
|
|
199
|
+
// because of a very particular set of implementation details and assumptions
|
|
200
|
+
// -- change any one of them and it will break. The most important assumption
|
|
201
|
+
// is that updates are always synchronous, because concurrent rendering is
|
|
202
|
+
// only available in versions of React that also have a built-in
|
|
203
|
+
// useSyncExternalStore API. And we only use this shim when the built-in API
|
|
204
|
+
// does not exist.
|
|
205
|
+
//
|
|
206
|
+
// Do not assume that the clever hacks used by this hook also work in general.
|
|
207
|
+
// The point of this shim is to replace the need for hacks by other libraries.
|
|
208
|
+
|
|
209
|
+
function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
210
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
211
|
+
// will need to track that themselves and return the correct value
|
|
212
|
+
// from `getSnapshot`.
|
|
213
|
+
getServerSnapshot) {
|
|
214
|
+
{
|
|
215
|
+
if (!didWarnOld18Alpha) {
|
|
216
|
+
if (React.startTransition !== undefined) {
|
|
217
|
+
didWarnOld18Alpha = true;
|
|
218
|
+
|
|
219
|
+
error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} // Read the current snapshot from the store on every render. Again, this
|
|
223
|
+
// breaks the rules of React, and only works here because of specific
|
|
224
|
+
// implementation details, most importantly that updates are
|
|
225
|
+
// always synchronous.
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
var value = getSnapshot();
|
|
229
|
+
|
|
230
|
+
{
|
|
231
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
232
|
+
var cachedValue = getSnapshot();
|
|
233
|
+
|
|
234
|
+
if (!objectIs(value, cachedValue)) {
|
|
235
|
+
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
236
|
+
|
|
237
|
+
didWarnUncachedGetSnapshot = true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
241
|
+
// re-render whenever the subscribed state changes by updating an some
|
|
242
|
+
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
243
|
+
// the current value.
|
|
244
|
+
//
|
|
245
|
+
// Because we don't actually use the state returned by the useState hook, we
|
|
246
|
+
// can save a bit of memory by storing other stuff in that slot.
|
|
247
|
+
//
|
|
248
|
+
// To implement the early bailout, we need to track some things on a mutable
|
|
249
|
+
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
250
|
+
// our useState hook instead.
|
|
251
|
+
//
|
|
252
|
+
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
253
|
+
// new object always fails an equality check.
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
var _useState = useState({
|
|
257
|
+
inst: {
|
|
258
|
+
value: value,
|
|
259
|
+
getSnapshot: getSnapshot
|
|
260
|
+
}
|
|
261
|
+
}),
|
|
262
|
+
inst = _useState[0].inst,
|
|
263
|
+
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
264
|
+
// in the layout phase so we can access it during the tearing check that
|
|
265
|
+
// happens on subscribe.
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
useLayoutEffect(function () {
|
|
269
|
+
inst.value = value;
|
|
270
|
+
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
271
|
+
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
272
|
+
// this can happen all the time, but even in synchronous mode, an earlier
|
|
273
|
+
// effect may have mutated the store.
|
|
274
|
+
|
|
275
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
276
|
+
// Force a re-render.
|
|
277
|
+
forceUpdate({
|
|
278
|
+
inst: inst
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}, [subscribe, value, getSnapshot]);
|
|
282
|
+
useEffect(function () {
|
|
283
|
+
// Check for changes right before subscribing. Subsequent changes will be
|
|
284
|
+
// detected in the subscription handler.
|
|
285
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
286
|
+
// Force a re-render.
|
|
287
|
+
forceUpdate({
|
|
288
|
+
inst: inst
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
var handleStoreChange = function () {
|
|
293
|
+
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
294
|
+
// up to the consumer of this library to wrap their subscription event
|
|
295
|
+
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
296
|
+
// the case and print a warning in development?
|
|
297
|
+
// The store changed. Check if the snapshot changed since the last time we
|
|
298
|
+
// read from the store.
|
|
299
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
300
|
+
// Force a re-render.
|
|
301
|
+
forceUpdate({
|
|
302
|
+
inst: inst
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}; // Subscribe to the store and return a clean-up function.
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
return subscribe(handleStoreChange);
|
|
309
|
+
}, [subscribe]);
|
|
310
|
+
useDebugValue(value);
|
|
311
|
+
return value;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function checkIfSnapshotChanged(inst) {
|
|
315
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
316
|
+
var prevValue = inst.value;
|
|
317
|
+
|
|
318
|
+
try {
|
|
319
|
+
var nextValue = latestGetSnapshot();
|
|
320
|
+
return !objectIs(prevValue, nextValue);
|
|
321
|
+
} catch (error) {
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
327
|
+
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
328
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
329
|
+
// will need to track that themselves and return the correct value
|
|
330
|
+
// from `getSnapshot`.
|
|
331
|
+
return getSnapshot();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
|
335
|
+
|
|
336
|
+
var isServerEnvironment = !canUseDOM;
|
|
337
|
+
|
|
338
|
+
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
339
|
+
var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
|
|
340
|
+
|
|
341
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
342
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
343
|
+
if (
|
|
344
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
345
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
346
|
+
'function'
|
|
347
|
+
) {
|
|
348
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
})();
|
|
352
|
+
}
|
|
353
|
+
return useSyncExternalStoreShim_development;
|
|
265
354
|
}
|
|
355
|
+
|
|
266
356
|
var hasRequiredShim;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
357
|
+
|
|
358
|
+
function requireShim () {
|
|
359
|
+
if (hasRequiredShim) return shim.exports;
|
|
360
|
+
hasRequiredShim = 1;
|
|
361
|
+
|
|
362
|
+
if (process.env.NODE_ENV === 'production') {
|
|
363
|
+
shim.exports = requireUseSyncExternalStoreShim_production_min();
|
|
364
|
+
} else {
|
|
365
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
366
|
+
}
|
|
367
|
+
return shim.exports;
|
|
277
368
|
}
|
|
369
|
+
|
|
278
370
|
/**
|
|
279
371
|
* @license React
|
|
280
372
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
@@ -284,63 +376,20 @@ function requireShim() {
|
|
|
284
376
|
* This source code is licensed under the MIT license found in the
|
|
285
377
|
* LICENSE file in the root directory of this source tree.
|
|
286
378
|
*/
|
|
379
|
+
|
|
287
380
|
var hasRequiredWithSelector_production_min;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
var q = "function" === typeof Object.is ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
|
|
297
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a, b, e, l, g) {
|
|
298
|
-
var c = t(null);
|
|
299
|
-
if (null === c.current) {
|
|
300
|
-
var f = { hasValue: false, value: null };
|
|
301
|
-
c.current = f;
|
|
302
|
-
} else
|
|
303
|
-
f = c.current;
|
|
304
|
-
c = v(function() {
|
|
305
|
-
function a2(a3) {
|
|
306
|
-
if (!c2) {
|
|
307
|
-
c2 = true;
|
|
308
|
-
d2 = a3;
|
|
309
|
-
a3 = l(a3);
|
|
310
|
-
if (void 0 !== g && f.hasValue) {
|
|
311
|
-
var b2 = f.value;
|
|
312
|
-
if (g(b2, a3))
|
|
313
|
-
return k = b2;
|
|
314
|
-
}
|
|
315
|
-
return k = a3;
|
|
316
|
-
}
|
|
317
|
-
b2 = k;
|
|
318
|
-
if (q(d2, a3))
|
|
319
|
-
return b2;
|
|
320
|
-
var e2 = l(a3);
|
|
321
|
-
if (void 0 !== g && g(b2, e2))
|
|
322
|
-
return b2;
|
|
323
|
-
d2 = a3;
|
|
324
|
-
return k = e2;
|
|
325
|
-
}
|
|
326
|
-
var c2 = false, d2, k, m = void 0 === e ? null : e;
|
|
327
|
-
return [function() {
|
|
328
|
-
return a2(b());
|
|
329
|
-
}, null === m ? void 0 : function() {
|
|
330
|
-
return a2(m());
|
|
331
|
-
}];
|
|
332
|
-
}, [b, e, l, g]);
|
|
333
|
-
var d = r(a, c[0], c[1]);
|
|
334
|
-
u(function() {
|
|
335
|
-
f.hasValue = true;
|
|
336
|
-
f.value = d;
|
|
337
|
-
}, [d]);
|
|
338
|
-
w(d);
|
|
339
|
-
return d;
|
|
340
|
-
};
|
|
341
|
-
return withSelector_production_min;
|
|
381
|
+
|
|
382
|
+
function requireWithSelector_production_min () {
|
|
383
|
+
if (hasRequiredWithSelector_production_min) return withSelector_production_min;
|
|
384
|
+
hasRequiredWithSelector_production_min = 1;
|
|
385
|
+
var h=require$$0,n=requireShim();function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;
|
|
386
|
+
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);
|
|
387
|
+
u(function(){f.hasValue=!0;f.value=d;},[d]);w(d);return d};
|
|
388
|
+
return withSelector_production_min;
|
|
342
389
|
}
|
|
390
|
+
|
|
343
391
|
var withSelector_development = {};
|
|
392
|
+
|
|
344
393
|
/**
|
|
345
394
|
* @license React
|
|
346
395
|
* use-sync-external-store-shim/with-selector.development.js
|
|
@@ -350,101 +399,175 @@ var withSelector_development = {};
|
|
|
350
399
|
* This source code is licensed under the MIT license found in the
|
|
351
400
|
* LICENSE file in the root directory of this source tree.
|
|
352
401
|
*/
|
|
402
|
+
|
|
353
403
|
var hasRequiredWithSelector_development;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
404
|
+
|
|
405
|
+
function requireWithSelector_development () {
|
|
406
|
+
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
407
|
+
hasRequiredWithSelector_development = 1;
|
|
408
|
+
|
|
409
|
+
if (process.env.NODE_ENV !== "production") {
|
|
410
|
+
(function() {
|
|
411
|
+
|
|
412
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
413
|
+
if (
|
|
414
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
415
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
416
|
+
'function'
|
|
417
|
+
) {
|
|
418
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
419
|
+
}
|
|
420
|
+
var React = require$$0;
|
|
421
|
+
var shim = requireShim();
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
425
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
426
|
+
*/
|
|
427
|
+
function is(x, y) {
|
|
428
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
429
|
+
;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
433
|
+
|
|
434
|
+
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
435
|
+
|
|
436
|
+
// for CommonJS interop.
|
|
437
|
+
|
|
438
|
+
var useRef = React.useRef,
|
|
439
|
+
useEffect = React.useEffect,
|
|
440
|
+
useMemo = React.useMemo,
|
|
441
|
+
useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.
|
|
442
|
+
|
|
443
|
+
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
444
|
+
// Use this to track the rendered snapshot.
|
|
445
|
+
var instRef = useRef(null);
|
|
446
|
+
var inst;
|
|
447
|
+
|
|
448
|
+
if (instRef.current === null) {
|
|
449
|
+
inst = {
|
|
450
|
+
hasValue: false,
|
|
451
|
+
value: null
|
|
452
|
+
};
|
|
453
|
+
instRef.current = inst;
|
|
454
|
+
} else {
|
|
455
|
+
inst = instRef.current;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
var _useMemo = useMemo(function () {
|
|
459
|
+
// Track the memoized state using closure variables that are local to this
|
|
460
|
+
// memoized instance of a getSnapshot function. Intentionally not using a
|
|
461
|
+
// useRef hook, because that state would be shared across all concurrent
|
|
462
|
+
// copies of the hook/component.
|
|
463
|
+
var hasMemo = false;
|
|
464
|
+
var memoizedSnapshot;
|
|
465
|
+
var memoizedSelection;
|
|
466
|
+
|
|
467
|
+
var memoizedSelector = function (nextSnapshot) {
|
|
468
|
+
if (!hasMemo) {
|
|
469
|
+
// The first time the hook is called, there is no memoized result.
|
|
470
|
+
hasMemo = true;
|
|
471
|
+
memoizedSnapshot = nextSnapshot;
|
|
472
|
+
|
|
473
|
+
var _nextSelection = selector(nextSnapshot);
|
|
474
|
+
|
|
475
|
+
if (isEqual !== undefined) {
|
|
476
|
+
// Even if the selector has changed, the currently rendered selection
|
|
477
|
+
// may be equal to the new selection. We should attempt to reuse the
|
|
478
|
+
// current value if possible, to preserve downstream memoizations.
|
|
479
|
+
if (inst.hasValue) {
|
|
480
|
+
var currentSelection = inst.value;
|
|
481
|
+
|
|
482
|
+
if (isEqual(currentSelection, _nextSelection)) {
|
|
483
|
+
memoizedSelection = currentSelection;
|
|
484
|
+
return currentSelection;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
memoizedSelection = _nextSelection;
|
|
490
|
+
return _nextSelection;
|
|
491
|
+
} // We may be able to reuse the previous invocation's result.
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
// We may be able to reuse the previous invocation's result.
|
|
495
|
+
var prevSnapshot = memoizedSnapshot;
|
|
496
|
+
var prevSelection = memoizedSelection;
|
|
497
|
+
|
|
498
|
+
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
499
|
+
// The snapshot is the same as last time. Reuse the previous selection.
|
|
500
|
+
return prevSelection;
|
|
501
|
+
} // The snapshot has changed, so we need to compute a new selection.
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
// The snapshot has changed, so we need to compute a new selection.
|
|
505
|
+
var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data
|
|
506
|
+
// has changed. If it hasn't, return the previous selection. That signals
|
|
507
|
+
// to React that the selections are conceptually equal, and we can bail
|
|
508
|
+
// out of rendering.
|
|
509
|
+
|
|
510
|
+
// If a custom isEqual function is provided, use that to check if the data
|
|
511
|
+
// has changed. If it hasn't, return the previous selection. That signals
|
|
512
|
+
// to React that the selections are conceptually equal, and we can bail
|
|
513
|
+
// out of rendering.
|
|
514
|
+
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
515
|
+
return prevSelection;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
memoizedSnapshot = nextSnapshot;
|
|
519
|
+
memoizedSelection = nextSelection;
|
|
520
|
+
return nextSelection;
|
|
521
|
+
}; // Assigning this to a constant so that Flow knows it can't change.
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
// Assigning this to a constant so that Flow knows it can't change.
|
|
525
|
+
var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;
|
|
526
|
+
|
|
527
|
+
var getSnapshotWithSelector = function () {
|
|
528
|
+
return memoizedSelector(getSnapshot());
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {
|
|
532
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
533
|
+
};
|
|
534
|
+
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
535
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual]),
|
|
536
|
+
getSelection = _useMemo[0],
|
|
537
|
+
getServerSelection = _useMemo[1];
|
|
538
|
+
|
|
539
|
+
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
540
|
+
useEffect(function () {
|
|
541
|
+
inst.hasValue = true;
|
|
542
|
+
inst.value = value;
|
|
543
|
+
}, [value]);
|
|
544
|
+
useDebugValue(value);
|
|
545
|
+
return value;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
|
|
549
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
550
|
+
if (
|
|
551
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
552
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
553
|
+
'function'
|
|
554
|
+
) {
|
|
555
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
})();
|
|
559
|
+
}
|
|
560
|
+
return withSelector_development;
|
|
441
561
|
}
|
|
442
|
-
|
|
562
|
+
|
|
563
|
+
if (process.env.NODE_ENV === 'production') {
|
|
443
564
|
withSelector.exports = requireWithSelector_production_min();
|
|
444
565
|
} else {
|
|
445
566
|
withSelector.exports = requireWithSelector_development();
|
|
446
567
|
}
|
|
568
|
+
|
|
447
569
|
var withSelectorExports = withSelector.exports;
|
|
570
|
+
|
|
448
571
|
function useStore(store$1, argument1, argument2) {
|
|
449
572
|
const selector = store.makeSelector(
|
|
450
573
|
typeof argument1 === "function" || typeof argument1 === "string" ? argument1 : void 0
|
|
@@ -457,8 +580,7 @@ function useStore(store$1, argument1, argument2) {
|
|
|
457
580
|
} = typeof argument1 === "object" ? argument1 : argument2 ?? {};
|
|
458
581
|
const lastEqualsRef = require$$0.useRef();
|
|
459
582
|
const { rootStore, mappingSelector } = require$$0.useMemo(() => {
|
|
460
|
-
|
|
461
|
-
const rootStore2 = ((_a = store$1.derivedFrom) == null ? void 0 : _a.store) ?? store$1;
|
|
583
|
+
const rootStore2 = store$1.derivedFrom?.store ?? store$1;
|
|
462
584
|
let mappingSelector2 = (x) => x;
|
|
463
585
|
if (store$1.derivedFrom) {
|
|
464
586
|
mappingSelector2 = (value2) => {
|
|
@@ -507,10 +629,7 @@ function useStore(store$1, argument1, argument2) {
|
|
|
507
629
|
rootStore.get,
|
|
508
630
|
void 0,
|
|
509
631
|
(x) => selector(mappingSelector(x)),
|
|
510
|
-
(_v, newValue) =>
|
|
511
|
-
var _a;
|
|
512
|
-
return ((_a = lastEqualsRef.current) == null ? void 0 : _a.call(lastEqualsRef, newValue)) ?? false;
|
|
513
|
-
}
|
|
632
|
+
(_v, newValue) => lastEqualsRef.current?.(newValue) ?? false
|
|
514
633
|
);
|
|
515
634
|
let lastEquals = (newValue) => equals(newValue, value);
|
|
516
635
|
let revoke;
|
|
@@ -519,11 +638,12 @@ function useStore(store$1, argument1, argument2) {
|
|
|
519
638
|
}
|
|
520
639
|
require$$0.useLayoutEffect(() => {
|
|
521
640
|
lastEqualsRef.current = lastEquals;
|
|
522
|
-
revoke
|
|
641
|
+
revoke?.();
|
|
523
642
|
});
|
|
524
643
|
require$$0.useDebugValue(value);
|
|
525
644
|
return value;
|
|
526
645
|
}
|
|
646
|
+
|
|
527
647
|
const LoadingBoundaryContext = require$$0.createContext(store.createStore(/* @__PURE__ */ new Set()));
|
|
528
648
|
function LoadingBoundary({
|
|
529
649
|
fallback,
|
|
@@ -540,15 +660,15 @@ function LoadingBoundary({
|
|
|
540
660
|
] }) : children });
|
|
541
661
|
}
|
|
542
662
|
function useLoadingBoundary(isLoading, label) {
|
|
543
|
-
const
|
|
663
|
+
const store = require$$0.useContext(LoadingBoundaryContext);
|
|
544
664
|
require$$0.useLayoutEffect(() => {
|
|
545
665
|
if (!isLoading) {
|
|
546
666
|
return;
|
|
547
667
|
}
|
|
548
668
|
const entry = { label };
|
|
549
|
-
|
|
669
|
+
store.set((entries) => new Set(entries).add(entry));
|
|
550
670
|
return () => {
|
|
551
|
-
|
|
671
|
+
store.set((entries) => {
|
|
552
672
|
const newEntries = new Set(entries);
|
|
553
673
|
newEntries.delete(entry);
|
|
554
674
|
return newEntries;
|
|
@@ -556,6 +676,7 @@ function useLoadingBoundary(isLoading, label) {
|
|
|
556
676
|
};
|
|
557
677
|
}, [isLoading]);
|
|
558
678
|
}
|
|
679
|
+
|
|
559
680
|
function useCache(cache, {
|
|
560
681
|
passive,
|
|
561
682
|
disabled,
|
|
@@ -569,8 +690,7 @@ function useCache(cache, {
|
|
|
569
690
|
withViewTransition = (state) => state.value;
|
|
570
691
|
}
|
|
571
692
|
const { rootCache, selector } = require$$0.useMemo(() => {
|
|
572
|
-
|
|
573
|
-
const rootCache2 = ((_a = cache.derivedFromCache) == null ? void 0 : _a.cache) ?? cache;
|
|
693
|
+
const rootCache2 = cache.derivedFromCache?.cache ?? cache;
|
|
574
694
|
let selector2 = (x) => x;
|
|
575
695
|
if (cache.derivedFromCache) {
|
|
576
696
|
selector2 = (value) => {
|
|
@@ -626,23 +746,26 @@ function useCache(cache, {
|
|
|
626
746
|
}
|
|
627
747
|
return result;
|
|
628
748
|
}
|
|
749
|
+
|
|
629
750
|
const cacheMethods = {
|
|
630
751
|
useCache(options) {
|
|
631
752
|
return useCache(this, options);
|
|
632
753
|
}
|
|
633
754
|
};
|
|
634
|
-
|
|
755
|
+
|
|
756
|
+
function useProp(store, argument1, argument2, argument3) {
|
|
635
757
|
const selector = typeof argument1 === "function" || typeof argument1 === "string" ? argument1 : void 0;
|
|
636
758
|
const updater = typeof argument2 === "function" ? argument2 : void 0;
|
|
637
759
|
const options = typeof argument1 === "object" ? argument1 : typeof argument2 === "object" ? argument2 : argument3;
|
|
638
760
|
if (selector) {
|
|
639
|
-
|
|
761
|
+
store = store.map(selector, updater);
|
|
640
762
|
}
|
|
641
|
-
const value = useStore(
|
|
642
|
-
return [value,
|
|
763
|
+
const value = useStore(store, options);
|
|
764
|
+
return [value, store.set];
|
|
643
765
|
}
|
|
766
|
+
|
|
644
767
|
function getScopeContext(scope) {
|
|
645
|
-
scope.context
|
|
768
|
+
scope.context ??= require$$0.createContext(store.createStore(scope.defaultValue));
|
|
646
769
|
return scope.context;
|
|
647
770
|
}
|
|
648
771
|
function ScopeProvider({
|
|
@@ -662,13 +785,14 @@ function useScope(scope) {
|
|
|
662
785
|
return require$$0.useContext(context);
|
|
663
786
|
}
|
|
664
787
|
function useScopeStore(scope, options) {
|
|
665
|
-
const
|
|
666
|
-
return useStore(
|
|
788
|
+
const store = useScope(scope);
|
|
789
|
+
return useStore(store, options);
|
|
667
790
|
}
|
|
668
791
|
function useScopeProp(scope, options) {
|
|
669
|
-
const
|
|
670
|
-
return useProp(
|
|
792
|
+
const store = useScope(scope);
|
|
793
|
+
return useProp(store, options);
|
|
671
794
|
}
|
|
795
|
+
|
|
672
796
|
const scopeMethods = {
|
|
673
797
|
useScope() {
|
|
674
798
|
return useScope(this);
|
|
@@ -683,6 +807,7 @@ const scopeMethods = {
|
|
|
683
807
|
return ScopeProvider({ ...props, scope: this });
|
|
684
808
|
}
|
|
685
809
|
};
|
|
810
|
+
|
|
686
811
|
function boundUseStore(...args) {
|
|
687
812
|
return useStore(this, ...args);
|
|
688
813
|
}
|
|
@@ -693,6 +818,7 @@ const storeMethods = {
|
|
|
693
818
|
useStore: boundUseStore,
|
|
694
819
|
useProp: boundUseProp
|
|
695
820
|
};
|
|
821
|
+
|
|
696
822
|
exports.LoadingBoundary = LoadingBoundary;
|
|
697
823
|
exports.ScopeProvider = ScopeProvider;
|
|
698
824
|
exports.cacheMethods = cacheMethods;
|