zudoku 0.16.2 → 0.17.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/dist/app/entry.server.js +4 -5
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +2 -2
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/validate.d.ts +44 -44
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -2
- package/dist/lib/authentication/state.d.ts +1 -1
- package/dist/lib/authentication/state.js +5 -3
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
- package/dist/lib/authentication/use-broadcast/shared.js +243 -0
- package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
- package/dist/lib/components/ClientOnly.d.ts +4 -2
- package/dist/lib/components/ClientOnly.js +1 -1
- package/dist/lib/components/ClientOnly.js.map +1 -1
- package/dist/lib/components/Header.js +4 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
- package/dist/lib/components/{DevPortal.js → Zudoku.js} +11 -11
- package/dist/lib/components/Zudoku.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +4 -4
- package/dist/lib/components/context/ZudokuContext.js +1 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +4 -7
- package/dist/lib/components/index.js +2 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +5 -5
- package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -2
- package/dist/lib/core/ZudokuContext.js.map +1 -0
- package/dist/lib/core/plugins.d.ts +12 -12
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -9
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -2
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +4 -2
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +28 -24
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +1 -4
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +9 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +2 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +2 -2
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +2 -2
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/ui/ActionButton.d.ts +4 -0
- package/dist/lib/ui/ActionButton.js +10 -0
- package/dist/lib/ui/ActionButton.js.map +1 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +4 -0
- package/dist/lib/util/useOnScreen.js +19 -0
- package/dist/lib/util/useOnScreen.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +0 -6
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-DYbUOP9U.js} +2 -2
- package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-DYbUOP9U.js.map} +1 -1
- package/lib/{AuthenticationPlugin-C9BHGXlE.js → AuthenticationPlugin-bqGAKfot.js} +3 -3
- package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-bqGAKfot.js.map} +1 -1
- package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
- package/lib/ClientOnly-E7hGysn1.js.map +1 -0
- package/lib/{Markdown-BDcCAWwm.js → Markdown-D6UxMbZm.js} +2 -2
- package/lib/{Markdown-BDcCAWwm.js.map → Markdown-D6UxMbZm.js.map} +1 -1
- package/lib/{MdxPage-DKMH_t0f.js → MdxPage-DRKqyn2b.js} +5 -5
- package/lib/{MdxPage-DKMH_t0f.js.map → MdxPage-DRKqyn2b.js.map} +1 -1
- package/lib/{OperationList-35iw_Gil.js → OperationList-BHUBGM0c.js} +116 -113
- package/lib/OperationList-BHUBGM0c.js.map +1 -0
- package/lib/{Route-BsEZmkNl.js → Route-B0XuN1oC.js} +3 -3
- package/lib/{Route-BsEZmkNl.js.map → Route-B0XuN1oC.js.map} +1 -1
- package/lib/{Select-Bagt3Bme.js → Select-DYKDahHt.js} +3 -3
- package/lib/{Select-Bagt3Bme.js.map → Select-DYKDahHt.js.map} +1 -1
- package/lib/{Spinner-C6zroowC.js → SidebarBadge-Bbt92M5K.js} +16 -18
- package/lib/SidebarBadge-Bbt92M5K.js.map +1 -0
- package/lib/{SlotletProvider-Da7eFgd2.js → SlotletProvider-mhjLPG44.js} +4 -4
- package/lib/{SlotletProvider-Da7eFgd2.js.map → SlotletProvider-mhjLPG44.js.map} +1 -1
- package/lib/Spinner-ChOGyPls.js +51 -0
- package/lib/Spinner-ChOGyPls.js.map +1 -0
- package/lib/{hook-sn0zMTkE.js → hook-CjQERPa7.js} +3 -3
- package/lib/{hook-sn0zMTkE.js.map → hook-CjQERPa7.js.map} +1 -1
- package/lib/{index-BdD8UbS-.js → index-BRg5pi5D.js} +1351 -1364
- package/lib/index-BRg5pi5D.js.map +1 -0
- package/lib/{index-CRo94sKK.js → index-DM9hrcCG.js} +4 -4
- package/lib/{index-CRo94sKK.js.map → index-DM9hrcCG.js.map} +1 -1
- package/lib/state-BsPrOUAh.js +252 -0
- package/lib/state-BsPrOUAh.js.map +1 -0
- package/lib/ui/ActionButton.js +24 -0
- package/lib/ui/ActionButton.js.map +1 -0
- package/lib/urql-core-35Qt_U4i.js +1511 -0
- package/lib/{urql-core-KJnLL26g.js.map → urql-core-35Qt_U4i.js.map} +1 -1
- package/lib/{useExposedProps-ChOIUaS4.js → useExposedProps-BxyHjPNN.js} +2 -2
- package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-BxyHjPNN.js.map} +1 -1
- package/lib/{ZudokuContext-BKXGJTmu.js → utils-DNAltzXc.js} +153 -152
- package/lib/utils-DNAltzXc.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.components.js +690 -667
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +737 -729
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -6
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +2 -2
- package/src/app/entry.server.tsx +9 -5
- package/src/app/main.tsx +4 -4
- package/src/lib/authentication/authentication.ts +2 -2
- package/src/lib/authentication/state.ts +12 -5
- package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
- package/src/lib/authentication/use-broadcast/shared.ts +372 -0
- package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
- package/src/lib/components/ClientOnly.tsx +6 -3
- package/src/lib/components/Header.tsx +31 -25
- package/src/lib/components/Zudoku.tsx +113 -0
- package/src/lib/components/context/ZudokuContext.ts +3 -3
- package/src/lib/components/context/ZudokuProvider.tsx +2 -2
- package/src/lib/components/index.ts +2 -3
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +5 -5
- package/src/lib/core/plugins.ts +12 -16
- package/src/lib/plugins/api-keys/index.tsx +9 -9
- package/src/lib/plugins/custom-pages/index.tsx +2 -2
- package/src/lib/plugins/markdown/index.tsx +2 -2
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -8
- package/src/lib/plugins/openapi/OperationList.tsx +2 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
- package/src/lib/plugins/openapi/Sidecar.tsx +65 -51
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +17 -3
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +5 -1
- package/src/lib/plugins/openapi/index.tsx +2 -4
- package/src/lib/plugins/redirect/index.tsx +2 -2
- package/src/lib/plugins/search-inkeep/index.tsx +2 -2
- package/src/lib/ui/ActionButton.tsx +28 -0
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -0
- package/dist/lib/components/DevPortal.js.map +0 -1
- package/dist/lib/core/DevPortalContext.js.map +0 -1
- package/lib/ClientOnly-CVN6leDu.js.map +0 -1
- package/lib/OperationList-35iw_Gil.js.map +0 -1
- package/lib/Spinner-C6zroowC.js.map +0 -1
- package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
- package/lib/index-BdD8UbS-.js.map +0 -1
- package/lib/state-CsuHT8ZO.js +0 -183
- package/lib/state-CsuHT8ZO.js.map +0 -1
- package/lib/urql-core-KJnLL26g.js +0 -1455
- package/src/lib/components/DevPortal.tsx +0 -111
|
@@ -3,12 +3,16 @@ var _e = (t) => {
|
|
|
3
3
|
};
|
|
4
4
|
var be = (t, e, s) => e.has(t) || _e("Cannot " + s);
|
|
5
5
|
var i = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (t, e, s) => e.has(t) ? _e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (be(t, e, "access private method"), s);
|
|
6
|
-
import * as
|
|
6
|
+
import * as T from "react";
|
|
7
7
|
import { createContext as dt, useContext as ft } from "react";
|
|
8
8
|
import { j as yt } from "./jsx-runtime-B6kdoens.js";
|
|
9
|
-
import { u as pe } from "./index-
|
|
9
|
+
import { u as pe } from "./index-DM9hrcCG.js";
|
|
10
10
|
import { b as pt } from "./router-BsfSoK2j.js";
|
|
11
|
-
|
|
11
|
+
const V = (...t) => {
|
|
12
|
+
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
13
|
+
return e ? `/${e}` : "/";
|
|
14
|
+
};
|
|
15
|
+
var Ue = class {
|
|
12
16
|
constructor() {
|
|
13
17
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
14
18
|
}
|
|
@@ -24,10 +28,10 @@ var ke = class {
|
|
|
24
28
|
}
|
|
25
29
|
onUnsubscribe() {
|
|
26
30
|
}
|
|
27
|
-
},
|
|
31
|
+
}, $ = typeof window > "u" || "Deno" in globalThis;
|
|
28
32
|
function ge() {
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function Wt(t, e) {
|
|
31
35
|
return typeof t == "function" ? t(e) : t;
|
|
32
36
|
}
|
|
33
37
|
function Ce(t) {
|
|
@@ -42,7 +46,7 @@ function fe(t, e) {
|
|
|
42
46
|
function q(t, e) {
|
|
43
47
|
return typeof t == "function" ? t(e) : t;
|
|
44
48
|
}
|
|
45
|
-
function
|
|
49
|
+
function Jt(t, e) {
|
|
46
50
|
const {
|
|
47
51
|
type: s = "all",
|
|
48
52
|
exact: r,
|
|
@@ -163,14 +167,14 @@ function mt(t, e) {
|
|
|
163
167
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
164
168
|
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ye ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
165
169
|
}
|
|
166
|
-
var K, Q,
|
|
170
|
+
var K, Q, J, $e, gt = ($e = class extends Ue {
|
|
167
171
|
constructor() {
|
|
168
172
|
super();
|
|
169
173
|
y(this, K);
|
|
170
174
|
y(this, Q);
|
|
171
|
-
y(this,
|
|
172
|
-
c(this,
|
|
173
|
-
if (
|
|
175
|
+
y(this, J);
|
|
176
|
+
c(this, J, (e) => {
|
|
177
|
+
if (!$ && window.addEventListener) {
|
|
174
178
|
const s = () => e();
|
|
175
179
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
176
180
|
window.removeEventListener("visibilitychange", s);
|
|
@@ -179,7 +183,7 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
179
183
|
});
|
|
180
184
|
}
|
|
181
185
|
onSubscribe() {
|
|
182
|
-
i(this, Q) || this.setEventListener(i(this,
|
|
186
|
+
i(this, Q) || this.setEventListener(i(this, J));
|
|
183
187
|
}
|
|
184
188
|
onUnsubscribe() {
|
|
185
189
|
var e;
|
|
@@ -187,7 +191,7 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
187
191
|
}
|
|
188
192
|
setEventListener(e) {
|
|
189
193
|
var s;
|
|
190
|
-
c(this,
|
|
194
|
+
c(this, J, e), (s = i(this, Q)) == null || s.call(this), c(this, Q, e((r) => {
|
|
191
195
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
192
196
|
}));
|
|
193
197
|
}
|
|
@@ -204,14 +208,14 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
204
208
|
var e;
|
|
205
209
|
return typeof i(this, K) == "boolean" ? i(this, K) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
206
210
|
}
|
|
207
|
-
}, K = new WeakMap(), Q = new WeakMap(),
|
|
211
|
+
}, K = new WeakMap(), Q = new WeakMap(), J = new WeakMap(), $e), et = new gt(), X, A, Y, Ze, Ct = (Ze = class extends Ue {
|
|
208
212
|
constructor() {
|
|
209
213
|
super();
|
|
210
214
|
y(this, X, !0);
|
|
211
215
|
y(this, A);
|
|
212
216
|
y(this, Y);
|
|
213
217
|
c(this, Y, (e) => {
|
|
214
|
-
if (
|
|
218
|
+
if (!$ && window.addEventListener) {
|
|
215
219
|
const s = () => e(!0), r = () => e(!1);
|
|
216
220
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
217
221
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
@@ -238,7 +242,7 @@ var K, Q, Z, $e, gt = ($e = class extends ke {
|
|
|
238
242
|
isOnline() {
|
|
239
243
|
return i(this, X);
|
|
240
244
|
}
|
|
241
|
-
}, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(),
|
|
245
|
+
}, X = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), Ze), tt = new Ct();
|
|
242
246
|
function Fe() {
|
|
243
247
|
let t, e;
|
|
244
248
|
const s = new Promise((n, u) => {
|
|
@@ -312,7 +316,7 @@ function Rt(t) {
|
|
|
312
316
|
var ve;
|
|
313
317
|
if (r)
|
|
314
318
|
return;
|
|
315
|
-
const
|
|
319
|
+
const x = t.retry ?? ($ ? 0 : 3), N = t.retryDelay ?? St, ce = typeof N == "function" ? N(s, P) : N, le = x === !0 || typeof x == "number" && s < x || typeof x == "function" && x(s, P);
|
|
316
320
|
if (e || !le) {
|
|
317
321
|
m(P);
|
|
318
322
|
return;
|
|
@@ -391,7 +395,7 @@ function wt() {
|
|
|
391
395
|
}
|
|
392
396
|
};
|
|
393
397
|
}
|
|
394
|
-
var Ae = wt(), _,
|
|
398
|
+
var Ae = wt(), _, We, Et = (We = class {
|
|
395
399
|
constructor() {
|
|
396
400
|
y(this, _);
|
|
397
401
|
}
|
|
@@ -406,23 +410,23 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
406
410
|
updateGcTime(t) {
|
|
407
411
|
this.gcTime = Math.max(
|
|
408
412
|
this.gcTime || 0,
|
|
409
|
-
t ?? (
|
|
413
|
+
t ?? ($ ? 1 / 0 : 5 * 60 * 1e3)
|
|
410
414
|
);
|
|
411
415
|
}
|
|
412
416
|
clearGcTimeout() {
|
|
413
417
|
i(this, _) && (clearTimeout(i(this, _)), c(this, _, void 0));
|
|
414
418
|
}
|
|
415
|
-
}, _ = new WeakMap(),
|
|
419
|
+
}, _ = new WeakMap(), We), ee, te, I, R, oe, H, D, U, Je, ts = (Je = class extends Et {
|
|
416
420
|
constructor(e) {
|
|
417
421
|
super();
|
|
418
|
-
y(this,
|
|
422
|
+
y(this, D);
|
|
419
423
|
y(this, ee);
|
|
420
424
|
y(this, te);
|
|
421
|
-
y(this,
|
|
425
|
+
y(this, I);
|
|
422
426
|
y(this, R);
|
|
423
427
|
y(this, oe);
|
|
424
428
|
y(this, H);
|
|
425
|
-
c(this, H, !1), c(this, oe, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this,
|
|
429
|
+
c(this, H, !1), c(this, oe, e.defaultOptions), this.setOptions(e.options), this.observers = [], c(this, I, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, c(this, ee, Ot(this.options)), this.state = e.state ?? i(this, ee), this.scheduleGc();
|
|
426
430
|
}
|
|
427
431
|
get meta() {
|
|
428
432
|
return this.options.meta;
|
|
@@ -435,11 +439,11 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
435
439
|
this.options = { ...i(this, oe), ...e }, this.updateGcTime(this.options.gcTime);
|
|
436
440
|
}
|
|
437
441
|
optionalRemove() {
|
|
438
|
-
!this.observers.length && this.state.fetchStatus === "idle" && i(this,
|
|
442
|
+
!this.observers.length && this.state.fetchStatus === "idle" && i(this, I).remove(this);
|
|
439
443
|
}
|
|
440
444
|
setData(e, s) {
|
|
441
445
|
const r = Oe(this.state.data, e, this.options);
|
|
442
|
-
return b(this,
|
|
446
|
+
return b(this, D, U).call(this, {
|
|
443
447
|
data: r,
|
|
444
448
|
type: "success",
|
|
445
449
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -447,7 +451,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
447
451
|
}), r;
|
|
448
452
|
}
|
|
449
453
|
setState(e, s) {
|
|
450
|
-
b(this,
|
|
454
|
+
b(this, D, U).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
451
455
|
}
|
|
452
456
|
cancel(e) {
|
|
453
457
|
var r, n;
|
|
@@ -487,16 +491,16 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
487
491
|
e == null || e.refetch({ cancelRefetch: !1 }), (s = i(this, R)) == null || s.continue();
|
|
488
492
|
}
|
|
489
493
|
addObserver(e) {
|
|
490
|
-
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this,
|
|
494
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), i(this, I).notify({ type: "observerAdded", query: this, observer: e }));
|
|
491
495
|
}
|
|
492
496
|
removeObserver(e) {
|
|
493
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, R) && (i(this, H) ? i(this, R).cancel({ revert: !0 }) : i(this, R).cancelRetry()), this.scheduleGc()), i(this,
|
|
497
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (i(this, R) && (i(this, H) ? i(this, R).cancel({ revert: !0 }) : i(this, R).cancelRetry()), this.scheduleGc()), i(this, I).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
494
498
|
}
|
|
495
499
|
getObserversCount() {
|
|
496
500
|
return this.observers.length;
|
|
497
501
|
}
|
|
498
502
|
invalidate() {
|
|
499
|
-
this.state.isInvalidated || b(this,
|
|
503
|
+
this.state.isInvalidated || b(this, D, U).call(this, { type: "invalidate" });
|
|
500
504
|
}
|
|
501
505
|
fetch(e, s) {
|
|
502
506
|
var l, C, v;
|
|
@@ -538,17 +542,17 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
538
542
|
n(a), (l = this.options.behavior) == null || l.onFetch(
|
|
539
543
|
a,
|
|
540
544
|
this
|
|
541
|
-
), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((C = a.fetchOptions) == null ? void 0 : C.meta)) && b(this,
|
|
545
|
+
), c(this, te, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((C = a.fetchOptions) == null ? void 0 : C.meta)) && b(this, D, U).call(this, { type: "fetch", meta: (v = a.fetchOptions) == null ? void 0 : v.meta });
|
|
542
546
|
const o = (h) => {
|
|
543
547
|
var m, S, w, f;
|
|
544
|
-
me(h) && h.silent || b(this,
|
|
548
|
+
me(h) && h.silent || b(this, D, U).call(this, {
|
|
545
549
|
type: "error",
|
|
546
550
|
error: h
|
|
547
|
-
}), me(h) || ((S = (m = i(this,
|
|
551
|
+
}), me(h) || ((S = (m = i(this, I).config).onError) == null || S.call(
|
|
548
552
|
m,
|
|
549
553
|
h,
|
|
550
554
|
this
|
|
551
|
-
), (f = (w = i(this,
|
|
555
|
+
), (f = (w = i(this, I).config).onSettled) == null || f.call(
|
|
552
556
|
w,
|
|
553
557
|
this.state.data,
|
|
554
558
|
h,
|
|
@@ -573,7 +577,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
573
577
|
o(g);
|
|
574
578
|
return;
|
|
575
579
|
}
|
|
576
|
-
(S = (m = i(this,
|
|
580
|
+
(S = (m = i(this, I).config).onSuccess) == null || S.call(m, h, this), (f = (w = i(this, I).config).onSettled) == null || f.call(
|
|
577
581
|
w,
|
|
578
582
|
h,
|
|
579
583
|
this.state.error,
|
|
@@ -582,13 +586,13 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
582
586
|
},
|
|
583
587
|
onError: o,
|
|
584
588
|
onFail: (h, m) => {
|
|
585
|
-
b(this,
|
|
589
|
+
b(this, D, U).call(this, { type: "failed", failureCount: h, error: m });
|
|
586
590
|
},
|
|
587
591
|
onPause: () => {
|
|
588
|
-
b(this,
|
|
592
|
+
b(this, D, U).call(this, { type: "pause" });
|
|
589
593
|
},
|
|
590
594
|
onContinue: () => {
|
|
591
|
-
b(this,
|
|
595
|
+
b(this, D, U).call(this, { type: "continue" });
|
|
592
596
|
},
|
|
593
597
|
retry: a.options.retry,
|
|
594
598
|
retryDelay: a.options.retryDelay,
|
|
@@ -596,7 +600,7 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
596
600
|
canRun: () => !0
|
|
597
601
|
})), i(this, R).start();
|
|
598
602
|
}
|
|
599
|
-
}, ee = new WeakMap(), te = new WeakMap(),
|
|
603
|
+
}, ee = new WeakMap(), te = new WeakMap(), I = new WeakMap(), R = new WeakMap(), oe = new WeakMap(), H = new WeakMap(), D = new WeakSet(), U = function(e) {
|
|
600
604
|
const s = (r) => {
|
|
601
605
|
switch (e.type) {
|
|
602
606
|
case "failed":
|
|
@@ -663,9 +667,9 @@ var Ae = wt(), _, Je, Et = (Je = class {
|
|
|
663
667
|
this.state = s(this.state), Ae.batch(() => {
|
|
664
668
|
this.observers.forEach((r) => {
|
|
665
669
|
r.onQueryUpdate();
|
|
666
|
-
}), i(this,
|
|
670
|
+
}), i(this, I).notify({ query: this, type: "updated", action: e });
|
|
667
671
|
});
|
|
668
|
-
},
|
|
672
|
+
}, Je);
|
|
669
673
|
function it(t, e) {
|
|
670
674
|
return {
|
|
671
675
|
fetchFailureCount: 0,
|
|
@@ -694,7 +698,7 @@ function Ot(t) {
|
|
|
694
698
|
fetchStatus: "idle"
|
|
695
699
|
};
|
|
696
700
|
}
|
|
697
|
-
var F, d, ue, O, B, se, L,
|
|
701
|
+
var F, d, ue, O, B, se, L, k, he, re, ie, G, z, M, ne, p, ae, Pe, Ie, Te, De, qe, je, ke, at, Xe, nt = (Xe = class extends Ue {
|
|
698
702
|
constructor(e, s) {
|
|
699
703
|
super();
|
|
700
704
|
y(this, p);
|
|
@@ -705,7 +709,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
705
709
|
y(this, B);
|
|
706
710
|
y(this, se);
|
|
707
711
|
y(this, L);
|
|
708
|
-
y(this,
|
|
712
|
+
y(this, k);
|
|
709
713
|
y(this, he);
|
|
710
714
|
y(this, re);
|
|
711
715
|
// This property keeps track of the last query with defined data.
|
|
@@ -715,7 +719,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
715
719
|
y(this, z);
|
|
716
720
|
y(this, M);
|
|
717
721
|
y(this, ne, /* @__PURE__ */ new Set());
|
|
718
|
-
this.options = s, c(this, F, e), c(this,
|
|
722
|
+
this.options = s, c(this, F, e), c(this, k, null), c(this, L, Fe()), this.options.experimental_prefetchInRender || i(this, L).reject(
|
|
719
723
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
720
724
|
), this.bindMethods(), this.setOptions(s);
|
|
721
725
|
}
|
|
@@ -723,20 +727,20 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
723
727
|
this.refetch = this.refetch.bind(this);
|
|
724
728
|
}
|
|
725
729
|
onSubscribe() {
|
|
726
|
-
this.listeners.size === 1 && (i(this, d).addObserver(this), Ge(i(this, d), this.options) ? b(this, p, ae).call(this) : this.updateResult(), b(this, p,
|
|
730
|
+
this.listeners.size === 1 && (i(this, d).addObserver(this), Ge(i(this, d), this.options) ? b(this, p, ae).call(this) : this.updateResult(), b(this, p, De).call(this));
|
|
727
731
|
}
|
|
728
732
|
onUnsubscribe() {
|
|
729
733
|
this.hasListeners() || this.destroy();
|
|
730
734
|
}
|
|
731
735
|
shouldFetchOnReconnect() {
|
|
732
|
-
return
|
|
736
|
+
return xe(
|
|
733
737
|
i(this, d),
|
|
734
738
|
this.options,
|
|
735
739
|
this.options.refetchOnReconnect
|
|
736
740
|
);
|
|
737
741
|
}
|
|
738
742
|
shouldFetchOnWindowFocus() {
|
|
739
|
-
return
|
|
743
|
+
return xe(
|
|
740
744
|
i(this, d),
|
|
741
745
|
this.options,
|
|
742
746
|
this.options.refetchOnWindowFocus
|
|
@@ -751,7 +755,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
751
755
|
throw new Error(
|
|
752
756
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
753
757
|
);
|
|
754
|
-
b(this, p,
|
|
758
|
+
b(this, p, ke).call(this), i(this, d).setOptions(this.options), r._defaulted && !we(this.options, r) && i(this, F).getQueryCache().notify({
|
|
755
759
|
type: "observerOptionsUpdated",
|
|
756
760
|
query: i(this, d),
|
|
757
761
|
observer: this
|
|
@@ -763,8 +767,8 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
763
767
|
this.options,
|
|
764
768
|
r
|
|
765
769
|
) && b(this, p, ae).call(this), this.updateResult(s), u && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || fe(this.options.staleTime, i(this, d)) !== fe(r.staleTime, i(this, d))) && b(this, p, Pe).call(this);
|
|
766
|
-
const a = b(this, p,
|
|
767
|
-
u && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || a !== i(this, M)) && b(this, p,
|
|
770
|
+
const a = b(this, p, Ie).call(this);
|
|
771
|
+
u && (i(this, d) !== n || q(this.options.enabled, i(this, d)) !== q(r.enabled, i(this, d)) || a !== i(this, M)) && b(this, p, Te).call(this, a);
|
|
768
772
|
}
|
|
769
773
|
getOptimisticResult(e) {
|
|
770
774
|
const s = i(this, F).getQueryCache().build(i(this, F), e), r = this.createResult(s, e);
|
|
@@ -809,8 +813,8 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
809
813
|
const r = i(this, d), n = this.options, u = i(this, O), a = i(this, B), o = i(this, se), C = e !== r ? e.state : i(this, ue), { state: v } = e;
|
|
810
814
|
let h = { ...v }, m = !1, S;
|
|
811
815
|
if (s._optimisticResults) {
|
|
812
|
-
const E = this.hasListeners(),
|
|
813
|
-
(
|
|
816
|
+
const E = this.hasListeners(), Z = !E && Ge(e, s), W = E && ze(e, r, s, n);
|
|
817
|
+
(Z || W) && (h = {
|
|
814
818
|
...h,
|
|
815
819
|
...it(v.data, e.options)
|
|
816
820
|
}), s._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
|
|
@@ -821,9 +825,9 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
821
825
|
S = i(this, re);
|
|
822
826
|
else
|
|
823
827
|
try {
|
|
824
|
-
c(this, he, s.select), S = s.select(h.data), S = Oe(u == null ? void 0 : u.data, S, s), c(this, re, S), c(this,
|
|
828
|
+
c(this, he, s.select), S = s.select(h.data), S = Oe(u == null ? void 0 : u.data, S, s), c(this, re, S), c(this, k, null);
|
|
825
829
|
} catch (E) {
|
|
826
|
-
c(this,
|
|
830
|
+
c(this, k, E);
|
|
827
831
|
}
|
|
828
832
|
else
|
|
829
833
|
S = h.data;
|
|
@@ -836,9 +840,9 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
836
840
|
i(this, ie)
|
|
837
841
|
) : s.placeholderData, s.select && E !== void 0)
|
|
838
842
|
try {
|
|
839
|
-
E = s.select(E), c(this,
|
|
840
|
-
} catch (
|
|
841
|
-
c(this,
|
|
843
|
+
E = s.select(E), c(this, k, null);
|
|
844
|
+
} catch (Z) {
|
|
845
|
+
c(this, k, Z);
|
|
842
846
|
}
|
|
843
847
|
E !== void 0 && (g = "success", S = Oe(
|
|
844
848
|
u == null ? void 0 : u.data,
|
|
@@ -846,11 +850,11 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
846
850
|
s
|
|
847
851
|
), m = !0);
|
|
848
852
|
}
|
|
849
|
-
i(this,
|
|
850
|
-
const P = h.fetchStatus === "fetching",
|
|
853
|
+
i(this, k) && (w = i(this, k), S = i(this, re), f = Date.now(), g = "error");
|
|
854
|
+
const P = h.fetchStatus === "fetching", x = g === "pending", N = g === "error", ce = x && P, le = S !== void 0, j = {
|
|
851
855
|
status: g,
|
|
852
856
|
fetchStatus: h.fetchStatus,
|
|
853
|
-
isPending:
|
|
857
|
+
isPending: x,
|
|
854
858
|
isSuccess: g === "success",
|
|
855
859
|
isError: N,
|
|
856
860
|
isInitialLoading: ce,
|
|
@@ -865,7 +869,7 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
865
869
|
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
|
|
866
870
|
isFetchedAfterMount: h.dataUpdateCount > C.dataUpdateCount || h.errorUpdateCount > C.errorUpdateCount,
|
|
867
871
|
isFetching: P,
|
|
868
|
-
isRefetching: P && !
|
|
872
|
+
isRefetching: P && !x,
|
|
869
873
|
isLoadingError: N && !le,
|
|
870
874
|
isPaused: h.fetchStatus === "paused",
|
|
871
875
|
isPlaceholderData: m,
|
|
@@ -877,19 +881,19 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
877
881
|
if (this.options.experimental_prefetchInRender) {
|
|
878
882
|
const E = (de) => {
|
|
879
883
|
j.status === "error" ? de.reject(j.error) : j.data !== void 0 && de.resolve(j.data);
|
|
880
|
-
},
|
|
884
|
+
}, Z = () => {
|
|
881
885
|
const de = c(this, L, j.promise = Fe());
|
|
882
886
|
E(de);
|
|
883
|
-
},
|
|
884
|
-
switch (
|
|
887
|
+
}, W = i(this, L);
|
|
888
|
+
switch (W.status) {
|
|
885
889
|
case "pending":
|
|
886
|
-
e.queryHash === r.queryHash && E(
|
|
890
|
+
e.queryHash === r.queryHash && E(W);
|
|
887
891
|
break;
|
|
888
892
|
case "fulfilled":
|
|
889
|
-
(j.status === "error" || j.data !==
|
|
893
|
+
(j.status === "error" || j.data !== W.value) && Z();
|
|
890
894
|
break;
|
|
891
895
|
case "rejected":
|
|
892
|
-
(j.status !== "error" || j.error !==
|
|
896
|
+
(j.status !== "error" || j.error !== W.reason) && Z();
|
|
893
897
|
break;
|
|
894
898
|
}
|
|
895
899
|
}
|
|
@@ -917,10 +921,10 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
917
921
|
(e == null ? void 0 : e.listeners) !== !1 && u() && (n.listeners = !0), b(this, p, at).call(this, { ...n, ...e });
|
|
918
922
|
}
|
|
919
923
|
onQueryUpdate() {
|
|
920
|
-
this.updateResult(), this.hasListeners() && b(this, p,
|
|
924
|
+
this.updateResult(), this.hasListeners() && b(this, p, De).call(this);
|
|
921
925
|
}
|
|
922
|
-
}, F = new WeakMap(), d = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), B = new WeakMap(), se = new WeakMap(), L = new WeakMap(),
|
|
923
|
-
b(this, p,
|
|
926
|
+
}, F = new WeakMap(), d = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), B = new WeakMap(), se = new WeakMap(), L = new WeakMap(), k = new WeakMap(), he = new WeakMap(), re = new WeakMap(), ie = new WeakMap(), G = new WeakMap(), z = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), p = new WeakSet(), ae = function(e) {
|
|
927
|
+
b(this, p, ke).call(this);
|
|
924
928
|
let s = i(this, d).fetch(
|
|
925
929
|
this.options,
|
|
926
930
|
e
|
|
@@ -932,25 +936,25 @@ var F, d, ue, O, B, se, L, x, he, re, ie, G, z, M, ne, p, ae, Pe, De, Ie, Te, qe
|
|
|
932
936
|
this.options.staleTime,
|
|
933
937
|
i(this, d)
|
|
934
938
|
);
|
|
935
|
-
if (
|
|
939
|
+
if ($ || i(this, O).isStale || !Ce(e))
|
|
936
940
|
return;
|
|
937
941
|
const r = Ye(i(this, O).dataUpdatedAt, e) + 1;
|
|
938
942
|
c(this, G, setTimeout(() => {
|
|
939
943
|
i(this, O).isStale || this.updateResult();
|
|
940
944
|
}, r));
|
|
941
|
-
},
|
|
945
|
+
}, Ie = function() {
|
|
942
946
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, d)) : this.options.refetchInterval) ?? !1;
|
|
943
|
-
},
|
|
944
|
-
b(this, p, je).call(this), c(this, M, e), !(
|
|
947
|
+
}, Te = function(e) {
|
|
948
|
+
b(this, p, je).call(this), c(this, M, e), !($ || q(this.options.enabled, i(this, d)) === !1 || !Ce(i(this, M)) || i(this, M) === 0) && c(this, z, setInterval(() => {
|
|
945
949
|
(this.options.refetchIntervalInBackground || et.isFocused()) && b(this, p, ae).call(this);
|
|
946
950
|
}, i(this, M)));
|
|
947
|
-
},
|
|
948
|
-
b(this, p, Pe).call(this), b(this, p,
|
|
951
|
+
}, De = function() {
|
|
952
|
+
b(this, p, Pe).call(this), b(this, p, Te).call(this, b(this, p, Ie).call(this));
|
|
949
953
|
}, qe = function() {
|
|
950
954
|
i(this, G) && (clearTimeout(i(this, G)), c(this, G, void 0));
|
|
951
955
|
}, je = function() {
|
|
952
956
|
i(this, z) && (clearInterval(i(this, z)), c(this, z, void 0));
|
|
953
|
-
},
|
|
957
|
+
}, ke = function() {
|
|
954
958
|
const e = i(this, F).getQueryCache().build(i(this, F), this.options);
|
|
955
959
|
if (e === i(this, d))
|
|
956
960
|
return;
|
|
@@ -970,9 +974,9 @@ function Ft(t, e) {
|
|
|
970
974
|
return q(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
971
975
|
}
|
|
972
976
|
function Ge(t, e) {
|
|
973
|
-
return Ft(t, e) || t.state.data !== void 0 &&
|
|
977
|
+
return Ft(t, e) || t.state.data !== void 0 && xe(t, e, e.refetchOnMount);
|
|
974
978
|
}
|
|
975
|
-
function
|
|
979
|
+
function xe(t, e, s) {
|
|
976
980
|
if (q(e.enabled, t) !== !1) {
|
|
977
981
|
const r = typeof s == "function" ? s(t) : s;
|
|
978
982
|
return r === "always" || r !== !1 && Le(t, e);
|
|
@@ -988,21 +992,21 @@ function Le(t, e) {
|
|
|
988
992
|
function Pt(t, e) {
|
|
989
993
|
return !we(t.getCurrentResult(), e);
|
|
990
994
|
}
|
|
991
|
-
var ot =
|
|
995
|
+
var ot = T.createContext(
|
|
992
996
|
void 0
|
|
993
|
-
),
|
|
994
|
-
const e =
|
|
997
|
+
), It = (t) => {
|
|
998
|
+
const e = T.useContext(ot);
|
|
995
999
|
if (!e)
|
|
996
1000
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
997
1001
|
return e;
|
|
998
1002
|
}, ss = ({
|
|
999
1003
|
client: t,
|
|
1000
1004
|
children: e
|
|
1001
|
-
}) => (
|
|
1005
|
+
}) => (T.useEffect(() => (t.mount(), () => {
|
|
1002
1006
|
t.unmount();
|
|
1003
|
-
}), [t]), /* @__PURE__ */ yt.jsx(ot.Provider, { value: t, children: e })), ut =
|
|
1007
|
+
}), [t]), /* @__PURE__ */ yt.jsx(ot.Provider, { value: t, children: e })), ut = T.createContext(!1), Tt = () => T.useContext(ut);
|
|
1004
1008
|
ut.Provider;
|
|
1005
|
-
function
|
|
1009
|
+
function Dt() {
|
|
1006
1010
|
let t = !1;
|
|
1007
1011
|
return {
|
|
1008
1012
|
clearReset: () => {
|
|
@@ -1014,16 +1018,16 @@ function Tt() {
|
|
|
1014
1018
|
isReset: () => t
|
|
1015
1019
|
};
|
|
1016
1020
|
}
|
|
1017
|
-
var qt =
|
|
1018
|
-
function
|
|
1021
|
+
var qt = T.createContext(Dt()), jt = () => T.useContext(qt);
|
|
1022
|
+
function kt(t, e) {
|
|
1019
1023
|
return typeof t == "function" ? t(...e) : !!t;
|
|
1020
1024
|
}
|
|
1021
|
-
function
|
|
1025
|
+
function xt() {
|
|
1022
1026
|
}
|
|
1023
|
-
var
|
|
1027
|
+
var Ut = (t, e) => {
|
|
1024
1028
|
(t.suspense || t.throwOnError) && (e.isReset() || (t.retryOnMount = !1));
|
|
1025
1029
|
}, Qt = (t) => {
|
|
1026
|
-
|
|
1030
|
+
T.useEffect(() => {
|
|
1027
1031
|
t.clearReset();
|
|
1028
1032
|
}, [t]);
|
|
1029
1033
|
}, At = ({
|
|
@@ -1031,7 +1035,7 @@ var kt = (t, e) => {
|
|
|
1031
1035
|
errorResetBoundary: e,
|
|
1032
1036
|
throwOnError: s,
|
|
1033
1037
|
query: r
|
|
1034
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r &&
|
|
1038
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && kt(s, [t.error, r]), Lt = (t, e) => e.state.data === void 0, Mt = (t) => {
|
|
1035
1039
|
t.suspense && (typeof t.staleTime != "number" && (t.staleTime = 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
1036
1040
|
}, Nt = (t, e) => t.isLoading && t.isFetching && !e, Kt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Ve = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1037
1041
|
s.clearReset();
|
|
@@ -1042,19 +1046,19 @@ function ht(t, e, s) {
|
|
|
1042
1046
|
throw new Error(
|
|
1043
1047
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1044
1048
|
);
|
|
1045
|
-
const r =
|
|
1049
|
+
const r = It(), n = Tt(), u = jt(), a = r.defaultQueryOptions(t);
|
|
1046
1050
|
(h = (v = r.getDefaultOptions().queries) == null ? void 0 : v._experimental_beforeQuery) == null || h.call(
|
|
1047
1051
|
v,
|
|
1048
1052
|
a
|
|
1049
|
-
), a._optimisticResults = n ? "isRestoring" : "optimistic", Mt(a),
|
|
1050
|
-
const o = !r.getQueryCache().get(a.queryHash), [l] =
|
|
1053
|
+
), a._optimisticResults = n ? "isRestoring" : "optimistic", Mt(a), Ut(a, u), Qt(u);
|
|
1054
|
+
const o = !r.getQueryCache().get(a.queryHash), [l] = T.useState(
|
|
1051
1055
|
() => new e(
|
|
1052
1056
|
r,
|
|
1053
1057
|
a
|
|
1054
1058
|
)
|
|
1055
1059
|
), C = l.getOptimisticResult(a);
|
|
1056
|
-
if (
|
|
1057
|
-
|
|
1060
|
+
if (T.useSyncExternalStore(
|
|
1061
|
+
T.useCallback(
|
|
1058
1062
|
(f) => {
|
|
1059
1063
|
const g = n ? () => {
|
|
1060
1064
|
} : l.subscribe(Ae.batchCalls(f));
|
|
@@ -1064,7 +1068,7 @@ function ht(t, e, s) {
|
|
|
1064
1068
|
),
|
|
1065
1069
|
() => l.getCurrentResult(),
|
|
1066
1070
|
() => l.getCurrentResult()
|
|
1067
|
-
),
|
|
1071
|
+
), T.useEffect(() => {
|
|
1068
1072
|
l.setOptions(a, { listeners: !1 });
|
|
1069
1073
|
}, [a, l]), Kt(a, C))
|
|
1070
1074
|
throw Ve(a, l, u);
|
|
@@ -1079,7 +1083,7 @@ function ht(t, e, s) {
|
|
|
1079
1083
|
m,
|
|
1080
1084
|
a,
|
|
1081
1085
|
C
|
|
1082
|
-
), a.experimental_prefetchInRender &&
|
|
1086
|
+
), a.experimental_prefetchInRender && !$ && Nt(C, n)) {
|
|
1083
1087
|
const f = o ? (
|
|
1084
1088
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1085
1089
|
Ve(a, l, u)
|
|
@@ -1087,7 +1091,7 @@ function ht(t, e, s) {
|
|
|
1087
1091
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1088
1092
|
(w = r.getQueryCache().get(a.queryHash)) == null ? void 0 : w.promise
|
|
1089
1093
|
);
|
|
1090
|
-
f == null || f.catch(
|
|
1094
|
+
f == null || f.catch(xt).finally(() => {
|
|
1091
1095
|
l.hasListeners() || l.updateResult();
|
|
1092
1096
|
});
|
|
1093
1097
|
}
|
|
@@ -1108,9 +1112,37 @@ function Ht(t, e) {
|
|
|
1108
1112
|
nt
|
|
1109
1113
|
);
|
|
1110
1114
|
}
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
|
|
1115
|
+
const Bt = dt(
|
|
1116
|
+
void 0
|
|
1117
|
+
), ct = () => {
|
|
1118
|
+
const t = ft(Bt);
|
|
1119
|
+
if (!t)
|
|
1120
|
+
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1121
|
+
return t;
|
|
1122
|
+
}, rs = () => {
|
|
1123
|
+
const { getApiIdentities: t } = ct();
|
|
1124
|
+
return _t({
|
|
1125
|
+
queryFn: t,
|
|
1126
|
+
queryKey: ["api-identities"]
|
|
1127
|
+
});
|
|
1128
|
+
}, lt = () => {
|
|
1129
|
+
const { getPluginSidebar: t, sidebars: e, topNavigation: s } = ct(), r = pe(), n = Object.entries(e).find(([, a]) => Me(a, (o) => {
|
|
1130
|
+
if ((o.type === "doc" ? V(o.id) : o.type === "category" && o.link ? V(o.link.id) : void 0) === r.pathname)
|
|
1131
|
+
return o;
|
|
1132
|
+
})), u = s.find((a) => a.id === (n == null ? void 0 : n[0])) ?? s.find((a) => pt(a.id, r.pathname));
|
|
1133
|
+
return Ht({
|
|
1134
|
+
queryFn: async () => {
|
|
1135
|
+
const a = await t(r.pathname);
|
|
1136
|
+
return {
|
|
1137
|
+
sidebar: [
|
|
1138
|
+
...n ? n[1] : [],
|
|
1139
|
+
...a
|
|
1140
|
+
],
|
|
1141
|
+
topNavItem: u
|
|
1142
|
+
};
|
|
1143
|
+
},
|
|
1144
|
+
queryKey: ["navigation", r.pathname]
|
|
1145
|
+
});
|
|
1114
1146
|
}, Me = (t, e) => {
|
|
1115
1147
|
for (const s of t) {
|
|
1116
1148
|
const r = Ne(s, e);
|
|
@@ -1127,84 +1159,53 @@ const $ = (...t) => {
|
|
|
1127
1159
|
]);
|
|
1128
1160
|
if (u !== void 0) return u;
|
|
1129
1161
|
}
|
|
1130
|
-
},
|
|
1162
|
+
}, is = () => {
|
|
1131
1163
|
const t = pe(), s = lt().data.sidebar;
|
|
1132
1164
|
return Me(s, (r) => {
|
|
1133
|
-
if (r.type === "doc" &&
|
|
1165
|
+
if (r.type === "doc" && V(r.id) === t.pathname)
|
|
1134
1166
|
return r;
|
|
1135
1167
|
});
|
|
1136
|
-
},
|
|
1168
|
+
}, ns = (t) => {
|
|
1137
1169
|
const e = pe();
|
|
1138
1170
|
return Ne(t, (s) => {
|
|
1139
|
-
if (s.type === "category" && s.link &&
|
|
1171
|
+
if (s.type === "category" && s.link && V(s.link.id) === e.pathname || s.type === "doc" && V(s.id) === e.pathname)
|
|
1140
1172
|
return !0;
|
|
1141
1173
|
});
|
|
1142
|
-
},
|
|
1174
|
+
}, as = () => {
|
|
1143
1175
|
const t = pe().pathname, s = lt().data.sidebar;
|
|
1144
1176
|
let r, n, u = !1;
|
|
1145
1177
|
return Me(s, (a) => {
|
|
1146
|
-
const o = a.type === "doc" ?
|
|
1178
|
+
const o = a.type === "doc" ? V(a.id) : a.type === "category" && a.link ? V(a.link.id) : void 0;
|
|
1147
1179
|
if (o) {
|
|
1148
1180
|
if (u)
|
|
1149
1181
|
return n = { label: a.label, id: o }, !0;
|
|
1150
1182
|
t === o ? u = !0 : r = { label: a.label, id: o };
|
|
1151
1183
|
}
|
|
1152
1184
|
}), { prev: r, next: n };
|
|
1153
|
-
}, Bt = dt(
|
|
1154
|
-
void 0
|
|
1155
|
-
), ct = () => {
|
|
1156
|
-
const t = ft(Bt);
|
|
1157
|
-
if (!t)
|
|
1158
|
-
throw new Error("useDevPortal must be used within a DevPortalProvider.");
|
|
1159
|
-
return t;
|
|
1160
|
-
}, as = () => {
|
|
1161
|
-
const { getApiIdentities: t } = ct();
|
|
1162
|
-
return _t({
|
|
1163
|
-
queryFn: t,
|
|
1164
|
-
queryKey: ["api-identities"]
|
|
1165
|
-
});
|
|
1166
|
-
}, lt = () => {
|
|
1167
|
-
const { getPluginSidebar: t, sidebars: e, topNavigation: s } = ct(), r = pe(), n = Object.entries(e).find(([, a]) => Me(a, (o) => {
|
|
1168
|
-
if ((o.type === "doc" ? $(o.id) : o.type === "category" && o.link ? $(o.link.id) : void 0) === r.pathname)
|
|
1169
|
-
return o;
|
|
1170
|
-
})), u = s.find((a) => a.id === (n == null ? void 0 : n[0])) ?? s.find((a) => pt(a.id, r.pathname));
|
|
1171
|
-
return Ht({
|
|
1172
|
-
queryFn: async () => {
|
|
1173
|
-
const a = await t(r.pathname);
|
|
1174
|
-
return {
|
|
1175
|
-
sidebar: [
|
|
1176
|
-
...n ? n[1] : [],
|
|
1177
|
-
...a
|
|
1178
|
-
],
|
|
1179
|
-
topNavItem: u
|
|
1180
|
-
};
|
|
1181
|
-
},
|
|
1182
|
-
queryKey: ["navigation", r.pathname]
|
|
1183
|
-
});
|
|
1184
1185
|
};
|
|
1185
1186
|
export {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1187
|
+
lt as A,
|
|
1188
|
+
Me as B,
|
|
1189
|
+
ss as C,
|
|
1190
|
+
rs as D,
|
|
1190
1191
|
_t as E,
|
|
1191
1192
|
ts as Q,
|
|
1192
1193
|
Et as R,
|
|
1193
|
-
|
|
1194
|
+
Ue as S,
|
|
1194
1195
|
Bt as Z,
|
|
1195
|
-
|
|
1196
|
-
|
|
1196
|
+
is as a,
|
|
1197
|
+
as as b,
|
|
1197
1198
|
Rt as c,
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1199
|
+
It as d,
|
|
1200
|
+
xt as e,
|
|
1201
|
+
kt as f,
|
|
1201
1202
|
Ht as g,
|
|
1202
1203
|
Se as h,
|
|
1203
1204
|
vt as i,
|
|
1204
1205
|
Xt as j,
|
|
1205
1206
|
ge as k,
|
|
1206
1207
|
mt as l,
|
|
1207
|
-
|
|
1208
|
+
Jt as m,
|
|
1208
1209
|
Ae as n,
|
|
1209
1210
|
es as o,
|
|
1210
1211
|
Yt as p,
|
|
@@ -1213,10 +1214,10 @@ export {
|
|
|
1213
1214
|
we as s,
|
|
1214
1215
|
fe as t,
|
|
1215
1216
|
ct as u,
|
|
1216
|
-
|
|
1217
|
+
Wt as v,
|
|
1217
1218
|
Qe as w,
|
|
1218
1219
|
ye as x,
|
|
1219
|
-
|
|
1220
|
-
|
|
1220
|
+
ns as y,
|
|
1221
|
+
V as z
|
|
1221
1222
|
};
|
|
1222
|
-
//# sourceMappingURL=
|
|
1223
|
+
//# sourceMappingURL=utils-DNAltzXc.js.map
|