zudoku 0.66.5 → 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.
Files changed (153) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/config/validators/InputNavigationSchema.d.ts +2 -0
  3. package/dist/config/validators/InputNavigationSchema.js +1 -0
  4. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  5. package/dist/config/validators/NavigationSchema.js +6 -1
  6. package/dist/config/validators/NavigationSchema.js.map +1 -1
  7. package/dist/flat-config.d.ts +1 -0
  8. package/dist/index.d.ts +2 -1
  9. package/dist/index.js +2 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/authentication/providers/auth0.js +11 -7
  12. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  13. package/dist/lib/authentication/providers/clerk.js +0 -22
  14. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  15. package/dist/lib/authentication/providers/supabase.js +6 -15
  16. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  17. package/dist/lib/components/Pagination.js +2 -2
  18. package/dist/lib/components/Pagination.js.map +1 -1
  19. package/dist/lib/components/index.d.ts +3 -0
  20. package/dist/lib/components/index.js +4 -0
  21. package/dist/lib/components/index.js.map +1 -1
  22. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  23. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  24. package/dist/lib/core/react-query.d.ts +1 -0
  25. package/dist/lib/core/react-query.js +2 -0
  26. package/dist/lib/core/react-query.js.map +1 -0
  27. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  28. package/dist/lib/oas/graphql/circular.js +32 -10
  29. package/dist/lib/oas/graphql/circular.js.map +1 -1
  30. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  31. package/dist/lib/oas/graphql/circular.test.js +152 -0
  32. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  33. package/dist/lib/plugins/openapi/OperationList.js +5 -1
  34. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  35. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  36. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  37. package/dist/vite/api/SchemaManager.d.ts +1 -0
  38. package/dist/vite/api/SchemaManager.js +9 -3
  39. package/dist/vite/api/SchemaManager.js.map +1 -1
  40. package/dist/vite/config.js +2 -0
  41. package/dist/vite/config.js.map +1 -1
  42. package/dist/vite/prerender/utils.js +9 -3
  43. package/dist/vite/prerender/utils.js.map +1 -1
  44. package/lib/{ClaudeLogo-ByzA8TYR.js → ClaudeLogo-DHxJUhN_.js} +21 -21
  45. package/lib/ClaudeLogo-DHxJUhN_.js.map +1 -0
  46. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  47. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  48. package/lib/Input-Cx-GeKoF.js +22 -0
  49. package/lib/Input-Cx-GeKoF.js.map +1 -0
  50. package/lib/{MdxPage-Bh5YNRV9.js → MdxPage-CD36PJ17.js} +8 -8
  51. package/lib/{MdxPage-Bh5YNRV9.js.map → MdxPage-CD36PJ17.js.map} +1 -1
  52. package/lib/{Mermaid-CGRoylZf.js → Mermaid-Koc3z8mU.js} +3 -3
  53. package/lib/{Mermaid-CGRoylZf.js.map → Mermaid-Koc3z8mU.js.map} +1 -1
  54. package/lib/{OAuthErrorPage-CsTKz5hX.js → OAuthErrorPage-4mN5DA86.js} +23 -22
  55. package/lib/{OAuthErrorPage-CsTKz5hX.js.map → OAuthErrorPage-4mN5DA86.js.map} +1 -1
  56. package/lib/{OasProvider-BBAbJiYa.js → OasProvider-DSe-hk5Y.js} +4 -4
  57. package/lib/{OasProvider-BBAbJiYa.js.map → OasProvider-DSe-hk5Y.js.map} +1 -1
  58. package/lib/{OperationList-DUxrNisd.js → OperationList-CaknPbvq.js} +148 -144
  59. package/lib/{OperationList-DUxrNisd.js.map → OperationList-CaknPbvq.js.map} +1 -1
  60. package/lib/{RouteGuard-CIN9Ou-r.js → RouteGuard--A04ESy8.js} +4 -4
  61. package/lib/{RouteGuard-CIN9Ou-r.js.map → RouteGuard--A04ESy8.js.map} +1 -1
  62. package/lib/{SchemaList-BbnkfjIe.js → SchemaList-Dw3-CJPb.js} +7 -7
  63. package/lib/{SchemaList-BbnkfjIe.js.map → SchemaList-Dw3-CJPb.js.map} +1 -1
  64. package/lib/{SchemaView-BrUf6_nP.js → SchemaView-DyJkiQkD.js} +94 -91
  65. package/lib/SchemaView-DyJkiQkD.js.map +1 -0
  66. package/lib/{SignUp-AlaaduyY.js → SignUp-DRvN-8cq.js} +4 -4
  67. package/lib/{SignUp-AlaaduyY.js.map → SignUp-DRvN-8cq.js.map} +1 -1
  68. package/lib/{SyntaxHighlight-DveJcTOQ.js → SyntaxHighlight-klTH8c6-.js} +372 -363
  69. package/lib/SyntaxHighlight-klTH8c6-.js.map +1 -0
  70. package/lib/{Toc-B4ShtN-I.js → Toc-PbuF-u9x.js} +2 -2
  71. package/lib/{Toc-B4ShtN-I.js.map → Toc-PbuF-u9x.js.map} +1 -1
  72. package/lib/ZudokuContext-BZB1TWdT.js +387 -0
  73. package/lib/ZudokuContext-BZB1TWdT.js.map +1 -0
  74. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  75. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  76. package/lib/{circular-CuSWVYOZ.js → circular-DFquXeY2.js} +771 -749
  77. package/lib/{circular-CuSWVYOZ.js.map → circular-DFquXeY2.js.map} +1 -1
  78. package/lib/{createServer-B1_RUTJP.js → createServer-BXZ0CAUn.js} +4 -4
  79. package/lib/{createServer-B1_RUTJP.js.map → createServer-BXZ0CAUn.js.map} +1 -1
  80. package/lib/{errors-iDfQAr_v.js → errors-rWHkzVTd.js} +2 -2
  81. package/lib/{errors-iDfQAr_v.js.map → errors-rWHkzVTd.js.map} +1 -1
  82. package/lib/{firebase-I54w2ZsH.js → firebase-BmGU1FuD.js} +18 -16
  83. package/lib/{firebase-I54w2ZsH.js.map → firebase-BmGU1FuD.js.map} +1 -1
  84. package/lib/{hook-BxWvqzB0.js → hook-BGlHBdET.js} +3 -3
  85. package/lib/{hook-BxWvqzB0.js.map → hook-BGlHBdET.js.map} +1 -1
  86. package/lib/{index-A5Cre871.js → index-BDsEwofZ.js} +1709 -1707
  87. package/lib/index-BDsEwofZ.js.map +1 -0
  88. package/lib/{index-B4puReRo.js → index-BQB9hb6n.js} +152 -150
  89. package/lib/{index-B4puReRo.js.map → index-BQB9hb6n.js.map} +1 -1
  90. package/lib/{index-CjTisMeX.js → index-DBjOT2H1.js} +4 -4
  91. package/lib/{index-CjTisMeX.js.map → index-DBjOT2H1.js.map} +1 -1
  92. package/lib/{index-Dbrv6d94.js → index-DRBOFufT.js} +2 -2
  93. package/lib/{index-Dbrv6d94.js.map → index-DRBOFufT.js.map} +1 -1
  94. package/lib/{index.esm-BxIXRKtj.js → index.esm-Cx8B1YJQ.js} +2 -2
  95. package/lib/index.esm-Cx8B1YJQ.js.map +1 -0
  96. package/lib/{mutation-Cq0wKBqW.js → mutation-BISOc7OM.js} +2 -2
  97. package/lib/{mutation-Cq0wKBqW.js.map → mutation-BISOc7OM.js.map} +1 -1
  98. package/lib/ui/SyntaxHighlight.js +2 -2
  99. package/lib/{Input-nskrp_mj.js → useMutation-CFMGlAMW.js} +23 -40
  100. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  101. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  102. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  103. package/lib/zudoku.__internal.js +929 -1458
  104. package/lib/zudoku.__internal.js.map +1 -1
  105. package/lib/zudoku.auth-auth0.js +16 -16
  106. package/lib/zudoku.auth-auth0.js.map +1 -1
  107. package/lib/zudoku.auth-azureb2c.js +4 -4
  108. package/lib/zudoku.auth-clerk.js +52 -75
  109. package/lib/zudoku.auth-clerk.js.map +1 -1
  110. package/lib/zudoku.auth-firebase.js +4 -4
  111. package/lib/zudoku.auth-openid.js +4 -4
  112. package/lib/zudoku.auth-supabase.js +31 -40
  113. package/lib/zudoku.auth-supabase.js.map +1 -1
  114. package/lib/zudoku.components.js +22 -19
  115. package/lib/zudoku.components.js.map +1 -1
  116. package/lib/zudoku.hooks.js +3 -3
  117. package/lib/zudoku.mermaid.js +3 -3
  118. package/lib/zudoku.plugin-api-catalog.js +7 -6
  119. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  120. package/lib/zudoku.plugin-api-keys.js +23 -21
  121. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  122. package/lib/zudoku.plugin-custom-pages.js +1 -1
  123. package/lib/zudoku.plugin-markdown.js +1 -1
  124. package/lib/zudoku.plugin-openapi.js +3 -3
  125. package/lib/zudoku.plugin-redirect.js +1 -1
  126. package/lib/zudoku.plugin-search-pagefind.js +30 -29
  127. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  128. package/lib/zudoku.react-query.js +440 -0
  129. package/lib/zudoku.react-query.js.map +1 -0
  130. package/lib/zudoku.router.js +1130 -1404
  131. package/lib/zudoku.router.js.map +1 -1
  132. package/package.json +14 -10
  133. package/src/lib/authentication/providers/auth0.tsx +15 -9
  134. package/src/lib/authentication/providers/clerk.tsx +0 -26
  135. package/src/lib/authentication/providers/supabase.tsx +6 -15
  136. package/src/lib/components/Pagination.tsx +4 -5
  137. package/src/lib/components/index.ts +4 -0
  138. package/src/lib/components/navigation/NavigationItem.tsx +9 -3
  139. package/src/lib/core/react-query.ts +1 -0
  140. package/src/lib/oas/graphql/circular.test.ts +186 -0
  141. package/src/lib/oas/graphql/circular.ts +49 -10
  142. package/src/lib/plugins/openapi/OperationList.tsx +6 -1
  143. package/src/lib/plugins/openapi/schema/utils.ts +15 -4
  144. package/lib/ClaudeLogo-ByzA8TYR.js.map +0 -1
  145. package/lib/Input-nskrp_mj.js.map +0 -1
  146. package/lib/SchemaView-BrUf6_nP.js.map +0 -1
  147. package/lib/SyntaxHighlight-DveJcTOQ.js.map +0 -1
  148. package/lib/ZudokuContext-CDJYKqMY.js +0 -1581
  149. package/lib/ZudokuContext-CDJYKqMY.js.map +0 -1
  150. package/lib/chunk-PVWAREVJ-ClM0m2aJ.js +0 -7965
  151. package/lib/chunk-PVWAREVJ-ClM0m2aJ.js.map +0 -1
  152. package/lib/index-A5Cre871.js.map +0 -1
  153. package/lib/index.esm-BxIXRKtj.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.66.5",
