zudoku 0.4.2-dev.1 → 0.4.2-dev.10

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 (71) hide show
  1. package/dist/cli/dev/handler.js +1 -0
  2. package/dist/cli/dev/handler.js.map +1 -1
  3. package/dist/lib/components/DeveloperHint.js +1 -3
  4. package/dist/lib/components/DeveloperHint.js.map +1 -1
  5. package/dist/lib/components/Header.js +1 -3
  6. package/dist/lib/components/Header.js.map +1 -1
  7. package/dist/lib/components/Layout.js +3 -1
  8. package/dist/lib/components/Layout.js.map +1 -1
  9. package/dist/lib/components/navigation/SidebarCategory.js +3 -1
  10. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  11. package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
  12. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  13. package/dist/lib/plugins/markdown/Toc.js +1 -1
  14. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  15. package/dist/lib/plugins/openapi/index.js +1 -1
  16. package/dist/lib/plugins/openapi/index.js.map +1 -1
  17. package/dist/lib/plugins/openapi/playground/Playground.js +9 -3
  18. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  19. package/dist/lib/plugins/openapi/playground/ResponseTab.js +3 -1
  20. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
  21. package/lib/{CategoryHeading-D7_Jy0Lx.js → CategoryHeading-BoT0DVI-.js} +2 -2
  22. package/lib/{CategoryHeading-D7_Jy0Lx.js.map → CategoryHeading-BoT0DVI-.js.map} +1 -1
  23. package/lib/{Combination-Ce1nWgn5.js → Combination-C1wKWZ28.js} +2 -2
  24. package/lib/{Combination-Ce1nWgn5.js.map → Combination-C1wKWZ28.js.map} +1 -1
  25. package/lib/DeveloperHint-Bv958_pY.js +16 -0
  26. package/lib/DeveloperHint-Bv958_pY.js.map +1 -0
  27. package/lib/{ErrorPage-uwQIn-3A.js → ErrorPage-CcBjrY_g.js} +3 -3
  28. package/lib/{ErrorPage-uwQIn-3A.js.map → ErrorPage-CcBjrY_g.js.map} +1 -1
  29. package/lib/{Input-CBiLCRuK.js → Input-BqnnTL7-.js} +3 -3
  30. package/lib/{Input-CBiLCRuK.js.map → Input-BqnnTL7-.js.map} +1 -1
  31. package/lib/{Markdown-h11bKkQ9.js → Markdown-C3hatKS5.js} +1009 -1086
  32. package/lib/Markdown-C3hatKS5.js.map +1 -0
  33. package/lib/{MdxPage-AzVbIhda.js → MdxPage-BEG8cDoF.js} +4 -4
  34. package/lib/MdxPage-BEG8cDoF.js.map +1 -0
  35. package/lib/{OperationList-DajrjZzx.js → OperationList-BEiJFfFr.js} +9 -9
  36. package/lib/{OperationList-DajrjZzx.js.map → OperationList-BEiJFfFr.js.map} +1 -1
  37. package/lib/{Route-D7sTrFzF.js → Route-BvREOAN6.js} +2 -2
  38. package/lib/{Route-D7sTrFzF.js.map → Route-BvREOAN6.js.map} +1 -1
  39. package/lib/{SidebarBadge-djIXD1Pv.js → SidebarBadge-C6wpM9X3.js} +3 -3
  40. package/lib/{SidebarBadge-djIXD1Pv.js.map → SidebarBadge-C6wpM9X3.js.map} +1 -1
  41. package/lib/{SlotletProvider-WwEUzQQ3.js → SlotletProvider-Bdzag6MN.js} +4 -4
  42. package/lib/{SlotletProvider-WwEUzQQ3.js.map → SlotletProvider-Bdzag6MN.js.map} +1 -1
  43. package/lib/{Spinner-D4ifRVWf.js → Spinner-DiA314T5.js} +2 -2
  44. package/lib/{Spinner-D4ifRVWf.js.map → Spinner-DiA314T5.js.map} +1 -1
  45. package/lib/{index-D2SS6ne_.js → index-ClDFRC39.js} +601 -595
  46. package/lib/index-ClDFRC39.js.map +1 -0
  47. package/lib/{index-CZAFD5xN.js → index-LWNs2niD.js} +3 -3
  48. package/lib/{index-CZAFD5xN.js.map → index-LWNs2niD.js.map} +1 -1
  49. package/lib/zudoku.auth-openid.js +4 -4
  50. package/lib/zudoku.components.js +152 -154
  51. package/lib/zudoku.components.js.map +1 -1
  52. package/lib/zudoku.plugin-api-keys.js +5 -5
  53. package/lib/zudoku.plugin-custom-page.js +1 -1
  54. package/lib/zudoku.plugin-markdown.js +1 -1
  55. package/lib/zudoku.plugin-openapi.js +4 -4
  56. package/package.json +3 -3
  57. package/src/app/main.css +17 -4
  58. package/src/lib/components/DeveloperHint.tsx +1 -3
  59. package/src/lib/components/Header.tsx +1 -2
  60. package/src/lib/components/Layout.tsx +5 -4
  61. package/src/lib/components/navigation/SidebarCategory.tsx +5 -2
  62. package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
  63. package/src/lib/plugins/markdown/Toc.tsx +1 -1
  64. package/src/lib/plugins/openapi/index.tsx +1 -1
  65. package/src/lib/plugins/openapi/playground/Playground.tsx +11 -5
  66. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +2 -1
  67. package/lib/DeveloperHint-BQSFXH01.js +0 -10
  68. package/lib/DeveloperHint-BQSFXH01.js.map +0 -1
  69. package/lib/Markdown-h11bKkQ9.js.map +0 -1
  70. package/lib/MdxPage-AzVbIhda.js.map +0 -1
  71. package/lib/index-D2SS6ne_.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { S as p, R as g } from "./SlotletProvider-WwEUzQQ3.js";
