zudoku 0.3.0-dev.3 → 0.3.0-dev.30
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 +23 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/main.d.ts +2 -1
- package/dist/app/main.js +29 -10
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +28 -0
- package/dist/app/standalone.js.map +1 -0
- 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 +3 -21
- package/dist/lib/components/DevPortal.js +14 -10
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Error.d.ts +1 -0
- package/dist/lib/components/Error.js +10 -0
- package/dist/lib/components/Error.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/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 +10 -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/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 -7
- package/dist/vite/config.js +54 -48
- 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-BtVKbEwm.js +706 -0
- package/lib/AnchorLink-BtVKbEwm.js.map +1 -0
- package/lib/DevPortalProvider--xZTs0RJ.js +1081 -0
- package/lib/DevPortalProvider--xZTs0RJ.js.map +1 -0
- package/lib/Markdown-oJFqm0uk.js +8621 -0
- package/lib/Markdown-oJFqm0uk.js.map +1 -0
- package/lib/MdxComponents-CsU8yR42.js +3019 -0
- package/lib/MdxComponents-CsU8yR42.js.map +1 -0
- package/lib/MdxPage-BV_9ncEk.js +217 -0
- package/lib/MdxPage-BV_9ncEk.js.map +1 -0
- package/lib/OperationList-DfG_E0Xa.js +5546 -0
- package/lib/OperationList-DfG_E0Xa.js.map +1 -0
- package/lib/Route-CHqr53jb.js +14 -0
- package/lib/Route-CHqr53jb.js.map +1 -0
- package/lib/Select-CNmXi4JU.js +4572 -0
- package/lib/Select-CNmXi4JU.js.map +1 -0
- package/lib/Spinner-By5opWs5.js +182 -0
- package/lib/Spinner-By5opWs5.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-kVJ4gpk5.js +25 -0
- package/lib/hook-kVJ4gpk5.js.map +1 -0
- package/lib/index-B2qLeglF.js +710 -0
- package/lib/index-B2qLeglF.js.map +1 -0
- package/lib/index-CUIxJAeE.js +713 -0
- package/lib/index-CUIxJAeE.js.map +1 -0
- package/lib/index-Cr3hgaqt.js +412 -0
- package/lib/index-Cr3hgaqt.js.map +1 -0
- package/lib/index-fXFJf9Ua.js +464 -0
- package/lib/index-fXFJf9Ua.js.map +1 -0
- package/lib/jsx-runtime-D7DwziLW.js +3009 -0
- package/lib/jsx-runtime-D7DwziLW.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-DnDPBx_j.js +41 -0
- package/lib/util-DnDPBx_j.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 +302 -305
- 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 +20 -6
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +35 -0
- package/src/app/main.css +74 -0
- package/src/app/main.tsx +40 -9
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +42 -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 +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 +13 -29
- package/src/lib/components/Error.tsx +15 -0
- 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 +2 -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/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,49 @@
|
|
|
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
|
+
import "./main.css";
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import "../lib/util/logInit.js";
|
|
7
|
+
|
|
8
|
+
// Virtual config
|
|
9
|
+
import config from "virtual:zudoku-config";
|
|
10
|
+
|
|
11
|
+
// Virtual Plugins
|
|
12
|
+
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
13
|
+
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
14
|
+
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
15
|
+
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
16
|
+
import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
17
|
+
|
|
18
|
+
// Base React Component
|
|
19
|
+
import { DevPortal } from "zudoku/components";
|
|
20
|
+
|
|
21
|
+
// IMPORTANT: This component must not contain tailwind classes
|
|
22
|
+
// This directory is not processed by the tailwind plugin
|
|
13
23
|
|
|
14
24
|
createRoot(document.getElementById("root")!).render(
|
|
15
25
|
<StrictMode>
|
|
16
|
-
<
|
|
26
|
+
<DevPortal
|
|
27
|
+
page={{
|
|
28
|
+
logo: config.page?.logo ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
29
|
+
pageTitle: "Developer Portal",
|
|
30
|
+
...config.page,
|
|
31
|
+
}}
|
|
32
|
+
metadata={{
|
|
33
|
+
favicon: "https://cdn.zudoku.dev/logos/icon.svg",
|
|
34
|
+
title: "%s | Developer Portal",
|
|
35
|
+
...config.metadata,
|
|
36
|
+
}}
|
|
37
|
+
navigation={config.navigation ?? []}
|
|
38
|
+
authentication={configuredAuthProvider}
|
|
39
|
+
mdxComponents={config.mdx?.components}
|
|
40
|
+
plugins={[
|
|
41
|
+
...configuredDocsPlugins,
|
|
42
|
+
...configuredApiPlugins,
|
|
43
|
+
configuredRedirectPlugin,
|
|
44
|
+
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
45
|
+
...(configuredAuthProvider ? [configuredAuthProvider] : []),
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
17
48
|
</StrictMode>,
|
|
18
49
|
);
|
|
@@ -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,42 @@
|
|
|
1
|
+
import "./main.css";
|
|
2
|
+
|
|
3
|
+
import "../lib/util/logInit.js";
|
|
4
|
+
|
|
5
|
+
// Base React Component
|
|
6
|
+
import { DevPortal } from "../lib/components/DevPortal.js";
|
|
7
|
+
|
|
8
|
+
import { StrictMode } from "react";
|
|
9
|
+
import { createRoot } from "react-dom/client";
|
|
10
|
+
import type { NavigationItem } from "../lib/core/DevPortalContext.js";
|
|
11
|
+
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
12
|
+
|
|
13
|
+
const root = document.querySelector("[data-api-url]");
|
|
14
|
+
if (!root || root.tagName !== "DIV") {
|
|
15
|
+
throw new Error("No div found with attribute data-api-url");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const apiUrl = root.getAttribute("data-api-url");
|
|
19
|
+
const pageTitle = document.getElementsByTagName("title")[0].innerText;
|
|
20
|
+
const logoUrl = root.getAttribute("data-logo-url");
|
|
21
|
+
|
|
22
|
+
const navigation: NavigationItem[] = [
|
|
23
|
+
{
|
|
24
|
+
label: "API Reference",
|
|
25
|
+
path: "/",
|
|
26
|
+
categories: [],
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
createRoot(root).render(
|
|
31
|
+
<StrictMode>
|
|
32
|
+
<DevPortal
|
|
33
|
+
page={{
|
|
34
|
+
logo: logoUrl ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
36
|
+
pageTitle: pageTitle ?? "Developer Portal",
|
|
37
|
+
}}
|
|
38
|
+
navigation={navigation}
|
|
39
|
+
plugins={[openApiPlugin({ type: "url", input: apiUrl!, path: "/" })]}
|
|
40
|
+
/>
|
|
41
|
+
</StrictMode>,
|
|
42
|
+
);
|
|
@@ -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,24 @@
|
|
|
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 { Helmet, HelmetProvider } from "react-helmet-async";
|
|
5
5
|
import {
|
|
6
6
|
DevPortalContext,
|
|
7
7
|
queryClient,
|
|
8
|
-
|
|
8
|
+
ZudokuContextOptions,
|
|
9
9
|
} 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";
|
|
10
|
+
import { hasHead } from "../core/plugins.js";
|
|
11
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
18
12
|
import {
|
|
19
13
|
ComponentsProvider,
|
|
20
14
|
DEFAULT_COMPONENTS,
|
|
21
|
-
type ComponentsContextType,
|
|
22
15
|
} from "./context/ComponentsContext.js";
|
|
23
16
|
import { DevPortalProvider } from "./context/DevPortalProvider.js";
|
|
24
17
|
import { ThemeProvider } from "./context/ThemeContext.js";
|
|
25
18
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
26
19
|
import { Router } from "./Router.js";
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
const DevPortalSystemPaths = {
|
|
29
22
|
Settings: "/settings",
|
|
30
23
|
} as const;
|
|
31
24
|
|
|
@@ -33,22 +26,7 @@ export type DevPortalPath =
|
|
|
33
26
|
| string
|
|
34
27
|
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
35
28
|
|
|
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) => {
|
|
29
|
+
const DevPortalInner = (props: ZudokuContextOptions) => {
|
|
52
30
|
const components = useMemo(
|
|
53
31
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
54
32
|
[props.overrides],
|
|
@@ -65,9 +43,15 @@ const DevPortalInner = (props: DevPortalProps) => {
|
|
|
65
43
|
void devPortalContext.initialize();
|
|
66
44
|
}, [devPortalContext]);
|
|
67
45
|
|
|
46
|
+
const heads = props.plugins
|
|
47
|
+
?.filter(hasHead)
|
|
48
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
49
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
50
|
+
|
|
68
51
|
return (
|
|
69
52
|
<QueryClientProvider client={queryClient}>
|
|
70
53
|
<HelmetProvider>
|
|
54
|
+
<Helmet>{heads}</Helmet>
|
|
71
55
|
<DevPortalProvider value={devPortalContext}>
|
|
72
56
|
<MDXProvider components={mdxComponents}>
|
|
73
57
|
<ThemeProvider>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRouteError } from "react-router-dom";
|
|
2
|
+
import { Layout } from "./Layout.js";
|
|
3
|
+
|
|
4
|
+
export function ErrorBoundary() {
|
|
5
|
+
const error = useRouteError();
|
|
6
|
+
// eslint-disable-next-line no-console
|
|
7
|
+
console.error(error);
|
|
8
|
+
return (
|
|
9
|
+
<Layout>
|
|
10
|
+
<div className="h-[75vh] flex items-center justify-center">
|
|
11
|
+
Error, look at the console
|
|
12
|
+
</div>
|
|
13
|
+
</Layout>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -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,7 @@
|
|
|
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
|
+
import { ErrorBoundary } from "./Error.js";
|
|
4
5
|
import { Layout } from "./Layout.js";
|
|
5
6
|
|
|
6
7
|
export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
@@ -13,13 +14,7 @@ export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
|
13
14
|
{
|
|
14
15
|
path: "/",
|
|
15
16
|
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
|
-
),
|
|
17
|
+
errorElement: <ErrorBoundary />,
|
|
23
18
|
children: routes,
|
|
24
19
|
},
|
|
25
20
|
]);
|
|
@@ -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;
|