3
+ "version": "0.66.7",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -119,6 +119,10 @@
119
119
  "import": "./lib/zudoku.router.js",
120
120
  "types": "./dist/lib/core/router.d.ts"
121
121
  },
122
+ "./react-query": {
123
+ "import": "./lib/zudoku.react-query.js",
124
+ "types": "./dist/lib/core/react-query.d.ts"
125
+ },
122
126
  "./processors/*": {
123
127
  "import": "./lib/processors/*.js",
124
128
  "types": "./dist/lib/plugins/openapi/processors/*.d.ts"
@@ -180,11 +184,11 @@
180
184
  "@radix-ui/react-visually-hidden": "1.2.4",
181
185
  "@scalar/openapi-parser": "0.23.2",
182
186
  "@sentry/node": "10.27.0",
183
- "@shikijs/engine-javascript": "3.19.0",
184
- "@shikijs/langs": "3.19.0",
185
- "@shikijs/rehype": "3.19.0",
186
- "@shikijs/themes": "3.19.0",
187
- "@shikijs/transformers": "3.19.0",
187
+ "@shikijs/engine-javascript": "3.20.0",
188
+ "@shikijs/langs": "3.20.0",
189
+ "@shikijs/rehype": "3.20.0",
190
+ "@shikijs/themes": "3.20.0",
191
+ "@shikijs/transformers": "3.20.0",
188
192
  "@sindresorhus/slugify": "3.0.0",
189
193
  "@stefanprobst/rehype-extract-toc": "3.0.0",
190
194
  "@tailwindcss/typography": "0.5.19",
@@ -233,7 +237,7 @@
233
237
  "react-hook-form": "7.66.0",
234
238
  "react-is": "19.2.3",
235
239
  "react-markdown": "10.1.0",
236
- "react-router": "7.8.2",
240
+ "react-router": "7.12.0",
237
241
  "rehype-mdx-import-media": "1.2.0",
238
242
  "rehype-raw": "7.0.0",
239
243
  "rehype-slug": "6.0.0",
@@ -245,11 +249,11 @@
245
249
  "remark-mdx-frontmatter": "5.2.0",
246
250
  "rollup": "4.52.5",
247
251
  "semver": "7.7.2",
248
- "shiki": "3.19.0",
252
+ "shiki": "3.20.0",
249
253
  "sitemap": "9.0.0",
250
254
  "strip-ansi": "7.1.2",
251
255
  "tailwind-merge": "3.4.0",
252
- "tailwindcss": "4.1.17",
256
+ "tailwindcss": "4.1.18",
253
257
  "tw-animate-css": "1.4.0",
254
258
  "unified": "^11.0.5",
255
259
  "unist-util-visit": "5.0.0",
@@ -280,7 +284,7 @@
280
284
  "@types/semver": "7.7.0",
281
285
  "@types/unist": "^3.0.3",
282
286
  "@types/yargs": "17.0.35",
283
- "@vitest/coverage-v8": "3.2.4",
287
+ "@vitest/coverage-v8": "4.0.16",
284
288
  "esbuild": "0.27.0",
285
289
  "happy-dom": "20.0.10",
286
290
  "mdast-util-mdx": "3.0.0",
@@ -1,4 +1,5 @@
1
1
  import type { Auth0AuthenticationConfig } from "../../../config/config.js";
2
+ import { joinUrl } from "../../util/joinUrl.js";
2
3
  import type {
3
4
  AuthActionContext,
4
5
  AuthenticationPlugin,
@@ -43,7 +44,10 @@ class Auth0AuthenticationProvider
43
44
 
44
45
  signOut = async (_: AuthActionContext): Promise<void> => {
45
46
  const as = await this.getAuthServer();
46
- const idToken = await this.getAccessToken();
47
+
48
+ // biome-ignore lint/suspicious/noExplicitAny: We don't have a good way for typing provider-data yet.
49
+ const providerData = useAuthState.getState().providerData as any;
50
+ const idToken = providerData?.idToken;
47
51
 
48
52
  useAuthState.setState({
49
53
  isAuthenticated: false,
@@ -53,15 +57,18 @@ class Auth0AuthenticationProvider
53
57
  });
54
58
 
55
59
  const redirectUrl = new URL(window.location.origin);
56
- redirectUrl.pathname = this.redirectToAfterSignOut;
60
+ redirectUrl.pathname = joinUrl(
61
+ import.meta.env.BASE_URL,
62
+ this.redirectToAfterSignOut,
63
+ );
57
64
 
58
65
  // SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0
59
66
  // For Auth0 tenants created on or after 14 November 2023, RP-Initiated
60
67
  // Logout End Session Endpoint Discovery is enabled by default.
61
68
  // Otherwise we fallback to the old non-compliant logout
62
69
 
63
- // The endSessionEndpoint is set, the IdP supports some form of logout,
64
- // so we use the IdP logout. Otherwise, just redirect the user to home
70
+ // The end_session_endpoint is set, the IdP supports some form of logout,
71
+ // so we use auth0 logout. Otherwise, just redirect the user to home
65
72
  if (as.end_session_endpoint) {
66
73
  const logoutUrl = new URL(as.end_session_endpoint);
67
74
  if (idToken) {
@@ -72,12 +79,11 @@ class Auth0AuthenticationProvider
72
79
  redirectUrl.toString(),
73
80
  );
74
81
 
75
- // window.location.href = logoutUrl.toString();
82
+ window.location.href = logoutUrl.toString();
76
83
  } else {
77
- const _logoutUrl = new URL(
78
- `${this.issuer.replace(/\/$/, "")}/oidc/logout`,
79
- );
80
- // window.location.href = logoutUrl.toString();
84
+ // const logoutUrl = new URL(`${this.issuer.replace(/\/$/, "")}/v2/logout`);
85
+ // logoutUrl.searchParams.set("returnTo", redirectUrl.toString());
86
+ // don't support the deprecated logout today
81
87
  }
82
88
  };
83
89
  }
@@ -29,32 +29,6 @@ const clerkAuth: AuthenticationProviderInitializer<
29
29
 
30
30
  await clerkApi.load();
31
31
 
32
- if (clerkApi.user) {
33
- const verifiedEmail = clerkApi.user.emailAddresses.find(
34
- (email) => email.verification.status === "verified",
35
- );
36
- useAuthState.getState().setLoggedIn({
37
- profile: {
38
- sub: clerkApi.user.id,
39
- name: clerkApi.user.fullName ?? undefined,
40
- email:
41
- verifiedEmail?.emailAddress ??
42
- clerkApi.user.emailAddresses[0]?.emailAddress,
43
- emailVerified: verifiedEmail !== undefined,
44
- pictureUrl: clerkApi.user.imageUrl,
45
- },
46
- providerData: {
47
- user: {
48
- publicMetadata: clerkApi.user.publicMetadata,
49
- id: clerkApi.user.id,
50
- emailAddresses: clerkApi.user.emailAddresses,
51
- imageUrl: clerkApi.user.imageUrl,
52
- fullName: clerkApi.user.fullName,
53
- },
54
- },
55
- });
56
- }
57
-
58
32
  return clerkApi;
59
33
  })();