3
- import { u as j, a as u, I as k, S as v, b as w, c as b, d as K, e as N, f as y } from "./Input-CBiLCRuK.js";
2
+ import { S as p, R as g } from "./SlotletProvider-Bdzag6MN.js";
3
+ import { u as j, a as u, I as k, S as v, b as w, c as b, d as K, e as N, f as y } from "./Input-BqnnTL7-.js";
4
4
  import { e as E, L as x, O as A } from "./index-ChhUJhLT.js";
5
5
  import { u as m, t as C, j as S } from "./ZudokuContext-BHNQL3XO.js";
6
- import { B as l, p as I } from "./Combination-Ce1nWgn5.js";
7
- import { D as P } from "./DeveloperHint-BQSFXH01.js";
6
+ import { B as l, p as I } from "./Combination-C1wKWZ28.js";
7
+ import { D as P } from "./DeveloperHint-Bv958_pY.js";
8
8
  import { useState as h } from "react";
9
- import { c as d, a as D, C as R, g as q } from "./Markdown-h11bKkQ9.js";
9
+ import { c as d, a as D, C as R, g as q } from "./Markdown-C3hatKS5.js";
10
10
  /**
11
11
  * @license lucide-react v0.378.0 - ISC
12
12
  *
@@ -1,5 +1,5 @@
1
1
  import { j as m } from "./jsx-runtime-B6kdoens.js";
2
- import { P as o } from "./Markdown-h11bKkQ9.js";
2
+ import { P as o } from "./Markdown-C3hatKS5.js";
3
3
  const l = (s) => ({
4
4
  getRoutes: () => s.map(({ path: e, element: t }) => ({
5
5
  path: e,
@@ -6,7 +6,7 @@ const u = (t, e) => Object.entries(t).flatMap(([a, r]) => {
6
6
  return {
7
7
  path: s.at(-1) === "index" ? s.slice(0, -1).join("/") : o,
8
8
  lazy: async () => {
9
- const { MdxPage: i } = await import("./MdxPage-AzVbIhda.js"), { default: p, ...c } = await r();
9
+ const { MdxPage: i } = await import("./MdxPage-BEG8cDoF.js"), { default: p, ...c } = await r();
10
10
  return {
11
11
  element: /* @__PURE__ */ m.jsx(
12
12
  i,
@@ -1,11 +1,11 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as s } from "./index-D2SS6ne_.js";
2
+ import { o as s } from "./index-ClDFRC39.js";
3
3
  import "./urql-YhcsXYy8.js";
4
4
  import "./ZudokuContext-BHNQL3XO.js";
5
5
  import "zudoku/openapi-worker";
6
- import "./Combination-Ce1nWgn5.js";
7
- import "./ErrorPage-uwQIn-3A.js";
8
- import "./Markdown-h11bKkQ9.js";
6
+ import "./Combination-C1wKWZ28.js";
7
+ import "./ErrorPage-CcBjrY_g.js";
8
+ import "./Markdown-C3hatKS5.js";
9
9
  import "./joinPath-B7kNnUX4.js";
10
10
  import "./router-BiRCp01d.js";
11
11
  import "./index-ChhUJhLT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.4.2-dev.1",
3
+ "version": "0.4.2-dev.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -138,7 +138,7 @@
138
138
  "semver": "7.6.2",
139
139
  "slugify": "1.6.6",
140
140
  "strip-ansi": "7.1.0",
141
- "tailwind-merge": "2.3.0",
141
+ "tailwind-merge": "2.5.2",
142
142
  "tailwindcss": "3.4.4",
143
143
  "ulidx": "^2.3.0",
144
144
  "unist-util-visit": "5.0.0",
