zudoku 0.3.0-dev.57 → 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.
- package/dist/app/entry.client.js +1 -1
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +2 -0
- package/dist/app/entry.server.js +1 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +8 -2
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/validate.d.ts +121 -102
- package/dist/config/validators/validate.js +4 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +16 -0
- package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
- package/dist/lib/authentication/authentication.d.ts +3 -4
- package/dist/lib/authentication/components/Login.d.ts +1 -0
- package/dist/lib/authentication/components/Login.js +10 -0
- package/dist/lib/authentication/components/Login.js.map +1 -0
- package/dist/lib/authentication/components/Logout.d.ts +1 -0
- package/dist/lib/authentication/components/Logout.js +10 -0
- package/dist/lib/authentication/components/Logout.js.map +1 -0
- package/dist/lib/authentication/providers/clerk.js +43 -27
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +11 -3
- package/dist/lib/authentication/providers/openid.js +22 -11
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/routes.d.ts +5 -0
- package/dist/lib/authentication/routes.js +12 -0
- package/dist/lib/authentication/routes.js.map +1 -0
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +4 -1
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/DevPortal.js +14 -2
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js +16 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/InlineCode.js +1 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +18 -1
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +5 -1
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +1 -1
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +10 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +2 -2
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +2 -2
- package/dist/lib/plugins/api-keys/index.js +6 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-page/index.d.ts +8 -0
- package/dist/lib/plugins/custom-page/index.js +12 -0
- package/dist/lib/plugins/custom-page/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +3 -3
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/StaggeredRender.d.ts +3 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js +10 -5
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Card.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +27 -0
- package/dist/lib/ui/DropdownMenu.js +36 -0
- package/dist/lib/ui/DropdownMenu.js.map +1 -0
- package/dist/lib/ui/button-variants.d.ts +2 -2
- package/dist/lib/ui/button-variants.js +1 -0
- package/dist/lib/ui/button-variants.js.map +1 -1
- package/dist/lib/util/MdxComponents.js +1 -1
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.js +2 -1
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/vite/build.js +5 -2
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +8 -1
- package/dist/vite/config.js +13 -6
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -0
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/prerender.d.ts +1 -1
- package/dist/vite/prerender.js +23 -3
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{AnchorLink-GNsUeGSX.js → AnchorLink-Bj1hwDuD.js} +3 -3
- package/lib/{AnchorLink-GNsUeGSX.js.map → AnchorLink-Bj1hwDuD.js.map} +1 -1
- package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
- package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
- package/lib/CategoryHeading-DMkTmmBh.js +10 -0
- package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
- package/lib/Combination-lAFQBd6U.js +2774 -0
- package/lib/Combination-lAFQBd6U.js.map +1 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
- package/lib/{Markdown-DtLFdxD1.js → Markdown-BjRJKl_E.js} +1376 -1379
- package/lib/Markdown-BjRJKl_E.js.map +1 -0
- package/lib/{MdxPage-CbwYRKf5.js → MdxPage-DJTFOCbZ.js} +17 -17
- package/lib/{MdxPage-CbwYRKf5.js.map → MdxPage-DJTFOCbZ.js.map} +1 -1
- package/lib/OperationList-DDTtK3I7.js +5403 -0
- package/lib/OperationList-DDTtK3I7.js.map +1 -0
- package/lib/{Route-C1LyvITr.js → Route-Bsrd0acQ.js} +2 -2
- package/lib/{Route-C1LyvITr.js.map → Route-Bsrd0acQ.js.map} +1 -1
- package/lib/Select-CEnkyfyn.js +2223 -0
- package/lib/Select-CEnkyfyn.js.map +1 -0
- package/lib/Spinner-Ciq_pWU7.js +359 -0
- package/lib/Spinner-Ciq_pWU7.js.map +1 -0
- package/lib/{hook-Biq3zYel.js → hook-Q_gAL2NZ.js} +20 -19
- package/lib/{hook-Biq3zYel.js.map → hook-Q_gAL2NZ.js.map} +1 -1
- package/lib/{index-Bg82-bqR.js → index-BE2a6gGC.js} +24 -23
- package/lib/{index-Bg82-bqR.js.map → index-BE2a6gGC.js.map} +1 -1
- package/lib/{jsx-runtime-CJZJivg2.js → jsx-runtime-BIr0WBt_.js} +119 -119
- package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
- package/lib/{router-CBw2vqJE.js → router-BiRCp01d.js} +671 -673
- package/lib/router-BiRCp01d.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +47 -32
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +170 -159
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1514 -598
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +30 -24
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +13 -0
- package/lib/zudoku.plugin-custom-page.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +19 -20
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +3 -3
- package/package.json +29 -14
- package/src/app/entry.client.tsx +1 -1
- package/src/app/entry.server.tsx +2 -0
- package/src/app/main.css +6 -0
- package/src/app/main.tsx +8 -2
- package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
- package/src/lib/authentication/authentication.ts +3 -4
- package/src/lib/authentication/components/Login.tsx +11 -0
- package/src/lib/authentication/components/Logout.tsx +11 -0
- package/src/lib/authentication/providers/clerk.tsx +43 -27
- package/src/lib/authentication/providers/openid.tsx +25 -13
- package/src/lib/authentication/routes.tsx +10 -0
- package/src/lib/components/Bootstrap.tsx +14 -7
- package/src/lib/components/DevPortal.tsx +29 -9
- package/src/lib/components/Header.tsx +80 -30
- package/src/lib/components/InlineCode.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/context/DevPortalProvider.ts +22 -2
- package/src/lib/components/index.ts +4 -0
- package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
- package/src/lib/core/DevPortalContext.ts +1 -1
- package/src/lib/core/plugins.ts +16 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +4 -4
- package/src/lib/plugins/api-keys/index.tsx +8 -1
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -4
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +3 -3
- package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/StaggeredRender.tsx +19 -5
- package/src/lib/plugins/openapi/playground/Playground.tsx +2 -2
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +199 -0
- package/src/lib/ui/button-variants.ts +1 -0
- package/src/lib/util/MdxComponents.tsx +1 -1
- package/src/lib/util/joinPath.tsx +2 -1
- package/dist/app/zudoku-manifest.d.ts +0 -1
- package/dist/app/zudoku-manifest.js +0 -20
- package/dist/app/zudoku-manifest.js.map +0 -1
- package/lib/Button-DpHMZvVs.js +0 -4571
- package/lib/Button-DpHMZvVs.js.map +0 -1
- package/lib/DevPortalProvider-Do9oJqme.js +0 -1081
- package/lib/DevPortalProvider-Do9oJqme.js.map +0 -1
- package/lib/Markdown-DtLFdxD1.js.map +0 -1
- package/lib/OperationList-DypxLtSC.js +0 -5578
- package/lib/OperationList-DypxLtSC.js.map +0 -1
- package/lib/Spinner-Bhbs5aPI.js +0 -182
- package/lib/Spinner-Bhbs5aPI.js.map +0 -1
- package/lib/index-gsAuUwQh.js +0 -418
- package/lib/index-gsAuUwQh.js.map +0 -1
- package/lib/jsx-runtime-CJZJivg2.js.map +0 -1
- package/lib/router-CBw2vqJE.js.map +0 -1
- package/lib/util-_jwUlTBU.js +0 -41
- package/lib/util-_jwUlTBU.js.map +0 -1
- package/src/app/zudoku-manifest.ts +0 -22
|
@@ -35,7 +35,7 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
|
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<div className="max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]">
|
|
38
|
-
<div className="flex justify-between mb-4 border-b
|
|
38
|
+
<div className="flex justify-between mb-4 border-b pb-3">
|
|
39
39
|
<h1 className="font-medium text-2xl">API Keys</h1>
|
|
40
40
|
{service.createKey && (
|
|
41
41
|
<Button asChild>
|
|
@@ -60,13 +60,13 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
|
|
|
60
60
|
) : (
|
|
61
61
|
<ul
|
|
62
62
|
className={cn(
|
|
63
|
-
"grid grid-cols-1 rounded border
|
|
63
|
+
"grid grid-cols-1 rounded border",
|
|
64
64
|
"lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]",
|
|
65
65
|
)}
|
|
66
66
|
>
|
|
67
67
|
{data.map((key) => (
|
|
68
68
|
<li
|
|
69
|
-
className="border-b
|
|
69
|
+
className="border-b p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
|
|
70
70
|
key={key.id}
|
|
71
71
|
>
|
|
72
72
|
<div className="flex flex-col gap-1 text-sm">
|
|
@@ -124,7 +124,7 @@ const RevealApiKey = ({ apiKey }: { apiKey: string }) => {
|
|
|
124
124
|
return (
|
|
125
125
|
<div className="flex gap-2 items-center text-sm w-full">
|
|
126
126
|
<input
|
|
127
|
-
className="border
|
|
127
|
+
className="border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min"
|
|
128
128
|
value={revealed ? apiKey : "•".repeat(apiKey.length)}
|
|
129
129
|
/>
|
|
130
130
|
<Button
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
11
|
+
"rounded-lg overflow-hidden border dark:border-transparent",
|
|
12
12
|
className,
|
|
13
13
|
)}
|
|
14
14
|
>
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
-
|
|
22
|
+
setRenderAll(true);
|
|
9
23
|
});
|
|
10
24
|
|
|
11
25
|
return () => window.cancelIdleCallback(x);
|
|
12
|
-
}, []);
|
|
26
|
+
}, [renderAll]);
|
|
13
27
|
|
|
14
|
-
return !
|
|
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
|
|
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
|
|
272
|
+
className="border w-full rounded p-2 bg-muted h-40"
|
|
273
273
|
/>
|
|
274
274
|
</TabsContent>
|
|
275
275
|
</Tabs>
|
package/src/lib/ui/Card.tsx
CHANGED
|
@@ -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
|
+
};
|
|
@@ -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
|
|
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"}
|