zudoku 0.47.1 → 0.47.2

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 (118) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +21 -21
  2. package/dist/app/ZuploBuildConfig.js +7 -7
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/entry.client.d.ts +0 -2
  5. package/dist/app/entry.client.js +0 -2
  6. package/dist/app/entry.client.js.map +1 -1
  7. package/dist/app/entry.server.d.ts +0 -2
  8. package/dist/app/entry.server.js +0 -2
  9. package/dist/app/entry.server.js.map +1 -1
  10. package/dist/app/env.d.ts +7 -7
  11. package/dist/app/env.js +8 -0
  12. package/dist/app/env.js.map +1 -1
  13. package/dist/app/main.d.ts +1 -0
  14. package/dist/app/main.js +1 -0
  15. package/dist/app/main.js.map +1 -1
  16. package/dist/config/validators/validate.d.ts +199 -76
  17. package/dist/config/validators/validate.js +22 -11
  18. package/dist/config/validators/validate.js.map +1 -1
  19. package/dist/lib/auth/issuer.js +1 -1
  20. package/dist/lib/auth/issuer.js.map +1 -1
  21. package/dist/lib/auth/issuer.test.js +1 -1
  22. package/dist/lib/auth/issuer.test.js.map +1 -1
  23. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  24. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  25. package/dist/lib/components/Framed.d.ts +7 -0
  26. package/dist/lib/components/Framed.js +26 -0
  27. package/dist/lib/components/Framed.js.map +1 -0
  28. package/dist/lib/components/MobileTopNavigation.js +2 -1
  29. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  30. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +4 -4
  31. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  32. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  33. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  34. package/dist/lib/ui/CodeBlock.js +1 -1
  35. package/dist/lib/ui/CodeBlock.js.map +1 -1
  36. package/dist/lib/util/MdxComponents.d.ts +6 -0
  37. package/dist/lib/util/MdxComponents.js +4 -2
  38. package/dist/lib/util/MdxComponents.js.map +1 -1
  39. package/dist/vite/css/plugin.js +11 -0
  40. package/dist/vite/css/plugin.js.map +1 -1
  41. package/dist/vite/plugin-mdx.js +4 -2
  42. package/dist/vite/plugin-mdx.js.map +1 -1
  43. package/dist/vite/plugin-theme.d.ts +8 -0
  44. package/dist/vite/plugin-theme.js +223 -0
  45. package/dist/vite/plugin-theme.js.map +1 -0
  46. package/dist/vite/plugin-theme.test.d.ts +1 -0
  47. package/dist/vite/plugin-theme.test.js +270 -0
  48. package/dist/vite/plugin-theme.test.js.map +1 -0
  49. package/dist/vite/plugin.js +2 -4
  50. package/dist/vite/plugin.js.map +1 -1
  51. package/dist/vite/shadcn-registry.d.ts +45 -0
  52. package/dist/vite/shadcn-registry.js +29 -0
  53. package/dist/vite/shadcn-registry.js.map +1 -0
  54. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  55. package/lib/{Markdown-r4buN85T.js → Markdown-C5j8kKSX.js} +444 -404
  56. package/lib/Markdown-C5j8kKSX.js.map +1 -0
  57. package/lib/{MdxPage-DYKsTerz.js → MdxPage-CKTMf1cR.js} +3 -3
  58. package/lib/{MdxPage-DYKsTerz.js.map → MdxPage-CKTMf1cR.js.map} +1 -1
  59. package/lib/{OasProvider-8vNiLpIG.js → OasProvider-_GzmsbMg.js} +2 -2
  60. package/lib/{OasProvider-8vNiLpIG.js.map → OasProvider-_GzmsbMg.js.map} +1 -1
  61. package/lib/{OperationList-BCVHtZNK.js → OperationList-BJAKaG5p.js} +4 -4
  62. package/lib/{OperationList-BCVHtZNK.js.map → OperationList-BJAKaG5p.js.map} +1 -1
  63. package/lib/{SchemaList-1oJKvBxh.js → SchemaList-Dgc0A8x5.js} +5 -5
  64. package/lib/{SchemaList-1oJKvBxh.js.map → SchemaList-Dgc0A8x5.js.map} +1 -1
  65. package/lib/{SchemaView-CTqaB-79.js → SchemaView-DVx-jFN4.js} +13 -13
  66. package/lib/{SchemaView-CTqaB-79.js.map → SchemaView-DVx-jFN4.js.map} +1 -1
  67. package/lib/{Slot-B5qSAnwR.js → Slot-ITby_hMb.js} +2 -2
  68. package/lib/{Slot-B5qSAnwR.js.map → Slot-ITby_hMb.js.map} +1 -1
  69. package/lib/{Toc-lxYQEOzX.js → Toc-Csq3UNtW.js} +2 -2
  70. package/lib/{Toc-lxYQEOzX.js.map → Toc-Csq3UNtW.js.map} +1 -1
  71. package/lib/{circular-ZGGPtwMq.js → circular-BP4OrHFK.js} +2 -2
  72. package/lib/{circular-ZGGPtwMq.js.map → circular-BP4OrHFK.js.map} +1 -1
  73. package/lib/clerk-yAKDC3Qz.js.map +1 -1
  74. package/lib/{createServer-DUBpXfvA.js → createServer-zu4cDiPe.js} +3 -3
  75. package/lib/{createServer-DUBpXfvA.js.map → createServer-zu4cDiPe.js.map} +1 -1
  76. package/lib/{errors-D27ZTQgx.js → errors-CPPSp5F4.js} +8 -8
  77. package/lib/{errors-D27ZTQgx.js.map → errors-CPPSp5F4.js.map} +1 -1
  78. package/lib/hook-7wZANGJP.js.map +1 -1
  79. package/lib/index-CrcNWbel.js.map +1 -1
  80. package/lib/index-QzXzw_ra.js.map +1 -1
  81. package/lib/{index-Cucjfk3D.js → index-jWXxqkni.js} +6 -6
  82. package/lib/{index-Cucjfk3D.js.map → index-jWXxqkni.js.map} +1 -1
  83. package/lib/ui/CodeBlock.js +7 -7
  84. package/lib/ui/CodeBlock.js.map +1 -1
  85. package/lib/zudoku.auth-azureb2c.js +1 -1
  86. package/lib/zudoku.auth-openid.js +1 -1
  87. package/lib/zudoku.components.js +25 -24
  88. package/lib/zudoku.components.js.map +1 -1
  89. package/lib/zudoku.plugin-api-catalog.js +1 -1
  90. package/lib/zudoku.plugin-api-keys.js +50 -42
  91. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  92. package/lib/zudoku.plugin-custom-pages.js +1 -1
  93. package/lib/zudoku.plugin-markdown.js +1 -1
  94. package/lib/zudoku.plugin-openapi.js +1 -1
  95. package/package.json +5 -5
  96. package/src/app/ZuploBuildConfig.ts +7 -7
  97. package/src/app/defaultTheme.css +68 -49
  98. package/src/app/entry.client.tsx +0 -2
  99. package/src/app/entry.server.tsx +0 -2
  100. package/src/app/env.ts +8 -0
  101. package/src/app/main.css +1 -52
  102. package/src/app/main.tsx +1 -0
  103. package/src/lib/auth/issuer.test.ts +1 -1
  104. package/src/lib/auth/issuer.ts +1 -1
  105. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  106. package/src/lib/components/Framed.tsx +51 -0
  107. package/src/lib/components/MobileTopNavigation.tsx +4 -0
  108. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +11 -8
  109. package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
  110. package/src/lib/ui/CodeBlock.tsx +1 -1
  111. package/src/lib/util/MdxComponents.tsx +13 -2
  112. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  113. package/dist/vite/plugin-configure-tailwind.js +0 -38
  114. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  115. package/dist/vite/plugin-theme-css.d.ts +0 -5
  116. package/dist/vite/plugin-theme-css.js +0 -77
  117. package/dist/vite/plugin-theme-css.js.map +0 -1
  118. package/lib/Markdown-r4buN85T.js.map +0 -1
