zudoku 0.1.1-dev.14 → 0.1.1-dev.16
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.js +3 -1
- package/dist/app/App.js.map +1 -1
- package/dist/app/main.js +2 -2
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +3 -3
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/{app → lib}/DevPortal.d.ts +2 -2
- package/dist/{app → lib}/DevPortal.js +4 -4
- package/dist/{app → lib}/DevPortal.js.map +1 -1
- package/dist/{app → lib}/Heading.js.map +1 -1
- package/dist/{app → lib}/Router.js.map +1 -1
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +2 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/authentication/authentication.js.map +1 -0
- package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
- package/dist/{app → lib}/authentication/clerk.js +1 -2
- package/dist/lib/authentication/clerk.js.map +1 -0
- package/dist/{app → lib}/authentication/openid.js.map +1 -1
- package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
- package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
- package/dist/{app → lib}/components/Dialog.js.map +1 -1
- package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
- package/dist/{app → lib}/components/Header.js.map +1 -1
- package/dist/{app → lib}/components/Input.js.map +1 -1
- package/dist/{app → lib}/components/Layout.js.map +1 -1
- package/dist/{app → lib}/components/Markdown.js.map +1 -1
- package/dist/{app → lib}/components/SyntaxHighlight.js.map +1 -1
- package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
- package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/context/PluginSystem.js.map +1 -0
- package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
- package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/{app → lib}/components/navigation/util.js.map +1 -1
- package/dist/lib/components.d.ts +3 -0
- package/dist/lib/components.js +4 -0
- package/dist/lib/components.js.map +1 -0
- package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
- package/dist/{app → lib}/core/helmet.js.map +1 -1
- package/dist/lib/core/icons.js.map +1 -0
- package/dist/{app → lib}/core/plugins.js.map +1 -1
- package/dist/lib/core/router.js.map +1 -0
- package/dist/lib/core/types/combine.js.map +1 -0
- package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
- package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
- package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
- package/dist/{app → lib}/oas/parser/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
- package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
- package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/MakeRequest.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/OperationList.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
- package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins.d.ts +4 -0
- package/dist/lib/plugins.js +6 -0
- package/dist/lib/plugins.js.map +1 -0
- package/dist/{app → lib}/ui/Button.d.ts +1 -1
- package/dist/{app → lib}/ui/Button.js.map +1 -1
- package/dist/{app → lib}/ui/Callout.js.map +1 -1
- package/dist/{app → lib}/ui/Card.js.map +1 -1
- package/dist/{app → lib}/ui/Note.js.map +1 -1
- package/dist/{app → lib}/ui/Tabs.js.map +1 -1
- package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
- package/dist/{app → lib}/util/cn.js.map +1 -1
- package/dist/{app → lib}/util/createVariantComponent.js.map +1 -1
- package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
- package/dist/{app → lib}/util/groupBy.js.map +1 -1
- package/dist/{app → lib}/util/joinPath.js.map +1 -1
- package/dist/{app → lib}/util/pastellize.js.map +1 -1
- package/dist/lib/util/slugify.js.map +1 -0
- package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
- package/dist/vite/config.d.ts +2 -1
- package/dist/vite/config.js +28 -18
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +1 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +2 -2
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +3 -0
- package/dist/vite/plugin-component.js +22 -0
- package/dist/vite/plugin-component.js.map +1 -0
- package/dist/vite/plugin-docs.js +1 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-html.js +0 -3
- package/dist/vite/plugin-html.js.map +1 -1
- package/dist/vite/plugin-mdx.js +1 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/package.json +18 -19
- package/src/app/App.tsx +4 -1
- package/src/app/main.tsx +3 -3
- package/dist/app/authentication/authentication.js.map +0 -1
- package/dist/app/authentication/clerk.js.map +0 -1
- package/dist/app/components/context/PluginSystem.js.map +0 -1
- package/dist/app/core/icons.js.map +0 -1
- package/dist/app/core/router.js.map +0 -1
- package/dist/app/core/types/combine.js.map +0 -1
- package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
- package/dist/app/util/slugify.js.map +0 -1
- package/dist/auth.d.ts +0 -2
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -1
- package/dist/plugins.d.ts +0 -4
- package/dist/plugins.js +0 -6
- package/dist/plugins.js.map +0 -1
- package/src/app/DevPortal.tsx +0 -93
- package/src/app/Heading.tsx +0 -60
- package/src/app/Router.tsx +0 -28
- package/src/app/authentication/authentication.ts +0 -18
- package/src/app/authentication/clerk.ts +0 -47
- package/src/app/authentication/openid.ts +0 -192
- package/src/app/components/AnchorLink.tsx +0 -19
- package/src/app/components/CategoryHeading.tsx +0 -16
- package/src/app/components/Dialog.tsx +0 -119
- package/src/app/components/DynamicIcon.tsx +0 -60
- package/src/app/components/Header.tsx +0 -69
- package/src/app/components/Input.tsx +0 -24
- package/src/app/components/Layout.tsx +0 -56
- package/src/app/components/Markdown.tsx +0 -37
- package/src/app/components/SyntaxHighlight.tsx +0 -94
- package/src/app/components/TopNavigation.tsx +0 -32
- package/src/app/components/context/ComponentsContext.tsx +0 -24
- package/src/app/components/context/DevPortalProvider.ts +0 -54
- package/src/app/components/context/PluginSystem.ts +0 -0
- package/src/app/components/context/ThemeContext.tsx +0 -46
- package/src/app/components/context/ViewportAnchorContext.tsx +0 -139
- package/src/app/components/navigation/SideNavigation.tsx +0 -18
- package/src/app/components/navigation/SideNavigationCategory.tsx +0 -74
- package/src/app/components/navigation/SideNavigationItem.tsx +0 -143
- package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
- package/src/app/components/navigation/useNavigationCollapsibleState.ts +0 -27
- package/src/app/components/navigation/util.ts +0 -38
- package/src/app/core/DevPortalContext.ts +0 -164
- package/src/app/core/helmet.ts +0 -5
- package/src/app/core/icons.tsx +0 -1
- package/src/app/core/plugins.ts +0 -43
- package/src/app/core/router.tsx +0 -1
- package/src/app/core/types/combine.ts +0 -16
- package/src/app/oas/graphql/index.ts +0 -422
- package/src/app/oas/graphql/server.ts +0 -10
- package/src/app/oas/parser/dereference/index.ts +0 -59
- package/src/app/oas/parser/dereference/resolveRef.ts +0 -32
- package/src/app/oas/parser/index.ts +0 -94
- package/src/app/oas/parser/schemas/v3.0.json +0 -1489
- package/src/app/oas/parser/schemas/v3.1.json +0 -1298
- package/src/app/oas/parser/upgrade/index.ts +0 -108
- package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
- package/src/app/plugins/api-key/index.tsx +0 -123
- package/src/app/plugins/markdown/MdxPage.tsx +0 -128
- package/src/app/plugins/markdown/Toc.tsx +0 -122
- package/src/app/plugins/markdown/generateRoutes.tsx +0 -72
- package/src/app/plugins/markdown/index.tsx +0 -31
- package/src/app/plugins/openapi/ColorizedParam.tsx +0 -82
- package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
- package/src/app/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/app/plugins/openapi/OperationList.tsx +0 -117
- package/src/app/plugins/openapi/OperationListItem.tsx +0 -55
- package/src/app/plugins/openapi/ParameterList.tsx +0 -32
- package/src/app/plugins/openapi/ParameterListItem.tsx +0 -60
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -51
- package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +0 -60
- package/src/app/plugins/openapi/Select.tsx +0 -35
- package/src/app/plugins/openapi/Sidecar.tsx +0 -160
- package/src/app/plugins/openapi/SidecarBox.tsx +0 -36
- package/src/app/plugins/openapi/graphql/fragment-masking.ts +0 -111
- package/src/app/plugins/openapi/graphql/gql.ts +0 -70
- package/src/app/plugins/openapi/graphql/graphql.ts +0 -795
- package/src/app/plugins/openapi/graphql/index.ts +0 -2
- package/src/app/plugins/openapi/index.tsx +0 -142
- package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
- package/src/app/plugins/openapi/queries.graphql +0 -6
- package/src/app/plugins/openapi/util/generateSchemaExample.ts +0 -59
- package/src/app/plugins/openapi/util/urql.ts +0 -8
- package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +0 -60
- package/src/app/plugins/openapi/worker/worker.ts +0 -30
- package/src/app/plugins/redirect/index.tsx +0 -20
- package/src/app/ui/Button.tsx +0 -56
- package/src/app/ui/Callout.tsx +0 -87
- package/src/app/ui/Card.tsx +0 -82
- package/src/app/ui/Note.tsx +0 -58
- package/src/app/ui/Tabs.tsx +0 -52
- package/src/app/util/MdxComponents.tsx +0 -70
- package/src/app/util/cn.ts +0 -6
- package/src/app/util/createVariantComponent.tsx +0 -30
- package/src/app/util/createWaitForNotify.ts +0 -18
- package/src/app/util/groupBy.ts +0 -24
- package/src/app/util/joinPath.tsx +0 -10
- package/src/app/util/pastellize.ts +0 -25
- package/src/app/util/slugify.ts +0 -3
- package/src/app/util/traverseNavigation.ts +0 -55
- package/src/app/util/useScrollToAnchor.ts +0 -38
- package/src/app/util/useScrollToTop.ts +0 -13
- /package/dist/{app → lib}/Heading.d.ts +0 -0
- /package/dist/{app → lib}/Heading.js +0 -0
- /package/dist/{app → lib}/Router.d.ts +0 -0
- /package/dist/{app → lib}/Router.js +0 -0
- /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
- /package/dist/{app → lib}/authentication/authentication.js +0 -0
- /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
- /package/dist/{app → lib}/authentication/openid.js +0 -0
- /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
- /package/dist/{app → lib}/components/AnchorLink.js +0 -0
- /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
- /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
- /package/dist/{app → lib}/components/Dialog.d.ts +0 -0
- /package/dist/{app → lib}/components/Dialog.js +0 -0
- /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
- /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
- /package/dist/{app → lib}/components/Header.d.ts +0 -0
- /package/dist/{app → lib}/components/Header.js +0 -0
- /package/dist/{app → lib}/components/Input.d.ts +0 -0
- /package/dist/{app → lib}/components/Input.js +0 -0
- /package/dist/{app → lib}/components/Layout.d.ts +0 -0
- /package/dist/{app → lib}/components/Layout.js +0 -0
- /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
- /package/dist/{app → lib}/components/Markdown.js +0 -0
- /package/dist/{app → lib}/components/SyntaxHighlight.d.ts +0 -0
- /package/dist/{app → lib}/components/SyntaxHighlight.js +0 -0
- /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
- /package/dist/{app → lib}/components/TopNavigation.js +0 -0
- /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
- /package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
- /package/dist/{app → lib}/components/context/DevPortalProvider.js +0 -0
- /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
- /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
- /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
- /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigation.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +0 -0
- /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
- /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/util.js +0 -0
- /package/dist/{app → lib}/core/DevPortalContext.d.ts +0 -0
- /package/dist/{app → lib}/core/DevPortalContext.js +0 -0
- /package/dist/{app → lib}/core/helmet.d.ts +0 -0
- /package/dist/{app → lib}/core/helmet.js +0 -0
- /package/dist/{app → lib}/core/icons.d.ts +0 -0
- /package/dist/{app → lib}/core/icons.js +0 -0
- /package/dist/{app → lib}/core/plugins.d.ts +0 -0
- /package/dist/{app → lib}/core/plugins.js +0 -0
- /package/dist/{app → lib}/core/router.d.ts +0 -0
- /package/dist/{app → lib}/core/router.js +0 -0
- /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
- /package/dist/{app → lib}/core/types/combine.js +0 -0
- /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/index.js +0 -0
- /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/server.js +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
- /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/index.js +0 -0
- /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
- /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/generateRoutes.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/MakeRequest.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/OperationList.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/OperationListItem.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/Sidecar.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/gql.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/index.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/playground/Playground.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/playground/Playground.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
- /package/dist/{app → lib}/plugins/redirect/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
- /package/dist/{app → lib}/ui/Button.js +0 -0
- /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
- /package/dist/{app → lib}/ui/Callout.js +0 -0
- /package/dist/{app → lib}/ui/Card.d.ts +0 -0
- /package/dist/{app → lib}/ui/Card.js +0 -0
- /package/dist/{app → lib}/ui/Note.d.ts +0 -0
- /package/dist/{app → lib}/ui/Note.js +0 -0
- /package/dist/{app → lib}/ui/Tabs.d.ts +0 -0
- /package/dist/{app → lib}/ui/Tabs.js +0 -0
- /package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
- /package/dist/{app → lib}/util/MdxComponents.js +0 -0
- /package/dist/{app → lib}/util/cn.d.ts +0 -0
- /package/dist/{app → lib}/util/cn.js +0 -0
- /package/dist/{app → lib}/util/createVariantComponent.d.ts +0 -0
- /package/dist/{app → lib}/util/createVariantComponent.js +0 -0
- /package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
- /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
- /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
- /package/dist/{app → lib}/util/groupBy.js +0 -0
- /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
- /package/dist/{app → lib}/util/joinPath.js +0 -0
- /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
- /package/dist/{app → lib}/util/pastellize.js +0 -0
- /package/dist/{app → lib}/util/slugify.d.ts +0 -0
- /package/dist/{app → lib}/util/slugify.js +0 -0
- /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
- /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
- /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
- /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
- /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
- /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
package/src/app/DevPortal.tsx
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { MDXProvider } from "@mdx-js/react";
|
|
2
|
-
import { QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import { memo, Suspense, useEffect, useMemo } from "react";
|
|
4
|
-
import { type AuthProvider } from "./authentication/authentication.js";
|
|
5
|
-
import {
|
|
6
|
-
ComponentsProvider,
|
|
7
|
-
DEFAULT_COMPONENTS,
|
|
8
|
-
type ComponentsContextType,
|
|
9
|
-
} from "./components/context/ComponentsContext.js";
|
|
10
|
-
import { DevPortalProvider } from "./components/context/DevPortalProvider.js";
|
|
11
|
-
import { ThemeProvider } from "./components/context/ThemeContext.js";
|
|
12
|
-
import { ViewportAnchorProvider } from "./components/context/ViewportAnchorContext.js";
|
|
13
|
-
import {
|
|
14
|
-
DevPortalContext,
|
|
15
|
-
queryClient,
|
|
16
|
-
type NavigationItem,
|
|
17
|
-
} from "./core/DevPortalContext.js";
|
|
18
|
-
import { HelmetProvider } from "./core/helmet.js";
|
|
19
|
-
import { type DevPortalPlugin } from "./core/plugins.js";
|
|
20
|
-
import { Router } from "./Router.js";
|
|
21
|
-
import { MdxComponents, type MdxComponentsType } from "./util/MdxComponents.js";
|
|
22
|
-
|
|
23
|
-
export const DevPortalSystemPaths = {
|
|
24
|
-
Settings: "/settings",
|
|
25
|
-
} as const;
|
|
26
|
-
|
|
27
|
-
export type DevPortalPath =
|
|
28
|
-
| string
|
|
29
|
-
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
30
|
-
|
|
31
|
-
export type DevPortalProps = {
|
|
32
|
-
meta?: Partial<{
|
|
33
|
-
headerTitle: string;
|
|
34
|
-
pageTitle: string;
|
|
35
|
-
description: string;
|
|
36
|
-
logo: string;
|
|
37
|
-
favicon: string;
|
|
38
|
-
}>;
|
|
39
|
-
authentication?: AuthProvider;
|
|
40
|
-
navigation: NavigationItem[];
|
|
41
|
-
plugins?: DevPortalPlugin[];
|
|
42
|
-
mdxComponents?: MdxComponentsType;
|
|
43
|
-
overrides?: ComponentsContextType;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const DevPortal = (props: DevPortalProps) => {
|
|
47
|
-
const components = useMemo(
|
|
48
|
-
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
49
|
-
[props.overrides],
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const mdxComponents = useMemo(
|
|
53
|
-
() => ({ ...MdxComponents, ...props.mdxComponents }),
|
|
54
|
-
[props.mdxComponents],
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const devPortalContext = useMemo(() => new DevPortalContext(props), [props]);
|
|
58
|
-
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
void devPortalContext.initialize();
|
|
61
|
-
}, [devPortalContext]);
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<QueryClientProvider client={queryClient}>
|
|
65
|
-
<HelmetProvider>
|
|
66
|
-
<DevPortalProvider value={devPortalContext}>
|
|
67
|
-
<MDXProvider components={mdxComponents}>
|
|
68
|
-
<ThemeProvider>
|
|
69
|
-
<ComponentsProvider value={components}>
|
|
70
|
-
<ViewportAnchorProvider>
|
|
71
|
-
<Suspense
|
|
72
|
-
fallback={
|
|
73
|
-
<div className="grid place-items-center h-full">
|
|
74
|
-
Loading...
|
|
75
|
-
</div>
|
|
76
|
-
}
|
|
77
|
-
>
|
|
78
|
-
<Router plugins={props.plugins} />
|
|
79
|
-
</Suspense>
|
|
80
|
-
</ViewportAnchorProvider>
|
|
81
|
-
</ComponentsProvider>
|
|
82
|
-
</ThemeProvider>
|
|
83
|
-
</MDXProvider>
|
|
84
|
-
</DevPortalProvider>
|
|
85
|
-
</HelmetProvider>
|
|
86
|
-
</QueryClientProvider>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const MemoDevPortal = memo(DevPortal);
|
|
91
|
-
MemoDevPortal.displayName = "DevPortal";
|
|
92
|
-
|
|
93
|
-
export default MemoDevPortal;
|
package/src/app/Heading.tsx
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { useRegisterAnchorElement } from "./components/context/ViewportAnchorContext.js";
|
|
3
|
-
import { cn } from "./util/cn.js";
|
|
4
|
-
|
|
5
|
-
const getComponent = (level: number) => {
|
|
6
|
-
switch (level) {
|
|
7
|
-
case 1:
|
|
8
|
-
return "h1";
|
|
9
|
-
case 2:
|
|
10
|
-
return "h2";
|
|
11
|
-
case 3:
|
|
12
|
-
return "h3";
|
|
13
|
-
case 4:
|
|
14
|
-
return "h4";
|
|
15
|
-
case 5:
|
|
16
|
-
return "h5";
|
|
17
|
-
case 6:
|
|
18
|
-
return "h6";
|
|
19
|
-
default:
|
|
20
|
-
return "h1";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type HeadingProps = {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
className?: string;
|
|
27
|
-
id?: string;
|
|
28
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
29
|
-
registerSidebarAnchor?: boolean;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Heading = ({
|
|
33
|
-
level,
|
|
34
|
-
children,
|
|
35
|
-
id,
|
|
36
|
-
className,
|
|
37
|
-
registerSidebarAnchor,
|
|
38
|
-
}: HeadingProps) => {
|
|
39
|
-
const Component = getComponent(level ?? 1);
|
|
40
|
-
const { ref } = useRegisterAnchorElement();
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Component
|
|
44
|
-
className={cn("group relative", className)}
|
|
45
|
-
ref={registerSidebarAnchor ? ref : undefined}
|
|
46
|
-
id={id}
|
|
47
|
-
>
|
|
48
|
-
{id && (
|
|
49
|
-
<a
|
|
50
|
-
href={`#${id}`}
|
|
51
|
-
className="no-underline absolute text-primary -left-[0.8em] pr-2.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity duration-200"
|
|
52
|
-
aria-label={`Link to ${id}`}
|
|
53
|
-
>
|
|
54
|
-
#
|
|
55
|
-
</a>
|
|
56
|
-
)}
|
|
57
|
-
{children}
|
|
58
|
-
</Component>
|
|
59
|
-
);
|
|
60
|
-
};
|
package/src/app/Router.tsx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
|
-
import { Layout } from "./components/Layout.js";
|
|
4
|
-
import { DevPortalPlugin, isNavigationPlugin } from "./core/plugins.js";
|
|
5
|
-
|
|
6
|
-
export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
7
|
-
const router = useMemo(() => {
|
|
8
|
-
const routes = (plugins ?? []).flatMap((plugin) =>
|
|
9
|
-
isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
return createBrowserRouter([
|
|
13
|
-
{
|
|
14
|
-
path: "/",
|
|
15
|
-
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
|
-
),
|
|
23
|
-
children: routes,
|
|
24
|
-
},
|
|
25
|
-
]);
|
|
26
|
-
}, [plugins]);
|
|
27
|
-
return <RouterProvider router={router} />;
|
|
28
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DevPortalContext } from "../core/DevPortalContext.js";
|
|
2
|
-
|
|
3
|
-
export interface AuthProvider {
|
|
4
|
-
initialize(context: DevPortalContext): Promise<unknown>;
|
|
5
|
-
login(context: DevPortalContext): Promise<unknown>;
|
|
6
|
-
getToken?: (context: DevPortalContext) => Promise<string | undefined>;
|
|
7
|
-
handleAuthenticationResponse?: (
|
|
8
|
-
path: Path,
|
|
9
|
-
context: DevPortalContext,
|
|
10
|
-
) => Promise<unknown>;
|
|
11
|
-
signOut(context: DevPortalContext): void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type Path = {
|
|
15
|
-
pathname: string;
|
|
16
|
-
search: string;
|
|
17
|
-
hash: string;
|
|
18
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Clerk } from "@clerk/clerk-js";
|
|
2
|
-
import { type AuthProvider } from "./authentication.js";
|
|
3
|
-
|
|
4
|
-
const clerkProvider = ({
|
|
5
|
-
clerkPubKey,
|
|
6
|
-
}: {
|
|
7
|
-
clerkPubKey: string;
|
|
8
|
-
}): AuthProvider => {
|
|
9
|
-
const clerkApi = new Clerk(clerkPubKey);
|
|
10
|
-
|
|
11
|
-
const clerkIsLoaded = clerkApi.load({});
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
initialize: async (context) => {
|
|
15
|
-
await clerkIsLoaded;
|
|
16
|
-
|
|
17
|
-
if (clerkApi.session) {
|
|
18
|
-
await context.setUserProfile({
|
|
19
|
-
isLoggedIn: true,
|
|
20
|
-
name: clerkApi.session.user.fullName ?? undefined,
|
|
21
|
-
email:
|
|
22
|
-
clerkApi.session.user.emailAddresses.at(0)?.emailAddress ??
|
|
23
|
-
undefined,
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
await context.setUserProfile({
|
|
27
|
-
isLoggedIn: false,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
getToken: async () => {
|
|
33
|
-
await clerkIsLoaded;
|
|
34
|
-
const token = await clerkApi.session?.getToken();
|
|
35
|
-
return token ?? undefined;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
signOut() {
|
|
39
|
-
clerkApi.signOut();
|
|
40
|
-
},
|
|
41
|
-
login: async () => {
|
|
42
|
-
await clerkApi.redirectToSignIn();
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default clerkProvider;
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import * as oauth from "oauth4webapi";
|
|
2
|
-
import { DevPortalContext } from "../core/DevPortalContext.js";
|
|
3
|
-
import { type AuthProvider } from "./authentication.js";
|
|
4
|
-
const algorithm = "oauth2";
|
|
5
|
-
|
|
6
|
-
const getAuthServerByIssuer = async (issuer: string) => {
|
|
7
|
-
const authorizationServer = await oauth
|
|
8
|
-
.discoveryRequest(new URL(issuer), { algorithm })
|
|
9
|
-
.then((response) =>
|
|
10
|
-
oauth.processDiscoveryResponse(new URL(issuer), response),
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
return authorizationServer;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type AuthServerOption = {
|
|
17
|
-
issuer?: string;
|
|
18
|
-
authorizationEndpoint?: string;
|
|
19
|
-
tokenEndpoint?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const getAuthServer = async ({
|
|
23
|
-
issuer,
|
|
24
|
-
authorizationEndpoint,
|
|
25
|
-
tokenEndpoint,
|
|
26
|
-
}: AuthServerOption) => {
|
|
27
|
-
return issuer
|
|
28
|
-
? await getAuthServerByIssuer(issuer)
|
|
29
|
-
: ({
|
|
30
|
-
issuer: new URL(authorizationEndpoint!).origin,
|
|
31
|
-
authorization_endpoint: authorizationEndpoint,
|
|
32
|
-
token_endpoint: tokenEndpoint,
|
|
33
|
-
code_challenge_methods_supported: [],
|
|
34
|
-
} satisfies oauth.AuthorizationServer);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const openIdAuth = ({
|
|
38
|
-
clientId,
|
|
39
|
-
clientSecret,
|
|
40
|
-
issuer,
|
|
41
|
-
authorizationEndpoint,
|
|
42
|
-
tokenEndpoint,
|
|
43
|
-
}: {
|
|
44
|
-
clientId: string;
|
|
45
|
-
clientSecret?: string;
|
|
46
|
-
audience?: string;
|
|
47
|
-
} & AuthServerOption): AuthProvider => {
|
|
48
|
-
const client: oauth.Client = {
|
|
49
|
-
client_id: clientId,
|
|
50
|
-
client_secret: clientSecret,
|
|
51
|
-
token_endpoint_auth_method: "none",
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const redirect_uri = "http://localhost:5173/oauth/callback";
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
initialize() {
|
|
58
|
-
return Promise.resolve();
|
|
59
|
-
},
|
|
60
|
-
signOut() {},
|
|
61
|
-
login: async (context: DevPortalContext) => {
|
|
62
|
-
const code_challenge_method = "S256";
|
|
63
|
-
const authorizationServer = await getAuthServer({
|
|
64
|
-
issuer,
|
|
65
|
-
authorizationEndpoint,
|
|
66
|
-
tokenEndpoint,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
if (!authorizationServer.authorization_endpoint) {
|
|
70
|
-
throw new Error("No authorization endpoint");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* The following MUST be generated for every redirect to the authorization_endpoint. You must store
|
|
75
|
-
* the codeVerifier and nonce in the end-user session such that it can be recovered as the user
|
|
76
|
-
* gets redirected from the authorization server back to your application.
|
|
77
|
-
*/
|
|
78
|
-
const codeVerifier = oauth.generateRandomCodeVerifier();
|
|
79
|
-
const codeChallenge =
|
|
80
|
-
await oauth.calculatePKCECodeChallenge(codeVerifier);
|
|
81
|
-
|
|
82
|
-
await context.sessionStorage.set("codeVerifier", codeVerifier);
|
|
83
|
-
|
|
84
|
-
// redirect user to as.authorization_endpoint
|
|
85
|
-
const authorizationUrl = new URL(
|
|
86
|
-
authorizationServer.authorization_endpoint,
|
|
87
|
-
);
|
|
88
|
-
authorizationUrl.searchParams.set("client_id", client.client_id);
|
|
89
|
-
authorizationUrl.searchParams.set("redirect_uri", redirect_uri);
|
|
90
|
-
authorizationUrl.searchParams.set("response_type", "code");
|
|
91
|
-
// authorizationUrl.searchParams.set("scope", "api:read");
|
|
92
|
-
authorizationUrl.searchParams.set("code_challenge", codeChallenge);
|
|
93
|
-
authorizationUrl.searchParams.set(
|
|
94
|
-
"code_challenge_method",
|
|
95
|
-
code_challenge_method,
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* We cannot be sure the AS supports PKCE so we're going to use state too. Use of PKCE is
|
|
100
|
-
* backwards compatible even if the AS doesn't support it which is why we're using it regardless.
|
|
101
|
-
*/
|
|
102
|
-
if (
|
|
103
|
-
authorizationServer.code_challenge_methods_supported?.includes(
|
|
104
|
-
"S256",
|
|
105
|
-
) !== true
|
|
106
|
-
) {
|
|
107
|
-
const state = oauth.generateRandomState();
|
|
108
|
-
authorizationUrl.searchParams.set("state", state);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// now redirect the user to authorizationUrl.href
|
|
112
|
-
location.href = authorizationUrl.href;
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
handleAuthenticationResponse: async ({ search }, { sessionStorage }) => {
|
|
116
|
-
const searchParams = new URLSearchParams(search);
|
|
117
|
-
const state = searchParams.get("state");
|
|
118
|
-
if (!state) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// one eternity later, the user lands back on the redirect_uri
|
|
123
|
-
// Authorization Code Grant Request & Response
|
|
124
|
-
const codeVerifier = await sessionStorage.get("codeVerifier");
|
|
125
|
-
|
|
126
|
-
if (!codeVerifier) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const as = await getAuthServer({
|
|
131
|
-
issuer,
|
|
132
|
-
authorizationEndpoint,
|
|
133
|
-
tokenEndpoint,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
const params = oauth.validateAuthResponse(
|
|
137
|
-
as,
|
|
138
|
-
client,
|
|
139
|
-
searchParams,
|
|
140
|
-
state,
|
|
141
|
-
);
|
|
142
|
-
if (oauth.isOAuth2Error(params)) {
|
|
143
|
-
console.error("Error Response", params);
|
|
144
|
-
throw new Error(); // Handle OAuth 2.0 redirect error
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const response = await oauth.authorizationCodeGrantRequest(
|
|
148
|
-
as,
|
|
149
|
-
client,
|
|
150
|
-
params,
|
|
151
|
-
redirect_uri,
|
|
152
|
-
codeVerifier,
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
// @todo do we need to do these
|
|
156
|
-
// const challenges = oauth.parseWwwAuthenticateChallenges(response);
|
|
157
|
-
// if (challenges) {
|
|
158
|
-
// for (const challenge of challenges) {
|
|
159
|
-
// console.error("WWW-Authenticate Challenge", challenge);
|
|
160
|
-
// }
|
|
161
|
-
// throw new Error(); // Handle WWW-Authenticate Challenges as needed
|
|
162
|
-
// }
|
|
163
|
-
|
|
164
|
-
const oauthResult = await oauth.processAuthorizationCodeOpenIDResponse(
|
|
165
|
-
as,
|
|
166
|
-
client,
|
|
167
|
-
response,
|
|
168
|
-
);
|
|
169
|
-
if (oauth.isOAuth2Error(oauthResult)) {
|
|
170
|
-
console.error("Error Response", oauthResult);
|
|
171
|
-
throw new Error(oauthResult.error);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const userInfoResponse = await oauth.userInfoRequest(
|
|
175
|
-
as,
|
|
176
|
-
client,
|
|
177
|
-
oauthResult.access_token,
|
|
178
|
-
);
|
|
179
|
-
const userInfo = await userInfoResponse.json();
|
|
180
|
-
|
|
181
|
-
// void storage.setProfile({
|
|
182
|
-
// sub: userInfo.sub,
|
|
183
|
-
// email: userInfo.email,
|
|
184
|
-
// name: userInfo.name,
|
|
185
|
-
// email_verified: userInfo.email_verified ?? false,
|
|
186
|
-
// picture: userInfo.picture,
|
|
187
|
-
// id_token: oauthResult.id_token,
|
|
188
|
-
// access_token: oauthResult.access_token,
|
|
189
|
-
// });
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Link, type LinkProps, useLocation } from "react-router-dom";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Link that scrolls to anchor even if the hash is already set in the URL.
|
|
6
|
-
*/
|
|
7
|
-
export const AnchorLink = (props: LinkProps) => {
|
|
8
|
-
const location = useLocation();
|
|
9
|
-
const hash = typeof props.to === "string" ? props.to : props.to.hash;
|
|
10
|
-
|
|
11
|
-
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
12
|
-
if (!hash?.startsWith("#") || hash !== location.hash) return;
|
|
13
|
-
|
|
14
|
-
event.preventDefault();
|
|
15
|
-
document.getElementById(hash.slice(1))?.scrollIntoView();
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return <Link onClick={handleClick} {...props} />;
|
|
19
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { cx } from "class-variance-authority";
|
|
3
|
-
|
|
4
|
-
export const CategoryHeading = ({
|
|
5
|
-
children,
|
|
6
|
-
className,
|
|
7
|
-
}: {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
}) => {
|
|
11
|
-
return (
|
|
12
|
-
<div className={cx("text-sm font-semibold text-primary mb-2", className)}>
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
3
|
-
import { XIcon } from "lucide-react"
|
|
4
|
-
import { cn } from "../util/cn.js";
|
|
5
|
-
|
|
6
|
-
const Dialog = DialogPrimitive.Root
|
|
7
|
-
|
|
8
|
-
const DialogTrigger = DialogPrimitive.Trigger
|
|
9
|
-
|
|
10
|
-
const DialogPortal = DialogPrimitive.Portal
|
|
11
|
-
|
|
12
|
-
const DialogClose = DialogPrimitive.Close
|
|
13
|
-
|
|
14
|
-
const DialogOverlay = React.forwardRef<
|
|
15
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
17
|
-
>(({ className, ...props }, ref) => (
|
|
18
|
-
<DialogPrimitive.Overlay
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(
|
|
21
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
22
|
-
className
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
))
|
|
27
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
28
|
-
|
|
29
|
-
const DialogContent = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
32
|
-
>(({ className, children, ...props }, ref) => (
|
|
33
|
-
<DialogPortal>
|
|
34
|
-
<DialogOverlay />
|
|
35
|
-
<DialogPrimitive.Content
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(
|
|
38
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
45
|
-
<XIcon className="h-4 w-4" />
|
|
46
|
-
<span className="sr-only">Close</span>
|
|
47
|
-
</DialogPrimitive.Close>
|
|
48
|
-
</DialogPrimitive.Content>
|
|
49
|
-
</DialogPortal>
|
|
50
|
-
))
|
|
51
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName
|
|
52
|
-
|
|
53
|
-
const DialogHeader = ({
|
|
54
|
-
className,
|
|
55
|
-
...props
|
|
56
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
57
|
-
<div
|
|
58
|
-
className={cn(
|
|
59
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
60
|
-
className
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
)
|
|
65
|
-
DialogHeader.displayName = "DialogHeader"
|
|
66
|
-
|
|
67
|
-
const DialogFooter = ({
|
|
68
|
-
className,
|
|
69
|
-
...props
|
|
70
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
71
|
-
<div
|
|
72
|
-
className={cn(
|
|
73
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
74
|
-
className
|
|
75
|
-
)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
)
|
|
79
|
-
DialogFooter.displayName = "DialogFooter"
|
|
80
|
-
|
|
81
|
-
const DialogTitle = React.forwardRef<
|
|
82
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
83
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
84
|
-
>(({ className, ...props }, ref) => (
|
|
85
|
-
<DialogPrimitive.Title
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cn(
|
|
88
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
))
|
|
94
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
95
|
-
|
|
96
|
-
const DialogDescription = React.forwardRef<
|
|
97
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
98
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
99
|
-
>(({ className, ...props }, ref) => (
|
|
100
|
-
<DialogPrimitive.Description
|
|
101
|
-
ref={ref}
|
|
102
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
103
|
-
{...props}
|
|
104
|
-
/>
|
|
105
|
-
))
|
|
106
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
Dialog,
|
|
110
|
-
DialogPortal,
|
|
111
|
-
DialogOverlay,
|
|
112
|
-
DialogTrigger,
|
|
113
|
-
DialogClose,
|
|
114
|
-
DialogContent,
|
|
115
|
-
DialogHeader,
|
|
116
|
-
DialogFooter,
|
|
117
|
-
DialogTitle,
|
|
118
|
-
DialogDescription,
|
|
119
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// import { type LucideProps } from "lucide-react";
|
|
2
|
-
// import dynamicIconImports from "lucide-react/dynamicIconImports.js";
|
|
3
|
-
// import { Suspense, lazy, memo } from "react";
|
|
4
|
-
// import { cn } from "../util/cn.js";
|
|
5
|
-
|
|
6
|
-
// export type IconName = keyof typeof dynamicIconImports;
|
|
7
|
-
|
|
8
|
-
// const IconNames = Object.keys(dynamicIconImports) as IconName[];
|
|
9
|
-
|
|
10
|
-
// export const isValidIcon = (name: unknown): name is IconName =>
|
|
11
|
-
// typeof name === "string" && IconNames.includes(name as IconName);
|
|
12
|
-
|
|
13
|
-
// type IconProps = Omit<LucideProps, "ref"> & {
|
|
14
|
-
// name: IconName;
|
|
15
|
-
// inline?: boolean;
|
|
16
|
-
// };
|
|
17
|
-
|
|
18
|
-
// const Fallback = ({
|
|
19
|
-
// inline,
|
|
20
|
-
// size,
|
|
21
|
-
// }: {
|
|
22
|
-
// inline?: boolean;
|
|
23
|
-
// size?: string | number;
|
|
24
|
-
// }) => (
|
|
25
|
-
// <span
|
|
26
|
-
// className={cn(inline ? "inline-block" : "block", "bg-background")}
|
|
27
|
-
// style={{ height: size, width: size }}
|
|
28
|
-
// role="presentation"
|
|
29
|
-
// />
|
|
30
|
-
// );
|
|
31
|
-
|
|
32
|
-
// export const DynamicIcon = memo(function ({
|
|
33
|
-
// name,
|
|
34
|
-
// inline,
|
|
35
|
-
// className,
|
|
36
|
-
// size = 16,
|
|
37
|
-
// ...props
|
|
38
|
-
// }: IconProps) {
|
|
39
|
-
// const LucideIcon = lazy(dynamicIconImports[name]);
|
|
40
|
-
|
|
41
|
-
// return (
|
|
42
|
-
// <Suspense fallback={<Fallback inline={inline} size={size} />}>
|
|
43
|
-
// <LucideIcon
|
|
44
|
-
// {...props}
|
|
45
|
-
// size={size}
|
|
46
|
-
// className={cn(inline && "inline-block align-[-0.125em]", className)}
|
|
47
|
-
// />
|
|
48
|
-
// </Suspense>
|
|
49
|
-
// );
|
|
50
|
-
// });
|
|
51
|
-
|
|
52
|
-
export type IconName = string;
|
|
53
|
-
|
|
54
|
-
export function isValidIcon(name: unknown): name is IconName {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const DynamicIcon = (props: { name: string; size?: number }) => (
|
|
59
|
-
<div></div>
|
|
60
|
-
);
|