@@ -175,7 +175,7 @@
175
175
  "react-markdown": "9.0.1",
176
176
  "react-router-dom": "6.25.1",
177
177
  "rollup-plugin-visualizer": "^5.12.0",
178
- "tsx": "4.16.5",
178
+ "tsx": "4.18.0",
179
179
  "typescript": "5.5.3"
180
180
  },
181
181
  "peerDependencies": {
package/src/app/main.css CHANGED
@@ -91,9 +91,12 @@
91
91
  }
92
92
 
93
93
  html,
94
- body,
94
+ body {
95
+ @apply h-full;
96
+ }
97
+
95
98
  #root {
96
- @apply h-full min-h-screen;
99
+ @apply min-h-screen grid grid-rows-[var(--header-height)_1fr] w-full;
97
100
  }
98
101
  * {
99
102
  @apply border-border;
@@ -102,11 +105,11 @@
102
105
  html {
103
106
  scroll-padding-block: var(--scroll-padding);
104
107
  /* This is to prevent layout jumping when the scrollbar appears/disappears */
105
- padding-left: var(--scrollbar-width);
108
+ @apply -mr-[--scrollbar-width];
106
109
  }
107
110
 
108
111
  body {
109
- @apply antialiased bg-background text-foreground;
112
+ @apply antialiased bg-background text-foreground overflow-y-auto overflow-x-clip;
110
113
  font-feature-settings:
111
114
  "rlig" 1,
112
115
  "calt" 1;
@@ -172,6 +175,16 @@
172
175
  }
173
176
  }
174
177
 
