zudoku 0.3.0-dev.3 → 0.3.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +27 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/main.d.ts +2 -1
- package/dist/app/main.js +31 -10
- 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 -9
- package/dist/app/tailwind.js.map +1 -1
- package/dist/config/config.d.ts +10 -16
- 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 +2 -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/DevPortal.d.ts +5 -20
- package/dist/lib/components/DevPortal.js +20 -11
- package/dist/lib/components/DevPortal.js.map +1 -1
- 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/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Router.js +2 -1
- package/dist/lib/components/Router.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +5 -1
- 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 +13 -3
- package/dist/lib/components/index.js +8 -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 -4
- 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 +9 -0
- package/dist/lib/errors/RouterError.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.js +3 -1
- 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 +37 -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 +2 -2
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +5 -4
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +8 -4
- 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 +4 -26
- 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} +11 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +2 -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 +1 -19
- package/dist/lib/plugins/openapi/index.js +27 -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/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/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/button-variants.d.ts +1 -1
- package/dist/lib/util/MdxComponents.js +1 -1
- package/dist/lib/util/MdxComponents.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 +4 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +11 -8
- package/dist/vite/config.js +58 -50
- 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.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +0 -1
- 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 +7 -11
- 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 +1 -1
- 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-docs.js +9 -8
- 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-openapi-worker.js +11 -3
- package/dist/vite/plugin-openapi-worker.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 +1 -1
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AnchorLink-ptdQk87q.js +706 -0
- package/lib/AnchorLink-ptdQk87q.js.map +1 -0
- package/lib/DevPortalProvider-BMk-RCE0.js +1081 -0
- package/lib/DevPortalProvider-BMk-RCE0.js.map +1 -0
- package/lib/Markdown-DDmW47R9.js +8621 -0
- package/lib/Markdown-DDmW47R9.js.map +1 -0
- package/lib/MdxComponents-C0R6zobS.js +3019 -0
- package/lib/MdxComponents-C0R6zobS.js.map +1 -0
- package/lib/MdxPage-DyJAHF9y.js +217 -0
- package/lib/MdxPage-DyJAHF9y.js.map +1 -0
- package/lib/OperationList-Dz9rHM9r.js +5546 -0
- package/lib/OperationList-Dz9rHM9r.js.map +1 -0
- package/lib/Route-CN_7-e5r.js +14 -0
- package/lib/Route-CN_7-e5r.js.map +1 -0
- package/lib/Select-D-Jtx53Q.js +4572 -0
- package/lib/Select-D-Jtx53Q.js.map +1 -0
- package/lib/Spinner-BG1JnYy0.js +182 -0
- package/lib/Spinner-BG1JnYy0.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-BXS8hiSM.js} +9844 -9800
- package/lib/assets/worker-BXS8hiSM.js.map +1 -0
- package/lib/cn-DpqTslo9.js +2342 -0
- package/lib/cn-DpqTslo9.js.map +1 -0
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/context-_fYfJFgk.js.map +1 -0
- package/lib/hook-BzBeIPL4.js +25 -0
- package/lib/hook-BzBeIPL4.js.map +1 -0
- package/lib/index-BaOOUFsA.js +412 -0
- package/lib/index-BaOOUFsA.js.map +1 -0
- package/lib/index-CPvRaBBB.js +713 -0
- package/lib/index-CPvRaBBB.js.map +1 -0
- package/lib/index-Cpdpun6t.js +710 -0
- package/lib/index-Cpdpun6t.js.map +1 -0
- package/lib/index-DLS6fPwU.js +464 -0
- package/lib/index-DLS6fPwU.js.map +1 -0
- package/lib/jsx-runtime-SV6hXQua.js +3009 -0
- package/lib/jsx-runtime-SV6hXQua.js.map +1 -0
- package/lib/loglevel-CA34MiFn.js +153 -0
- package/lib/loglevel-CA34MiFn.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/{state-oycsxkHz.js → state-Ds_OxRHP.js} +20 -18
- package/lib/state-Ds_OxRHP.js.map +1 -0
- package/lib/urql-DMlBWUKL.js +1 -0
- package/lib/urql-DMlBWUKL.js.map +1 -0
- package/lib/util-CCWvaWo7.js +41 -0
- package/lib/util-CCWvaWo7.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 +444 -588
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +429 -334
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +16 -13
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +296 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +52 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +8 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +12 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/package.json +21 -6
- 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/main.css +74 -0
- package/src/app/main.tsx +42 -9
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +46 -0
- package/src/app/tailwind.ts +1 -11
- 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 +2 -0
- package/src/lib/authentication/providers/openid.tsx +3 -1
- package/src/lib/authentication/state.ts +2 -0
- package/src/lib/components/DevPortal.tsx +23 -30
- package/src/lib/components/Header.tsx +7 -7
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/Layout.tsx +3 -4
- package/src/lib/components/Router.tsx +3 -7
- package/src/lib/components/SyntaxHighlight.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +5 -0
- package/src/lib/components/context/DevPortalProvider.ts +2 -2
- package/src/lib/components/index.ts +9 -3
- package/src/lib/core/DevPortalContext.ts +42 -12
- package/src/lib/core/plugins.ts +10 -5
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +12 -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 +3 -1
- 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 +54 -8
- 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 +15 -5
- package/src/lib/plugins/markdown/index.tsx +8 -1
- package/src/lib/plugins/openapi/OperationList.tsx +10 -4
- package/src/lib/plugins/openapi/OperationListItem.tsx +66 -41
- 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 +15 -182
- 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} +13 -1
- package/src/lib/plugins/openapi/client/interfaces.ts +3 -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 +37 -51
- 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 +1 -1
- 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/ui/Callout.tsx +2 -2
- package/src/lib/util/MdxComponents.tsx +1 -2
- 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/app/App.d.ts +0 -2
- package/dist/app/App.js +0 -29
- package/dist/app/App.js.map +0 -1
- 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/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/lib/Spinner-7LezPqGn.js +0 -8393
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-DNx3xWa2.js +0 -3461
- package/lib/zudoku.plugins.js +0 -19863
- package/src/app/App.tsx +0 -40
- package/src/lib/components/Link.tsx +0 -1
- 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
package/src/app/main.css
CHANGED
|
@@ -2,6 +2,80 @@
|
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: Geist;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-weight: 100;
|
|
9
|
+
font-display: swap;
|
|
10
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Thin.woff2") format("woff2");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@font-face {
|
|
14
|
+
font-family: Geist;
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: 200;
|
|
17
|
+
font-display: swap;
|
|
18
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-UltraLight.woff2")
|
|
19
|
+
format("woff2");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: Geist;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 300;
|
|
26
|
+
font-display: swap;
|
|
27
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Light.woff2") format("woff2");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@font-face {
|
|
31
|
+
font-family: Geist;
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
font-display: swap;
|
|
35
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Regular.woff2") format("woff2");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: Geist;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Medium.woff2") format("woff2");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@font-face {
|
|
47
|
+
font-family: Geist;
|
|
48
|
+
font-style: normal;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
font-display: swap;
|
|
51
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-SemiBold.woff2") format("woff2");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@font-face {
|
|
55
|
+
font-family: Geist;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
font-display: swap;
|
|
59
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Bold.woff2") format("woff2");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@font-face {
|
|
63
|
+
font-family: Geist;
|
|
64
|
+
font-style: normal;
|
|
65
|
+
font-weight: 800;
|
|
66
|
+
font-display: swap;
|
|
67
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-Black.woff2") format("woff2");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@font-face {
|
|
71
|
+
font-family: Geist;
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 900;
|
|
74
|
+
font-display: swap;
|
|
75
|
+
src: url("https://cdn.zudoku.dev/geist/Geist-UltraBlack.woff2")
|
|
76
|
+
format("woff2");
|
|
77
|
+
}
|
|
78
|
+
|
|
5
79
|
@layer base {
|
|
6
80
|
:root {
|
|
7
81
|
--top-header-height: 65px;
|
package/src/app/main.tsx
CHANGED
|
@@ -1,18 +1,51 @@
|
|
|
1
|
-
import log from "loglevel";
|
|
2
1
|
import { StrictMode } from "react";
|
|
3
2
|
import { createRoot } from "react-dom/client";
|
|
4
|
-
import App from "./App.js";
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
// Styles
|
|
5
|
+
import "./main.css";
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
// Logger
|
|
8
|
+
import "../lib/util/logInit.js";
|
|
9
|
+
|
|
10
|
+
// Config
|
|
11
|
+
import config from "virtual:zudoku-config";
|
|
12
|
+
|
|
13
|
+
// Plugins
|
|
14
|
+
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
15
|
+
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
16
|
+
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
17
|
+
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
18
|
+
import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
19
|
+
|
|
20
|
+
// Base React Component
|
|
21
|
+
import { DevPortal } from "zudoku/components";
|
|
22
|
+
|
|
23
|
+
// IMPORTANT: This component must not contain tailwind classes
|
|
24
|
+
// This directory is not processed by the tailwind plugin
|
|
13
25
|
|
|
14
26
|
createRoot(document.getElementById("root")!).render(
|
|
15
27
|
<StrictMode>
|
|
16
|
-
<
|
|
28
|
+
<DevPortal
|
|
29
|
+
page={{
|
|
30
|
+
logo: config.page?.logo ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
31
|
+
pageTitle: "Developer Portal",
|
|
32
|
+
...config.page,
|
|
33
|
+
}}
|
|
34
|
+
metadata={{
|
|
35
|
+
favicon: "https://cdn.zudoku.dev/logos/icon.svg",
|
|
36
|
+
title: "%s | Developer Portal",
|
|
37
|
+
...config.metadata,
|
|
38
|
+
}}
|
|
39
|
+
navigation={config.navigation ?? []}
|
|
40
|
+
authentication={configuredAuthProvider}
|
|
41
|
+
mdxComponents={config.mdx?.components}
|
|
42
|
+
plugins={[
|
|
43
|
+
...configuredDocsPlugins,
|
|
44
|
+
...configuredApiPlugins,
|
|
45
|
+
configuredRedirectPlugin,
|
|
46
|
+
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
47
|
+
...(configuredAuthProvider ? [configuredAuthProvider] : []),
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
17
50
|
</StrictMode>,
|
|
18
51
|
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
rel="icon"
|
|
7
|
+
type="image/svg+xml"
|
|
8
|
+
href="https://cdn.zudoku.dev/logos/icon.svg"
|
|
9
|
+
/>
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
|
+
<title>Dev Portal</title>
|
|
12
|
+
<script type="module" crossorigin src="./main.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./style.css" />
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div
|
|
17
|
+
data-api-url="https://blue-sloth-main-afc3428.d2.zuplo.dev/schemas/rewiring-america"
|
|
18
|
+
></div>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { StrictMode } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
|
|
4
|
+
// Styles
|
|
5
|
+
import "./main.css";
|
|
6
|
+
|
|
7
|
+
// Logger
|
|
8
|
+
import "../lib/util/logInit.js";
|
|
9
|
+
|
|
10
|
+
// Base React Component
|
|
11
|
+
import { DevPortal } from "../lib/components/DevPortal.js";
|
|
12
|
+
|
|
13
|
+
// Plugins
|
|
14
|
+
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
15
|
+
|
|
16
|
+
const root = document.querySelector("[data-api-url]");
|
|
17
|
+
if (!root || root.tagName !== "DIV") {
|
|
18
|
+
throw new Error("No div found with attribute data-api-url");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const apiUrl = root.getAttribute("data-api-url");
|
|
22
|
+
const pageTitle = document.getElementsByTagName("title")[0].innerText;
|
|
23
|
+
const logoUrl = root.getAttribute("data-logo-url");
|
|
24
|
+
|
|
25
|
+
// IMPORTANT: This component must not contain tailwind classes
|
|
26
|
+
// This directory is not processed by the tailwind plugin
|
|
27
|
+
|
|
28
|
+
createRoot(root).render(
|
|
29
|
+
<StrictMode>
|
|
30
|
+
<DevPortal
|
|
31
|
+
page={{
|
|
32
|
+
logo: logoUrl ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
34
|
+
pageTitle: pageTitle ?? "Developer Portal",
|
|
35
|
+
}}
|
|
36
|
+
navigation={[
|
|
37
|
+
{
|
|
38
|
+
label: "API Reference",
|
|
39
|
+
path: "/",
|
|
40
|
+
categories: [],
|
|
41
|
+
},
|
|
42
|
+
]}
|
|
43
|
+
plugins={[openApiPlugin({ type: "url", input: apiUrl!, path: "/" })]}
|
|
44
|
+
/>
|
|
45
|
+
</StrictMode>,
|
|
46
|
+
);
|
package/src/app/tailwind.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import typographyPlugin from "@tailwindcss/typography";
|
|
2
2
|
import type { Config } from "tailwindcss";
|
|
3
3
|
import defaultTheme from "tailwindcss/defaultTheme.js";
|
|
4
|
-
const content = [
|
|
5
|
-
"./src/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
6
|
-
"./node_modules/zudoku/dist/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
7
|
-
];
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
// if (process.env.NODE_ENV === "development") {
|
|
11
|
-
// content.push("../../plugins/*/src/**/*.{js,ts,jsx,tsx}");
|
|
12
|
-
// }
|
|
13
|
-
|
|
14
|
-
const config: Config = {
|
|
5
|
+
const config: Omit<Config, "content"> = {
|
|
15
6
|
darkMode: "selector",
|
|
16
|
-
content,
|
|
17
7
|
theme: {
|
|
18
8
|
extend: {
|
|
19
9
|
fontFamily: {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InitializationPlugin,
|
|
3
|
-
NavigationPlugin,
|
|
4
|
-
} from "../../lib/core/plugins.js";
|
|
1
|
+
import { CommonPlugin, NavigationPlugin } from "../core/plugins.js";
|
|
5
2
|
|
|
6
|
-
type AuthenticationPlugin = NavigationPlugin &
|
|
3
|
+
type AuthenticationPlugin = NavigationPlugin & CommonPlugin;
|
|
7
4
|
|
|
8
5
|
export interface AuthenticationProvider extends AuthenticationPlugin {
|
|
9
6
|
login(): Promise<void>;
|
|
@@ -34,6 +34,7 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
34
34
|
if (clerkApi.session) {
|
|
35
35
|
useAuthState.setState({
|
|
36
36
|
isAuthenticated: true,
|
|
37
|
+
isPending: false,
|
|
37
38
|
profile: {
|
|
38
39
|
sub: clerkApi.session.user.id,
|
|
39
40
|
name: clerkApi.session.user.fullName ?? undefined,
|
|
@@ -46,6 +47,7 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
46
47
|
} else {
|
|
47
48
|
useAuthState.setState({
|
|
48
49
|
isAuthenticated: false,
|
|
50
|
+
isPending: false,
|
|
49
51
|
profile: undefined,
|
|
50
52
|
});
|
|
51
53
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logger from "loglevel";
|
|
2
2
|
import * as oauth from "oauth4webapi";
|
|
3
|
+
import type { RouteObject } from "react-router-dom";
|
|
3
4
|
import { OpenIDAuthenticationConfig } from "../../../config/config.js";
|
|
4
|
-
import { RouteObject } from "../../core/router.js";
|
|
5
5
|
import {
|
|
6
6
|
AuthenticationProvider,
|
|
7
7
|
AuthenticationProviderInitializer,
|
|
@@ -180,6 +180,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
180
180
|
async logout(): Promise<void> {
|
|
181
181
|
useAuthState.setState({
|
|
182
182
|
isAuthenticated: false,
|
|
183
|
+
isPending: false,
|
|
183
184
|
profile: undefined,
|
|
184
185
|
});
|
|
185
186
|
|
|
@@ -293,6 +294,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
293
294
|
|
|
294
295
|
useAuthState.setState({
|
|
295
296
|
isAuthenticated: true,
|
|
297
|
+
isPending: false,
|
|
296
298
|
profile,
|
|
297
299
|
});
|
|
298
300
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
2
|
|
|
3
3
|
export const useAuthState = create<AuthState>(() => ({
|
|
4
|
+
isPending: true,
|
|
4
5
|
isAuthenticated: false,
|
|
5
6
|
}));
|
|
6
7
|
|
|
7
8
|
export interface AuthState {
|
|
8
9
|
isAuthenticated: boolean;
|
|
10
|
+
isPending: boolean;
|
|
9
11
|
profile?: UserProfile;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
/* eslint-disable react/destructuring-assignment */
|
|
2
1
|
import { MDXProvider } from "@mdx-js/react";
|
|
3
2
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
import { memo, Suspense, useEffect, useMemo } from "react";
|
|
3
|
+
import { Fragment, memo, Suspense, useEffect, useMemo } from "react";
|
|
4
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
5
|
+
import { Helmet, HelmetProvider } from "react-helmet-async";
|
|
5
6
|
import {
|
|
6
7
|
DevPortalContext,
|
|
7
8
|
queryClient,
|
|
8
|
-
|
|
9
|
+
ZudokuContextOptions,
|
|
9
10
|
} 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";
|
|
11
|
+
import { hasHead } from "../core/plugins.js";
|
|
12
|
+
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
13
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
18
14
|
import {
|
|
19
15
|
ComponentsProvider,
|
|
20
16
|
DEFAULT_COMPONENTS,
|
|
21
|
-
type ComponentsContextType,
|
|
22
17
|
} from "./context/ComponentsContext.js";
|
|
23
18
|
import { DevPortalProvider } from "./context/DevPortalProvider.js";
|
|
24
19
|
import { ThemeProvider } from "./context/ThemeContext.js";
|
|
25
20
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
26
21
|
import { Router } from "./Router.js";
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
const DevPortalSystemPaths = {
|
|
29
24
|
Settings: "/settings",
|
|
30
25
|
} as const;
|
|
31
26
|
|
|
@@ -33,22 +28,7 @@ export type DevPortalPath =
|
|
|
33
28
|
| string
|
|
34
29
|
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
meta?: Partial<{
|
|
38
|
-
headerTitle: string;
|
|
39
|
-
pageTitle: string;
|
|
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) => {
|
|
31
|
+
const DevPortalInner = (props: ZudokuContextOptions) => {
|
|
52
32
|
const components = useMemo(
|
|
53
33
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
54
34
|
[props.overrides],
|
|
@@ -65,9 +45,15 @@ const DevPortalInner = (props: DevPortalProps) => {
|
|
|
65
45
|
void devPortalContext.initialize();
|
|
66
46
|
}, [devPortalContext]);
|
|
67
47
|
|
|
48
|
+
const heads = props.plugins
|
|
49
|
+
?.filter(hasHead)
|
|
50
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
51
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
52
|
+
|
|
68
53
|
return (
|
|
69
54
|
<QueryClientProvider client={queryClient}>
|
|
70
55
|
<HelmetProvider>
|
|
56
|
+
<Helmet>{heads}</Helmet>
|
|
71
57
|
<DevPortalProvider value={devPortalContext}>
|
|
72
58
|
<MDXProvider components={mdxComponents}>
|
|
73
59
|
<ThemeProvider>
|
|
@@ -97,7 +83,14 @@ const DevPortalInner = (props: DevPortalProps) => {
|
|
|
97
83
|
);
|
|
98
84
|
};
|
|
99
85
|
|
|
100
|
-
const DevPortal =
|
|
86
|
+
const DevPortal = (props: ZudokuContextOptions) => {
|
|
87
|
+
const Inner = memo(DevPortalInner);
|
|
88
|
+
return (
|
|
89
|
+
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
90
|
+
<Inner {...props} />
|
|
91
|
+
</ErrorBoundary>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
101
94
|
DevPortal.displayName = "DevPortal";
|
|
102
95
|
|
|
103
96
|
export { DevPortal };
|
|
@@ -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
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Suspense, useEffect, useRef, type ReactNode } from "react";
|
|
2
|
+
import { Helmet } from "react-helmet-async";
|
|
2
3
|
import { Outlet, useLocation } from "react-router-dom";
|
|
3
|
-
import { Helmet } from "../core/helmet.js";
|
|
4
4
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
5
5
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
6
6
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
@@ -29,8 +29,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<>
|
|
32
|
-
<Helmet titleTemplate={meta?.
|
|
33
|
-
<title>Home</title>
|
|
32
|
+
<Helmet titleTemplate={meta?.title}>
|
|
34
33
|
{meta?.description && (
|
|
35
34
|
<meta name="description" content={meta.description} />
|
|
36
35
|
)}
|
|
@@ -48,7 +47,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
48
47
|
>
|
|
49
48
|
<SideNavigation />
|
|
50
49
|
<main
|
|
51
|
-
className="dark:border-white/10 translate-x-0
|
|
50
|
+
className="dark:border-white/10 translate-x-0 h-full
|
|
52
51
|
lg:overflow-visible
|
|
53
52
|
lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]
|
|
54
53
|
lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] peer-data-[navigation=true]:pl-12"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
3
|
import { DevPortalPlugin, isNavigationPlugin } from "../core/plugins.js";
|
|
4
|
+
|
|
5
|
+
import { RouterError } from "../errors/RouterError.js";
|
|
4
6
|
import { Layout } from "./Layout.js";
|
|
5
7
|
|
|
6
8
|
export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
@@ -13,13 +15,7 @@ export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
|
13
15
|
{
|
|
14
16
|
path: "/",
|
|
15
17
|
element: <Layout />,
|
|
16
|
-
errorElement:
|
|
17
|
-
<Layout>
|
|
18
|
-
<div className="h-[75vh] flex items-center justify-center">
|
|
19
|
-
Error, look at the console
|
|
20
|
-
</div>
|
|
21
|
-
</Layout>
|
|
22
|
-
),
|
|
18
|
+
errorElement: <RouterError />,
|
|
23
19
|
children: routes,
|
|
24
20
|
},
|
|
25
21
|
]);
|
|
@@ -21,6 +21,10 @@ if (!import.meta.env.SSR) {
|
|
|
21
21
|
import("prismjs/components/prism-json.min.js");
|
|
22
22
|
// @ts-expect-error This is untyped
|
|
23
23
|
import("prismjs/components/prism-java.min.js");
|
|
24
|
+
// @ts-expect-error This is untyped
|
|
25
|
+
import("prismjs/components/prism-csharp.min.js");
|
|
26
|
+
// @ts-expect-error This is untyped
|
|
27
|
+
import("prismjs/components/prism-objectivec.min.js");
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
import { useState } from "react";
|
|
@@ -67,7 +71,7 @@ export const SyntaxHighlight = ({
|
|
|
67
71
|
disabled={isCopied}
|
|
68
72
|
onClick={() => {
|
|
69
73
|
setIsCopied(true);
|
|
70
|
-
navigator.clipboard.writeText(
|
|
74
|
+
void navigator.clipboard.writeText(
|
|
71
75
|
tokens
|
|
72
76
|
.map((line) => line.map(({ content }) => content).join(""))
|
|
73
77
|
.join("\n"),
|
|
@@ -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,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
|
+
import { Link as LinkImport } from "react-router-dom";
|
|
3
|
+
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
4
|
+
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
5
|
+
|
|
6
|
+
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
7
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
8
|
+
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
9
|
+
export const Link = /*@__PURE__*/ LinkImport;
|