zudoku 0.26.0 → 0.26.1

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 (169) hide show
  1. package/dist/config/config.d.ts +1 -0
  2. package/dist/config/loader.js +1 -1
  3. package/dist/config/loader.js.map +1 -1
  4. package/dist/config/validators/common.d.ts +11 -0
  5. package/dist/config/validators/common.js +1 -0
  6. package/dist/config/validators/common.js.map +1 -1
  7. package/dist/config/validators/validate.d.ts +5 -0
  8. package/dist/lib/authentication/providers/auth0.js +1 -1
  9. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  10. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  11. package/dist/lib/authentication/providers/openid.js +10 -6
  12. package/dist/lib/authentication/providers/openid.js.map +1 -1
  13. package/dist/lib/components/Autocomplete.d.ts +12 -0
  14. package/dist/lib/components/Autocomplete.js +47 -0
  15. package/dist/lib/components/Autocomplete.js.map +1 -0
  16. package/dist/lib/components/Header.js +3 -3
  17. package/dist/lib/components/Header.js.map +1 -1
  18. package/dist/lib/components/index.js +2 -2
  19. package/dist/lib/components/index.js.map +1 -1
  20. package/dist/lib/plugins/markdown/MdxPage.js +8 -2
  21. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  22. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
  23. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
  24. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  25. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  26. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  27. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  28. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
  29. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  30. package/dist/lib/plugins/openapi/playground/Headers.js +66 -4
  31. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  32. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -1
  33. package/dist/lib/plugins/openapi/playground/Playground.js +36 -11
  34. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  35. package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -30
  36. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  37. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
  38. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
  39. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
  40. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
  41. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
  42. package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
  43. package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
  44. package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
  45. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
  46. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
  47. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
  48. package/dist/lib/ui/Command.d.ts +9 -1
  49. package/dist/lib/ui/Command.js +5 -1
  50. package/dist/lib/ui/Command.js.map +1 -1
  51. package/dist/lib/util/joinUrl.d.ts +1 -0
  52. package/dist/lib/util/joinUrl.js +40 -0
  53. package/dist/lib/util/joinUrl.js.map +1 -0
  54. package/dist/vite/build.js +10 -10
  55. package/dist/vite/build.js.map +1 -1
  56. package/dist/vite/config.js +4 -1
  57. package/dist/vite/config.js.map +1 -1
  58. package/dist/vite/dev-server.js +4 -1
  59. package/dist/vite/dev-server.js.map +1 -1
  60. package/dist/vite/plugin-api.d.ts +1 -1
  61. package/dist/vite/plugin-api.js +23 -5
  62. package/dist/vite/plugin-api.js.map +1 -1
  63. package/dist/vite/plugin-auth.js +4 -1
  64. package/dist/vite/plugin-auth.js.map +1 -1
  65. package/dist/vite/plugin-mdx.js +9 -4
  66. package/dist/vite/plugin-mdx.js.map +1 -1
  67. package/dist/vite/prerender.d.ts +2 -2
  68. package/dist/vite/prerender.js +4 -4
  69. package/dist/vite/prerender.js.map +1 -1
  70. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  71. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  72. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  73. package/dist/zuplo/env.d.ts +1 -0
  74. package/dist/zuplo/env.js +3 -0
  75. package/dist/zuplo/env.js.map +1 -1
  76. package/dist/zuplo/policy-types.d.ts +33 -0
  77. package/dist/zuplo/policy-types.js +8 -0
  78. package/dist/zuplo/policy-types.js.map +1 -0
  79. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  80. package/dist/zuplo/with-zuplo-processors.js +26 -0
  81. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  82. package/dist/zuplo/with-zuplo.d.ts +1 -2
  83. package/dist/zuplo/with-zuplo.js +6 -27
  84. package/dist/zuplo/with-zuplo.js.map +1 -1
  85. package/lib/{AnchorLink-_Vu02ceN.js → AnchorLink-bObQitZv.js} +2 -2
  86. package/lib/{AnchorLink-_Vu02ceN.js.map → AnchorLink-bObQitZv.js.map} +1 -1
  87. package/lib/{AuthenticationPlugin-DNXBcsVN.js → AuthenticationPlugin-C9SwOxkc.js} +3 -3
  88. package/lib/{AuthenticationPlugin-DNXBcsVN.js.map → AuthenticationPlugin-C9SwOxkc.js.map} +1 -1
  89. package/lib/{Markdown-BrfrjEk_.js → Markdown-DFN6p0J-.js} +2 -2
  90. package/lib/{Markdown-BrfrjEk_.js.map → Markdown-DFN6p0J-.js.map} +1 -1
  91. package/lib/{MdxPage-LNZLj_A5.js → MdxPage-D9c4z09Q.js} +63 -58
  92. package/lib/MdxPage-D9c4z09Q.js.map +1 -0
  93. package/lib/{OperationList-PCwzTp1r.js → OperationList-DGJWDx1G.js} +875 -871
  94. package/lib/{OperationList-PCwzTp1r.js.map → OperationList-DGJWDx1G.js.map} +1 -1
  95. package/lib/{Route-Pzk6qwIk.js → Route-VdmEyOD0.js} +3 -3
  96. package/lib/{Route-Pzk6qwIk.js.map → Route-VdmEyOD0.js.map} +1 -1
  97. package/lib/{Select-DkOpAG0c.js → Select-D3O7wISy.js} +3 -3
  98. package/lib/{Select-DkOpAG0c.js.map → Select-D3O7wISy.js.map} +1 -1
  99. package/lib/{SlotletProvider-DPbx9KdU.js → SlotletProvider-_3zzX_g_.js} +4 -4
  100. package/lib/{SlotletProvider-DPbx9KdU.js.map → SlotletProvider-_3zzX_g_.js.map} +1 -1
  101. package/lib/{Button-oroWHXAy.js → Spinner-BlzrEEk1.js} +15 -12
  102. package/lib/Spinner-BlzrEEk1.js.map +1 -0
  103. package/lib/{ZudokuContext-D3ayHjP-.js → ZudokuContext-DeQZEp-x.js} +2 -2
  104. package/lib/{ZudokuContext-D3ayHjP-.js.map → ZudokuContext-DeQZEp-x.js.map} +1 -1
  105. package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js → chunk-SYFQ2XB5-BF5IDYrB.js} +6 -5
  106. package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js.map → chunk-SYFQ2XB5-BF5IDYrB.js.map} +1 -1
  107. package/lib/{hook-DUyACbIK.js → hook-BRQEDRbn.js} +2 -2
  108. package/lib/{hook-DUyACbIK.js.map → hook-BRQEDRbn.js.map} +1 -1
  109. package/lib/index-B7mqiOei.js +509 -0
  110. package/lib/index-B7mqiOei.js.map +1 -0
  111. package/lib/index-CXRrqOIl.js +1750 -0
  112. package/lib/index-CXRrqOIl.js.map +1 -0
  113. package/lib/joinUrl-BTy9bvoK.js +20 -0
  114. package/lib/joinUrl-BTy9bvoK.js.map +1 -0
  115. package/lib/post-processors/removeExtensions.js +7 -7
  116. package/lib/post-processors/removeExtensions.js.map +1 -1
  117. package/lib/post-processors/removeParameters.js +48 -0
  118. package/lib/post-processors/removeParameters.js.map +1 -0
  119. package/lib/ui/ActionButton.js +10 -11
  120. package/lib/ui/ActionButton.js.map +1 -1
  121. package/lib/ui/Command.js +125 -13
  122. package/lib/ui/Command.js.map +1 -1
  123. package/lib/{useExposedProps-BBHR7aLM.js → useExposedProps-CetwhZpP.js} +2 -2
  124. package/lib/{useExposedProps-BBHR7aLM.js.map → useExposedProps-CetwhZpP.js.map} +1 -1
  125. package/lib/zudoku.auth-auth0.js +7 -9
  126. package/lib/zudoku.auth-auth0.js.map +1 -1
  127. package/lib/zudoku.auth-clerk.js +1 -1
  128. package/lib/zudoku.auth-openid.js +223 -219
  129. package/lib/zudoku.auth-openid.js.map +1 -1
  130. package/lib/zudoku.components.js +219 -219
  131. package/lib/zudoku.components.js.map +1 -1
  132. package/lib/zudoku.plugin-api-catalog.js +3 -3
  133. package/lib/zudoku.plugin-api-keys.js +5 -5
  134. package/lib/zudoku.plugin-custom-pages.js +2 -2
  135. package/lib/zudoku.plugin-markdown.js +1 -1
  136. package/lib/zudoku.plugin-openapi.js +4 -4
  137. package/lib/zudoku.plugin-redirect.js +1 -1
  138. package/package.json +1 -1
  139. package/src/app/main.css +50 -50
  140. package/src/lib/authentication/providers/auth0.tsx +1 -4
  141. package/src/lib/authentication/providers/openid.tsx +12 -5
  142. package/src/lib/components/Autocomplete.tsx +111 -0
  143. package/src/lib/components/Header.tsx +3 -3
  144. package/src/lib/components/index.ts +2 -2
  145. package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
  146. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
  147. package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
  148. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +51 -0
  149. package/src/lib/plugins/openapi/playground/Headers.tsx +138 -41
  150. package/src/lib/plugins/openapi/playground/Playground.tsx +156 -62
  151. package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -122
  152. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
  153. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
  154. package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
  155. package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
  156. package/src/lib/ui/Command.tsx +20 -0
  157. package/src/lib/util/joinUrl.ts +57 -0
  158. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
  159. package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
  160. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
  161. package/lib/Button-oroWHXAy.js.map +0 -1
  162. package/lib/Command-D5DE0DD7.js +0 -611
  163. package/lib/Command-D5DE0DD7.js.map +0 -1
  164. package/lib/MdxPage-LNZLj_A5.js.map +0 -1
  165. package/lib/Spinner-C5gHXrVz.js +0 -7
  166. package/lib/Spinner-C5gHXrVz.js.map +0 -1
  167. package/lib/index-CaILD1AV.js +0 -1292
  168. package/lib/index-CaILD1AV.js.map +0 -1
  169. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
