zudoku 0.3.0-dev.58 → 0.3.0-dev.59

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 (199) hide show
  1. package/dist/app/entry.client.js +1 -1
  2. package/dist/app/entry.client.js.map +1 -1
  3. package/dist/app/entry.server.d.ts +2 -0
  4. package/dist/app/entry.server.js +1 -0
  5. package/dist/app/entry.server.js.map +1 -1
  6. package/dist/app/main.js +8 -2
  7. package/dist/app/main.js.map +1 -1
  8. package/dist/config/validators/validate.d.ts +121 -102
  9. package/dist/config/validators/validate.js +4 -0
  10. package/dist/config/validators/validate.js.map +1 -1
  11. package/dist/lib/authentication/AuthenticationPlugin.d.ts +16 -0
  12. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  13. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  14. package/dist/lib/authentication/authentication.d.ts +3 -4
  15. package/dist/lib/authentication/components/Login.d.ts +1 -0
  16. package/dist/lib/authentication/components/Login.js +10 -0
  17. package/dist/lib/authentication/components/Login.js.map +1 -0
  18. package/dist/lib/authentication/components/Logout.d.ts +1 -0
  19. package/dist/lib/authentication/components/Logout.js +10 -0
  20. package/dist/lib/authentication/components/Logout.js.map +1 -0
  21. package/dist/lib/authentication/providers/clerk.js +43 -27
  22. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  23. package/dist/lib/authentication/providers/openid.d.ts +11 -3
  24. package/dist/lib/authentication/providers/openid.js +22 -11
  25. package/dist/lib/authentication/providers/openid.js.map +1 -1
  26. package/dist/lib/authentication/routes.d.ts +5 -0
  27. package/dist/lib/authentication/routes.js +12 -0
  28. package/dist/lib/authentication/routes.js.map +1 -0
  29. package/dist/lib/components/Bootstrap.d.ts +2 -1
  30. package/dist/lib/components/Bootstrap.js +4 -1
  31. package/dist/lib/components/Bootstrap.js.map +1 -1
  32. package/dist/lib/components/DevPortal.js +14 -2
  33. package/dist/lib/components/DevPortal.js.map +1 -1
  34. package/dist/lib/components/Header.js +16 -3
  35. package/dist/lib/components/Header.js.map +1 -1
  36. package/dist/lib/components/InlineCode.js +1 -1
  37. package/dist/lib/components/InlineCode.js.map +1 -1
  38. package/dist/lib/components/TopNavigation.js +1 -1
  39. package/dist/lib/components/TopNavigation.js.map +1 -1
  40. package/dist/lib/components/context/DevPortalProvider.js +18 -1
  41. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  42. package/dist/lib/components/index.d.ts +5 -1
  43. package/dist/lib/components/index.js +4 -0
  44. package/dist/lib/components/index.js.map +1 -1
  45. package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
  46. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  47. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  48. package/dist/lib/core/DevPortalContext.js.map +1 -1
  49. package/dist/lib/core/plugins.d.ts +10 -1
  50. package/dist/lib/core/plugins.js +1 -0
  51. package/dist/lib/core/plugins.js.map +1 -1
  52. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  53. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  54. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +2 -2
  55. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  56. package/dist/lib/plugins/api-keys/index.d.ts +2 -2
  57. package/dist/lib/plugins/api-keys/index.js +6 -0
  58. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  59. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  60. package/dist/lib/plugins/custom-page/index.js +12 -0
  61. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  62. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  63. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  64. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  65. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  66. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  67. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  68. package/dist/lib/plugins/openapi/SchemaListViewItem.js +3 -3
  69. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -1
  70. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  71. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  72. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +3 -0
  73. package/dist/lib/plugins/openapi/StaggeredRender.js +10 -5
  74. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -1
  75. package/dist/lib/plugins/openapi/playground/Playground.js +2 -2
  76. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  77. package/dist/lib/ui/Card.js +1 -1
  78. package/dist/lib/ui/Card.js.map +1 -1
  79. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  80. package/dist/lib/ui/DropdownMenu.js +36 -0
  81. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  82. package/dist/lib/ui/button-variants.d.ts +2 -2
  83. package/dist/lib/ui/button-variants.js +1 -0
  84. package/dist/lib/ui/button-variants.js.map +1 -1
  85. package/dist/lib/util/MdxComponents.js +1 -1
  86. package/dist/lib/util/MdxComponents.js.map +1 -1
  87. package/dist/lib/util/joinPath.js +2 -1
  88. package/dist/lib/util/joinPath.js.map +1 -1
  89. package/dist/vite/build.js +5 -2
  90. package/dist/vite/build.js.map +1 -1
  91. package/dist/vite/config.d.ts +8 -1
  92. package/dist/vite/config.js +13 -6
  93. package/dist/vite/config.js.map +1 -1
  94. package/dist/vite/plugin-component.js +1 -0
  95. package/dist/vite/plugin-component.js.map +1 -1
  96. package/dist/vite/prerender.d.ts +1 -1
  97. package/dist/vite/prerender.js +23 -3
  98. package/dist/vite/prerender.js.map +1 -1
  99. package/lib/{AnchorLink-B4IgsA83.js → AnchorLink-Bj1hwDuD.js} +3 -3
  100. package/lib/{AnchorLink-B4IgsA83.js.map → AnchorLink-Bj1hwDuD.js.map} +1 -1
  101. package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
  102. package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
  103. package/lib/CategoryHeading-DMkTmmBh.js +10 -0
  104. package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
  105. package/lib/Combination-lAFQBd6U.js +2774 -0
  106. package/lib/Combination-lAFQBd6U.js.map +1 -0
  107. package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
  108. package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
  109. package/lib/{Markdown-DQrAhTkw.js → Markdown-BjRJKl_E.js} +1376 -1379
  110. package/lib/Markdown-BjRJKl_E.js.map +1 -0
  111. package/lib/{MdxPage-DMP-pM_g.js → MdxPage-DJTFOCbZ.js} +17 -17
  112. package/lib/{MdxPage-DMP-pM_g.js.map → MdxPage-DJTFOCbZ.js.map} +1 -1
  113. package/lib/OperationList-DDTtK3I7.js +5403 -0
  114. package/lib/OperationList-DDTtK3I7.js.map +1 -0
  115. package/lib/{Route-C1LyvITr.js → Route-Bsrd0acQ.js} +2 -2
  116. package/lib/{Route-C1LyvITr.js.map → Route-Bsrd0acQ.js.map} +1 -1
  117. package/lib/Select-CEnkyfyn.js +2223 -0
  118. package/lib/Select-CEnkyfyn.js.map +1 -0
  119. package/lib/Spinner-Ciq_pWU7.js +359 -0
  120. package/lib/Spinner-Ciq_pWU7.js.map +1 -0
  121. package/lib/{hook-CrQMC_eg.js → hook-Q_gAL2NZ.js} +20 -19
  122. package/lib/{hook-CrQMC_eg.js.map → hook-Q_gAL2NZ.js.map} +1 -1
  123. package/lib/{index-tOwoT-uJ.js → index-BE2a6gGC.js} +24 -23
  124. package/lib/{index-tOwoT-uJ.js.map → index-BE2a6gGC.js.map} +1 -1
  125. package/lib/{jsx-runtime-CJZJivg2.js → jsx-runtime-BIr0WBt_.js} +119 -119
  126. package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
  127. package/lib/{router-CBw2vqJE.js → router-BiRCp01d.js} +671 -673
  128. package/lib/router-BiRCp01d.js.map +1 -0
  129. package/lib/zudoku.auth-clerk.js +47 -32
  130. package/lib/zudoku.auth-clerk.js.map +1 -1
  131. package/lib/zudoku.auth-openid.js +170 -159
  132. package/lib/zudoku.auth-openid.js.map +1 -1
  133. package/lib/zudoku.components.js +1494 -591
  134. package/lib/zudoku.components.js.map +1 -1
  135. package/lib/zudoku.plugin-api-keys.js +31 -25
  136. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  137. package/lib/zudoku.plugin-custom-page.js +13 -0
  138. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  139. package/lib/zudoku.plugin-markdown.js +19 -20
  140. package/lib/zudoku.plugin-markdown.js.map +1 -1
  141. package/lib/zudoku.plugin-openapi.js +4 -4
  142. package/lib/zudoku.plugin-redirect.js +3 -3
  143. package/package.json +29 -14
  144. package/src/app/entry.client.tsx +1 -1
  145. package/src/app/entry.server.tsx +2 -0
  146. package/src/app/main.css +6 -0
  147. package/src/app/main.tsx +8 -2
  148. package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
  149. package/src/lib/authentication/authentication.ts +3 -4
  150. package/src/lib/authentication/components/Login.tsx +11 -0
  151. package/src/lib/authentication/components/Logout.tsx +11 -0
  152. package/src/lib/authentication/providers/clerk.tsx +43 -27
  153. package/src/lib/authentication/providers/openid.tsx +25 -13
  154. package/src/lib/authentication/routes.tsx +10 -0
  155. package/src/lib/components/Bootstrap.tsx +14 -7
  156. package/src/lib/components/DevPortal.tsx +29 -9
  157. package/src/lib/components/Header.tsx +63 -24
  158. package/src/lib/components/InlineCode.tsx +1 -1
  159. package/src/lib/components/TopNavigation.tsx +1 -1
  160. package/src/lib/components/context/DevPortalProvider.ts +22 -2
  161. package/src/lib/components/index.ts +4 -0
  162. package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
  163. package/src/lib/core/DevPortalContext.ts +1 -1
  164. package/src/lib/core/plugins.ts +16 -0
  165. package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
  166. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +4 -4
  167. package/src/lib/plugins/api-keys/index.tsx +8 -1
  168. package/src/lib/plugins/custom-page/index.tsx +22 -0
  169. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  170. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -4
  171. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  172. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +3 -3
  173. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  174. package/src/lib/plugins/openapi/StaggeredRender.tsx +19 -5
  175. package/src/lib/plugins/openapi/playground/Playground.tsx +2 -2
  176. package/src/lib/ui/Card.tsx +1 -1
  177. package/src/lib/ui/DropdownMenu.tsx +199 -0
  178. package/src/lib/ui/button-variants.ts +1 -0
  179. package/src/lib/util/MdxComponents.tsx +1 -1
  180. package/src/lib/util/joinPath.tsx +2 -1
  181. package/dist/app/zudoku-manifest.d.ts +0 -1
  182. package/dist/app/zudoku-manifest.js +0 -20
  183. package/dist/app/zudoku-manifest.js.map +0 -1
  184. package/lib/Button-CnuhSW99.js +0 -4571
  185. package/lib/Button-CnuhSW99.js.map +0 -1
  186. package/lib/DevPortalProvider-Do9oJqme.js +0 -1081
  187. package/lib/DevPortalProvider-Do9oJqme.js.map +0 -1
  188. package/lib/Markdown-DQrAhTkw.js.map +0 -1
  189. package/lib/OperationList-Dw2SadHL.js +0 -5578
  190. package/lib/OperationList-Dw2SadHL.js.map +0 -1
  191. package/lib/Spinner-BuBOzK_8.js +0 -182
  192. package/lib/Spinner-BuBOzK_8.js.map +0 -1
  193. package/lib/index-gsAuUwQh.js +0 -418
  194. package/lib/index-gsAuUwQh.js.map +0 -1
  195. package/lib/jsx-runtime-CJZJivg2.js.map +0 -1
  196. package/lib/router-CBw2vqJE.js.map +0 -1
  197. package/lib/util-_jwUlTBU.js +0 -41
  198. package/lib/util-_jwUlTBU.js.map +0 -1
  199. package/src/app/zudoku-manifest.ts +0 -22
