zudoku 0.4.3-dev.8 → 0.4.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/app/demo.js +4 -0
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +8 -3
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +3 -1
- package/dist/app/entry.server.js.map +1 -1
- package/dist/config/validators/SidebarSchema.js +0 -3
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +5 -0
- package/dist/config/validators/validate.js +1 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +8 -0
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/demo/DemoAnnouncement.d.ts +2 -0
- package/dist/lib/demo/DemoAnnouncement.js +4 -0
- package/dist/lib/demo/DemoAnnouncement.js.map +1 -0
- package/dist/lib/oas/parser/index.js +9 -2
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +1 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +5 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/vite/build.js +6 -2
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +1 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/prerender.js +2 -1
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{CategoryHeading-BoT0DVI-.js → CategoryHeading-DLCe0Use.js} +2 -2
- package/lib/{CategoryHeading-BoT0DVI-.js.map → CategoryHeading-DLCe0Use.js.map} +1 -1
- package/lib/{Combination-C1wKWZ28.js → Combination-B46-2_PR.js} +2 -2
- package/lib/{Combination-C1wKWZ28.js.map → Combination-B46-2_PR.js.map} +1 -1
- package/lib/{DeveloperHint-Bv958_pY.js → DeveloperHint-CCKk5wYF.js} +2 -2
- package/lib/{DeveloperHint-Bv958_pY.js.map → DeveloperHint-CCKk5wYF.js.map} +1 -1
- package/lib/{ErrorPage-CcBjrY_g.js → ErrorPage-BUyRN_4w.js} +3 -3
- package/lib/{ErrorPage-CcBjrY_g.js.map → ErrorPage-BUyRN_4w.js.map} +1 -1
- package/lib/{Input-BqnnTL7-.js → Input-C81a88Ux.js} +3 -3
- package/lib/{Input-BqnnTL7-.js.map → Input-C81a88Ux.js.map} +1 -1
- package/lib/{Markdown-C3hatKS5.js → Markdown-DWiGXWrs.js} +5 -1
- package/lib/{Markdown-C3hatKS5.js.map → Markdown-DWiGXWrs.js.map} +1 -1
- package/lib/{MdxPage-BEG8cDoF.js → MdxPage-DKD6W5vO.js} +3 -3
- package/lib/{MdxPage-BEG8cDoF.js.map → MdxPage-DKD6W5vO.js.map} +1 -1
- package/lib/{OperationList-BEiJFfFr.js → OperationList-EG2GsU0f.js} +9 -9
- package/lib/{OperationList-BEiJFfFr.js.map → OperationList-EG2GsU0f.js.map} +1 -1
- package/lib/{Route-BvREOAN6.js → Route-R9dc2BqA.js} +2 -2
- package/lib/{Route-BvREOAN6.js.map → Route-R9dc2BqA.js.map} +1 -1
- package/lib/{SidebarBadge-C6wpM9X3.js → SidebarBadge-D7XZv6EH.js} +3 -3
- package/lib/{SidebarBadge-C6wpM9X3.js.map → SidebarBadge-D7XZv6EH.js.map} +1 -1
- package/lib/{SlotletProvider-Bdzag6MN.js → SlotletProvider-BOqq0WiS.js} +4 -4
- package/lib/{SlotletProvider-Bdzag6MN.js.map → SlotletProvider-BOqq0WiS.js.map} +1 -1
- package/lib/{Spinner-DiA314T5.js → Spinner-D2_3rzdl.js} +2 -2
- package/lib/{Spinner-DiA314T5.js.map → Spinner-D2_3rzdl.js.map} +1 -1
- package/lib/assets/{worker-4PRCYVz5.js → worker-BsNqC5G3.js} +8 -7
- package/lib/assets/{worker-4PRCYVz5.js.map → worker-BsNqC5G3.js.map} +1 -1
- package/lib/{index-ClDFRC39.js → index-CcnRjD7X.js} +11 -11
- package/lib/{index-ClDFRC39.js.map → index-CcnRjD7X.js.map} +1 -1
- package/lib/{index-LWNs2niD.js → index-sjtls4Rz.js} +3 -3
- package/lib/{index-LWNs2niD.js.map → index-sjtls4Rz.js.map} +1 -1
- package/lib/prism-javascript.min-CEqHqgbm.js +9 -0
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -0
- package/lib/prism-markdown.min-F3U-vPBi.js +61 -0
- package/lib/prism-markdown.min-F3U-vPBi.js.map +1 -0
- package/lib/prism-markup-BNGj0Tvm.js +174 -0
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -0
- package/lib/prism-typescript.min-oSVeWCAd.js +6 -0
- package/lib/prism-typescript.min-oSVeWCAd.js.map +1 -0
- package/lib/state-DsXXkBLH.js.map +1 -1
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.components.js +105 -104
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +8 -7
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-page.js +1 -1
- package/lib/zudoku.plugin-markdown.js +12 -14
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/package.json +4 -4
- package/src/app/demo.tsx +4 -0
- package/src/app/entry.client.tsx +8 -5
- package/src/app/entry.server.tsx +3 -1
- package/src/app/main.css +1 -1
- package/src/lib/components/Layout.tsx +1 -0
- package/src/lib/components/SyntaxHighlight.tsx +8 -0
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/demo/DemoAnnouncement.tsx +14 -0
- package/src/lib/oas/parser/index.ts +9 -2
- package/src/lib/plugins/markdown/generateRoutes.tsx +1 -5
- package/src/lib/plugins/openapi/Sidecar.tsx +5 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { S as p, R as g } from "./SlotletProvider-
|
|
3
|
-
import { u as j, a as u, I as k, S as v, b as w, c as b, d as K, e as N, f as y } from "./Input-
|
|
2
|
+
import { S as p, R as g } from "./SlotletProvider-BOqq0WiS.js";
|
|
3
|
+
import { u as j, a as u, I as k, S as v, b as w, c as b, d as K, e as N, f as y } from "./Input-C81a88Ux.js";
|
|
4
4
|
import { e as E, L as x, O as A } from "./index-ChhUJhLT.js";
|
|
5
5
|
import { u as m, t as C, j as S } from "./ZudokuContext-BHNQL3XO.js";
|
|
6
|
-
import { B as l, p as I } from "./Combination-
|
|
7
|
-
import { D as P } from "./DeveloperHint-
|
|
6
|
+
import { B as l, p as I } from "./Combination-B46-2_PR.js";
|
|
7
|
+
import { D as P } from "./DeveloperHint-CCKk5wYF.js";
|
|
8
8
|
import { useState as h } from "react";
|
|
9
|
-
import { c as d, a as D, C as R, g as q } from "./Markdown-
|
|
9
|
+
import { c as d, a as D, C as R, g as q } from "./Markdown-DWiGXWrs.js";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.378.0 - ISC
|
|
12
12
|
*
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
const
|
|
1
|
+
import { j as c } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
const i = (t, e) => Object.entries(t).flatMap(([a, s]) => {
|
|
3
3
|
const n = a.match(/pages\/(.*).mdx?$/), o = n == null ? void 0 : n.at(1);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
path: s.at(-1) === "index" ? s.slice(0, -1).join("/") : o,
|
|
4
|
+
return o ? {
|
|
5
|
+
path: o,
|
|
8
6
|
lazy: async () => {
|
|
9
|
-
const { MdxPage:
|
|
7
|
+
const { MdxPage: r } = await import("./MdxPage-DKD6W5vO.js"), { default: p, ...m } = await s();
|
|
10
8
|
return {
|
|
11
|
-
element: /* @__PURE__ */
|
|
12
|
-
|
|
9
|
+
element: /* @__PURE__ */ c.jsx(
|
|
10
|
+
r,
|
|
13
11
|
{
|
|
14
12
|
mdxComponent: p,
|
|
15
|
-
...
|
|
13
|
+
...m,
|
|
16
14
|
defaultOptions: e
|
|
17
15
|
}
|
|
18
16
|
)
|
|
19
17
|
};
|
|
20
18
|
}
|
|
21
|
-
};
|
|
22
|
-
}),
|
|
19
|
+
} : [];
|
|
20
|
+
}), x = ({
|
|
23
21
|
markdownFiles: t,
|
|
24
22
|
defaultOptions: e
|
|
25
23
|
}) => ({
|
|
26
|
-
getRoutes: () =>
|
|
24
|
+
getRoutes: () => i(t, e)
|
|
27
25
|
});
|
|
28
26
|
export {
|
|
29
|
-
|
|
27
|
+
x as markdownPlugin
|
|
30
28
|
};
|
|
31
29
|
//# sourceMappingURL=zudoku.plugin-markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/generateRoutes.tsx","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import { type RouteObject } from \"react-router-dom\";\n\nimport {\n MarkdownPluginDefaultOptions,\n MarkdownPluginOptions,\n} from \"./index.js\";\n\nexport const generateRoutes = (\n markdownFiles: MarkdownPluginOptions[\"markdownFiles\"],\n defaultOptions?: MarkdownPluginDefaultOptions,\n): RouteObject[] =>\n Object.entries(markdownFiles).flatMap(([file, importPromise]) => {\n // @todo we can pass in the folder name and then filter the markdown files based on that path\n const match = file.match(/pages\\/(.*).mdx?$/);\n const path = match?.at(1);\n\n if (!path) return [];\n\n
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/generateRoutes.tsx","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import { type RouteObject } from \"react-router-dom\";\n\nimport {\n MarkdownPluginDefaultOptions,\n MarkdownPluginOptions,\n} from \"./index.js\";\n\nexport const generateRoutes = (\n markdownFiles: MarkdownPluginOptions[\"markdownFiles\"],\n defaultOptions?: MarkdownPluginDefaultOptions,\n): RouteObject[] =>\n Object.entries(markdownFiles).flatMap(([file, importPromise]) => {\n // @todo we can pass in the folder name and then filter the markdown files based on that path\n const match = file.match(/pages\\/(.*).mdx?$/);\n const path = match?.at(1);\n\n if (!path) return [];\n\n return {\n path,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n } satisfies RouteObject;\n });\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { generateRoutes } from \"./generateRoutes.js\";\n\nexport type MarkdownPluginOptions = {\n markdownFiles: Record<string, () => Promise<MDXImport>>;\n defaultOptions?: MarkdownPluginDefaultOptions;\n};\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = ({\n markdownFiles,\n defaultOptions,\n}: MarkdownPluginOptions): DevPortalPlugin => ({\n getRoutes: () => generateRoutes(markdownFiles, defaultOptions),\n});\n"],"names":["generateRoutes","markdownFiles","defaultOptions","file","importPromise","match","path","MdxPage","Component","props","jsx","markdownPlugin"],"mappings":";AAOO,MAAMA,IAAiB,CAC5BC,GACAC,MAEA,OAAO,QAAQD,CAAa,EAAE,QAAQ,CAAC,CAACE,GAAMC,CAAa,MAAM;AAEzD,QAAAC,IAAQF,EAAK,MAAM,mBAAmB,GACtCG,IAAOD,KAAA,gBAAAA,EAAO,GAAG;AAEnB,SAACC,IAEE;AAAA,IACL,MAAAA;AAAA,IACA,MAAM,YAAY;AAChB,YAAM,EAAE,SAAAC,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAML;AACxC,aAAA;AAAA,QACL,SACEM,gBAAAA,EAAA;AAAA,UAACH;AAAA,UAAA;AAAA,YACC,cAAcC;AAAA,YACb,GAAGC;AAAA,YACJ,gBAAAP;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAGN;AAAA,EAAA,IAhBgB;AAkBpB,CAAC,GCNUS,IAAiB,CAAC;AAAA,EAC7B,eAAAV;AAAA,EACA,gBAAAC;AACF,OAA+C;AAAA,EAC7C,WAAW,MAAMF,EAAeC,GAAeC,CAAc;AAC/D;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { o as s } from "./index-
|
|
2
|
+
import { o as s } from "./index-CcnRjD7X.js";
|
|
3
3
|
import "./urql-YhcsXYy8.js";
|
|
4
4
|
import "./ZudokuContext-BHNQL3XO.js";
|
|
5
5
|
import "zudoku/openapi-worker";
|
|
6
|
-
import "./Combination-
|
|
7
|
-
import "./ErrorPage-
|
|
8
|
-
import "./Markdown-
|
|
6
|
+
import "./Combination-B46-2_PR.js";
|
|
7
|
+
import "./ErrorPage-BUyRN_4w.js";
|
|
8
|
+
import "./Markdown-DWiGXWrs.js";
|
|
9
9
|
import "./joinPath-B7kNnUX4.js";
|
|
10
10
|
import "./router-BiRCp01d.js";
|
|
11
11
|
import "./index-ChhUJhLT.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.4.3
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"remark-frontmatter": "5.0.0",
|
|
135
135
|
"remark-gfm": "4.0.0",
|
|
136
136
|
"remark-mdx-frontmatter": "5.0.0",
|
|
137
|
-
"rollup": "^4.
|
|
137
|
+
"rollup": "^4.21.2",
|
|
138
138
|
"semver": "7.6.2",
|
|
139
139
|
"slugify": "1.6.6",
|
|
140
140
|
"strip-ansi": "7.1.0",
|
|
@@ -147,8 +147,8 @@
|
|
|
147
147
|
"yaml": "2.5.0",
|
|
148
148
|
"yargs": "17.7.2",
|
|
149
149
|
"zod": "3.23.8",
|
|
150
|
-
"zod-validation-error": "3.3.
|
|
151
|
-
"zustand": "4.5.
|
|
150
|
+
"zod-validation-error": "3.3.1",
|
|
151
|
+
"zustand": "4.5.5"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
154
|
"@radix-ui/react-dialog": "1.1.1",
|
package/src/app/demo.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { createRoot } from "react-dom/client";
|
|
|
3
3
|
import { createBrowserRouter } from "react-router-dom";
|
|
4
4
|
import { Bootstrap } from "zudoku/components";
|
|
5
5
|
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
6
|
+
import DemoAnnouncement from "../lib/demo/DemoAnnouncement.js";
|
|
6
7
|
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
7
8
|
import { themeToggle } from "../lib/themeToggle.js";
|
|
8
9
|
import "../lib/util/logInit.js";
|
|
@@ -41,6 +42,9 @@ const config = {
|
|
|
41
42
|
label: "API Reference",
|
|
42
43
|
},
|
|
43
44
|
],
|
|
45
|
+
slotlets: {
|
|
46
|
+
"layout-before-head": <DemoAnnouncement />,
|
|
47
|
+
},
|
|
44
48
|
plugins: [
|
|
45
49
|
// Using the plugin directly because there's no config file to load in the virtual plugins
|
|
46
50
|
openApiPlugin({
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -20,9 +20,8 @@ if (root.childElementCount > 0) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
);
|
|
23
|
+
const path = window.location.pathname.slice(config.basePath?.length ?? 0);
|
|
24
|
+
const lazyMatches = matchRoutes(routes, path)?.filter((m) => m.route.lazy);
|
|
26
25
|
|
|
27
26
|
if (lazyMatches?.length) {
|
|
28
27
|
await Promise.all(
|
|
@@ -35,13 +34,17 @@ async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
function render(routes: RouteObject[]) {
|
|
38
|
-
const router = createBrowserRouter(routes
|
|
37
|
+
const router = createBrowserRouter(routes, {
|
|
38
|
+
basename: config.basePath,
|
|
39
|
+
});
|
|
39
40
|
createRoot(root).render(<Bootstrap router={router} />);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
async function hydrate(routes: RouteObject[]) {
|
|
43
44
|
await hydrateLazyRoutes(routes);
|
|
44
|
-
const router = createBrowserRouter(routes
|
|
45
|
+
const router = createBrowserRouter(routes, {
|
|
46
|
+
basename: config.basePath,
|
|
47
|
+
});
|
|
45
48
|
|
|
46
49
|
hydrateRoot(root, <Bootstrap hydrate router={router} />);
|
|
47
50
|
}
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -29,7 +29,9 @@ export const render = async ({
|
|
|
29
29
|
config: ZudokuConfig;
|
|
30
30
|
}) => {
|
|
31
31
|
const routes = getRoutesByConfig(config);
|
|
32
|
-
const { query, dataRoutes } = createStaticHandler(routes
|
|
32
|
+
const { query, dataRoutes } = createStaticHandler(routes, {
|
|
33
|
+
basename: config.basePath,
|
|
34
|
+
});
|
|
33
35
|
|
|
34
36
|
const request =
|
|
35
37
|
baseRequest instanceof Request
|
package/src/app/main.css
CHANGED
|
@@ -45,6 +45,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
45
45
|
)}
|
|
46
46
|
{meta?.favicon && <link rel="icon" href={meta.favicon} />}
|
|
47
47
|
</Helmet>
|
|
48
|
+
<Slotlet name="layout-before-head" />
|
|
48
49
|
<Header />
|
|
49
50
|
|
|
50
51
|
<div className="w-full max-w-screen-2xl mx-auto px-10 lg:px-12">
|
|
@@ -15,6 +15,8 @@ import("prismjs/components/prism-ruby.min.js");
|
|
|
15
15
|
// @ts-expect-error This is untyped
|
|
16
16
|
import("prismjs/components/prism-markup-templating.js");
|
|
17
17
|
// @ts-expect-error This is untyped
|
|
18
|
+
import("prismjs/components/prism-markup.js");
|
|
19
|
+
// @ts-expect-error This is untyped
|
|
18
20
|
import("prismjs/components/prism-php.min.js");
|
|
19
21
|
// @ts-expect-error This is untyped
|
|
20
22
|
import("prismjs/components/prism-json.min.js");
|
|
@@ -24,6 +26,12 @@ import("prismjs/components/prism-java.min.js");
|
|
|
24
26
|
import("prismjs/components/prism-csharp.min.js");
|
|
25
27
|
// @ts-expect-error This is untyped
|
|
26
28
|
import("prismjs/components/prism-objectivec.min.js");
|
|
29
|
+
// @ts-expect-error This is untyped
|
|
30
|
+
import("prismjs/components/prism-markdown.min.js");
|
|
31
|
+
// @ts-expect-error This is untyped
|
|
32
|
+
import("prismjs/components/prism-javascript.min.js");
|
|
33
|
+
// @ts-expect-error This is untyped
|
|
34
|
+
import("prismjs/components/prism-typescript.min.js");
|
|
27
35
|
|
|
28
36
|
import { useState } from "react";
|
|
29
37
|
import { cn } from "../util/cn.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const DemoAnnouncement = () => (
|
|
2
|
+
<div className="h-12 w-full bg-pink-900 text-pink-100 text-center text-sm font-medium py-2 flex items-center justify-center ">
|
|
3
|
+
This demo hosting of your OpenAPI isn't as fast or flexible as self-hosting;{" "}
|
|
4
|
+
<a
|
|
5
|
+
href="https://github.com/zuplo/zudoku"
|
|
6
|
+
className="px-1 underline hover:white"
|
|
7
|
+
>
|
|
8
|
+
Get started here
|
|
9
|
+
</a>{" "}
|
|
10
|
+
to see Zudoku at full tilt.
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export default DemoAnnouncement;
|
|
@@ -73,10 +73,17 @@ const parseSchemaInput = async (
|
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
const schemaText = await response.text();
|
|
77
|
+
|
|
76
78
|
try {
|
|
77
|
-
|
|
79
|
+
if (schemaText.trim().startsWith("{")) {
|
|
80
|
+
return JSON.parse(schemaText) as JSONSchema;
|
|
81
|
+
} else {
|
|
82
|
+
const yaml = await import("yaml");
|
|
83
|
+
return yaml.parse(schemaText) as JSONSchema;
|
|
84
|
+
}
|
|
78
85
|
} catch (err) {
|
|
79
|
-
throw new GraphQLError("Fetched invalid
|
|
86
|
+
throw new GraphQLError("Fetched invalid schema", {
|
|
80
87
|
originalError: err,
|
|
81
88
|
});
|
|
82
89
|
}
|
|
@@ -16,12 +16,8 @@ export const generateRoutes = (
|
|
|
16
16
|
|
|
17
17
|
if (!path) return [];
|
|
18
18
|
|
|
19
|
-
const pathSegments = path.split("/");
|
|
20
|
-
const isIndexFile = pathSegments.at(-1) === "index";
|
|
21
|
-
const routePath = isIndexFile ? pathSegments.slice(0, -1).join("/") : path;
|
|
22
|
-
|
|
23
19
|
return {
|
|
24
|
-
path
|
|
20
|
+
path,
|
|
25
21
|
lazy: async () => {
|
|
26
22
|
const { MdxPage } = await import("./MdxPage.js");
|
|
27
23
|
const { default: Component, ...props } = await importPromise();
|
|
@@ -178,7 +178,7 @@ export const Sidecar = ({
|
|
|
178
178
|
operation={operation}
|
|
179
179
|
/>
|
|
180
180
|
</SidecarBox.Head>
|
|
181
|
-
<SidecarBox.Body>
|
|
181
|
+
<SidecarBox.Body className="max-h-[480px]">
|
|
182
182
|
<SyntaxHighlight
|
|
183
183
|
language={selectedLang}
|
|
184
184
|
noBackground
|
|
@@ -193,7 +193,10 @@ export const Sidecar = ({
|
|
|
193
193
|
value={selectedLang}
|
|
194
194
|
onChange={(e) => {
|
|
195
195
|
startTransition(() => {
|
|
196
|
-
setSearchParams(
|
|
196
|
+
setSearchParams((prev) => {
|
|
197
|
+
prev.set("lang", e.target.value);
|
|
198
|
+
return prev;
|
|
199
|
+
});
|
|
197
200
|
});
|
|
198
201
|
}}
|
|
199
202
|
options={[
|