zudoku 0.39.1 → 0.39.3
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/cli/build/handler.js +2 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/vite/api/schema-codegen.js +4 -1
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/plugin-api.js +3 -0
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +3 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/lib/{OasProvider-C7Y53snX.js → OasProvider-C4T5TU8Z.js} +2 -2
- package/lib/{OasProvider-C7Y53snX.js.map → OasProvider-C4T5TU8Z.js.map} +1 -1
- package/lib/{OperationList-_M8wg22T.js → OperationList-C-gBHUou.js} +3 -3
- package/lib/{OperationList-_M8wg22T.js.map → OperationList-C-gBHUou.js.map} +1 -1
- package/lib/{SchemaList-CrKZdUyo.js → SchemaList-DuN6ThXR.js} +3 -3
- package/lib/{SchemaList-CrKZdUyo.js.map → SchemaList-DuN6ThXR.js.map} +1 -1
- package/lib/{SchemaView-B4JHn-BX.js → SchemaView-B3fOPR4V.js} +104 -101
- package/lib/{SchemaView-B4JHn-BX.js.map → SchemaView-B3fOPR4V.js.map} +1 -1
- package/lib/{index-C8-tlf_X.js → index-DsdAaiwx.js} +4 -4
- package/lib/{index-C8-tlf_X.js.map → index-DsdAaiwx.js.map} +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -1
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -1
|
@@ -3,12 +3,12 @@ import { s as i } from "./index-LNp6rxyU.js";
|
|
|
3
3
|
import { d as j } from "./hook-CqpVYDqN.js";
|
|
4
4
|
import { ChevronsUpDownIcon as N, ChevronsDownUpIcon as y, ChevronRightIcon as C } from "lucide-react";
|
|
5
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-
|
|
6
|
+
import { C as o, a as c, b as m, c as v } from "./index-DsdAaiwx.js";
|
|
7
7
|
import { C as w } from "./CategoryHeading-DpB47wvk.js";
|
|
8
8
|
import { H as l, M as S, P as z } from "./Markdown-aF5FdsNi.js";
|
|
9
9
|
import { T } from "./Toc-YBsgI72s.js";
|
|
10
10
|
import { c as V } from "./cn-qaFjX9_3.js";
|
|
11
|
-
import { u as A, S as H } from "./SchemaView-
|
|
11
|
+
import { u as A, S as H } from "./SchemaView-B3fOPR4V.js";
|
|
12
12
|
import { u as I } from "./context-DLCwaMXN.js";
|
|
13
13
|
const M = v(
|
|
14
14
|
/* GraphQL */
|
|
@@ -145,4 +145,4 @@ function J() {
|
|
|
145
145
|
export {
|
|
146
146
|
J as SchemaList
|
|
147
147
|
};
|
|
148
|
-
//# sourceMappingURL=SchemaList-
|
|
148
|
+
//# sourceMappingURL=SchemaList-DuN6ThXR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaList-
|
|
1
|
+
{"version":3,"file":"SchemaList-DuN6ThXR.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":";;;;;;;;;;;;AAuBA,MAAMA,IAAcC;AAAA;AAAA,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAezC;AAEM,SAASC,IAAa;;AAC3B,QAAM,EAAE,OAAAC,GAAO,MAAAC,GAAM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AAAA,gBAEtB,UAAA;AAAA,kBAAOA,EAAA;AAAA,kBAAM;AAAA,kBACdd,gBAAAA,EAAA,IAACO,GAAmB,EAAA,SAAO,IACzB,UAAAP,gBAAAA,EAAAA,IAACgB,GAAO,EAAA,SAAQ,SAAQ,MAAK,QAAO,WAAU,UAC5C,UAAAhB,gBAAAA,EAAA;AAAA,oBAACiB;AAAA,oBAAA;AAAA,sBACC,MAAM;AAAA,sBACN,WAAU;AAAA,oBAAA;AAAA,qBAEd,EACF,CAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,YACAjB,gBAAAA,EAAAA,IAACU,KAAmB,WAAU,2BAC5B,gCAACQ,GAAW,EAAA,QAAQJ,EAAO,OAAQ,CAAA,EACrC,CAAA;AAAA,UAAA,KAnBgBA,EAAO,IAoBzB,CACD,EACH,CAAA;AAAA,QAAA,GACF;AAAA,QACAd,gBAAAA,EAAA;AAAA,UAACmB;AAAA,UAAA;AAAA,YACC,SAASrB,EAAQ,IAAI,CAACgB,OAAY;AAAA,cAChC,IAAIC,EAAQD,EAAO,IAAI;AAAA,cACvB,OAAOA,EAAO;AAAA,cACd,OAAO;AAAA,YAAA,EACP;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { use as
|
|
2
|
-
import { a as
|
|
3
|
-
import { i as
|
|
1
|
+
import { use as L, isValidElement as S, useState as p, useCallback as E } from "react";
|
|
2
|
+
import { a as R } from "./context-DLCwaMXN.js";
|
|
3
|
+
import { i as z, S as A, L as T, T as f, a as B, p as $, C as D } from "./circular-ByJI6Mci.js";
|
|
4
4
|
import { j as s } from "./jsx-runtime-CYK1ROHF.js";
|
|
5
|
-
import { I, S as
|
|
6
|
-
import { Card as
|
|
7
|
-
import { c
|
|
8
|
-
import { ChevronsLeftRightIcon as
|
|
9
|
-
import { B as
|
|
5
|
+
import { I as O, S as u, M as I, P as k } from "./Markdown-aF5FdsNi.js";
|
|
6
|
+
import { Card as d, CardHeader as q, CardTitle as G, CardContent as M } from "./ui/Card.js";
|
|
7
|
+
import { c } from "./cn-qaFjX9_3.js";
|
|
8
|
+
import { ChevronsLeftRightIcon as K, ChevronUpIcon as F, ChevronDownIcon as v, CircleIcon as Q, CircleDotIcon as H, CircleFadingPlusIcon as J, SquareMinusIcon as U, SquarePlusIcon as _, MinusIcon as V, PlusIcon as W, RefreshCcwDotIcon as X } from "lucide-react";
|
|
9
|
+
import { B as Y } from "./Button-Fp19CMUr.js";
|
|
10
10
|
import * as a from "@radix-ui/react-collapsible";
|
|
11
|
-
import { Button as
|
|
12
|
-
import { o as
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
11
|
+
import { Button as Z } from "./ui/Button.js";
|
|
12
|
+
import { o as ee } from "./objectEntries-yMIkr2mI.js";
|
|
13
|
+
function se(e) {
|
|
14
|
+
const t = z(e) ? e : new A(e), r = t.body, i = new T(t);
|
|
15
15
|
let n = "", o = !1;
|
|
16
|
-
for (; i.advance().kind !==
|
|
17
|
-
const l = i.token,
|
|
18
|
-
o && (h || l.kind ===
|
|
19
|
-
const
|
|
20
|
-
|
|
16
|
+
for (; i.advance().kind !== f.EOF; ) {
|
|
17
|
+
const l = i.token, m = l.kind, h = !B(l.kind);
|
|
18
|
+
o && (h || l.kind === f.SPREAD) && (n += " ");
|
|
19
|
+
const w = r.slice(l.start, l.end);
|
|
20
|
+
m === f.BLOCK_STRING ? n += $(l.value, {
|
|
21
21
|
minimize: !0
|
|
22
|
-
}) : n +=
|
|
22
|
+
}) : n += w, o = h;
|
|
23
23
|
}
|
|
24
24
|
return n;
|
|
25
25
|
}
|
|
26
26
|
const we = (e, ...[t]) => {
|
|
27
|
-
const r =
|
|
27
|
+
const r = L(R);
|
|
28
28
|
if (r === void 0)
|
|
29
29
|
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
30
30
|
return {
|
|
31
31
|
queryFn: () => r.fetch(e, t),
|
|
32
|
-
queryKey: [
|
|
32
|
+
queryKey: [se(e.toString()), t]
|
|
33
33
|
};
|
|
34
|
-
},
|
|
34
|
+
}, te = (e, t) => e.reduce(
|
|
35
35
|
(r, i) => {
|
|
36
36
|
const n = t(i);
|
|
37
37
|
return r[n] || (r[n] = []), r[n].push(i), r;
|
|
38
38
|
},
|
|
39
39
|
{}
|
|
40
|
-
),
|
|
41
|
-
const [t, r] =
|
|
40
|
+
), re = ({ pattern: e }) => {
|
|
41
|
+
const [t, r] = p(!1), i = e.length > 20, n = i ? `${e.slice(0, 20)}…` : e;
|
|
42
42
|
return /* @__PURE__ */ s.jsxs(
|
|
43
|
-
|
|
43
|
+
O,
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
45
|
+
className: c("text-xs", i && "cursor-pointer"),
|
|
46
46
|
onClick: () => r(!t),
|
|
47
47
|
selectOnClick: !1,
|
|
48
48
|
children: [
|
|
49
49
|
t ? e : n,
|
|
50
|
-
i && /* @__PURE__ */ s.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !t && /* @__PURE__ */ s.jsx(
|
|
50
|
+
i && /* @__PURE__ */ s.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !t && /* @__PURE__ */ s.jsx(K, { size: 12 }) })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
},
|
|
54
|
+
}, ne = (e) => e ? [
|
|
55
55
|
e.type === "array" && e.items.type ? `${e.items.type}[]` : Array.isArray(e.type) ? e.type.join(" | ") : e.type,
|
|
56
56
|
e.enum && "enum",
|
|
57
57
|
e.format,
|
|
@@ -69,15 +69,15 @@ const we = (e, ...[t]) => {
|
|
|
69
69
|
e.deprecated && "deprecated",
|
|
70
70
|
e.pattern && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
71
71
|
"pattern: ",
|
|
72
|
-
/* @__PURE__ */ s.jsx(
|
|
72
|
+
/* @__PURE__ */ s.jsx(re, { pattern: e.pattern })
|
|
73
73
|
] })
|
|
74
|
-
] : [],
|
|
74
|
+
] : [], j = ({
|
|
75
75
|
schema: e,
|
|
76
76
|
extraItems: t = [],
|
|
77
77
|
className: r
|
|
78
78
|
}) => {
|
|
79
|
-
const i = [...
|
|
80
|
-
(n) => typeof n == "string" ||
|
|
79
|
+
const i = [...ne(e), ...t].flatMap(
|
|
80
|
+
(n) => typeof n == "string" || S(n) ? n : []
|
|
81
81
|
);
|
|
82
82
|
return /* @__PURE__ */ s.jsx("span", { className: r, children: i.map((n, o) => /* @__PURE__ */ s.jsxs("span", { className: "text-muted-foreground", children: [
|
|
83
83
|
n,
|
|
@@ -88,24 +88,24 @@ const we = (e, ...[t]) => {
|
|
|
88
88
|
className: t,
|
|
89
89
|
maxVisibleValues: r = 8
|
|
90
90
|
}) => {
|
|
91
|
-
const [i, n] =
|
|
91
|
+
const [i, n] = p(!1);
|
|
92
92
|
if (!e.length) return null;
|
|
93
93
|
const o = e.length > r, l = o && !i ? e.slice(0, r) : e;
|
|
94
|
-
return /* @__PURE__ */ s.jsxs("div", { className:
|
|
94
|
+
return /* @__PURE__ */ s.jsxs("div", { className: c("flex flex-wrap gap-1.5 text-xs", t), children: [
|
|
95
95
|
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Enum values: " }),
|
|
96
|
-
l.map((
|
|
96
|
+
l.map((m) => /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: m }) }, m)),
|
|
97
97
|
o && /* @__PURE__ */ s.jsx(
|
|
98
|
-
|
|
98
|
+
Y,
|
|
99
99
|
{
|
|
100
100
|
variant: "ghost",
|
|
101
101
|
size: "sm",
|
|
102
102
|
className: "h-fit px-0",
|
|
103
103
|
onClick: () => n(!i),
|
|
104
104
|
children: i ? /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
105
|
-
/* @__PURE__ */ s.jsx(
|
|
105
|
+
/* @__PURE__ */ s.jsx(F, { size: 12 }),
|
|
106
106
|
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "show less" })
|
|
107
107
|
] }) : /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
108
|
-
/* @__PURE__ */ s.jsx(
|
|
108
|
+
/* @__PURE__ */ s.jsx(v, { size: 12 }),
|
|
109
109
|
/* @__PURE__ */ s.jsxs("span", { className: "text-muted-foreground", children: [
|
|
110
110
|
"show ",
|
|
111
111
|
e.length - r,
|
|
@@ -123,22 +123,22 @@ const we = (e, ...[t]) => {
|
|
|
123
123
|
return !t && !r ? null : /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col gap-1 text-xs", children: [
|
|
124
124
|
t && /* @__PURE__ */ s.jsxs("div", { children: [
|
|
125
125
|
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Example: " }),
|
|
126
|
-
/* @__PURE__ */ s.jsx(
|
|
126
|
+
/* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: typeof t == "object" ? JSON.stringify(t) : t })
|
|
127
127
|
] }),
|
|
128
128
|
r && /* @__PURE__ */ s.jsxs("div", { children: [
|
|
129
129
|
/* @__PURE__ */ s.jsx("span", { className: "text-muted-foreground", children: "Default: " }),
|
|
130
|
-
/* @__PURE__ */ s.jsx(
|
|
130
|
+
/* @__PURE__ */ s.jsx(u, { className: "border rounded px-1 font-mono", children: typeof r == "object" ? JSON.stringify(r) : r })
|
|
131
131
|
] })
|
|
132
132
|
] });
|
|
133
|
+
}, ie = {
|
|
134
|
+
AND: /* @__PURE__ */ s.jsx(J, { size: 16, className: "fill-card" }),
|
|
135
|
+
OR: /* @__PURE__ */ s.jsx(H, { size: 16, className: "fill-card" }),
|
|
136
|
+
ONE: /* @__PURE__ */ s.jsx(Q, { size: 14, className: "fill-card" })
|
|
133
137
|
}, 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
138
|
AND: "text-green-500 dark:text-green-300/60",
|
|
139
139
|
OR: "text-blue-400 dark:text-blue-500",
|
|
140
140
|
ONE: "text-purple-500 dark:text-purple-300/60"
|
|
141
|
-
},
|
|
141
|
+
}, le = ({
|
|
142
142
|
type: e,
|
|
143
143
|
isOpen: t,
|
|
144
144
|
className: r,
|
|
@@ -146,29 +146,29 @@ const we = (e, ...[t]) => {
|
|
|
146
146
|
}) => /* @__PURE__ */ s.jsx(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
|
-
className:
|
|
150
|
-
|
|
149
|
+
className: c(
|
|
150
|
+
oe[e],
|
|
151
151
|
"relative text-sm flex py-2",
|
|
152
152
|
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
153
153
|
r
|
|
154
154
|
),
|
|
155
155
|
children: /* @__PURE__ */ s.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
156
|
-
|
|
156
|
+
ie[e],
|
|
157
157
|
/* @__PURE__ */ s.jsx(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
|
-
className:
|
|
160
|
+
className: c(
|
|
161
161
|
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
162
162
|
!t && "-rotate-90"
|
|
163
163
|
),
|
|
164
|
-
children: /* @__PURE__ */ s.jsx(
|
|
164
|
+
children: /* @__PURE__ */ s.jsx(v, { size: 16 })
|
|
165
165
|
}
|
|
166
166
|
),
|
|
167
167
|
/* @__PURE__ */ s.jsx("span", { className: "text-sm text-foreground", children: i })
|
|
168
168
|
] })
|
|
169
169
|
}
|
|
170
|
-
),
|
|
171
|
-
const [t, r] =
|
|
170
|
+
), ae = (e) => {
|
|
171
|
+
const [t, r] = p(!0);
|
|
172
172
|
return /* @__PURE__ */ s.jsxs(
|
|
173
173
|
a.Root,
|
|
174
174
|
{
|
|
@@ -177,7 +177,7 @@ const we = (e, ...[t]) => {
|
|
|
177
177
|
className: "group",
|
|
178
178
|
children: [
|
|
179
179
|
/* @__PURE__ */ s.jsx(a.Trigger, { children: /* @__PURE__ */ s.jsx(
|
|
180
|
-
|
|
180
|
+
le,
|
|
181
181
|
{
|
|
182
182
|
type: e.type,
|
|
183
183
|
isOpen: t,
|
|
@@ -185,38 +185,38 @@ const we = (e, ...[t]) => {
|
|
|
185
185
|
}
|
|
186
186
|
) }),
|
|
187
187
|
!t && /* @__PURE__ */ s.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
|
|
188
|
-
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx(
|
|
188
|
+
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx(x, { schema: e.schema }) })
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
);
|
|
192
|
-
},
|
|
192
|
+
}, de = {
|
|
193
193
|
AND: "All of",
|
|
194
194
|
OR: "Any of",
|
|
195
195
|
ONE: "One of"
|
|
196
|
-
},
|
|
196
|
+
}, ce = ({
|
|
197
197
|
schemas: e,
|
|
198
198
|
type: t,
|
|
199
199
|
isOpen: r,
|
|
200
200
|
toggleOpen: i
|
|
201
|
-
}) => /* @__PURE__ */ s.jsx(a.Root, { open: r, onOpenChange: i, asChild: !0, children: /* @__PURE__ */ s.jsxs(
|
|
201
|
+
}) => /* @__PURE__ */ s.jsx(a.Root, { open: r, onOpenChange: i, asChild: !0, children: /* @__PURE__ */ s.jsxs(d, { className: "px-6", children: [
|
|
202
202
|
/* @__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: [
|
|
203
|
-
r ? /* @__PURE__ */ s.jsx(
|
|
204
|
-
/* @__PURE__ */ s.jsx("span", { children:
|
|
203
|
+
r ? /* @__PURE__ */ s.jsx(U, { size: 14 }) : /* @__PURE__ */ s.jsx(_, { size: 14 }),
|
|
204
|
+
/* @__PURE__ */ s.jsx("span", { children: de[t] })
|
|
205
205
|
] }),
|
|
206
206
|
/* @__PURE__ */ s.jsx(a.Content, { className: "pb-4", children: e.map((n, o) => (
|
|
207
207
|
// eslint-disable-next-line react/no-array-index-key
|
|
208
|
-
/* @__PURE__ */ s.jsx(
|
|
208
|
+
/* @__PURE__ */ s.jsx(ae, { type: t, schema: n }, o)
|
|
209
209
|
)) })
|
|
210
|
-
] }) }),
|
|
210
|
+
] }) }), xe = (e) => typeof e == "string" && ["string", "number", "boolean", "integer", "null"].includes(e), pe = (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 = {
|
|
211
211
|
allOf: "AND",
|
|
212
212
|
anyOf: "OR",
|
|
213
213
|
oneOf: "ONE"
|
|
214
|
-
},
|
|
215
|
-
const [t, r] =
|
|
216
|
-
for (const [n, o] of
|
|
214
|
+
}, g = (e) => e === D, P = ({ schema: e }) => {
|
|
215
|
+
const [t, r] = p(!0), i = E(() => r((n) => !n), []);
|
|
216
|
+
for (const [n, o] of ee(me))
|
|
217
217
|
if (e[n])
|
|
218
218
|
return /* @__PURE__ */ s.jsx(
|
|
219
|
-
|
|
219
|
+
ce,
|
|
220
220
|
{
|
|
221
221
|
schemas: e[n],
|
|
222
222
|
type: o,
|
|
@@ -225,28 +225,28 @@ const we = (e, ...[t]) => {
|
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
}, C = () => /* @__PURE__ */ s.jsxs(
|
|
228
|
-
|
|
228
|
+
O,
|
|
229
229
|
{
|
|
230
230
|
className: "inline-flex items-center gap-1.5 italic text-xs translate-y-0.5",
|
|
231
231
|
selectOnClick: !1,
|
|
232
232
|
children: [
|
|
233
|
-
/* @__PURE__ */ s.jsx(
|
|
233
|
+
/* @__PURE__ */ s.jsx(X, { size: 13 }),
|
|
234
234
|
/* @__PURE__ */ s.jsx("span", { children: "circular" })
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
|
-
),
|
|
237
|
+
), ue = ({
|
|
238
238
|
name: e,
|
|
239
239
|
schema: t,
|
|
240
240
|
group: r,
|
|
241
241
|
defaultOpen: i = !1,
|
|
242
242
|
showCollapseButton: n = !0
|
|
243
243
|
}) => {
|
|
244
|
-
const [o, l] =
|
|
245
|
-
return
|
|
244
|
+
const [o, l] = p(i);
|
|
245
|
+
return g(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: [
|
|
246
246
|
/* @__PURE__ */ s.jsxs("div", { className: "space-x-2", children: [
|
|
247
247
|
/* @__PURE__ */ s.jsx("code", { children: e }),
|
|
248
248
|
/* @__PURE__ */ s.jsx(
|
|
249
|
-
|
|
249
|
+
j,
|
|
250
250
|
{
|
|
251
251
|
schema: t,
|
|
252
252
|
extraItems: [/* @__PURE__ */ s.jsx(C, {}, "circular-ref")]
|
|
@@ -256,78 +256,81 @@ const we = (e, ...[t]) => {
|
|
|
256
256
|
/* @__PURE__ */ s.jsx(N, { schema: t })
|
|
257
257
|
] }) }) : /* @__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: [
|
|
258
258
|
/* @__PURE__ */ s.jsxs("div", { className: "space-x-2", children: [
|
|
259
|
-
/* @__PURE__ */ s.jsx(
|
|
259
|
+
/* @__PURE__ */ s.jsx(u, { asChild: !0, children: /* @__PURE__ */ s.jsx("code", { children: e }) }),
|
|
260
260
|
/* @__PURE__ */ s.jsx(
|
|
261
|
-
|
|
261
|
+
j,
|
|
262
262
|
{
|
|
263
263
|
schema: t,
|
|
264
264
|
extraItems: [
|
|
265
265
|
r !== "optional" && /* @__PURE__ */ s.jsx("span", { className: "text-primary", children: "required" }),
|
|
266
|
-
t.type === "array" && "items" in t &&
|
|
266
|
+
t.type === "array" && "items" in t && g(t.items) && /* @__PURE__ */ s.jsx(C, {})
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
)
|
|
270
270
|
] }),
|
|
271
271
|
t.description && /* @__PURE__ */ s.jsx(
|
|
272
|
-
|
|
272
|
+
I,
|
|
273
273
|
{
|
|
274
|
-
className:
|
|
274
|
+
className: c(k, "text-sm leading-normal line-clamp-4"),
|
|
275
275
|
content: t.description
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
278
|
t.type === "array" && "items" in t && t.items.enum && /* @__PURE__ */ s.jsx(y, { values: t.items.enum }),
|
|
279
279
|
t.enum && /* @__PURE__ */ s.jsx(y, { values: t.enum }),
|
|
280
280
|
/* @__PURE__ */ s.jsx(N, { schema: t }),
|
|
281
|
-
(b(t) ||
|
|
281
|
+
(b(t) || pe(t)) && /* @__PURE__ */ s.jsxs(
|
|
282
282
|
a.Root,
|
|
283
283
|
{
|
|
284
284
|
defaultOpen: i,
|
|
285
285
|
open: o,
|
|
286
286
|
onOpenChange: () => l(!o),
|
|
287
287
|
children: [
|
|
288
|
-
n && /* @__PURE__ */ s.jsx(a.Trigger, { asChild: !0, children: /* @__PURE__ */ s.jsxs(
|
|
289
|
-
o ? /* @__PURE__ */ s.jsx(
|
|
288
|
+
n && /* @__PURE__ */ s.jsx(a.Trigger, { asChild: !0, children: /* @__PURE__ */ s.jsxs(Z, { variant: "expand", size: "sm", className: "h-7", children: [
|
|
289
|
+
o ? /* @__PURE__ */ s.jsx(V, { size: 12 }) : /* @__PURE__ */ s.jsx(W, { size: 12 }),
|
|
290
290
|
o ? "Hide properties" : "Show properties"
|
|
291
291
|
] }) }),
|
|
292
|
-
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx("div", { className: "mt-2", children: b(t) ? /* @__PURE__ */ s.jsx(
|
|
292
|
+
/* @__PURE__ */ s.jsx(a.Content, { children: /* @__PURE__ */ s.jsx("div", { className: "mt-2", children: b(t) ? /* @__PURE__ */ s.jsx(P, { schema: t }) : t.type === "object" ? /* @__PURE__ */ s.jsx(x, { schema: t }) : t.type === "array" && "items" in t && typeof t.items == "object" && !g(t.items) && /* @__PURE__ */ s.jsx(x, { schema: t.items }) }) })
|
|
293
293
|
]
|
|
294
294
|
}
|
|
295
295
|
)
|
|
296
296
|
] }) });
|
|
297
|
-
},
|
|
298
|
-
|
|
297
|
+
}, je = (e) => e && /* @__PURE__ */ s.jsx(
|
|
298
|
+
I,
|
|
299
299
|
{
|
|
300
|
-
className:
|
|
300
|
+
className: c(k, "text-sm leading-normal line-clamp-4"),
|
|
301
301
|
content: e
|
|
302
302
|
}
|
|
303
|
-
),
|
|
304
|
-
/* @__PURE__ */ s.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ s.jsx(
|
|
303
|
+
), fe = (e) => /* @__PURE__ */ s.jsxs(d, { className: "p-4 space-y-2", children: [
|
|
304
|
+
/* @__PURE__ */ s.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ s.jsx(j, { schema: e }) }),
|
|
305
305
|
e.enum && /* @__PURE__ */ s.jsx(y, { values: e.enum }),
|
|
306
|
-
|
|
306
|
+
je(e.description),
|
|
307
307
|
/* @__PURE__ */ s.jsx(N, { schema: e })
|
|
308
|
-
] }),
|
|
308
|
+
] }), x = ({
|
|
309
309
|
schema: e,
|
|
310
310
|
defaultOpen: t = !1
|
|
311
311
|
}) => {
|
|
312
312
|
if (!e || Object.keys(e).length === 0)
|
|
313
|
-
return /* @__PURE__ */ s.jsx(
|
|
313
|
+
return /* @__PURE__ */ s.jsx(d, { className: "p-4", children: /* @__PURE__ */ s.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No schema specified" }) });
|
|
314
314
|
if (b(e))
|
|
315
|
-
return /* @__PURE__ */ s.jsx(
|
|
316
|
-
if (
|
|
317
|
-
return
|
|
315
|
+
return /* @__PURE__ */ s.jsx(P, { schema: e });
|
|
316
|
+
if (xe(e.type))
|
|
317
|
+
return fe(e);
|
|
318
318
|
if (e.type === "array" && typeof e.items == "object")
|
|
319
|
-
return
|
|
319
|
+
return /* @__PURE__ */ s.jsxs(d, { className: "p-4 space-y-2 text-sm", children: [
|
|
320
|
+
/* @__PURE__ */ s.jsx(j, { schema: e }),
|
|
321
|
+
/* @__PURE__ */ s.jsx(x, { schema: e.items })
|
|
322
|
+
] });
|
|
320
323
|
if (e.type === "object") {
|
|
321
|
-
const r =
|
|
324
|
+
const r = te(
|
|
322
325
|
Object.entries(e.properties ?? {}),
|
|
323
326
|
([n, o]) => {
|
|
324
327
|
var l;
|
|
325
328
|
return o.deprecated ? "deprecated" : (l = e.required) != null && l.includes(n) ? "required" : "optional";
|
|
326
329
|
}
|
|
327
330
|
), i = ["required", "optional", "deprecated"];
|
|
328
|
-
return /* @__PURE__ */ s.jsx(
|
|
331
|
+
return /* @__PURE__ */ s.jsx(d, { className: "divide-y overflow-hidden", children: i.map(
|
|
329
332
|
(n) => r[n] && /* @__PURE__ */ s.jsx("ul", { className: "divide-y", children: r[n].map(([o, l]) => /* @__PURE__ */ s.jsx(
|
|
330
|
-
|
|
333
|
+
ue,
|
|
331
334
|
{
|
|
332
335
|
name: o,
|
|
333
336
|
schema: l,
|
|
@@ -338,17 +341,17 @@ const we = (e, ...[t]) => {
|
|
|
338
341
|
)) }, n)
|
|
339
342
|
) });
|
|
340
343
|
}
|
|
341
|
-
return e.additionalProperties ? /* @__PURE__ */ s.jsxs(
|
|
342
|
-
/* @__PURE__ */ s.jsx(
|
|
343
|
-
/* @__PURE__ */ s.jsx(
|
|
344
|
+
return e.additionalProperties ? /* @__PURE__ */ s.jsxs(d, { className: "my-2", children: [
|
|
345
|
+
/* @__PURE__ */ s.jsx(q, { children: /* @__PURE__ */ s.jsx(G, { children: "Additional Properties:" }) }),
|
|
346
|
+
/* @__PURE__ */ s.jsx(M, { children: /* @__PURE__ */ s.jsx(x, { schema: e.additionalProperties }) })
|
|
344
347
|
] }) : null;
|
|
345
348
|
};
|
|
346
349
|
export {
|
|
347
350
|
y as E,
|
|
348
|
-
|
|
349
|
-
|
|
351
|
+
j as P,
|
|
352
|
+
x as S,
|
|
350
353
|
N as a,
|
|
351
|
-
|
|
354
|
+
te as g,
|
|
352
355
|
we as u
|
|
353
356
|
};
|
|
354
|
-
//# sourceMappingURL=SchemaView-
|
|
357
|
+
//# sourceMappingURL=SchemaView-B3fOPR4V.js.map
|