zudoku 0.37.1 → 0.39.0
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/main.js +2 -0
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +14 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/config/validators/common.d.ts +287 -18
- package/dist/config/validators/common.js +2 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +107 -7
- package/dist/lib/authentication/authentication.d.ts +1 -0
- package/dist/lib/authentication/providers/clerk.js +19 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -0
- package/dist/lib/authentication/providers/openid.js +5 -0
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.js +5 -0
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +0 -26
- package/dist/lib/authentication/state.js +1 -16
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +5 -10
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.js +3 -1
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/Pagination.d.ts +10 -0
- package/dist/lib/components/Pagination.js +10 -0
- package/dist/lib/components/Pagination.js.map +1 -0
- package/dist/lib/components/TopNavigation.js +18 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
- package/dist/lib/components/navigation/SidebarItem.js +7 -3
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
- package/dist/lib/components/navigation/Toc.js.map +1 -0
- package/dist/lib/core/ZudokuContext.d.ts +7 -0
- package/dist/lib/core/ZudokuContext.js +8 -3
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -1
- package/dist/lib/oas/graphql/index.d.ts +2 -1
- package/dist/lib/oas/graphql/index.js +74 -14
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.js +2 -0
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +5 -3
- package/dist/lib/oas/parser/index.js +0 -22
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.js +19 -17
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -9
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +29 -9
- package/dist/lib/plugins/openapi/OperationList.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/ParameterListItem.js +2 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
- package/dist/lib/plugins/openapi/SchemaList.js +52 -0
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +29 -5
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +5 -5
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +3 -2
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +67 -11
- package/dist/lib/plugins/openapi/graphql/graphql.js +34 -5
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +12 -0
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +26 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +2 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +12 -9
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/SchemaView.js +30 -52
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -1
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/state.d.ts +25 -0
- package/dist/lib/plugins/openapi/state.js +18 -0
- package/dist/lib/plugins/openapi/state.js.map +1 -0
- package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +13 -4
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +19 -12
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
- package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -8
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/types.d.ts +7 -0
- package/dist/lib/util/types.js +2 -0
- package/dist/lib/util/types.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +3 -2
- package/dist/lib/util/useOnScreen.js +3 -3
- package/dist/lib/util/useOnScreen.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +18 -12
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.js +2 -2
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +5 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/plugin-api.js +12 -8
- package/dist/vite/plugin-api.js.map +1 -1
- package/lib/{AuthenticationPlugin-Cij2tPWa.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
- package/lib/{AuthenticationPlugin-Cij2tPWa.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
- package/lib/{Callout-B2vsR09t.js → Callout-D5frCCJ0.js} +2 -2
- package/lib/{Callout-B2vsR09t.js.map → Callout-D5frCCJ0.js.map} +1 -1
- package/lib/{Dialog-sbgekbjb.js → Dialog-Dv6WG8RN.js} +5 -5
- package/lib/{Dialog-sbgekbjb.js.map → Dialog-Dv6WG8RN.js.map} +1 -1
- package/lib/{Markdown-DT5Rrq8_.js → Markdown-aF5FdsNi.js} +1945 -1937
- package/lib/{Markdown-DT5Rrq8_.js.map → Markdown-aF5FdsNi.js.map} +1 -1
- package/lib/MdxPage-ZW1StNhp.js +83 -0
- package/lib/MdxPage-ZW1StNhp.js.map +1 -0
- package/lib/{OasProvider-DdEBf2qS.js → OasProvider-Cld9RAMQ.js} +4 -4
- package/lib/{OasProvider-DdEBf2qS.js.map → OasProvider-Cld9RAMQ.js.map} +1 -1
- package/lib/OperationList-D-OfzJm6.js +5065 -0
- package/lib/OperationList-D-OfzJm6.js.map +1 -0
- package/lib/Pagination-CYB3nVYx.js +46 -0
- package/lib/Pagination-CYB3nVYx.js.map +1 -0
- package/lib/SchemaList-Ci1WxRh0.js +148 -0
- package/lib/SchemaList-Ci1WxRh0.js.map +1 -0
- package/lib/SchemaView-Brn-YxHY.js +345 -0
- package/lib/SchemaView-Brn-YxHY.js.map +1 -0
- package/lib/{Select-z1Lwl0-J.js → Select-DVFRKf1R.js} +8 -8
- package/lib/{Select-z1Lwl0-J.js.map → Select-DVFRKf1R.js.map} +1 -1
- package/lib/{SlotletProvider-D8OBnr77.js → SlotletProvider-DXvc0aY6.js} +4 -4
- package/lib/{SlotletProvider-D8OBnr77.js.map → SlotletProvider-DXvc0aY6.js.map} +1 -1
- package/lib/Toc-YBsgI72s.js +92 -0
- package/lib/Toc-YBsgI72s.js.map +1 -0
- package/lib/{chunk-HA7DTUK3-ZGg2W6yV.js → chunk-HA7DTUK3-C4gP41vD.js} +5 -5
- package/lib/{chunk-HA7DTUK3-ZGg2W6yV.js.map → chunk-HA7DTUK3-C4gP41vD.js.map} +1 -1
- package/lib/{createServer-DjgKDpGV.js → createServer-mMau3eV_.js} +1732 -1664
- package/lib/{createServer-DjgKDpGV.js.map → createServer-mMau3eV_.js.map} +1 -1
- package/lib/hook-CqpVYDqN.js +1483 -0
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-Bt7MKhZq.js +2514 -0
- package/lib/index-Bt7MKhZq.js.map +1 -0
- package/lib/{index-DdQSV2RF.js → index-CjPMxpOV.js} +809 -750
- package/lib/index-CjPMxpOV.js.map +1 -0
- package/lib/{mutation-_Z5C2wFZ.js → mutation-8LjrN7uz.js} +2 -2
- package/lib/{mutation-_Z5C2wFZ.js.map → mutation-8LjrN7uz.js.map} +1 -1
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/{useExposedProps-BslIn-FE.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-BslIn-FE.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +59 -41
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +76 -73
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +31 -1440
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +81 -79
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +15 -16
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +133 -98
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +4 -3
- package/src/app/main.tsx +2 -0
- package/src/app/tailwind.ts +14 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/providers/clerk.tsx +20 -0
- package/src/lib/authentication/providers/openid.tsx +6 -0
- package/src/lib/authentication/providers/supabase.tsx +6 -0
- package/src/lib/authentication/state.ts +1 -35
- package/src/lib/components/Layout.tsx +17 -17
- package/src/lib/components/Main.tsx +3 -1
- package/src/lib/components/Pagination.tsx +47 -0
- package/src/lib/components/TopNavigation.tsx +29 -2
- package/src/lib/components/navigation/SidebarItem.tsx +10 -4
- package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
- package/src/lib/core/ZudokuContext.ts +13 -6
- package/src/lib/core/plugins.ts +1 -1
- package/src/lib/oas/graphql/index.ts +118 -45
- package/src/lib/oas/parser/dereference/index.ts +2 -0
- package/src/lib/oas/parser/index.ts +7 -29
- package/src/lib/plugins/api-catalog/index.tsx +40 -35
- package/src/lib/plugins/markdown/MdxPage.tsx +6 -43
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +37 -16
- package/src/lib/plugins/openapi/OperationListItem.tsx +7 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +2 -0
- package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +36 -7
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +12 -5
- package/src/lib/plugins/openapi/components/EnumValues.tsx +1 -1
- package/src/lib/plugins/openapi/graphql/gql.ts +15 -6
- package/src/lib/plugins/openapi/graphql/graphql.ts +104 -15
- package/src/lib/plugins/openapi/index.tsx +13 -0
- package/src/lib/plugins/openapi/interfaces.ts +29 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +2 -1
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +1 -2
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +20 -21
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +69 -141
- package/src/lib/plugins/openapi/schema/utils.ts +7 -1
- package/src/lib/plugins/openapi/state.ts +36 -0
- package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +26 -4
- package/src/lib/plugins/search-pagefind/ResultList.tsx +59 -47
- package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
- package/src/lib/util/traverse.ts +2 -6
- package/src/lib/util/types.ts +7 -0
- package/src/lib/util/useOnScreen.ts +6 -4
- package/src/lib/util/useScrollToAnchor.ts +20 -12
- package/dist/lib/plugins/markdown/Toc.js.map +0 -1
- package/lib/MdxPage-D2rD1vC4.js +0 -200
- package/lib/MdxPage-D2rD1vC4.js.map +0 -1
- package/lib/OperationList-DT4-gm_S.js +0 -5363
- package/lib/OperationList-DT4-gm_S.js.map +0 -1
- package/lib/hook-DzQC8PzJ.js +0 -355
- package/lib/hook-DzQC8PzJ.js.map +0 -1
- package/lib/index-DdQSV2RF.js.map +0 -1
- package/lib/index.esm-CltAN0Tf.js +0 -711
- package/lib/index.esm-CltAN0Tf.js.map +0 -1
- package/lib/joinUrl-BjDooT-T.js +0 -1154
- package/lib/joinUrl-BjDooT-T.js.map +0 -1
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-CYK1ROHF.js";
|
|
2
|
+
import { ArrowLeftIcon as n, ArrowRightIcon as i } from "lucide-react";
|
|
3
|
+
import { L as o } from "./chunk-HA7DTUK3-C4gP41vD.js";
|
|
4
|
+
import { c as l } from "./cn-qaFjX9_3.js";
|
|
5
|
+
import { B as r } from "./index-Bt7MKhZq.js";
|
|
6
|
+
const d = ({
|
|
7
|
+
prev: t,
|
|
8
|
+
next: a
|
|
9
|
+
}) => {
|
|
10
|
+
const e = "group transition-all p-5 space-x-1 transition-all hover:text-foreground";
|
|
11
|
+
return /* @__PURE__ */ s.jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: l(
|
|
15
|
+
"flex my-8 -mx-4 text-muted-foreground font-semibold",
|
|
16
|
+
t ? "justify-between" : "justify-end"
|
|
17
|
+
),
|
|
18
|
+
children: [
|
|
19
|
+
t && /* @__PURE__ */ s.jsx(r, { variant: "ghost", asChild: !0, children: /* @__PURE__ */ s.jsxs(o, { to: t.to, relative: "path", className: e, children: [
|
|
20
|
+
/* @__PURE__ */ s.jsx(
|
|
21
|
+
n,
|
|
22
|
+
{
|
|
23
|
+
className: "group-hover:motion-safe:animate-bounce-x-start",
|
|
24
|
+
size: 12
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ s.jsx("span", { className: "truncate", children: t.label })
|
|
28
|
+
] }) }),
|
|
29
|
+
a && /* @__PURE__ */ s.jsx(r, { variant: "ghost", asChild: !0, children: /* @__PURE__ */ s.jsxs(o, { to: a.to, relative: "path", className: e, children: [
|
|
30
|
+
/* @__PURE__ */ s.jsx("span", { className: "truncate ", children: a.label }),
|
|
31
|
+
/* @__PURE__ */ s.jsx(
|
|
32
|
+
i,
|
|
33
|
+
{
|
|
34
|
+
className: "group-hover:motion-safe:animate-bounce-x-end",
|
|
35
|
+
size: 12
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] }) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
d as P
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=Pagination-CYB3nVYx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination-CYB3nVYx.js","sources":["../src/lib/components/Pagination.tsx"],"sourcesContent":["import { ArrowLeftIcon, ArrowRightIcon } from \"lucide-react\";\nimport { Link } from \"react-router\";\nimport { cn } from \"../util/cn.js\";\nimport { Button } from \"./index.js\";\n\nexport const Pagination = ({\n prev,\n next,\n}: {\n prev: { to: string; label: string } | undefined;\n next: { to: string; label: string } | undefined;\n}) => {\n const linkClass =\n \"group transition-all p-5 space-x-1 transition-all hover:text-foreground\";\n\n return (\n <div\n className={cn(\n \"flex my-8 -mx-4 text-muted-foreground font-semibold\",\n prev ? \"justify-between\" : \"justify-end\",\n )}\n >\n {prev && (\n <Button variant=\"ghost\" asChild>\n <Link to={prev.to} relative=\"path\" className={linkClass}>\n <ArrowLeftIcon\n className=\"group-hover:motion-safe:animate-bounce-x-start\"\n size={12}\n />\n <span className=\"truncate\">{prev.label}</span>\n </Link>\n </Button>\n )}\n {next && (\n <Button variant=\"ghost\" asChild>\n <Link to={next.to} relative=\"path\" className={linkClass}>\n <span className=\"truncate \">{next.label}</span>\n <ArrowRightIcon\n className=\"group-hover:motion-safe:animate-bounce-x-end\"\n size={12}\n />\n </Link>\n </Button>\n )}\n </div>\n );\n};\n"],"names":["Pagination","prev","next","linkClass","jsxs","cn","jsx","Button","Link","ArrowLeftIcon","ArrowRightIcon"],"mappings":";;;;;AAKO,MAAMA,IAAa,CAAC;AAAA,EACzB,MAAAC;AAAA,EACA,MAAAC;AACF,MAGM;AACJ,QAAMC,IACJ;AAGA,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAJ,IAAO,oBAAoB;AAAA,MAC7B;AAAA,MAEC,UAAA;AAAA,QAAAA,KACEK,gBAAAA,EAAAA,IAAAC,GAAA,EAAO,SAAQ,SAAQ,SAAO,IAC7B,UAAAH,gBAAAA,EAAAA,KAACI,GAAK,EAAA,IAAIP,EAAK,IAAI,UAAS,QAAO,WAAWE,GAC5C,UAAA;AAAA,UAAAG,gBAAAA,EAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,MAAM;AAAA,YAAA;AAAA,UACR;AAAA,UACCH,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,YAAY,YAAK,MAAM,CAAA;AAAA,QAAA,EAAA,CACzC,EACF,CAAA;AAAA,QAEDJ,KACCI,gBAAAA,EAAAA,IAACC,GAAO,EAAA,SAAQ,SAAQ,SAAO,IAC7B,UAACH,gBAAAA,EAAAA,KAAAI,GAAA,EAAK,IAAIN,EAAK,IAAI,UAAS,QAAO,WAAWC,GAC5C,UAAA;AAAA,UAAAG,gBAAAA,EAAA,IAAC,QAAK,EAAA,WAAU,aAAa,UAAAJ,EAAK,OAAM;AAAA,UACxCI,gBAAAA,EAAA;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,QACR,EAAA,CACF,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-CYK1ROHF.js";
|
|
2
|
+
import { s as i } from "./index-LNp6rxyU.js";
|
|
3
|
+
import { d as j } from "./hook-CqpVYDqN.js";
|
|
4
|
+
import { ChevronsUpDownIcon as N, ChevronsDownUpIcon as y, ChevronRightIcon as C } from "lucide-react";
|
|
5
|
+
import { B as b } from "./Button-Fp19CMUr.js";
|
|
6
|
+
import { C as o, a as c, b as m, c as v } from "./index-CjPMxpOV.js";
|
|
7
|
+
import { C as w } from "./CategoryHeading-DpB47wvk.js";
|
|
8
|
+
import { H as l, M as S, P as z } from "./Markdown-aF5FdsNi.js";
|
|
9
|
+
import { T } from "./Toc-YBsgI72s.js";
|
|
10
|
+
import { c as V } from "./cn-qaFjX9_3.js";
|
|
11
|
+
import { u as A, S as H } from "./SchemaView-Brn-YxHY.js";
|
|
12
|
+
import { u as I } from "./context-DLCwaMXN.js";
|
|
13
|
+
const M = v(
|
|
14
|
+
/* GraphQL */
|
|
15
|
+
`
|
|
16
|
+
query GetSchemas($input: JSON!, $type: SchemaType!) {
|
|
17
|
+
schema(input: $input, type: $type) {
|
|
18
|
+
title
|
|
19
|
+
description
|
|
20
|
+
summary
|
|
21
|
+
components {
|
|
22
|
+
schemas {
|
|
23
|
+
name
|
|
24
|
+
schema
|
|
25
|
+
extensions
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`
|
|
31
|
+
);
|
|
32
|
+
function J() {
|
|
33
|
+
var n;
|
|
34
|
+
const { input: d, type: p, versions: h, version: x, options: a } = I(), u = A(M, {
|
|
35
|
+
input: d,
|
|
36
|
+
type: p
|
|
37
|
+
}), { data: t } = j(u), r = ((n = t.schema.components) == null ? void 0 : n.schemas) ?? [];
|
|
38
|
+
if (!r.length)
|
|
39
|
+
return /* @__PURE__ */ e.jsx("div", { children: "No schemas found" });
|
|
40
|
+
const f = Object.entries(h).length > 1, g = (a == null ? void 0 : a.showVersionSelect) === "always" || f && (a == null ? void 0 : a.showVersionSelect) !== "hide";
|
|
41
|
+
return /* @__PURE__ */ e.jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between",
|
|
45
|
+
"data-pagefind-filter": "section:openapi",
|
|
46
|
+
"data-pagefind-meta": "section:openapi",
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ e.jsxs("div", { className: "pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
|
|
49
|
+
/* @__PURE__ */ e.jsxs(o, { className: "w-full", children: [
|
|
50
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-y-4 sm:flex-row justify-around items-start sm:items-end", children: [
|
|
51
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex-1", children: [
|
|
52
|
+
/* @__PURE__ */ e.jsx(w, { children: t.schema.title }),
|
|
53
|
+
/* @__PURE__ */ e.jsxs(
|
|
54
|
+
l,
|
|
55
|
+
{
|
|
56
|
+
level: 1,
|
|
57
|
+
id: "schemas",
|
|
58
|
+
registerSidebarAnchor: !0,
|
|
59
|
+
className: "mb-0",
|
|
60
|
+
children: [
|
|
61
|
+
"Schemas",
|
|
62
|
+
g && /* @__PURE__ */ e.jsxs("span", { className: "text-xl text-muted-foreground ml-1.5", children: [
|
|
63
|
+
"(",
|
|
64
|
+
x,
|
|
65
|
+
")"
|
|
66
|
+
] })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] }),
|
|
71
|
+
t.schema.description && /* @__PURE__ */ e.jsxs(c, { className: "flex items-center gap-1 text-sm font-medium text-muted-foreground group", children: [
|
|
72
|
+
/* @__PURE__ */ e.jsx("span", { children: "API information" }),
|
|
73
|
+
/* @__PURE__ */ e.jsx(
|
|
74
|
+
N,
|
|
75
|
+
{
|
|
76
|
+
className: "group-data-[state=open]:hidden translate-y-px",
|
|
77
|
+
size: 14
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ e.jsx(
|
|
81
|
+
y,
|
|
82
|
+
{
|
|
83
|
+
className: "group-data-[state=closed]:hidden translate-y-px",
|
|
84
|
+
size: 13
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
t.schema.description && /* @__PURE__ */ e.jsx(m, { className: "CollapsibleContent", children: /* @__PURE__ */ e.jsx(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: V(
|
|
93
|
+
z,
|
|
94
|
+
"pt-4 max-w-full prose-img:max-w-prose"
|
|
95
|
+
),
|
|
96
|
+
children: /* @__PURE__ */ e.jsx(
|
|
97
|
+
S,
|
|
98
|
+
{
|
|
99
|
+
className: "border rounded bg-muted/25 border-border px-2.5 md:px-4",
|
|
100
|
+
content: t.schema.description
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ e.jsx("hr", { className: "my-8" }),
|
|
107
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-y-5", children: r.map((s) => /* @__PURE__ */ e.jsxs(o, { className: "group", defaultOpen: !0, children: [
|
|
108
|
+
/* @__PURE__ */ e.jsxs(
|
|
109
|
+
l,
|
|
110
|
+
{
|
|
111
|
+
registerSidebarAnchor: !0,
|
|
112
|
+
level: 2,
|
|
113
|
+
className: "flex items-center gap-1 justify-between w-fit",
|
|
114
|
+
id: i(s.name),
|
|
115
|
+
children: [
|
|
116
|
+
s.name,
|
|
117
|
+
" ",
|
|
118
|
+
/* @__PURE__ */ e.jsx(c, { asChild: !0, children: /* @__PURE__ */ e.jsx(b, { variant: "ghost", size: "icon", className: "size-6", children: /* @__PURE__ */ e.jsx(
|
|
119
|
+
C,
|
|
120
|
+
{
|
|
121
|
+
size: 16,
|
|
122
|
+
className: "group-data-[state=open]:rotate-90 transition cursor-pointer"
|
|
123
|
+
}
|
|
124
|
+
) }) })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ e.jsx(m, { className: "mt-4 CollapsibleContent", children: /* @__PURE__ */ e.jsx(H, { schema: s.schema }) })
|
|
129
|
+
] }, s.name)) })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ e.jsx(
|
|
132
|
+
T,
|
|
133
|
+
{
|
|
134
|
+
entries: r.map((s) => ({
|
|
135
|
+
id: i(s.name),
|
|
136
|
+
value: s.name,
|
|
137
|
+
depth: 1
|
|
138
|
+
}))
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
J as SchemaList
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=SchemaList-Ci1WxRh0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaList-Ci1WxRh0.js","sources":["../src/lib/plugins/openapi/SchemaList.tsx"],"sourcesContent":["import slugify from \"@sindresorhus/slugify\";\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport {\n ChevronRightIcon,\n ChevronsDownUpIcon,\n ChevronsUpDownIcon,\n} from \"lucide-react\";\nimport { Button } from \"zudoku/ui/Button.js\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"zudoku/ui/Collapsible.js\";\nimport { CategoryHeading } from \"../../components/CategoryHeading.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown, ProseClasses } from \"../../components/Markdown.js\";\nimport { Toc } from \"../../components/navigation/Toc.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { useCreateQuery } from \"./client/useCreateQuery.js\";\nimport { useOasConfig } from \"./context.js\";\nimport { graphql } from \"./graphql/gql.js\";\nimport { SchemaView } from \"./schema/SchemaView.js\";\n\nconst GET_SCHEMAS = graphql(/* GraphQL */ `\n query GetSchemas($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n title\n description\n summary\n components {\n schemas {\n name\n schema\n extensions\n }\n }\n }\n }\n`);\n\nexport function SchemaList() {\n const { input, type, versions, version, options } = useOasConfig();\n const schemasQuery = useCreateQuery(GET_SCHEMAS, {\n input,\n type,\n });\n const { data } = useSuspenseQuery(schemasQuery);\n\n const schemas = data.schema.components?.schemas ?? [];\n\n if (!schemas.length) {\n return <div>No schemas found</div>;\n }\n\n const hasMultipleVersions = Object.entries(versions).length > 1;\n const showVersions =\n options?.showVersionSelect === \"always\" ||\n (hasMultipleVersions && options?.showVersionSelect !== \"hide\");\n\n return (\n <div\n className=\"grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between\"\n data-pagefind-filter=\"section:openapi\"\n data-pagefind-meta=\"section:openapi\"\n >\n <div className=\"pt-[--padding-content-top] pb-[--padding-content-bottom]\">\n <Collapsible className=\"w-full\">\n <div className=\"flex flex-col gap-y-4 sm:flex-row justify-around items-start sm:items-end\">\n <div className=\"flex-1\">\n <CategoryHeading>{data.schema.title}</CategoryHeading>\n <Heading\n level={1}\n id=\"schemas\"\n registerSidebarAnchor\n className=\"mb-0\"\n >\n Schemas\n {showVersions && (\n <span className=\"text-xl text-muted-foreground ml-1.5\">\n ({version})\n </span>\n )}\n </Heading>\n </div>\n {data.schema.description && (\n <CollapsibleTrigger className=\"flex items-center gap-1 text-sm font-medium text-muted-foreground group\">\n <span>API information</span>\n <ChevronsUpDownIcon\n className=\"group-data-[state=open]:hidden translate-y-px\"\n size={14}\n />\n <ChevronsDownUpIcon\n className=\"group-data-[state=closed]:hidden translate-y-px\"\n size={13}\n />\n </CollapsibleTrigger>\n )}\n </div>\n {data.schema.description && (\n <CollapsibleContent className=\"CollapsibleContent\">\n <div\n className={cn(\n ProseClasses,\n \"pt-4 max-w-full prose-img:max-w-prose\",\n )}\n >\n <Markdown\n className=\"border rounded bg-muted/25 border-border px-2.5 md:px-4\"\n content={data.schema.description}\n />\n </div>\n </CollapsibleContent>\n )}\n </Collapsible>\n <hr className=\"my-8\" />\n <div className=\"flex flex-col gap-y-5\">\n {schemas.map((schema) => (\n <Collapsible key={schema.name} className=\"group\" defaultOpen>\n <Heading\n registerSidebarAnchor\n level={2}\n className=\"flex items-center gap-1 justify-between w-fit\"\n id={slugify(schema.name)}\n >\n {schema.name}{\" \"}\n <CollapsibleTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6\">\n <ChevronRightIcon\n size={16}\n className=\"group-data-[state=open]:rotate-90 transition cursor-pointer\"\n />\n </Button>\n </CollapsibleTrigger>\n </Heading>\n <CollapsibleContent className=\"mt-4 CollapsibleContent\">\n <SchemaView schema={schema.schema} />\n </CollapsibleContent>\n </Collapsible>\n ))}\n </div>\n </div>\n <Toc\n entries={schemas.map((schema) => ({\n id: slugify(schema.name),\n value: schema.name,\n depth: 1,\n }))}\n />\n </div>\n );\n}\n"],"names":["GET_SCHEMAS","graphql","SchemaList","input","type","versions","version","options","useOasConfig","schemasQuery","useCreateQuery","data","useSuspenseQuery","schemas","_a","jsx","hasMultipleVersions","showVersions","jsxs","Collapsible","CategoryHeading","Heading","CollapsibleTrigger","ChevronsUpDownIcon","ChevronsDownUpIcon","CollapsibleContent","cn","ProseClasses","Markdown","schema","slugify","Button","ChevronRightIcon","SchemaView","Toc"],"mappings":"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"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { use as S, isValidElement as E, useState as x, useCallback as R } from "react";
|
|
2
|
+
import { a as z } from "./context-DLCwaMXN.js";
|
|
3
|
+
import { i as A, S as T, L as B, T as j, a as $, p as D, C as q } from "./circular-ByJI6Mci.js";
|
|
4
|
+
import { j as s } from "./jsx-runtime-CYK1ROHF.js";
|
|
5
|
+
import { I, S as u, M as k, P as v } from "./Markdown-aF5FdsNi.js";
|
|
6
|
+
import { Card as c, CardHeader as G, CardTitle as M, CardContent as K } from "./ui/Card.js";
|
|
7
|
+
import { c as d } from "./cn-qaFjX9_3.js";
|
|
8
|
+
import { ChevronsLeftRightIcon as F, ChevronUpIcon as Q, ChevronDownIcon as P, CircleIcon as H, CircleDotIcon as J, CircleFadingPlusIcon as U, SquareMinusIcon as _, SquarePlusIcon as V, MinusIcon as W, PlusIcon as X, RefreshCcwDotIcon as Y } from "lucide-react";
|
|
9
|
+
import { B as Z } from "./Button-Fp19CMUr.js";
|
|
10
|
+
import * as a from "@radix-ui/react-collapsible";
|
|
11
|
+
import { Button as ee } from "./ui/Button.js";
|
|
12
|
+
import { o as se } from "./objectEntries-BS7aAgOm.js";
|
|
13
|
+
function te(e) {
|
|
14
|
+
const t = A(e) ? e : new T(e), r = t.body, i = new B(t);
|
|
15
|
+
let n = "", o = !1;
|
|
16
|
+
for (; i.advance().kind !== j.EOF; ) {
|
|
17
|
+
const l = i.token, p = l.kind, h = !$(l.kind);
|
|
18
|
+
o && (h || l.kind === j.SPREAD) && (n += " ");
|
|
19
|
+
const L = r.slice(l.start, l.end);
|
|
20
|
+
p === j.BLOCK_STRING ? n += D(l.value, {
|
|
21
|
+
minimize: !0
|
|
22
|
+
}) : n += L, o = h;
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
const we = (e, ...[t]) => {
|
|
27
|
+
const r = S(z);
|
|
28
|
+
if (r === void 0)
|
|
29
|
+
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
30
|
+
return {
|
|
31
|
+
queryFn: () => r.fetch(e, t),
|
|
32
|
+
queryKey: [te(e.toString()), t]
|
|
33
|
+
};
|
|
34
|
+
}, re = (e, t) => e.reduce(
|
|
35
|
+
(r, i) => {
|
|
36
|
+
const n = t(i);
|
|
37
|
+
return r[n] || (r[n] = []), r[n].push(i), r;
|
|
38
|
+
},
|
|
39
|
+
{}
|
|
40
|
+
), ne = ({ pattern: e }) => {
|
|
41
|
+
const [t, r] = x(!1), i = e.length > 20, n = i ? `${e.slice(0, 20)}…` : e;
|
|
42
|
+
return /* @__PURE__ */ s.jsxs(
|
|
43
|
+
I,
|
|
44
|
+
{
|
|
45
|
+
className: d("text-xs", i && "cursor-pointer"),
|
|
46
|
+
onClick: () => r(!t),
|
|
47
|
+
selectOnClick: !1,
|
|
48
|
+
children: [
|
|
49
|
+
t ? e : n,
|
|
50
|
+
i && /* @__PURE__ */ s.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !t && /* @__PURE__ */ s.jsx(F, { size: 12 }) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, ie = (e) => e ? [
|
|
55
|
+
e.type === "array" && e.items.type ? `${e.items.type}[]` : Array.isArray(e.type) ? e.type.join(" | ") : e.type,
|
|
56
|
+
e.enum && "enum",
|
|
57
|
+
e.format,
|
|
58
|
+
e.minimum && `min: ${e.minimum}`,
|
|
59
|
+
e.maximum && `max: ${e.maximum}`,
|
|
60
|
+
e.minLength && `minLength: ${e.minLength}`,
|
|
61
|
+
e.maxLength && `maxLength: ${e.maxLength}`,
|
|
62
|
+
e.minItems && `minItems: ${e.minItems}`,
|
|
63
|
+
e.maxItems && `maxItems: ${e.maxItems}`,
|
|
64
|
+
e.uniqueItems && "unique",
|
|
65
|
+
e.minProperties && `minProps: ${e.minProperties}`,
|
|
66
|
+
e.maxProperties && `maxProps: ${e.maxProperties}`,
|
|
67
|
+
e.readOnly && "readOnly",
|
|
68
|
+
e.writeOnly && "writeOnly",
|
|
69
|
+
e.deprecated && "deprecated",
|
|
70
|
+
e.pattern && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
71
|
+
"pattern: ",
|
|
72
|
+
/* @__PURE__ */ s.jsx(ne, { pattern: e.pattern })
|
|
73
|
+
] })
|
|
74
|
+
] : [], g = ({
|
|
75
|
+
schema: e,
|
|
76
|
+
extraItems: t = [],
|
|
77
|
+
className: r
|
|
78
|
+
}) => {
|
|
79
|
+
const i = [...ie(e), ...t].flatMap(
|
|
80
|
+
(n) => typeof n == "string" || E(n) ? n : []
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ s.jsx("span", { className: r, children: i.map((n, o) => /* @__PURE__ */ s.jsxs("span", { className: "text-muted-foreground", children: [
|
|
83
|
+
n,
|
|
84
|
+
o < i.length - 1 && /* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground/50", children: " · " })
|
|
85
|
+
] }, o)) });
|
|
86
|
+
}, y = ({
|
|
87
|
+
values: e,
|
|
88
|
+
className: t,
|
|
89
|
+
maxVisibleValues: r = 8
|
|
90
|
+
}) => {
|
|
91
|
+
const [i, n] = x(!1);
|
|
92
|
+
if (!e.length) return null;
|
|
93
|
+
const o = e.length > r, l = o && !i ? e.slice(0, r) : e;
|
|
94
|
+
return /* @__PURE__ */ s.jsxs("div", { className: d("flex flex-wrap gap-1.5 text-xs", t), children: [
|
|
95
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Enum values: " }),
|
|
96
|
+
l.map((p) => /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: p }) }, p)),
|
|
97
|
+
o && /* @__PURE__ */ s.jsx(
|
|
98
|
+
Z,
|
|
99
|
+
{
|
|
100
|
+
variant: "ghost",
|
|
101
|
+
size: "sm",
|
|
102
|
+
className: "h-fit px-0",
|
|
103
|
+
onClick: () => n(!i),
|
|
104
|
+
children: i ? /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
105
|
+
/* @__PURE__ */ s.jsx(Q, { size: 12 }),
|
|
106
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "show less" })
|
|
107
|
+
] }) : /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
108
|
+
/* @__PURE__ */ s.jsx(P, { size: 12 }),
|
|
109
|
+
/* @__PURE__ */ s.jsxs("span", { className: "text-muted-foreground", children: [
|
|
110
|
+
"show ",
|
|
111
|
+
e.length - r,
|
|
112
|
+
" more"
|
|
113
|
+
] })
|
|
114
|
+
] })
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] });
|
|
118
|
+
}, N = ({
|
|
119
|
+
schema: e
|
|
120
|
+
}) => {
|
|
121
|
+
var i;
|
|
122
|
+
const t = (i = e.examples) == null ? void 0 : i.at(0), r = e.default;
|
|
123
|
+
return !t && !r ? null : /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col gap-1 text-xs", children: [
|
|
124
|
+
t && /* @__PURE__ */ s.jsxs("div", { children: [
|
|
125
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Example: " }),
|
|
126
|
+
/* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: typeof t == "object" ? JSON.stringify(t) : t })
|
|
127
|
+
] }),
|
|
128
|
+
r && /* @__PURE__ */ s.jsxs("div", { children: [
|
|
129
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Default: " }),
|
|
130
|
+
/* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: typeof r == "object" ? JSON.stringify(r) : r })
|
|
131
|
+
] })
|
|
132
|
+
] });
|
|
133
|
+
}, oe = {
|
|
134
|
+
AND: /* @__PURE__ */ s.jsx(U, { size: 16, className: "fill-card" }),
|
|
135
|
+
OR: /* @__PURE__ */ s.jsx(J, { size: 16, className: "fill-card" }),
|
|
136
|
+
ONE: /* @__PURE__ */ s.jsx(H, { size: 14, className: "fill-card" })
|
|
137
|
+
}, le = {
|
|
138
|
+
AND: "text-green-500 dark:text-green-300/60",
|
|
139
|
+
OR: "text-blue-400 dark:text-blue-500",
|
|
140
|
+
ONE: "text-purple-500 dark:text-purple-300/60"
|
|
141
|
+
}, ae = ({
|
|
142
|
+
type: e,
|
|
143
|
+
isOpen: t,
|
|
144
|
+
className: r
|
|
145
|
+
}) => /* @__PURE__ */ s.jsx(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: d(
|
|
149
|
+
le[e],
|
|
150
|
+
"relative text-sm flex py-2",
|
|
151
|
+
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
152
|
+
r
|
|
153
|
+
),
|
|
154
|
+
children: /* @__PURE__ */ s.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
155
|
+
oe[e],
|
|
156
|
+
/* @__PURE__ */ s.jsx(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
className: d(
|
|
160
|
+
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
161
|
+
!t && "-rotate-90"
|
|
162
|
+
),
|
|
163
|
+
children: /* @__PURE__ */ s.jsx(P, { size: 16 })
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] })
|
|
167
|
+
}
|
|
168
|
+
), de = (e) => {
|
|
169
|
+
const [t, r] = x(!0);
|
|
170
|
+
return /* @__PURE__ */ s.jsxs(
|
|
171
|
+
a.Root,
|
|
172
|
+
{
|
|
173
|
+
open: t,
|
|
174
|
+
onOpenChange: () => r((i) => !i),
|
|
175
|
+
className: "group",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ s.jsx(a.Trigger, { children: /* @__PURE__ */ s.jsx(ae, { type: e.type, isOpen: t }) }),
|
|
178
|
+
!t && /* @__PURE__ */ s.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
|
|
179
|
+
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx(m, { schema: e.schema }) })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}, ce = {
|
|
184
|
+
AND: "All of",
|
|
185
|
+
OR: "Any of",
|
|
186
|
+
ONE: "One of"
|
|
187
|
+
}, xe = ({
|
|
188
|
+
schemas: e,
|
|
189
|
+
type: t,
|
|
190
|
+
isOpen: r,
|
|
191
|
+
toggleOpen: i
|
|
192
|
+
}) => /* @__PURE__ */ s.jsx(a.Root, { open: r, onOpenChange: i, asChild: !0, children: /* @__PURE__ */ s.jsxs(c, { className: "px-6", children: [
|
|
193
|
+
/* @__PURE__ */ s.jsxs(a.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
|
|
194
|
+
r ? /* @__PURE__ */ s.jsx(_, { size: 14 }) : /* @__PURE__ */ s.jsx(V, { size: 14 }),
|
|
195
|
+
/* @__PURE__ */ s.jsx("span", { children: ce[t] })
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ s.jsx(a.Content, { className: "pb-4", children: e.map((n, o) => (
|
|
198
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
199
|
+
/* @__PURE__ */ s.jsx(de, { type: t, schema: n }, o)
|
|
200
|
+
)) })
|
|
201
|
+
] }) }), pe = (e) => typeof e == "string" && ["string", "number", "boolean", "integer", "null"].includes(e), ue = (e) => e.type === "object" && Object.keys(e.properties ?? {}).length > 0 || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object"), b = (e) => !!(e.oneOf ?? e.allOf ?? e.anyOf), me = {
|
|
202
|
+
allOf: "AND",
|
|
203
|
+
anyOf: "OR",
|
|
204
|
+
oneOf: "ONE"
|
|
205
|
+
}, f = (e) => e === q, w = ({ schema: e }) => {
|
|
206
|
+
const [t, r] = x(!0), i = R(() => r((n) => !n), []);
|
|
207
|
+
for (const [n, o] of se(me))
|
|
208
|
+
if (e[n])
|
|
209
|
+
return /* @__PURE__ */ s.jsx(
|
|
210
|
+
xe,
|
|
211
|
+
{
|
|
212
|
+
schemas: e[n],
|
|
213
|
+
type: o,
|
|
214
|
+
isOpen: t,
|
|
215
|
+
toggleOpen: i
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}, C = () => /* @__PURE__ */ s.jsxs(
|
|
219
|
+
I,
|
|
220
|
+
{
|
|
221
|
+
className: "inline-flex items-center gap-1.5 italic text-xs translate-y-0.5",
|
|
222
|
+
selectOnClick: !1,
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ s.jsx(Y, { size: 13 }),
|
|
225
|
+
/* @__PURE__ */ s.jsx("span", { children: "circular" })
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
), je = ({
|
|
229
|
+
name: e,
|
|
230
|
+
schema: t,
|
|
231
|
+
group: r,
|
|
232
|
+
defaultOpen: i = !1,
|
|
233
|
+
showCollapseButton: n = !0
|
|
234
|
+
}) => {
|
|
235
|
+
const [o, l] = x(i);
|
|
236
|
+
return f(t) ? /* @__PURE__ */ s.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col gap-2.5 justify-between text-sm", children: [
|
|
237
|
+
/* @__PURE__ */ s.jsxs("div", { className: "space-x-2", children: [
|
|
238
|
+
/* @__PURE__ */ s.jsx("code", { children: e }),
|
|
239
|
+
/* @__PURE__ */ s.jsx(
|
|
240
|
+
g,
|
|
241
|
+
{
|
|
242
|
+
schema: t,
|
|
243
|
+
extraItems: [/* @__PURE__ */ s.jsx(C, {}, "circular-ref")]
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
] }),
|
|
247
|
+
/* @__PURE__ */ s.jsx(N, { schema: t })
|
|
248
|
+
] }) }) : /* @__PURE__ */ s.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col gap-2.5 justify-between text-sm", children: [
|
|
249
|
+
/* @__PURE__ */ s.jsxs("div", { className: "space-x-2", children: [
|
|
250
|
+
/* @__PURE__ */ s.jsx(u, { asChild: !0, children: /* @__PURE__ */ s.jsx("code", { children: e }) }),
|
|
251
|
+
/* @__PURE__ */ s.jsx(
|
|
252
|
+
g,
|
|
253
|
+
{
|
|
254
|
+
schema: t,
|
|
255
|
+
extraItems: [
|
|
256
|
+
r !== "optional" && /* @__PURE__ */ s.jsx("span", { className: "text-primary", children: "required" }),
|
|
257
|
+
t.type === "array" && "items" in t && f(t.items) && /* @__PURE__ */ s.jsx(C, {})
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
] }),
|
|
262
|
+
t.description && /* @__PURE__ */ s.jsx(
|
|
263
|
+
k,
|
|
264
|
+
{
|
|
265
|
+
className: d(v, "text-sm leading-normal line-clamp-4"),
|
|
266
|
+
content: t.description
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
t.type === "array" && "items" in t && t.items.enum && /* @__PURE__ */ s.jsx(y, { values: t.items.enum }),
|
|
270
|
+
t.enum && /* @__PURE__ */ s.jsx(y, { values: t.enum }),
|
|
271
|
+
/* @__PURE__ */ s.jsx(N, { schema: t }),
|
|
272
|
+
(b(t) || ue(t)) && /* @__PURE__ */ s.jsxs(
|
|
273
|
+
a.Root,
|
|
274
|
+
{
|
|
275
|
+
defaultOpen: i,
|
|
276
|
+
open: o,
|
|
277
|
+
onOpenChange: () => l(!o),
|
|
278
|
+
children: [
|
|
279
|
+
n && /* @__PURE__ */ s.jsx(a.Trigger, { asChild: !0, children: /* @__PURE__ */ s.jsxs(ee, { variant: "expand", size: "sm", className: "h-7", children: [
|
|
280
|
+
o ? /* @__PURE__ */ s.jsx(W, { size: 12 }) : /* @__PURE__ */ s.jsx(X, { size: 12 }),
|
|
281
|
+
o ? "Hide properties" : "Show properties"
|
|
282
|
+
] }) }),
|
|
283
|
+
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx("div", { className: "mt-2", children: b(t) ? /* @__PURE__ */ s.jsx(w, { schema: t }) : t.type === "object" ? /* @__PURE__ */ s.jsx(m, { schema: t }) : t.type === "array" && "items" in t && typeof t.items == "object" && !f(t.items) && /* @__PURE__ */ s.jsx(m, { schema: t.items }) }) })
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
] }) });
|
|
288
|
+
}, fe = (e) => e && /* @__PURE__ */ s.jsx(
|
|
289
|
+
k,
|
|
290
|
+
{
|
|
291
|
+
className: d(v, "text-sm leading-normal line-clamp-4"),
|
|
292
|
+
content: e
|
|
293
|
+
}
|
|
294
|
+
), O = (e) => /* @__PURE__ */ s.jsxs(c, { className: "p-4 space-y-2", children: [
|
|
295
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ s.jsx(g, { schema: e }) }),
|
|
296
|
+
e.enum && /* @__PURE__ */ s.jsx(y, { values: e.enum }),
|
|
297
|
+
fe(e.description),
|
|
298
|
+
/* @__PURE__ */ s.jsx(N, { schema: e })
|
|
299
|
+
] }), m = ({
|
|
300
|
+
schema: e,
|
|
301
|
+
defaultOpen: t = !1
|
|
302
|
+
}) => {
|
|
303
|
+
if (!e || Object.keys(e).length === 0)
|
|
304
|
+
return /* @__PURE__ */ s.jsx(c, { className: "p-4", children: /* @__PURE__ */ s.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No schema specified" }) });
|
|
305
|
+
if (b(e))
|
|
306
|
+
return /* @__PURE__ */ s.jsx(w, { schema: e });
|
|
307
|
+
if (pe(e.type))
|
|
308
|
+
return O(e);
|
|
309
|
+
if (e.type === "array" && typeof e.items == "object")
|
|
310
|
+
return O(e.items);
|
|
311
|
+
if (e.type === "object") {
|
|
312
|
+
const r = re(
|
|
313
|
+
Object.entries(e.properties ?? {}),
|
|
314
|
+
([n, o]) => {
|
|
315
|
+
var l;
|
|
316
|
+
return o.deprecated ? "deprecated" : (l = e.required) != null && l.includes(n) ? "required" : "optional";
|
|
317
|
+
}
|
|
318
|
+
), i = ["required", "optional", "deprecated"];
|
|
319
|
+
return /* @__PURE__ */ s.jsx(c, { className: "divide-y overflow-hidden", children: i.map(
|
|
320
|
+
(n) => r[n] && /* @__PURE__ */ s.jsx("ul", { className: "divide-y", children: r[n].map(([o, l]) => /* @__PURE__ */ s.jsx(
|
|
321
|
+
je,
|
|
322
|
+
{
|
|
323
|
+
name: o,
|
|
324
|
+
schema: l,
|
|
325
|
+
group: n,
|
|
326
|
+
defaultOpen: t
|
|
327
|
+
},
|
|
328
|
+
o
|
|
329
|
+
)) }, n)
|
|
330
|
+
) });
|
|
331
|
+
}
|
|
332
|
+
return e.additionalProperties ? /* @__PURE__ */ s.jsxs(c, { className: "my-2", children: [
|
|
333
|
+
/* @__PURE__ */ s.jsx(G, { children: /* @__PURE__ */ s.jsx(M, { children: "Additional Properties:" }) }),
|
|
334
|
+
/* @__PURE__ */ s.jsx(K, { children: /* @__PURE__ */ s.jsx(m, { schema: e.additionalProperties }) })
|
|
335
|
+
] }) : null;
|
|
336
|
+
};
|
|
337
|
+
export {
|
|
338
|
+
y as E,
|
|
339
|
+
g as P,
|
|
340
|
+
m as S,
|
|
341
|
+
N as a,
|
|
342
|
+
re as g,
|
|
343
|
+
we as u
|
|
344
|
+
};
|
|
345
|
+
//# sourceMappingURL=SchemaView-Brn-YxHY.js.map
|