zudoku 0.0.2-dev.0
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/cli.js +1 -0
- package/dist/app/DevPortal.d.ts +26 -0
- package/dist/app/DevPortal.js +41 -0
- package/dist/app/DevPortal.js.map +1 -0
- package/dist/app/Heading.d.ts +9 -0
- package/dist/app/Heading.js +27 -0
- package/dist/app/Heading.js.map +1 -0
- package/dist/app/app.d.ts +2 -0
- package/dist/app/app.js +69 -0
- package/dist/app/app.js.map +1 -0
- package/dist/app/authentication/authentication.d.ts +13 -0
- package/dist/app/authentication/authentication.js +2 -0
- package/dist/app/authentication/authentication.js.map +1 -0
- package/dist/app/authentication/clerk.d.ts +5 -0
- package/dist/app/authentication/clerk.js +36 -0
- package/dist/app/authentication/clerk.js.map +1 -0
- package/dist/app/authentication/openid.d.ts +11 -0
- package/dist/app/authentication/openid.js +118 -0
- package/dist/app/authentication/openid.js.map +1 -0
- package/dist/app/components/AnchorLink.d.ts +5 -0
- package/dist/app/components/AnchorLink.js +17 -0
- package/dist/app/components/AnchorLink.js.map +1 -0
- package/dist/app/components/CategoryHeading.d.ts +5 -0
- package/dist/app/components/CategoryHeading.js +6 -0
- package/dist/app/components/CategoryHeading.js.map +1 -0
- package/dist/app/components/DynamicIcon.d.ts +6 -0
- package/dist/app/components/DynamicIcon.js +6 -0
- package/dist/app/components/DynamicIcon.js.map +1 -0
- package/dist/app/components/Header.d.ts +2 -0
- package/dist/app/components/Header.js +15 -0
- package/dist/app/components/Header.js.map +1 -0
- package/dist/app/components/Layout.d.ts +4 -0
- package/dist/app/components/Layout.js +31 -0
- package/dist/app/components/Layout.js.map +1 -0
- package/dist/app/components/Markdown.d.ts +5 -0
- package/dist/app/components/Markdown.js +20 -0
- package/dist/app/components/Markdown.js.map +1 -0
- package/dist/app/components/SyntaxHighlight.d.ts +9 -0
- package/dist/app/components/SyntaxHighlight.js +31 -0
- package/dist/app/components/SyntaxHighlight.js.map +1 -0
- package/dist/app/components/TopNavigation.d.ts +1 -0
- package/dist/app/components/TopNavigation.js +11 -0
- package/dist/app/components/TopNavigation.js.map +1 -0
- package/dist/app/components/context/ComponentsContext.d.ts +10 -0
- package/dist/app/components/context/ComponentsContext.js +11 -0
- package/dist/app/components/context/ComponentsContext.js.map +1 -0
- package/dist/app/components/context/DevPortalProvider.d.ts +10 -0
- package/dist/app/components/context/DevPortalProvider.js +39 -0
- package/dist/app/components/context/DevPortalProvider.js.map +1 -0
- package/dist/app/components/context/PluginSystem.d.ts +1 -0
- package/dist/app/components/context/PluginSystem.js +2 -0
- package/dist/app/components/context/PluginSystem.js.map +1 -0
- package/dist/app/components/context/ThemeContext.d.ts +5 -0
- package/dist/app/components/context/ThemeContext.js +33 -0
- package/dist/app/components/context/ThemeContext.js.map +1 -0
- package/dist/app/components/context/ViewportAnchorContext.d.ts +15 -0
- package/dist/app/components/context/ViewportAnchorContext.js +89 -0
- package/dist/app/components/context/ViewportAnchorContext.js.map +1 -0
- package/dist/app/components/navigation/SideNavigation.d.ts +1 -0
- package/dist/app/components/navigation/SideNavigation.js +11 -0
- package/dist/app/components/navigation/SideNavigation.js.map +1 -0
- package/dist/app/components/navigation/SideNavigationCategory.d.ts +4 -0
- package/dist/app/components/navigation/SideNavigationCategory.js +26 -0
- package/dist/app/components/navigation/SideNavigationCategory.js.map +1 -0
- package/dist/app/components/navigation/SideNavigationItem.d.ts +12 -0
- package/dist/app/components/navigation/SideNavigationItem.js +38 -0
- package/dist/app/components/navigation/SideNavigationItem.js.map +1 -0
- package/dist/app/components/navigation/SideNavigationWrapper.d.ts +4 -0
- package/dist/app/components/navigation/SideNavigationWrapper.js +6 -0
- package/dist/app/components/navigation/SideNavigationWrapper.js.map +1 -0
- package/dist/app/components/navigation/useNavigationCollapsibleState.d.ts +7 -0
- package/dist/app/components/navigation/useNavigationCollapsibleState.js +16 -0
- package/dist/app/components/navigation/useNavigationCollapsibleState.js.map +1 -0
- package/dist/app/components/navigation/util.d.ts +8 -0
- package/dist/app/components/navigation/util.js +15 -0
- package/dist/app/components/navigation/util.js.map +1 -0
- package/dist/app/config.d.ts +3 -0
- package/dist/app/config.js +9 -0
- package/dist/app/config.js.map +1 -0
- package/dist/app/core/DevPortalContext.d.ts +80 -0
- package/dist/app/core/DevPortalContext.js +68 -0
- package/dist/app/core/DevPortalContext.js.map +1 -0
- package/dist/app/core/helmet.d.ts +4 -0
- package/dist/app/core/helmet.js +5 -0
- package/dist/app/core/helmet.js.map +1 -0
- package/dist/app/core/icons.d.ts +1 -0
- package/dist/app/core/icons.js +2 -0
- package/dist/app/core/icons.js.map +1 -0
- package/dist/app/core/plugins.d.ts +24 -0
- package/dist/app/core/plugins.js +4 -0
- package/dist/app/core/plugins.js.map +1 -0
- package/dist/app/core/router.d.ts +1 -0
- package/dist/app/core/router.js +2 -0
- package/dist/app/core/router.js.map +1 -0
- package/dist/app/core/types/combine.d.ts +4 -0
- package/dist/app/core/types/combine.js +2 -0
- package/dist/app/core/types/combine.js.map +1 -0
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +18 -0
- package/dist/app/main.js.map +1 -0
- package/dist/app/markdowns.d.ts +3 -0
- package/dist/app/markdowns.js +5 -0
- package/dist/app/markdowns.js.map +1 -0
- package/dist/app/oas/graphql/index.d.ts +12 -0
- package/dist/app/oas/graphql/index.js +290 -0
- package/dist/app/oas/graphql/index.js.map +1 -0
- package/dist/app/oas/graphql/server.d.ts +1 -0
- package/dist/app/oas/graphql/server.js +8 -0
- package/dist/app/oas/graphql/server.js.map +1 -0
- package/dist/app/oas/parser/dereference/index.d.ts +5 -0
- package/dist/app/oas/parser/dereference/index.js +43 -0
- package/dist/app/oas/parser/dereference/index.js.map +1 -0
- package/dist/app/oas/parser/dereference/resolveRef.d.ts +5 -0
- package/dist/app/oas/parser/dereference/resolveRef.js +26 -0
- package/dist/app/oas/parser/dereference/resolveRef.js.map +1 -0
- package/dist/app/oas/parser/index.d.ts +21 -0
- package/dist/app/oas/parser/index.js +58 -0
- package/dist/app/oas/parser/index.js.map +1 -0
- package/dist/app/oas/parser/schemas/v3.0.json +1489 -0
- package/dist/app/oas/parser/schemas/v3.1.json +1298 -0
- package/dist/app/oas/parser/upgrade/index.d.ts +9 -0
- package/dist/app/oas/parser/upgrade/index.js +90 -0
- package/dist/app/oas/parser/upgrade/index.js.map +1 -0
- package/dist/app/plugins/api-key/SettingsApiKeys.d.ts +4 -0
- package/dist/app/plugins/api-key/SettingsApiKeys.js +7 -0
- package/dist/app/plugins/api-key/SettingsApiKeys.js.map +1 -0
- package/dist/app/plugins/api-key/index.d.ts +32 -0
- package/dist/app/plugins/api-key/index.js +55 -0
- package/dist/app/plugins/api-key/index.js.map +1 -0
- package/dist/app/plugins/markdown/MdxPage.d.ts +3 -0
- package/dist/app/plugins/markdown/MdxPage.js +55 -0
- package/dist/app/plugins/markdown/MdxPage.js.map +1 -0
- package/dist/app/plugins/markdown/Toc.d.ts +4 -0
- package/dist/app/plugins/markdown/Toc.js +40 -0
- package/dist/app/plugins/markdown/Toc.js.map +1 -0
- package/dist/app/plugins/markdown/generateRoutes.d.ts +3 -0
- package/dist/app/plugins/markdown/generateRoutes.js +50 -0
- package/dist/app/plugins/markdown/generateRoutes.js.map +1 -0
- package/dist/app/plugins/markdown/index.d.ts +19 -0
- package/dist/app/plugins/markdown/index.js +9 -0
- package/dist/app/plugins/markdown/index.js.map +1 -0
- package/dist/app/plugins/openapi/ColorizedParam.d.ts +8 -0
- package/dist/app/plugins/openapi/ColorizedParam.js +40 -0
- package/dist/app/plugins/openapi/ColorizedParam.js.map +1 -0
- package/dist/app/plugins/openapi/MakeRequest.d.ts +4 -0
- package/dist/app/plugins/openapi/MakeRequest.js +11 -0
- package/dist/app/plugins/openapi/MakeRequest.js.map +1 -0
- package/dist/app/plugins/openapi/MethodBadge.d.ts +13 -0
- package/dist/app/plugins/openapi/MethodBadge.js +26 -0
- package/dist/app/plugins/openapi/MethodBadge.js.map +1 -0
- package/dist/app/plugins/openapi/OperationList.d.ts +47 -0
- package/dist/app/plugins/openapi/OperationList.js +82 -0
- package/dist/app/plugins/openapi/OperationList.js.map +1 -0
- package/dist/app/plugins/openapi/OperationListItem.d.ts +7 -0
- package/dist/app/plugins/openapi/OperationListItem.js +15 -0
- package/dist/app/plugins/openapi/OperationListItem.js.map +1 -0
- package/dist/app/plugins/openapi/ParameterList.d.ts +7 -0
- package/dist/app/plugins/openapi/ParameterList.js +5 -0
- package/dist/app/plugins/openapi/ParameterList.js.map +1 -0
- package/dist/app/plugins/openapi/ParameterListItem.d.ts +8 -0
- package/dist/app/plugins/openapi/ParameterListItem.js +13 -0
- package/dist/app/plugins/openapi/ParameterListItem.js.map +1 -0
- package/dist/app/plugins/openapi/RequestBodySidecarBox.d.ts +6 -0
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js +19 -0
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js.map +1 -0
- package/dist/app/plugins/openapi/ResponsesSidecarBox.d.ts +6 -0
- package/dist/app/plugins/openapi/ResponsesSidecarBox.js +15 -0
- package/dist/app/plugins/openapi/ResponsesSidecarBox.js.map +1 -0
- package/dist/app/plugins/openapi/Select.d.ts +9 -0
- package/dist/app/plugins/openapi/Select.js +5 -0
- package/dist/app/plugins/openapi/Select.js.map +1 -0
- package/dist/app/plugins/openapi/Sidecar.d.ts +4 -0
- package/dist/app/plugins/openapi/Sidecar.js +39 -0
- package/dist/app/plugins/openapi/Sidecar.js.map +1 -0
- package/dist/app/plugins/openapi/SidecarBox.d.ts +10 -0
- package/dist/app/plugins/openapi/SidecarBox.js +8 -0
- package/dist/app/plugins/openapi/SidecarBox.js.map +1 -0
- package/dist/app/plugins/openapi/graphql/index.d.ts +836 -0
- package/dist/app/plugins/openapi/graphql/index.js +4 -0
- package/dist/app/plugins/openapi/graphql/index.js.map +1 -0
- package/dist/app/plugins/openapi/index.d.ts +22 -0
- package/dist/app/plugins/openapi/index.js +91 -0
- package/dist/app/plugins/openapi/index.js.map +1 -0
- package/dist/app/plugins/openapi/util/generateSchemaExample.d.ts +3 -0
- package/dist/app/plugins/openapi/util/generateSchemaExample.js +52 -0
- package/dist/app/plugins/openapi/util/generateSchemaExample.js.map +1 -0
- package/dist/app/plugins/openapi/util/getCode.d.ts +2 -0
- package/dist/app/plugins/openapi/util/getCode.js +54 -0
- package/dist/app/plugins/openapi/util/getCode.js.map +1 -0
- package/dist/app/plugins/openapi/util/urql.d.ts +8 -0
- package/dist/app/plugins/openapi/util/urql.js +8 -0
- package/dist/app/plugins/openapi/util/urql.js.map +1 -0
- package/dist/app/plugins/openapi/worker/createSharedWorkerClient.d.ts +5 -0
- package/dist/app/plugins/openapi/worker/createSharedWorkerClient.js +47 -0
- package/dist/app/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -0
- package/dist/app/plugins/openapi/worker/worker.d.ts +1 -0
- package/dist/app/plugins/openapi/worker/worker.js +20 -0
- package/dist/app/plugins/openapi/worker/worker.js.map +1 -0
- package/dist/app/plugins/redirect/index.d.ts +10 -0
- package/dist/app/plugins/redirect/index.js +11 -0
- package/dist/app/plugins/redirect/index.js.map +1 -0
- package/dist/app/tailwind.d.ts +3 -0
- package/dist/app/tailwind.js +69 -0
- package/dist/app/tailwind.js.map +1 -0
- package/dist/app/ui/Callout.d.ts +51 -0
- package/dist/app/ui/Callout.js +50 -0
- package/dist/app/ui/Callout.js.map +1 -0
- package/dist/app/ui/Card.d.ts +8 -0
- package/dist/app/ui/Card.js +17 -0
- package/dist/app/ui/Card.js.map +1 -0
- package/dist/app/ui/Note.d.ts +8 -0
- package/dist/app/ui/Note.js +23 -0
- package/dist/app/ui/Note.js.map +1 -0
- package/dist/app/util/MdxComponents.d.ts +27 -0
- package/dist/app/util/MdxComponents.js +40 -0
- package/dist/app/util/MdxComponents.js.map +1 -0
- package/dist/app/util/cn.d.ts +2 -0
- package/dist/app/util/cn.js +6 -0
- package/dist/app/util/cn.js.map +1 -0
- package/dist/app/util/createWaitForNotify.d.ts +1 -0
- package/dist/app/util/createWaitForNotify.js +15 -0
- package/dist/app/util/createWaitForNotify.js.map +1 -0
- package/dist/app/util/groupBy.d.ts +6 -0
- package/dist/app/util/groupBy.js +9 -0
- package/dist/app/util/groupBy.js.map +1 -0
- package/dist/app/util/joinPath.d.ts +1 -0
- package/dist/app/util/joinPath.js +8 -0
- package/dist/app/util/joinPath.js.map +1 -0
- package/dist/app/util/pastellize.d.ts +4 -0
- package/dist/app/util/pastellize.js +14 -0
- package/dist/app/util/pastellize.js.map +1 -0
- package/dist/app/util/slugify.d.ts +3 -0
- package/dist/app/util/slugify.js +3 -0
- package/dist/app/util/slugify.js.map +1 -0
- package/dist/app/util/traverseNavigation.d.ts +6 -0
- package/dist/app/util/traverseNavigation.js +30 -0
- package/dist/app/util/traverseNavigation.js.map +1 -0
- package/dist/app/util/useScrollToAnchor.d.ts +1 -0
- package/dist/app/util/useScrollToAnchor.js +33 -0
- package/dist/app/util/useScrollToAnchor.js.map +1 -0
- package/dist/app/util/useScrollToTop.d.ts +1 -0
- package/dist/app/util/useScrollToTop.js +13 -0
- package/dist/app/util/useScrollToTop.js.map +1 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +3 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli/build/handler.d.ts +4 -0
- package/dist/cli/build/handler.js +9 -0
- package/dist/cli/build/handler.js.map +1 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +64 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/cmds/build.d.ts +8 -0
- package/dist/cli/cmds/build.js +23 -0
- package/dist/cli/cmds/build.js.map +1 -0
- package/dist/cli/cmds/dev.d.ts +8 -0
- package/dist/cli/cmds/dev.js +29 -0
- package/dist/cli/cmds/dev.js.map +1 -0
- package/dist/cli/common/analytics/lib.d.ts +17 -0
- package/dist/cli/common/analytics/lib.js +53 -0
- package/dist/cli/common/analytics/lib.js.map +1 -0
- package/dist/cli/common/constants.d.ts +5 -0
- package/dist/cli/common/constants.js +9 -0
- package/dist/cli/common/constants.js.map +1 -0
- package/dist/cli/common/logger.d.ts +2 -0
- package/dist/cli/common/logger.js +14 -0
- package/dist/cli/common/logger.js.map +1 -0
- package/dist/cli/common/machine-id/lib.d.ts +1 -0
- package/dist/cli/common/machine-id/lib.js +74 -0
- package/dist/cli/common/machine-id/lib.js.map +1 -0
- package/dist/cli/common/outdated.d.ts +1 -0
- package/dist/cli/common/outdated.js +70 -0
- package/dist/cli/common/outdated.js.map +1 -0
- package/dist/cli/common/output.d.ts +9 -0
- package/dist/cli/common/output.js +65 -0
- package/dist/cli/common/output.js.map +1 -0
- package/dist/cli/common/utils/box.d.ts +33 -0
- package/dist/cli/common/utils/box.js +81 -0
- package/dist/cli/common/utils/box.js.map +1 -0
- package/dist/cli/common/utils/ports.d.ts +1 -0
- package/dist/cli/common/utils/ports.js +18 -0
- package/dist/cli/common/utils/ports.js.map +1 -0
- package/dist/cli/common/validators/lib.d.ts +20 -0
- package/dist/cli/common/validators/lib.js +31 -0
- package/dist/cli/common/validators/lib.js.map +1 -0
- package/dist/cli/common/xdg/lib.d.ts +6 -0
- package/dist/cli/common/xdg/lib.js +18 -0
- package/dist/cli/common/xdg/lib.js.map +1 -0
- package/dist/cli/dev/handler.d.ts +5 -0
- package/dist/cli/dev/handler.js +22 -0
- package/dist/cli/dev/handler.js.map +1 -0
- package/dist/config/config.d.ts +37 -0
- package/dist/config/config.js +2 -0
- package/dist/config/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins.d.ts +4 -0
- package/dist/plugins.js +6 -0
- package/dist/plugins.js.map +1 -0
- package/dist/vite/build.d.ts +3 -0
- package/dist/vite/build.js +29 -0
- package/dist/vite/build.js.map +1 -0
- package/dist/vite/config.d.ts +6 -0
- package/dist/vite/config.js +74 -0
- package/dist/vite/config.js.map +1 -0
- package/dist/vite/dev-server.d.ts +10 -0
- package/dist/vite/dev-server.js +53 -0
- package/dist/vite/dev-server.js.map +1 -0
- package/dist/vite/html.d.ts +5 -0
- package/dist/vite/html.js +32 -0
- package/dist/vite/html.js.map +1 -0
- package/dist/vite/import-auth-plugin.d.ts +3 -0
- package/dist/vite/import-auth-plugin.js +28 -0
- package/dist/vite/import-auth-plugin.js.map +1 -0
- package/dist/vite/plugin.d.ts +7 -0
- package/dist/vite/plugin.js +109 -0
- package/dist/vite/plugin.js.map +1 -0
- package/package.json +118 -0
- package/src/app/DevPortal.tsx +115 -0
- package/src/app/Heading.tsx +60 -0
- package/src/app/app.tsx +85 -0
- package/src/app/authentication/authentication.ts +18 -0
- package/src/app/authentication/clerk.ts +47 -0
- package/src/app/authentication/openid.ts +192 -0
- package/src/app/components/AnchorLink.tsx +19 -0
- package/src/app/components/CategoryHeading.tsx +16 -0
- package/src/app/components/DynamicIcon.tsx +60 -0
- package/src/app/components/Header.tsx +69 -0
- package/src/app/components/Layout.tsx +56 -0
- package/src/app/components/Markdown.tsx +37 -0
- package/src/app/components/SyntaxHighlight.tsx +92 -0
- package/src/app/components/TopNavigation.tsx +32 -0
- package/src/app/components/context/ComponentsContext.tsx +24 -0
- package/src/app/components/context/DevPortalProvider.ts +54 -0
- package/src/app/components/context/PluginSystem.ts +0 -0
- package/src/app/components/context/ThemeContext.tsx +46 -0
- package/src/app/components/context/ViewportAnchorContext.tsx +139 -0
- package/src/app/components/navigation/SideNavigation.tsx +18 -0
- package/src/app/components/navigation/SideNavigationCategory.tsx +74 -0
- package/src/app/components/navigation/SideNavigationItem.tsx +143 -0
- package/src/app/components/navigation/SideNavigationWrapper.tsx +15 -0
- package/src/app/components/navigation/useNavigationCollapsibleState.ts +27 -0
- package/src/app/components/navigation/util.ts +38 -0
- package/src/app/config.ts +20 -0
- package/src/app/core/DevPortalContext.ts +164 -0
- package/src/app/core/helmet.ts +5 -0
- package/src/app/core/icons.tsx +1 -0
- package/src/app/core/plugins.ts +43 -0
- package/src/app/core/router.tsx +1 -0
- package/src/app/core/types/combine.ts +16 -0
- package/src/app/main.css +137 -0
- package/src/app/main.tsx +22 -0
- package/src/app/markdowns.ts +7 -0
- package/src/app/oas/graphql/index.ts +422 -0
- package/src/app/oas/graphql/server.ts +10 -0
- package/src/app/oas/parser/dereference/index.ts +59 -0
- package/src/app/oas/parser/dereference/resolveRef.ts +32 -0
- package/src/app/oas/parser/index.ts +94 -0
- package/src/app/oas/parser/schemas/v3.0.json +1489 -0
- package/src/app/oas/parser/schemas/v3.1.json +1298 -0
- package/src/app/oas/parser/upgrade/index.ts +108 -0
- package/src/app/plugins/api-key/SettingsApiKeys.tsx +22 -0
- package/src/app/plugins/api-key/index.tsx +123 -0
- package/src/app/plugins/markdown/MdxPage.tsx +128 -0
- package/src/app/plugins/markdown/Toc.tsx +122 -0
- package/src/app/plugins/markdown/generateRoutes.tsx +72 -0
- package/src/app/plugins/markdown/index.tsx +31 -0
- package/src/app/plugins/openapi/ColorizedParam.tsx +73 -0
- package/src/app/plugins/openapi/MakeRequest.tsx +30 -0
- package/src/app/plugins/openapi/MethodBadge.tsx +36 -0
- package/src/app/plugins/openapi/OperationList.tsx +119 -0
- package/src/app/plugins/openapi/OperationListItem.tsx +55 -0
- package/src/app/plugins/openapi/ParameterList.tsx +32 -0
- package/src/app/plugins/openapi/ParameterListItem.tsx +60 -0
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +48 -0
- package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +60 -0
- package/src/app/plugins/openapi/Select.tsx +35 -0
- package/src/app/plugins/openapi/Sidecar.tsx +99 -0
- package/src/app/plugins/openapi/SidecarBox.tsx +35 -0
- package/src/app/plugins/openapi/graphql/env.d.ts +48 -0
- package/src/app/plugins/openapi/graphql/index.ts +13 -0
- package/src/app/plugins/openapi/index.tsx +142 -0
- package/src/app/plugins/openapi/util/generateSchemaExample.ts +59 -0
- package/src/app/plugins/openapi/util/getCode.tsx +69 -0
- package/src/app/plugins/openapi/util/urql.ts +8 -0
- package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +60 -0
- package/src/app/plugins/openapi/worker/worker.ts +30 -0
- package/src/app/plugins/redirect/index.tsx +20 -0
- package/src/app/tailwind.ts +72 -0
- package/src/app/ui/Callout.tsx +87 -0
- package/src/app/ui/Card.tsx +82 -0
- package/src/app/ui/Note.tsx +58 -0
- package/src/app/util/MdxComponents.tsx +70 -0
- package/src/app/util/cn.ts +6 -0
- package/src/app/util/createWaitForNotify.ts +18 -0
- package/src/app/util/groupBy.ts +24 -0
- package/src/app/util/joinPath.tsx +10 -0
- package/src/app/util/pastellize.ts +25 -0
- package/src/app/util/slugify.ts +3 -0
- package/src/app/util/traverseNavigation.ts +55 -0
- package/src/app/util/useScrollToAnchor.ts +38 -0
- package/src/app/util/useScrollToTop.ts +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,EAMlC,CAAC;AAGL,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { type DevPortalPlugin } from "../../core/plugins.js";
|
|
3
|
+
export declare const OasConfigProvider: import("react").Provider<{
|
|
4
|
+
config: OasPluginConfig;
|
|
5
|
+
} | undefined>;
|
|
6
|
+
export declare const useOasConfig: () => OasPluginConfig;
|
|
7
|
+
type OasSource = {
|
|
8
|
+
type: "url";
|
|
9
|
+
input: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: "yaml";
|
|
12
|
+
input: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: "json";
|
|
15
|
+
input: object;
|
|
16
|
+
};
|
|
17
|
+
export type OasPluginConfig = {
|
|
18
|
+
server?: string;
|
|
19
|
+
path?: string;
|
|
20
|
+
} & OasSource;
|
|
21
|
+
export declare const openApiPlugin: (config: OasPluginConfig) => DevPortalPlugin;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { Outlet, matchPath } from "../../core/router.js";
|
|
4
|
+
import { MethodBadge } from "./MethodBadge.js";
|
|
5
|
+
import { OperationList } from "./OperationList.js";
|
|
6
|
+
import { graphql } from "./graphql/index.js";
|
|
7
|
+
import { Provider, Client as UrqlClient, cacheExchange, fetchExchange, } from "./util/urql.js";
|
|
8
|
+
import { createSharedWorkerClient } from "./worker/createSharedWorkerClient.js";
|
|
9
|
+
const OasContext = createContext(undefined);
|
|
10
|
+
export const OasConfigProvider = OasContext.Provider;
|
|
11
|
+
export const useOasConfig = () => {
|
|
12
|
+
const ctx = useContext(OasContext);
|
|
13
|
+
if (!ctx) {
|
|
14
|
+
throw new Error("useOasConfig must be used within a OasConfigProvider");
|
|
15
|
+
}
|
|
16
|
+
return ctx.config;
|
|
17
|
+
};
|
|
18
|
+
const OasContextProvider = ({ config, client, }) => {
|
|
19
|
+
return (_jsx(Provider, { value: client, children: _jsx(OasConfigProvider, { value: { config }, children: _jsx(Outlet, {}) }) }));
|
|
20
|
+
};
|
|
21
|
+
const GetCategoriesQuery = graphql(`
|
|
22
|
+
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
23
|
+
schema(input: $input, type: $type) {
|
|
24
|
+
tags {
|
|
25
|
+
__typename
|
|
26
|
+
name
|
|
27
|
+
operations {
|
|
28
|
+
__typename
|
|
29
|
+
slug
|
|
30
|
+
method
|
|
31
|
+
summary
|
|
32
|
+
operationId
|
|
33
|
+
path
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`);
|
|
39
|
+
export const openApiPlugin = (config) => {
|
|
40
|
+
const basePath = config.path ?? "/reference";
|
|
41
|
+
const client = config.server
|
|
42
|
+
? new UrqlClient({
|
|
43
|
+
url: config.server,
|
|
44
|
+
exchanges: [cacheExchange, fetchExchange],
|
|
45
|
+
})
|
|
46
|
+
: createSharedWorkerClient();
|
|
47
|
+
return {
|
|
48
|
+
getNavigation: async (path) => {
|
|
49
|
+
if (!matchPath({ path: basePath, end: false }, path)) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
const { data } = await client.query(GetCategoriesQuery, {
|
|
53
|
+
input: config.input,
|
|
54
|
+
type: config.type,
|
|
55
|
+
});
|
|
56
|
+
if (!data)
|
|
57
|
+
return [];
|
|
58
|
+
const categories = data.schema.tags
|
|
59
|
+
.filter((tag) => tag.operations.length > 0)
|
|
60
|
+
.map((tag) => ({
|
|
61
|
+
path,
|
|
62
|
+
label: tag.name ?? "",
|
|
63
|
+
collapsible: false,
|
|
64
|
+
children: tag.operations.map((operation) => ({
|
|
65
|
+
path: `#${operation.slug}`,
|
|
66
|
+
title: operation.summary ?? operation.path,
|
|
67
|
+
label: (_jsxs("div", { className: "flex flex-1 min-w-0 justify-between gap-2", children: [_jsx("span", { className: "truncate", children: operation.summary ?? operation.path }), _jsx(MethodBadge, { method: operation.method })] })),
|
|
68
|
+
})),
|
|
69
|
+
}));
|
|
70
|
+
categories.unshift({
|
|
71
|
+
path,
|
|
72
|
+
label: "Overview",
|
|
73
|
+
collapsible: false,
|
|
74
|
+
children: [{ path: "#description", label: "Description" }],
|
|
75
|
+
});
|
|
76
|
+
return categories;
|
|
77
|
+
},
|
|
78
|
+
getRoutes: () => [
|
|
79
|
+
{
|
|
80
|
+
element: _jsx(OasContextProvider, { config: config, client: client }),
|
|
81
|
+
children: [
|
|
82
|
+
{
|
|
83
|
+
path: basePath,
|
|
84
|
+
children: [{ index: true, element: _jsx(OperationList, {}) }],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app/plugins/openapi/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAKlD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAoB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,MAAM,IAAI,UAAU,EACpB,aAAa,EACb,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,MAAM,UAAU,GAAG,aAAa,CAC9B,SAAS,CACV,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC;AACpB,CAAC,CAAC;AAYF,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,MAAM,GAIP,EAAE,EAAE;IACH,OAAO,CACL,KAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACrB,KAAC,iBAAiB,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,YAClC,KAAC,MAAM,KAAG,GACQ,GACX,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,OAAO,CAAC;;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S,CAAC,IAAI,EAAE;oBAC1B,KAAK,EAAE,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,IAAI;oBAC1C,KAAK,EAAE,CACL,eAAK,SAAS,EAAC,2CAA2C,aACxD,eAAM,SAAS,EAAC,UAAU,YACvB,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,IAAI,GAC/B,EACP,KAAC,WAAW,IAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAI,IACrC,CACP;iBACF,CAAC,CAAC;aACJ,CAAC,CAAC,CAAC;YAEN,UAAU,CAAC,OAAO,CAAC;gBACjB,IAAI;gBACJ,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,KAAK;gBAClB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;aAC3D,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CACd;YACE;gBACE,OAAO,EAAE,KAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI;gBAC/D,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAC,aAAa,KAAG,EAAE,CAAC;qBACxD;iBACF;aACF;SACsB;KAC5B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2
|
+
export const generateSchemaExample = (schema) => {
|
|
3
|
+
// Directly return the example or default if they exist
|
|
4
|
+
if (schema.example !== undefined) {
|
|
5
|
+
return schema.example;
|
|
6
|
+
}
|
|
7
|
+
else if (schema.default !== undefined) {
|
|
8
|
+
return schema.default;
|
|
9
|
+
}
|
|
10
|
+
// Process examples object
|
|
11
|
+
if (schema.examples && isObject(schema.examples)) {
|
|
12
|
+
return Object.values(schema.examples)[0];
|
|
13
|
+
}
|
|
14
|
+
// Recursively process objects and arrays
|
|
15
|
+
return processComplexTypes(schema);
|
|
16
|
+
};
|
|
17
|
+
function processComplexTypes(schema) {
|
|
18
|
+
if (schema.type === "object" && schema.properties) {
|
|
19
|
+
const obj = {};
|
|
20
|
+
Object.keys(schema.properties).forEach((key) => {
|
|
21
|
+
obj[key] = generateSchemaExample(schema.properties[key]);
|
|
22
|
+
});
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
25
|
+
else if (schema.type === "array" && schema.items) {
|
|
26
|
+
return [generateSchemaExample(schema.items)];
|
|
27
|
+
}
|
|
28
|
+
// Fallback for missing or undefined types
|
|
29
|
+
return getDefaultForType(schema.type);
|
|
30
|
+
}
|
|
31
|
+
function getDefaultForType(type) {
|
|
32
|
+
if (Array.isArray(type)) {
|
|
33
|
+
return getDefaultForSingleType(type[0]);
|
|
34
|
+
}
|
|
35
|
+
return getDefaultForSingleType(type);
|
|
36
|
+
}
|
|
37
|
+
function getDefaultForSingleType(type) {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case "string":
|
|
40
|
+
return "";
|
|
41
|
+
case "number":
|
|
42
|
+
case "integer":
|
|
43
|
+
return 0;
|
|
44
|
+
case "boolean":
|
|
45
|
+
return false;
|
|
46
|
+
case "null":
|
|
47
|
+
return null;
|
|
48
|
+
default:
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=generateSchemaExample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateSchemaExample.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/util/generateSchemaExample.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAW,EAAE,CAClD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,K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SAAS,iBAAiB,CAAC,IAAwB;IACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAa;IAC5C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,EAAE,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC;QACf,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const getCode = (operation, option) => {
|
|
2
|
+
switch (option) {
|
|
3
|
+
case "curl":
|
|
4
|
+
return (`curl --request ${operation.method.toLocaleUpperCase()} \\\n` +
|
|
5
|
+
` --url ${operation.path} \\\n` +
|
|
6
|
+
` --header 'Content-Type: application/json'`);
|
|
7
|
+
case "wget":
|
|
8
|
+
return (`wget --method=${operation.method.toLocaleUpperCase()} \\\n` +
|
|
9
|
+
` --header='Content-Type: application/json' \\\n` +
|
|
10
|
+
` ${operation.path}`);
|
|
11
|
+
case "js":
|
|
12
|
+
return (`fetch('${operation.path}', {\n` +
|
|
13
|
+
` method: '${operation.method.toLocaleUpperCase()}',\n` +
|
|
14
|
+
` headers: { 'Content-Type': 'application/json' },\n` +
|
|
15
|
+
`});`);
|
|
16
|
+
case "ruby":
|
|
17
|
+
return (`require 'net/http'\n\n` +
|
|
18
|
+
`url = URI.parse('${operation.path}')\n` +
|
|
19
|
+
`http = Net::HTTP.new(url.host, url.port)\n` +
|
|
20
|
+
`request = Net::HTTP::${operation.method}.new(url)\n` +
|
|
21
|
+
`request['Content-Type'] = 'application/json'\n` +
|
|
22
|
+
`http.request(request)`);
|
|
23
|
+
case "php":
|
|
24
|
+
return (`$ch = curl_init('${operation.path}');\n` +
|
|
25
|
+
`curl_setopt($ch, CURLOPT_CUSTOMREQUEST, '${operation.method.toLocaleUpperCase()}');\n` +
|
|
26
|
+
`curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n` +
|
|
27
|
+
`curl_exec($ch);\n` +
|
|
28
|
+
`curl_close($ch);`);
|
|
29
|
+
case "go":
|
|
30
|
+
return (`package main\n\n` +
|
|
31
|
+
`import (\n` +
|
|
32
|
+
` "net/http"\n` +
|
|
33
|
+
` "strings"\n` +
|
|
34
|
+
`)\n\n` +
|
|
35
|
+
`func main() {\n` +
|
|
36
|
+
` client := &http.Client{}\n` +
|
|
37
|
+
` req, _ := http.NewRequest("${operation.method.toLocaleUpperCase()}", "${operation.path}", strings.NewReader(""))\n` +
|
|
38
|
+
` req.Header.Set("Content-Type", "application/json")\n` +
|
|
39
|
+
` client.Do(req)\n` +
|
|
40
|
+
`}`);
|
|
41
|
+
case "rust":
|
|
42
|
+
return (`use reqwest::Client;\n\n` +
|
|
43
|
+
`fn main() {\n` +
|
|
44
|
+
` let client = Client::new();\n` +
|
|
45
|
+
` let res = client\n` +
|
|
46
|
+
` .${operation.method.toLocaleLowerCase()}("${operation.path}")\n` +
|
|
47
|
+
` .header("Content-Type", "application/json")\n` +
|
|
48
|
+
` .send();\n` +
|
|
49
|
+
`}`);
|
|
50
|
+
default:
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=getCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCode.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/util/getCode.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,SAAkC,EAAE,MAAc,EAAE,EAAE;IAC5E,QAAQ,MAAM,EAA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M,CAAC,iBAAiB,EAAE,KAAK,SAAS,CAAC,IAAI,MAAM;gBACrE,mDAAmD;gBACnD,gBAAgB;gBAChB,GAAG,CACJ,CAAC;QACJ;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import * as urql from "urql";
|
|
3
|
+
export declare const useQuery: typeof urql.useQuery;
|
|
4
|
+
export declare const Provider: import("react").Provider<object | urql.Client>;
|
|
5
|
+
export declare const cacheExchange: urql.Exchange;
|
|
6
|
+
export declare const fetchExchange: urql.Exchange;
|
|
7
|
+
export declare const mapExchange: ({ onOperation, onResult, onError, }: urql.MapExchangeOpts) => urql.Exchange;
|
|
8
|
+
export declare const Client: new (opts: urql.ClientOptions) => urql.Client;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as urql from "urql";
|
|
2
|
+
export const useQuery = urql.useQuery;
|
|
3
|
+
export const Provider = urql.Provider;
|
|
4
|
+
export const cacheExchange = urql.cacheExchange;
|
|
5
|
+
export const fetchExchange = urql.fetchExchange;
|
|
6
|
+
export const mapExchange = urql.mapExchange;
|
|
7
|
+
export const Client = urql.Client;
|
|
8
|
+
//# sourceMappingURL=urql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urql.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/util/urql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { monotonicFactory } from "ulid";
|
|
2
|
+
import { createWaitForNotify } from "../../../util/createWaitForNotify.js";
|
|
3
|
+
import { cacheExchange, Client, fetchExchange, mapExchange, } from "../util/urql.js";
|
|
4
|
+
const ulid = monotonicFactory();
|
|
5
|
+
export const createSharedWorkerClient = () => {
|
|
6
|
+
const worker = new SharedWorker(new URL("./worker.ts", import.meta.url), {
|
|
7
|
+
type: "module",
|
|
8
|
+
});
|
|
9
|
+
worker.port.start();
|
|
10
|
+
const [waitFor, notify] = createWaitForNotify();
|
|
11
|
+
worker.port.onmessage = (e) => {
|
|
12
|
+
notify(e.data.id, e.data.body);
|
|
13
|
+
};
|
|
14
|
+
return new Client({
|
|
15
|
+
url: "/__z/graphql",
|
|
16
|
+
// Custom fetch to send the GraphQL request to the worker and convert the response back to a `Response` object
|
|
17
|
+
fetch: async (_req, init) => {
|
|
18
|
+
if (!init?.body)
|
|
19
|
+
throw new Error("No body");
|
|
20
|
+
const id = ulid();
|
|
21
|
+
worker.port.postMessage({
|
|
22
|
+
id,
|
|
23
|
+
body: init.body,
|
|
24
|
+
});
|
|
25
|
+
const body = await waitFor(id);
|
|
26
|
+
return new Response(body, {
|
|
27
|
+
headers: {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
exchanges: [
|
|
33
|
+
cacheExchange,
|
|
34
|
+
mapExchange({
|
|
35
|
+
onError(error, operation) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
console.groupCollapsed("Operation info");
|
|
38
|
+
console.log("body", operation.query.loc?.source.body.trim());
|
|
39
|
+
console.log("variables", operation.variables);
|
|
40
|
+
console.groupEnd();
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
fetchExchange,
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=createSharedWorkerClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSharedWorkerClient.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/worker/createSharedWorkerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,aAAa,EACb,MAAM,EACN,aAAa,EACb,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAIzB,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACvE,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAEpB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,mBAAmB,EAAU,CAAC;IAExD,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAqC,EAAE,EAAE;QAChE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,OAAO,IAAI,MAAM,CAAC;QAChB,GAAG,EAAE,cAAc;QACnB,8GAA8G;QAC9G,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YAC1B,IAAI,CAAC,IAAI,EAAE,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;YAE5C,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;gBACtB,EAAE;gBACF,IAAI,EAAE,IAAI,CAAC,IAAc;aACK,CAAC,CAAC;YAElC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,CAAC;YAE/B,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACxB,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC,CAAC;QACL,CAAC;QACD,SAAS,EAAE;YACT,aAAa;YACb,WAAW,CAAC;gBACV,OAAO,CAAC,KAAK,EAAE,SAAS;oBACtB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;oBACzC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC7D,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;oBAC9C,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACrB,CAAC;aACF,CAAC;YACF,aAAa;SACd;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createGraphQLServer } from "../../../oas/graphql/index.js";
|
|
2
|
+
const localServer = createGraphQLServer();
|
|
3
|
+
const worker = self;
|
|
4
|
+
worker.addEventListener("connect", function (event) {
|
|
5
|
+
const port = event.ports[0];
|
|
6
|
+
port.onmessage = async function (e) {
|
|
7
|
+
const response = await localServer.fetch(new Request("/__z/graphql", {
|
|
8
|
+
method: "POST",
|
|
9
|
+
body: e.data.body,
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
14
|
+
port.postMessage({
|
|
15
|
+
id: e.data.id,
|
|
16
|
+
body: await response.text(),
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../../../src/app/plugins/openapi/worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC;AAE1C,MAAM,MAAM,GAAG,IAA0C,CAAC;AAE1D,MAAM,CAAC,gBAAgB,CACrB,SAAS,EACT,UAAU,KAAiD;IACzD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE5B,IAAI,CAAC,SAAS,GAAG,KAAK,WAAW,CAAC;QAChC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI;YACjB,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC;YACf,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;SACG,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Navigate } from "react-router-dom";
|
|
3
|
+
export const redirectPlugin = (options) => {
|
|
4
|
+
return {
|
|
5
|
+
getRoutes: () => options.redirects.map(({ from, to, replace }) => ({
|
|
6
|
+
path: from,
|
|
7
|
+
element: _jsx(Navigate, { to: to, replace: replace }),
|
|
8
|
+
})),
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app/plugins/redirect/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAS5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAE9B,EAAmB,EAAE;IACpB,OAAO;QACL,SAAS,EAAE,GAAG,EAAE,CACd,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YAChD,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,KAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI;SAChD,CAAC,CAAC;KACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import typographyPlugin from "@tailwindcss/typography";
|
|
2
|
+
import defaultTheme from "tailwindcss/defaultTheme.js";
|
|
3
|
+
const content = [
|
|
4
|
+
"./src/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
5
|
+
"./node_modules/zudoku/dist/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
6
|
+
];
|
|
7
|
+
// ,
|
|
8
|
+
// if (process.env.NODE_ENV === "development") {
|
|
9
|
+
// content.push("../../plugins/*/src/**/*.{js,ts,jsx,tsx}");
|
|
10
|
+
// }
|
|
11
|
+
const config = {
|
|
12
|
+
darkMode: "selector",
|
|
13
|
+
content,
|
|
14
|
+
theme: {
|
|
15
|
+
extend: {
|
|
16
|
+
fontFamily: {
|
|
17
|
+
sans: [
|
|
18
|
+
["Geist", ...defaultTheme.fontFamily.sans],
|
|
19
|
+
{ fontFeatureSettings: '"rlig" 1, "calt" 0' },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
typography: () => ({
|
|
23
|
+
DEFAULT: {
|
|
24
|
+
css: {
|
|
25
|
+
blockquote: { quotes: "none" },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
colors: {
|
|
30
|
+
border: "hsl(var(--border))",
|
|
31
|
+
input: "hsl(var(--input))",
|
|
32
|
+
ring: "hsl(var(--ring))",
|
|
33
|
+
background: "hsl(var(--background))",
|
|
34
|
+
foreground: "hsl(var(--foreground))",
|
|
35
|
+
primary: {
|
|
36
|
+
DEFAULT: "hsl(var(--primary))",
|
|
37
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
38
|
+
},
|
|
39
|
+
secondary: {
|
|
40
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
41
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
42
|
+
},
|
|
43
|
+
destructive: {
|
|
44
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
45
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
46
|
+
},
|
|
47
|
+
muted: {
|
|
48
|
+
DEFAULT: "hsl(var(--muted))",
|
|
49
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
50
|
+
},
|
|
51
|
+
accent: {
|
|
52
|
+
DEFAULT: "hsl(var(--accent))",
|
|
53
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
54
|
+
},
|
|
55
|
+
popover: {
|
|
56
|
+
DEFAULT: "hsl(var(--popover))",
|
|
57
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
58
|
+
},
|
|
59
|
+
card: {
|
|
60
|
+
DEFAULT: "hsl(var(--card))",
|
|
61
|
+
foreground: "hsl(var(--card-foreground))",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
plugins: [typographyPlugin],
|
|
67
|
+
};
|
|
68
|
+
export default config;
|
|
69
|
+
//# sourceMappingURL=tailwind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.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E;oBACP,OAAO,EAAE,qBAAqB;oBAC9B,UAAU,EAAE,gCAAgC;iBAC7C;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,kBAAkB;oBAC3B,UAAU,EAAE,6BAA6B;iBAC1C;aACF;SACF;KACF;IACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;CAC5B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
declare const stylesMap: {
|
|
3
|
+
note: {
|
|
4
|
+
border: string;
|
|
5
|
+
bg: string;
|
|
6
|
+
iconColor: string;
|
|
7
|
+
titleColor: string;
|
|
8
|
+
textColor: string;
|
|
9
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
};
|
|
11
|
+
tip: {
|
|
12
|
+
border: string;
|
|
13
|
+
bg: string;
|
|
14
|
+
iconColor: string;
|
|
15
|
+
titleColor: string;
|
|
16
|
+
textColor: string;
|
|
17
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
18
|
+
};
|
|
19
|
+
info: {
|
|
20
|
+
border: string;
|
|
21
|
+
bg: string;
|
|
22
|
+
iconColor: string;
|
|
23
|
+
titleColor: string;
|
|
24
|
+
textColor: string;
|
|
25
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
26
|
+
};
|
|
27
|
+
caution: {
|
|
28
|
+
border: string;
|
|
29
|
+
bg: string;
|
|
30
|
+
iconColor: string;
|
|
31
|
+
titleColor: string;
|
|
32
|
+
textColor: string;
|
|
33
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
34
|
+
};
|
|
35
|
+
danger: {
|
|
36
|
+
border: string;
|
|
37
|
+
bg: string;
|
|
38
|
+
iconColor: string;
|
|
39
|
+
titleColor: string;
|
|
40
|
+
textColor: string;
|
|
41
|
+
Icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type CalloutProps = {
|
|
45
|
+
type: keyof typeof stylesMap;
|
|
46
|
+
title?: string;
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
className?: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const Callout: ({ type, children, title, className }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertTriangleIcon, InfoIcon, LightbulbIcon, ShieldAlertIcon, } from "../core/icons.js";
|
|
3
|
+
import { cn } from "../util/cn.js";
|
|
4
|
+
const stylesMap = {
|
|
5
|
+
note: {
|
|
6
|
+
border: "border-gray-300 dark:border-zinc-800",
|
|
7
|
+
bg: "bg-gray-100 dark:bg-zinc-800/50",
|
|
8
|
+
iconColor: "text-gray-600 dark:text-zinc-300",
|
|
9
|
+
titleColor: "text-gray-600 dark:text-zinc-300",
|
|
10
|
+
textColor: "text-gray-600 dark:text-zinc-300",
|
|
11
|
+
Icon: InfoIcon,
|
|
12
|
+
},
|
|
13
|
+
tip: {
|
|
14
|
+
border: "border-green-500 dark:border-green-800",
|
|
15
|
+
bg: "bg-green-200/25 dark:bg-green-950/70",
|
|
16
|
+
iconColor: "text-green-600 dark:text-green-200",
|
|
17
|
+
titleColor: "text-green-700 dark:text-green-200",
|
|
18
|
+
textColor: "text-green-600 dark:text-green-50",
|
|
19
|
+
Icon: LightbulbIcon,
|
|
20
|
+
},
|
|
21
|
+
info: {
|
|
22
|
+
border: "border-blue-400 dark:border-blue-900/60",
|
|
23
|
+
bg: "bg-blue-50 dark:bg-blue-950/40",
|
|
24
|
+
iconColor: "text-blue-400 dark:text-blue-200",
|
|
25
|
+
titleColor: "text-blue-700 dark:text-blue-200",
|
|
26
|
+
textColor: "text-blue-600 dark:text-blue-100",
|
|
27
|
+
Icon: InfoIcon,
|
|
28
|
+
},
|
|
29
|
+
caution: {
|
|
30
|
+
border: "border-yellow-400 dark:border-yellow-400/25",
|
|
31
|
+
bg: "bg-yellow-100/60 dark:bg-yellow-400/10",
|
|
32
|
+
iconColor: "text-yellow-500 dark:text-yellow-300",
|
|
33
|
+
titleColor: "text-yellow-600 dark:text-yellow-300",
|
|
34
|
+
textColor: "text-yellow-700 dark:text-yellow-200",
|
|
35
|
+
Icon: AlertTriangleIcon,
|
|
36
|
+
},
|
|
37
|
+
danger: {
|
|
38
|
+
border: "border-rose-400 dark:border-rose-800",
|
|
39
|
+
bg: "bg-rose-50 dark:bg-rose-950/40",
|
|
40
|
+
iconColor: "text-rose-400 dark:text-rose-300",
|
|
41
|
+
titleColor: "text-rose-800 dark:text-rose-300",
|
|
42
|
+
textColor: "text-rose-700 dark:text-rose-100",
|
|
43
|
+
Icon: ShieldAlertIcon,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export const Callout = ({ type, children, title, className }) => {
|
|
47
|
+
const { border, bg, iconColor, titleColor, textColor, Icon } = stylesMap[type];
|
|
48
|
+
return (_jsxs("div", { className: cn("not-prose grid grid-cols-[fit-content_1fr] grid-rows-[fit-content_1fr] gap-x-4 gap-y-2 text-md rounded-md border p-4", "[&_a]:underline [&_a]:decoration-current [&_a]:decoration-from-font [&_a]:underline-offset-4 hover:[&_a]:decoration-1", "[&_code]:!bg-transparent [&_code]:!border-none", title && "items-center", border, bg, className), children: [_jsx(Icon, { className: cn(!title && "mt-1 translate-y-px", iconColor), size: 20, "aria-hidden": "true" }), title && _jsx("h3", { className: cn("font-medium", titleColor), children: title }), _jsx("div", { className: cn("col-start-2", !title && "row-start-1", textColor), children: children })] }));
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=Callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.js","sourceRoot":"","sources":["../../../src/app/ui/Callout.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE;QACJ,MAAM,EAAE,sCAAsC;QAC9C,EAAE,EAAE,iCAAiC;QACrC,SAAS,EAAE,kCAAkC;QAC7C,UAAU,EAAE,kCAAkC;QAC9C,SAAS,EAAE,kCAAkC;QAC7C,IAAI,EAAE,QAAQ;KACf;IACD,GAAG,EAAE;QACH,MAAM,EAAE,wCAAwC;QAChD,EAAE,EAAE,sCAAsC;QAC1C,SAAS,EAAE,oCAAoC;QAC/C,UAAU,EAAE,oCAAoC;QAChD,SAAS,EAAE,mCAAmC;QAC9C,IAAI,EAAE,aAAa;KACpB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,yCAAyC;QACjD,EAAE,EAAE,gCAAgC;QACpC,SAAS,EAAE,kCAAkC;QAC7C,UAAU,EAAE,kCAAkC;QAC9C,SAAS,EAAE,kCAAkC;QAC7C,IAAI,EAAE,QAAQ;KACf;IACD,OAAO,EAAE;QACP,MAAM,EAAE,6CAA6C;QACrD,EAAE,EAAE,wCAAwC;QAC5C,SAAS,EAAE,sCAAsC;QACjD,UAAU,EAAE,sCAAsC;QAClD,SAAS,EAAE,sCAAsC;QACjD,IAAI,EAAE,iBAAiB;KACxB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,sCAAsC;QAC9C,EAAE,EAAE,gCAAgC;QACpC,SAAS,EAAE,kCAAkC;QAC7C,UAAU,EAAE,kCAAkC;QAC9C,SAAS,EAAE,kCAAkC;QAC7C,IAAI,EAAE,eAAe;KACtB;CACF,CAAC;AASF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAgB,EAAE,EAAE;IAC5E,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,GAC1D,SAAS,CAAC,IAAI,CAAC,CAAC;IAElB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,sHAAsH,EACtH,uHAAuH,EACvH,gDAAgD,EAChD,KAAK,IAAI,cAAc,EACvB,MAAM,EACN,EAAE,EACF,SAAS,CACV,aAED,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,qBAAqB,EAAE,SAAS,CAAC,EACzD,IAAI,EAAE,EAAE,iBACI,MAAM,GAClB,EACD,KAAK,IAAI,aAAI,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,YAAG,KAAK,GAAM,EACpE,cAAK,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,IAAI,aAAa,EAAE,SAAS,CAAC,YAClE,QAAQ,GACL,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../util/cn.js";
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow", className), ...props })));
|
|
5
|
+
Card.displayName = "Card";
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
7
|
+
CardHeader.displayName = "CardHeader";
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h3", { ref: ref, className: cn("font-semibold leading-none tracking-tight", className), ...props })));
|
|
9
|
+
CardTitle.displayName = "CardTitle";
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("p", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
11
|
+
CardDescription.displayName = "CardDescription";
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
|
|
13
|
+
CardContent.displayName = "CardContent";
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
|
|
15
|
+
CardFooter.displayName = "CardFooter";
|
|
16
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, };
|
|
17
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,CAAC;AACH,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACnE,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAGjC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,KAClD,KAAK,GACT,CACH,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Note: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const NoteTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const NoteDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Note, NoteDescription, NoteTitle };
|