@@ -3,7 +3,7 @@ import "lucide-react";
3
3
  import "./chunk-DQRVZFIR-BblmKnHy.js";
4
4
  import "./hook-7wZANGJP.js";
5
5
  import "./ui/Button.js";
6
- import { F as a, U as s, H as n } from "./index-Cucjfk3D.js";
6
+ import { F as a, U as s, H as n } from "./index-jWXxqkni.js";
7
7
  export {
8
8
  a as GetSidebarOperationsQuery,
9
9
  s as UNTAGGED_PATH,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.47.1",
3
+ "version": "0.47.2",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -174,7 +174,7 @@
174
174
  "@tailwindcss/vite": "4.1.7",
175
175
  "@tanem/react-nprogress": "5.0.55",
176
176
  "@tanstack/react-query": "5.74.3",
177
- "@types/react": "19.1.1",
177
+ "@types/react": "19.1.8",
178
178
  "@types/react-dom": "19.1.6",
179
179
  "@vitejs/plugin-react": "4.4.1",
180
180
  "@zudoku/httpsnippet": "10.0.9",
@@ -211,7 +211,7 @@
211
211
  "openapi-types": "12.1.3",
212
212
  "pagefind": "1.4.0-alpha.1",
213
213
  "picocolors": "1.1.1",
214
- "piscina": "5.0.0-alpha.2",
214
+ "piscina": "5.0.0",
215
215
  "posthog-node": "4.17.1",
216
216
  "react-error-boundary": "5.0.0",
217
217
  "react-hook-form": "7.57.0",
@@ -250,7 +250,7 @@
250
250
  "zustand": "5.0.5"
251
251
  },