178
+ .scrollbar {
179
+ /* For Firefox */
180
+ scrollbar-width: thin;
181
+ scrollbar-color: transparent transparent;
182
+ }
183
+
184
+ .scrollbar:hover {
185
+ scrollbar-color: hsla(var(--border)) transparent;
186
+ }
187
+
175
188
  .scrollbar::-webkit-scrollbar {
176
189
  padding: 2px;
177
190
  width: 12px;
@@ -8,9 +8,7 @@ export const DeveloperHint = ({
8
8
  children: ReactNode;
9
9
  className?: string;
10
10
  }) => {
11
- // TODO: figure out a way to do that in consumer dev mode not "internal"
12
- // so this doesn't get stripped out in the build
13
- if (!import.meta.env.DEV) return;
11
+ if (process.env.NODE_ENV !== "development") return;
14
12
 
15
13
  return (
16
14
  <Callout type="caution" title="Developer hint" className={className}>
@@ -58,8 +58,7 @@ export const Header = memo(function HeaderInner() {
58
58
  const ThemeIcon = isDark ? MoonStarIcon : SunIcon;
59
59
 
60
60
  return (
61
- // padding-left is to prevent layout jumping when scrollbar appears/disappears
62
- <header className="fixed top-0 z-10 bg-background/80 backdrop-blur left-0 right-0 pl-[var(--scrollbar-width)]">
61
+ <header className="sticky top-0 z-10 bg-background/80 backdrop-blur w-full">
63
62
  <div className="max-w-screen-2xl mx-auto">
64
63
  <div className="grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-12 h-[--top-header-height]">
65
64
  <div className="flex">
@@ -47,19 +47,20 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
47
47
  </Helmet>
48
48
  <Header />
49
49
 
50
- <div className="max-w-screen-2xl mx-auto pt-[--header-height] px-10 lg:px-12 h-full">
50
+ <div className="w-full max-w-screen-2xl mx-auto px-10 lg:px-12">
51
51
  <Suspense
52
52
  fallback={
53
- <div className="grid h-full place-items-center">
53
+ <main className="grid h-full place-items-center">
54
54
  <Spinner />
55
- </div>
55
+ </main>
56
56
  }
57
57
  >
58
58
  <Sidebar />
59
59
  <main
60
60
  className={cn(
61
- "dark:border-white/10 translate-x-0 h-full",
61
+ "dark:border-white/10 translate-x-0",
62
62
  "lg:overflow-visible",
63
+ // This works in tandem with the `SidebarWrapper` component
63
64
  "lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]",
64
65
  "lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] lg:peer-data-[navigation=true]:pl-12",
65
66
  )}
@@ -103,10 +103,13 @@ export const SidebarCategory = ({
103
103
  <ul className="mt-1 border-l ps-2">
104
104
  {category.items.map((item) => (
105
105
  <SidebarItem
106
- key={item.label}
106
+ key={
107
+ ("id" in item ? item.id : "") +
108
+ ("href" in item ? item.href : "") +
109
+ item.label
110
+ }
107
111
  level={level + 1}
108
112
  item={item}
109
- // activeAnchor={activeAnchor}
110
113
  />
111
114
  ))}
112
115
  </ul>
@@ -14,7 +14,7 @@ export const SidebarWrapper = forwardRef<
14
14
  className={cn(
15
15
  "scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0",
16
16
  "px-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 mt-[--padding-content-top]",
17
- "w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
17
+ "w-[--side-nav-width] h-full scroll-pt-2 gap-2",
18
18
  className,
19
19
  )}
20
20
  ref={ref}
@@ -89,7 +89,7 @@ export const Toc = ({ entries }: { entries: TocEntry[] }) => {
89
89
  }, [activeAnchor]);
90
90
 
91
91
  return (
92
- <aside className="sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm">
92
+ <aside className="sticky scrollbar top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm">
93
93
  <div className="flex items-center gap-2 font-medium mb-2">
94
94
  <ListTreeIcon size={16} />
95
95
  On this page
@@ -163,7 +163,7 @@ export const openApiPlugin = (
163
163
  .filter((tag) => tag.operations.length > 0)
164
164
  .map<SidebarItem>((tag) => ({
165
165
  type: "category",
166
- label: tag.name ?? "",
166
+ label: tag.name || "Other endpoints",
167
167
  collapsible: true,
168
168
  collapsed: false,
169
169
  items: tag.operations.map((operation) => ({
@@ -223,9 +223,13 @@ export const Playground = ({
223
223
  </Button>
224
224
  </div>
225
225
  <Tabs
226
- defaultValue={pathParams.length > 0 ? "parameters" : "headers"}
226
+ defaultValue={
227
+ queryParams.length + pathParams.length > 0
228
+ ? "parameters"
229
+ : "headers"
230
+ }
227
231
  >
228
- <div className="flex justify-between">
232
+ <div className="flex flex-wrap gap-1 justify-between">
229
233
  <TabsList>
230
234
  {queryParams.length + pathParams.length > 0 && (
231
235
  <TabsTrigger value="parameters">Parameters</TabsTrigger>
@@ -292,7 +296,7 @@ export const Playground = ({
292
296
  </TabsContent>
293
297
  </Tabs>
294
298
  </div>
295
- <div className="flex flex-col gap-4 p-8 bg-muted/70">
299
+ <div className="p-8 bg-muted/70">
296
300
  {queryMutation.error ? (
297
301
  <div className="flex flex-col gap-2">
298
302
  {formState.pathParams.some((p) => p.value === "") && (
@@ -325,7 +329,6 @@ export const Playground = ({
325
329
  <div>Size: {queryMutation.data.size} B</div>
326
330
  </div>
327
331
  </div>
328
- {/*<UrlDisplay host={host} path={url} />*/}
329
332
  <Tabs defaultValue="response">
330
333
  <TabsList>
331
334
  <TabsTrigger value="response">Response</TabsTrigger>
@@ -343,7 +346,10 @@ export const Playground = ({
343
346
  />
344
347
  </TabsContent>
345
348
  <TabsContent value="headers">
346
- <Card className="grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4">
349
+ <Card
350
+ // playground dialog has h-5/6 ≈ 83.333vh
351
+ className="max-h-[calc(83.333vh-140px)] overflow-y-auto grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4"
352
+ >
347
353
  <div className="font-semibold">Key</div>
348
354
  <div className="font-semibold">Value</div>
349
355
  {headerEntries.map(([key, value]) => (
@@ -55,7 +55,8 @@ export const ResponseTab = ({
55
55
  }
56
56
  noBackground
57
57
  showLanguageIndicator
58
- className="overflow-x-auto p-4 text-xs max-h-[480px]"
58
+ // playground dialog has h-5/6 ≈ 83.333vh
59
+ className="overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]"
59
60
  code={view === "raw" ? body : beautifiedBody}
60
61
  />
61
62
  </Card>
@@ -1,10 +0,0 @@
1
- import "./jsx-runtime-B6kdoens.js";
2
- const n = ({
3
- children: e,
4
- className: r
5
- }) => {
6
- };
7
- export {
8
- n as D
9
- };
10
- //# sourceMappingURL=DeveloperHint-BQSFXH01.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeveloperHint-BQSFXH01.js","sources":["../src/lib/components/DeveloperHint.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Callout } from \"../ui/Callout.js\";\n\nexport const DeveloperHint = ({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) => {\n // TODO: figure out a way to do that in consumer dev mode not \"internal\"\n // so this doesn't get stripped out in the build\n if (!import.meta.env.DEV) return;\n\n return (\n <Callout type=\"caution\" title=\"Developer hint\" className={className}>\n <div className=\"flex flex-col gap-2\">\n <div>{children}</div>\n <small className=\"italic\">\n Note: This hint is only shown in development mode.\n </small>\n </div>\n </Callout>\n );\n};\n"],"names":["DeveloperHint","children","className"],"mappings":";AAGO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,UAAAC;AAAA,EACA,WAAAC;AACF,MAGM;AAeN;"}