zudoku 0.3.0-dev.4 → 0.3.0-dev.41
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/App.d.ts +1 -2
- package/dist/app/App.js +1 -28
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +27 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/entry.client.d.ts +2 -0
- package/dist/app/entry.client.js +35 -0
- package/dist/app/entry.client.js.map +1 -0
- package/dist/app/entry.server.d.ts +12 -0
- package/dist/app/entry.server.js +104 -0
- package/dist/app/entry.server.js.map +1 -0
- package/dist/app/main.d.ts +6 -1
- package/dist/app/main.js +54 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +32 -0
- package/dist/app/standalone.js.map +1 -0
- package/dist/app/tailwind.d.ts +1 -1
- package/dist/app/tailwind.js +0 -4
- package/dist/app/tailwind.js.map +1 -1
- package/dist/app/zudoku-manifest.d.ts +1 -0
- package/dist/app/zudoku-manifest.js +20 -0
- package/dist/app/zudoku-manifest.js.map +1 -0
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +3 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +15 -16
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -0
- package/dist/lib/authentication/Callback.js +1 -1
- package/dist/lib/authentication/Callback.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -2
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +1 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +4 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +2 -0
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +1 -0
- package/dist/lib/authentication/state.js +1 -0
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +12 -0
- package/dist/lib/components/Bootstrap.js +9 -0
- package/dist/lib/components/Bootstrap.js.map +1 -0
- package/dist/lib/components/DevPortal.d.ts +4 -19
- package/dist/lib/components/DevPortal.js +17 -12
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/ErrorPage.d.ts +6 -0
- package/dist/lib/components/ErrorPage.js +9 -0
- package/dist/lib/components/ErrorPage.js.map +1 -0
- package/dist/lib/components/Header.js +3 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +9 -4
- package/dist/lib/components/Heading.js +17 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/InlineCode.d.ts +5 -0
- package/dist/lib/components/InlineCode.js +4 -0
- package/dist/lib/components/InlineCode.js.map +1 -0
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/NotFoundPage.d.ts +1 -0
- package/dist/lib/components/NotFoundPage.js +12 -0
- package/dist/lib/components/NotFoundPage.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
- package/dist/lib/components/SyntaxHighlight.js +21 -19
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +4 -0
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +2 -2
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +28 -3
- package/dist/lib/components/index.js +17 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +33 -3
- package/dist/lib/core/DevPortalContext.js +8 -5
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +7 -4
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +3 -0
- package/dist/lib/errors/ErrorAlert.js +8 -0
- package/dist/lib/errors/ErrorAlert.js.map +1 -0
- package/dist/lib/errors/RouterError.d.ts +1 -0
- package/dist/lib/errors/RouterError.js +12 -0
- package/dist/lib/errors/RouterError.js.map +1 -0
- package/dist/lib/errors/ServerError.d.ts +3 -0
- package/dist/lib/errors/ServerError.js +6 -0
- package/dist/lib/errors/ServerError.js.map +1 -0
- package/dist/lib/errors/TopLevelError.d.ts +2 -0
- package/dist/lib/errors/TopLevelError.js +7 -0
- package/dist/lib/errors/TopLevelError.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +1 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -1
- package/dist/lib/oas/parser/index.js +38 -12
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +4 -0
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +4 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +38 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/{api-key → api-keys}/index.js +32 -9
- package/dist/lib/plugins/api-keys/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
- package/dist/lib/plugins/markdown/MdxPage.js +7 -6
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +1 -1
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +4 -1
- package/dist/lib/plugins/markdown/index.js +3 -7
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +16 -5
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +5 -5
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +10 -8
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
- package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/createServer.js +30 -0
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
- package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/index.d.ts +4 -18
- package/dist/lib/plugins/openapi/index.js +35 -20
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
- package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -3
- package/dist/lib/plugins/openapi/playground/Playground.js +8 -12
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +10 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
- package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/prose.js +4 -0
- package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +1 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.js +2 -3
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Callout.js +2 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/button-variants.d.ts +2 -2
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/groupBy.d.ts +1 -6
- package/dist/lib/util/groupBy.js +10 -8
- package/dist/lib/util/groupBy.js.map +1 -1
- package/dist/lib/util/logInit.d.ts +1 -0
- package/dist/lib/util/logInit.js +9 -0
- package/dist/lib/util/logInit.js.map +1 -0
- package/dist/lib/util/objectEntries.d.ts +4 -0
- package/dist/lib/util/objectEntries.js +2 -0
- package/dist/lib/util/objectEntries.js.map +1 -0
- package/dist/lib/util/renderIf.d.ts +1 -0
- package/dist/lib/util/renderIf.js +2 -0
- package/dist/lib/util/renderIf.js.map +1 -0
- package/dist/vite/build.js +27 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +13 -9
- package/dist/vite/config.js +98 -57
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -4
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -1
- package/dist/vite/dev-server.js +43 -15
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +5 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +7 -8
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +8 -19
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +5 -6
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.js +3 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +0 -1
- package/dist/vite/plugin-config.js +13 -7
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-css.d.ts +6 -0
- package/dist/vite/plugin-custom-css.js +55 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.js +14 -4
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +1 -1
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-html.js +1 -9
- package/dist/vite/plugin-html.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +3 -1
- package/dist/vite/plugin-mdx.js +4 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-redirect.js +9 -9
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin.js +3 -3
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +17 -0
- package/dist/vite/prerender.js +55 -0
- package/dist/vite/prerender.js.map +1 -0
- package/lib/AnchorLink-DCdBbdqo.js +705 -0
- package/lib/AnchorLink-DCdBbdqo.js.map +1 -0
- package/lib/DevPortalProvider-C-O1s7mm.js +1081 -0
- package/lib/DevPortalProvider-C-O1s7mm.js.map +1 -0
- package/lib/Markdown-CGZJUYcj.js +15028 -0
- package/lib/Markdown-CGZJUYcj.js.map +1 -0
- package/lib/MdxPage-BZLuBOqR.js +190 -0
- package/lib/MdxPage-BZLuBOqR.js.map +1 -0
- package/lib/OperationList-BEpN70_E.js +5562 -0
- package/lib/OperationList-BEpN70_E.js.map +1 -0
- package/lib/Route-WiMUalLG.js +13 -0
- package/lib/Route-WiMUalLG.js.map +1 -0
- package/lib/Select-BQ9-3iTJ.js +4571 -0
- package/lib/Select-BQ9-3iTJ.js.map +1 -0
- package/lib/Spinner-C1L_TK5f.js +182 -0
- package/lib/Spinner-C1L_TK5f.js.map +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +1 -0
- package/lib/assets/index-BPdJm2ty.js.map +1 -0
- package/lib/assets/{worker-BCcpCNJ7.js → worker-BjPv-hjP.js} +10742 -10318
- package/lib/assets/worker-BjPv-hjP.js.map +1 -0
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/context-_fYfJFgk.js.map +1 -0
- package/lib/createWorkerClient-TWecYOlx.js +16698 -0
- package/lib/createWorkerClient-TWecYOlx.js.map +1 -0
- package/lib/hook-SM2dMVmI.js +77 -0
- package/lib/hook-SM2dMVmI.js.map +1 -0
- package/lib/index-CtLNbq0d.js +412 -0
- package/lib/index-CtLNbq0d.js.map +1 -0
- package/lib/index-PvQa9XLl.js +724 -0
- package/lib/index-PvQa9XLl.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/jsx-runtime-DLtUZ5Ve.js +1526 -0
- package/lib/jsx-runtime-DLtUZ5Ve.js.map +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
- package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
- package/lib/prism-java.min-d5iT_mOd.js +1 -0
- package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
- package/lib/router-BkOLuJlq.js +2973 -0
- package/lib/router-BkOLuJlq.js.map +1 -0
- package/lib/slugify-DbLhpSPt.js +28 -0
- package/lib/slugify-DbLhpSPt.js.map +1 -0
- package/lib/{state-oycsxkHz.js → state-Ds_OxRHP.js} +20 -18
- package/lib/state-Ds_OxRHP.js.map +1 -0
- package/lib/util-Cgie7wjb.js +41 -0
- package/lib/util-Cgie7wjb.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +3 -1
- package/lib/zudoku.auth-auth0.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +11 -8
- package/lib/zudoku.auth-clerk.js.map +1 -0
- package/lib/zudoku.auth-openid.js +5 -2
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +800 -464
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +3 -223
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +287 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +49 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +9 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +11 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/package.json +33 -15
- package/src/app/App.tsx +0 -40
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +40 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +158 -0
- package/src/app/main.css +74 -0
- package/src/app/main.tsx +71 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +46 -0
- package/src/app/tailwind.ts +2 -6
- package/src/app/zudoku-manifest.ts +22 -0
- package/src/lib/authentication/Callback.tsx +1 -1
- package/src/lib/authentication/authentication.ts +2 -5
- package/src/lib/authentication/hook.ts +1 -0
- package/src/lib/authentication/providers/auth0.tsx +1 -0
- package/src/lib/authentication/providers/clerk.tsx +3 -0
- package/src/lib/authentication/providers/openid.tsx +3 -1
- package/src/lib/authentication/state.ts +2 -0
- package/src/lib/components/Bootstrap.tsx +37 -0
- package/src/lib/components/DevPortal.tsx +41 -56
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +7 -7
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +9 -7
- package/src/lib/components/NotFoundPage.tsx +39 -0
- package/src/lib/components/SyntaxHighlight.tsx +27 -19
- package/src/lib/components/TopNavigation.tsx +5 -0
- package/src/lib/components/context/DevPortalProvider.ts +2 -2
- package/src/lib/components/index.ts +21 -3
- package/src/lib/core/DevPortalContext.ts +42 -13
- package/src/lib/core/plugins.ts +10 -5
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +13 -0
- package/src/lib/errors/ServerError.tsx +5 -0
- package/src/lib/errors/TopLevelError.tsx +8 -0
- package/src/lib/oas/graphql/index.ts +2 -2
- package/src/lib/oas/parser/index.ts +41 -20
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -8
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -14
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +43 -9
- package/src/lib/plugins/markdown/MdxPage.tsx +52 -35
- package/src/lib/plugins/markdown/Toc.tsx +1 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
- package/src/lib/plugins/markdown/index.tsx +10 -7
- package/src/lib/plugins/openapi/OperationList.tsx +40 -4
- package/src/lib/plugins/openapi/OperationListItem.tsx +69 -42
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +4 -4
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
- package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
- package/src/lib/plugins/openapi/client/createServer.ts +33 -0
- package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -1
- package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
- package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/index.tsx +59 -52
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +158 -193
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +34 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +7 -2
- package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
- package/src/lib/plugins/openapi/util/prose.ts +7 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +2 -2
- package/src/lib/ui/Callout.tsx +4 -4
- package/src/lib/util/MdxComponents.tsx +2 -12
- package/src/lib/util/groupBy.ts +7 -12
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/objectEntries.ts +5 -0
- package/src/lib/util/renderIf.ts +4 -0
- package/dist/lib/components/Link.d.ts +0 -1
- package/dist/lib/components/Link.js +0 -2
- package/dist/lib/components/Link.js.map +0 -1
- package/dist/lib/components/Router.d.ts +0 -4
- package/dist/lib/components/Router.js +0 -20
- package/dist/lib/components/Router.js.map +0 -1
- package/dist/lib/core/helmet.d.ts +0 -4
- package/dist/lib/core/helmet.js +0 -5
- package/dist/lib/core/helmet.js.map +0 -1
- package/dist/lib/core/icons.d.ts +0 -1
- package/dist/lib/core/icons.js +0 -2
- package/dist/lib/core/icons.js.map +0 -1
- package/dist/lib/core/router.d.ts +0 -1
- package/dist/lib/core/router.js +0 -2
- package/dist/lib/core/router.js.map +0 -1
- package/dist/lib/plugins/api-key/CreateApiKey.d.ts +0 -5
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +0 -5
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/lib/plugins/api-key/index.js.map +0 -1
- package/dist/lib/plugins/index.d.ts +0 -4
- package/dist/lib/plugins/index.js +0 -5
- package/dist/lib/plugins/index.js.map +0 -1
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/Select.js +0 -5
- package/dist/lib/plugins/openapi/Select.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
- package/dist/vite/common.d.ts +0 -1
- package/dist/vite/common.js +0 -5
- package/dist/vite/common.js.map +0 -1
- package/dist/vite/plugin-openapi-worker.d.ts +0 -4
- package/dist/vite/plugin-openapi-worker.js +0 -28
- package/dist/vite/plugin-openapi-worker.js.map +0 -1
- package/lib/Spinner-7LezPqGn.js +0 -8393
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-DNx3xWa2.js +0 -3461
- package/lib/urql-DMlBWUKL.js +0 -1591
- package/lib/zudoku.plugins.js +0 -19863
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/components/Router.tsx +0 -28
- package/src/lib/core/helmet.ts +0 -5
- package/src/lib/core/icons.tsx +0 -1
- package/src/lib/core/router.tsx +0 -1
- package/src/lib/plugins/index.ts +0 -4
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- /package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/* eslint-disable react/destructuring-assignment */
|
|
2
1
|
import { MDXProvider } from "@mdx-js/react";
|
|
3
2
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
import {
|
|
3
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
memo,
|
|
7
|
+
type PropsWithChildren,
|
|
8
|
+
useEffect,
|
|
9
|
+
useMemo,
|
|
10
|
+
} from "react";
|
|
11
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
5
12
|
import {
|
|
6
13
|
DevPortalContext,
|
|
7
14
|
queryClient,
|
|
8
|
-
|
|
15
|
+
ZudokuContextOptions,
|
|
9
16
|
} from "../core/DevPortalContext.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { AuthenticationProvider } from "../authentication/authentication.js";
|
|
14
|
-
import {
|
|
15
|
-
MdxComponents,
|
|
16
|
-
type MdxComponentsType,
|
|
17
|
-
} from "../util/MdxComponents.js";
|
|
17
|
+
import { hasHead } from "../core/plugins.js";
|
|
18
|
+
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
19
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
18
20
|
import {
|
|
19
21
|
ComponentsProvider,
|
|
20
22
|
DEFAULT_COMPONENTS,
|
|
21
|
-
type ComponentsContextType,
|
|
22
23
|
} from "./context/ComponentsContext.js";
|
|
23
24
|
import { DevPortalProvider } from "./context/DevPortalProvider.js";
|
|
24
25
|
import { ThemeProvider } from "./context/ThemeContext.js";
|
|
25
26
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
26
|
-
import { Router } from "./Router.js";
|
|
27
27
|
|
|
28
28
|
export const DevPortalSystemPaths = {
|
|
29
29
|
Settings: "/settings",
|
|
@@ -33,22 +33,10 @@ export type DevPortalPath =
|
|
|
33
33
|
| string
|
|
34
34
|
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
description: string;
|
|
41
|
-
logo: string;
|
|
42
|
-
favicon: string;
|
|
43
|
-
}>;
|
|
44
|
-
authentication?: AuthenticationProvider;
|
|
45
|
-
navigation: NavigationItem[];
|
|
46
|
-
plugins?: DevPortalPlugin[];
|
|
47
|
-
mdxComponents?: MdxComponentsType;
|
|
48
|
-
overrides?: ComponentsContextType;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const DevPortalInner = (props: DevPortalProps) => {
|
|
36
|
+
const DevPortalInner = ({
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: PropsWithChildren<ZudokuContextOptions>) => {
|
|
52
40
|
const components = useMemo(
|
|
53
41
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
54
42
|
[props.overrides],
|
|
@@ -65,39 +53,36 @@ const DevPortalInner = (props: DevPortalProps) => {
|
|
|
65
53
|
void devPortalContext.initialize();
|
|
66
54
|
}, [devPortalContext]);
|
|
67
55
|
|
|
56
|
+
const heads = props.plugins
|
|
57
|
+
?.filter(hasHead)
|
|
58
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
59
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
60
|
+
|
|
68
61
|
return (
|
|
69
62
|
<QueryClientProvider client={queryClient}>
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</div>
|
|
81
|
-
}
|
|
82
|
-
>
|
|
83
|
-
<Router
|
|
84
|
-
plugins={[
|
|
85
|
-
...(props.plugins ?? []),
|
|
86
|
-
...(props.authentication ? [props.authentication] : []),
|
|
87
|
-
]}
|
|
88
|
-
/>
|
|
89
|
-
</Suspense>
|
|
90
|
-
</ViewportAnchorProvider>
|
|
91
|
-
</ComponentsProvider>
|
|
92
|
-
</ThemeProvider>
|
|
93
|
-
</MDXProvider>
|
|
94
|
-
</DevPortalProvider>
|
|
95
|
-
</HelmetProvider>
|
|
63
|
+
<Helmet>{heads}</Helmet>
|
|
64
|
+
<DevPortalProvider value={devPortalContext}>
|
|
65
|
+
<MDXProvider components={mdxComponents}>
|
|
66
|
+
<ThemeProvider>
|
|
67
|
+
<ComponentsProvider value={components}>
|
|
68
|
+
<ViewportAnchorProvider>{children}</ViewportAnchorProvider>
|
|
69
|
+
</ComponentsProvider>
|
|
70
|
+
</ThemeProvider>
|
|
71
|
+
</MDXProvider>
|
|
72
|
+
</DevPortalProvider>
|
|
96
73
|
</QueryClientProvider>
|
|
97
74
|
);
|
|
98
75
|
};
|
|
99
76
|
|
|
100
|
-
const
|
|
77
|
+
const Inner = memo(DevPortalInner);
|
|
78
|
+
|
|
79
|
+
const DevPortal = (props: ZudokuContextOptions) => {
|
|
80
|
+
return (
|
|
81
|
+
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
82
|
+
<Inner {...props} />
|
|
83
|
+
</ErrorBoundary>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
101
86
|
DevPortal.displayName = "DevPortal";
|
|
102
87
|
|
|
103
88
|
export { DevPortal };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
|
+
import { Heading } from "./Heading.js";
|
|
5
|
+
import { ProseClasses } from "./Markdown.js";
|
|
6
|
+
|
|
7
|
+
export const ErrorPage = ({
|
|
8
|
+
title = "An error occurred",
|
|
9
|
+
message,
|
|
10
|
+
category,
|
|
11
|
+
}: {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
message?: ReactNode;
|
|
14
|
+
category?: ReactNode;
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={ProseClasses + " h-full pt-[--padding-content-top]"}>
|
|
18
|
+
{category && <CategoryHeading>{category}</CategoryHeading>}
|
|
19
|
+
{title && (
|
|
20
|
+
<Heading level={1} className="flex gap-3.5 items-center">
|
|
21
|
+
{title}
|
|
22
|
+
</Heading>
|
|
23
|
+
)}
|
|
24
|
+
<p>{message}</p>
|
|
25
|
+
<Link to="/">Go back home</Link>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MoonStarIcon,
|
|
1
|
+
import { MoonStarIcon, SunIcon } from "lucide-react";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
|
|
4
4
|
import { useAuth } from "../authentication/hook.js";
|
|
@@ -9,7 +9,7 @@ import { useTheme } from "./context/ThemeContext.js";
|
|
|
9
9
|
export const Header = memo(function HeaderInner() {
|
|
10
10
|
const [isDark, toggleTheme] = useTheme();
|
|
11
11
|
const { isAuthenticated, profile, isAuthEnabled, login, logout } = useAuth();
|
|
12
|
-
const {
|
|
12
|
+
const { page } = useDevPortal();
|
|
13
13
|
|
|
14
14
|
const ThemeIcon = isDark ? MoonStarIcon : SunIcon;
|
|
15
15
|
|
|
@@ -18,16 +18,16 @@ export const Header = memo(function HeaderInner() {
|
|
|
18
18
|
<div className="max-w-screen-2xl mx-auto">
|
|
19
19
|
<div className="grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b border-border px-12 h-[--top-header-height]">
|
|
20
20
|
<div className="flex items-center gap-3.5">
|
|
21
|
-
{
|
|
22
|
-
<img src={
|
|
21
|
+
{page?.logo && (
|
|
22
|
+
<img src={page.logo} alt={page.pageTitle} className="h-10" />
|
|
23
23
|
)}
|
|
24
24
|
<span className="font-bold text-2xl text-foreground/85 tracking-wide">
|
|
25
|
-
{
|
|
25
|
+
{page?.pageTitle}
|
|
26
26
|
</span>
|
|
27
27
|
</div>
|
|
28
28
|
<div className="grid grid-cols-[--sidecar-grid-cols] items-center gap-8">
|
|
29
29
|
<div className="w-full max-w-prose">
|
|
30
|
-
|
|
30
|
+
{/*<button 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-40 sm:w-72">
|
|
31
31
|
<div className="flex items-center gap-2 flex-grow">
|
|
32
32
|
<SearchIcon size={14} />
|
|
33
33
|
Search
|
|
@@ -35,7 +35,7 @@ export const Header = memo(function HeaderInner() {
|
|
|
35
35
|
<kbd className="absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex">
|
|
36
36
|
⌘K
|
|
37
37
|
</kbd>
|
|
38
|
-
</button
|
|
38
|
+
</button>*/}
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
41
|
<div className="items-center justify-self-end text-sm hidden lg:flex">
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { cn } from "../util/cn.js";
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
3
2
|
import { useRegisterAnchorElement } from "./context/ViewportAnchorContext.js";
|
|
4
3
|
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
const heading = cva("group relative", {
|
|
7
|
+
variants: {
|
|
8
|
+
level: {
|
|
9
|
+
6: "text-md",
|
|
10
|
+
5: "text-lg",
|
|
11
|
+
4: "text-xl",
|
|
12
|
+
3: "text-xl font-semibold",
|
|
13
|
+
2: "text-2xl font-bold",
|
|
14
|
+
1: "text-4xl font-extrabold",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
level: 1,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
5
22
|
const getComponent = (level: number) => {
|
|
6
23
|
switch (level) {
|
|
7
24
|
case 1:
|
|
@@ -21,27 +38,29 @@ const getComponent = (level: number) => {
|
|
|
21
38
|
}
|
|
22
39
|
};
|
|
23
40
|
|
|
24
|
-
export
|
|
41
|
+
export interface HeadingProps
|
|
42
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
43
|
+
VariantProps<typeof heading> {
|
|
25
44
|
children: ReactNode;
|
|
26
45
|
className?: string;
|
|
27
46
|
id?: string;
|
|
28
47
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
29
48
|
registerSidebarAnchor?: boolean;
|
|
30
|
-
}
|
|
49
|
+
}
|
|
31
50
|
|
|
32
|
-
export const Heading = ({
|
|
51
|
+
export const Heading: React.FC<HeadingProps> = ({
|
|
33
52
|
level,
|
|
34
53
|
children,
|
|
35
54
|
id,
|
|
36
55
|
className,
|
|
37
56
|
registerSidebarAnchor,
|
|
38
|
-
}
|
|
57
|
+
}) => {
|
|
39
58
|
const Component = getComponent(level ?? 1);
|
|
40
59
|
const { ref } = useRegisterAnchorElement();
|
|
41
60
|
|
|
42
61
|
return (
|
|
43
62
|
<Component
|
|
44
|
-
className={
|
|
63
|
+
className={heading({ className, level })}
|
|
45
64
|
ref={registerSidebarAnchor ? ref : undefined}
|
|
46
65
|
id={id}
|
|
47
66
|
>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../util/cn.js";
|
|
3
|
+
|
|
4
|
+
export const InlineCode = ({
|
|
5
|
+
className,
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
className?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => (
|
|
11
|
+
<code
|
|
12
|
+
className={cn(
|
|
13
|
+
className,
|
|
14
|
+
"font-mono border border-border p-1 py-0.5 rounded bg-border/50 dark:bg-border/70 whitespace-nowrap",
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</code>
|
|
19
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
1
2
|
import { Suspense, useEffect, useRef, type ReactNode } from "react";
|
|
2
3
|
import { Outlet, useLocation } from "react-router-dom";
|
|
3
|
-
import {
|
|
4
|
+
import { cn } from "../util/cn.js";
|
|
4
5
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
5
6
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
6
7
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
@@ -29,8 +30,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
32
|
<>
|
|
32
|
-
<Helmet titleTemplate={meta?.
|
|
33
|
-
<title>Home</title>
|
|
33
|
+
<Helmet titleTemplate={meta?.title}>
|
|
34
34
|
{meta?.description && (
|
|
35
35
|
<meta name="description" content={meta.description} />
|
|
36
36
|
)}
|
|
@@ -48,10 +48,12 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
48
48
|
>
|
|
49
49
|
<SideNavigation />
|
|
50
50
|
<main
|
|
51
|
-
className=
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
className={cn(
|
|
52
|
+
"dark:border-white/10 translate-x-0 h-full",
|
|
53
|
+
"lg:overflow-visible",
|
|
54
|
+
"lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]",
|
|
55
|
+
"lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] peer-data-[navigation=true]:pl-12",
|
|
56
|
+
)}
|
|
55
57
|
>
|
|
56
58
|
{children ?? <Outlet />}
|
|
57
59
|
</main>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UnlinkIcon } from "lucide-react";
|
|
2
|
+
import { Link, useParams } from "react-router-dom";
|
|
3
|
+
import { Callout } from "../ui/Callout.js";
|
|
4
|
+
import { CategoryHeading } from "./CategoryHeading.js";
|
|
5
|
+
import { Heading } from "./Heading.js";
|
|
6
|
+
import { ProseClasses } from "./Markdown.js";
|
|
7
|
+
|
|
8
|
+
export const NotFoundPage = () => {
|
|
9
|
+
const params = useParams();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className={ProseClasses + " h-full pt-[--padding-content-top]"}>
|
|
13
|
+
<CategoryHeading>404</CategoryHeading>
|
|
14
|
+
<Heading level={1} className="flex gap-3.5 items-center">
|
|
15
|
+
Page not found
|
|
16
|
+
<UnlinkIcon size={24} />
|
|
17
|
+
</Heading>
|
|
18
|
+
{import.meta.env.DEV && (
|
|
19
|
+
<Callout type="caution" title="Developer hint">
|
|
20
|
+
Start by adding a file at{" "}
|
|
21
|
+
<code>
|
|
22
|
+
{"{PROJECT_ROOT}"}/{params["*"]}.mdx
|
|
23
|
+
</code>{" "}
|
|
24
|
+
and add some content to make this error go away.
|
|
25
|
+
<br />
|
|
26
|
+
<small className="italic">
|
|
27
|
+
Note: This hint is only shown in development mode.
|
|
28
|
+
</small>
|
|
29
|
+
</Callout>
|
|
30
|
+
)}
|
|
31
|
+
<p>
|
|
32
|
+
It seems that the page you are looking for does not exist or may have
|
|
33
|
+
been moved. Please check the URL for any typos or use the navigation
|
|
34
|
+
menu to find the correct page.
|
|
35
|
+
</p>
|
|
36
|
+
<Link to="/">Go back home</Link>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -7,21 +7,23 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
globalThis.Prism = Prism;
|
|
11
|
+
// @ts-expect-error This is untyped
|
|
12
|
+
import("prismjs/components/prism-bash.min.js");
|
|
13
|
+
// @ts-expect-error This is untyped
|
|
14
|
+
import("prismjs/components/prism-ruby.min.js");
|
|
15
|
+
// @ts-expect-error This is untyped
|
|
16
|
+
import("prismjs/components/prism-markup-templating.js");
|
|
17
|
+
// @ts-expect-error This is untyped
|
|
18
|
+
import("prismjs/components/prism-php.min.js");
|
|
19
|
+
// @ts-expect-error This is untyped
|
|
20
|
+
import("prismjs/components/prism-json.min.js");
|
|
21
|
+
// @ts-expect-error This is untyped
|
|
22
|
+
import("prismjs/components/prism-java.min.js");
|
|
23
|
+
// @ts-expect-error This is untyped
|
|
24
|
+
import("prismjs/components/prism-csharp.min.js");
|
|
25
|
+
// @ts-expect-error This is untyped
|
|
26
|
+
import("prismjs/components/prism-objectivec.min.js");
|
|
25
27
|
|
|
26
28
|
import { useState } from "react";
|
|
27
29
|
import { cn } from "../util/cn.js";
|
|
@@ -33,10 +35,12 @@ type SyntaxHighlightProps = {
|
|
|
33
35
|
wrapLines?: boolean;
|
|
34
36
|
copyable?: boolean;
|
|
35
37
|
showLanguageIndicator?: boolean;
|
|
36
|
-
|
|
38
|
+
language?: string;
|
|
39
|
+
} & Omit<HighlightProps, "children" | "language">;
|
|
37
40
|
|
|
38
41
|
export const SyntaxHighlight = ({
|
|
39
42
|
copyable = true,
|
|
43
|
+
language = "plain",
|
|
40
44
|
...props
|
|
41
45
|
}: SyntaxHighlightProps) => {
|
|
42
46
|
const [isDark] = useTheme();
|
|
@@ -47,7 +51,11 @@ export const SyntaxHighlight = ({
|
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
return (
|
|
50
|
-
<Highlight
|
|
54
|
+
<Highlight
|
|
55
|
+
theme={isDark ? themes.vsDark : themes.github}
|
|
56
|
+
language={language}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
51
59
|
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
|
52
60
|
<pre
|
|
53
61
|
className={cn(
|
|
@@ -67,7 +75,7 @@ export const SyntaxHighlight = ({
|
|
|
67
75
|
disabled={isCopied}
|
|
68
76
|
onClick={() => {
|
|
69
77
|
setIsCopied(true);
|
|
70
|
-
navigator.clipboard.writeText(
|
|
78
|
+
void navigator.clipboard.writeText(
|
|
71
79
|
tokens
|
|
72
80
|
.map((line) => line.map(({ content }) => content).join(""))
|
|
73
81
|
.join("\n"),
|
|
@@ -84,7 +92,7 @@ export const SyntaxHighlight = ({
|
|
|
84
92
|
)}
|
|
85
93
|
{props.showLanguageIndicator && (
|
|
86
94
|
<span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
|
|
87
|
-
{
|
|
95
|
+
{language}
|
|
88
96
|
</span>
|
|
89
97
|
)}
|
|
90
98
|
{tokens.map((line, i) => (
|
|
@@ -6,6 +6,11 @@ import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
|
6
6
|
export const TopNavigation = () => {
|
|
7
7
|
const { navigation } = useDevPortal();
|
|
8
8
|
|
|
9
|
+
// Hide tope nav if there is only one item
|
|
10
|
+
if (navigation.length <= 1) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
return (
|
|
10
15
|
<nav className="border-b border-border text-sm px-12 h-[--top-nav-height]">
|
|
11
16
|
<ul className="flex flex-row items-center gap-8">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
1
|
+
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { matchPath, useLocation } from "react-router-dom";
|
|
4
4
|
import { DevPortalContext } from "../../core/DevPortalContext.js";
|
|
@@ -21,7 +21,7 @@ export const useDevPortal = () => {
|
|
|
21
21
|
|
|
22
22
|
export const useApiIdentities = () => {
|
|
23
23
|
const { getApiIdentities } = useDevPortal();
|
|
24
|
-
return
|
|
24
|
+
return useQuery({
|
|
25
25
|
queryFn: getApiIdentities,
|
|
26
26
|
queryKey: ["api-identities"],
|
|
27
27
|
});
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
|
+
import { Link as LinkImport } from "react-router-dom";
|
|
3
|
+
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
4
|
+
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
5
|
+
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
6
|
+
import {
|
|
7
|
+
Bootstrap as BootstrapImport,
|
|
8
|
+
BootstrapStatic as BootstrapStaticImport,
|
|
9
|
+
} from "./Bootstrap.js";
|
|
10
|
+
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
11
|
+
import { Layout as LayoutImport } from "./Layout.js";
|
|
12
|
+
|
|
13
|
+
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
14
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
15
|
+
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
16
|
+
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
17
|
+
export const Link = /*@__PURE__*/ LinkImport;
|
|
18
|
+
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
19
|
+
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
20
|
+
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|
|
21
|
+
export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
@@ -2,16 +2,15 @@ import { QueryClient } from "@tanstack/react-query";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { create } from "zustand";
|
|
4
4
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
|
+
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
|
+
import { type DevPortalPath } from "../components/DevPortal.js";
|
|
7
|
+
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
5
8
|
import {
|
|
6
|
-
type
|
|
7
|
-
type DevPortalProps,
|
|
8
|
-
} from "../components/DevPortal.js";
|
|
9
|
-
import {
|
|
9
|
+
type DevPortalPlugin,
|
|
10
10
|
isApiIdentityPlugin,
|
|
11
11
|
isNavigationPlugin,
|
|
12
|
-
needsInitialization,
|
|
13
|
-
type DevPortalPlugin,
|
|
14
12
|
type NavigationPlugin,
|
|
13
|
+
needsInitialization,
|
|
15
14
|
} from "./plugins.js";
|
|
16
15
|
|
|
17
16
|
export interface ApiIdentity {
|
|
@@ -66,29 +65,59 @@ export const useRoutingState = create<RoutingState>(() => ({}));
|
|
|
66
65
|
export type ApiKeyCache = "api-keys";
|
|
67
66
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
68
67
|
|
|
68
|
+
export type ZudokuContextMetadataOptions = Partial<{
|
|
69
|
+
title: string;
|
|
70
|
+
description: string;
|
|
71
|
+
logo: string;
|
|
72
|
+
favicon: string;
|
|
73
|
+
generator: string;
|
|
74
|
+
applicationName: string;
|
|
75
|
+
referrer: string;
|
|
76
|
+
keywords: string[];
|
|
77
|
+
authors: string[];
|
|
78
|
+
creator: string;
|
|
79
|
+
publisher: string;
|
|
80
|
+
}>;
|
|
81
|
+
export type ZudokuContextPageOptions = Partial<{
|
|
82
|
+
pageTitle?: string;
|
|
83
|
+
logo?: string;
|
|
84
|
+
}>;
|
|
85
|
+
export type ZudokuContextOptions = {
|
|
86
|
+
metadata?: ZudokuContextMetadataOptions;
|
|
87
|
+
page?: ZudokuContextPageOptions;
|
|
88
|
+
authentication?: AuthenticationProvider;
|
|
89
|
+
navigation: NavigationItem[];
|
|
90
|
+
plugins?: DevPortalPlugin[];
|
|
91
|
+
mdxComponents?: MdxComponentsType;
|
|
92
|
+
overrides?: ComponentsContextType;
|
|
93
|
+
};
|
|
94
|
+
|
|
69
95
|
export class DevPortalContext {
|
|
70
96
|
private plugins: DevPortalPlugin[] = [];
|
|
71
97
|
private navigationPlugins: NavigationPlugin[];
|
|
72
98
|
|
|
73
99
|
public navigation: NavigationItem[];
|
|
74
|
-
public meta:
|
|
100
|
+
public meta: ZudokuContextOptions["metadata"];
|
|
101
|
+
public page: ZudokuContextOptions["page"];
|
|
75
102
|
public authentication?: AuthenticationProvider;
|
|
76
103
|
public state: typeof useRoutingState;
|
|
77
104
|
|
|
78
|
-
constructor(config:
|
|
105
|
+
constructor(config: ZudokuContextOptions) {
|
|
79
106
|
this.plugins = config.plugins ?? [];
|
|
80
107
|
this.navigation = config.navigation;
|
|
81
108
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
82
109
|
this.authentication = config.authentication;
|
|
83
|
-
this.meta = config.
|
|
110
|
+
this.meta = config.metadata;
|
|
111
|
+
this.page = config.page;
|
|
84
112
|
this.state = useRoutingState;
|
|
85
113
|
}
|
|
86
114
|
|
|
87
115
|
initialize = async () => {
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
116
|
+
await Promise.all([
|
|
117
|
+
this.plugins
|
|
118
|
+
.filter(needsInitialization)
|
|
119
|
+
.map((plugin) => plugin.initialize?.(this)),
|
|
120
|
+
]);
|
|
92
121
|
};
|
|
93
122
|
|
|
94
123
|
invalidateCache = async (key: DevPortalCacheKey[]) => {
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type RouteObject } from "react-router-dom";
|
|
2
3
|
import {
|
|
3
4
|
DevPortalContext,
|
|
@@ -10,9 +11,9 @@ export type PluginNavigationCategory = {
|
|
|
10
11
|
} & NavigationCategory;
|
|
11
12
|
|
|
12
13
|
export type DevPortalPlugin =
|
|
14
|
+
| CommonPlugin
|
|
13
15
|
| NavigationPlugin
|
|
14
|
-
| ApiIdentityPlugin
|
|
15
|
-
| InitializationPlugin;
|
|
16
|
+
| ApiIdentityPlugin;
|
|
16
17
|
|
|
17
18
|
export interface NavigationPlugin {
|
|
18
19
|
getRoutes: () => RouteObject[];
|
|
@@ -23,8 +24,9 @@ export interface ApiIdentityPlugin {
|
|
|
23
24
|
getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export interface
|
|
27
|
-
initialize
|
|
27
|
+
export interface CommonPlugin {
|
|
28
|
+
initialize?: (context: DevPortalContext) => Promise<void> | void;
|
|
29
|
+
getHead?: () => ReactElement | undefined;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export const isNavigationPlugin = (
|
|
@@ -34,9 +36,12 @@ export const isNavigationPlugin = (
|
|
|
34
36
|
|
|
35
37
|
export const needsInitialization = (
|
|
36
38
|
obj: DevPortalPlugin,
|
|
37
|
-
): obj is
|
|
39
|
+
): obj is CommonPlugin =>
|
|
38
40
|
"initialize" in obj && typeof obj.initialize === "function";
|
|
39
41
|
|
|
42
|
+
export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
|
|
43
|
+
"getHead" in obj && typeof obj.getHead === "function";
|
|
44
|
+
|
|
40
45
|
export const isApiIdentityPlugin = (
|
|
41
46
|
obj: DevPortalPlugin,
|
|
42
47
|
): obj is ApiIdentityPlugin =>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
export function ErrorAlert({ error }: { error: any }) {
|
|
3
|
+
const message = error?.message ?? "Something went wrong";
|
|
4
|
+
const stack = error?.stack;
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
|
|
8
|
+
<div className="mx-auto max-w-[85%] sm:max-w-[50%]">
|
|
9
|
+
<h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
|
|
10
|
+
Something went wrong
|
|
11
|
+
</h1>
|
|
12
|
+
<p className="mt-5 text-h1-text">{message}</p>
|
|
13
|
+
{stack ? (
|
|
14
|
+
<pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
|
|
15
|
+
{stack}
|
|
16
|
+
</pre>
|
|
17
|
+
) : null}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|