jamdesk 1.0.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/LICENSE +21 -0
- package/README.md +323 -0
- package/bin/jamdesk.js +76 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.d.ts +8 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.js +165 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.js.map +1 -0
- package/dist/__tests__/integration/migrate.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/migrate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/migrate.integration.test.js +64 -0
- package/dist/__tests__/integration/migrate.integration.test.js.map +1 -0
- package/dist/__tests__/integration/prepublish.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/prepublish.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/prepublish.integration.test.js +27 -0
- package/dist/__tests__/integration/prepublish.integration.test.js.map +1 -0
- package/dist/__tests__/integration/validate.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/validate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/validate.integration.test.js +56 -0
- package/dist/__tests__/integration/validate.integration.test.js.map +1 -0
- package/dist/__tests__/unit/deploy-templates.test.d.ts +2 -0
- package/dist/__tests__/unit/deploy-templates.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deploy-templates.test.js +124 -0
- package/dist/__tests__/unit/deploy-templates.test.js.map +1 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.d.ts +2 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.js +69 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.js.map +1 -0
- package/dist/__tests__/unit/deps-sync.test.d.ts +14 -0
- package/dist/__tests__/unit/deps-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deps-sync.test.js +166 -0
- package/dist/__tests__/unit/deps-sync.test.js.map +1 -0
- package/dist/__tests__/unit/docs-config.test.d.ts +2 -0
- package/dist/__tests__/unit/docs-config.test.d.ts.map +1 -0
- package/dist/__tests__/unit/docs-config.test.js +288 -0
- package/dist/__tests__/unit/docs-config.test.js.map +1 -0
- package/dist/__tests__/unit/errors.test.d.ts +2 -0
- package/dist/__tests__/unit/errors.test.d.ts.map +1 -0
- package/dist/__tests__/unit/errors.test.js +27 -0
- package/dist/__tests__/unit/errors.test.js.map +1 -0
- package/dist/__tests__/unit/extract-hooks.test.d.ts +5 -0
- package/dist/__tests__/unit/extract-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/unit/extract-hooks.test.js +205 -0
- package/dist/__tests__/unit/extract-hooks.test.js.map +1 -0
- package/dist/__tests__/unit/frontmatter-sync.test.d.ts +8 -0
- package/dist/__tests__/unit/frontmatter-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/frontmatter-sync.test.js +26 -0
- package/dist/__tests__/unit/frontmatter-sync.test.js.map +1 -0
- package/dist/__tests__/unit/mdx-validator.test.d.ts +2 -0
- package/dist/__tests__/unit/mdx-validator.test.d.ts.map +1 -0
- package/dist/__tests__/unit/mdx-validator.test.js +264 -0
- package/dist/__tests__/unit/mdx-validator.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-convert.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-convert.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-convert.test.js +297 -0
- package/dist/__tests__/unit/migrate-convert.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-detect.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-detect.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-detect.test.js +35 -0
- package/dist/__tests__/unit/migrate-detect.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-mdx.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-mdx.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-mdx.test.js +158 -0
- package/dist/__tests__/unit/migrate-mdx.test.js.map +1 -0
- package/dist/__tests__/unit/openapi.test.d.ts +2 -0
- package/dist/__tests__/unit/openapi.test.d.ts.map +1 -0
- package/dist/__tests__/unit/openapi.test.js +52 -0
- package/dist/__tests__/unit/openapi.test.js.map +1 -0
- package/dist/__tests__/unit/package-config.test.d.ts +2 -0
- package/dist/__tests__/unit/package-config.test.d.ts.map +1 -0
- package/dist/__tests__/unit/package-config.test.js +63 -0
- package/dist/__tests__/unit/package-config.test.js.map +1 -0
- package/dist/__tests__/unit/port.test.d.ts +2 -0
- package/dist/__tests__/unit/port.test.d.ts.map +1 -0
- package/dist/__tests__/unit/port.test.js +20 -0
- package/dist/__tests__/unit/port.test.js.map +1 -0
- package/dist/__tests__/unit/vendored-sync.test.d.ts +14 -0
- package/dist/__tests__/unit/vendored-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/vendored-sync.test.js +90 -0
- package/dist/__tests__/unit/vendored-sync.test.js.map +1 -0
- package/dist/commands/broken-links.d.ts +11 -0
- package/dist/commands/broken-links.d.ts.map +1 -0
- package/dist/commands/broken-links.js +95 -0
- package/dist/commands/broken-links.js.map +1 -0
- package/dist/commands/clean.d.ts +7 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +59 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/deploy/cloudflare.d.ts +12 -0
- package/dist/commands/deploy/cloudflare.d.ts.map +1 -0
- package/dist/commands/deploy/cloudflare.js +409 -0
- package/dist/commands/deploy/cloudflare.js.map +1 -0
- package/dist/commands/deploy/templates.d.ts +23 -0
- package/dist/commands/deploy/templates.d.ts.map +1 -0
- package/dist/commands/deploy/templates.js +179 -0
- package/dist/commands/deploy/templates.js.map +1 -0
- package/dist/commands/deploy/types.d.ts +19 -0
- package/dist/commands/deploy/types.d.ts.map +1 -0
- package/dist/commands/deploy/types.js +5 -0
- package/dist/commands/deploy/types.js.map +1 -0
- package/dist/commands/dev.d.ts +14 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +817 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +159 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +96 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/migrate/convert-mdx.d.ts +50 -0
- package/dist/commands/migrate/convert-mdx.d.ts.map +1 -0
- package/dist/commands/migrate/convert-mdx.js +108 -0
- package/dist/commands/migrate/convert-mdx.js.map +1 -0
- package/dist/commands/migrate/convert.d.ts +80 -0
- package/dist/commands/migrate/convert.d.ts.map +1 -0
- package/dist/commands/migrate/convert.js +158 -0
- package/dist/commands/migrate/convert.js.map +1 -0
- package/dist/commands/migrate/detect.d.ts +31 -0
- package/dist/commands/migrate/detect.d.ts.map +1 -0
- package/dist/commands/migrate/detect.js +62 -0
- package/dist/commands/migrate/detect.js.map +1 -0
- package/dist/commands/migrate/extract-hooks.d.ts +71 -0
- package/dist/commands/migrate/extract-hooks.d.ts.map +1 -0
- package/dist/commands/migrate/extract-hooks.js +473 -0
- package/dist/commands/migrate/extract-hooks.js.map +1 -0
- package/dist/commands/migrate/index.d.ts +17 -0
- package/dist/commands/migrate/index.d.ts.map +1 -0
- package/dist/commands/migrate/index.js +282 -0
- package/dist/commands/migrate/index.js.map +1 -0
- package/dist/commands/migrate/prompts.d.ts +22 -0
- package/dist/commands/migrate/prompts.d.ts.map +1 -0
- package/dist/commands/migrate/prompts.js +67 -0
- package/dist/commands/migrate/prompts.js.map +1 -0
- package/dist/commands/migrate/types.d.ts +22 -0
- package/dist/commands/migrate/types.d.ts.map +1 -0
- package/dist/commands/migrate/types.js +26 -0
- package/dist/commands/migrate/types.js.map +1 -0
- package/dist/commands/openapi-check.d.ts +11 -0
- package/dist/commands/openapi-check.d.ts.map +1 -0
- package/dist/commands/openapi-check.js +88 -0
- package/dist/commands/openapi-check.js.map +1 -0
- package/dist/commands/rename.d.ts +10 -0
- package/dist/commands/rename.d.ts.map +1 -0
- package/dist/commands/rename.js +125 -0
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/update.d.ts +10 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +57 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +12 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +163 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +18 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/deprecated-components.d.ts +72 -0
- package/dist/lib/deprecated-components.d.ts.map +1 -0
- package/dist/lib/deprecated-components.js +138 -0
- package/dist/lib/deprecated-components.js.map +1 -0
- package/dist/lib/deps.d.ts +17 -0
- package/dist/lib/deps.d.ts.map +1 -0
- package/dist/lib/deps.js +186 -0
- package/dist/lib/deps.js.map +1 -0
- package/dist/lib/docs-config.d.ts +67 -0
- package/dist/lib/docs-config.d.ts.map +1 -0
- package/dist/lib/docs-config.js +294 -0
- package/dist/lib/docs-config.js.map +1 -0
- package/dist/lib/errors.d.ts +23 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +32 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/frontmatter-utils.d.ts +25 -0
- package/dist/lib/frontmatter-utils.d.ts.map +1 -0
- package/dist/lib/frontmatter-utils.js +64 -0
- package/dist/lib/frontmatter-utils.js.map +1 -0
- package/dist/lib/mdx-validator.d.ts +27 -0
- package/dist/lib/mdx-validator.d.ts.map +1 -0
- package/dist/lib/mdx-validator.js +148 -0
- package/dist/lib/mdx-validator.js.map +1 -0
- package/dist/lib/navigation-validator.d.ts +31 -0
- package/dist/lib/navigation-validator.d.ts.map +1 -0
- package/dist/lib/navigation-validator.js +75 -0
- package/dist/lib/navigation-validator.js.map +1 -0
- package/dist/lib/normalize-config.d.ts +57 -0
- package/dist/lib/normalize-config.d.ts.map +1 -0
- package/dist/lib/normalize-config.js +63 -0
- package/dist/lib/normalize-config.js.map +1 -0
- package/dist/lib/openapi/cache.d.ts +40 -0
- package/dist/lib/openapi/cache.d.ts.map +1 -0
- package/dist/lib/openapi/cache.js +76 -0
- package/dist/lib/openapi/cache.js.map +1 -0
- package/dist/lib/openapi/errors.d.ts +36 -0
- package/dist/lib/openapi/errors.d.ts.map +1 -0
- package/dist/lib/openapi/errors.js +162 -0
- package/dist/lib/openapi/errors.js.map +1 -0
- package/dist/lib/openapi/index.d.ts +10 -0
- package/dist/lib/openapi/index.d.ts.map +1 -0
- package/dist/lib/openapi/index.js +12 -0
- package/dist/lib/openapi/index.js.map +1 -0
- package/dist/lib/openapi/types.d.ts +198 -0
- package/dist/lib/openapi/types.d.ts.map +1 -0
- package/dist/lib/openapi/types.js +8 -0
- package/dist/lib/openapi/types.js.map +1 -0
- package/dist/lib/openapi/validator.d.ts +45 -0
- package/dist/lib/openapi/validator.d.ts.map +1 -0
- package/dist/lib/openapi/validator.js +128 -0
- package/dist/lib/openapi/validator.js.map +1 -0
- package/dist/lib/openapi.d.ts +7 -0
- package/dist/lib/openapi.d.ts.map +1 -0
- package/dist/lib/openapi.js +7 -0
- package/dist/lib/openapi.js.map +1 -0
- package/dist/lib/output.d.ts +14 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +19 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/path-security.d.ts +23 -0
- package/dist/lib/path-security.d.ts.map +1 -0
- package/dist/lib/path-security.js +35 -0
- package/dist/lib/path-security.js.map +1 -0
- package/dist/lib/port.d.ts +18 -0
- package/dist/lib/port.d.ts.map +1 -0
- package/dist/lib/port.js +65 -0
- package/dist/lib/port.js.map +1 -0
- package/dist/lib/spinner.d.ts +4 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +16 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +49 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/utils/update-checker.d.ts +34 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +142 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/package.json +125 -0
- package/templates/docs.json +11 -0
- package/templates/introduction.mdx +19 -0
- package/templates/quickstart.mdx +20 -0
- package/vendored/app/[[...slug]]/error.tsx +103 -0
- package/vendored/app/[[...slug]]/page.tsx +690 -0
- package/vendored/app/api/assets/[...path]/route.ts +78 -0
- package/vendored/app/api/ev/route.ts +61 -0
- package/vendored/app/api/isr-health/route.ts +66 -0
- package/vendored/app/api/mcp/[project]/route.ts +435 -0
- package/vendored/app/api/og/route.tsx +167 -0
- package/vendored/app/api/r2/[project]/[...path]/route.ts +214 -0
- package/vendored/app/api/revalidate/route.ts +76 -0
- package/vendored/app/globals.css +37 -0
- package/vendored/app/layout.tsx +571 -0
- package/vendored/app/not-found.tsx +47 -0
- package/vendored/components/CodeBlockCopyButton.tsx +146 -0
- package/vendored/components/HeaderLinkCopy.tsx +135 -0
- package/vendored/components/errors/NotFoundContent.tsx +147 -0
- package/vendored/components/layout/LayoutWrapper.tsx +128 -0
- package/vendored/components/mdx/Accordion.tsx +91 -0
- package/vendored/components/mdx/ApiCodePanel.tsx +51 -0
- package/vendored/components/mdx/ApiEndpoint.tsx +104 -0
- package/vendored/components/mdx/ApiPage.tsx +379 -0
- package/vendored/components/mdx/Badge.tsx +169 -0
- package/vendored/components/mdx/Callouts.tsx +140 -0
- package/vendored/components/mdx/Card.tsx +214 -0
- package/vendored/components/mdx/CodeGroup.tsx +136 -0
- package/vendored/components/mdx/Color.tsx +244 -0
- package/vendored/components/mdx/Columns.tsx +37 -0
- package/vendored/components/mdx/Expandable.tsx +37 -0
- package/vendored/components/mdx/Frame.tsx +51 -0
- package/vendored/components/mdx/Icon.tsx +132 -0
- package/vendored/components/mdx/Latex.tsx +75 -0
- package/vendored/components/mdx/MDXComponents.tsx +414 -0
- package/vendored/components/mdx/Mermaid.tsx +35 -0
- package/vendored/components/mdx/MermaidInner.tsx +342 -0
- package/vendored/components/mdx/OpenApiEndpoint.tsx +971 -0
- package/vendored/components/mdx/Panel.tsx +26 -0
- package/vendored/components/mdx/PanelWrapper.tsx +100 -0
- package/vendored/components/mdx/ParamField.tsx +75 -0
- package/vendored/components/mdx/RequestExample.tsx +91 -0
- package/vendored/components/mdx/ResponseExample.tsx +145 -0
- package/vendored/components/mdx/ResponseField.tsx +109 -0
- package/vendored/components/mdx/Steps.tsx +173 -0
- package/vendored/components/mdx/Table.tsx +352 -0
- package/vendored/components/mdx/Tabs.tsx +147 -0
- package/vendored/components/mdx/Tile.tsx +127 -0
- package/vendored/components/mdx/Tooltip.tsx +111 -0
- package/vendored/components/mdx/Tree.tsx +484 -0
- package/vendored/components/mdx/Update.tsx +90 -0
- package/vendored/components/mdx/View.tsx +354 -0
- package/vendored/components/mdx/YouTube.tsx +35 -0
- package/vendored/components/mdx/ZoomableImage.tsx +83 -0
- package/vendored/components/navigation/Breadcrumb.tsx +241 -0
- package/vendored/components/navigation/DefaultLogo.tsx +81 -0
- package/vendored/components/navigation/Header.tsx +512 -0
- package/vendored/components/navigation/LanguageSelector.tsx +249 -0
- package/vendored/components/navigation/PageNavigation.tsx +174 -0
- package/vendored/components/navigation/Sidebar.tsx +713 -0
- package/vendored/components/navigation/SocialFooter.tsx +186 -0
- package/vendored/components/navigation/TableOfContents.tsx +435 -0
- package/vendored/components/navigation/TabsNav.tsx +182 -0
- package/vendored/components/search/LazySearchModal.tsx +19 -0
- package/vendored/components/search/SearchModal.tsx +573 -0
- package/vendored/components/snippets/ProjectSnippets.tsx +4 -0
- package/vendored/components/theme/ThemeProvider.tsx +31 -0
- package/vendored/components/theme/ThemeToggle.tsx +134 -0
- package/vendored/components/ui/CodePanel.tsx +517 -0
- package/vendored/components/ui/CodePanelModal.tsx +342 -0
- package/vendored/contexts/TabSyncContext.tsx +30 -0
- package/vendored/hooks/useFocusTrap.ts +42 -0
- package/vendored/hooks/useHashNavigation.ts +39 -0
- package/vendored/hooks/useShikiHighlight.ts +101 -0
- package/vendored/lib/analytics-client.ts +77 -0
- package/vendored/lib/build/cache.ts +138 -0
- package/vendored/lib/build/error-parser.ts +690 -0
- package/vendored/lib/build/estimation.ts +113 -0
- package/vendored/lib/build/index.ts +17 -0
- package/vendored/lib/build/page-file-map.ts +48 -0
- package/vendored/lib/build/r2-upload.ts +179 -0
- package/vendored/lib/cache-keys.ts +117 -0
- package/vendored/lib/code-utils.ts +42 -0
- package/vendored/lib/content-loader.ts +176 -0
- package/vendored/lib/deprecated-components.ts +185 -0
- package/vendored/lib/docs-isr.ts +180 -0
- package/vendored/lib/docs-types.ts +874 -0
- package/vendored/lib/docs.ts +203 -0
- package/vendored/lib/domain-helpers.ts +107 -0
- package/vendored/lib/email-notifier.ts +102 -0
- package/vendored/lib/email-templates/build-failure.tsx +193 -0
- package/vendored/lib/email-templates/components/base-layout.tsx +150 -0
- package/vendored/lib/email-templates/components/error-box.tsx +88 -0
- package/vendored/lib/email-templates/components/info-row.tsx +63 -0
- package/vendored/lib/email-templates/index.ts +13 -0
- package/vendored/lib/empty-polyfill.js +3 -0
- package/vendored/lib/extract-highlights.ts +124 -0
- package/vendored/lib/fonts.ts +227 -0
- package/vendored/lib/frontmatter-utils.ts +77 -0
- package/vendored/lib/fs-utils.ts +20 -0
- package/vendored/lib/git-utils.ts +87 -0
- package/vendored/lib/health-checks.ts +224 -0
- package/vendored/lib/icon-utils.ts +492 -0
- package/vendored/lib/infer-page-type.ts +14 -0
- package/vendored/lib/isr-build-executor.ts +185 -0
- package/vendored/lib/language-icons.ts +152 -0
- package/vendored/lib/language-utils.ts +338 -0
- package/vendored/lib/latex-config.ts +64 -0
- package/vendored/lib/link-prefix-context.tsx +32 -0
- package/vendored/lib/logger.ts +63 -0
- package/vendored/lib/mcp-search.ts +255 -0
- package/vendored/lib/mdx-inline-components.ts +155 -0
- package/vendored/lib/mdx.ts +100 -0
- package/vendored/lib/middleware-helpers.ts +519 -0
- package/vendored/lib/navigation-resolver.ts +621 -0
- package/vendored/lib/navigation-utils.ts +103 -0
- package/vendored/lib/normalize-config.ts +94 -0
- package/vendored/lib/openapi/cache.ts +92 -0
- package/vendored/lib/openapi/code-examples.ts +389 -0
- package/vendored/lib/openapi/errors.ts +253 -0
- package/vendored/lib/openapi/generator.ts +230 -0
- package/vendored/lib/openapi/index.ts +84 -0
- package/vendored/lib/openapi/parser.ts +474 -0
- package/vendored/lib/openapi/types.ts +232 -0
- package/vendored/lib/openapi/validator.ts +156 -0
- package/vendored/lib/openapi-isr.ts +121 -0
- package/vendored/lib/page-isr-helpers.ts +137 -0
- package/vendored/lib/path-safety.ts +130 -0
- package/vendored/lib/paths.ts +35 -0
- package/vendored/lib/preprocess-mdx.ts +951 -0
- package/vendored/lib/process-mdx-with-exports.ts +75 -0
- package/vendored/lib/project-resolver.ts +165 -0
- package/vendored/lib/r2-content.ts +60 -0
- package/vendored/lib/r2-manifest.ts +84 -0
- package/vendored/lib/recent-searches.ts +41 -0
- package/vendored/lib/recma-compound-components.ts +84 -0
- package/vendored/lib/redirect-compiler.ts +160 -0
- package/vendored/lib/redirect-matcher.ts +296 -0
- package/vendored/lib/redis.ts +23 -0
- package/vendored/lib/rehype-class-to-classname.ts +31 -0
- package/vendored/lib/rehype-code-meta.ts +275 -0
- package/vendored/lib/rehype-nozoom-to-data.ts +45 -0
- package/vendored/lib/remark-extract-exports.ts +104 -0
- package/vendored/lib/resilience.ts +260 -0
- package/vendored/lib/revalidation-helpers.ts +200 -0
- package/vendored/lib/revalidation-trigger.ts +150 -0
- package/vendored/lib/screenshot-capture.ts +229 -0
- package/vendored/lib/search-client.ts +91 -0
- package/vendored/lib/search-suggestions.ts +38 -0
- package/vendored/lib/search.ts +158 -0
- package/vendored/lib/seo.ts +264 -0
- package/vendored/lib/shiki-client.ts +131 -0
- package/vendored/lib/shiki-config.ts +289 -0
- package/vendored/lib/shiki-css-theme.ts +46 -0
- package/vendored/lib/shiki-highlighter.ts +62 -0
- package/vendored/lib/shiki-transformers.ts +337 -0
- package/vendored/lib/slack-notifier.ts +248 -0
- package/vendored/lib/snippet-compiler-isr.ts +114 -0
- package/vendored/lib/snippet-loader-isr.ts +276 -0
- package/vendored/lib/static-artifacts.ts +375 -0
- package/vendored/lib/static-file-route.ts +72 -0
- package/vendored/lib/tracking-script.ts +19 -0
- package/vendored/lib/typography-config.ts +42 -0
- package/vendored/lib/validate-config.ts +268 -0
- package/vendored/next.config.js +45 -0
- package/vendored/postcss.config.js +6 -0
- package/vendored/schema/README.md +28 -0
- package/vendored/schema/docs-schema.json +4631 -0
- package/vendored/scripts/build-project.cjs +174 -0
- package/vendored/scripts/build-search-index.cjs +347 -0
- package/vendored/scripts/compile-snippets.cjs +488 -0
- package/vendored/scripts/copy-files.cjs +295 -0
- package/vendored/scripts/dev-project.cjs +534 -0
- package/vendored/scripts/enhance-navigation.cjs +354 -0
- package/vendored/scripts/validate-links.cjs +423 -0
- package/vendored/shared/constants.ts +6 -0
- package/vendored/shared/index.ts +19 -0
- package/vendored/shared/logger.ts +62 -0
- package/vendored/shared/memory-monitor.ts +190 -0
- package/vendored/shared/navigation-validator.ts +101 -0
- package/vendored/shared/path-security.ts +39 -0
- package/vendored/shared/status-reporter.ts +199 -0
- package/vendored/shared/timer.ts +51 -0
- package/vendored/shared/types.ts +102 -0
- package/vendored/tailwind.config.ts +39 -0
- package/vendored/themes/base.css +1311 -0
- package/vendored/themes/index.ts +119 -0
- package/vendored/themes/jam/variables.css +835 -0
- package/vendored/themes/nebula/variables.css +282 -0
- package/vendored/themes/pulsar/variables.css +1009 -0
- package/vendored/themes/types.ts +89 -0
- package/vendored/tsconfig.json +48 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { isValidElement, type ReactNode } from 'react';
|
|
2
|
+
import { Card } from './Card';
|
|
3
|
+
import { Note, Info, Warning, Tip, Check, Danger, Callout } from './Callouts';
|
|
4
|
+
import { Accordion, AccordionGroup } from './Accordion';
|
|
5
|
+
import { CodeGroup } from './CodeGroup';
|
|
6
|
+
import { Steps, Step } from './Steps';
|
|
7
|
+
import { ParamField } from './ParamField';
|
|
8
|
+
import { ResponseField } from './ResponseField';
|
|
9
|
+
import { RequestExample } from './RequestExample';
|
|
10
|
+
import { ResponseExample } from './ResponseExample';
|
|
11
|
+
import { ApiEndpoint, HttpMethodBadge } from './ApiEndpoint';
|
|
12
|
+
import { ApiCodePanel, ApiPageLayout } from './ApiCodePanel';
|
|
13
|
+
import { OpenApiEndpoint } from './OpenApiEndpoint';
|
|
14
|
+
import { ZoomableImage } from './ZoomableImage';
|
|
15
|
+
import { Icon } from './Icon';
|
|
16
|
+
import { Expandable } from './Expandable';
|
|
17
|
+
import { Frame } from './Frame';
|
|
18
|
+
import { Update } from './Update';
|
|
19
|
+
import { Tabs, Tab } from './Tabs';
|
|
20
|
+
import { Table, Row, Cell } from './Table';
|
|
21
|
+
import { CodePanel } from '../ui/CodePanel';
|
|
22
|
+
import { Latex } from './Latex';
|
|
23
|
+
import { Tooltip } from './Tooltip';
|
|
24
|
+
import { Mermaid } from './Mermaid';
|
|
25
|
+
import { Badge } from './Badge';
|
|
26
|
+
import { Color, ColorItem, ColorRow } from './Color';
|
|
27
|
+
import { Panel } from './Panel';
|
|
28
|
+
import { Tile } from './Tile';
|
|
29
|
+
import { Tree, TreeFolder, TreeFile } from './Tree';
|
|
30
|
+
import { Columns } from './Columns';
|
|
31
|
+
import { View, ViewProvider, ViewSelector, ViewWrapper } from './View';
|
|
32
|
+
import { YouTube } from './YouTube';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Extract language from a pre element for tab label
|
|
36
|
+
*
|
|
37
|
+
* Priority order:
|
|
38
|
+
* 1. data-language attribute on pre (set by Shiki transformer)
|
|
39
|
+
* 2. language-* class on code element (standard markdown)
|
|
40
|
+
* 3. language-* class on pre element (fallback for edge cases)
|
|
41
|
+
*/
|
|
42
|
+
function getCodeLanguage(preProps: any, children: ReactNode): string {
|
|
43
|
+
// Check data-language on pre element (added by Shiki transformer)
|
|
44
|
+
if (preProps['data-language']) {
|
|
45
|
+
return preProps['data-language'];
|
|
46
|
+
}
|
|
47
|
+
// Check code element's className for language-* class
|
|
48
|
+
if (isValidElement(children)) {
|
|
49
|
+
const codeProps = children.props as any;
|
|
50
|
+
const className = codeProps?.className || '';
|
|
51
|
+
const match = className.match(/language-(\w+)/);
|
|
52
|
+
if (match) return match[1];
|
|
53
|
+
}
|
|
54
|
+
// Fallback: check pre element className (defensive for edge cases)
|
|
55
|
+
const preClassName = preProps?.className || '';
|
|
56
|
+
const preMatch = preClassName.match(/language-(\w+)/);
|
|
57
|
+
if (preMatch) return preMatch[1];
|
|
58
|
+
|
|
59
|
+
return 'Code';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Extract text content from React children (handles Shiki-rendered code)
|
|
64
|
+
*/
|
|
65
|
+
function extractTextFromChildren(children: ReactNode): string {
|
|
66
|
+
if (typeof children === 'string') return children;
|
|
67
|
+
if (typeof children === 'number') return String(children);
|
|
68
|
+
if (!children) return '';
|
|
69
|
+
|
|
70
|
+
if (isValidElement(children)) {
|
|
71
|
+
const props = children.props as any;
|
|
72
|
+
return extractTextFromChildren(props?.children);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (Array.isArray(children)) {
|
|
76
|
+
return children.map(extractTextFromChildren).join('');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return '';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Parse HTTP request from code block text
|
|
84
|
+
* Supports: "GET https://api.example.com/path" or "POST /api/endpoint"
|
|
85
|
+
*/
|
|
86
|
+
function parseHttpRequest(text: string): { method: string; url: string } | null {
|
|
87
|
+
const trimmed = text.trim();
|
|
88
|
+
// Match: METHOD URL (e.g., "GET https://api.example.com/users/:id")
|
|
89
|
+
const match = trimmed.match(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE)\s+(.+)$/i);
|
|
90
|
+
if (match) {
|
|
91
|
+
return {
|
|
92
|
+
method: match[1].toUpperCase(),
|
|
93
|
+
url: match[2].trim(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* HTTP method colors for badges
|
|
101
|
+
*/
|
|
102
|
+
const httpMethodColors: Record<string, { bg: string; text: string }> = {
|
|
103
|
+
GET: { bg: 'bg-emerald-500/10', text: 'text-emerald-500' },
|
|
104
|
+
POST: { bg: 'bg-blue-500/10', text: 'text-blue-500' },
|
|
105
|
+
PUT: { bg: 'bg-amber-500/10', text: 'text-amber-500' },
|
|
106
|
+
PATCH: { bg: 'bg-orange-500/10', text: 'text-orange-500' },
|
|
107
|
+
DELETE: { bg: 'bg-red-500/10', text: 'text-red-500' },
|
|
108
|
+
HEAD: { bg: 'bg-purple-500/10', text: 'text-purple-500' },
|
|
109
|
+
OPTIONS: { bg: 'bg-gray-500/10', text: 'text-gray-500' },
|
|
110
|
+
TRACE: { bg: 'bg-gray-500/10', text: 'text-gray-500' },
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* HTTP Code Block Component (Server-renderable)
|
|
115
|
+
* Renders HTTP requests with a bordered card, method badge, and URL
|
|
116
|
+
* Uses data attributes for client-side copy functionality
|
|
117
|
+
*/
|
|
118
|
+
function HttpCodeBlock({ method, url }: { method: string; url: string }) {
|
|
119
|
+
const colors = httpMethodColors[method] || httpMethodColors.GET;
|
|
120
|
+
const fullText = `${method} ${url}`;
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div
|
|
124
|
+
className="flex items-center gap-3 px-4 py-3 rounded-lg border border-[var(--color-border)] bg-white my-4 not-prose http-code-block"
|
|
125
|
+
data-copy-text={fullText}
|
|
126
|
+
>
|
|
127
|
+
{/* Method badge */}
|
|
128
|
+
<span className={`px-2 py-0.5 text-xs font-bold rounded ${colors.bg} ${colors.text}`}>
|
|
129
|
+
{method}
|
|
130
|
+
</span>
|
|
131
|
+
{/* URL in monospace */}
|
|
132
|
+
<span
|
|
133
|
+
className="text-sm text-[var(--color-text-primary)] flex-1 overflow-x-auto whitespace-nowrap"
|
|
134
|
+
style={{ fontFamily: 'var(--font-mono, ui-monospace, monospace)' }}
|
|
135
|
+
>
|
|
136
|
+
{url}
|
|
137
|
+
</span>
|
|
138
|
+
{/* Copy button - functionality added via client-side script */}
|
|
139
|
+
<button
|
|
140
|
+
className="http-copy-btn p-1.5 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-bg-secondary)] rounded-md transition-colors flex-shrink-0"
|
|
141
|
+
title="Copy"
|
|
142
|
+
type="button"
|
|
143
|
+
>
|
|
144
|
+
<i className="fa-regular fa-copy text-sm" aria-hidden="true" />
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const MDXComponents = {
|
|
151
|
+
Card,
|
|
152
|
+
// Callout components
|
|
153
|
+
Note,
|
|
154
|
+
Info,
|
|
155
|
+
Warning,
|
|
156
|
+
Tip,
|
|
157
|
+
Check,
|
|
158
|
+
Danger,
|
|
159
|
+
Callout,
|
|
160
|
+
// Accordion components
|
|
161
|
+
Accordion,
|
|
162
|
+
AccordionGroup,
|
|
163
|
+
CodeGroup,
|
|
164
|
+
Steps,
|
|
165
|
+
Step,
|
|
166
|
+
ParamField,
|
|
167
|
+
ResponseField,
|
|
168
|
+
RequestExample,
|
|
169
|
+
ResponseExample,
|
|
170
|
+
ApiEndpoint,
|
|
171
|
+
HttpMethodBadge,
|
|
172
|
+
ApiCodePanel,
|
|
173
|
+
ApiPageLayout,
|
|
174
|
+
// OpenAPI endpoint renderer
|
|
175
|
+
OpenApiEndpoint,
|
|
176
|
+
// Icon component for inline icons
|
|
177
|
+
Icon,
|
|
178
|
+
// Expandable/collapsible section
|
|
179
|
+
Expandable,
|
|
180
|
+
// Frame for images/content
|
|
181
|
+
Frame,
|
|
182
|
+
// Update for changelog entries
|
|
183
|
+
Update,
|
|
184
|
+
// Tabs for organizing content
|
|
185
|
+
Tabs,
|
|
186
|
+
Tab,
|
|
187
|
+
// Table components for structured data
|
|
188
|
+
Table,
|
|
189
|
+
Row,
|
|
190
|
+
Cell,
|
|
191
|
+
// LaTeX math rendering
|
|
192
|
+
Latex,
|
|
193
|
+
// Tooltip for contextual definitions
|
|
194
|
+
Tooltip,
|
|
195
|
+
// Mermaid diagrams
|
|
196
|
+
Mermaid,
|
|
197
|
+
// Badge component for labels and status indicators
|
|
198
|
+
Badge,
|
|
199
|
+
// Color palette display (supports Color.Item syntax via recma-compound-components)
|
|
200
|
+
Color,
|
|
201
|
+
ColorItem,
|
|
202
|
+
ColorRow,
|
|
203
|
+
// Panel component for custom sidebar content (replaces Table of Contents)
|
|
204
|
+
Panel,
|
|
205
|
+
// Tile component for visual preview cards with pattern backgrounds
|
|
206
|
+
Tile,
|
|
207
|
+
// Tree file/folder hierarchy (supports Tree.Folder syntax via recma-compound-components)
|
|
208
|
+
Tree,
|
|
209
|
+
TreeFolder,
|
|
210
|
+
TreeFile,
|
|
211
|
+
// Columns layout component for responsive grids
|
|
212
|
+
Columns,
|
|
213
|
+
// View components for multi-view content (language/framework-specific docs)
|
|
214
|
+
View,
|
|
215
|
+
ViewProvider,
|
|
216
|
+
ViewSelector,
|
|
217
|
+
ViewWrapper,
|
|
218
|
+
// Media embeds
|
|
219
|
+
YouTube,
|
|
220
|
+
// Localized component aliases (for translated docs)
|
|
221
|
+
Varning: Warning, // Swedish
|
|
222
|
+
Avertissement: Warning, // French
|
|
223
|
+
img: ({
|
|
224
|
+
src,
|
|
225
|
+
alt,
|
|
226
|
+
width,
|
|
227
|
+
height,
|
|
228
|
+
style,
|
|
229
|
+
loading,
|
|
230
|
+
decoding,
|
|
231
|
+
className,
|
|
232
|
+
class: htmlClass,
|
|
233
|
+
'data-no-zoom': dataNoZoom,
|
|
234
|
+
'data-no-style': dataNoStyle,
|
|
235
|
+
noZoom, // Explicitly destructure to prevent React warning about unknown DOM prop
|
|
236
|
+
nozoom, // Also handle lowercase version from HTML parsing
|
|
237
|
+
noStyle, // Explicitly destructure to prevent React warning about unknown DOM prop
|
|
238
|
+
nostyle, // Also handle lowercase version from HTML parsing
|
|
239
|
+
// Destructure and ignore any other props to prevent them from being passed to DOM
|
|
240
|
+
...rest
|
|
241
|
+
}: any) => {
|
|
242
|
+
// Check for data-no-zoom attribute or noZoom prop (handle both camelCase and lowercase)
|
|
243
|
+
const disableZoom = dataNoZoom === 'true' || dataNoZoom === true ||
|
|
244
|
+
noZoom === true || noZoom === 'true' ||
|
|
245
|
+
nozoom === true || nozoom === 'true';
|
|
246
|
+
|
|
247
|
+
// Check for data-no-style attribute or noStyle prop (handle both camelCase and lowercase)
|
|
248
|
+
// When noStyle is set, skip default styling (useful for light/dark mode image pairs)
|
|
249
|
+
const disableStyle = dataNoStyle === 'true' || dataNoStyle === true ||
|
|
250
|
+
noStyle === true || noStyle === 'true' ||
|
|
251
|
+
nostyle === true || nostyle === 'true';
|
|
252
|
+
|
|
253
|
+
// Apply base styles only if noStyle is not set
|
|
254
|
+
const baseStyles = disableStyle ? '' : 'rounded-xl my-6 border border-theme-border';
|
|
255
|
+
|
|
256
|
+
// Combine base styles with class and className (MDX might pass either)
|
|
257
|
+
const combinedClassName = `${baseStyles} ${htmlClass || ''} ${className || ''}`.trim();
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<ZoomableImage
|
|
261
|
+
src={src}
|
|
262
|
+
alt={alt || ''}
|
|
263
|
+
width={width}
|
|
264
|
+
height={height}
|
|
265
|
+
className={combinedClassName}
|
|
266
|
+
style={style}
|
|
267
|
+
loading={loading}
|
|
268
|
+
decoding={decoding}
|
|
269
|
+
noZoom={disableZoom}
|
|
270
|
+
/>
|
|
271
|
+
);
|
|
272
|
+
},
|
|
273
|
+
h1: (props: any) => (
|
|
274
|
+
<h1
|
|
275
|
+
className="text-3xl font-bold text-theme-text-primary mt-8 mb-4 tracking-tight"
|
|
276
|
+
{...props}
|
|
277
|
+
/>
|
|
278
|
+
),
|
|
279
|
+
h2: (props: any) => (
|
|
280
|
+
<h2
|
|
281
|
+
className="text-2xl font-semibold text-theme-text-primary mt-10 mb-4 tracking-tight scroll-mt-20"
|
|
282
|
+
{...props}
|
|
283
|
+
/>
|
|
284
|
+
),
|
|
285
|
+
h3: (props: any) => (
|
|
286
|
+
<h3
|
|
287
|
+
className="text-xl font-semibold text-theme-text-primary mt-8 mb-3 scroll-mt-20"
|
|
288
|
+
{...props}
|
|
289
|
+
/>
|
|
290
|
+
),
|
|
291
|
+
h4: (props: any) => (
|
|
292
|
+
<h4
|
|
293
|
+
className="text-lg font-semibold text-theme-text-primary mt-6 mb-2 scroll-mt-20"
|
|
294
|
+
{...props}
|
|
295
|
+
/>
|
|
296
|
+
),
|
|
297
|
+
p: (props: any) => (
|
|
298
|
+
<p
|
|
299
|
+
className="text-theme-text-secondary leading-7 mb-4"
|
|
300
|
+
{...props}
|
|
301
|
+
/>
|
|
302
|
+
),
|
|
303
|
+
ul: ({ class: htmlClass, className, ...props }: any) => (
|
|
304
|
+
<ul
|
|
305
|
+
className={`list-disc list-inside text-theme-text-secondary space-y-2 mb-4 ml-4 ${htmlClass || ''} ${className || ''}`.trim()}
|
|
306
|
+
{...props}
|
|
307
|
+
/>
|
|
308
|
+
),
|
|
309
|
+
ol: ({ class: htmlClass, className, ...props }: any) => (
|
|
310
|
+
<ol
|
|
311
|
+
className={`list-decimal list-inside text-theme-text-secondary space-y-2 mb-4 ml-4 ${htmlClass || ''} ${className || ''}`.trim()}
|
|
312
|
+
{...props}
|
|
313
|
+
/>
|
|
314
|
+
),
|
|
315
|
+
li: (props: any) => (
|
|
316
|
+
<li
|
|
317
|
+
className="text-theme-text-secondary marker:text-theme-marker"
|
|
318
|
+
{...props}
|
|
319
|
+
/>
|
|
320
|
+
),
|
|
321
|
+
a: ({ ariaLabel, ...props }: any) => (
|
|
322
|
+
<a
|
|
323
|
+
className="text-theme-accent hover:text-theme-accent-hover transition-colors"
|
|
324
|
+
aria-label={ariaLabel}
|
|
325
|
+
{...props}
|
|
326
|
+
/>
|
|
327
|
+
),
|
|
328
|
+
blockquote: (props: any) => (
|
|
329
|
+
<blockquote
|
|
330
|
+
className="border-l-4 pl-4 text-theme-text-tertiary my-6 not-italic"
|
|
331
|
+
style={{ borderColor: 'var(--color-border)' }}
|
|
332
|
+
{...props}
|
|
333
|
+
/>
|
|
334
|
+
),
|
|
335
|
+
// Custom pre component to wrap code blocks with titles in CodePanel
|
|
336
|
+
pre: ({ children, 'data-title': dataTitle, ...props }: any) => {
|
|
337
|
+
const language = getCodeLanguage(props, children);
|
|
338
|
+
|
|
339
|
+
// Check for mermaid diagrams - render with Mermaid component
|
|
340
|
+
if (language === 'mermaid') {
|
|
341
|
+
const diagramCode = extractTextFromChildren(children);
|
|
342
|
+
return <Mermaid>{diagramCode}</Mermaid>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Check for HTTP code blocks - render with special styling
|
|
346
|
+
if (language === 'http') {
|
|
347
|
+
const codeText = extractTextFromChildren(children);
|
|
348
|
+
const parsed = parseHttpRequest(codeText);
|
|
349
|
+
if (parsed) {
|
|
350
|
+
return <HttpCodeBlock method={parsed.method} url={parsed.url} />;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// If no title, render the pre element directly
|
|
355
|
+
// Copy button is added by CodeBlockCopyButton client component
|
|
356
|
+
if (!dataTitle) {
|
|
357
|
+
return <pre {...props}>{children}</pre>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Wrap in CodePanel to show the title
|
|
361
|
+
const preElement = <pre {...props}>{children}</pre>;
|
|
362
|
+
|
|
363
|
+
return (
|
|
364
|
+
<CodePanel
|
|
365
|
+
tabs={[{ label: language, content: preElement, language }]}
|
|
366
|
+
title={dataTitle}
|
|
367
|
+
hideTabs={true}
|
|
368
|
+
className="my-6"
|
|
369
|
+
enableFullscreen
|
|
370
|
+
/>
|
|
371
|
+
);
|
|
372
|
+
},
|
|
373
|
+
// Inline code styling is done via CSS in base.css (.prose :not(pre) > code)
|
|
374
|
+
table: (props: any) => (
|
|
375
|
+
<div className="overflow-x-auto my-6">
|
|
376
|
+
<table
|
|
377
|
+
className="w-full text-sm border-collapse"
|
|
378
|
+
{...props}
|
|
379
|
+
/>
|
|
380
|
+
</div>
|
|
381
|
+
),
|
|
382
|
+
th: (props: any) => (
|
|
383
|
+
<th
|
|
384
|
+
className="text-left font-semibold text-theme-text-primary p-3 border-b-2 border-theme-border bg-theme-bg-secondary"
|
|
385
|
+
{...props}
|
|
386
|
+
/>
|
|
387
|
+
),
|
|
388
|
+
td: (props: any) => (
|
|
389
|
+
<td
|
|
390
|
+
className="p-3 border-b border-theme-border text-theme-text-secondary"
|
|
391
|
+
{...props}
|
|
392
|
+
/>
|
|
393
|
+
),
|
|
394
|
+
hr: (props: any) => (
|
|
395
|
+
<hr
|
|
396
|
+
className="border-theme-border my-8"
|
|
397
|
+
{...props}
|
|
398
|
+
/>
|
|
399
|
+
),
|
|
400
|
+
// Generic div handler to convert class to className
|
|
401
|
+
div: ({ class: htmlClass, className, ...props }: any) => (
|
|
402
|
+
<div
|
|
403
|
+
className={`${htmlClass || ''} ${className || ''}`.trim() || undefined}
|
|
404
|
+
{...props}
|
|
405
|
+
/>
|
|
406
|
+
),
|
|
407
|
+
// Generic span handler to convert class to className
|
|
408
|
+
span: ({ class: htmlClass, className, ...props }: any) => (
|
|
409
|
+
<span
|
|
410
|
+
className={`${htmlClass || ''} ${className || ''}`.trim() || undefined}
|
|
411
|
+
{...props}
|
|
412
|
+
/>
|
|
413
|
+
),
|
|
414
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
|
|
5
|
+
// Skeleton shown during lazy load
|
|
6
|
+
function MermaidSkeleton({ className }: { className?: string }) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={`my-6 flex justify-center ${className || ''}`}
|
|
10
|
+
data-testid="mermaid-skeleton"
|
|
11
|
+
>
|
|
12
|
+
<div className="animate-pulse bg-gray-200 dark:bg-gray-700 rounded-lg w-full max-w-xl h-48" />
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Dynamic import - ssr: false because mermaid requires browser APIs
|
|
18
|
+
const MermaidInner = dynamic(
|
|
19
|
+
() => import('./MermaidInner').then(mod => ({ default: mod.MermaidInner })),
|
|
20
|
+
{
|
|
21
|
+
ssr: false,
|
|
22
|
+
loading: () => <MermaidSkeleton />
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
interface MermaidProps {
|
|
27
|
+
children: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Minimum width for the SVG diagram (e.g., "700px", "100%") */
|
|
30
|
+
minWidth?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function Mermaid({ children, className, minWidth }: MermaidProps) {
|
|
34
|
+
return <MermaidInner className={className} minWidth={minWidth}>{children}</MermaidInner>;
|
|
35
|
+
}
|