@tanstack/query-core 5.101.3 → 5.102.0
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/build/legacy/classPrivateFieldSet2-Bo0ZyOIv.cjs +56 -0
- package/build/legacy/classPrivateFieldSet2-CV7wyte-.js +27 -0
- package/build/legacy/classPrivateMethodInitSpec-CBwa_Y7C.js +7 -0
- package/build/legacy/classPrivateMethodInitSpec-DVhcLejn.cjs +12 -0
- package/build/legacy/environmentManager.cjs +25 -46
- package/build/legacy/environmentManager.cjs.map +1 -1
- package/build/legacy/environmentManager.d.cts +18 -2
- package/build/legacy/environmentManager.d.cts.map +1 -0
- package/build/legacy/environmentManager.d.ts +18 -2
- package/build/legacy/environmentManager.d.ts.map +1 -0
- package/build/legacy/environmentManager.js +23 -22
- package/build/legacy/environmentManager.js.map +1 -1
- package/build/legacy/focusManager.cjs +63 -104
- package/build/legacy/focusManager.cjs.map +1 -1
- package/build/legacy/focusManager.d.cts +18 -2
- package/build/legacy/focusManager.d.cts.map +1 -0
- package/build/legacy/focusManager.d.ts +18 -2
- package/build/legacy/focusManager.d.ts.map +1 -0
- package/build/legacy/focusManager.js +60 -76
- package/build/legacy/focusManager.js.map +1 -1
- package/build/legacy/hydration-D1E7ZbjZ.d.ts +1374 -0
- package/build/legacy/hydration-D1E7ZbjZ.d.ts.map +1 -0
- package/build/legacy/hydration-NBquRCHe.d.cts +1374 -0
- package/build/legacy/hydration-NBquRCHe.d.cts.map +1 -0
- package/build/legacy/hydration.cjs +114 -194
- package/build/legacy/hydration.cjs.map +1 -1
- package/build/legacy/hydration.d.cts +2 -7
- package/build/legacy/hydration.d.ts +2 -7
- package/build/legacy/hydration.js +108 -167
- package/build/legacy/hydration.js.map +1 -1
- package/build/legacy/index.cjs +59 -111
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +10 -141
- package/build/legacy/index.d.ts +10 -141
- package/build/legacy/index.js +16 -66
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryBehavior.cjs +92 -135
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +14 -3
- package/build/legacy/infiniteQueryBehavior.d.cts.map +1 -0
- package/build/legacy/infiniteQueryBehavior.d.ts +14 -3
- package/build/legacy/infiniteQueryBehavior.d.ts.map +1 -0
- package/build/legacy/infiniteQueryBehavior.js +89 -115
- package/build/legacy/infiniteQueryBehavior.js.map +1 -1
- package/build/legacy/infiniteQueryObserver.cjs +59 -88
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +20 -1
- package/build/legacy/infiniteQueryObserver.d.cts.map +1 -0
- package/build/legacy/infiniteQueryObserver.d.ts +20 -1
- package/build/legacy/infiniteQueryObserver.d.ts.map +1 -0
- package/build/legacy/infiniteQueryObserver.js +57 -64
- package/build/legacy/infiniteQueryObserver.js.map +1 -1
- package/build/legacy/mutation.cjs +236 -329
- package/build/legacy/mutation.cjs.map +1 -1
- package/build/legacy/mutation.d.cts +2 -4
- package/build/legacy/mutation.d.ts +2 -4
- package/build/legacy/mutation.js +231 -299
- package/build/legacy/mutation.js.map +1 -1
- package/build/legacy/mutationCache.cjs +121 -166
- package/build/legacy/mutationCache.cjs.map +1 -1
- package/build/legacy/mutationCache.d.cts +2 -2
- package/build/legacy/mutationCache.d.ts +2 -2
- package/build/legacy/mutationCache.js +117 -130
- package/build/legacy/mutationCache.js.map +1 -1
- package/build/legacy/mutationObserver.cjs +134 -187
- package/build/legacy/mutationObserver.cjs.map +1 -1
- package/build/legacy/mutationObserver.d.cts +2 -1
- package/build/legacy/mutationObserver.d.ts +2 -1
- package/build/legacy/mutationObserver.js +132 -160
- package/build/legacy/mutationObserver.js.map +1 -1
- package/build/legacy/notifyManager.cjs +76 -110
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +48 -3
- package/build/legacy/notifyManager.d.cts.map +1 -0
- package/build/legacy/notifyManager.d.ts +48 -3
- package/build/legacy/notifyManager.d.ts.map +1 -0
- package/build/legacy/notifyManager.js +73 -84
- package/build/legacy/notifyManager.js.map +1 -1
- package/build/legacy/onlineManager.cjs +57 -93
- package/build/legacy/onlineManager.cjs.map +1 -1
- package/build/legacy/onlineManager.d.cts +17 -2
- package/build/legacy/onlineManager.d.cts.map +1 -0
- package/build/legacy/onlineManager.d.ts +17 -2
- package/build/legacy/onlineManager.d.ts.map +1 -0
- package/build/legacy/onlineManager.js +54 -65
- package/build/legacy/onlineManager.js.map +1 -1
- package/build/legacy/queriesObserver.cjs +203 -262
- package/build/legacy/queriesObserver.cjs.map +1 -1
- package/build/legacy/queriesObserver.d.cts +23 -2
- package/build/legacy/queriesObserver.d.cts.map +1 -0
- package/build/legacy/queriesObserver.d.ts +23 -2
- package/build/legacy/queriesObserver.d.ts.map +1 -0
- package/build/legacy/queriesObserver.js +199 -233
- package/build/legacy/queriesObserver.js.map +1 -1
- package/build/legacy/query.cjs +409 -491
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.d.cts +2 -9
- package/build/legacy/query.d.ts +2 -9
- package/build/legacy/query.js +402 -467
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryCache.cjs +99 -128
- package/build/legacy/queryCache.cjs.map +1 -1
- package/build/legacy/queryCache.d.cts +2 -3
- package/build/legacy/queryCache.d.ts +2 -3
- package/build/legacy/queryCache.js +96 -100
- package/build/legacy/queryCache.js.map +1 -1
- package/build/legacy/queryClient.cjs +295 -345
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +2 -1
- package/build/legacy/queryClient.d.ts +2 -1
- package/build/legacy/queryClient.js +292 -318
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs +350 -502
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +2 -1
- package/build/legacy/queryObserver.d.ts +2 -1
- package/build/legacy/queryObserver.js +345 -480
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/legacy/removable-DeMjhW5M.d.cts +13 -0
- package/build/legacy/removable-DeMjhW5M.d.cts.map +1 -0
- package/build/legacy/removable-DeMjhW5M.d.ts +13 -0
- package/build/legacy/removable-DeMjhW5M.d.ts.map +1 -0
- package/build/legacy/removable.cjs +31 -67
- package/build/legacy/removable.cjs.map +1 -1
- package/build/legacy/removable.d.cts +2 -1
- package/build/legacy/removable.d.ts +2 -1
- package/build/legacy/removable.js +28 -39
- package/build/legacy/removable.js.map +1 -1
- package/build/legacy/retryer.cjs +127 -155
- package/build/legacy/retryer.cjs.map +1 -1
- package/build/legacy/retryer.d.cts +2 -7
- package/build/legacy/retryer.d.ts +2 -7
- package/build/legacy/retryer.js +121 -127
- package/build/legacy/retryer.js.map +1 -1
- package/build/legacy/streamedQuery.cjs +49 -78
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +33 -1
- package/build/legacy/streamedQuery.d.cts.map +1 -0
- package/build/legacy/streamedQuery.d.ts +33 -1
- package/build/legacy/streamedQuery.d.ts.map +1 -0
- package/build/legacy/streamedQuery.js +47 -54
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/subscribable-CbifVTKz.d.cts +12 -0
- package/build/legacy/subscribable-CbifVTKz.d.cts.map +1 -0
- package/build/legacy/subscribable-CbifVTKz.d.ts +12 -0
- package/build/legacy/subscribable-CbifVTKz.d.ts.map +1 -0
- package/build/legacy/subscribable.cjs +22 -48
- package/build/legacy/subscribable.cjs.map +1 -1
- package/build/legacy/subscribable.d.cts +2 -1
- package/build/legacy/subscribable.d.ts +2 -1
- package/build/legacy/subscribable.js +21 -25
- package/build/legacy/subscribable.js.map +1 -1
- package/build/legacy/timeoutManager.cjs +64 -105
- package/build/legacy/timeoutManager.cjs.map +1 -1
- package/build/legacy/timeoutManager.d.cts +60 -7
- package/build/legacy/timeoutManager.d.cts.map +1 -0
- package/build/legacy/timeoutManager.d.ts +60 -7
- package/build/legacy/timeoutManager.d.ts.map +1 -0
- package/build/legacy/timeoutManager.js +60 -76
- package/build/legacy/timeoutManager.js.map +1 -1
- package/build/legacy/types.cjs +10 -35
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +2 -94
- package/build/legacy/types.d.ts +2 -94
- package/build/legacy/types.js +7 -10
- package/build/legacy/types.js.map +1 -1
- package/build/legacy/utils.cjs +175 -300
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +2 -30
- package/build/legacy/utils.d.ts +2 -30
- package/build/legacy/utils.js +149 -252
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/environmentManager.cjs +25 -46
- package/build/modern/environmentManager.cjs.map +1 -1
- package/build/modern/environmentManager.d.cts +18 -2
- package/build/modern/environmentManager.d.cts.map +1 -0
- package/build/modern/environmentManager.d.ts +18 -2
- package/build/modern/environmentManager.d.ts.map +1 -0
- package/build/modern/environmentManager.js +23 -20
- package/build/modern/environmentManager.js.map +1 -1
- package/build/modern/focusManager.cjs +56 -90
- package/build/modern/focusManager.cjs.map +1 -1
- package/build/modern/focusManager.d.cts +18 -2
- package/build/modern/focusManager.d.cts.map +1 -0
- package/build/modern/focusManager.d.ts +18 -2
- package/build/modern/focusManager.d.ts.map +1 -0
- package/build/modern/focusManager.js +53 -63
- package/build/modern/focusManager.js.map +1 -1
- package/build/modern/hydration-D1E7ZbjZ.d.ts +1374 -0
- package/build/modern/hydration-D1E7ZbjZ.d.ts.map +1 -0
- package/build/modern/hydration-NBquRCHe.d.cts +1374 -0
- package/build/modern/hydration-NBquRCHe.d.cts.map +1 -0
- package/build/modern/hydration.cjs +105 -189
- package/build/modern/hydration.cjs.map +1 -1
- package/build/modern/hydration.d.cts +2 -7
- package/build/modern/hydration.d.ts +2 -7
- package/build/modern/hydration.js +99 -160
- package/build/modern/hydration.js.map +1 -1
- package/build/modern/index.cjs +59 -111
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +10 -141
- package/build/modern/index.d.ts +10 -141
- package/build/modern/index.js +16 -64
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryBehavior.cjs +89 -131
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +14 -3
- package/build/modern/infiniteQueryBehavior.d.cts.map +1 -0
- package/build/modern/infiniteQueryBehavior.d.ts +14 -3
- package/build/modern/infiniteQueryBehavior.d.ts.map +1 -0
- package/build/modern/infiniteQueryBehavior.js +86 -109
- package/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/build/modern/infiniteQueryObserver.cjs +58 -87
- package/build/modern/infiniteQueryObserver.cjs.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +20 -1
- package/build/modern/infiniteQueryObserver.d.cts.map +1 -0
- package/build/modern/infiniteQueryObserver.d.ts +20 -1
- package/build/modern/infiniteQueryObserver.d.ts.map +1 -0
- package/build/modern/infiniteQueryObserver.js +56 -61
- package/build/modern/infiniteQueryObserver.js.map +1 -1
- package/build/modern/mutation.cjs +221 -303
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +2 -4
- package/build/modern/mutation.d.ts +2 -4
- package/build/modern/mutation.js +216 -274
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs +111 -145
- package/build/modern/mutationCache.cjs.map +1 -1
- package/build/modern/mutationCache.d.cts +2 -2
- package/build/modern/mutationCache.d.ts +2 -2
- package/build/modern/mutationCache.js +107 -117
- package/build/modern/mutationCache.js.map +1 -1
- package/build/modern/mutationObserver.cjs +115 -162
- package/build/modern/mutationObserver.cjs.map +1 -1
- package/build/modern/mutationObserver.d.cts +2 -1
- package/build/modern/mutationObserver.d.ts +2 -1
- package/build/modern/mutationObserver.js +113 -136
- package/build/modern/mutationObserver.js.map +1 -1
- package/build/modern/notifyManager.cjs +76 -110
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +48 -3
- package/build/modern/notifyManager.d.cts.map +1 -0
- package/build/modern/notifyManager.d.ts +48 -3
- package/build/modern/notifyManager.d.ts.map +1 -0
- package/build/modern/notifyManager.js +73 -82
- package/build/modern/notifyManager.js.map +1 -1
- package/build/modern/onlineManager.cjs +51 -80
- package/build/modern/onlineManager.cjs.map +1 -1
- package/build/modern/onlineManager.d.cts +17 -2
- package/build/modern/onlineManager.d.cts.map +1 -0
- package/build/modern/onlineManager.d.ts +17 -2
- package/build/modern/onlineManager.d.ts.map +1 -0
- package/build/modern/onlineManager.js +48 -53
- package/build/modern/onlineManager.js.map +1 -1
- package/build/modern/queriesObserver.cjs +185 -237
- package/build/modern/queriesObserver.cjs.map +1 -1
- package/build/modern/queriesObserver.d.cts +23 -2
- package/build/modern/queriesObserver.d.cts.map +1 -0
- package/build/modern/queriesObserver.d.ts +23 -2
- package/build/modern/queriesObserver.d.ts.map +1 -0
- package/build/modern/queriesObserver.js +181 -209
- package/build/modern/queriesObserver.js.map +1 -1
- package/build/modern/query.cjs +384 -464
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.d.cts +2 -9
- package/build/modern/query.d.ts +2 -9
- package/build/modern/query.js +377 -441
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryCache.cjs +97 -119
- package/build/modern/queryCache.cjs.map +1 -1
- package/build/modern/queryCache.d.cts +2 -3
- package/build/modern/queryCache.d.ts +2 -3
- package/build/modern/queryCache.js +94 -92
- package/build/modern/queryCache.js.map +1 -1
- package/build/modern/queryClient.cjs +281 -318
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +2 -1
- package/build/modern/queryClient.d.ts +2 -1
- package/build/modern/queryClient.js +278 -299
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs +329 -475
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +2 -1
- package/build/modern/queryObserver.d.ts +2 -1
- package/build/modern/queryObserver.js +324 -454
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/removable-DeMjhW5M.d.cts +13 -0
- package/build/modern/removable-DeMjhW5M.d.cts.map +1 -0
- package/build/modern/removable-DeMjhW5M.d.ts +13 -0
- package/build/modern/removable-DeMjhW5M.d.ts.map +1 -0
- package/build/modern/removable.cjs +27 -56
- package/build/modern/removable.cjs.map +1 -1
- package/build/modern/removable.d.cts +2 -1
- package/build/modern/removable.d.ts +2 -1
- package/build/modern/removable.js +24 -29
- package/build/modern/removable.js.map +1 -1
- package/build/modern/retryer.cjs +121 -151
- package/build/modern/retryer.cjs.map +1 -1
- package/build/modern/retryer.d.cts +2 -7
- package/build/modern/retryer.d.ts +2 -7
- package/build/modern/retryer.js +115 -121
- package/build/modern/retryer.js.map +1 -1
- package/build/modern/streamedQuery.cjs +49 -78
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +33 -1
- package/build/modern/streamedQuery.d.cts.map +1 -0
- package/build/modern/streamedQuery.d.ts +33 -1
- package/build/modern/streamedQuery.d.ts.map +1 -0
- package/build/modern/streamedQuery.js +47 -52
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/subscribable-CbifVTKz.d.cts +12 -0
- package/build/modern/subscribable-CbifVTKz.d.cts.map +1 -0
- package/build/modern/subscribable-CbifVTKz.d.ts +12 -0
- package/build/modern/subscribable-CbifVTKz.d.ts.map +1 -0
- package/build/modern/subscribable.cjs +22 -48
- package/build/modern/subscribable.cjs.map +1 -1
- package/build/modern/subscribable.d.cts +2 -1
- package/build/modern/subscribable.d.ts +2 -1
- package/build/modern/subscribable.js +21 -23
- package/build/modern/subscribable.js.map +1 -1
- package/build/modern/timeoutManager.cjs +59 -93
- package/build/modern/timeoutManager.cjs.map +1 -1
- package/build/modern/timeoutManager.d.cts +60 -7
- package/build/modern/timeoutManager.d.cts.map +1 -0
- package/build/modern/timeoutManager.d.ts +60 -7
- package/build/modern/timeoutManager.d.ts.map +1 -0
- package/build/modern/timeoutManager.js +55 -65
- package/build/modern/timeoutManager.js.map +1 -1
- package/build/modern/types.cjs +10 -35
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +2 -94
- package/build/modern/types.d.ts +2 -94
- package/build/modern/types.js +8 -9
- package/build/modern/types.js.map +1 -1
- package/build/modern/utils.cjs +175 -300
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +2 -30
- package/build/modern/utils.d.ts +2 -30
- package/build/modern/utils.js +149 -250
- package/build/modern/utils.js.map +1 -1
- package/package.json +3 -5
- package/src/hydration.ts +62 -44
- package/src/index.ts +1 -0
- package/src/mutation.ts +14 -6
- package/src/mutationObserver.ts +8 -0
- package/src/queriesObserver.ts +14 -8
- package/src/query.ts +14 -6
- package/src/queryClient.ts +90 -2
- package/src/queryObserver.ts +41 -64
- package/src/retryer.ts +20 -12
- package/src/types.ts +70 -58
- package/build/legacy/_tsup-dts-rollup.d.cts +0 -2188
- package/build/legacy/_tsup-dts-rollup.d.ts +0 -2188
- package/build/legacy/chunk-PXG64RU4.js +0 -25
- package/build/legacy/chunk-PXG64RU4.js.map +0 -1
- package/build/legacy/thenable.cjs +0 -76
- package/build/legacy/thenable.cjs.map +0 -1
- package/build/legacy/thenable.d.cts +0 -6
- package/build/legacy/thenable.d.ts +0 -6
- package/build/legacy/thenable.js +0 -52
- package/build/legacy/thenable.js.map +0 -1
- package/build/modern/_tsup-dts-rollup.d.cts +0 -2188
- package/build/modern/_tsup-dts-rollup.d.ts +0 -2188
- package/build/modern/thenable.cjs +0 -75
- package/build/modern/thenable.cjs.map +0 -1
- package/build/modern/thenable.d.cts +0 -6
- package/build/modern/thenable.d.ts +0 -6
- package/build/modern/thenable.js +0 -49
- package/build/modern/thenable.js.map +0 -1
- package/src/thenable.ts +0 -111
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
3
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
7
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
8
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/assertClassBrand.js
|
|
12
|
+
function _assertClassBrand(e, t, n) {
|
|
13
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
14
|
+
throw new TypeError("Private element is not present on this object");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldGet2.js
|
|
18
|
+
function _classPrivateFieldGet2(s, a) {
|
|
19
|
+
return s.get(_assertClassBrand(s, a));
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldSet2.js
|
|
23
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
24
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
Object.defineProperty(exports, "_assertClassBrand", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return _assertClassBrand;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "_checkPrivateRedeclaration", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return _checkPrivateRedeclaration;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "_classPrivateFieldGet2", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function() {
|
|
42
|
+
return _classPrivateFieldGet2;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "_classPrivateFieldInitSpec", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function() {
|
|
48
|
+
return _classPrivateFieldInitSpec;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "_classPrivateFieldSet2", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function() {
|
|
54
|
+
return _classPrivateFieldSet2;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
3
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
7
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
8
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/assertClassBrand.js
|
|
12
|
+
function _assertClassBrand(e, t, n) {
|
|
13
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
14
|
+
throw new TypeError("Private element is not present on this object");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldGet2.js
|
|
18
|
+
function _classPrivateFieldGet2(s, a) {
|
|
19
|
+
return s.get(_assertClassBrand(s, a));
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldSet2.js
|
|
23
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
24
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { _checkPrivateRedeclaration as a, _classPrivateFieldInitSpec as i, _classPrivateFieldGet2 as n, _assertClassBrand as r, _classPrivateFieldSet2 as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as _checkPrivateRedeclaration } from "./classPrivateFieldSet2-CV7wyte-.js";
|
|
2
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
3
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
4
|
+
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _classPrivateMethodInitSpec as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_classPrivateFieldSet2 = require("./classPrivateFieldSet2-Bo0ZyOIv.cjs");
|
|
2
|
+
//#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
3
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
4
|
+
require_classPrivateFieldSet2._checkPrivateRedeclaration(e, a), a.add(e);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
Object.defineProperty(exports, "_classPrivateMethodInitSpec", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function() {
|
|
10
|
+
return _classPrivateMethodInitSpec;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -1,48 +1,27 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
environmentManager: () => environmentManager
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(environmentManager_exports);
|
|
26
|
-
var import_utils = require("./utils.cjs");
|
|
27
|
-
var environmentManager = /* @__PURE__ */ (() => {
|
|
28
|
-
let isServerFn = () => import_utils.isServer;
|
|
29
|
-
return {
|
|
30
|
-
/**
|
|
31
|
-
* Returns whether the current runtime should be treated as a server environment.
|
|
32
|
-
*/
|
|
33
|
-
isServer() {
|
|
34
|
-
return isServerFn();
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* Overrides the server check globally.
|
|
38
|
-
*/
|
|
39
|
-
setIsServer(isServerValue) {
|
|
40
|
-
isServerFn = isServerValue;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils.cjs");
|
|
3
|
+
//#region src/environmentManager.ts
|
|
4
|
+
/**
|
|
5
|
+
* Manages environment detection used by TanStack Query internals.
|
|
6
|
+
*/
|
|
7
|
+
const environmentManager = (() => {
|
|
8
|
+
let isServerFn = () => require_utils.isServer;
|
|
9
|
+
return {
|
|
10
|
+
/**
|
|
11
|
+
* Returns whether the current runtime should be treated as a server environment.
|
|
12
|
+
*/
|
|
13
|
+
isServer() {
|
|
14
|
+
return isServerFn();
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* Overrides the server check globally.
|
|
18
|
+
*/
|
|
19
|
+
setIsServer(isServerValue) {
|
|
20
|
+
isServerFn = isServerValue;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
43
23
|
})();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.environmentManager = environmentManager;
|
|
26
|
+
|
|
48
27
|
//# sourceMappingURL=environmentManager.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/environmentManager.ts"],"sourcesContent":["import { isServer } from './utils'\n\nexport type IsServerValue = () => boolean\n\n/**\n * Manages environment detection used by TanStack Query internals.\n */\nexport const environmentManager = (() => {\n let isServerFn: IsServerValue = () => isServer\n\n return {\n /**\n * Returns whether the current runtime should be treated as a server environment.\n */\n isServer(): boolean {\n return isServerFn()\n },\n /**\n * Overrides the server check globally.\n */\n setIsServer(isServerValue: IsServerValue): void {\n isServerFn = isServerValue\n },\n }\n})()\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"environmentManager.cjs","names":["isServer"],"sources":["../../src/environmentManager.ts"],"sourcesContent":["import { isServer } from './utils'\n\nexport type IsServerValue = () => boolean\n\n/**\n * Manages environment detection used by TanStack Query internals.\n */\nexport const environmentManager = (() => {\n let isServerFn: IsServerValue = () => isServer\n\n return {\n /**\n * Returns whether the current runtime should be treated as a server environment.\n */\n isServer(): boolean {\n return isServerFn()\n },\n /**\n * Overrides the server check globally.\n */\n setIsServer(isServerValue: IsServerValue): void {\n isServerFn = isServerValue\n },\n }\n})()\n"],"mappings":";;;;;;AAOA,MAAa,4BAA4B;CACvC,IAAI,mBAAkCA,cAAAA;CAEtC,OAAO;;;;EAIL,WAAoB;GAClB,OAAO,WAAW;EACpB;;;;EAIA,YAAY,eAAoC;GAC9C,aAAa;EACf;CACF;AACF,EAAA,CAAG"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/environmentManager.d.ts
|
|
2
|
+
type IsServerValue = () => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Manages environment detection used by TanStack Query internals.
|
|
5
|
+
*/
|
|
6
|
+
declare const environmentManager: {
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether the current runtime should be treated as a server environment.
|
|
9
|
+
*/
|
|
10
|
+
isServer(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the server check globally.
|
|
13
|
+
*/
|
|
14
|
+
setIsServer(isServerValue: IsServerValue): void;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { IsServerValue, environmentManager };
|
|
18
|
+
//# sourceMappingURL=environmentManager.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environmentManager.d.cts","names":[],"sources":["../../src/environmentManager.ts"],"mappings":";KAEY;;;;cAKC;;;;EAOG;;;;EAMe,YAAA,eAAA"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/environmentManager.d.ts
|
|
2
|
+
type IsServerValue = () => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Manages environment detection used by TanStack Query internals.
|
|
5
|
+
*/
|
|
6
|
+
declare const environmentManager: {
|
|
7
|
+
/**
|
|
8
|
+
* Returns whether the current runtime should be treated as a server environment.
|
|
9
|
+
*/
|
|
10
|
+
isServer(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the server check globally.
|
|
13
|
+
*/
|
|
14
|
+
setIsServer(isServerValue: IsServerValue): void;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { IsServerValue, environmentManager };
|
|
18
|
+
//# sourceMappingURL=environmentManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environmentManager.d.ts","names":[],"sources":["../../src/environmentManager.ts"],"mappings":";KAEY;;;;cAKC;;;;EAOG;;;;EAMe,YAAA,eAAA"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import "./chunk-PXG64RU4.js";
|
|
2
|
-
|
|
3
|
-
// src/environmentManager.ts
|
|
4
1
|
import { isServer } from "./utils.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
//#region src/environmentManager.ts
|
|
3
|
+
/**
|
|
4
|
+
* Manages environment detection used by TanStack Query internals.
|
|
5
|
+
*/
|
|
6
|
+
const environmentManager = (() => {
|
|
7
|
+
let isServerFn = () => isServer;
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the current runtime should be treated as a server environment.
|
|
11
|
+
*/
|
|
12
|
+
isServer() {
|
|
13
|
+
return isServerFn();
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* Overrides the server check globally.
|
|
17
|
+
*/
|
|
18
|
+
setIsServer(isServerValue) {
|
|
19
|
+
isServerFn = isServerValue;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
21
22
|
})();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
export { environmentManager };
|
|
25
|
+
|
|
25
26
|
//# sourceMappingURL=environmentManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/environmentManager.ts"],"sourcesContent":["import { isServer } from './utils'\n\nexport type IsServerValue = () => boolean\n\n/**\n * Manages environment detection used by TanStack Query internals.\n */\nexport const environmentManager = (() => {\n let isServerFn: IsServerValue = () => isServer\n\n return {\n /**\n * Returns whether the current runtime should be treated as a server environment.\n */\n isServer(): boolean {\n return isServerFn()\n },\n /**\n * Overrides the server check globally.\n */\n setIsServer(isServerValue: IsServerValue): void {\n isServerFn = isServerValue\n },\n }\n})()\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"environmentManager.js","names":[],"sources":["../../src/environmentManager.ts"],"sourcesContent":["import { isServer } from './utils'\n\nexport type IsServerValue = () => boolean\n\n/**\n * Manages environment detection used by TanStack Query internals.\n */\nexport const environmentManager = (() => {\n let isServerFn: IsServerValue = () => isServer\n\n return {\n /**\n * Returns whether the current runtime should be treated as a server environment.\n */\n isServer(): boolean {\n return isServerFn()\n },\n /**\n * Overrides the server check globally.\n */\n setIsServer(isServerValue: IsServerValue): void {\n isServerFn = isServerValue\n },\n }\n})()\n"],"mappings":";;;;;AAOA,MAAa,4BAA4B;CACvC,IAAI,mBAAkC;CAEtC,OAAO;;;;EAIL,WAAoB;GAClB,OAAO,WAAW;EACpB;;;;EAIA,YAAY,eAAoC;GAC9C,aAAa;EACf;CACF;AACF,EAAA,CAAG"}
|
|
@@ -1,107 +1,66 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_classPrivateFieldSet2 = require("./classPrivateFieldSet2-Bo0ZyOIv.cjs");
|
|
3
|
+
const require_subscribable = require("./subscribable.cjs");
|
|
4
|
+
//#region src/focusManager.ts
|
|
5
|
+
var _focused = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
var _cleanup = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
var _setup = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
var FocusManager = class extends require_subscribable.Subscribable {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
require_classPrivateFieldSet2._classPrivateFieldInitSpec(this, _focused, void 0);
|
|
12
|
+
require_classPrivateFieldSet2._classPrivateFieldInitSpec(this, _cleanup, void 0);
|
|
13
|
+
require_classPrivateFieldSet2._classPrivateFieldInitSpec(this, _setup, void 0);
|
|
14
|
+
require_classPrivateFieldSet2._classPrivateFieldSet2(_setup, this, (onFocus) => {
|
|
15
|
+
if (typeof window !== "undefined" && window.addEventListener) {
|
|
16
|
+
const listener = () => onFocus();
|
|
17
|
+
window.addEventListener("visibilitychange", listener, false);
|
|
18
|
+
return () => {
|
|
19
|
+
window.removeEventListener("visibilitychange", listener);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
onSubscribe() {
|
|
25
|
+
if (!require_classPrivateFieldSet2._classPrivateFieldGet2(_cleanup, this)) this.setEventListener(require_classPrivateFieldSet2._classPrivateFieldGet2(_setup, this));
|
|
26
|
+
}
|
|
27
|
+
onUnsubscribe() {
|
|
28
|
+
if (!this.hasListeners()) {
|
|
29
|
+
var _classPrivateFieldGet2$1;
|
|
30
|
+
(_classPrivateFieldGet2$1 = require_classPrivateFieldSet2._classPrivateFieldGet2(_cleanup, this)) === null || _classPrivateFieldGet2$1 === void 0 || _classPrivateFieldGet2$1.call(this);
|
|
31
|
+
require_classPrivateFieldSet2._classPrivateFieldSet2(_cleanup, this, void 0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
setEventListener(setup) {
|
|
35
|
+
var _classPrivateFieldGet3;
|
|
36
|
+
require_classPrivateFieldSet2._classPrivateFieldSet2(_setup, this, setup);
|
|
37
|
+
(_classPrivateFieldGet3 = require_classPrivateFieldSet2._classPrivateFieldGet2(_cleanup, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.call(this);
|
|
38
|
+
require_classPrivateFieldSet2._classPrivateFieldSet2(_cleanup, this, setup((focused) => {
|
|
39
|
+
if (typeof focused === "boolean") this.setFocused(focused);
|
|
40
|
+
else this.onFocus();
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
setFocused(focused) {
|
|
44
|
+
if (require_classPrivateFieldSet2._classPrivateFieldGet2(_focused, this) !== focused) {
|
|
45
|
+
require_classPrivateFieldSet2._classPrivateFieldSet2(_focused, this, focused);
|
|
46
|
+
this.onFocus();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
onFocus() {
|
|
50
|
+
const isFocused = this.isFocused();
|
|
51
|
+
this.listeners.forEach((listener) => {
|
|
52
|
+
listener(isFocused);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
isFocused() {
|
|
56
|
+
var _globalThis$document;
|
|
57
|
+
if (typeof require_classPrivateFieldSet2._classPrivateFieldGet2(_focused, this) === "boolean") return require_classPrivateFieldSet2._classPrivateFieldGet2(_focused, this);
|
|
58
|
+
return ((_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) !== "hidden";
|
|
59
|
+
}
|
|
8
60
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
23
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
24
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
25
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
61
|
+
const focusManager = new FocusManager();
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.FocusManager = FocusManager;
|
|
64
|
+
exports.focusManager = focusManager;
|
|
26
65
|
|
|
27
|
-
// src/focusManager.ts
|
|
28
|
-
var focusManager_exports = {};
|
|
29
|
-
__export(focusManager_exports, {
|
|
30
|
-
FocusManager: () => FocusManager,
|
|
31
|
-
focusManager: () => focusManager
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(focusManager_exports);
|
|
34
|
-
var import_subscribable = require("./subscribable.cjs");
|
|
35
|
-
var _focused, _cleanup, _setup;
|
|
36
|
-
var FocusManager = class extends import_subscribable.Subscribable {
|
|
37
|
-
constructor() {
|
|
38
|
-
super();
|
|
39
|
-
__privateAdd(this, _focused);
|
|
40
|
-
__privateAdd(this, _cleanup);
|
|
41
|
-
__privateAdd(this, _setup);
|
|
42
|
-
__privateSet(this, _setup, (onFocus) => {
|
|
43
|
-
if (typeof window !== "undefined" && window.addEventListener) {
|
|
44
|
-
const listener = () => onFocus();
|
|
45
|
-
window.addEventListener("visibilitychange", listener, false);
|
|
46
|
-
return () => {
|
|
47
|
-
window.removeEventListener("visibilitychange", listener);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
onSubscribe() {
|
|
54
|
-
if (!__privateGet(this, _cleanup)) {
|
|
55
|
-
this.setEventListener(__privateGet(this, _setup));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
onUnsubscribe() {
|
|
59
|
-
var _a;
|
|
60
|
-
if (!this.hasListeners()) {
|
|
61
|
-
(_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this);
|
|
62
|
-
__privateSet(this, _cleanup, void 0);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
setEventListener(setup) {
|
|
66
|
-
var _a;
|
|
67
|
-
__privateSet(this, _setup, setup);
|
|
68
|
-
(_a = __privateGet(this, _cleanup)) == null ? void 0 : _a.call(this);
|
|
69
|
-
__privateSet(this, _cleanup, setup((focused) => {
|
|
70
|
-
if (typeof focused === "boolean") {
|
|
71
|
-
this.setFocused(focused);
|
|
72
|
-
} else {
|
|
73
|
-
this.onFocus();
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
setFocused(focused) {
|
|
78
|
-
const changed = __privateGet(this, _focused) !== focused;
|
|
79
|
-
if (changed) {
|
|
80
|
-
__privateSet(this, _focused, focused);
|
|
81
|
-
this.onFocus();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
onFocus() {
|
|
85
|
-
const isFocused = this.isFocused();
|
|
86
|
-
this.listeners.forEach((listener) => {
|
|
87
|
-
listener(isFocused);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
isFocused() {
|
|
91
|
-
var _a;
|
|
92
|
-
if (typeof __privateGet(this, _focused) === "boolean") {
|
|
93
|
-
return __privateGet(this, _focused);
|
|
94
|
-
}
|
|
95
|
-
return ((_a = globalThis.document) == null ? void 0 : _a.visibilityState) !== "hidden";
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
_focused = new WeakMap();
|
|
99
|
-
_cleanup = new WeakMap();
|
|
100
|
-
_setup = new WeakMap();
|
|
101
|
-
var focusManager = new FocusManager();
|
|
102
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
-
0 && (module.exports = {
|
|
104
|
-
FocusManager,
|
|
105
|
-
focusManager
|
|
106
|
-
});
|
|
107
66
|
//# sourceMappingURL=focusManager.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable<Listener> {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window !== 'undefined' && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"focusManager.cjs","names":["Subscribable"],"sources":["../../src/focusManager.ts"],"sourcesContent":["import { Subscribable } from './subscribable'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable<Listener> {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window !== 'undefined' && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n"],"mappings":";;;;;;;AAQA,IAAa,eAAb,cAAkCA,qBAAAA,aAAuB;CAMvD,cAAc;EACZ,MAAM;;;;EACN,8BAAA,uBAAA,QAAA,OAAe,YAAY;GAGzB,IAAI,OAAO,WAAW,eAAe,OAAO,kBAAkB;IAC5D,MAAM,iBAAiB,QAAQ;IAE/B,OAAO,iBAAiB,oBAAoB,UAAU,KAAK;IAE3D,aAAa;KAEX,OAAO,oBAAoB,oBAAoB,QAAQ;IACzD;GACF;EAEF,CAAA;CACF;CAEA,cAA8B;EAC5B,IAAI,CAAA,8BAAA,uBAAA,UAAC,IAAA,GACH,KAAK,iBAAA,8BAAA,uBAAA,QAAiB,IAAA,CAAW;CAErC;CAEA,gBAA0B;EACxB,IAAI,CAAC,KAAK,aAAa,GAAG;;GACxB,CAAA,2BAAA,8BAAA,uBAAA,UAAA,IAAA,OAAA,QAAA,6BAAA,KAAA,KAAA,yBAAA,KAAA,IAAgB;GAChB,8BAAA,uBAAA,UAAA,MAAgB,KAAA,CAAA;EAClB;CACF;CAEA,iBAAiB,OAAsB;;EACrC,8BAAA,uBAAA,QAAA,MAAc,KAAA;EACd,CAAA,yBAAA,8BAAA,uBAAA,UAAA,IAAA,OAAA,QAAA,2BAAA,KAAA,KAAA,uBAAA,KAAA,IAAgB;EAChB,8BAAA,uBAAA,UAAA,MAAgB,OAAO,YAAY;GACjC,IAAI,OAAO,YAAY,WACrB,KAAK,WAAW,OAAO;QAEvB,KAAK,QAAQ;EAEjB,CAAC,CAAA;CACH;CAEA,WAAW,SAAyB;EAElC,IAAA,8BAAA,uBAAA,UADgB,IAAA,MAAkB,SACrB;GACX,8BAAA,uBAAA,UAAA,MAAgB,OAAA;GAChB,KAAK,QAAQ;EACf;CACF;CAEA,UAAgB;EACd,MAAM,YAAY,KAAK,UAAU;EACjC,KAAK,UAAU,SAAS,aAAa;GACnC,SAAS,SAAS;EACpB,CAAC;CACH;CAEA,YAAqB;;EACnB,IAAI,OAAA,8BAAA,uBAAA,UAAO,IAAA,MAAkB,WAC3B,OAAA,8BAAA,uBAAA,UAAO,IAAA;EAKT,SAAA,uBAAO,WAAW,cAAA,QAAA,yBAAA,KAAA,IAAA,KAAA,IAAA,qBAAU,qBAAoB;CAClD;AACF;AAEA,MAAa,eAAe,IAAI,aAAa"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { t as Subscribable } from "./subscribable-CbifVTKz.cjs";
|
|
2
|
+
//#region src/focusManager.d.ts
|
|
3
|
+
type Listener = (focused: boolean) => void;
|
|
4
|
+
type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined;
|
|
5
|
+
declare class FocusManager extends Subscribable<Listener> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
protected onSubscribe(): void;
|
|
9
|
+
protected onUnsubscribe(): void;
|
|
10
|
+
setEventListener(setup: SetupFn): void;
|
|
11
|
+
setFocused(focused?: boolean): void;
|
|
12
|
+
onFocus(): void;
|
|
13
|
+
isFocused(): boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const focusManager: FocusManager;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FocusManager, focusManager };
|
|
18
|
+
//# sourceMappingURL=focusManager.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusManager.d.cts","names":[],"sources":["../../src/focusManager.ts"],"mappings":";;KAEK,YAAY;KAEZ,WACH,aAAa;cAGF,qBAAqB,aAAa;;;YAyBnC;YAMA;EAOV,iBAAiB,OAAO;EAYxB,WAAW;EAQX;EAOA;;cAWW,cAAY"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { t as Subscribable } from "./subscribable-CbifVTKz.js";
|
|
2
|
+
//#region src/focusManager.d.ts
|
|
3
|
+
type Listener = (focused: boolean) => void;
|
|
4
|
+
type SetupFn = (setFocused: (focused?: boolean) => void) => (() => void) | undefined;
|
|
5
|
+
declare class FocusManager extends Subscribable<Listener> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
protected onSubscribe(): void;
|
|
9
|
+
protected onUnsubscribe(): void;
|
|
10
|
+
setEventListener(setup: SetupFn): void;
|
|
11
|
+
setFocused(focused?: boolean): void;
|
|
12
|
+
onFocus(): void;
|
|
13
|
+
isFocused(): boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const focusManager: FocusManager;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FocusManager, focusManager };
|
|
18
|
+
//# sourceMappingURL=focusManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusManager.d.ts","names":[],"sources":["../../src/focusManager.ts"],"mappings":";;KAEK,YAAY;KAEZ,WACH,aAAa;cAGF,qBAAqB,aAAa;;;YAyBnC;YAMA;EAOV,iBAAiB,OAAO;EAYxB,WAAW;EAQX;EAOA;;cAWW,cAAY"}
|