@@ -1,10 +1,10 @@
1
1
  import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import { s as j } from "./index-LNp6rxyU.js";
3
- import { u as b } from "./ZudokuContext-D3ayHjP-.js";
4
- import { b as y } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
3
+ import { u as b } from "./ZudokuContext-DeQZEp-x.js";
4
+ import { b as y } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
5
5
  import { Head as v, Link as N } from "./zudoku.components.js";
6
6
  import { u as w } from "./state-mM7uaXTW.js";
7
- import { M as C } from "./Markdown-BrfrjEk_.js";
7
+ import { M as C } from "./Markdown-DFN6p0J-.js";
8
8
  import { c as h } from "./cn-qaFjX9_3.js";
9
9
  const f = (r, n) => j(`${r}-${n}`), k = ({
10
10
  items: r,
@@ -1,14 +1,14 @@
1
1
  import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import { RotateCwIcon as g, TrashIcon as f, EyeOffIcon as j, EyeIcon as v, CheckIcon as w, CopyIcon as b, FileKey2Icon as K } from "lucide-react";
3
- import { D as k, S as m, R as N } from "./SlotletProvider-DPbx9KdU.js";
3
+ import { D as k, S as m, R as N } from "./SlotletProvider-_3zzX_g_.js";
4
4
  import { i as c } from "./invariant-Caa8-XvF.js";
5
- import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-DkOpAG0c.js";
5
+ import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-D3O7wISy.js";
6
6
  import { a as P } from "./index.esm-CrSoEshU.js";
7
- import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
8
- import { a as y, e as q, u as O } from "./ZudokuContext-D3ayHjP-.js";
7
+ import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
8
+ import { a as y, e as q, u as O } from "./ZudokuContext-DeQZEp-x.js";
9
9
  import { Button as l } from "./ui/Button.js";
10
10
  import { Input as z } from "./ui/Input.js";
11
- import { u as F } from "./hook-DUyACbIK.js";
11
+ import { u as F } from "./hook-BRQEDRbn.js";
12
12
  import { useState as p } from "react";
13
13
  import { c as T } from "./cn-qaFjX9_3.js";
14
14
  const L = ({ service: t }) => {
@@ -1,8 +1,8 @@
1
1
  import { j as o } from "./jsx-runtime-Bdg6XQ1m.js";
2
2
  import a from "react";
3
- import { P as n } from "./Markdown-BrfrjEk_.js";
3
+ import { P as n } from "./Markdown-DFN6p0J-.js";
4
4
  import { c } from "./cn-qaFjX9_3.js";
5
- import { u as p } from "./useExposedProps-BBHR7aLM.js";
5
+ import { u as p } from "./useExposedProps-CetwhZpP.js";
6
6
  const u = ({
7
7
  element: t,
8
8
  render: s,
@@ -74,7 +74,7 @@ const C = (n) => ({
74
74
  const h = {
75
75
  path: r,
76
76
  lazy: async () => {
77
- const { MdxPage: l } = await import("./MdxPage-LNZLj_A5.js"), { default: p, ...g } = await a();
77
+ const { MdxPage: l } = await import("./MdxPage-D9c4z09Q.js"), { default: p, ...g } = await a();
78
78
  return {
79
79
  element: /* @__PURE__ */ P.jsx(
80
80
  l,
@@ -1,9 +1,9 @@
1
1
  import "./jsx-runtime-Bdg6XQ1m.js";
2
- import "./chunk-SYFQ2XB5-KWlHsT7t.js";
3
- import { o as a } from "./index-CaILD1AV.js";
4
- import "./ZudokuContext-D3ayHjP-.js";
2
+ import "./chunk-SYFQ2XB5-BF5IDYrB.js";
3
+ import { o as a } from "./index-CXRrqOIl.js";
4
+ import "./ZudokuContext-DeQZEp-x.js";
5
5
  import "lucide-react";
6
- import "./hook-DUyACbIK.js";
6
+ import "./hook-BRQEDRbn.js";
7
7
  import "./ui/Button.js";
8
8
  export {
9
9
  a as openApiPlugin
@@ -1,4 +1,4 @@
1
- import { r as o } from "./chunk-SYFQ2XB5-KWlHsT7t.js";
1
+ import { r as o } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
2
2
  const a = (r) => ({
3
3
  getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
4
  path: e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
package/src/app/main.css CHANGED
@@ -238,57 +238,57 @@
238
238
  }
239
239
 
240
240
  /* Theme */
241
-
242
- @layer base {
243
- :root {
244
- --background: 0 0% 100%;
245
- --foreground: 240 10% 3.9%;
246
- --card: 0 0% 100%;
247
- --card-foreground: 240 10% 3.9%;
248
- --popover: 0 0% 100%;
249
- --popover-foreground: 240 10% 3.9%;
250
- --primary: 240 5.9% 10%;
251
- --primary-foreground: 0 0% 98%;
252
- --secondary: 240 4.8% 95.9%;
253
- --secondary-foreground: 240 5.9% 10%;
254
- --muted: 240 4.8% 95.9%;
255
- --muted-foreground: 240 3.8% 46.1%;
256
- --accent: 240 4.8% 95.9%;
257
- --accent-foreground: 240 5.9% 10%;
258
- --destructive: 0 84.2% 60.2%;
259
- --destructive-foreground: 0 0% 98%;
260
- --border: 240 5.9% 95%;
261
- --input: 240 5.9% 90%;
262
- --ring: 240 5.9% 10%;
263
- --radius: 0.75rem;
264
- --chart-1: 12 76% 61%;
265
- --chart-2: 173 58% 39%;
266
- --chart-3: 197 37% 24%;
267
- --chart-4: 43 74% 66%;
268
- --chart-5: 27 87% 67%;
269
- }
270
241
 
271
- .dark {
272
- --background: 240 10% 3.9%;
273
- --foreground: 0 0% 98%;
274
- --card: 240 10% 3.9%;
275
- --card-foreground: 0 0% 98%;
276
- --popover: 240 10% 3.9%;
277
- --popover-foreground: 0 0% 98%;
278
- --primary: 0 0% 98%;
279
- --primary-foreground: 240 5.9% 10%;
280
- --secondary: 240 3.7% 15.9%;
281
- --secondary-foreground: 0 0% 98%;
282
- --muted: 240 3.7% 15.9%;
283
- --muted-foreground: 240 5% 64.9%;
284
- --accent: 240 3.7% 15.9%;
285
- --accent-foreground: 0 0% 98%;
286
- --destructive: 0 62.8% 30.6%;
287
- --destructive-foreground: 0 0% 98%;
288
- --border: 240 3.7% 15.9%;
289
- --input: 240 3.7% 15.9%;
290
- --ring: 240 4.9% 83.9%;
291
- --chart-1: 220 70% 50%;
242
+ @layer base {
243
+ :root {
244
+ --background: 0 0% 100%;
245
+ --foreground: 240 10% 3.9%;
246
+ --card: 0 0% 100%;
247
+ --card-foreground: 240 10% 3.9%;
248
+ --popover: 0 0% 100%;
249
+ --popover-foreground: 240 10% 3.9%;
250
+ --primary: 240 5.9% 10%;
251
+ --primary-foreground: 0 0% 98%;
252
+ --secondary: 240 4.8% 95.9%;
253
+ --secondary-foreground: 240 5.9% 10%;
254
+ --muted: 240 4.8% 95.9%;
255
+ --muted-foreground: 240 3.8% 46.1%;
256
+ --accent: 240 4.8% 95.9%;
257
+ --accent-foreground: 240 5.9% 10%;
258
+ --destructive: 0 84.2% 60.2%;
259
+ --destructive-foreground: 0 0% 98%;
260
+ --border: 240 5.9% 95%;
261
+ --input: 240 5.9% 90%;
262
+ --ring: 240 5.9% 10%;
263
+ --radius: 0.75rem;
264
+ --chart-1: 12 76% 61%;
265
+ --chart-2: 173 58% 39%;
266
+ --chart-3: 197 37% 24%;
267
+ --chart-4: 43 74% 66%;
268
+ --chart-5: 27 87% 67%;
269
+ }
270
+
271
+ .dark {
272
+ --background: 240 10% 3.9%;
273
+ --foreground: 0 0% 98%;
274
+ --card: 240 10% 3.9%;
275
+ --card-foreground: 0 0% 98%;
276
+ --popover: 240 10% 3.9%;
277
+ --popover-foreground: 0 0% 98%;
278
+ --primary: 0 0% 98%;
279
+ --primary-foreground: 240 5.9% 10%;
280
+ --secondary: 240 3.7% 15.9%;
281
+ --secondary-foreground: 0 0% 98%;
282
+ --muted: 240 3.7% 15.9%;
283
+ --muted-foreground: 240 5% 64.9%;
284
+ --accent: 240 3.7% 15.9%;
285
+ --accent-foreground: 0 0% 98%;
286
+ --destructive: 0 62.8% 30.6%;
287
+ --destructive-foreground: 0 0% 98%;
288
+ --border: 240 3.7% 15.9%;
289
+ --input: 240 3.7% 15.9%;
290
+ --ring: 240 4.9% 83.9%;
291
+ --chart-1: 220 70% 50%;
292
292
  --chart-2: 160 60% 45%;
293
293
  --chart-3: 30 80% 55%;
294
294
  --chart-4: 280 65% 60%;
@@ -35,10 +35,7 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
35
35
  providerData: null,
36
36
  });
37
37
 
38
- const redirectUrl = new URL(
39
- window.location.origin + this.logoutRedirectUrlPath,
40
- );
41
-
38
+ const redirectUrl = new URL(window.location.origin);
42
39
  redirectUrl.pathname = this.logoutRedirectUrlPath;
43
40
 
44
41
  // SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0
@@ -2,6 +2,7 @@ import logger from "loglevel";
2
2
  import * as oauth from "oauth4webapi";
3
3
  import { OpenIDAuthenticationConfig } from "../../../config/config.js";
4
4
  import { ClientOnly } from "../../components/ClientOnly.js";
5
+ import { joinUrl } from "../../util/joinUrl.js";
5
6
  import {
6
7
  AuthenticationProvider,
7
8
  AuthenticationProviderInitializer,
@@ -49,8 +50,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
49
50
 
50
51
  protected authorizationServer: oauth.AuthorizationServer | undefined;
51
52
 
52
- protected callbackUrlPath = "/oauth/callback";
53
- protected logoutRedirectUrlPath = "/";
53
+ protected callbackUrlPath: string;
54
+ protected logoutRedirectUrlPath: string;
54
55
  protected onAuthorizationUrl?: (
55
56
  authorizationUrl: URL,
56
57
  options: { isSignIn: boolean; isSignUp: boolean },
@@ -67,6 +68,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
67
68
  redirectToAfterSignUp,
68
69
  redirectToAfterSignIn,
69
70
  redirectToAfterSignOut,
71
+ basePath,
70
72
  }: OpenIDAuthenticationConfig) {
71
73
  this.client = {
72
74
  client_id: clientId,
@@ -74,9 +76,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
74
76
  };
75
77
  this.audience = audience;
76
78
  this.issuer = issuer;
77
- this.redirectToAfterSignUp = redirectToAfterSignUp ?? "/";
78
- this.redirectToAfterSignIn = redirectToAfterSignIn ?? "/";
79
- this.redirectToAfterSignOut = redirectToAfterSignOut ?? "/";
79
+ this.callbackUrlPath = joinUrl(basePath, "/oauth/callback");
80
+
81
+ const root = joinUrl(basePath, "/");
82
+
83
+ this.logoutRedirectUrlPath = root;
84
+ this.redirectToAfterSignUp = redirectToAfterSignUp ?? root;
85
+ this.redirectToAfterSignIn = redirectToAfterSignIn ?? root;
86
+ this.redirectToAfterSignOut = redirectToAfterSignOut ?? root;
80
87
  }
81
88
 
82
89
  protected async getAuthServer() {
@@ -0,0 +1,111 @@
1
+ import { PopoverAnchor } from "@radix-ui/react-popover";
2
+ import { useCommandState } from "cmdk";
3
+ import { useRef, useState, type Ref } from "react";
4
+ import {
5
+ Command,
6
+ CommandInlineInput,
7
+ CommandItem,
8
+ CommandList,
9
+ } from "zudoku/ui/Command.js";
10
+ import { Popover, PopoverContent } from "zudoku/ui/Popover.js";
11
+ import { cn } from "../util/cn.js";
12
+
13
+ type AutocompleteProps = {
14
+ value: string;
15
+ options: readonly string[];
16
+ onChange: (e: string) => void;
17
+ className?: string;
18
+ placeholder?: string;
19
+ onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
20
+ ref?: Ref<HTMLInputElement>;
21
+ };
22
+
23
+ const AutocompletePopover = ({
24
+ value,
25
+ options,
26
+ onChange,
27
+ className,
28
+ placeholder = "Enter value",
29
+ onEnterPress,
30
+ ref,
31
+ }: AutocompleteProps) => {
32
+ const [open, setOpen] = useState(false);
33
+ const [dontClose, setDontClose] = useState(false);
34
+ const count = useCommandState((state) => state.filtered.count);
35
+ const inputRef = useRef<HTMLInputElement>(null);
36
+ return (
37
+ <Popover open={open}>
38
+ <PopoverAnchor>
39
+ <CommandInlineInput
40
+ ref={(el) => {
41
+ inputRef.current = el;
42
+ if (typeof ref === "function") {
43
+ ref(el);
44
+ } else if (ref) {
45
+ ref.current = el;
46
+ }
47
+ }}
48
+ value={value}
49
+ placeholder={placeholder}
50
+ className={cn("h-9 bg-transparent", className)}
51
+ onFocus={() => setOpen(true)}
52
+ onBlur={() => {
53
+ if (dontClose) {
54
+ return;
55
+ }
56
+ setOpen(false);
57
+ }}
58
+ onKeyDown={(e) => {
59
+ if (e.key === "Enter") {
60
+ setOpen(false);
61
+ inputRef.current?.blur();
62
+ onEnterPress?.(e);
63
+ }
64
+ }}
65
+ onValueChange={(e) => onChange(e)}
66
+ />
67
+ </PopoverAnchor>
68
+ <PopoverContent
69
+ onMouseEnter={() => setDontClose(true)}
70
+ onMouseLeave={() => setDontClose(false)}
71
+ onOpenAutoFocus={(e) => e.preventDefault()}
72
+ className={cn("p-0 w-[--radix-popover-trigger-width]", {
73
+ "border-0": count === 0,
74
+ })}
75
+ align="start"
76
+ side="bottom"
77
+ onWheel={(e) => {
78
+ // See: https://github.com/radix-ui/primitives/issues/1159
79
+ e.stopPropagation();
80
+ }}
81
+ onTouchMove={(e) => {
82
+ e.stopPropagation();
83
+ }}
84
+ >
85
+ <CommandList className="max-h-[140px]">
86
+ {options.map((enumValue) => (
87
+ <CommandItem
88
+ key={enumValue}
89
+ value={enumValue}
90
+ onSelect={(selected) => {
91
+ onChange(selected);
92
+ setOpen(false);
93
+ }}
94
+ className="cursor-pointer"
95
+ >
96
+ {enumValue}
97
+ </CommandItem>
98
+ ))}
99
+ </CommandList>
100
+ </PopoverContent>
101
+ </Popover>
102
+ );
103
+ };
104
+
105
+ export const Autocomplete = (props: AutocompleteProps) => {
106
+ return (
107
+ <Command className="bg-transparent">
108
+ <AutocompletePopover {...props} />
109
+ </Command>
110
+ );
111
+ };
@@ -16,7 +16,7 @@ import {
16
16
  DropdownMenuSubTrigger,
17
17
  DropdownMenuTrigger,
18
18
  } from "../ui/DropdownMenu.js";
19
- import { joinPath } from "../util/joinPath.js";
19
+ import { joinUrl } from "../util/joinUrl.js";
20
20
  import { Banner } from "./Banner.js";
21
21
  import { ClientOnly } from "./ClientOnly.js";
22
22
  import { useZudoku } from "./context/ZudokuContext.js";
@@ -76,7 +76,7 @@ export const Header = memo(function HeaderInner() {
76
76
  src={
77
77
  /https?:\/\//.test(page.logo.src.light)
78
78
  ? page.logo.src.light
79
- : joinPath(
79
+ : joinUrl(
80
80
  import.meta.env.BASE_URL,
81
81
  page.logo.src.light,
82
82
  )
@@ -90,7 +90,7 @@ export const Header = memo(function HeaderInner() {
90
90
  src={
91
91
  /https?:\/\//.test(page.logo.src.dark)
92
92
  ? page.logo.src.dark
93
- : joinPath(
93
+ : joinUrl(
94
94
  import.meta.env.BASE_URL,
95
95
  page.logo.src.dark,
96
96
  )
@@ -6,14 +6,14 @@ import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
6
6
  import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
7
7
  import { Button as ButtonImport } from "../ui/Button.js";
8
8
  import { Callout as CalloutImport } from "../ui/Callout.js";
9
- import { Spinner as SpinnerImport } from "./Spinner.js";
10
- import { Markdown as MarkdownImport } from "./Markdown.js";
11
9
  import {
12
10
  Bootstrap as BootstrapImport,
13
11
  BootstrapStatic as BootstrapStaticImport,
14
12
  } from "./Bootstrap.js";
15
13
  import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
16
14
  import { Layout as LayoutImport } from "./Layout.js";
15
+ import { Markdown as MarkdownImport } from "./Markdown.js";
16
+ import { Spinner as SpinnerImport } from "./Spinner.js";
17
17
  import { Zudoku as ZudokuImport } from "./Zudoku.js";
18
18
  import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
19
19
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
@@ -2,7 +2,7 @@ import { useMDXComponents } from "@mdx-js/react";
2
2
  import slugify from "@sindresorhus/slugify";
3
3
  import { Helmet } from "@zudoku/react-helmet-async";
4
4
  import { type PropsWithChildren, useEffect } from "react";
5
- import { Link } from "react-router";
5
+ import { Link, useHref } from "react-router";
6
6
  import { CategoryHeading } from "../../components/CategoryHeading.js";
7
7
  import { Heading } from "../../components/Heading.js";
8
8
  import { ProseClasses } from "../../components/Markdown.js";
@@ -51,6 +51,13 @@ export const MdxPage = ({
51
51
  }
52
52
  >) => {
53
53
  const categoryTitle = useCurrentItem()?.categoryLabel;
54
+ let canonicalUrl = null;
55
+ const path = useHref("");
56
+ if (typeof window !== "undefined") {
57
+ const domain = window.location.origin;
58
+ canonicalUrl = `${domain}${path}`;
59
+ }
60
+
54
61
  const title = frontmatter.title;
55
62
  const category = frontmatter.category ?? categoryTitle;
56
63
  const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;
@@ -87,6 +94,7 @@ export const MdxPage = ({
87
94
  <Helmet>
88
95
  <title>{pageTitle}</title>
89
96
  {excerpt && <meta name="description" content={excerpt} />}
97
+ {canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
90
98
  </Helmet>
91
99
  <div
92
100
  className={cn(
@@ -1,20 +1,24 @@
1
1
  import type { OperationListItemResult } from "./OperationList.js";
2
2
  import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
3
+ import { Content } from "./SidecarExamples.js";
3
4
 
4
5
  export const PlaygroundDialogWrapper = ({
5
6
  server,
6
7
  servers,
7
8
  operation,
9
+ examples,
8
10
  }: {
9
11
  server: string;
10
12
  servers?: string[];
11
13
  operation: OperationListItemResult;
14
+ examples?: Content;
12
15
  }) => {
13
16
  const headers = operation.parameters
14
17
  ?.filter((p) => p.in === "header")
15
18
  .map((p) => ({
16
19
  name: p.name,
17
20
  defaultValue: p.examples?.find((x) => x.value)?.value ?? "",
21
+ defaultActive: false,
18
22
  }));
19
23
  const queryParams = operation.parameters
20
24
  ?.filter((p) => p.in === "query")
@@ -39,6 +43,7 @@ export const PlaygroundDialogWrapper = ({
39
43
  headers={headers}
40
44
  queryParams={queryParams}
41
45
  pathParams={pathParams}
46
+ examples={examples}
42
47
  />
43
48
  );
44
49
  };
@@ -198,6 +198,7 @@ export const Sidecar = ({
198
198
  server={result.data.schema.url}
199
199
  servers={result.data.schema.servers.map((server) => server.url)}
200
200
  operation={operation}
201
+ examples={requestBodyContent ?? undefined}
201
202
  />
202
203
  )}
203
204
  </SidecarBox.Head>
@@ -0,0 +1,51 @@
1
+ import { Button } from "zudoku/ui/Button.js";
2
+ import {
3
+ DropdownMenu,
4
+ DropdownMenuContent,
5
+ DropdownMenuGroup,
6
+ DropdownMenuItem,
7
+ DropdownMenuLabel,
8
+ DropdownMenuSeparator,
9
+ DropdownMenuTrigger,
10
+ } from "zudoku/ui/DropdownMenu.js";
11
+ import { Content, Example } from "../SidecarExamples.js";
12
+
13
+ const ExamplesDropdown = ({
14
+ examples,
15
+ onSelect,
16
+ }: {
17
+ examples: Content;
18
+ onSelect: (example: Example) => void;
19
+ }) => {
20
+ return (
21
+ <DropdownMenu>
22
+ <DropdownMenuTrigger asChild>
23
+ <Button variant="outline">Use Example</Button>
24
+ </DropdownMenuTrigger>
25
+ <DropdownMenuContent className="w-56">
26
+ {examples.map((example) => {
27
+ return (
28
+ <div key={example.mediaType}>
29
+ <DropdownMenuLabel>{example.mediaType}</DropdownMenuLabel>
30
+ <DropdownMenuSeparator />
31
+ <DropdownMenuGroup>
32
+ {example.examples?.map((example) => {
33
+ return (
34
+ <DropdownMenuItem
35
+ key={example.name}
36
+ onSelect={() => onSelect(example)}
37
+ >
38
+ {example.name}
39
+ </DropdownMenuItem>
40
+ );
41
+ })}
42
+ </DropdownMenuGroup>
43
+ </div>
44
+ );
45
+ })}
46
+ </DropdownMenuContent>
47
+ </DropdownMenu>
48
+ );
49
+ };
50
+
51
+ export default ExamplesDropdown;