252
252
  "devDependencies": {
253
- "@graphql-codegen/cli": "5.0.6",
253
+ "@graphql-codegen/cli": "5.0.7",
254
254
  "@graphql-codegen/client-preset": "4.8.0",
255
255
  "@testing-library/dom": "10.4.0",
256
256
  "@testing-library/jest-dom": "6.6.3",
@@ -276,7 +276,7 @@
276
276
  "react-dom": "19.1.0",
277
277
  "rollup-plugin-visualizer": "5.14.0",
278
278
  "typescript": "5.8.3",
279
- "vitest": "3.1.4"
279
+ "vitest": "3.2.3"
280
280
  },
281
281
  "peerDependencies": {
282
282
  "react": ">=19",
@@ -19,14 +19,14 @@ export const EntitlementsSchema = z.object({
19
19
 
20
20
  export const BuildConfigSchema = z.object({
21
21
  entitlements: EntitlementsSchema,
22
- environmentType: z.string(),
22
+ environmentType: z.string().optional(),
23
23
  deploymentName: z.string(),
24
- deploymentUrl: z.string(),
25
- projectId: z.string(),
26
- projectType: z.string(),
27
- sourceType: z.string(),
28
- accountName: z.string(),
29
- projectName: z.string(),
24
+ deploymentUrl: z.string().optional(),
25
+ projectId: z.string().optional(),
26
+ projectType: z.string().optional(),
27
+ sourceType: z.string().optional(),
28
+ accountName: z.string().optional(),
29
+ projectName: z.string().optional(),
30
30
  });
31
31
 
32
32
  export type BuildConfig = z.infer<typeof BuildConfigSchema>;
@@ -1,54 +1,73 @@
1
+ /**
2
+ * Default theme for Zudoku. Based on shadcn/ui zinc base colors.
3
+ * See: https://ui.shadcn.com/docs/theming#zinc
4
+ */
5
+
1
6
  :root {
2
- --background: oklch(100% 0 none);
3
- --foreground: oklch(14.1% 0.004 286);
4
- --card: oklch(100% 0 none);
5
- --card-foreground: oklch(14.1% 0.004 286);
6
- --popover: oklch(100% 0 none);
7
- --popover-foreground: oklch(14.1% 0.004 286);
8
- --primary: oklch(21% 0.006 286);
9
- --primary-foreground: oklch(98.5% 0 none);
10
- --secondary: oklch(96.8% 0.001 286);
11
- --secondary-foreground: oklch(21% 0.006 286);
12
- --muted: oklch(96.8% 0.001 286);
13
- --muted-foreground: oklch(55.2% 0.014 286);
14
- --accent: oklch(96.8% 0.001 286);
15
- --accent-foreground: oklch(21% 0.006 286);
16
- --destructive: oklch(63.7% 0.208 25.3);
17
- --destructive-foreground: oklch(98.5% 0 none);
18
- --border: oklch(96% 0.002 286);
19
- --input: oklch(92% 0.004 286);
20
- --ring: oklch(21% 0.006 286);
21
- --chart-1: oklch(67.7% 0.157 35.2);
22
- --chart-2: oklch(63.1% 0.101 183);
23
- --chart-3: oklch(37.9% 0.044 226);
24
- --chart-4: oklch(83.4% 0.119 88.1);
25
- --chart-5: oklch(78.3% 0.126 58.7);
26
- --radius: 0.75rem;
7
+ --radius: 0.625rem;
8
+ --background: oklch(1 0 0);
9
+ --foreground: oklch(0.141 0.005 285.823);
10
+ --card: oklch(1 0 0);
11
+ --card-foreground: oklch(0.141 0.005 285.823);
12
+ --popover: oklch(1 0 0);
13
+ --popover-foreground: oklch(0.141 0.005 285.823);
14
+ --primary: oklch(0.21 0.006 285.885);
15
+ --primary-foreground: oklch(0.985 0 0);
16
+ --secondary: oklch(0.967 0.001 286.375);
17
+ --secondary-foreground: oklch(0.21 0.006 285.885);
18
+ --muted: oklch(0.967 0.001 286.375);
19
+ --muted-foreground: oklch(0.552 0.016 285.938);
20
+ --accent: oklch(0.967 0.001 286.375);
21
+ --accent-foreground: oklch(0.21 0.006 285.885);
22
+ --destructive: oklch(0.577 0.245 27.325);
23
+ --border: oklch(0.92 0.004 286.32);
24
+ --input: oklch(0.92 0.004 286.32);
25
+ --ring: oklch(0.705 0.015 286.067);
26
+ --chart-1: oklch(0.646 0.222 41.116);
27
+ --chart-2: oklch(0.6 0.118 184.704);
28
+ --chart-3: oklch(0.398 0.07 227.392);
29
+ --chart-4: oklch(0.828 0.189 84.429);
30
+ --chart-5: oklch(0.769 0.188 70.08);
31
+ --sidebar: oklch(0.985 0 0);
32
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
33
+ --sidebar-primary: oklch(0.21 0.006 285.885);
34
+ --sidebar-primary-foreground: oklch(0.985 0 0);
35
+ --sidebar-accent: oklch(0.967 0.001 286.375);
36
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
37
+ --sidebar-border: oklch(0.92 0.004 286.32);
38
+ --sidebar-ring: oklch(0.705 0.015 286.067);
27
39
  }
28
40
 
29
41
  .dark {
30
- --background: oklch(14.1% 0.004 286);
31
- --foreground: oklch(98.5% 0 none);
32
- --card: oklch(14.1% 0.004 286);
33
- --card-foreground: oklch(98.5% 0 none);
34
- --popover: oklch(14.1% 0.004 286);
35
- --popover-foreground: oklch(98.5% 0 none);
36
- --primary: oklch(98.5% 0 none);
37
- --primary-foreground: oklch(21% 0.006 286);
38
- --secondary: oklch(27.4% 0.005 286);
39
- --secondary-foreground: oklch(98.5% 0 none);
40
- --muted: oklch(27.4% 0.005 286);
41
- --muted-foreground: oklch(71.2% 0.013 286);
42
- --accent: oklch(27.4% 0.005 286);
43
- --accent-foreground: oklch(98.5% 0 none);
44
- --destructive: oklch(39.6% 0.133 25.7);
45
- --destructive-foreground: oklch(98.5% 0 none);
46
- --border: oklch(27.4% 0.005 286);
47
- --input: oklch(27.4% 0.005 286);
48
- --ring: oklch(87.1% 0.005 286);
49
- --chart-1: oklch(52.9% 0.193 262);
50
- --chart-2: oklch(69.8% 0.134 165);
51
- --chart-3: oklch(72.3% 0.15 60.6);
52
- --chart-4: oklch(61.9% 0.204 313);
53
- --chart-5: oklch(61.2% 0.209 6.39);
42
+ --background: oklch(0.141 0.005 285.823);
43
+ --foreground: oklch(0.985 0 0);
44
+ --card: oklch(0.21 0.006 285.885);
45
+ --card-foreground: oklch(0.985 0 0);
46
+ --popover: oklch(0.21 0.006 285.885);
47
+ --popover-foreground: oklch(0.985 0 0);
48
+ --primary: oklch(0.92 0.004 286.32);
49
+ --primary-foreground: oklch(0.21 0.006 285.885);
50
+ --secondary: oklch(0.274 0.006 286.033);
51
+ --secondary-foreground: oklch(0.985 0 0);
52
+ --muted: oklch(0.274 0.006 286.033);
53
+ --muted-foreground: oklch(0.705 0.015 286.067);
54
+ --accent: oklch(0.274 0.006 286.033);
55
+ --accent-foreground: oklch(0.985 0 0);
56
+ --destructive: oklch(0.704 0.191 22.216);
57
+ --border: oklch(1 0 0 / 10%);
58
+ --input: oklch(1 0 0 / 15%);
59
+ --ring: oklch(0.552 0.016 285.938);
60
+ --chart-1: oklch(0.488 0.243 264.376);
61
+ --chart-2: oklch(0.696 0.17 162.48);
62
+ --chart-3: oklch(0.769 0.188 70.08);
63
+ --chart-4: oklch(0.627 0.265 303.9);
64
+ --chart-5: oklch(0.645 0.246 16.439);
65
+ --sidebar: oklch(0.21 0.006 285.885);
66
+ --sidebar-foreground: oklch(0.985 0 0);
67
+ --sidebar-primary: oklch(0.488 0.243 264.376);
68
+ --sidebar-primary-foreground: oklch(0.985 0 0);
69
+ --sidebar-accent: oklch(0.274 0.006 286.033);
70
+ --sidebar-accent-foreground: oklch(0.985 0 0);
71
+ --sidebar-border: oklch(1 0 0 / 10%);
72
+ --sidebar-ring: oklch(0.552 0.016 285.938);
54
73
  }
@@ -5,10 +5,8 @@ import {
5
5
  type RouteObject,
6
6
  } from "react-router";
7
7
  import config from "virtual:zudoku-config";
8
- import "virtual:zudoku-theme.css";
9
8
  import "vite/modulepreload-polyfill";
10
9
  import { Bootstrap } from "zudoku/components";
11
- import "./main.css";
12
10
  import { getRoutesByConfig } from "./main.js";
13
11
 
14
12
  const routes = getRoutesByConfig(config);
@@ -10,12 +10,10 @@ import {
10
10
  isRouteErrorResponse,
11
11
  type RouteObject,
12
12
  } from "react-router";
13
- import "virtual:zudoku-theme.css";
14
13
  import "vite/modulepreload-polyfill";
15
14
  import { BootstrapStatic, ServerError } from "zudoku/components";
16
15
  import { NO_DEHYDRATE } from "../lib/components/cache.js";
17
16
  import type { PrerenderResponse } from "../vite/prerender/PrerenderResponse.js";
18
- import "./main.css";
19
17
  import { getRoutesByConfig } from "./main.js";
20
18
  export { getRoutesByConfig };
21
19
 
package/src/app/env.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import z from "zod";
1
2
  import { BuildConfigSchema } from "./ZuploBuildConfig.js";
2
3
 
3
4
  const getZuploBuildConfig = () => {
@@ -9,6 +10,13 @@ const getZuploBuildConfig = () => {
9
10
  );
10
11
  return zuploBuildConfig;
11
12
  } catch (error) {
13
+ if (error instanceof z.ZodError) {
14
+ // eslint-disable-next-line no-console
15
+ console.error("ZUPLO_BUILD_CONFIG is invalid.");
16
+ // eslint-disable-next-line no-console
17
+ console.log(error.errors);
18
+ return undefined;
19
+ }
12
20
  // eslint-disable-next-line no-console
13
21
  console.error(
14
22
  "ZUPLO_BUILD_CONFIG is a reserved environment variable and cannot be used for custom configuration. Please remove it from your environment variables.",
package/src/app/main.css CHANGED
@@ -1,5 +1,4 @@
1
- /* @vite-plugin-inject font */
2
- @import "./defaultTheme.css" layer(theme);
1
+ /* @vite-plugin-inject defaultTheme */
3
2
  @import "tailwindcss" source("..");
4
3
 
5
4
  /* @vite-plugin-inject main */
@@ -7,56 +6,6 @@
7
6
  @plugin "@tailwindcss/typography";
8
7
  @custom-variant dark (&:is(.dark *));
9
8
 
10
- @theme inline {
11
- --color-background: var(--background);
12
- --color-foreground: var(--foreground);
13
- --color-card: var(--card);
14
- --color-card-foreground: var(--card-foreground);
15
- --color-popover: var(--popover);
16
- --color-popover-foreground: var(--popover-foreground);
17
- --color-primary: var(--primary);
18
- --color-primary-foreground: var(--primary-foreground);
19
- --color-secondary: var(--secondary);
20
- --color-secondary-foreground: var(--secondary-foreground);
21
- --color-muted: var(--muted);
22
- --color-muted-foreground: var(--muted-foreground);
23
- --color-accent: var(--accent);
24
- --color-accent-foreground: var(--accent-foreground);
25
- --color-destructive: var(--destructive);
26
- --color-destructive-foreground: var(--destructive-foreground);
27
- --color-border: var(--border);
28
- --color-input: var(--input);
29
- --color-ring: var(--ring);
30
- --color-chart-1: var(--chart-1);
31
- --color-chart-2: var(--chart-2);
32
- --color-chart-3: var(--chart-3);
33
- --color-chart-4: var(--chart-4);
34
- --color-chart-5: var(--chart-5);
35
-
36
- --radius-sm: calc(var(--radius) - 4px);
37
- --radius-md: calc(var(--radius) - 2px);
38
- --radius-lg: var(--radius);
39
- --radius-xl: calc(var(--radius) + 4px);
40
-
41
- --shadow-2xs: var(--shadow-2xs);
42
- --shadow-xs: var(--shadow-xs);
43
- --shadow-sm: var(--shadow-sm);
44
- --shadow: var(--shadow);
45
- --shadow-md: var(--shadow-md);
46
- --shadow-lg: var(--shadow-lg);
47
- --shadow-xl: var(--shadow-xl);
48
- --shadow-2xl: var(--shadow-2xl);
49
-
50
- --color-sidebar: var(--sidebar);
51
- --color-sidebar-foreground: var(--sidebar-foreground);
52
- --color-sidebar-primary: var(--sidebar-primary);
53
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
54
- --color-sidebar-accent: var(--sidebar-accent);
55
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
56
- --color-sidebar-border: var(--sidebar-border);
57
- --color-sidebar-ring: var(--sidebar-ring);
58
- }
59
-
60
9
  @utility prose {
61
10
  a {
62
11
  @apply font-normal underline-offset-4 hover:text-primary;
package/src/app/main.tsx CHANGED
@@ -25,6 +25,7 @@ import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
25
25
  import { isNavigationPlugin } from "../lib/core/plugins.js";
26
26
  import { highlighter } from "../lib/shiki.js";
27
27
  import { ZuploEnv } from "./env.js";
28
+ import "./main.css";
28
29
 
29
30
  await registerShiki(highlighter);
30
31
 
@@ -14,7 +14,7 @@ describe("getIssuer", () => {
14
14
  };
15
15
 
16
16
  const result = await getIssuer(config);
17
- expect(result).toBe("tolerant-hornet-46.clerk.accounts.dev");
17
+ expect(result).toBe("https://tolerant-hornet-46.clerk.accounts.dev");
18
18
  });
19
19
 
20
20
  it("should throw error for invalid clerk public key format", async () => {
@@ -17,7 +17,7 @@ export const getIssuer = async (config: ZudokuConfig) => {
17
17
  const frontendApi = frontendApiParts.at(0);
18
18
  invariant(frontendApi, "Clerk public key is invalid");
19
19
 
20
- return frontendApi;
20
+ return `https://${frontendApi}`;
21
21
  }
22
22
  case "auth0": {
23
23
  return `https://${config.authentication.domain}/`;
@@ -34,5 +34,5 @@ export function CallbackHandler({
34
34
  },
35
35
  });
36
36
 
37
- return <Navigate to={executeCallback.data} />;
37
+ return <Navigate to={executeCallback.data} replace />;
38
38
  }
@@ -0,0 +1,51 @@
1
+ import { cva } from "class-variance-authority";
2
+ import type { PropsWithChildren } from "react";
3
+ import { cn } from "../util/cn.js";
4
+
5
+ const frameVariants = cva("", {
6
+ variants: {
7
+ size: {
8
+ sm: "max-w-sm",
9
+ md: "max-w-md",
10
+ lg: "max-w-lg",
11
+ xl: "max-w-xl",
12
+ "2xl": "max-w-2xl",
13
+ full: "max-w-full",
14
+ },
15
+ align: {
16
+ center: "mx-auto",
17
+ start: "me-auto",
18
+ end: "ms-auto",
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ size: "xl",
23
+ align: "center",
24
+ },
25
+ });
26
+
27
+ export const Framed = ({
28
+ caption,
29
+ className,
30
+ size = "xl",
31
+ align = "center",
32
+ children,
33
+ }: PropsWithChildren<{
34
+ caption?: string;
35
+ className?: string;
36
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
37
+ align?: "center" | "start" | "end";
38
+ }>) => (
39
+ <figure className={cn(frameVariants({ size, align }), className)}>
40
+ <div className="relative overflow-hidden rounded-lg border border-border bg-muted/50 p-1 shadow-sm">
41
+ <div className="not-prose rounded-md [&_img]:rounded-md! relative overflow-hidden bg-background">
42
+ {children}
43
+ </div>
44
+ </div>
45
+ {caption && (
46
+ <figcaption className="mt-3 text-center text-sm text-muted-foreground">
47
+ {caption}
48
+ </figcaption>
49
+ )}
50
+ </figure>
51
+ );
@@ -12,6 +12,7 @@ import { useZudoku } from "./context/ZudokuContext.js";
12
12
  import { PoweredByZudoku } from "./navigation/PoweredByZudoku.js";
13
13
  import { isHiddenItem } from "./navigation/utils.js";
14
14
  import { Search } from "./Search.js";
15
+ import { Slot } from "./Slot.js";
15
16
  import { ThemeSwitch } from "./ThemeSwitch.js";
16
17
  import { PageProgress, TopNavItem } from "./TopNavigation.js";
17
18
 
@@ -43,6 +44,9 @@ export const MobileTopNavigation = () => {
43
44
  </VisuallyHidden>
44
45
  <Search className="flex p-4" />
45
46
  <ul className="flex flex-col items-center gap-4 p-4">
47
+ <li className="empty:hidden">
48
+ <Slot.Target name="top-navigation-side" />
49
+ </li>
46
50
  <li>
47
51
  <ThemeSwitch />
48
52
  </li>
@@ -296,17 +296,20 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
296
296
  <Dialog>
297
297
  <DialogTrigger asChild>
298
298
  <Button
299
- size="icon"
300
299
  title="Roll this key"
301
300
  variant="ghost"
302
301
  disabled={rollKeyMutation.isPending}
303
- className={
304
- rollKeyMutation.isPending
305
- ? "animate-spin"
306
- : undefined
307
- }
302
+ className="flex items-center gap-1"
308
303
  >
309
- <RotateCwIcon size={16} />
304
+ <RotateCwIcon
305
+ size={16}
306
+ className={
307
+ rollKeyMutation.isPending
308
+ ? "animate-spin"
309
+ : undefined
310
+ }
311
+ />
312
+ Roll
310
313
  </Button>
311
314
  </DialogTrigger>
312
315
  <DialogContent>
@@ -473,7 +476,7 @@ const RevealApiKey = ({
473
476
  </div>
474
477
  </div>
475
478
  <div className="flex justify-end">
476
- {isExpired && onDeleteKey && (
479
+ {expiresOn && onDeleteKey && (
477
480
  <Dialog>
478
481
  <DialogTrigger asChild>
479
482
  <Button variant="ghost" size="icon">
@@ -47,7 +47,7 @@ export const SchemaView = ({
47
47
  <Card className="overflow-hidden">
48
48
  {cardHeader}
49
49
  <div className="text-sm text-muted-foreground italic p-4">
50
- No schema specified
50
+ No data returned
51
51
  </div>
52
52
  </Card>
53
53
  );
@@ -71,7 +71,7 @@ export const CodeBlock = ({
71
71
  aria-label="Copy code"
72
72
  title="Copy code"
73
73
  className={cn(
74
- "absolute top-2 end-2 p-2 hover:outline hover:outline-border/75 dark:hover:outline-border rounded-md text-sm text-muted-foreground transition",
74
+ "absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground",
75
75
  title && "top-10",
76
76
  showCopy === "hover" && "opacity-0 group-hover:opacity-100",
77
77
  showCopyText && "flex gap-2 items-center font-medium",
@@ -1,6 +1,7 @@
1
1
  import { type MDXComponents } from "mdx/types.js";
2
2
  import { CodeBlock } from "zudoku/ui/CodeBlock.js";
3
3
  import { AnchorLink } from "../components/AnchorLink.js";
4
+ import { Framed } from "../components/Framed.js";
4
5
  import { Heading } from "../components/Heading.js";
5
6
  import { InlineCode } from "../components/InlineCode.js";
6
7
  import { Button } from "../ui/Button.js";
@@ -14,10 +15,20 @@ export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
14
15
  export const MdxComponents = {
15
16
  img: ({ node, ...props }) => {
16
17
  if (/\.(mp4|webm|mov|avi)$/.test(props.src ?? "")) {
17
- return <video src={props.src} controls playsInline autoPlay loop />;
18
+ return (
19
+ <video
20
+ src={props.src}
21
+ controls
22
+ playsInline
23
+ autoPlay
24
+ loop
25
+ className={cn("rounded-lg", props.className)}
26
+ />
27
+ );
18
28
  }
19
- return <img {...props} className={cn("rounded-md", props.className)} />;
29
+ return <img {...props} className={cn("rounded-lg", props.className)} />;
20
30
  },
31
+ Framed,
21
32
  h1: ({ children, id }) => (
22
33
  <Heading level={1} id={id}>
23
34
  {children}
@@ -1,2 +0,0 @@
1
- import type { Plugin } from "vite";
2
- export declare const viteTailwindPlugin: () => Plugin;
@@ -1,38 +0,0 @@
1
- import path from "node:path";
2
- import { getCurrentConfig } from "../config/loader.js";
3
- // Font imports need to be at the very top of the file
4
- const FONT_REPLACE = "/* @vite-plugin-inject font */";
5
- const MAIN_REPLACE = "/* @vite-plugin-inject main */";
6
- export const viteTailwindPlugin = () => {
7
- return {
8
- name: "zudoku-configure-tailwind",
9
- enforce: "pre",
10
- transform(src, id) {
11
- if (!id.endsWith("/src/app/main.css"))
12
- return;
13
- const config = getCurrentConfig();
14
- const files = new Set([config.__meta.rootDir, ...config.__meta.dependencies].map((file) => path.relative(path.dirname(id), file)));
15
- const code = [...files].map((file) => `@source "${file}";`);
16
- const fontImports = [];
17
- code.push("@theme {");
18
- if (config.theme?.fonts?.sans) {
19
- fontImports.push(`@import url('${config.theme.fonts.sans.url}');`);
20
- code.push(` --font-sans: ${config.theme.fonts.sans.fontFamily}, sans-serif;`);
21
- }
22
- else {
23
- fontImports.push("@import url('./font.geist.css');");
24
- code.push(" --font-sans: Geist, sans-serif;");
25
- code.push(' --font-display--font-feature-settings: "rlig" 1, "calt" 0;');
26
- }
27
- if (config.theme?.fonts?.mono) {
28
- fontImports.push(`@import url('${config.theme.fonts.mono.url}');`);
29
- code.push(` --font-mono: ${config.theme.fonts.mono.fontFamily}, monospace;`);
30
- }
31
- code.push("}");
32
- return src
33
- .replace(FONT_REPLACE, fontImports.join("\n"))
34
- .replace(MAIN_REPLACE, code.join("\n"));
35
- },
36
- };
37
- };
38
- //# sourceMappingURL=plugin-configure-tailwind.js.map
@@ -1 +0,0 @@
1
- {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B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,eAAe,CACpE,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;gBACrD,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;gBAC/C,IAAI,CAAC,IAAI,CACP,8DAA8D,CAC/D,CAAC;YACJ,CAAC;YAED,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;gBAC9B,WAAW,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;gBACnE,IAAI,CAAC,IAAI,CACP,kBAAkB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,cAAc,CACnE,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEf,OAAO,GAAG;iBACP,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAC7C,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type Plugin } from "vite";
2
- declare const THEME_VARIABLES: readonly ["background", "foreground", "card", "cardForeground", "popover", "popoverForeground", "primary", "primaryForeground", "secondary", "secondaryForeground", "muted", "mutedForeground", "accent", "accentForeground", "destructive", "destructiveForeground", "border", "input", "ring", "radius"];
3
- export type Theme = Partial<Record<(typeof THEME_VARIABLES)[number], string>>;
4
- export declare const viteThemeCss: () => Plugin;
5
- export {};
@@ -1,77 +0,0 @@
1
- import Color from "colorjs.io";
2
- import { getCurrentConfig } from "../config/loader.js";
3
- import { objectEntries } from "../lib/util/objectEntries.js";
4
- const THEME_VARIABLES = [
5
- "background",
6
- "foreground",
7
- "card",
8
- "cardForeground",
9
- "popover",
10
- "popoverForeground",
11
- "primary",
12
- "primaryForeground",
13
- "secondary",
14
- "secondaryForeground",
15
- "muted",
16
- "mutedForeground",
17
- "accent",
18
- "accentForeground",
19
- "destructive",
20
- "destructiveForeground",
21
- "border",
22
- "input",
23
- "ring",
24
- "radius",
25
- ];
26
- const uncamelize = (str) => str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
27
- const processColorValue = (value) => {
28
- if (!value)
29
- return "";
30
- const c = !value.startsWith("#") &&
31
- !value.includes("(") &&
32
- value.split(" ").length >= 3
33
- ? // Assume legacy tailwind hsl format
34
- `hsl(${value})`
35
- : value;
36
- try {
37
- return new Color(c).to("oklch").toString();
38
- }
39
- catch (e) {
40
- // eslint-disable-next-line no-console
41
- console.error("Invalid color value:", value, e);
42
- return value;
43
- }
44
- };
45
- const generateCss = (theme) => objectEntries(theme)
46
- .filter(([key]) => THEME_VARIABLES.includes(key))
47
- .map(([key, value]) => {
48
- const processedValue = processColorValue(value);
49
- return `--${uncamelize(key)}: ${processedValue};`;
50
- })
51
- .join("\n");
52
- export const viteThemeCss = () => {
53
- const virtualModuleId = "virtual:zudoku-theme.css";
54
- const resolvedVirtualModuleId = "\0" + virtualModuleId;
55
- return {
56
- name: "zudoku-theme",
57
- resolveId(id) {
58
- if (id === virtualModuleId) {
59
- return resolvedVirtualModuleId;
60
- }
61
- },
62
- load(id) {
63
- if (id !== resolvedVirtualModuleId)
64
- return;
65
- const config = getCurrentConfig();
66
- const cssParts = [];
67
- if (config.theme?.light) {
68
- cssParts.push(`:root {\n${generateCss(config.theme.light)}\n}`);
69
- }
70
- if (config.theme?.dark) {
71
- cssParts.push(`.dark {\n${generateCss(config.theme.dark)}\n}`);
72
- }
73
- return cssParts.join("\n");
74
- },
75
- };
76
- };
77
- //# sourceMappingURL=plugin-theme-css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-theme-css.js","sourceRo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