zudoku 0.0.0-eff6f9b → 0.0.0-f1a6fd4
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/README.md +121 -0
- package/dist/app/main.js +3 -3
- package/dist/app/main.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 +1 -0
- package/dist/config/validators/validate.d.ts +42 -23
- package/dist/config/validators/validate.js +6 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +2 -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 +1 -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/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +9 -2
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.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/core/DevPortalContext.d.ts +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-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- 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/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/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/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/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +8 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/vite/config.d.ts +1 -1
- package/dist/vite/config.js +21 -15
- package/dist/vite/config.js.map +1 -1
- 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-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-mdx.js +3 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +14 -1
- 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/lib/{AuthenticationPlugin-gtf8JS3V.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
- package/lib/{AuthenticationPlugin-gtf8JS3V.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
- package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-3Qtp2yZ8.js} +2 -2
- package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-3Qtp2yZ8.js.map} +1 -1
- package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-BE9DzNhv.js} +2 -2
- package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-BE9DzNhv.js.map} +1 -1
- package/lib/ErrorPage-B0COs372.js +16 -0
- package/lib/ErrorPage-B0COs372.js.map +1 -0
- package/lib/Input-CHfE_2Qk.js +2229 -0
- package/lib/Input-CHfE_2Qk.js.map +1 -0
- package/lib/{Markdown-B4aR03g6.js → Markdown-CWI6lU11.js} +1448 -1286
- package/lib/Markdown-CWI6lU11.js.map +1 -0
- package/lib/{MdxPage-BcftTg5g.js → MdxPage-C3tlrV4j.js} +24 -24
- package/lib/MdxPage-C3tlrV4j.js.map +1 -0
- package/lib/{OperationList-Da36LrGl.js → OperationList-BO-ES1C5.js} +149 -108
- package/lib/OperationList-BO-ES1C5.js.map +1 -0
- package/lib/{Route-CWj1ECzh.js → Route-Dq6zv0Pi.js} +3 -4
- package/lib/Route-Dq6zv0Pi.js.map +1 -0
- package/lib/SidebarBadge-DmI5hT04.js +503 -0
- package/lib/SidebarBadge-DmI5hT04.js.map +1 -0
- package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-RvaeLR6z.js} +43 -42
- package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-RvaeLR6z.js.map} +1 -1
- package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
- package/lib/ZudokuContext-BEmsYQoq.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-Bf8vjASY.js} +6768 -4410
- package/lib/assets/worker-Bf8vjASY.js.map +1 -0
- package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
- package/lib/index-BRCiYFaL.js.map +1 -0
- 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-DIkaYL-l.js → index-DNfiZTPV.js} +1956 -1676
- package/lib/index-DNfiZTPV.js.map +1 -0
- package/lib/{index-BoXX7LeD.js → index-Do_BBSIs.js} +597 -544
- package/lib/index-Do_BBSIs.js.map +1 -0
- package/lib/{index-B_9xr661.js → index-Dvh1BL_e.js} +3 -3
- package/lib/{index-B_9xr661.js.map → index-Dvh1BL_e.js.map} +1 -1
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.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/useExposedProps-Csw8oAlt.js +9 -0
- package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
- package/lib/{utils-DtEHoAvg.js → utils-Chi3p5nE.js} +101 -104
- package/lib/utils-Chi3p5nE.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 +1695 -1621
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +4671 -4383
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +7 -7
- package/lib/zudoku.plugin-custom-pages.js +21 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +10 -9
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +71 -69
- package/src/app/main.tsx +3 -3
- 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 +4 -2
- package/src/lib/components/InlineCode.tsx +10 -0
- package/src/lib/components/Layout.tsx +2 -1
- package/src/lib/components/MobileTopNavigation.tsx +4 -0
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/SlotletProvider.tsx +27 -4
- package/src/lib/components/index.ts +1 -1
- package/src/lib/core/DevPortalContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +35 -23
- package/src/lib/oas/parser/index.ts +1 -0
- package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- 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/Route.tsx +1 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +18 -3
- 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/graphql/gql.ts +11 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +113 -1
- package/src/lib/plugins/openapi/index.tsx +3 -6
- 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/useExposedProps.tsx +10 -0
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.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 +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- 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 { u as h, a as E, b as S } from "./ZudokuContext-
|
|
6
|
-
import { B as l,
|
|
7
|
-
import { D as C } from "./DeveloperHint-
|
|
2
|
+
import { S as x, R as f } from "./SlotletProvider-RvaeLR6z.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-CHfE_2Qk.js";
|
|
4
|
+
import { a as N, L as u, O as I } from "./index-BRCiYFaL.js";
|
|
5
|
+
import { u as h, a as E, b as S } from "./ZudokuContext-BEmsYQoq.js";
|
|
6
|
+
import { B as l, n as A } from "./index-Do_BBSIs.js";
|
|
7
|
+
import { D as C } from "./DeveloperHint-BE9DzNhv.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-CWI6lU11.js";
|
|
11
11
|
function c(t, s) {
|
|
12
12
|
if (t)
|
|
13
13
|
return;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { a as n, P as u } from "./Markdown-CWI6lU11.js";
|
|
4
|
+
import { u as c } from "./useExposedProps-Csw8oAlt.js";
|
|
5
|
+
const l = ({
|
|
6
|
+
element: t,
|
|
7
|
+
render: s,
|
|
8
|
+
prose: e = !0
|
|
9
|
+
}) => {
|
|
10
|
+
const r = c(), m = s ? a.createElement(s, r) : t;
|
|
11
|
+
return /* @__PURE__ */ o.jsx("div", { className: n(e && u, "max-w-full"), children: m });
|
|
12
|
+
}, f = (t) => ({
|
|
13
|
+
getRoutes: () => t.map(({ path: s, ...e }) => ({
|
|
14
|
+
path: s,
|
|
15
|
+
element: /* @__PURE__ */ o.jsx(l, { ...e })
|
|
16
|
+
}))
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
f as customPagesPlugin
|
|
20
|
+
};
|
|
21
|
+
//# 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/CustomPage.tsx","../src/lib/plugins/custom-pages/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { CustomPageConfig } from \"./index.js\";\n\nexport const CustomPage = ({\n element,\n render,\n prose = true,\n}: Omit<CustomPageConfig, \"path\">) => {\n const slotletProps = useExposedProps();\n const content = render ? React.createElement(render, slotletProps) : element;\n\n return (\n <div className={cn(prose && ProseClasses, \"max-w-full\")}>{content}</div>\n );\n};\n","import { type ComponentType, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { type ExposedComponentProps } from \"../../components/SlotletProvider.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\nimport { CustomPage } from \"./CustomPage.js\";\n\nexport type CustomPageConfig = {\n path: string;\n prose?: boolean;\n element?: ReactNode;\n render?: ComponentType<ExposedComponentProps>;\n};\n\nexport const customPagesPlugin = (\n config: CustomPageConfig[],\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, ...props }) => ({\n path,\n element: <CustomPage {...props} />,\n })),\n };\n};\n"],"names":["CustomPage","element","render","prose","slotletProps","useExposedProps","content","React","jsx","cn","ProseClasses","customPagesPlugin","config","path","props"],"mappings":";;;;AAMO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAAsC;AACpC,QAAMC,IAAeC,KACfC,IAAUJ,IAASK,EAAM,cAAcL,GAAQE,CAAY,IAAIH;AAGnE,SAAAO,gBAAAA,MAAC,SAAI,WAAWC,EAAGN,KAASO,GAAc,YAAY,GAAI,UAAQJ,EAAA,CAAA;AAEtE,GCJaK,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,GAAGC,SAAa;AAAA,IAClC,MAAAD;AAAA,IACA,SAASL,gBAAAA,EAAAA,IAACR,GAAY,EAAA,GAAGc,EAAO,CAAA;AAAA,EAAA,EAChC;AAAA;"}
|
|
@@ -6,7 +6,7 @@ const x = (t, e, n) => Object.entries(t).flatMap(([a, p]) => {
|
|
|
6
6
|
return s ? {
|
|
7
7
|
path: s,
|
|
8
8
|
lazy: async () => {
|
|
9
|
-
const { MdxPage: i } = await import("./MdxPage-
|
|
9
|
+
const { MdxPage: i } = await import("./MdxPage-C3tlrV4j.js"), { default: m, ...l } = await p();
|
|
10
10
|
return {
|
|
11
11
|
element: /* @__PURE__ */ u.jsx(
|
|
12
12
|
i,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { o as
|
|
3
|
-
import "./
|
|
4
|
-
import "./ZudokuContext-em1gHkIY.js";
|
|
2
|
+
import { o as u } from "./index-DNfiZTPV.js";
|
|
3
|
+
import "./ZudokuContext-BEmsYQoq.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-Do_BBSIs.js";
|
|
7
|
+
import "./ErrorPage-B0COs372.js";
|
|
8
|
+
import "./Markdown-CWI6lU11.js";
|
|
9
|
+
import "./joinPath-B7kNnUX4.js";
|
|
10
|
+
import "./urql-core-KJnLL26g.js";
|
|
11
|
+
import "./router-Oe6YmY6B.js";
|
|
12
|
+
import "./index-BRCiYFaL.js";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
u as openApiPlugin
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=zudoku.plugin-openapi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f1a6fd4",
|
|
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/main.tsx
CHANGED
|
@@ -2,13 +2,13 @@ import { redirect, 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
14
|
import { traverseSidebar } from "../lib/components/navigation/utils.js";
|
|
@@ -42,7 +42,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
-
slotlets: config.
|
|
45
|
+
slotlets: config.UNSAFE_slotlets,
|
|
46
46
|
metadata: {
|
|
47
47
|
favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
|
|
48
48
|
title: "%s - Zudoku",
|
|
@@ -60,7 +60,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
60
60
|
...configuredApiPlugins,
|
|
61
61
|
...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
|
|
62
62
|
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
63
|
-
...(
|
|
63
|
+
...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
|
|
64
64
|
...(configuredAuthProvider?.getAuthenticationPlugin
|
|
65
65
|
? [configuredAuthProvider.getAuthenticationPlugin()]
|
|
66
66
|
: []),
|
|
@@ -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
|
};
|
|
@@ -91,8 +91,8 @@ export const Header = memo(function HeaderInner() {
|
|
|
91
91
|
</div>
|
|
92
92
|
</Link>
|
|
93
93
|
</div>
|
|
94
|
-
<div className="grid grid-cols-
|
|
95
|
-
<div className="w-full justify-center flex">
|
|
94
|
+
<div className="grid grid-cols-1 lg:grid-cols-[--sidecar-grid-cols] items-center gap-8">
|
|
95
|
+
<div className="w-full justify-center hidden lg:flex">
|
|
96
96
|
<Search />
|
|
97
97
|
</div>
|
|
98
98
|
|
|
@@ -133,7 +133,9 @@ export const Header = memo(function HeaderInner() {
|
|
|
133
133
|
</div>
|
|
134
134
|
</div>
|
|
135
135
|
</div>
|
|
136
|
+
<Slotlet name="top-navigation-before" />
|
|
136
137
|
<TopNavigation />
|
|
138
|
+
<Slotlet name="top-navigation-after" />
|
|
137
139
|
</div>
|
|
138
140
|
</header>
|
|
139
141
|
);
|
|
@@ -4,11 +4,21 @@ import { cn } from "../util/cn.js";
|
|
|
4
4
|
export const InlineCode = ({
|
|
5
5
|
className,
|
|
6
6
|
children,
|
|
7
|
+
selectOnClick,
|
|
7
8
|
}: {
|
|
8
9
|
className?: string;
|
|
9
10
|
children: ReactNode;
|
|
11
|
+
selectOnClick?: boolean;
|
|
10
12
|
}) => (
|
|
11
13
|
<code
|
|
14
|
+
onClick={(e) => {
|
|
15
|
+
if (!selectOnClick) return;
|
|
16
|
+
const selection = window.getSelection();
|
|
17
|
+
const range = document.createRange();
|
|
18
|
+
range.selectNodeContents(e.currentTarget);
|
|
19
|
+
selection?.removeAllRanges();
|
|
20
|
+
selection?.addRange(range);
|
|
21
|
+
}}
|
|
12
22
|
className={cn(
|
|
13
23
|
"font-mono border p-1 py-0.5 rounded bg-border/50 dark:bg-border/70 whitespace-nowrap",
|
|
14
24
|
className,
|
|
@@ -49,11 +49,12 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
49
49
|
</Helmet>
|
|
50
50
|
<Slotlet name="layout-before-head" />
|
|
51
51
|
<Header />
|
|
52
|
+
<Slotlet name="layout-after-head" />
|
|
52
53
|
|
|
53
54
|
<div className="w-full max-w-screen-2xl mx-auto px-10 lg:px-12">
|
|
54
55
|
<Suspense
|
|
55
56
|
fallback={
|
|
56
|
-
<main className="grid h-
|
|
57
|
+
<main className="grid h-[calc(100vh-var(--header-height))] place-items-center">
|
|
57
58
|
<Spinner />
|
|
58
59
|
</main>
|
|
59
60
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
DrawerTrigger,
|
|
11
11
|
} from "../ui/Drawer.js";
|
|
12
12
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
13
|
+
import { Search } from "./Search.js";
|
|
13
14
|
|
|
14
15
|
export const MobileTopNavigation = () => {
|
|
15
16
|
const { topNavigation } = useZudoku();
|
|
@@ -27,6 +28,9 @@ export const MobileTopNavigation = () => {
|
|
|
27
28
|
<VisuallyHidden>
|
|
28
29
|
<DrawerTitle>Navigation</DrawerTitle>
|
|
29
30
|
</VisuallyHidden>
|
|
31
|
+
<div className="flex p-4">
|
|
32
|
+
<Search />
|
|
33
|
+
</div>
|
|
30
34
|
<ul className="flex flex-col items-center gap-4 p-4">
|
|
31
35
|
{topNavigation.map((item) => (
|
|
32
36
|
<li key={item.label}>
|
|
@@ -39,7 +39,7 @@ export const Search = () => {
|
|
|
39
39
|
<button
|
|
40
40
|
type="button"
|
|
41
41
|
onClick={() => setIsOpen(true)}
|
|
42
|
-
className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-
|
|
42
|
+
className="flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-full sm:w-72"
|
|
43
43
|
>
|
|
44
44
|
<div className="flex items-center gap-2 flex-grow">
|
|
45
45
|
<SearchIcon size={14} />
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
type ComponentType,
|
|
3
|
+
type ReactElement,
|
|
4
|
+
ReactNode,
|
|
5
|
+
useContext,
|
|
6
|
+
} from "react";
|
|
2
7
|
import { isValidElementType } from "react-is";
|
|
3
|
-
|
|
8
|
+
import {
|
|
9
|
+
type Location,
|
|
10
|
+
type NavigateFunction,
|
|
11
|
+
type SetURLSearchParams,
|
|
12
|
+
} from "react-router-dom";
|
|
13
|
+
import { useExposedProps } from "../util/useExposedProps.js";
|
|
14
|
+
|
|
15
|
+
export type Slotlets = Record<
|
|
16
|
+
string,
|
|
17
|
+
ReactNode | ReactElement | ComponentType<ExposedComponentProps>
|
|
18
|
+
>;
|
|
4
19
|
|
|
5
20
|
const SlotletContext = React.createContext<Slotlets | undefined>({});
|
|
6
21
|
|
|
@@ -18,13 +33,21 @@ export const SlotletProvider = ({
|
|
|
18
33
|
);
|
|
19
34
|
};
|
|
20
35
|
|
|
36
|
+
export type ExposedComponentProps = {
|
|
37
|
+
location: Location;
|
|
38
|
+
navigate: NavigateFunction;
|
|
39
|
+
searchParams: URLSearchParams;
|
|
40
|
+
setSearchParams: SetURLSearchParams;
|
|
41
|
+
};
|
|
42
|
+
|
|
21
43
|
export const Slotlet = ({ name }: { name: string }) => {
|
|
22
44
|
const context = useContext(SlotletContext);
|
|
23
45
|
const componentOrElement = context?.[name];
|
|
46
|
+
const slotletProps = useExposedProps();
|
|
24
47
|
|
|
25
48
|
if (isValidElementType(componentOrElement)) {
|
|
26
|
-
return React.createElement(componentOrElement);
|
|
49
|
+
return React.createElement(componentOrElement, slotletProps);
|
|
27
50
|
}
|
|
28
51
|
|
|
29
|
-
return componentOrElement;
|
|
52
|
+
return componentOrElement as ReactNode;
|
|
30
53
|
};
|
|
@@ -16,7 +16,7 @@ export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
|
16
16
|
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
17
17
|
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
18
18
|
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
19
|
-
export const Link = /*@__PURE__*/ LinkImport;
|
|
19
|
+
export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
|
|
20
20
|
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
21
21
|
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
22
22
|
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|