zudoku 0.0.0-eff6f9b → 0.0.0-f3858d6
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/cli.js +2 -2
- package/dist/app/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +3 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +9 -24
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +2 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -1
- package/dist/config/validators/SidebarSchema.d.ts +1 -1
- package/dist/config/validators/SidebarSchema.js +5 -9
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +97 -30
- package/dist/config/validators/validate.js +10 -7
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +16 -0
- package/dist/lib/authentication/state.js +5 -0
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +1 -2
- package/dist/lib/components/ErrorPage.js.map +1 -1
- package/dist/lib/components/Header.js +5 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +9 -1
- package/dist/lib/components/InlineCode.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/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +5 -2
- package/dist/lib/components/SlotletProvider.js +6 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +30 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +4 -9
- package/dist/lib/components/context/ZudokuContext.js +26 -20
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +2 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +1 -3
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -3
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +10 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +4 -7
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +2 -1
- package/dist/lib/oas/graphql/index.js +23 -15
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/{custom-page → custom-pages}/index.d.ts +2 -2
- package/dist/lib/plugins/{custom-page → custom-pages}/index.js +1 -1
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.js +2 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +5 -6
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
- package/dist/lib/plugins/openapi/Endpoint.js +46 -8
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +1 -1
- package/dist/lib/plugins/openapi/Route.js +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +15 -4
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +26 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +3 -2
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +13 -5
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +7 -2
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +1 -1
- package/dist/vite/config.js +22 -16
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.d.ts +6 -1
- package/dist/vite/dev-server.js +14 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +4 -7
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +0 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +9 -4
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin-docs.js +26 -26
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -0
- package/dist/vite/plugin-frontmatter.js +30 -0
- package/dist/vite/plugin-frontmatter.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +19 -3
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +4 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -1
- package/dist/vite/prerender.js +6 -5
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{utils-DtEHoAvg.js → AnchorLink-DovtSBJk.js} +214 -261
- package/lib/AnchorLink-DovtSBJk.js.map +1 -0
- package/lib/{AuthenticationPlugin-gtf8JS3V.js → AuthenticationPlugin-Cnqy9csQ.js} +3 -3
- package/lib/{AuthenticationPlugin-gtf8JS3V.js.map → AuthenticationPlugin-Cnqy9csQ.js.map} +1 -1
- package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-C7VfgpFZ.js} +2 -2
- package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-C7VfgpFZ.js.map} +1 -1
- package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-CNyuFROc.js} +2 -2
- package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-CNyuFROc.js.map} +1 -1
- package/lib/ErrorPage-CUz-Zzmx.js +16 -0
- package/lib/ErrorPage-CUz-Zzmx.js.map +1 -0
- package/lib/Input-x-t53FyR.js +2229 -0
- package/lib/Input-x-t53FyR.js.map +1 -0
- package/lib/{Markdown-B4aR03g6.js → Markdown-C-0TaxoY.js} +1448 -1286
- package/lib/Markdown-C-0TaxoY.js.map +1 -0
- package/lib/{MdxPage-BcftTg5g.js → MdxPage-C5I9c7R1.js} +19 -18
- package/lib/MdxPage-C5I9c7R1.js.map +1 -0
- package/lib/{OperationList-Da36LrGl.js → OperationList-qsBOguHS.js} +149 -108
- package/lib/OperationList-qsBOguHS.js.map +1 -0
- package/lib/{Route-CWj1ECzh.js → Route-DlKvXPAO.js} +3 -4
- package/lib/Route-DlKvXPAO.js.map +1 -0
- package/lib/SidebarBadge-DaA0-bFW.js +503 -0
- package/lib/SidebarBadge-DaA0-bFW.js.map +1 -0
- package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-BGEs7yyu.js} +28 -26
- package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-BGEs7yyu.js.map} +1 -1
- package/lib/ZudokuContext-DSipF8sq.js +1222 -0
- package/lib/ZudokuContext-DSipF8sq.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
- package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
- package/lib/assets/{worker-TYRbYl6N.js → worker-DaFlmuyf.js} +6549 -4277
- package/lib/assets/worker-DaFlmuyf.js.map +1 -0
- package/lib/{index-DIkaYL-l.js → index-BIl-R3aH.js} +1943 -1675
- package/lib/index-BIl-R3aH.js.map +1 -0
- package/lib/{index-B_9xr661.js → index-CKmSo0py.js} +3 -3
- package/lib/{index-B_9xr661.js.map → index-CKmSo0py.js.map} +1 -1
- package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
- package/lib/index-CkwDvuPt.js.map +1 -0
- package/lib/index-D06ATMgg.js +2094 -0
- package/lib/index-D06ATMgg.js.map +1 -0
- package/lib/index-DJqnphbT.js +35 -0
- package/lib/index-DJqnphbT.js.map +1 -0
- package/lib/{index-BoXX7LeD.js → index-Dssw7Gff.js} +597 -544
- package/lib/index-Dssw7Gff.js.map +1 -0
- package/lib/{index-BG0g4WW0.js → index-SrtqdZ3j.js} +746 -736
- package/lib/index-SrtqdZ3j.js.map +1 -0
- package/lib/router-Oe6YmY6B.js +3024 -0
- package/lib/router-Oe6YmY6B.js.map +1 -0
- package/lib/state-CsuHT8ZO.js +183 -0
- package/lib/state-CsuHT8ZO.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js +1455 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +363 -350
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1717 -1633
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +4485 -4283
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +7 -7
- package/lib/{zudoku.plugin-custom-page.js → zudoku.plugin-custom-pages.js} +3 -3
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +93 -27
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -8
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +71 -69
- package/src/app/entry.client.tsx +4 -2
- package/src/app/entry.server.tsx +4 -0
- package/src/app/main.css +4 -0
- package/src/app/main.tsx +12 -28
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/state.ts +17 -0
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/ErrorPage.tsx +0 -2
- package/src/lib/components/Header.tsx +13 -3
- package/src/lib/components/InlineCode.tsx +10 -0
- package/src/lib/components/Layout.tsx +2 -1
- package/src/lib/components/MobileTopNavigation.tsx +2 -0
- package/src/lib/components/SlotletProvider.tsx +20 -4
- package/src/lib/components/TopNavigation.tsx +58 -24
- package/src/lib/components/context/ZudokuContext.ts +28 -20
- package/src/lib/components/index.ts +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +5 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +1 -3
- package/src/lib/components/navigation/SidebarItem.tsx +1 -3
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/DevPortalContext.ts +4 -3
- package/src/lib/core/plugins.ts +2 -0
- package/src/lib/oas/graphql/index.ts +35 -23
- package/src/lib/oas/parser/index.ts +1 -0
- package/src/lib/plugins/{custom-page → custom-pages}/index.tsx +3 -3
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- package/src/lib/plugins/markdown/index.tsx +49 -12
- package/src/lib/plugins/markdown/resolver.ts +92 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
- package/src/lib/plugins/openapi/OperationList.tsx +4 -2
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Route.tsx +1 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +19 -4
- package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +113 -1
- package/src/lib/plugins/openapi/index.tsx +4 -7
- package/src/lib/plugins/openapi/playground/Playground.tsx +39 -5
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
- package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
- package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/dist/lib/util/slugify.d.ts +0 -2
- package/dist/lib/util/slugify.js +0 -3
- package/dist/lib/util/slugify.js.map +0 -1
- package/dist/vite/plugin-icons.d.ts +0 -3
- package/dist/vite/plugin-icons.js +0 -47
- package/dist/vite/plugin-icons.js.map +0 -1
- package/lib/ErrorPage-knunPbKI.js +0 -18
- package/lib/ErrorPage-knunPbKI.js.map +0 -1
- package/lib/Input-B1kkVL1R.js +0 -2198
- package/lib/Input-B1kkVL1R.js.map +0 -1
- package/lib/Markdown-B4aR03g6.js.map +0 -1
- package/lib/MdxPage-BcftTg5g.js.map +0 -1
- package/lib/OperationList-Da36LrGl.js.map +0 -1
- package/lib/Route-CWj1ECzh.js.map +0 -1
- package/lib/SidebarBadge-DdvT2qep.js +0 -498
- package/lib/SidebarBadge-DdvT2qep.js.map +0 -1
- package/lib/ZudokuContext-em1gHkIY.js +0 -1084
- package/lib/ZudokuContext-em1gHkIY.js.map +0 -1
- package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-TYRbYl6N.js.map +0 -1
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-BoXX7LeD.js.map +0 -1
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-DIkaYL-l.js.map +0 -1
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/slugify-DbLhpSPt.js +0 -28
- package/lib/slugify-DbLhpSPt.js.map +0 -1
- package/lib/state-BUM4jc0J.js +0 -288
- package/lib/state-BUM4jc0J.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-DtEHoAvg.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
- package/src/lib/util/slugify.ts +0 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { S as x, R as f } from "./SlotletProvider-
|
|
3
|
-
import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-
|
|
4
|
-
import { a as N, L as u, O as I } from "./index-
|
|
5
|
-
import {
|
|
6
|
-
import { B as l,
|
|
7
|
-
import { D as C } from "./DeveloperHint-
|
|
2
|
+
import { S as x, R as f } from "./SlotletProvider-BGEs7yyu.js";
|
|
3
|
+
import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-x-t53FyR.js";
|
|
4
|
+
import { a as N, L as u, O as I } from "./index-SrtqdZ3j.js";
|
|
5
|
+
import { b as h, c as E, d as S } from "./ZudokuContext-DSipF8sq.js";
|
|
6
|
+
import { B as l, n as A } from "./index-Dssw7Gff.js";
|
|
7
|
+
import { D as C } from "./DeveloperHint-CNyuFROc.js";
|
|
8
8
|
import { RotateCwIcon as P, TrashIcon as D, EyeOffIcon as R, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
|
|
9
9
|
import { useState as p } from "react";
|
|
10
|
-
import { a as T } from "./Markdown-
|
|
10
|
+
import { a as T } from "./Markdown-C-0TaxoY.js";
|
|
11
11
|
function c(t, s) {
|
|
12
12
|
if (t)
|
|
13
13
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as m } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { P as o } from "./Markdown-
|
|
2
|
+
import { P as o } from "./Markdown-C-0TaxoY.js";
|
|
3
3
|
const l = (s) => ({
|
|
4
4
|
getRoutes: () => s.map(({ path: e, element: t }) => ({
|
|
5
5
|
path: e,
|
|
@@ -8,6 +8,6 @@ const l = (s) => ({
|
|
|
8
8
|
}))
|
|
9
9
|
});
|
|
10
10
|
export {
|
|
11
|
-
l as
|
|
11
|
+
l as customPagesPlugin
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=zudoku.plugin-custom-
|
|
13
|
+
//# sourceMappingURL=zudoku.plugin-custom-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-custom-pages.js","sources":["../src/lib/plugins/custom-pages/index.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\n\ntype CustomPagesConfig = Array<{\n path: string;\n element: ReactNode;\n}>;\n\nexport const customPagesPlugin = (\n config: CustomPagesConfig,\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, element }) => ({\n path,\n // TODO: we should componentize prose pages\n element: <div className={ProseClasses + \" max-w-full\"}>{element}</div>,\n })),\n };\n};\n"],"names":["customPagesPlugin","config","path","element","jsx","ProseClasses"],"mappings":";;AAUa,MAAAA,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,SAAAC,SAAe;AAAA,IACjC,MAAAD;AAAA;AAAA,IAEA,SAAUE,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAWC,IAAe,eAAgB,UAAQF,GAAA;AAAA,EAAA,EAChE;AAAA;"}
|
|
@@ -1,32 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (n, t, o) => t in n ? d(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o;
|
|
3
|
+
var f = (n, t, o) => m(n, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { j as P } from "./jsx-runtime-B6kdoens.js";
|
|
5
|
+
import { f as u } from "./__vite-browser-external-BYRIRx8p.js";
|
|
6
|
+
const x = "/pages/**/*.{md,mdx}", D = [".md", ".mdx"];
|
|
7
|
+
class c {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
f(this, "fileMap", /* @__PURE__ */ new Map());
|
|
10
|
+
this.config = t;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Gets the default docs config from the zudoku config
|
|
14
|
+
*/
|
|
15
|
+
getDocsConfigs() {
|
|
16
|
+
return this.config.docs ? Array.isArray(this.config.docs) ? this.config.docs : [this.config.docs] : [{ files: x }];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the first matching file system path for a given docId
|
|
20
|
+
* @param docId - The docId to resolve
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
resolveFilePath(t) {
|
|
24
|
+
const o = this.getDocsConfigs();
|
|
25
|
+
let s;
|
|
26
|
+
return o.forEach(({ files: i }) => {
|
|
27
|
+
if (s)
|
|
28
|
+
return;
|
|
29
|
+
const e = c.getRootDir(i);
|
|
30
|
+
for (const a of D) {
|
|
31
|
+
if (s)
|
|
32
|
+
return;
|
|
33
|
+
const r = u.join(e, `${t}${a}`);
|
|
34
|
+
u.existsSync(r) && (s = r);
|
|
35
|
+
}
|
|
36
|
+
}), s;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Gets the root directory from a files glob
|
|
40
|
+
*/
|
|
41
|
+
static getRootDir(t) {
|
|
42
|
+
let o = t.split("**")[0];
|
|
43
|
+
if (!o)
|
|
44
|
+
throw new Error("Invalid files glob. Must have '**' in the path.");
|
|
45
|
+
return o = o.replace("/**", "/"), o;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Resolves the route path for a given file system path
|
|
49
|
+
* @param options - The options to resolve the route path
|
|
50
|
+
* @returns The string route path
|
|
51
|
+
*/
|
|
52
|
+
static resolveRoutePath({
|
|
53
|
+
filesGlob: t,
|
|
54
|
+
fsPath: o
|
|
55
|
+
}) {
|
|
56
|
+
const s = this.getRootDir(t), i = new RegExp(`^${s}(.*).mdx?`), e = o.match(i);
|
|
57
|
+
return e == null ? void 0 : e.at(1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const C = (n) => ({
|
|
61
|
+
getRoutes: () => {
|
|
62
|
+
const t = /* @__PURE__ */ new Map();
|
|
63
|
+
return n.forEach(
|
|
64
|
+
({ fileImports: o, files: s, defaultOptions: i }) => Object.entries(o).flatMap(([e, a]) => {
|
|
65
|
+
const r = c.resolveRoutePath({
|
|
66
|
+
filesGlob: s,
|
|
67
|
+
fsPath: e
|
|
68
|
+
});
|
|
69
|
+
if (!r) return [];
|
|
70
|
+
if (t.has(r))
|
|
71
|
+
return console.warn(
|
|
72
|
+
`Duplicate route path found for ${r}. Skipping file at '${e}'.`
|
|
73
|
+
), [];
|
|
74
|
+
const h = {
|
|
75
|
+
path: r,
|
|
76
|
+
lazy: async () => {
|
|
77
|
+
const { MdxPage: l } = await import("./MdxPage-C5I9c7R1.js"), { default: p, ...g } = await a();
|
|
78
|
+
return {
|
|
79
|
+
element: /* @__PURE__ */ P.jsx(
|
|
80
|
+
l,
|
|
81
|
+
{
|
|
82
|
+
mdxComponent: p,
|
|
83
|
+
...g,
|
|
84
|
+
defaultOptions: i
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
};
|
|
17
88
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
markdownFiles: t,
|
|
24
|
-
defaultOptions: e,
|
|
25
|
-
filesPath: n
|
|
26
|
-
}) => ({
|
|
27
|
-
getRoutes: () => x(t, n, e)
|
|
89
|
+
};
|
|
90
|
+
t.set(r, h);
|
|
91
|
+
})
|
|
92
|
+
), [...t.values()];
|
|
93
|
+
}
|
|
28
94
|
});
|
|
29
95
|
export {
|
|
30
|
-
|
|
96
|
+
C as markdownPlugin
|
|
31
97
|
};
|
|
32
98
|
//# sourceMappingURL=zudoku.plugin-markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport {\n ZudokuConfig,\n ZudokuDocsConfig,\n} from \"../../../config/validators/validate.js\";\n\nconst DEFAULT_DOCS_FILES = \"/pages/**/*.{md,mdx}\";\n\n// TODO: This should be dynamic based on the glob selector\nconst SUPPORTED_EXTENSIONS = [\".md\", \".mdx\"];\n\n/**\n * Utilities for resolving markdown file paths and routes\n */\nexport class DocResolver {\n constructor(private config: ZudokuConfig) {}\n\n fileMap = new Map<string, string>();\n\n /**\n * Gets the default docs config from the zudoku config\n */\n getDocsConfigs() {\n const docsConfigs: ZudokuDocsConfig[] = this.config.docs\n ? Array.isArray(this.config.docs)\n ? this.config.docs\n : [this.config.docs]\n : [{ files: DEFAULT_DOCS_FILES }];\n\n return docsConfigs;\n }\n\n /**\n * Resolves the first matching file system path for a given docId\n * @param docId - The docId to resolve\n * @returns\n */\n resolveFilePath(docId: string) {\n const docsConfigs = this.getDocsConfigs();\n let fsPath: string | undefined;\n\n docsConfigs.forEach(({ files: fileGlob }) => {\n if (fsPath) {\n return;\n }\n const rootDir = DocResolver.getRootDir(fileGlob);\n for (const ext of SUPPORTED_EXTENSIONS) {\n if (fsPath) {\n return;\n }\n const checkPath = path.join(rootDir, `${docId}${ext}`);\n if (fs.existsSync(checkPath)) {\n fsPath = checkPath;\n }\n }\n });\n\n return fsPath;\n }\n\n /**\n * Gets the root directory from a files glob\n */\n private static getRootDir(filesGlob: string) {\n let rootDir = filesGlob.split(\"**\")[0];\n if (!rootDir) {\n throw new Error(\"Invalid files glob. Must have '**' in the path.\");\n }\n rootDir = rootDir.replace(\"/**\", \"/\");\n return rootDir;\n }\n\n /**\n * Resolves the route path for a given file system path\n * @param options - The options to resolve the route path\n * @returns The string route path\n */\n static resolveRoutePath({\n filesGlob,\n fsPath,\n }: {\n filesGlob: string;\n fsPath: string;\n }) {\n const rootDir = this.getRootDir(filesGlob);\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = fsPath.match(re);\n const routePath = match?.at(1);\n return routePath;\n }\n}\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport { RouteObject } from \"react-router-dom\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/validate.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { DocResolver } from \"./resolver.js\";\n\nexport interface MarkdownPluginOptions extends ZudokuDocsConfig {\n fileImports: Record<string, () => Promise<MDXImport>>;\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 options: MarkdownPluginOptions[],\n): DevPortalPlugin => ({\n getRoutes: () => {\n const routeMap = new Map<string, RouteObject>();\n options.forEach(({ fileImports, files, defaultOptions }) =>\n Object.entries(fileImports).flatMap(([file, importPromise]) => {\n const routePath = DocResolver.resolveRoutePath({\n filesGlob: files,\n fsPath: file,\n });\n\n if (!routePath) return [];\n\n if (routeMap.has(routePath)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,\n );\n return [];\n }\n\n const route: RouteObject = {\n path: routePath,\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 };\n routeMap.set(routePath, route);\n }),\n );\n return [...routeMap.values()];\n },\n});\n"],"names":["DEFAULT_DOCS_FILES","SUPPORTED_EXTENSIONS","DocResolver","config","__publicField","docId","docsConfigs","fsPath","fileGlob","rootDir","ext","checkPath","path","fs","filesGlob","re","match","markdownPlugin","options","routeMap","fileImports","files","defaultOptions","file","importPromise","routePath","route","MdxPage","Component","props","jsx"],"mappings":";;;;;AAOA,MAAMA,IAAqB,wBAGrBC,IAAuB,CAAC,OAAO,MAAM;AAKpC,MAAMC,EAAY;AAAA,EACvB,YAAoBC,GAAsB;AAE1C,IAAAC,EAAA,qCAAc;AAFM,SAAA,SAAAD;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB;AAOR,WANiC,KAAK,OAAO,OAChD,MAAM,QAAQ,KAAK,OAAO,IAAI,IAC5B,KAAK,OAAO,OACZ,CAAC,KAAK,OAAO,IAAI,IACnB,CAAC,EAAE,OAAOH,EAAA,CAAoB;AAAA,EAGpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgBK,GAAe;AACvB,UAAAC,IAAc,KAAK;AACrB,QAAAC;AAEJ,WAAAD,EAAY,QAAQ,CAAC,EAAE,OAAOE,QAAe;AAC3C,UAAID;AACF;AAEI,YAAAE,IAAUP,EAAY,WAAWM,CAAQ;AAC/C,iBAAWE,KAAOT,GAAsB;AACtC,YAAIM;AACF;AAEI,cAAAI,IAAYC,EAAK,KAAKH,GAAS,GAAGJ,CAAK,GAAGK,CAAG,EAAE;AACjD,QAAAG,EAAG,WAAWF,CAAS,MAChBJ,IAAAI;AAAA,MAEb;AAAA,IAAA,CACD,GAEMJ;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe,WAAWO,GAAmB;AAC3C,QAAIL,IAAUK,EAAU,MAAM,IAAI,EAAE,CAAC;AACrC,QAAI,CAACL;AACG,YAAA,IAAI,MAAM,iDAAiD;AAEzD,WAAAA,IAAAA,EAAQ,QAAQ,OAAO,GAAG,GAC7BA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,iBAAiB;AAAA,IACtB,WAAAK;AAAA,IACA,QAAAP;AAAA,EAAA,GAIC;AACK,UAAAE,IAAU,KAAK,WAAWK,CAAS,GACnCC,IAAK,IAAI,OAAO,IAAIN,CAAO,WAAW,GACtCO,IAAQT,EAAO,MAAMQ,CAAE;AAEtB,WADWC,KAAA,gBAAAA,EAAO,GAAG;AAAA,EAE9B;AACF;AC9Da,MAAAC,IAAiB,CAC5BC,OACqB;AAAA,EACrB,WAAW,MAAM;AACT,UAAAC,wBAAe;AACb,WAAAD,EAAA;AAAA,MAAQ,CAAC,EAAE,aAAAE,GAAa,OAAAC,GAAO,gBAAAC,QACrC,OAAO,QAAQF,CAAW,EAAE,QAAQ,CAAC,CAACG,GAAMC,CAAa,MAAM;AACvD,cAAAC,IAAYvB,EAAY,iBAAiB;AAAA,UAC7C,WAAWmB;AAAA,UACX,QAAQE;AAAA,QAAA,CACT;AAEG,YAAA,CAACE,EAAW,QAAO;AAEnB,YAAAN,EAAS,IAAIM,CAAS;AAEhB,yBAAA;AAAA,YACN,kCAAkCA,CAAS,uBAAuBF,CAAI;AAAA,UAAA,GAEjE;AAGT,cAAMG,IAAqB;AAAA,UACzB,MAAMD;AAAA,UACN,MAAM,YAAY;AAChB,kBAAM,EAAE,SAAAE,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAML;AACxC,mBAAA;AAAA,cACL,SACEM,gBAAAA,EAAA;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,cAAcC;AAAA,kBACb,GAAGC;AAAA,kBACJ,gBAAAP;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAGN;AAAA,QAAA;AAEO,QAAAH,EAAA,IAAIM,GAAWC,CAAK;AAAA,MAAA,CAC9B;AAAA,IAAA,GAEI,CAAC,GAAGP,EAAS,OAAA,CAAQ;AAAA,EAC9B;AACF;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { o as s } from "./index-
|
|
3
|
-
import "./
|
|
4
|
-
import "./ZudokuContext-em1gHkIY.js";
|
|
2
|
+
import { o as s } from "./index-BIl-R3aH.js";
|
|
3
|
+
import "./ZudokuContext-DSipF8sq.js";
|
|
5
4
|
import "lucide-react";
|
|
6
5
|
import "zudoku/openapi-worker";
|
|
7
|
-
import "./index-
|
|
8
|
-
import "./ErrorPage-
|
|
9
|
-
import "./Markdown-
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
6
|
+
import "./index-Dssw7Gff.js";
|
|
7
|
+
import "./ErrorPage-CUz-Zzmx.js";
|
|
8
|
+
import "./Markdown-C-0TaxoY.js";
|
|
9
|
+
import "./urql-core-KJnLL26g.js";
|
|
10
|
+
import "./router-Oe6YmY6B.js";
|
|
11
|
+
import "./index-SrtqdZ3j.js";
|
|
12
12
|
export {
|
|
13
13
|
s as openApiPlugin
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f3858d6",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"homepage": "https://zudoku.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/zuplo/zudoku.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/zuplo/zudoku/issues"
|
|
12
|
+
},
|
|
13
|
+
"description": "Framework for building high quality, interactive API documentation.",
|
|
5
14
|
"files": [
|
|
6
15
|
"dist",
|
|
7
16
|
"lib",
|
|
@@ -52,9 +61,9 @@
|
|
|
52
61
|
"import": "./lib/zudoku.plugin-redirect.js",
|
|
53
62
|
"types": "./dist/lib/plugins/redirect/index.d.ts"
|
|
54
63
|
},
|
|
55
|
-
"./plugins/custom-
|
|
56
|
-
"import": "./lib/zudoku.plugin-custom-
|
|
57
|
-
"types": "./dist/lib/plugins/custom-
|
|
64
|
+
"./plugins/custom-pages": {
|
|
65
|
+
"import": "./lib/zudoku.plugin-custom-pages.js",
|
|
66
|
+
"types": "./dist/lib/plugins/custom-pages/index.d.ts"
|
|
58
67
|
},
|
|
59
68
|
"./plugins/search-inkeep": {
|
|
60
69
|
"import": "./lib/zudoku.plugin-search-inkeep.js",
|
|
@@ -89,53 +98,58 @@
|
|
|
89
98
|
}
|
|
90
99
|
},
|
|
91
100
|
"dependencies": {
|
|
92
|
-
"@envelop/core": "5.0.
|
|
101
|
+
"@envelop/core": "5.0.2",
|
|
93
102
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
94
103
|
"@hiogawa/vite-plugin-ssr-css": "0.0.1",
|
|
95
104
|
"@lekoarts/rehype-meta-as-attributes": "3.0.1",
|
|
96
105
|
"@mdx-js/react": "3.0.1",
|
|
97
106
|
"@mdx-js/rollup": "3.0.1",
|
|
98
|
-
"@monaco-editor/react": "^4.6.0",
|
|
99
107
|
"@pothos/core": "3.41.0",
|
|
100
|
-
"@radix-ui/react-collapsible": "1.1.
|
|
101
|
-
"@radix-ui/react-
|
|
102
|
-
"@radix-ui/react-
|
|
103
|
-
"@radix-ui/react-
|
|
104
|
-
"@
|
|
108
|
+
"@radix-ui/react-collapsible": "1.1.1",
|
|
109
|
+
"@radix-ui/react-dialog": "1.1.2",
|
|
110
|
+
"@radix-ui/react-dropdown-menu": "2.1.2",
|
|
111
|
+
"@radix-ui/react-select": "2.1.2",
|
|
112
|
+
"@radix-ui/react-slot": "1.1.0",
|
|
113
|
+
"@radix-ui/react-tabs": "1.1.1",
|
|
114
|
+
"@radix-ui/react-visually-hidden": "1",
|
|
115
|
+
"@sentry/node": "8.34.0",
|
|
116
|
+
"@sindresorhus/slugify": "2.2.1",
|
|
105
117
|
"@stefanprobst/rehype-extract-toc": "2.2.0",
|
|
106
|
-
"@tailwindcss/typography": "0.5.
|
|
107
|
-
"@tanstack/react-query": "5.
|
|
118
|
+
"@tailwindcss/typography": "0.5.15",
|
|
119
|
+
"@tanstack/react-query": "5.59.13",
|
|
120
|
+
"@types/react": "18.3.11",
|
|
121
|
+
"@types/react-dom": "18.3.1",
|
|
108
122
|
"@vitejs/plugin-react": "4.3.1",
|
|
123
|
+
"@zudoku/httpsnippet": "10.0.9",
|
|
109
124
|
"@zudoku/react-helmet-async": "2.0.4",
|
|
110
|
-
"autoprefixer": "10.4.
|
|
111
|
-
"chokidar": "
|
|
125
|
+
"autoprefixer": "10.4.20",
|
|
126
|
+
"chokidar": "3.6.0",
|
|
112
127
|
"class-variance-authority": "0.7.0",
|
|
128
|
+
"clsx": "2.1.1",
|
|
113
129
|
"dotenv": "16.4.5",
|
|
114
|
-
"express": "4.
|
|
115
|
-
"glob": "
|
|
130
|
+
"express": "4.21.1",
|
|
131
|
+
"glob": "11.0.0",
|
|
116
132
|
"graphql": "16.9.0",
|
|
117
133
|
"graphql-type-json": "0.3.2",
|
|
118
|
-
"graphql-yoga": "5.
|
|
119
|
-
"gray-matter": "
|
|
120
|
-
"http-terminator": "
|
|
121
|
-
"loglevel": "
|
|
122
|
-
"lru-cache": "11.0.
|
|
123
|
-
"lucide-react": "0.
|
|
124
|
-
"
|
|
134
|
+
"graphql-yoga": "5.7.0",
|
|
135
|
+
"gray-matter": "4.0.3",
|
|
136
|
+
"http-terminator": "3.2.0",
|
|
137
|
+
"loglevel": "1.9.2",
|
|
138
|
+
"lru-cache": "11.0.1",
|
|
139
|
+
"lucide-react": "0.452.0",
|
|
140
|
+
"oauth4webapi": "2.17.0",
|
|
125
141
|
"object-hash": "3.0.0",
|
|
126
142
|
"openapi-types": "12.1.3",
|
|
127
|
-
"picocolors": "
|
|
128
|
-
"postcss": "8.4.
|
|
129
|
-
"posthog-node": "
|
|
130
|
-
"prism-react-renderer": "2.
|
|
143
|
+
"picocolors": "1.1.0",
|
|
144
|
+
"postcss": "8.4.47",
|
|
145
|
+
"posthog-node": "4.2.1",
|
|
146
|
+
"prism-react-renderer": "2.4.0",
|
|
131
147
|
"prismjs": "1.29.0",
|
|
132
|
-
"react": "
|
|
133
|
-
"react-
|
|
134
|
-
"react-error-boundary": "^4.0.13",
|
|
135
|
-
"react-hook-form": "^7.52.1",
|
|
148
|
+
"react-error-boundary": "4.0.13",
|
|
149
|
+
"react-hook-form": "7.53.0",
|
|
136
150
|
"react-is": "18.3.1",
|
|
137
151
|
"react-markdown": "9.0.1",
|
|
138
|
-
"react-router-dom": "6.
|
|
152
|
+
"react-router-dom": "6.27.0",
|
|
139
153
|
"rehype-raw": "7.0.0",
|
|
140
154
|
"rehype-slug": "6.0.0",
|
|
141
155
|
"remark-comment": "1.0.0",
|
|
@@ -144,54 +158,42 @@
|
|
|
144
158
|
"remark-frontmatter": "5.0.0",
|
|
145
159
|
"remark-gfm": "4.0.0",
|
|
146
160
|
"remark-mdx-frontmatter": "5.0.0",
|
|
147
|
-
"rollup": "
|
|
148
|
-
"semver": "7.6.
|
|
149
|
-
"sitemap": "
|
|
150
|
-
"slugify": "1.6.6",
|
|
161
|
+
"rollup": "4.24.0",
|
|
162
|
+
"semver": "7.6.3",
|
|
163
|
+
"sitemap": "8.0.0",
|
|
151
164
|
"strip-ansi": "7.1.0",
|
|
152
|
-
"tailwind-merge": "2.5.
|
|
153
|
-
"tailwindcss": "3.4.
|
|
154
|
-
"tsx": "4.19.
|
|
155
|
-
"ulidx": "
|
|
165
|
+
"tailwind-merge": "2.5.4",
|
|
166
|
+
"tailwindcss": "3.4.13",
|
|
167
|
+
"tsx": "4.19.1",
|
|
168
|
+
"ulidx": "2.4.1",
|
|
156
169
|
"unist-util-visit": "5.0.0",
|
|
157
170
|
"urql": "4.1.0",
|
|
158
|
-
"vaul": "
|
|
159
|
-
"vite": "5.
|
|
160
|
-
"yaml": "2.
|
|
171
|
+
"vaul": "1.1.0",
|
|
172
|
+
"vite": "5.4.9",
|
|
173
|
+
"yaml": "2.6.0",
|
|
161
174
|
"yargs": "17.7.2",
|
|
162
175
|
"zod": "3.23.8",
|
|
163
|
-
"zod-validation-error": "3.
|
|
164
|
-
"zustand": "
|
|
176
|
+
"zod-validation-error": "3.4.0",
|
|
177
|
+
"zustand": "5.0.0"
|
|
165
178
|
},
|
|
166
179
|
"devDependencies": {
|
|
167
|
-
"@
|
|
168
|
-
"@
|
|
169
|
-
"@radix-ui/react-tabs": "1.1.0",
|
|
170
|
-
"@types/express": "^4.17.21",
|
|
171
|
-
"@types/har-format": "^1.2.15",
|
|
180
|
+
"@types/express": "4.17.21",
|
|
181
|
+
"@types/har-format": "1.2.15",
|
|
172
182
|
"@types/json-schema": "7.0.15",
|
|
173
183
|
"@types/mdx": "2.0.13",
|
|
174
|
-
"@types/node": "20.
|
|
175
|
-
"@types/object-hash": "
|
|
176
|
-
"@types/react": "18.3.3",
|
|
177
|
-
"@types/react-dom": "18.3.0",
|
|
184
|
+
"@types/node": "20.16.11",
|
|
185
|
+
"@types/object-hash": "3.0.6",
|
|
178
186
|
"@types/react-is": "18.3.0",
|
|
179
|
-
"@types/
|
|
180
|
-
"@types/
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"prism-react-renderer": "2.3.1",
|
|
186
|
-
"prismjs": "1.29.0",
|
|
187
|
-
"react-markdown": "9.0.1",
|
|
188
|
-
"react-router-dom": "6.25.1",
|
|
189
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
190
|
-
"typescript": "5.5.3"
|
|
187
|
+
"@types/semver": "7.5.8",
|
|
188
|
+
"@types/yargs": "17.0.33",
|
|
189
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
190
|
+
"react": "18.3.1",
|
|
191
|
+
"react-dom": "18.3.1",
|
|
192
|
+
"typescript": "5.6.3"
|
|
191
193
|
},
|
|
192
194
|
"peerDependencies": {
|
|
193
|
-
"react": "
|
|
194
|
-
"react-dom": "
|
|
195
|
+
"react": ">=18",
|
|
196
|
+
"react-dom": ">=18"
|
|
195
197
|
},
|
|
196
198
|
"optionalDependencies": {
|
|
197
199
|
"@clerk/clerk-js": "5.11.0",
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -20,8 +20,10 @@ if (root.childElementCount > 0) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
23
|
-
const path = window.location.pathname
|
|
24
|
-
const lazyMatches = matchRoutes(routes, path)?.filter(
|
|
23
|
+
const path = window.location.pathname;
|
|
24
|
+
const lazyMatches = matchRoutes(routes, path, config.basePath)?.filter(
|
|
25
|
+
(m) => m.route.lazy,
|
|
26
|
+
);
|
|
25
27
|
|
|
26
28
|
if (lazyMatches?.length) {
|
|
27
29
|
await Promise.all(
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -96,6 +96,10 @@ export const render = async ({
|
|
|
96
96
|
|
|
97
97
|
const [htmlStart, htmlEnd] = template.split("<!--app-html-->");
|
|
98
98
|
|
|
99
|
+
if (!htmlStart) {
|
|
100
|
+
throw new Error("No <!--app-html--> found in template");
|
|
101
|
+
}
|
|
102
|
+
|
|
99
103
|
response.write(
|
|
100
104
|
htmlStart.replace(
|
|
101
105
|
"<!--app-helmet-->",
|
package/src/app/main.css
CHANGED
package/src/app/main.tsx
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type RouteObject } from "react-router-dom";
|
|
2
2
|
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
3
3
|
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
4
4
|
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
5
|
+
import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
|
|
5
6
|
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
6
7
|
import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
7
8
|
import { configuredSidebar } from "virtual:zudoku-sidebar";
|
|
8
9
|
import "virtual:zudoku-theme.css";
|
|
9
10
|
import { DevPortal, Layout, RouterError } from "zudoku/components";
|
|
10
11
|
import { isNavigationPlugin } from "zudoku/internal";
|
|
11
|
-
import { customPagePlugin } from "zudoku/plugins/custom-page";
|
|
12
12
|
import { inkeepSearchPlugin } from "zudoku/plugins/search-inkeep";
|
|
13
13
|
import type { ZudokuConfig } from "../config/config.js";
|
|
14
|
-
import { traverseSidebar } from "../lib/components/navigation/utils.js";
|
|
15
14
|
import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
|
|
16
|
-
import { joinPath } from "../lib/util/joinPath.js";
|
|
17
15
|
|
|
18
16
|
export const convertZudokuConfigToOptions = (
|
|
19
17
|
config: ZudokuConfig,
|
|
@@ -42,7 +40,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
42
40
|
},
|
|
43
41
|
},
|
|
44
42
|
},
|
|
45
|
-
slotlets: config.
|
|
43
|
+
slotlets: config.UNSAFE_slotlets,
|
|
46
44
|
metadata: {
|
|
47
45
|
favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
|
|
48
46
|
title: "%s - Zudoku",
|
|
@@ -60,7 +58,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
60
58
|
...configuredApiPlugins,
|
|
61
59
|
...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
|
|
62
60
|
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
63
|
-
...(
|
|
61
|
+
...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
|
|
64
62
|
...(configuredAuthProvider?.getAuthenticationPlugin
|
|
65
63
|
? [configuredAuthProvider.getAuthenticationPlugin()]
|
|
66
64
|
: []),
|
|
@@ -69,9 +67,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
69
67
|
};
|
|
70
68
|
};
|
|
71
69
|
|
|
72
|
-
export const
|
|
73
|
-
const options = convertZudokuConfigToOptions(config);
|
|
74
|
-
|
|
70
|
+
export const getRoutesByOptions = (options: ZudokuContextOptions) => {
|
|
75
71
|
const allPlugins = [
|
|
76
72
|
...(options.plugins ? options.plugins : []),
|
|
77
73
|
...(options.authentication?.getAuthenticationPlugin
|
|
@@ -79,27 +75,8 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
79
75
|
: []),
|
|
80
76
|
];
|
|
81
77
|
|
|
82
|
-
const topNavRedirects =
|
|
83
|
-
options.topNavigation?.flatMap((topNavItem) => {
|
|
84
|
-
if (!options.sidebars?.[topNavItem.id]) return [];
|
|
85
|
-
|
|
86
|
-
const first =
|
|
87
|
-
topNavItem.default ??
|
|
88
|
-
traverseSidebar(options.sidebars[topNavItem.id], (item) => {
|
|
89
|
-
if (item.type === "doc") return joinPath(topNavItem.id, item.id);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
if (!first) return [];
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
path: topNavItem.id,
|
|
96
|
-
loader: () => redirect(joinPath(first)),
|
|
97
|
-
} satisfies RouteObject;
|
|
98
|
-
}) ?? [];
|
|
99
|
-
|
|
100
78
|
const routes = allPlugins
|
|
101
79
|
.flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
|
|
102
|
-
.concat(topNavRedirects)
|
|
103
80
|
.concat({
|
|
104
81
|
path: "*",
|
|
105
82
|
loader: () => {
|
|
@@ -107,6 +84,13 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
107
84
|
},
|
|
108
85
|
});
|
|
109
86
|
|
|
87
|
+
return routes;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
91
|
+
const options = convertZudokuConfigToOptions(config);
|
|
92
|
+
const routes = getRoutesByOptions(options);
|
|
93
|
+
|
|
110
94
|
return [
|
|
111
95
|
{
|
|
112
96
|
element: (
|
package/src/app/standalone.tsx
CHANGED
|
@@ -16,7 +16,7 @@ if (!root) {
|
|
|
16
16
|
themeToggle();
|
|
17
17
|
|
|
18
18
|
const apiUrl = root.getAttribute("data-api-url");
|
|
19
|
-
const pageTitle = document.getElementsByTagName("title")[0]
|
|
19
|
+
const pageTitle = document.getElementsByTagName("title")[0]!.innerText;
|
|
20
20
|
const logoUrl = root.getAttribute("data-logo-url");
|
|
21
21
|
|
|
22
22
|
// IMPORTANT: This component must not contain tailwind classes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
|
+
import { persist } from "zustand/middleware";
|
|
2
3
|
|
|
3
4
|
export const useAuthState = create<AuthState>(() => ({
|
|
4
5
|
isPending: false,
|
|
@@ -19,3 +20,19 @@ export interface UserProfile {
|
|
|
19
20
|
pictureUrl: string | undefined;
|
|
20
21
|
[key: string]: string | boolean | undefined;
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
interface SelectedServerState {
|
|
25
|
+
selectedServer?: string;
|
|
26
|
+
setSelectedServer: (newServer: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const useSelectedServerStore = create<SelectedServerState>()(
|
|
30
|
+
persist(
|
|
31
|
+
(set) => ({
|
|
32
|
+
selectedServer: undefined,
|
|
33
|
+
setSelectedServer: (newServer: string) =>
|
|
34
|
+
set({ selectedServer: newServer }),
|
|
35
|
+
}),
|
|
36
|
+
{ name: "zudoku-selected-server" },
|
|
37
|
+
),
|
|
38
|
+
);
|
|
@@ -9,7 +9,7 @@ const COLOR_MAP = {
|
|
|
9
9
|
tip: "bg-green-600",
|
|
10
10
|
caution: "bg-orange-500",
|
|
11
11
|
danger: "bg-rose-500",
|
|
12
|
-
};
|
|
12
|
+
} as const;
|
|
13
13
|
|
|
14
14
|
export const Banner = () => {
|
|
15
15
|
const { page } = useZudoku();
|
|
@@ -19,12 +19,22 @@ export const Banner = () => {
|
|
|
19
19
|
return <style>{`:root { --banner-height: 0px; }`}</style>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
const mappedColor =
|
|
23
|
+
page.banner.color && page.banner.color in COLOR_MAP
|
|
24
|
+
? COLOR_MAP[page.banner.color as keyof typeof COLOR_MAP]
|
|
25
|
+
: !page.banner.color
|
|
26
|
+
? "bg-primary"
|
|
27
|
+
: undefined;
|
|
28
|
+
|
|
29
|
+
const style = !mappedColor ? { backgroundColor: page.banner.color } : {};
|
|
30
|
+
|
|
22
31
|
return (
|
|
23
32
|
<div
|
|
24
33
|
className={cn(
|
|
25
34
|
"relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center",
|
|
26
|
-
|
|
35
|
+
mappedColor,
|
|
27
36
|
)}
|
|
37
|
+
style={style}
|
|
28
38
|
>
|
|
29
39
|
<div className="w-full">{page.banner.message}</div>
|
|
30
40
|
{page.banner.dismissible && (
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { Link } from "react-router-dom";
|
|
3
2
|
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
3
|
import { Heading } from "./Heading.js";
|
|
5
4
|
import { ProseClasses } from "./Markdown.js";
|
|
@@ -22,7 +21,6 @@ export const ErrorPage = ({
|
|
|
22
21
|
</Heading>
|
|
23
22
|
)}
|
|
24
23
|
<p>{message}</p>
|
|
25
|
-
<Link to="/">Go back home</Link>
|
|
26
24
|
</div>
|
|
27
25
|
);
|
|
28
26
|
};
|