zudoku 0.66.6 → 0.66.7
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/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/index.d.ts +3 -0
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/react-query.d.ts +1 -0
- package/dist/lib/core/react-query.js +2 -0
- package/dist/lib/core/react-query.js.map +1 -0
- package/dist/lib/oas/graphql/circular.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.js +15 -8
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.test.js +152 -0
- package/dist/lib/oas/graphql/circular.test.js.map +1 -0
- package/dist/vite/config.js +2 -0
- package/dist/vite/config.js.map +1 -1
- package/lib/{ClaudeLogo-BpqHBMS8.js → ClaudeLogo-DHxJUhN_.js} +20 -20
- package/lib/ClaudeLogo-DHxJUhN_.js.map +1 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
- package/lib/Input-Cx-GeKoF.js +22 -0
- package/lib/Input-Cx-GeKoF.js.map +1 -0
- package/lib/{MdxPage-CeFSxGb_.js → MdxPage-CD36PJ17.js} +7 -7
- package/lib/{MdxPage-CeFSxGb_.js.map → MdxPage-CD36PJ17.js.map} +1 -1
- package/lib/{Mermaid-COVtAqcZ.js → Mermaid-Koc3z8mU.js} +3 -3
- package/lib/{Mermaid-COVtAqcZ.js.map → Mermaid-Koc3z8mU.js.map} +1 -1
- package/lib/{OAuthErrorPage-XTPBOMN8.js → OAuthErrorPage-4mN5DA86.js} +23 -22
- package/lib/{OAuthErrorPage-XTPBOMN8.js.map → OAuthErrorPage-4mN5DA86.js.map} +1 -1
- package/lib/{OasProvider-BS4rdzZC.js → OasProvider-DSe-hk5Y.js} +3 -3
- package/lib/{OasProvider-BS4rdzZC.js.map → OasProvider-DSe-hk5Y.js.map} +1 -1
- package/lib/{OperationList-Dg0Nm1tg.js → OperationList-CaknPbvq.js} +32 -31
- package/lib/{OperationList-Dg0Nm1tg.js.map → OperationList-CaknPbvq.js.map} +1 -1
- package/lib/{RouteGuard-kCicqF3x.js → RouteGuard--A04ESy8.js} +3 -3
- package/lib/{RouteGuard-kCicqF3x.js.map → RouteGuard--A04ESy8.js.map} +1 -1
- package/lib/{SchemaList-DZKBH2WC.js → SchemaList-Dw3-CJPb.js} +7 -7
- package/lib/{SchemaList-DZKBH2WC.js.map → SchemaList-Dw3-CJPb.js.map} +1 -1
- package/lib/{SchemaView-DBaqV2yU.js → SchemaView-DyJkiQkD.js} +3 -3
- package/lib/{SchemaView-DBaqV2yU.js.map → SchemaView-DyJkiQkD.js.map} +1 -1
- package/lib/{SignUp-DNmOFbLD.js → SignUp-DRvN-8cq.js} +3 -3
- package/lib/{SignUp-DNmOFbLD.js.map → SignUp-DRvN-8cq.js.map} +1 -1
- package/lib/{SyntaxHighlight-C75W8uCn.js → SyntaxHighlight-klTH8c6-.js} +2 -2
- package/lib/{SyntaxHighlight-C75W8uCn.js.map → SyntaxHighlight-klTH8c6-.js.map} +1 -1
- package/lib/{Toc-ICilS65g.js → Toc-PbuF-u9x.js} +2 -2
- package/lib/{Toc-ICilS65g.js.map → Toc-PbuF-u9x.js.map} +1 -1
- package/lib/ZudokuContext-BZB1TWdT.js +387 -0
- package/lib/ZudokuContext-BZB1TWdT.js.map +1 -0
- package/lib/{circular-DleWPaPP.js → circular-DFquXeY2.js} +21 -19
- package/lib/{circular-DleWPaPP.js.map → circular-DFquXeY2.js.map} +1 -1
- package/lib/{createServer-nqMW9kro.js → createServer-BXZ0CAUn.js} +4 -4
- package/lib/{createServer-nqMW9kro.js.map → createServer-BXZ0CAUn.js.map} +1 -1
- package/lib/{errors-D2FbERKl.js → errors-rWHkzVTd.js} +2 -2
- package/lib/{errors-D2FbERKl.js.map → errors-rWHkzVTd.js.map} +1 -1
- package/lib/{firebase-Cn9CmB6h.js → firebase-BmGU1FuD.js} +17 -15
- package/lib/{firebase-Cn9CmB6h.js.map → firebase-BmGU1FuD.js.map} +1 -1
- package/lib/{hook-B2nmfmYN.js → hook-BGlHBdET.js} +2 -2
- package/lib/{hook-B2nmfmYN.js.map → hook-BGlHBdET.js.map} +1 -1
- package/lib/{index-D5NeW2z6.js → index-BDsEwofZ.js} +1709 -1707
- package/lib/index-BDsEwofZ.js.map +1 -0
- package/lib/{index-CSDW7CHl.js → index-BQB9hb6n.js} +151 -149
- package/lib/{index-CSDW7CHl.js.map → index-BQB9hb6n.js.map} +1 -1
- package/lib/{index-CC4L3gtM.js → index-DBjOT2H1.js} +3 -3
- package/lib/{index-CC4L3gtM.js.map → index-DBjOT2H1.js.map} +1 -1
- package/lib/{index-DSKBOdpT.js → index-DRBOFufT.js} +2 -2
- package/lib/{index-DSKBOdpT.js.map → index-DRBOFufT.js.map} +1 -1
- package/lib/{index.esm-B35e7P83.js → index.esm-Cx8B1YJQ.js} +2 -2
- package/lib/index.esm-Cx8B1YJQ.js.map +1 -0
- package/lib/{mutation-BOYnEDf6.js → mutation-BISOc7OM.js} +2 -2
- package/lib/{mutation-BOYnEDf6.js.map → mutation-BISOc7OM.js.map} +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/{Input-B6YcAPv-.js → useMutation-CFMGlAMW.js} +23 -40
- package/lib/useMutation-CFMGlAMW.js.map +1 -0
- package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
- package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
- package/lib/zudoku.__internal.js +928 -1457
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +4 -4
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +21 -18
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.mermaid.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +6 -5
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +23 -21
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +29 -28
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.react-query.js +440 -0
- package/lib/zudoku.react-query.js.map +1 -0
- package/package.json +5 -1
- package/src/lib/components/Pagination.tsx +4 -5
- package/src/lib/components/index.ts +4 -0
- package/src/lib/components/navigation/NavigationItem.tsx +9 -3
- package/src/lib/core/react-query.ts +1 -0
- package/src/lib/oas/graphql/circular.test.ts +186 -0
- package/src/lib/oas/graphql/circular.ts +22 -16
- package/lib/ClaudeLogo-BpqHBMS8.js.map +0 -1
- package/lib/Input-B6YcAPv-.js.map +0 -1
- package/lib/ZudokuContext-Ea7gxmGq.js +0 -1581
- package/lib/ZudokuContext-Ea7gxmGq.js.map +0 -1
- package/lib/index-D5NeW2z6.js.map +0 -1
- package/lib/index.esm-B35e7P83.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, a as r, E as t, b as i, F as o, G as n, c as d, O as h, d as u, T as l, e as A, f as P, g as c, h as g, i as m, j as E, k as p, l as v, m as w, n as b, o as C, p as I, q as R, r as f, s as k, t as O, u as T, v as W, w as x, x as G } from "./firebase-
|
|
1
|
+
import { A as a, a as r, E as t, b as i, F as o, G as n, c as d, O as h, d as u, T as l, e as A, f as P, g as c, h as g, i as m, j as E, k as p, l as v, m as w, n as b, o as C, p as I, q as R, r as f, s as k, t as O, u as T, v as W, w as x, x as G } from "./firebase-BmGU1FuD.js";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionCodeURL,
|
|
4
4
|
r as AuthCredential,
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
x as signInWithPopup,
|
|
32
32
|
G as signOut
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=index.esm-
|
|
34
|
+
//# sourceMappingURL=index.esm-Cx8B1YJQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm-Cx8B1YJQ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as r, c as u, n as h } from "./
|
|
1
|
+
import { R as r, c as u, n as h } from "./useSuspenseQuery-CSB_rVek.js";
|
|
2
2
|
var l = class extends r {
|
|
3
3
|
#n;
|
|
4
4
|
#e;
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
l as M,
|
|
220
220
|
c as g
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=mutation-
|
|
222
|
+
//# sourceMappingURL=mutation-BISOc7OM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-BOYnEDf6.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.90.12/node_modules/@tanstack/query-core/build/modern/mutation.js"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #client;\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.#client = config.client;\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const onContinue = () => {\n this.#dispatch({ type: \"continue\" });\n };\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables, mutationFnContext);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (restored) {\n onContinue();\n } else {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this,\n mutationFnContext\n );\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext\n );\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext\n );\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map"],"names":["Mutation","Removable","#client","#observers","#mutationCache","#retryer","config","getDefaultState","options","observer","x","variables","onContinue","#dispatch","mutationFnContext","createRetryer","failureCount","error","restored","isPaused","context","data","action","reducer","state","notifyManager"],"mappings":";AAIG,IAACA,IAAW,cAAcC,EAAU;AAAA,EACrCC;AAAA,EACAC;AAAA,EACAC;AAAA,EACAC;AAAA,EACA,YAAYC,GAAQ;AAClB,UAAK,GACL,KAAKJ,KAAUI,EAAO,QACtB,KAAK,aAAaA,EAAO,YACzB,KAAKF,KAAiBE,EAAO,eAC7B,KAAKH,KAAa,CAAA,GAClB,KAAK,QAAQG,EAAO,SAASC,EAAe,GAC5C,KAAK,WAAWD,EAAO,OAAO,GAC9B,KAAK,WAAU;AAAA,EACjB;AAAA,EACA,WAAWE,GAAS;AAClB,SAAK,UAAUA,GACf,KAAK,aAAa,KAAK,QAAQ,MAAM;AAAA,EACvC;AAAA,EACA,IAAI,OAAO;AACT,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EACA,YAAYC,GAAU;AACpB,IAAK,KAAKN,GAAW,SAASM,CAAQ,MACpC,KAAKN,GAAW,KAAKM,CAAQ,GAC7B,KAAK,eAAc,GACnB,KAAKL,GAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAAK;AAAA,IACR,CAAO;AAAA,EAEL;AAAA,EACA,eAAeA,GAAU;AACvB,SAAKN,KAAa,KAAKA,GAAW,OAAO,CAACO,MAAMA,MAAMD,CAAQ,GAC9D,KAAK,WAAU,GACf,KAAKL,GAAe,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,UAAU;AAAA,MACV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pB;AAAA,MACA;AAAA,IACI;AACA,SAAK,QAAQC,EAAQ,KAAK,KAAK,GAC/BE,EAAc,MAAM,MAAM;AACxB,WAAKtB,GAAW,QAAQ,CAACM,MAAa;AACpC,QAAAA,EAAS,iBAAiBa,CAAM;AAAA,MAClC,CAAC,GACD,KAAKlB,GAAe,OAAO;AAAA,QACzB,UAAU;AAAA,QACV,MAAM;AAAA,QACN,QAAAkB;AAAA,MACR,CAAO;AAAA,IACH,CAAC;AAAA,EACH;AACF;AACA,SAASf,IAAkB;AACzB,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACjB;AACA;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"mutation-BISOc7OM.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.90.12/node_modules/@tanstack/query-core/build/modern/mutation.js"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #client;\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.#client = config.client;\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const onContinue = () => {\n this.#dispatch({ type: \"continue\" });\n };\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables, mutationFnContext);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (restored) {\n onContinue();\n } else {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this,\n mutationFnContext\n );\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext\n );\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext\n );\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map"],"names":["Mutation","Removable","#client","#observers","#mutationCache","#retryer","config","getDefaultState","options","observer","x","variables","onContinue","#dispatch","mutationFnContext","createRetryer","failureCount","error","restored","isPaused","context","data","action","reducer","state","notifyManager"],"mapp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AAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,eAAe;AAAA,IACf,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,aAAa;AAAA,EACjB;AACA;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../ZudokuContext-
|
|
4
|
-
import { S as h } from "../SyntaxHighlight-
|
|
3
|
+
import "../ZudokuContext-BZB1TWdT.js";
|
|
4
|
+
import { S as h } from "../SyntaxHighlight-klTH8c6-.js";
|
|
5
5
|
import "../invariant-BJAl77rw.js";
|
|
6
6
|
import "./CodeBlock.js";
|
|
7
7
|
import "./EmbeddedCodeBlock.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { g as
|
|
3
|
-
import { S as
|
|
4
|
-
|
|
5
|
-
import { c as y } from "./cn-5-Gd1Dss.js";
|
|
6
|
-
var g = class extends d {
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { g as l } from "./mutation-BISOc7OM.js";
|
|
3
|
+
import { S as p, s as d, h as a, n as h, a as b, b as m, d as f } from "./useSuspenseQuery-CSB_rVek.js";
|
|
4
|
+
var v = class extends p {
|
|
7
5
|
#s;
|
|
8
6
|
#i = void 0;
|
|
9
7
|
#t;
|
|
@@ -16,7 +14,7 @@ var g = class extends d {
|
|
|
16
14
|
}
|
|
17
15
|
setOptions(t) {
|
|
18
16
|
const s = this.options;
|
|
19
|
-
this.options = this.#s.defaultMutationOptions(t),
|
|
17
|
+
this.options = this.#s.defaultMutationOptions(t), d(this.options, s) || this.#s.getMutationCache().notify({
|
|
20
18
|
type: "observerOptionsUpdated",
|
|
21
19
|
mutation: this.#t,
|
|
22
20
|
observer: this
|
|
@@ -38,7 +36,7 @@ var g = class extends d {
|
|
|
38
36
|
return this.#e = s, this.#t?.removeObserver(this), this.#t = this.#s.getMutationCache().build(this.#s, this.options), this.#t.addObserver(this), this.#t.execute(t);
|
|
39
37
|
}
|
|
40
38
|
#r() {
|
|
41
|
-
const t = this.#t?.state ??
|
|
39
|
+
const t = this.#t?.state ?? l();
|
|
42
40
|
this.#i = {
|
|
43
41
|
...t,
|
|
44
42
|
isPending: t.status === "pending",
|
|
@@ -50,7 +48,7 @@ var g = class extends d {
|
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
#o(t) {
|
|
53
|
-
|
|
51
|
+
h.batch(() => {
|
|
54
52
|
if (this.#e && this.hasListeners()) {
|
|
55
53
|
const s = this.#i.variables, i = this.#i.context, e = {
|
|
56
54
|
client: this.#s,
|
|
@@ -87,50 +85,35 @@ var g = class extends d {
|
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
|
-
function
|
|
91
|
-
const i =
|
|
92
|
-
() => new
|
|
88
|
+
function M(t, s) {
|
|
89
|
+
const i = b(s), [e] = o.useState(
|
|
90
|
+
() => new v(
|
|
93
91
|
i,
|
|
94
92
|
t
|
|
95
93
|
)
|
|
96
94
|
);
|
|
97
|
-
|
|
95
|
+
o.useEffect(() => {
|
|
98
96
|
e.setOptions(t);
|
|
99
97
|
}, [e, t]);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
(n) => e.subscribe(
|
|
98
|
+
const r = o.useSyncExternalStore(
|
|
99
|
+
o.useCallback(
|
|
100
|
+
(n) => e.subscribe(h.batchCalls(n)),
|
|
103
101
|
[e]
|
|
104
102
|
),
|
|
105
103
|
() => e.getCurrentResult(),
|
|
106
104
|
() => e.getCurrentResult()
|
|
107
|
-
),
|
|
108
|
-
(n,
|
|
109
|
-
e.mutate(n,
|
|
105
|
+
), u = o.useCallback(
|
|
106
|
+
(n, c) => {
|
|
107
|
+
e.mutate(n, c).catch(m);
|
|
110
108
|
},
|
|
111
109
|
[e]
|
|
112
110
|
);
|
|
113
|
-
if (
|
|
114
|
-
throw
|
|
115
|
-
return { ...
|
|
111
|
+
if (r.error && f(e.options.throwOnError, [r.error]))
|
|
112
|
+
throw r.error;
|
|
113
|
+
return { ...r, mutate: u, mutateAsync: r.mutate };
|
|
116
114
|
}
|
|
117
|
-
const x = r.forwardRef(
|
|
118
|
-
({ className: t, type: s, ...i }, e) => /* @__PURE__ */ v.jsx(
|
|
119
|
-
"input",
|
|
120
|
-
{
|
|
121
|
-
type: s,
|
|
122
|
-
className: y(
|
|
123
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
124
|
-
t
|
|
125
|
-
),
|
|
126
|
-
ref: e,
|
|
127
|
-
...i
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
);
|
|
131
|
-
x.displayName = "Input";
|
|
132
115
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
116
|
+
v as M,
|
|
117
|
+
M as u
|
|
135
118
|
};
|
|
136
|
-
//# sourceMappingURL=
|
|
119
|
+
//# sourceMappingURL=useMutation-CFMGlAMW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMutation-CFMGlAMW.js","sources":["../../../node_modules/.pnpm/@tanstack+query-core@5.90.12/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../node_modules/.pnpm/@tanstack+react-query@5.90.12_react@19.2.3/node_modules/@tanstack/react-query/build/modern/useMutation.js"],"sourcesContent":["// src/mutationObserver.ts\nimport { getDefaultState } from \"./mutation.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { hashKey, shallowEqualObjects } from \"./utils.js\";\nvar MutationObserver = class extends Subscribable {\n #client;\n #currentResult = void 0;\n #currentMutation;\n #mutateOptions;\n constructor(client, options) {\n super();\n this.#client = client;\n this.setOptions(options);\n this.bindMethods();\n this.#updateResult();\n }\n bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n this.options = this.#client.defaultMutationOptions(options);\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: \"observerOptionsUpdated\",\n mutation: this.#currentMutation,\n observer: this\n });\n }\n if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) {\n this.reset();\n } else if (this.#currentMutation?.state.status === \"pending\") {\n this.#currentMutation.setOptions(this.options);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this);\n }\n }\n onMutationUpdate(action) {\n this.#updateResult();\n this.#notify(action);\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n reset() {\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = void 0;\n this.#updateResult();\n this.#notify();\n }\n mutate(variables, options) {\n this.#mutateOptions = options;\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n this.#currentMutation.addObserver(this);\n return this.#currentMutation.execute(variables);\n }\n #updateResult() {\n const state = this.#currentMutation?.state ?? getDefaultState();\n this.#currentResult = {\n ...state,\n isPending: state.status === \"pending\",\n isSuccess: state.status === \"success\",\n isError: state.status === \"error\",\n isIdle: state.status === \"idle\",\n mutate: this.mutate,\n reset: this.reset\n };\n }\n #notify(action) {\n notifyManager.batch(() => {\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables;\n const onMutateResult = this.#currentResult.context;\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n if (action?.type === \"success\") {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context\n );\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context\n );\n } else if (action?.type === \"error\") {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context\n );\n this.#mutateOptions.onSettled?.(\n void 0,\n action.error,\n variables,\n onMutateResult,\n context\n );\n }\n }\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n });\n }\n};\nexport {\n MutationObserver\n};\n//# sourceMappingURL=mutationObserver.js.map","\"use client\";\n\n// src/useMutation.ts\nimport * as React from \"react\";\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError\n} from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nfunction useMutation(options, queryClient) {\n const client = useQueryClient(queryClient);\n const [observer] = React.useState(\n () => new MutationObserver(\n client,\n options\n )\n );\n React.useEffect(() => {\n observer.setOptions(options);\n }, [observer, options]);\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n const mutate = React.useCallback(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop);\n },\n [observer]\n );\n if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) {\n throw result.error;\n }\n return { ...result, mutate, mutateAsync: result.mutate };\n}\nexport {\n useMutation\n};\n//# sourceMappingURL=useMutation.js.map"],"names":["MutationObserver","Subscribable","#client","#currentResult","#currentMutation","#mutateOptions","client","options","#updateResult","prevOptions","shallowEqualObjects","hashKey","action","#notify","variables","state","getDefaultState","notifyManager","onMutateResult","context","listener","useMutation","queryClient","useQueryClient","observer","React","result","onStoreChange","mutate","mutateOptions","noop","shouldThrowError"],"mappings":";;;AAKG,IAACA,IAAmB,cAAcC,EAAa;AAAA,EAChDC;AAAA,EACAC,KAAiB;AAAA,EACjBC;AAAA,EACAC;AAAA,EACA,YAAYC,GAAQC,GAAS;AAC3B,UAAK,GACL,KAAKL,KAAUI,GACf,KAAK,WAAWC,CAAO,GACvB,KAAK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