@@ -4,6 +4,7 @@ import { DevPortalContext } from "../../core/DevPortalContext.js";
4
4
  import {
5
5
  type ApiIdentityPlugin,
6
6
  type DevPortalPlugin,
7
+ ProfileMenuPlugin,
7
8
  } from "../../core/plugins.js";
8
9
  import { RouterError } from "../../errors/RouterError.js";
9
10
  import { CreateApiKey } from "./CreateApiKey.js";
@@ -82,7 +83,7 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
82
83
 
83
84
  export const apiKeyPlugin = (
84
85
  options: ApiKeyPluginOptions,
85
- ): DevPortalPlugin & ApiIdentityPlugin => {
86
+ ): DevPortalPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {
86
87
  const endpoint =
87
88
  "endpoint" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;
88
89
 
@@ -90,6 +91,12 @@ export const apiKeyPlugin = (
90
91
  "getKeys" in options ? options : createDefaultHandler(endpoint);
91
92
 
92
93
  return {
94
+ getProfileMenuItems: () => [
95
+ {
96
+ label: "API Keys",
97
+ path: "/settings/api-keys",
98
+ },
99
+ ],
93
100
  getIdentities: async (context) => {
94
101
  try {
95
102
  const keys = await service.getKeys(context);
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ import type { RouteObject } from "react-router-dom";
3
+ import { ProseClasses } from "../../components/Markdown.js";
4
+ import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
5
+
6
+ type CustomPageConfig = Array<{
7
+ path: string;
8
+ element: ReactNode;
9
+ }>;
10
+
11
+ export const customPagePlugin = (
12
+ config: CustomPageConfig,
13
+ ): DevPortalPlugin & NavigationPlugin => {
14
+ return {
15
+ getRoutes: (): RouteObject[] =>
16
+ config.map(({ path, element }) => ({
17
+ path,
18
+ // TODO: we should componentize prose pages
19
+ element: <div className={ProseClasses + " max-w-full"}>{element}</div>,
20
+ })),
21
+ };
22
+ };
@@ -122,7 +122,7 @@ export const MdxPage = ({
122
122
  {prev.path ? (
123
123
  <Link
124
124
  to={prev.path}
125
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
125
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
126
126
  title={
127
127
  typeof prev.label === "string" ? prev.label : undefined
128
128
  }
@@ -140,7 +140,7 @@ export const MdxPage = ({
140
140
  {next.path ? (
141
141
  <Link
142
142
  to={next.path}
143
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
143
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
144
144
  title={
145
145
  typeof next.label === "string" ? next.label : undefined
146
146
  }
@@ -66,10 +66,7 @@ export const OperationListItem = ({
66
66
  ))}
67
67
  {operation.responses.length > 0 && (
68
68
  <>
69
- <Heading
70
- level={3}
71
- className="capitalize mt-8 pt-8 border-border border-t"
72
- >
69
+ <Heading level={3} className="capitalize mt-8 pt-8 border-t">
73
70
  Responses
74
71
  </Heading>
75
72
  <Tabs defaultValue={`${first?.statusCode}${first?.description}`}>
@@ -18,7 +18,7 @@ export const ParameterList = ({
18
18
  <Heading level={3} id={`${id}/${group}-parameters`} className="capitalize">
19
19
  {group === "header" ? "Headers" : `${group} Parameters`}
20
20
  </Heading>
21
- <ul className="list-none m-0 px-0 overflow-hidden border border-border divide-y divide-border rounded">
21
+ <ul className="list-none m-0 px-0 overflow-hidden border divide-y divide-border rounded">
22
22
  {parameters.map((parameter) => (
23
23
  <ParameterListItem
24
24
  key={`${parameter.name}-${parameter.in}`}
@@ -37,7 +37,7 @@ export const SchemaListViewItem = ({
37
37
  <span className="text-muted-foreground">Deprecated</span>
38
38
  )}
39
39
  {!isRequired && (
40
- <span className="py-px px-1.5 font-medium border border-border rounded-lg">
40
+ <span className="py-px px-1.5 font-medium border rounded-lg">
41
41
  optional {property.required}
42
42
  </span>
43
43
  )}
@@ -57,14 +57,14 @@ export const SchemaListViewItem = ({
57
57
  .map((value) => (
58
58
  <span
59
59
  key={value}
60
- className="font-mono text-xs border-border border bg-muted rounded px-1"
60
+ className="font-mono text-xs border bg-muted rounded px-1"
61
61
  >
62
62
  {value}
63
63
  </span>
64
64
  ))
65
65
  .slice(0, 4)}
66
66
  {property.enum.length > 4 && (
67
- <span className="font-mono text-xs border-border border bg-muted rounded px-1">
67
+ <span className="font-mono text-xs border bg-muted rounded px-1">
68
68
  ...
69
69
  </span>
70
70
  )}
@@ -8,7 +8,7 @@ type BaseComponentProps<T = unknown> = PropsWithChildren<
8
8
  export const Root = ({ children, className }: BaseComponentProps) => (
9
9
  <div
10
10
  className={cn(
11
- "rounded-lg overflow-hidden border border-border dark:border-transparent",
11
+ "rounded-lg overflow-hidden border dark:border-transparent",
12
12
  className,
13
13
  )}
14
14
  >
@@ -1,17 +1,31 @@
1
- import { Children, ReactNode, useEffect, useState } from "react";
1
+ import {
2
+ Children,
3
+ createContext,
4
+ ReactNode,
5
+ useContext,
6
+ useEffect,
7
+ useState,
8
+ } from "react";
9
+
10
+ export const StaggeredRenderContext = createContext({ stagger: false });
2
11
 
3
12
  const StaggeredRender = ({ children }: { children: ReactNode[] }) => {
4
- const [isMounted, setIsMounted] = useState(typeof window === "undefined");
13
+ const { stagger } = useContext(StaggeredRenderContext);
14
+ const [renderAll, setRenderAll] = useState(!stagger);
5
15
 
6
16
  useEffect(() => {
17
+ if (renderAll) {
18
+ return;
19
+ }
20
+
7
21
  const x = window.requestIdleCallback(() => {
8
- setIsMounted(true);
22
+ setRenderAll(true);
9
23
  });
10
24
 
11
25
  return () => window.cancelIdleCallback(x);
12
- }, []);
26
+ }, [renderAll]);
13
27
 
14
- return !isMounted ? Children.toArray(children).slice(0, 3) : children;
28
+ return !renderAll ? Children.toArray(children).slice(0, 3) : children;
15
29
  };
16
30
 
17
31
  export default StaggeredRender;
@@ -194,7 +194,7 @@ export const Playground = ({
194
194
  <div className="flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto">
195
195
  <div className="flex gap-2 items-stretch">
196
196
  <div className="flex flex-1 items-center w-full border rounded-md border-border">
197
- <div className="border-r border-border p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono">
197
+ <div className="border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono">
198
198
  {method.toUpperCase()}
199
199
  </div>
200
200
  <div className="p-2 font-mono text-xs">
@@ -269,7 +269,7 @@ export const Playground = ({
269
269
  <TabsContent value="body">
270
270
  <textarea
271
271
  {...register("body")}
272
- className="border border-border w-full rounded p-2 bg-muted h-40"
272
+ className="border w-full rounded p-2 bg-muted h-40"
273
273
  />
274
274
  </TabsContent>
275
275
  </Tabs>
@@ -8,7 +8,7 @@ const Card = React.forwardRef<
8
8
  <div
9
9
  ref={ref}
10
10
  className={cn(
11
- "rounded-xl border border-border bg-card text-card-foreground shadow",
11
+ "rounded-xl border bg-card text-card-foreground shadow",
12
12
  className,
13
13
  )}
14
14
  {...props}
@@ -0,0 +1,199 @@
1
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
2
+
3
+ import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
4
+ import * as React from "react";
5
+ import { cn } from "../util/cn.js";
6
+
7
+ const DropdownMenu = DropdownMenuPrimitive.Root;
8
+
9
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
10
+
11
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
12
+
13
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
14
+
15
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
16
+
17
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
18
+
19
+ const DropdownMenuSubTrigger = React.forwardRef<
20
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
+ inset?: boolean;
23
+ }
24
+ >(({ className, inset, children, ...props }, ref) => (
25
+ <DropdownMenuPrimitive.SubTrigger
26
+ ref={ref}
27
+ className={cn(
28
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
29
+ inset && "pl-8",
30
+ className,
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronRightIcon className="ml-auto h-4 w-4" />
36
+ </DropdownMenuPrimitive.SubTrigger>
37
+ ));
38
+ DropdownMenuSubTrigger.displayName =
39
+ DropdownMenuPrimitive.SubTrigger.displayName;
40
+
41
+ const DropdownMenuSubContent = React.forwardRef<
42
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
+ >(({ className, ...props }, ref) => (
45
+ <DropdownMenuPrimitive.SubContent
46
+ ref={ref}
47
+ className={cn(
48
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
49
+ className,
50
+ )}
51
+ {...props}
52
+ />
53
+ ));
54
+ DropdownMenuSubContent.displayName =
55
+ DropdownMenuPrimitive.SubContent.displayName;
56
+
57
+ const DropdownMenuContent = React.forwardRef<
58
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
+ >(({ className, sideOffset = 4, ...props }, ref) => (
61
+ <DropdownMenuPrimitive.Portal>
62
+ <DropdownMenuPrimitive.Content
63
+ ref={ref}
64
+ sideOffset={sideOffset}
65
+ className={cn(
66
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
67
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
68
+ className,
69
+ )}
70
+ {...props}
71
+ />
72
+ </DropdownMenuPrimitive.Portal>
73
+ ));
74
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
75
+
76
+ const DropdownMenuItem = React.forwardRef<
77
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
78
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
79
+ inset?: boolean;
80
+ }
81
+ >(({ className, inset, ...props }, ref) => (
82
+ <DropdownMenuPrimitive.Item
83
+ ref={ref}
84
+ className={cn(
85
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
86
+ inset && "pl-8",
87
+ className,
88
+ )}
89
+ {...props}
90
+ />
91
+ ));
92
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
93
+
94
+ const DropdownMenuCheckboxItem = React.forwardRef<
95
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
96
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
97
+ >(({ className, children, checked, ...props }, ref) => (
98
+ <DropdownMenuPrimitive.CheckboxItem
99
+ ref={ref}
100
+ className={cn(
101
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
102
+ className,
103
+ )}
104
+ checked={checked}
105
+ {...props}
106
+ >
107
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
108
+ <DropdownMenuPrimitive.ItemIndicator>
109
+ <CheckIcon className="h-4 w-4" />
110
+ </DropdownMenuPrimitive.ItemIndicator>
111
+ </span>
112
+ {children}
113
+ </DropdownMenuPrimitive.CheckboxItem>
114
+ ));
115
+ DropdownMenuCheckboxItem.displayName =
116
+ DropdownMenuPrimitive.CheckboxItem.displayName;
117
+
118
+ const DropdownMenuRadioItem = React.forwardRef<
119
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
120
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
121
+ >(({ className, children, ...props }, ref) => (
122
+ <DropdownMenuPrimitive.RadioItem
123
+ ref={ref}
124
+ className={cn(
125
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
126
+ className,
127
+ )}
128
+ {...props}
129
+ >
130
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
131
+ <DropdownMenuPrimitive.ItemIndicator>
132
+ <DotIcon className="h-4 w-4 fill-current" />
133
+ </DropdownMenuPrimitive.ItemIndicator>
134
+ </span>
135
+ {children}
136
+ </DropdownMenuPrimitive.RadioItem>
137
+ ));
138
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
139
+
140
+ const DropdownMenuLabel = React.forwardRef<
141
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
142
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
143
+ inset?: boolean;
144
+ }
145
+ >(({ className, inset, ...props }, ref) => (
146
+ <DropdownMenuPrimitive.Label
147
+ ref={ref}
148
+ className={cn(
149
+ "px-2 py-1.5 text-sm font-semibold",
150
+ inset && "pl-8",
151
+ className,
152
+ )}
153
+ {...props}
154
+ />
155
+ ));
156
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
157
+
158
+ const DropdownMenuSeparator = React.forwardRef<
159
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
160
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
161
+ >(({ className, ...props }, ref) => (
162
+ <DropdownMenuPrimitive.Separator
163
+ ref={ref}
164
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
165
+ {...props}
166
+ />
167
+ ));
168
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
169
+
170
+ const DropdownMenuShortcut = ({
171
+ className,
172
+ ...props
173
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
174
+ return (
175
+ <span
176
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
177
+ {...props}
178
+ />
179
+ );
180
+ };
181
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
182
+
183
+ export {
184
+ DropdownMenu,
185
+ DropdownMenuCheckboxItem,
186
+ DropdownMenuContent,
187
+ DropdownMenuGroup,
188
+ DropdownMenuItem,
189
+ DropdownMenuLabel,
190
+ DropdownMenuPortal,
191
+ DropdownMenuRadioGroup,
192
+ DropdownMenuRadioItem,
193
+ DropdownMenuSeparator,
194
+ DropdownMenuShortcut,
195
+ DropdownMenuSub,
196
+ DropdownMenuSubContent,
197
+ DropdownMenuSubTrigger,
198
+ DropdownMenuTrigger,
199
+ };
@@ -20,6 +20,7 @@ export const buttonVariants = cva(
20
20
  default: "h-9 px-4 py-2",
21
21
  sm: "h-8 rounded-md px-3 text-xs",
22
22
  lg: "h-10 rounded-md px-8",
23
+ xl: "h-14 rounded-lg px-10 text-lg",
23
24
  icon: "h-9 w-9",
24
25
  },
25
26
  },
@@ -75,7 +75,7 @@ export const MdxComponents = {
75
75
  return (
76
76
  <SyntaxHighlight
77
77
  language={match?.[1] ?? "markup"}
78
- className="rounded-xl overflow-x-auto p-4 border border-border dark:!bg-foreground/10 dark:border-transparent"
78
+ className="rounded-xl overflow-x-auto p-4 border dark:!bg-foreground/10 dark:border-transparent"
79
79
  showLanguageIndicator
80
80
  code={String(children).trim()}
81
81
  />
@@ -4,7 +4,8 @@ export const joinPath = (
4
4
  const cleanPath = parts
5
5
  .filter((part): part is string => Boolean(part))
6
6
  .map((part) => part.replace(/(^\/+|\/+$)/g, "")) // Strip leading and trailing slashes
7
- .join("/");
7
+ .join("/")
8
+ .replace(/(^\/+|\/+$)/g, "");
8
9
 
9
10
  return cleanPath ? `/${cleanPath}` : "";
10
11
  };
@@ -1 +0,0 @@
1
- export declare const paths: string[];
@@ -1,20 +0,0 @@
1
- import config from "virtual:zudoku-config";
2
- import { getRoutesByConfig } from "./main.js";
3
- const routes = getRoutesByConfig(config);
4
- const flattenPaths = (routes, basePath = "") => {
5
- return routes.reduce((acc, route) => {
6
- if (route.path) {
7
- const fullPath = `${basePath}/${route.path}`.replace(/\/+/g, "/");
8
- route.path !== "/" && acc.push(fullPath);
9
- if (route.children) {
10
- acc = acc.concat(flattenPaths(route.children, fullPath));
11
- }
12
- }
13
- else if (route.children) {
14
- acc = acc.concat(flattenPaths(route.children, basePath));
15
- }
16
- return acc;
17
- }, []);
18
- };
19
- export const paths = flattenPaths(routes);
20
- //# sourceMappingURL=zudoku-manifest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zudoku-manifest.js","sourceRoot":"","sources":["../../src/app/zudoku-manifest.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAE,QAAQ,GAAG,EAAE,EAAE,EAAE;IAC5D,OAAO,MAAM,CAAC,MAAM,CAAW,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5C,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,GAAG,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAClE,KAAK,CAAC,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACnB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC"}