60
34
 
@@ -129,21 +129,12 @@ class SupabaseAuthenticationProvider
129
129
  };
130
130
 
131
131
  signOut = async () => {
132
- await new Promise<void>((resolve) => {
133
- const { data } = this.client.auth.onAuthStateChange(async (event) => {
134
- if (event !== "SIGNED_OUT") return;
135
- data.subscription.unsubscribe();
136
- resolve();
137
- });
138
- void this.client.auth.signOut();
139
- });
140
-
141
- useAuthState.setState({
142
- isAuthenticated: false,
143
- isPending: false,
144
- profile: undefined,
145
- providerData: undefined,
146
- });
132
+ const { error } = await this.client.auth.signOut({ scope: "local" });
133
+ if (error) {
134
+ // biome-ignore lint/suspicious: Logging is better than not doing anything
135
+ console.error("Error signing out", error);
136
+ }
137
+ useAuthState.getState().setLoggedOut();
147
138
  };
148
139
 
149
140
  onPageLoad = async () => {
@@ -13,19 +13,18 @@ export const Pagination = ({
13
13
  className?: string;
14
14
  }) => {
15
15
  const linkClass =
16
- "group transition-all p-5 space-x-1 rtl:space-x-reverse transition-all hover:text-foreground";
17
-
16
+ "group min-w-0 transition-all p-5 space-x-1 rtl:space-x-reverse hover:text-foreground";
18
17
  return (
19
18
  <div
20
19
  className={cn(
21
- "flex -mx-4 text-muted-foreground font-semibold",
20
+ "flex flex-wrap gap-2 -mx-4 text-muted-foreground font-semibold",
22
21
  prev ? "justify-between" : "justify-end",
23
22
  className,
24
23
  )}
25
24
  data-pagefind-ignore="all"
26
25
  >
27
26
  {prev && (
28
- <Button variant="ghost" asChild>
27
+ <Button variant="ghost" className="min-w-0 max-w-full" asChild>
29
28
  <Link to={prev.to} relative="path" className={linkClass}>
30
29
  <ArrowLeftIcon size={14} strokeWidth={2.5} />
31
30
  <span className="text-lg truncate">{prev.label}</span>
@@ -33,7 +32,7 @@ export const Pagination = ({
33
32
  </Button>
34
33
  )}
35
34
  {next && (
36
- <Button variant="ghost" asChild>
35
+ <Button variant="ghost" className="ms-auto min-w-0 max-w-full" asChild>
37
36
  <Link to={next.to} relative="path" className={linkClass}>
38
37
  <span className="text-lg truncate">{next.label}</span>
39
38
  <ArrowRightIcon size={14} strokeWidth={2.5} />
@@ -5,12 +5,14 @@ import { Link as LinkImport } from "react-router";
5
5
  import { useAuth as useAuthImport } from "../authentication/hook.js";
6
6
  import { Button as ButtonImport } from "../ui/Button.js";
7
7
  import { Callout as CalloutImport } from "../ui/Callout.js";
8
+ import { ZudokuError as ZudokuErrorImport } from "../util/invariant.js";
8
9
  import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
9
10
  import {
10
11
  CACHE_KEYS as CACHE_KEYS_IMPORT,
11
12
  useCache as useCacheImport,
12
13
  } from "./cache.js";
13
14
  import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
15
+ import { Heading as HeadingImport } from "./Heading.js";
14
16
  import { Markdown as MarkdownImport } from "./Markdown.js";
15
17
  import { Slot as SlotImport } from "./Slot.js";
16
18
  import { Spinner as SpinnerImport } from "./Spinner.js";
@@ -18,6 +20,7 @@ import { Typography as TypographyImport } from "./Typography.js";
18
20
  import { Zudoku as ZudokuImport } from "./Zudoku.js";
19
21
 
20
22
  export const Head = /*@__PURE__*/ Helmet;
23
+ export const Heading = /*@__PURE__*/ HeadingImport;
21
24
  export const Callout = /*@__PURE__*/ CalloutImport;
22
25
  export const Markdown = /*@__PURE__*/ MarkdownImport;
23
26
  export const Spinner = /*@__PURE__*/ SpinnerImport;
@@ -27,6 +30,7 @@ export const Link = /*@__PURE__*/ LinkImport;
27
30
  export const Zudoku = /*@__PURE__*/ ZudokuImport;
28
31
  export const Typography = /*@__PURE__*/ TypographyImport;
29
32
  export const Slot = /*@__PURE__*/ SlotImport;
33
+ export const ZudokuError = /*@__PURE__*/ ZudokuErrorImport;
30
34
 
31
35
  /** @deprecated Import from `zudoku/hooks` instead */
32
36
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
@@ -86,7 +86,9 @@ export const NavigationItem = ({
86
86
  onClick={onRequestClose}
87
87
  end
88
88
  >
89
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
89
+ {item.icon && (
90
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
91
+ )}
90
92
  {item.badge ? (
91
93
  <>
92
94
  {item.label && (
@@ -117,7 +119,9 @@ export const NavigationItem = ({
117
119
  })}
118
120
  onClick={onRequestClose}
119
121
  >
120
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
122
+ {item.icon && (
123
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
124
+ )}
121
125
  {item.badge ? (
122
126
  <>
123
127
  {item.label && <TruncatedLabel label={item.label} />}
@@ -135,7 +139,9 @@ export const NavigationItem = ({
135
139
  rel="noopener noreferrer"
136
140
  onClick={onRequestClose}
137
141
  >
138
- {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
142
+ {item.icon && (
143
+ <item.icon size={16} className="align-[-0.125em] shrink-0" />
144
+ )}
139
145
  <span className="whitespace-normal">{item.label}</span>
140
146
  {/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
141
147
  <span className="whitespace-nowrap">
@@ -0,0 +1 @@
1
+ export * from "@tanstack/react-query";
@@ -0,0 +1,186 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ CIRCULAR_REF,
4
+ handleCircularRefs,
5
+ SCHEMA_REF_PREFIX,
6
+ } from "./circular.js";
7
+
8
+ describe("handleCircularRefs", () => {
9
+ it("should return primitives unchanged", () => {
10
+ expect(handleCircularRefs(null)).toBe(null);
11
+ expect(handleCircularRefs(undefined)).toBe(undefined);
12
+ expect(handleCircularRefs(42)).toBe(42);
13
+ expect(handleCircularRefs("hello")).toBe("hello");
14
+ expect(handleCircularRefs(true)).toBe(true);
15
+ });
16
+
17
+ it("should handle simple objects without refs", () => {
18
+ const obj = { type: "string", description: "A string" };
19
+ const result = handleCircularRefs(obj);
20
+ expect(result).toEqual(obj);
21
+ });
22
+
23
+ it("should handle arrays", () => {
24
+ const arr = [{ type: "string" }, { type: "number" }];
25
+ const result = handleCircularRefs(arr);
26
+ expect(result).toEqual(arr);
27
+ });
28
+
29
+ it("should detect true circular references via object identity", () => {
30
+ const obj: Record<string, unknown> = { type: "object" };
31
+ obj.self = obj;
32
+
33
+ const result = handleCircularRefs(obj);
34
+ expect(result.type).toBe("object");
35
+ expect(result.self).toContain(CIRCULAR_REF);
36
+ });
37
+
38
+ it("should detect circular refs via __$ref path", () => {
39
+ const inner = { __$ref: "#/components/schemas/Node", type: "object" };
40
+ const obj = {
41
+ __$ref: "#/components/schemas/Node",
42
+ type: "object",
43
+ properties: {
44
+ child: inner,
45
+ },
46
+ };
47
+ (inner as Record<string, unknown>).properties = { parent: obj };
48
+
49
+ const result = handleCircularRefs(obj);
50
+ expect(result.properties.child).toBe(
51
+ `${SCHEMA_REF_PREFIX}#/components/schemas/Node`,
52
+ );
53
+ });
54
+
55
+ // Regression test for #1869
56
+ it("should NOT mark sibling refs to the same schema as circular", () => {
57
+ const timestampSchema1 = {
58
+ __$ref: "#/components/schemas/timestamp",
59
+ type: "string",
60
+ format: "date-time",
61
+ };
62
+ const timestampSchema2 = {
63
+ __$ref: "#/components/schemas/timestamp",
64
+ type: "string",
65
+ format: "date-time",
66
+ };
67
+
68
+ const obj = {
69
+ type: "object",
70
+ properties: {
71
+ created_at: timestampSchema1,
72
+ updated_at: timestampSchema2,
73
+ },
74
+ };
75
+
76
+ const result = handleCircularRefs(obj);
77
+
78
+ expect(result.properties.created_at).toEqual({
79
+ __$ref: "#/components/schemas/timestamp",
80
+ type: "string",
81
+ format: "date-time",
82
+ });
83
+ expect(result.properties.updated_at).toEqual({
84
+ __$ref: "#/components/schemas/timestamp",
85
+ type: "string",
86
+ format: "date-time",
87
+ });
88
+ });
89
+
90
+ it("should allow same ref path in different branches of the tree", () => {
91
+ const obj = {
92
+ type: "object",
93
+ properties: {
94
+ user: {
95
+ type: "object",
96
+ properties: {
97
+ id: { __$ref: "#/components/schemas/identifier", type: "string" },
98
+ name: { type: "string" },
99
+ },
100
+ },
101
+ post: {
102
+ type: "object",
103
+ properties: {
104
+ id: { __$ref: "#/components/schemas/identifier", type: "string" },
105
+ title: { type: "string" },
106
+ },
107
+ },
108
+ },
109
+ };
110
+
111
+ const result = handleCircularRefs(obj);
112
+
113
+ expect(result.properties.user.properties.id.type).toBe("string");
114
+ expect(result.properties.post.properties.id.type).toBe("string");
115
+ expect(result.properties.user.properties.id).not.toBe(
116
+ expect.stringContaining(SCHEMA_REF_PREFIX),
117
+ );
118
+ expect(result.properties.post.properties.id).not.toBe(
119
+ expect.stringContaining(SCHEMA_REF_PREFIX),
120
+ );
121
+ });
122
+
123
+ it("should handle shared object instances (same object, multiple references)", () => {
124
+ const sharedSchema = { type: "string", description: "Shared" };
125
+ const obj = {
126
+ type: "object",
127
+ properties: { field1: sharedSchema, field2: sharedSchema },
128
+ };
129
+
130
+ const result = handleCircularRefs(obj);
131
+
132
+ expect(result.properties.field1).toEqual({
133
+ type: "string",
134
+ description: "Shared",
135
+ });
136
+ expect(result.properties.field2).toEqual({
137
+ type: "string",
138
+ description: "Shared",
139
+ });
140
+ });
141
+
142
+ it("should handle nested arrays with refs", () => {
143
+ const obj = {
144
+ type: "object",
145
+ allOf: [
146
+ { __$ref: "#/components/schemas/Base", type: "object" },
147
+ { type: "object", properties: { extra: { type: "string" } } },
148
+ ],
149
+ };
150
+
151
+ const result = handleCircularRefs(obj);
152
+
153
+ expect(result.allOf[0]).toEqual({
154
+ __$ref: "#/components/schemas/Base",
155
+ type: "object",
156
+ });
157
+ });
158
+
159
+ it("should deduplicate shared object instances with __$ref", () => {
160
+ const shared = { __$ref: "#/components/schemas/Foo", type: "string" };
161
+ const obj = { a: shared, b: shared };
162
+ const result = handleCircularRefs(obj);
163
+
164
+ expect(result.a).toEqual({
165
+ __$ref: "#/components/schemas/Foo",
166
+ type: "string",
167
+ });
168
+ expect(result.b).toBe(`${SCHEMA_REF_PREFIX}#/components/schemas/Foo`);
169
+ });
170
+
171
+ it("should mark circular ref with property name from path", () => {
172
+ const parent: Record<string, unknown> = {
173
+ type: "object",
174
+ properties: {} as Record<string, unknown>,
175
+ };
176
+ const child: Record<string, unknown> = {
177
+ type: "object",
178
+ properties: { back: parent },
179
+ };
180
+ (parent.properties as Record<string, unknown>).child = child;
181
+
182
+ const result = handleCircularRefs(parent);
183
+
184
+ expect(result.properties.child.properties.back).toContain(CIRCULAR_REF);
185
+ });
186
+ });
@@ -3,6 +3,7 @@ import { GraphQLJSON } from "graphql-type-json";
3
3
  import type { RecordAny } from "../../util/traverse.js";
4
4
 
5
5
  export const CIRCULAR_REF = "$[Circular Reference]";
6
+ export const SCHEMA_REF_PREFIX = "$ref:";
6
7
 
7
8
  const OPENAPI_PROPS = new Set([
8
9
  "properties",
@@ -13,19 +14,34 @@ const OPENAPI_PROPS = new Set([
13
14
  "oneOf",
14
15
  ]);
15
16
 
16
- const handleCircularRefs = (
17
+ export const handleCircularRefs = (
17
18
  // biome-ignore lint/suspicious/noExplicitAny: Allow any type
18
19
  obj: any,
19
20
  visited = new WeakSet(),
20
21
  refs = new WeakMap(),
21
22
  path: string[] = [],
23
+ seenRefPaths = new Set<string>(),
22
24
  // biome-ignore lint/suspicious/noExplicitAny: Allow any type
23
25
  ): any => {
24
26
  if (obj === null || typeof obj !== "object") return obj;
25
27
 
28
+ const refPath = obj.__$ref;
29
+
30
+ // Check if this object has a __$ref marker (set during schema code generation)
31
+ // If we've already fully processed this ref path, return a reference marker
32
+ // instead of the full data to avoid JSON.stringify serializing duplicates
33
+ if (typeof refPath === "string" && seenRefPaths.has(refPath)) {
34
+ return SCHEMA_REF_PREFIX + refPath;
35
+ }
36
+
26
37
  if (visited.has(obj)) {
27
38
  const cached = refs.get(obj);
28
- if (cached) return cached;
39
+ if (cached) {
40
+ return typeof refPath === "string"
41
+ ? // If already processed, return ref marker to avoid duplicate serialization
42
+ SCHEMA_REF_PREFIX + refPath
43
+ : cached;
44
+ }
29
45
  const circularProp = path.find((p) => !OPENAPI_PROPS.has(p)) || path[0];
30
46
 
31
47
  return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
@@ -33,19 +49,42 @@ const handleCircularRefs = (
33
49
 
34
50
  visited.add(obj);
35
51
 
52
+ // Add refPath BEFORE recursing to detect cycles within this branch
53
+ // This will be removed after processing to allow siblings with the same ref
54
+ if (typeof refPath === "string") {
55
+ seenRefPaths.add(refPath);
56
+ }
57
+
58
+ let result: RecordAny | RecordAny[];
36
59
  if (Array.isArray(obj)) {
37
- const result = obj.map((item, index) =>
38
- handleCircularRefs(item, visited, refs, [...path, index.toString()]),
60
+ result = obj.map((item, index) =>
61
+ handleCircularRefs(
62
+ item,
63
+ visited,
64
+ refs,
65
+ [...path, index.toString()],
66
+ seenRefPaths,
67
+ ),
39
68
  );
40
- refs.set(obj, result);
41
- return result;
69
+ } else {
70
+ result = {};
71
+ for (const [key, value] of Object.entries(obj)) {
72
+ result[key] = handleCircularRefs(
73
+ value,
74
+ visited,
75
+ refs,
76
+ [...path, key],
77
+ seenRefPaths,
78
+ );
79
+ }
42
80
  }
81
+ refs.set(obj, result);
43
82
 
44
- const result: RecordAny = {};
45
- for (const [key, value] of Object.entries(obj)) {
46
- result[key] = handleCircularRefs(value, visited, refs, [...path, key]);
83
+ // Remove refPath after processing so sibling refs aren't incorrectly marked
84
+ if (typeof refPath === "string") {
85
+ seenRefPaths.delete(refPath);
47
86
  }
48
- refs.set(obj, result);
87
+
49
88
  return result;
50
89
  };
51
90
 
@@ -151,6 +151,11 @@ const OperationsForTagQuery = graphql(/* GraphQL */ `
151
151
 
152
152
  const LAZY_OPERATION_LIST_THRESHOLD = 30;
153
153
 
154
+ const getFileExtension = (filename: string): string => {
155
+ const lastDotIndex = filename.lastIndexOf(".");
156
+ return lastDotIndex !== -1 ? filename.slice(lastDotIndex) : "";
157
+ };
158
+
154
159
  export const OperationList = ({
155
160
  tag,
156
161
  untagged,
@@ -251,7 +256,7 @@ export const OperationList = ({
251
256
  typeof input === "string"
252
257
  ? type === "url"
253
258
  ? input
254
- : joinUrl(path, version, input.split("/").pop())
259
+ : joinUrl(path, version, `schema${getFileExtension(input)}`)
255
260
  : undefined;
256
261
 
257
262
  return (
@@ -1,4 +1,7 @@
1
- import { CIRCULAR_REF } from "../../../oas/graphql/circular.js";
1
+ import {
2
+ CIRCULAR_REF,
3
+ SCHEMA_REF_PREFIX,
4
+ } from "../../../oas/graphql/circular.js";
2
5
  import type {
3
6
  ArraySchemaObject,
4
7
  SchemaObject,
@@ -25,7 +28,8 @@ export const isComplexType = (value?: SchemaObject) =>
25
28
  (!value.items.type || value.items.type === "object")));
26
29
 
27
30
  export const isCircularRef = (schema: unknown): schema is string =>
28
- typeof schema === "string" && schema.startsWith(CIRCULAR_REF);
31
+ typeof schema === "string" &&
32
+ (schema.startsWith(CIRCULAR_REF) || schema.startsWith(SCHEMA_REF_PREFIX));
29
33
 
30
34
  export const isArrayCircularRef = (
31
35
  schema: SchemaObject,
@@ -34,5 +38,12 @@ export const isArrayCircularRef = (
34
38
 
35
39
  export const extractCircularRefInfo = (
36
40
  ref?: string | SchemaObject,
37
- ): string | undefined =>
38
- typeof ref === "string" ? ref.split(":")[1] : undefined;
41
+ ): string | undefined => {
42
+ if (typeof ref !== "string") return undefined;
43
+
44
+ if (ref.startsWith(SCHEMA_REF_PREFIX)) {
45
+ return ref.slice(SCHEMA_REF_PREFIX.length).split("/").pop();
46
+ }
47
+
48
+ return ref.split(":")[1];
49
+ };
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClaudeLogo-ByzA8TYR.js","sources":["../src/lib/components/Pagination.tsx","../src/lib/plugins/markdown/assets/ChatGPTLogo.tsx","../src/lib/plugins/markdown/assets/ClaudeLogo.tsx"],"sourcesContent":["import { ArrowLeftIcon, ArrowRightIcon } from \"lucide-react\";\nimport { Link } from \"react-router\";\nimport { cn } from \"../util/cn.js\";\nimport { Button } from \"./index.js\";\n\nexport const Pagination = ({\n prev,\n next,\n className,\n}: {\n prev: { to: string; label: string } | undefined;\n next: { to: string; label: string } | undefined;\n className?: string;\n}) => {\n const linkClass =\n \"group transition-all p-5 space-x-1 rtl:space-x-reverse transition-all hover:text-foreground\";\n\n return (\n <div\n className={cn(\n \"flex -mx-4 text-muted-foreground font-semibold\",\n prev ? \"justify-between\" : \"justify-end\",\n className,\n )}\n data-pagefind-ignore=\"all\"\n >\n {prev && (\n <Button variant=\"ghost\" asChild>\n <Link to={prev.to} relative=\"path\" className={linkClass}>\n <ArrowLeftIcon size={14} strokeWidth={2.5} />\n <span className=\"text-lg truncate\">{prev.label}</span>\n </Link>\n </Button>\n )}\n {next && (\n <Button variant=\"ghost\" asChild>\n <Link to={next.to} relative=\"path\" className={linkClass}>\n <span className=\"text-lg truncate\">{next.label}</span>\n <ArrowRightIcon size={14} strokeWidth={2.5} />\n </Link>\n </Button>\n )}\n </div>\n );\n};\n","import type { SVGProps } from \"react\";\n\nexport const ChatGPTLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 320\" {...props}>\n <title>ChatGPT</title>\n <path\n fill=\"currentColor\"\n d=\"M297.06 130.97a79.712 79.712 0 0 0-6.85-65.48c-17.46-30.4-52.56-46.04-86.84-38.68A79.747 79.747 0 0 0 143.24 0C108.2-.08 77.11 22.48 66.33 55.82a79.754 79.754 0 0 0-53.31 38.67c-17.59 30.32-13.58 68.54 9.92 94.54a79.712 79.712 0 0 0 6.85 65.48c17.46 30.4 52.56 46.04 86.84 38.68a79.687 79.687 0 0 0 60.13 26.8c35.06.09 66.16-22.49 76.94-55.86a79.754 79.754 0 0 0 53.31-38.67c17.57-30.32 13.55-68.51-9.94-94.51zM176.78 299.08a59.77 59.77 0 0 1-38.39-13.88c.49-.26 1.34-.73 1.89-1.07l63.72-36.8a10.36 10.36 0 0 0 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zM47.94 244.05a59.71 59.71 0 0 1-7.15-40.18c.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83L129.87 266c-28.69 16.52-65.33 6.7-81.92-21.95zM31.17 104.96c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91L118.44 224c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94a59.94 59.94 0 0 1-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8a10.375 10.375 0 0 0-10.47 0l-77.79 44.92V92c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22a59.95 59.95 0 0 1 7.15 40.1zm-168.51 55.43-26.94-15.55a.943.943 0 0 1-.52-.74V80.86c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07L116 72.67a10.344 10.344 0 0 0-5.24 9.06l-.04 89.79zM125.35 140 160 119.99l34.65 20V180L160 200l-34.65-20z\"\n />\n </svg>\n);\n","import type { SVGProps } from \"react\";\n\nexport const ClaudeLogo = (props: SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <title>Claude</title>\n <path\n fill=\"#D97757\"\n d=\"m4.709 15.955 4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 0 1-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312z\"\n />\n </svg>\n);\n"],"names":["Pagination","prev","next","className","linkClass","jsxs","cn","jsx","Button","Link","ArrowLeftIcon","ArrowRightIcon","ChatGPTLogo","props","ClaudeLogo"],"mappings":";;;;;AAKO,MAAMA,IAAa,C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AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA,IAAA;AAAA,EAAA;AACJ,EAAA,CACF,GCPWO,IAAa,CAACD,MACzBR,gBAAAA,EAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,UAAS;AAAA,IACT,SAAQ;AAAA,IACP,GAAGQ;AAAA,IAEJ,UAAA;AAAA,MAAAN,gBAAAA,EAAAA,IAAC,WAAM,UAAA,SAAA,CAAM;AAAA,MACbA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACJ;AAAA,EAAA;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Input-nskrp_mj.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","../src/lib/ui/Input.tsx"],"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","import * as React from \"react\";\nimport { cn } from \"../util/cn.js\";\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"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\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n"],"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","Input","className","type","props","ref","jsx","cn"],"mappings":";;;;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