@gentleduck/docs 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-CR_OZcLS.js → button-Ao0Egplu.js} +2 -2
- package/dist/{button-CR_OZcLS.js.map → button-Ao0Egplu.js.map} +1 -1
- package/dist/{callout-C2bQgpQO.js → callout-ChU_uu_5.js} +2 -2
- package/dist/{callout-C2bQgpQO.js.map → callout-ChU_uu_5.js.map} +1 -1
- package/dist/callout-DlA6bFl6.d.ts +20 -0
- package/dist/callout-DlA6bFl6.d.ts.map +1 -0
- package/dist/{charts-SaaTMCb9.js → charts-CvYC8d1e.js} +1 -1
- package/dist/{charts-SaaTMCb9.js.map → charts-CvYC8d1e.js.map} +1 -1
- package/dist/{charts-CELN6vzr.d.ts → charts-Cyick3Tp.d.ts} +1 -1
- package/dist/charts-Cyick3Tp.d.ts.map +1 -0
- package/dist/{chunk-CeaF__0A-BK-6UBbr.js → chunk-BPpoHddQ-DLGSIJHp.js} +1 -1
- package/dist/{chunk-CeaF__0A-BK-6UBbr.js.map → chunk-BPpoHddQ-DLGSIJHp.js.map} +1 -1
- package/dist/client.d.ts +54 -53
- package/dist/client.js +1 -1
- package/dist/{code-block-DRKzpa_7.d.ts → code-block-XZs_wNL_.d.ts} +3 -3
- package/dist/code-block-XZs_wNL_.d.ts.map +1 -0
- package/dist/{code-block-D-0dMRRv.js → code-block-uesBcZgM.js} +1 -1
- package/dist/{code-block-D-0dMRRv.js.map → code-block-uesBcZgM.js.map} +1 -1
- package/dist/{code-block-wrapper-9DMaH5Br.d.ts → code-block-wrapper-I4wS1Zc_.d.ts} +3 -3
- package/dist/{code-block-wrapper-9DMaH5Br.d.ts.map → code-block-wrapper-I4wS1Zc_.d.ts.map} +1 -1
- package/dist/{code-block-wrapper-CZsaZm5E.js → code-block-wrapper-XLG-BrIs.js} +1 -1
- package/dist/{code-block-wrapper-CZsaZm5E.js.map → code-block-wrapper-XLG-BrIs.js.map} +1 -1
- package/dist/{code-preview-CfN-Mhwt.d.ts → code-preview-CcHWOM40.d.ts} +3 -3
- package/dist/{code-preview-CfN-Mhwt.d.ts.map → code-preview-CcHWOM40.d.ts.map} +1 -1
- package/dist/{code-preview-CH2PwR53.js → code-preview-DTVYDNkK.js} +2 -2
- package/dist/{code-preview-CH2PwR53.js.map → code-preview-DTVYDNkK.js.map} +1 -1
- package/dist/{colors-DBTwyOsD.d.ts → colors-BDTM1-gZ.d.ts} +1 -1
- package/dist/{colors-DBTwyOsD.d.ts.map → colors-BDTM1-gZ.d.ts.map} +1 -1
- package/dist/{colors-BT2tMNtt.js → colors-BUDdXvJ2.js} +2 -2
- package/dist/{colors-BT2tMNtt.js.map → colors-BUDdXvJ2.js.map} +1 -1
- package/dist/command-2PGkRCUM.js +2 -0
- package/dist/command-2PGkRCUM.js.map +1 -0
- package/dist/{command-menu-Dz8Cy4W4.js → command-menu-BYWVu7O7.js} +2 -2
- package/dist/{command-menu-Dz8Cy4W4.js.map → command-menu-BYWVu7O7.js.map} +1 -1
- package/dist/command-menu-CC0hL6Nw.d.ts +7 -0
- package/dist/{command-menu-DyhJfAuE.d.ts.map → command-menu-CC0hL6Nw.d.ts.map} +1 -1
- package/dist/{component-preview-BorhzzPJ.d.ts → component-preview-CFmX_yus.d.ts} +4 -4
- package/dist/{component-preview-BorhzzPJ.d.ts.map → component-preview-CFmX_yus.d.ts.map} +1 -1
- package/dist/component-preview-InhzN4h1.js +2 -0
- package/dist/component-preview-InhzN4h1.js.map +1 -0
- package/dist/{component-source-nRdNY4PH.d.ts → component-source-B8bxXxtX.d.ts} +3 -3
- package/dist/{component-source-nRdNY4PH.d.ts.map → component-source-B8bxXxtX.d.ts.map} +1 -1
- package/dist/{component-source-DaY4BKlT.js → component-source-DtSz1ZSB.js} +2 -2
- package/dist/{component-source-DaY4BKlT.js.map → component-source-DtSz1ZSB.js.map} +1 -1
- package/dist/components/copy-button/copy-button.d.ts +4 -4
- package/dist/components/copy-button/copy-button.js +1 -1
- package/dist/components/copy-button/copy-button.types.d.ts +3 -3
- package/dist/components/copy-button/index.d.ts +5 -5
- package/dist/components/copy-button/index.js +1 -1
- package/dist/components/docs/docs-copy-page.d.ts +1 -1
- package/dist/components/docs/docs-copy-page.js +1 -1
- package/dist/components/docs/docs-pager.d.ts +3 -3
- package/dist/components/docs/docs-pager.js +1 -1
- package/dist/components/docs/docs-sidebar.d.ts +3 -3
- package/dist/components/docs/docs-sidebar.js +1 -1
- package/dist/components/docs/docs-toc.d.ts +3 -3
- package/dist/components/docs/docs-toc.js +1 -1
- package/dist/components/docs/index.d.ts +7 -7
- package/dist/components/docs/index.js +1 -1
- package/dist/components/icons.d.ts +1 -1
- package/dist/components/icons.js +1 -1
- package/dist/components/index.d.ts +46 -45
- package/dist/components/index.js +1 -1
- package/dist/components/layouts/command-menu/command-menu.d.ts +1 -1
- package/dist/components/layouts/command-menu/command-menu.js +1 -1
- package/dist/components/layouts/command-menu/index.d.ts +2 -2
- package/dist/components/layouts/command-menu/index.js +1 -1
- package/dist/components/layouts/index.d.ts +7 -7
- package/dist/components/layouts/index.js +1 -1
- package/dist/components/layouts/site-footer/index.d.ts +1 -1
- package/dist/components/layouts/site-footer/index.js +1 -1
- package/dist/components/layouts/site-header/header-shell.d.ts +1 -1
- package/dist/components/layouts/site-header/header-shell.js +1 -1
- package/dist/components/layouts/site-header/index.d.ts +2 -2
- package/dist/components/layouts/site-header/index.js +1 -1
- package/dist/components/layouts/tailwind-indicator/index.d.ts +1 -1
- package/dist/components/layouts/tailwind-indicator/index.js +1 -1
- package/dist/components/main-nav.d.ts +1 -1
- package/dist/components/main-nav.js +1 -1
- package/dist/components/mdx/mdx-components/callout.d.ts +1 -1
- package/dist/components/mdx/mdx-components/callout.js +1 -1
- package/dist/components/mdx/mdx-components/code/code-block-wrapper.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/code-block-wrapper.js +1 -1
- package/dist/components/mdx/mdx-components/code/code-block.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/code-block.js +1 -1
- package/dist/components/mdx/mdx-components/code/code-preview.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/code-preview.js +1 -1
- package/dist/components/mdx/mdx-components/code/component-preview.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/component-preview.js +1 -1
- package/dist/components/mdx/mdx-components/code/component-source.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/component-source.js +1 -1
- package/dist/components/mdx/mdx-components/code/figcaption-block.d.ts +1 -1
- package/dist/components/mdx/mdx-components/code/figcaption-block.js +1 -1
- package/dist/components/mdx/mdx-components/code/index.d.ts +12 -11
- package/dist/components/mdx/mdx-components/code/index.js +1 -1
- package/dist/components/mdx/mdx-components/code/mermaid-block.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/mermaid-block.js +1 -0
- package/dist/components/mdx/mdx-components/code/pre-block.d.ts +3 -3
- package/dist/components/mdx/mdx-components/code/pre-block.js +1 -1
- package/dist/components/mdx/mdx-components/code/span-block.d.ts +2 -2
- package/dist/components/mdx/mdx-components/components-list.d.ts +3 -3
- package/dist/components/mdx/mdx-components/components-list.js +1 -1
- package/dist/components/mdx/mdx-components/exalidraw.d.ts +2 -2
- package/dist/components/mdx/mdx-components/framework-docs.d.ts +1 -1
- package/dist/components/mdx/mdx-components/framework-docs.js +1 -1
- package/dist/components/mdx/mdx-components/index.d.ts +21 -20
- package/dist/components/mdx/mdx-components/index.js +1 -1
- package/dist/components/mdx/mdx-components/table.d.ts +1 -1
- package/dist/components/mdx/mdx-components/table.js +1 -1
- package/dist/components/mdx/mdx-components/tabs.d.ts +1 -1
- package/dist/components/mdx/mdx-components/tabs.js +1 -1
- package/dist/components/mdx/mdx-components/typepography.d.ts +1 -1
- package/dist/components/mdx/mdx-components/typepography.js +1 -1
- package/dist/components/mdx/mdx-icons.d.ts +16 -0
- package/dist/components/mdx/mdx-icons.d.ts.map +1 -0
- package/dist/components/mdx/mdx-icons.js +1 -0
- package/dist/components/mdx/mdx.d.ts +1 -1
- package/dist/components/mdx/mdx.js +1 -1
- package/dist/components/mobile-nav.d.ts +1 -1
- package/dist/components/mobile-nav.js +1 -1
- package/dist/components/mode-toggle.d.ts +1 -1
- package/dist/components/mode-toggle.js +1 -1
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/providers.d.ts +1 -1
- package/dist/components/providers.js +1 -1
- package/dist/components/themes/index.d.ts +3 -3
- package/dist/components/themes/index.js +1 -1
- package/dist/components/themes/style-switcher.d.ts +2 -2
- package/dist/components/themes/style-switcher.js +1 -1
- package/dist/components-list-DdQIzOWR.d.ts +12 -0
- package/dist/{components-list-oRqyUqpK.d.ts.map → components-list-DdQIzOWR.d.ts.map} +1 -1
- package/dist/{components-list-aNKHINTJ.js → components-list-DiOUxZd_.js} +2 -2
- package/dist/{components-list-aNKHINTJ.js.map → components-list-DiOUxZd_.js.map} +1 -1
- package/dist/context/context.d.ts +1 -1
- package/dist/context/context.js +1 -1
- package/dist/context/context.types.d.ts +1 -1
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +1 -1
- package/dist/{context-iK9ApdrV.d.ts → context-4HPOTFY3.d.ts} +4 -4
- package/dist/{context-iK9ApdrV.d.ts.map → context-4HPOTFY3.d.ts.map} +1 -1
- package/dist/{context-BlGtI7pz.js → context-CibrcgaK.js} +1 -1
- package/dist/{context-BlGtI7pz.js.map → context-CibrcgaK.js.map} +1 -1
- package/dist/{context.types-B4K0TFVT.d.ts → context.types-KUK2rNdz.d.ts} +2 -2
- package/dist/{context.types-B4K0TFVT.d.ts.map → context.types-KUK2rNdz.d.ts.map} +1 -1
- package/dist/{copy-button-v61urJdF.d.ts → copy-button-CFc5QVLy.d.ts} +7 -8
- package/dist/copy-button-CFc5QVLy.d.ts.map +1 -0
- package/dist/copy-button-DZizVQ8G.js +2 -0
- package/dist/copy-button-DZizVQ8G.js.map +1 -0
- package/dist/{copy-button.types-B1E_Dsja.d.ts → copy-button.types-DDNr7hUc.d.ts} +5 -5
- package/dist/{copy-button.types-B1E_Dsja.d.ts.map → copy-button.types-DDNr7hUc.d.ts.map} +1 -1
- package/dist/dialog-BJXRFGlQ.js +31 -0
- package/dist/dialog-BJXRFGlQ.js.map +1 -0
- package/dist/{dist-ws2wUF1U.js → dist-DfVBUGvk.js} +1 -1
- package/dist/{dist-ws2wUF1U.js.map → dist-DfVBUGvk.js.map} +1 -1
- package/dist/{docs-copy-page-Dfona0Wa.d.ts → docs-copy-page-BM3zVUeL.d.ts} +3 -3
- package/dist/{docs-copy-page-Dfona0Wa.d.ts.map → docs-copy-page-BM3zVUeL.d.ts.map} +1 -1
- package/dist/{docs-copy-page-CUBmgypz.js → docs-copy-page-DZDkcR09.js} +2 -2
- package/dist/{docs-copy-page-CUBmgypz.js.map → docs-copy-page-DZDkcR09.js.map} +1 -1
- package/dist/{docs-pager-BJcKsfVa.d.ts → docs-pager-Doppai9B.d.ts} +6 -6
- package/dist/docs-pager-Doppai9B.d.ts.map +1 -0
- package/dist/docs-pager-Dr6dooWP.js +2 -0
- package/dist/docs-pager-Dr6dooWP.js.map +1 -0
- package/dist/{docs-sidebar-DihF9d4s.d.ts → docs-sidebar-D0TOniBr.d.ts} +7 -7
- package/dist/{docs-sidebar-DihF9d4s.d.ts.map → docs-sidebar-D0TOniBr.d.ts.map} +1 -1
- package/dist/{docs-sidebar-CSZlkWWo.js → docs-sidebar-MtBCNnEG.js} +2 -2
- package/dist/{docs-sidebar-CSZlkWWo.js.map → docs-sidebar-MtBCNnEG.js.map} +1 -1
- package/dist/docs-toc-BBsdEsY-.d.ts +13 -0
- package/dist/{docs-toc-BRKFzAJy.d.ts.map → docs-toc-BBsdEsY-.d.ts.map} +1 -1
- package/dist/{docs-toc-BuFrK7vO.js → docs-toc-Czi8gMJf.js} +2 -2
- package/dist/{docs-toc-BuFrK7vO.js.map → docs-toc-Czi8gMJf.js.map} +1 -1
- package/dist/{scroll-area-DOM4NPU1.js → drawer-DVVyDJ2D.js} +2 -2
- package/dist/{scroll-area-DOM4NPU1.js.map → drawer-DVVyDJ2D.js.map} +1 -1
- package/dist/dropdown-menu-Cf4PnvE4.js +2 -0
- package/dist/dropdown-menu-Cf4PnvE4.js.map +1 -0
- package/dist/{events-miUBWk_a.d.ts → events-CFVHB4m8.d.ts} +1 -1
- package/dist/{events-miUBWk_a.d.ts.map → events-CFVHB4m8.d.ts.map} +1 -1
- package/dist/{events-D55YvIRi.js → events-DHlTM_S_.js} +1 -1
- package/dist/{events-D55YvIRi.js.map → events-DHlTM_S_.js.map} +1 -1
- package/dist/{figcaption-block-BBWQRv4Q.js → figcaption-block-7FWvsSXj.js} +2 -2
- package/dist/{figcaption-block-BBWQRv4Q.js.map → figcaption-block-7FWvsSXj.js.map} +1 -1
- package/dist/{figcaption-block-BQsKallb.d.ts → figcaption-block-DAb2yFuu.d.ts} +3 -3
- package/dist/{figcaption-block-BQsKallb.d.ts.map → figcaption-block-DAb2yFuu.d.ts.map} +1 -1
- package/dist/{framework-docs-BatpVEiM.d.ts → framework-docs-BdW8xpfl.d.ts} +1 -1
- package/dist/{framework-docs-BatpVEiM.d.ts.map → framework-docs-BdW8xpfl.d.ts.map} +1 -1
- package/dist/framework-docs-BtCchZOF.js +2 -0
- package/dist/{framework-docs-CtgNYWtQ.js.map → framework-docs-BtCchZOF.js.map} +1 -1
- package/dist/{header-shell-BEQgerdN.js → header-shell-BnhiboVH.js} +2 -2
- package/dist/{header-shell-BEQgerdN.js.map → header-shell-BnhiboVH.js.map} +1 -1
- package/dist/{header-shell-DnaqjTZK.d.ts → header-shell-ClRz98xF.d.ts} +6 -6
- package/dist/{header-shell-DnaqjTZK.d.ts.map → header-shell-ClRz98xF.d.ts.map} +1 -1
- package/dist/hooks/index.d.ts +7 -7
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-colors.d.ts +2 -2
- package/dist/hooks/use-colors.js +1 -1
- package/dist/hooks/use-config.d.ts +1 -1
- package/dist/hooks/use-config.js +1 -1
- package/dist/hooks/use-lift-mode.d.ts +1 -1
- package/dist/hooks/use-lift-mode.js +1 -1
- package/dist/hooks/use-meta-colors.d.ts +1 -1
- package/dist/hooks/use-meta-colors.js +1 -1
- package/dist/hooks/use-mounted.d.ts +1 -1
- package/dist/hooks/use-mounted.js +1 -1
- package/dist/hooks/use-themes-config.d.ts +1 -1
- package/dist/hooks/use-themes-config.js +1 -1
- package/dist/{icons-Bu19iA4T.d.ts → icons-Bp6-jojO.d.ts} +1 -1
- package/dist/{icons-Bu19iA4T.d.ts.map → icons-Bp6-jojO.d.ts.map} +1 -1
- package/dist/{icons-CRYTp4x9.js → icons-CiCgiCYy.js} +1 -1
- package/dist/{icons-CRYTp4x9.js.map → icons-CiCgiCYy.js.map} +1 -1
- package/dist/{index-BaE3ZSOs.d.ts → index-C3il2ITv.d.ts} +3 -3
- package/dist/{index-BaE3ZSOs.d.ts.map → index-C3il2ITv.d.ts.map} +1 -1
- package/dist/index-C3ohDQzb.d.ts +8 -0
- package/dist/{index-BrgHDO1Y.d.ts.map → index-C3ohDQzb.d.ts.map} +1 -1
- package/dist/index-CtT0ECmz.d.ts +7 -0
- package/dist/{index-B4FEueq6.d.ts.map → index-CtT0ECmz.d.ts.map} +1 -1
- package/dist/index-RKzQMpzp.d.ts +8 -0
- package/dist/{index-Bp2MJnFp.d.ts.map → index-RKzQMpzp.d.ts.map} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/lib/charts.d.ts +1 -1
- package/dist/lib/charts.js +1 -1
- package/dist/lib/colors.d.ts +1 -1
- package/dist/lib/colors.js +1 -1
- package/dist/lib/events.d.ts +1 -1
- package/dist/lib/events.js +1 -1
- package/dist/lib/index.d.ts +5 -5
- package/dist/lib/index.js +1 -1
- package/dist/lib/registry-colors-data.js +1 -1
- package/dist/lib/registry-styles.d.ts +1 -1
- package/dist/lib/registry-styles.js +1 -1
- package/dist/lib/themes.d.ts +1 -1
- package/dist/lib/themes.js +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/main-nav-Cg6YiDTj.d.ts +7 -0
- package/dist/main-nav-Cg6YiDTj.d.ts.map +1 -0
- package/dist/{main-nav-C1zYcmcE.js → main-nav-Ci0i9b05.js} +2 -2
- package/dist/{main-nav-C1zYcmcE.js.map → main-nav-Ci0i9b05.js.map} +1 -1
- package/dist/mdx-BytZ4deL.js +2 -0
- package/dist/mdx-BytZ4deL.js.map +1 -0
- package/dist/{mdx-MPp13c0r.d.ts → mdx-CKRU84WS.d.ts} +1 -1
- package/dist/mdx-CKRU84WS.d.ts.map +1 -0
- package/dist/mdx-icons-BH4zLUw0.js +2 -0
- package/dist/mdx-icons-BH4zLUw0.js.map +1 -0
- package/dist/mermaid-block-BlCALvQ4.js +13 -0
- package/dist/mermaid-block-BlCALvQ4.js.map +1 -0
- package/dist/mermaid-block-RZuwdJvz.d.ts +17 -0
- package/dist/mermaid-block-RZuwdJvz.d.ts.map +1 -0
- package/dist/{metadata-plugin-CMU3PUxV.d.ts → metadata-plugin-OKcE6Xsj.d.ts} +2 -2
- package/dist/metadata-plugin-OKcE6Xsj.d.ts.map +1 -0
- package/dist/{metadata-plugin-DGwA5NWw.js → metadata-plugin-tEixstEj.js} +1 -1
- package/dist/{metadata-plugin-DGwA5NWw.js.map → metadata-plugin-tEixstEj.js.map} +1 -1
- package/dist/mobile-nav-BAkYO55-.js +2 -0
- package/dist/mobile-nav-BAkYO55-.js.map +1 -0
- package/dist/mobile-nav-BcRCNOB4.d.ts +7 -0
- package/dist/mobile-nav-BcRCNOB4.d.ts.map +1 -0
- package/dist/{mode-toggle-DoWxq87i.js → mode-toggle-BFNnk0Th.js} +2 -2
- package/dist/{mode-toggle-DoWxq87i.js.map → mode-toggle-BFNnk0Th.js.map} +1 -1
- package/dist/mode-toggle-DkjhxUcC.d.ts +7 -0
- package/dist/mode-toggle-DkjhxUcC.d.ts.map +1 -0
- package/dist/{mount-BuQtU842-CEQcCm2Y.js → mount-CNbhMJe--D9ALOndF.js} +2 -2
- package/dist/{mount-BuQtU842-CEQcCm2Y.js.map → mount-CNbhMJe--D9ALOndF.js.map} +1 -1
- package/dist/{nav-CAnD-pGR.d.ts → nav-B2NAfb21.d.ts} +1 -1
- package/dist/{nav-CAnD-pGR.d.ts.map → nav-B2NAfb21.d.ts.map} +1 -1
- package/dist/{page-header-DC0P0tw9.d.ts → page-header-BFaGrxuP.d.ts} +6 -6
- package/dist/{page-header-DC0P0tw9.d.ts.map → page-header-BFaGrxuP.d.ts.map} +1 -1
- package/dist/{page-header-BDMYarTX.js → page-header-D8n3yXQF.js} +1 -1
- package/dist/{page-header-BDMYarTX.js.map → page-header-D8n3yXQF.js.map} +1 -1
- package/dist/popover-DBuHxfGT.js +2 -0
- package/dist/popover-DBuHxfGT.js.map +1 -0
- package/dist/{pre-block-itQGtf67.d.ts → pre-block-BiGutzz_.d.ts} +6 -6
- package/dist/{pre-block-itQGtf67.d.ts.map → pre-block-BiGutzz_.d.ts.map} +1 -1
- package/dist/{pre-block-M0SrdSIi.js → pre-block-C2YQ_YU_.js} +2 -2
- package/dist/{pre-block-M0SrdSIi.js.map → pre-block-C2YQ_YU_.js.map} +1 -1
- package/dist/presence-DKRzzG6_-DV_YtF92.js +2 -0
- package/dist/presence-DKRzzG6_-DV_YtF92.js.map +1 -0
- package/dist/{providers-Cn0pPppV.js → providers-CFfgRc3G.js} +1 -1
- package/dist/{providers-Cn0pPppV.js.map → providers-CFfgRc3G.js.map} +1 -1
- package/dist/{providers-DBsOm_ZR.d.ts → providers-Df2oImJ-.d.ts} +3 -3
- package/dist/providers-Df2oImJ-.d.ts.map +1 -0
- package/dist/{registry-colors-data-BauG7f6N.js → registry-colors-data-tROJGGvk.js} +1 -1
- package/dist/{registry-colors-data-BauG7f6N.js.map → registry-colors-data-tROJGGvk.js.map} +1 -1
- package/dist/{registry-styles-DuIzFkId.js → registry-styles-Bby12FIz.js} +1 -1
- package/dist/{registry-styles-DuIzFkId.js.map → registry-styles-Bby12FIz.js.map} +1 -1
- package/dist/{registry-styles-CeAvJ8GF.d.ts → registry-styles-DACce7ra.d.ts} +1 -1
- package/dist/{registry-styles-CeAvJ8GF.d.ts.map → registry-styles-DACce7ra.d.ts.map} +1 -1
- package/dist/rehype-mermaid-gkaeJtqn.js +17 -0
- package/dist/rehype-mermaid-gkaeJtqn.js.map +1 -0
- package/dist/rehype-mermaid-kjf2DmAC.d.ts +7 -0
- package/dist/rehype-mermaid-kjf2DmAC.d.ts.map +1 -0
- package/dist/rehype-npm-command-C7BP6nqi.d.ts +7 -0
- package/dist/rehype-npm-command-C7BP6nqi.d.ts.map +1 -0
- package/dist/{velite/rehype-npm-command.js → rehype-npm-command-O7ik2lKv.js} +2 -2
- package/dist/rehype-npm-command-O7ik2lKv.js.map +1 -0
- package/dist/{rehype-pre-block-source-3-fJ4WJH.js → rehype-pre-block-source-D8t3NCnT.js} +1 -1
- package/dist/{rehype-pre-block-source-3-fJ4WJH.js.map → rehype-pre-block-source-D8t3NCnT.js.map} +1 -1
- package/dist/{rehype-pre-block-source-CMhCtBYe.d.ts → rehype-pre-block-source-zKoXg4aL.d.ts} +2 -2
- package/dist/{rehype-pre-block-source-CMhCtBYe.d.ts.map → rehype-pre-block-source-zKoXg4aL.d.ts.map} +1 -1
- package/dist/{rehype-title-tATZyrYL.js → rehype-title-TRUGszot.js} +1 -1
- package/dist/{rehype-title-tATZyrYL.js.map → rehype-title-TRUGszot.js.map} +1 -1
- package/dist/{rehype-title-DoG6hqwI.d.ts → rehype-title-umwuNb2D.d.ts} +2 -2
- package/dist/rehype-title-umwuNb2D.d.ts.map +1 -0
- package/dist/scroll-area-Bj8-58Fz.js +2 -0
- package/dist/scroll-area-Bj8-58Fz.js.map +1 -0
- package/dist/{separator-C-EmvFf-.js → separator-t0JrmyLj.js} +1 -1
- package/dist/{separator-C-EmvFf-.js.map → separator-t0JrmyLj.js.map} +1 -1
- package/dist/{site-footer-U_loxsN7.js → site-footer-BZQcOAVy.js} +2 -2
- package/dist/site-footer-BZQcOAVy.js.map +1 -0
- package/dist/{site-header-D0b71MM9.js → site-header-BT02DWt0.js} +2 -2
- package/dist/site-header-BT02DWt0.js.map +1 -0
- package/dist/style-switcher-BvF4n8f4.js +2 -0
- package/dist/style-switcher-BvF4n8f4.js.map +1 -0
- package/dist/{style-switcher-DHUlWCK9.d.ts → style-switcher-CJ7Z244x.d.ts} +5 -5
- package/dist/{style-switcher-DHUlWCK9.d.ts.map → style-switcher-CJ7Z244x.d.ts.map} +1 -1
- package/dist/styles/base.css +2 -5
- package/dist/styles/docs.css +2 -34
- package/dist/styles/mdx.css +1 -9
- package/dist/{table-CGxZyAIU.js → table-Cu1wFi9V.js} +2 -2
- package/dist/table-Cu1wFi9V.js.map +1 -0
- package/dist/{table-DBE7rAn8.d.ts → table-DAVFXCAf.d.ts} +1 -1
- package/dist/table-DAVFXCAf.d.ts.map +1 -0
- package/dist/{tabs-Dkxe7gur.js → tabs-Cvy3-KIA.js} +2 -2
- package/dist/{tabs-Dkxe7gur.js.map → tabs-Cvy3-KIA.js.map} +1 -1
- package/dist/{tabs-B-epHnpP.js → tabs-jsmxQQW0.js} +2 -2
- package/dist/{tabs-B-epHnpP.js.map → tabs-jsmxQQW0.js.map} +1 -1
- package/dist/{tabs-CZHr50hx.d.ts → tabs-qOB1npti.d.ts} +10 -10
- package/dist/{tabs-CZHr50hx.d.ts.map → tabs-qOB1npti.d.ts.map} +1 -1
- package/dist/{tailwind-indicator-DfZbcuiV.js → tailwind-indicator-Dt4Bfpta.js} +1 -1
- package/dist/{tailwind-indicator-DfZbcuiV.js.map → tailwind-indicator-Dt4Bfpta.js.map} +1 -1
- package/dist/{themes-f-kJrN-m.d.ts → themes-Ba683LGu.d.ts} +1 -1
- package/dist/{themes-f-kJrN-m.d.ts.map → themes-Ba683LGu.d.ts.map} +1 -1
- package/dist/{themes-B_GZI47B.js → themes-BzMklu0h.js} +2 -2
- package/dist/{themes-B_GZI47B.js.map → themes-BzMklu0h.js.map} +1 -1
- package/dist/{typepography-DCeDxf1d.js → typepography-CLdrb7_b.js} +1 -1
- package/dist/{typepography-DCeDxf1d.js.map → typepography-CLdrb7_b.js.map} +1 -1
- package/dist/{typepography-C7_sA_gd.d.ts → typepography-b9NEdPeR.d.ts} +13 -13
- package/dist/{typepography-C7_sA_gd.d.ts.map → typepography-b9NEdPeR.d.ts.map} +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/nav.d.ts +1 -1
- package/dist/types/unist.d.ts +1 -1
- package/dist/{unist-B-M8WB5-.d.ts → unist-DN6buKAy.d.ts} +5 -1
- package/dist/unist-DN6buKAy.d.ts.map +1 -0
- package/dist/{use-colors-CPBjzcVb.js → use-colors-BSOymnQG.js} +2 -2
- package/dist/{use-colors-CPBjzcVb.js.map → use-colors-BSOymnQG.js.map} +1 -1
- package/dist/{use-colors-CS9koNDv.d.ts → use-colors-tvFBbu3S.d.ts} +2 -2
- package/dist/use-colors-tvFBbu3S.d.ts.map +1 -0
- package/dist/{use-config-PB_AYm7O.js → use-config-DViAkW1f.js} +1 -1
- package/dist/{use-config-PB_AYm7O.js.map → use-config-DViAkW1f.js.map} +1 -1
- package/dist/{use-config-Ditx9N5z.d.ts → use-config-DlgXRPaN.d.ts} +4 -4
- package/dist/{use-config-Ditx9N5z.d.ts.map → use-config-DlgXRPaN.d.ts.map} +1 -1
- package/dist/{use-lift-mode-l3nQtEGa.js → use-lift-mode-CqcC0vis.js} +1 -1
- package/dist/{use-lift-mode-l3nQtEGa.js.map → use-lift-mode-CqcC0vis.js.map} +1 -1
- package/dist/{use-lift-mode-CZilliRQ.d.ts → use-lift-mode-DEELjsRA.d.ts} +1 -1
- package/dist/use-lift-mode-DEELjsRA.d.ts.map +1 -0
- package/dist/{use-meta-colors-CuAQwzr0.js → use-meta-colors-B7HIXaHI.js} +2 -2
- package/dist/{use-meta-colors-CuAQwzr0.js.map → use-meta-colors-B7HIXaHI.js.map} +1 -1
- package/dist/{use-meta-colors-DVSpBVKl.d.ts → use-meta-colors-CkNbJTgD.d.ts} +1 -1
- package/dist/use-meta-colors-CkNbJTgD.d.ts.map +1 -0
- package/dist/{use-mounted-CYGlYk2e.d.ts → use-mounted-BtOuPtMk.d.ts} +1 -1
- package/dist/use-mounted-BtOuPtMk.d.ts.map +1 -0
- package/dist/{use-mounted-C3BCVKvM.js → use-mounted-gdBJPRp0.js} +1 -1
- package/dist/{use-mounted-C3BCVKvM.js.map → use-mounted-gdBJPRp0.js.map} +1 -1
- package/dist/{use-themes-config-Cmh0Zmyp.js → use-themes-config-BRcxOF-M.js} +2 -2
- package/dist/{use-themes-config-Cmh0Zmyp.js.map → use-themes-config-BRcxOF-M.js.map} +1 -1
- package/dist/use-themes-config-Dtk_egkh.d.ts +14 -0
- package/dist/{use-themes-config-FMiBGRMO.d.ts.map → use-themes-config-Dtk_egkh.d.ts.map} +1 -1
- package/dist/{utils-DJ_-rCtq.js → utils-Ck5VSddf.js} +1 -1
- package/dist/{utils-DJ_-rCtq.js.map → utils-Ck5VSddf.js.map} +1 -1
- package/dist/{utils-BKcsqHz0.d.ts → utils-gls3XPIE.d.ts} +1 -1
- package/dist/{utils-BKcsqHz0.d.ts.map → utils-gls3XPIE.d.ts.map} +1 -1
- package/dist/velite/config.d.ts.map +1 -1
- package/dist/velite/config.js +1 -1
- package/dist/velite/config.js.map +1 -1
- package/dist/velite/index.d.ts +8 -7
- package/dist/velite/index.js +1 -1
- package/dist/velite/plugins/index.d.ts +8 -6
- package/dist/velite/plugins/index.js +1 -1
- package/dist/velite/plugins/metadata-plugin.d.ts +3 -3
- package/dist/velite/plugins/metadata-plugin.js +1 -1
- package/dist/velite/plugins/rehype-mermaid.d.ts +4 -0
- package/dist/velite/plugins/rehype-mermaid.js +1 -0
- package/dist/velite/plugins/rehype-npm-command.d.ts +4 -0
- package/dist/velite/plugins/rehype-npm-command.js +1 -0
- package/dist/velite/plugins/rehype-pre-block-source.d.ts +3 -3
- package/dist/velite/plugins/rehype-pre-block-source.js +1 -1
- package/dist/velite/plugins/rehype-title.d.ts +3 -3
- package/dist/velite/plugins/rehype-title.js +1 -1
- package/package.json +6 -8
- package/src/components/copy-button/copy-button.tsx +2 -2
- package/src/components/docs/docs-pager.tsx +8 -4
- package/src/components/docs/docs-sidebar.tsx +1 -0
- package/src/components/layouts/site-header/index.tsx +4 -1
- package/src/components/mdx/mdx-components/callout.tsx +11 -4
- package/src/components/mdx/mdx-components/code/component-preview.tsx +1 -10
- package/src/components/mdx/mdx-components/code/index.ts +1 -0
- package/src/components/mdx/mdx-components/code/mermaid-block.tsx +62 -0
- package/src/components/mdx/mdx-components/table.tsx +2 -5
- package/src/components/mdx/mdx-icons.ts +11 -0
- package/src/components/mdx/mdx.tsx +17 -2
- package/src/components/mobile-nav.tsx +1 -3
- package/src/styles/base.css +2 -5
- package/src/styles/docs.css +2 -34
- package/src/styles/mdx.css +1 -9
- package/src/types/unist.ts +4 -0
- package/src/velite/config.ts +2 -2
- package/src/velite/index.ts +0 -1
- package/src/velite/plugins/index.ts +2 -0
- package/src/velite/plugins/rehype-mermaid.ts +227 -0
- package/dist/callout-BtMq2tJx.d.ts +0 -17
- package/dist/callout-BtMq2tJx.d.ts.map +0 -1
- package/dist/charts-CELN6vzr.d.ts.map +0 -1
- package/dist/code-block-DRKzpa_7.d.ts.map +0 -1
- package/dist/command-D1QwvvDI.js +0 -31
- package/dist/command-D1QwvvDI.js.map +0 -1
- package/dist/command-menu-DyhJfAuE.d.ts +0 -7
- package/dist/component-preview-Bc8FAVzP.js +0 -2
- package/dist/component-preview-Bc8FAVzP.js.map +0 -1
- package/dist/components-list-oRqyUqpK.d.ts +0 -12
- package/dist/copy-button-DYr4LYYX.js +0 -2
- package/dist/copy-button-DYr4LYYX.js.map +0 -1
- package/dist/copy-button-v61urJdF.d.ts.map +0 -1
- package/dist/docs-pager-8if8gb0V.js +0 -2
- package/dist/docs-pager-8if8gb0V.js.map +0 -1
- package/dist/docs-pager-BJcKsfVa.d.ts.map +0 -1
- package/dist/docs-toc-BRKFzAJy.d.ts +0 -13
- package/dist/dropdown-menu-CbK2ioAt.js +0 -2
- package/dist/dropdown-menu-CbK2ioAt.js.map +0 -1
- package/dist/framework-docs-CtgNYWtQ.js +0 -2
- package/dist/index-B4FEueq6.d.ts +0 -7
- package/dist/index-Bp2MJnFp.d.ts +0 -8
- package/dist/index-BrgHDO1Y.d.ts +0 -8
- package/dist/main-nav-D-Uy7xjC.d.ts +0 -7
- package/dist/main-nav-D-Uy7xjC.d.ts.map +0 -1
- package/dist/mdx-0SRpwcYy.js +0 -2
- package/dist/mdx-0SRpwcYy.js.map +0 -1
- package/dist/mdx-MPp13c0r.d.ts.map +0 -1
- package/dist/metadata-plugin-CMU3PUxV.d.ts.map +0 -1
- package/dist/mobile-nav-DlpUqdSL.js +0 -2
- package/dist/mobile-nav-DlpUqdSL.js.map +0 -1
- package/dist/mobile-nav-DqlSA30q.d.ts +0 -7
- package/dist/mobile-nav-DqlSA30q.d.ts.map +0 -1
- package/dist/mode-toggle-CKIf57IF.d.ts +0 -7
- package/dist/mode-toggle-CKIf57IF.d.ts.map +0 -1
- package/dist/popover-fCKP1e-n.js +0 -2
- package/dist/popover-fCKP1e-n.js.map +0 -1
- package/dist/providers-DBsOm_ZR.d.ts.map +0 -1
- package/dist/rehype-title-DoG6hqwI.d.ts.map +0 -1
- package/dist/site-footer-U_loxsN7.js.map +0 -1
- package/dist/site-header-D0b71MM9.js.map +0 -1
- package/dist/style-switcher-mI1wYqx9.js +0 -2
- package/dist/style-switcher-mI1wYqx9.js.map +0 -1
- package/dist/table-CGxZyAIU.js.map +0 -1
- package/dist/table-DBE7rAn8.d.ts.map +0 -1
- package/dist/unist-B-M8WB5-.d.ts.map +0 -1
- package/dist/use-colors-CS9koNDv.d.ts.map +0 -1
- package/dist/use-lift-mode-CZilliRQ.d.ts.map +0 -1
- package/dist/use-meta-colors-DVSpBVKl.d.ts.map +0 -1
- package/dist/use-mounted-CYGlYk2e.d.ts.map +0 -1
- package/dist/use-themes-config-FMiBGRMO.d.ts +0 -14
- package/dist/velite/rehype-npm-command.d.ts +0 -8
- package/dist/velite/rehype-npm-command.d.ts.map +0 -1
- package/dist/velite/rehype-npm-command.js.map +0 -1
- /package/dist/{code-EGxBRQzI.js → code-CRijMbf8.js} +0 -0
- /package/dist/{command-menu-B-4RwCHn.js → command-menu-DJNwkpf0.js} +0 -0
- /package/dist/{context-D1vJbMz4.js → context-DAoDXLlH.js} +0 -0
- /package/dist/{context.types-_ABj6_iF.js → context.types-XX-41b7E.js} +0 -0
- /package/dist/{copy-button-1IrjQnN4.js → copy-button-BKOhlef4.js} +0 -0
- /package/dist/{copy-button.types-DyRzjYLJ.js → copy-button.types-B9s047di.js} +0 -0
- /package/dist/{docs-DXceQpMa.js → docs-BXWvl6Zg.js} +0 -0
- /package/dist/{index-BCvK1fdV.d.ts → index-2DqdDmQN.d.ts} +0 -0
- /package/dist/{index-BJZuNQ1k.d.ts → index-CGglgRYd.d.ts} +0 -0
- /package/dist/{index-BPt9YMeo.d.ts → index-CX84Uo3j.d.ts} +0 -0
- /package/dist/{index-CAfgpWI7.d.ts → index-DOo6j0yP.d.ts} +0 -0
- /package/dist/{index-CDXWDYLH.d.ts → index-DUfvqU8v.d.ts} +0 -0
- /package/dist/{index-ChT-j2Wd.d.ts → index-DlpwrdjG.d.ts} +0 -0
- /package/dist/{index-CvYs74sQ.d.ts → index-DxmiBoAj.d.ts} +0 -0
- /package/dist/{index-Deaompgh.d.ts → index-DzZbxTJ5.d.ts} +0 -0
- /package/dist/{index-DfpeEs9r.d.ts → index-MPFNOj9E.d.ts} +0 -0
- /package/dist/{layouts-BhXcIjuP.js → layouts-MJSz-Ia5.js} +0 -0
- /package/dist/{mdx-components-5zRXfhm4.js → mdx-components-Bvz2OZPf.js} +0 -0
- /package/dist/{nav-C5vWYEDs.js → nav-CVNxjtXM.js} +0 -0
- /package/dist/{themes-D1HAElYM.js → themes-k-j3m6gv.js} +0 -0
- /package/dist/{unist-CnBII6A_.js → unist-C_C48flD.js} +0 -0
- /package/src/velite/{rehype-npm-command.ts → plugins/rehype-npm-command.ts} +0 -0
|
@@ -55,7 +55,7 @@ export function CopyButton({ value, className, variant = 'ghost', event, ...prop
|
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export function CopyWithClassNames({ value, classNames, className
|
|
58
|
+
export function CopyWithClassNames({ value, classNames, className }: CopyWithClassNamesProps) {
|
|
59
59
|
const [hasCopied, setHasCopied] = React.useState(false)
|
|
60
60
|
|
|
61
61
|
React.useEffect(() => {
|
|
@@ -77,7 +77,7 @@ export function CopyWithClassNames({ value, classNames, className, ...props }: C
|
|
|
77
77
|
icon={hasCopied ? <CheckIcon /> : <ClipboardIcon />}
|
|
78
78
|
size="icon"
|
|
79
79
|
variant="outline"
|
|
80
|
-
|
|
80
|
+
/>
|
|
81
81
|
</DropdownMenuTrigger>
|
|
82
82
|
<DropdownMenuContent>
|
|
83
83
|
<DropdownMenuItem onClick={() => copyToClipboard(value)}>Component</DropdownMenuItem>
|
|
@@ -32,7 +32,8 @@ export function DocsPagerBottom({ doc }: DocsPagerProps) {
|
|
|
32
32
|
variant: 'outline',
|
|
33
33
|
}),
|
|
34
34
|
)}
|
|
35
|
-
href={pager.prev.href}
|
|
35
|
+
href={pager.prev.href}
|
|
36
|
+
scroll>
|
|
36
37
|
<ChevronLeft className="mr-2 size-4" />
|
|
37
38
|
<span>{pager.prev.title}</span>
|
|
38
39
|
</Link>
|
|
@@ -45,7 +46,8 @@ export function DocsPagerBottom({ doc }: DocsPagerProps) {
|
|
|
45
46
|
variant: 'outline',
|
|
46
47
|
}),
|
|
47
48
|
)}
|
|
48
|
-
href={pager.next.href}
|
|
49
|
+
href={pager.next.href}
|
|
50
|
+
scroll>
|
|
49
51
|
<span>{pager.next.title}</span>
|
|
50
52
|
<ChevronRight className="ml-2 size-4" />
|
|
51
53
|
</Link>
|
|
@@ -72,7 +74,8 @@ export function DocsPagerTop({ doc }: DocsPagerProps) {
|
|
|
72
74
|
variant: 'secondary',
|
|
73
75
|
}),
|
|
74
76
|
)}
|
|
75
|
-
href={pager.prev.href}
|
|
77
|
+
href={pager.prev.href}
|
|
78
|
+
scroll>
|
|
76
79
|
<ArrowLeft />
|
|
77
80
|
</Link>
|
|
78
81
|
)}
|
|
@@ -85,7 +88,8 @@ export function DocsPagerTop({ doc }: DocsPagerProps) {
|
|
|
85
88
|
variant: 'secondary',
|
|
86
89
|
}),
|
|
87
90
|
)}
|
|
88
|
-
href={pager.next.href}
|
|
91
|
+
href={pager.next.href}
|
|
92
|
+
scroll>
|
|
89
93
|
<ArrowRight />
|
|
90
94
|
</Link>
|
|
91
95
|
)}
|
|
@@ -75,6 +75,7 @@ export function DocsSidebarNavItem({ item, pathname }: { item: SidebarNavItem; p
|
|
|
75
75
|
pathname === item.href ? 'font-medium text-foreground' : 'text-muted-foreground',
|
|
76
76
|
)}
|
|
77
77
|
href={item.href}
|
|
78
|
+
scroll
|
|
78
79
|
rel={item.external ? 'noreferrer' : ''}
|
|
79
80
|
target={item.external ? '_blank' : ''}>
|
|
80
81
|
{item.title}
|
|
@@ -104,7 +104,10 @@ export function FontStyleButton() {
|
|
|
104
104
|
return
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
const family =
|
|
107
|
+
const family =
|
|
108
|
+
fontType === 'sans'
|
|
109
|
+
? 'var(--font-geist-sans, "Montserrat"), sans-serif'
|
|
110
|
+
: 'var(--font-geist-mono, "Geist Mono"), monospace'
|
|
108
111
|
|
|
109
112
|
document.documentElement.style.setProperty('font-family', family, 'important')
|
|
110
113
|
}, [fontType])
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
1
2
|
import { Alert, AlertDescription, AlertTitle } from '@gentleduck/registry-ui-duckui/alert'
|
|
2
3
|
|
|
3
4
|
interface CalloutProps {
|
|
4
|
-
icon?:
|
|
5
|
+
icon?: React.ReactNode
|
|
5
6
|
title?: string
|
|
6
7
|
children?: React.ReactNode
|
|
8
|
+
className?: string
|
|
9
|
+
[key: string]: unknown
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
export function Callout({ title, children, icon, ...props }: CalloutProps) {
|
|
12
|
+
export function Callout({ title, children, icon, className, ...props }: CalloutProps) {
|
|
10
13
|
return (
|
|
11
|
-
<Alert {
|
|
12
|
-
{icon &&
|
|
14
|
+
<Alert className={cn('my-6', icon && 'grid-cols-[calc(var(--spacing)*4)_1fr] gap-x-3', className)}>
|
|
15
|
+
{icon && (
|
|
16
|
+
<span className="row-span-2 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:translate-y-0.5 [&_svg]:text-current">
|
|
17
|
+
{icon}
|
|
18
|
+
</span>
|
|
19
|
+
)}
|
|
13
20
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
14
21
|
<AlertDescription>{children}</AlertDescription>
|
|
15
22
|
</Alert>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { CopyButton } from '@duck-docs/components/copy-button'
|
|
4
|
-
import { Icons } from '@duck-docs/components/icons'
|
|
5
4
|
import { useRegistryIndex } from '@duck-docs/context'
|
|
6
5
|
import { cn } from '@gentleduck/libs/cn'
|
|
7
6
|
import { Button } from '@gentleduck/registry-ui-duckui/button'
|
|
@@ -104,15 +103,7 @@ export function ComponentPreview({
|
|
|
104
103
|
'items-start': align === 'start',
|
|
105
104
|
})}
|
|
106
105
|
duck-preview="">
|
|
107
|
-
|
|
108
|
-
fallback={
|
|
109
|
-
<div className="flex w-full items-center justify-center text-muted-foreground text-sm">
|
|
110
|
-
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
|
|
111
|
-
Loading...
|
|
112
|
-
</div>
|
|
113
|
-
}>
|
|
114
|
-
{Preview}
|
|
115
|
-
</React.Suspense>
|
|
106
|
+
{Preview}
|
|
116
107
|
</div>
|
|
117
108
|
</TabsContent>
|
|
118
109
|
<TabsContent
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
4
|
+
import { PreviewPanelDialog } from '@gentleduck/registry-ui-duckui/preview-panel'
|
|
5
|
+
import { Loader } from 'lucide-react'
|
|
6
|
+
import { useTheme } from 'next-themes'
|
|
7
|
+
import { useEffect, useState } from 'react'
|
|
8
|
+
|
|
9
|
+
export interface MermaidBlockProps {
|
|
10
|
+
chart?: string
|
|
11
|
+
lightSvg?: string
|
|
12
|
+
darkSvg?: string
|
|
13
|
+
className?: string
|
|
14
|
+
__mermaidLightSvg__?: string
|
|
15
|
+
__mermaidDarkSvg__?: string
|
|
16
|
+
__rawString__?: string
|
|
17
|
+
[key: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function MermaidBlock(props: MermaidBlockProps) {
|
|
21
|
+
const chart = props.chart || props.__rawString__ || ''
|
|
22
|
+
const preLight = props.lightSvg || props.__mermaidLightSvg__ || ''
|
|
23
|
+
const preDark = props.darkSvg || props.__mermaidDarkSvg__ || ''
|
|
24
|
+
|
|
25
|
+
const { resolvedTheme } = useTheme()
|
|
26
|
+
const [mounted, setMounted] = useState(false)
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setMounted(true)
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
const currentSvg = resolvedTheme === 'dark' ? preDark || preLight : preLight || preDark
|
|
33
|
+
|
|
34
|
+
if (!mounted) {
|
|
35
|
+
return (
|
|
36
|
+
<div className={cn('my-6 flex h-[300px] items-center justify-center rounded-lg border bg-card', props.className)}>
|
|
37
|
+
<div className="flex flex-col items-center gap-3">
|
|
38
|
+
<Loader className="size-4 animate-spin opacity-50" />
|
|
39
|
+
<p className="text-muted-foreground text-sm">Loading diagram...</p>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!currentSvg) {
|
|
46
|
+
return (
|
|
47
|
+
<pre className="my-6 overflow-auto rounded-lg border bg-muted p-4 text-muted-foreground text-sm">
|
|
48
|
+
{chart || 'Mermaid diagram'}
|
|
49
|
+
</pre>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<PreviewPanelDialog
|
|
55
|
+
html={currentSvg}
|
|
56
|
+
maxHeight="500px"
|
|
57
|
+
className={cn('my-6', props.className)}
|
|
58
|
+
panelClassName="[&_svg]:block [&_svg]:h-auto [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full"
|
|
59
|
+
syncPanels
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -2,12 +2,9 @@ import { cn } from '@gentleduck/libs/cn'
|
|
|
2
2
|
import type { FC } from 'react'
|
|
3
3
|
|
|
4
4
|
export const Table: FC<React.HTMLAttributes<HTMLTableElement>> = ({ className, ...props }) => (
|
|
5
|
-
<div className="my-6 w-full rounded-lg border">
|
|
5
|
+
<div className="my-6 w-full overflow-x-auto rounded-lg border">
|
|
6
6
|
<table
|
|
7
|
-
className={cn(
|
|
8
|
-
'relative w-full overflow-hidden border-none text-sm [&_tbody_tr:last-child]:border-b-0',
|
|
9
|
-
className,
|
|
10
|
-
)}
|
|
7
|
+
className={cn('relative w-full border-none text-sm [&_tbody_tr:last-child]:border-b-0', className)}
|
|
11
8
|
{...props}
|
|
12
9
|
/>
|
|
13
10
|
</div>
|
|
@@ -11,12 +11,20 @@ import Image from 'next/image'
|
|
|
11
11
|
import type * as React from 'react'
|
|
12
12
|
import runtime from 'react/jsx-runtime'
|
|
13
13
|
import { Callout } from './mdx-components/callout'
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
CodeBlock,
|
|
16
|
+
CodeBlockWrapper,
|
|
17
|
+
ComponentPreview,
|
|
18
|
+
ComponentSource,
|
|
19
|
+
MermaidBlock,
|
|
20
|
+
PreBlock,
|
|
21
|
+
} from './mdx-components/code'
|
|
15
22
|
import { FigcaptionBlock } from './mdx-components/code/figcaption-block'
|
|
16
23
|
import { ComponentsList } from './mdx-components/components-list'
|
|
17
24
|
import { Table, TableCell, TableHeader, TableRow } from './mdx-components/table'
|
|
18
25
|
import { Tab, TabContent, TabList, TabTrigger } from './mdx-components/tabs'
|
|
19
26
|
import { A, H1, H2, H3, H4, H5, H6, Hr, LinkBlock, LinkedCard, P } from './mdx-components/typepography'
|
|
27
|
+
import { mdxIcons } from './mdx-icons'
|
|
20
28
|
|
|
21
29
|
const useMDXComponent = (code: string) => {
|
|
22
30
|
const fn = new Function(code)
|
|
@@ -24,6 +32,7 @@ const useMDXComponent = (code: string) => {
|
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
const components = {
|
|
35
|
+
...mdxIcons,
|
|
27
36
|
Accordion,
|
|
28
37
|
AccordionContent,
|
|
29
38
|
AccordionItem,
|
|
@@ -67,7 +76,13 @@ const components = {
|
|
|
67
76
|
<ol className={cn('my-6 ml-6 list-decimal', className)} {...props} />
|
|
68
77
|
),
|
|
69
78
|
p: P,
|
|
70
|
-
|
|
79
|
+
MermaidDiagram: MermaidBlock,
|
|
80
|
+
pre: (props: any) => {
|
|
81
|
+
if (props.__isMermaid__) {
|
|
82
|
+
return <MermaidBlock {...props} />
|
|
83
|
+
}
|
|
84
|
+
return <PreBlock {...props} />
|
|
85
|
+
},
|
|
71
86
|
Step: ({ className, ...props }: React.ComponentProps<'h3'>) => (
|
|
72
87
|
<h3 className={cn('step scroll-m-20 font-heading font-semibold text-xl tracking-tight', className)} {...props} />
|
|
73
88
|
),
|
|
@@ -7,7 +7,6 @@ import { Drawer, DrawerContent, DrawerTrigger } from '@gentleduck/registry-ui-du
|
|
|
7
7
|
import { ScrollArea } from '@gentleduck/registry-ui-duckui/scroll-area'
|
|
8
8
|
import { PanelsTopLeft } from 'lucide-react'
|
|
9
9
|
import Link, { type LinkProps } from 'next/link'
|
|
10
|
-
import { useRouter } from 'next/navigation'
|
|
11
10
|
import * as React from 'react'
|
|
12
11
|
|
|
13
12
|
export function MobileNav() {
|
|
@@ -75,13 +74,12 @@ interface MobileLinkProps extends LinkProps {
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
function MobileLink({ href, onOpenChange, className, children, ...props }: MobileLinkProps) {
|
|
78
|
-
const router = useRouter()
|
|
79
77
|
return (
|
|
80
78
|
<Link
|
|
81
79
|
className={cn(className)}
|
|
82
80
|
href={href}
|
|
81
|
+
scroll
|
|
83
82
|
onClick={() => {
|
|
84
|
-
router.push(href.toString())
|
|
85
83
|
onOpenChange?.(false)
|
|
86
84
|
}}
|
|
87
85
|
{...props}>
|
package/src/styles/base.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--font-sans-geist: "Geist", "Adjusted Arial Fallback";
|
|
3
|
-
--font-mono-geist: "Geist Mono", monospace, "Adjusted Lucida Sans Typewriter Fallback";
|
|
4
|
-
|
|
5
2
|
--background: oklch(1 0 0);
|
|
6
3
|
--foreground: oklch(0.141 0.005 285.823);
|
|
7
4
|
--card: oklch(1 0 0);
|
|
@@ -100,8 +97,8 @@
|
|
|
100
97
|
@theme inline {
|
|
101
98
|
--breakpoint-3xl: 1600px;
|
|
102
99
|
--breakpoint-4xl: 2000px;
|
|
103
|
-
--font-sans: "
|
|
104
|
-
--font-mono:
|
|
100
|
+
--font-sans: var(--font-geist-sans, "Montserrat"), sans-serif;
|
|
101
|
+
--font-mono: var(--font-geist-mono, "Geist Mono"), monospace;
|
|
105
102
|
--radius: 0.5rem;
|
|
106
103
|
|
|
107
104
|
--color-background: var(--background);
|
package/src/styles/docs.css
CHANGED
|
@@ -4,38 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
@custom-variant dark (&:is(.dark *));
|
|
6
6
|
|
|
7
|
-
@font-face {
|
|
8
|
-
font-family: "Adjusted Lucida Sans Typewriter Fallback";
|
|
9
|
-
src: local("Lucida Sans Typewriter");
|
|
10
|
-
size-adjust: 119%;
|
|
11
|
-
ascent-override: 86%;
|
|
12
|
-
descent-override: 16%;
|
|
13
|
-
line-gap-override: 30%;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@font-face {
|
|
17
|
-
font-family: "Adjusted Arial Fallback";
|
|
18
|
-
src: local("Arial");
|
|
19
|
-
size-adjust: 99%;
|
|
20
|
-
ascent-override: 101%;
|
|
21
|
-
descent-override: 26%;
|
|
22
|
-
line-gap-override: 0%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@font-face {
|
|
26
|
-
font-family: "Geist";
|
|
27
|
-
font-weight: 100 900;
|
|
28
|
-
font-display: swap;
|
|
29
|
-
src: url(/fonts/Geist-VF.woff2) format("woff2");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@font-face {
|
|
33
|
-
font-family: "Geist Mono";
|
|
34
|
-
font-weight: 100 900;
|
|
35
|
-
font-display: swap;
|
|
36
|
-
src: url(/fonts/GeistMono-VF.woff2) format("woff2");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
7
|
@theme {
|
|
40
8
|
--animate-shine: shine 8s ease-in-out infinite;
|
|
41
9
|
|
|
@@ -63,11 +31,11 @@
|
|
|
63
31
|
}
|
|
64
32
|
|
|
65
33
|
.font-sans {
|
|
66
|
-
font-family: var(--font-sans
|
|
34
|
+
font-family: var(--font-geist-sans, "Montserrat"), sans-serif !important;
|
|
67
35
|
}
|
|
68
36
|
|
|
69
37
|
.font-mono {
|
|
70
|
-
font-family: var(--font-mono
|
|
38
|
+
font-family: var(--font-geist-mono, "Geist Mono"), monospace !important;
|
|
71
39
|
}
|
|
72
40
|
|
|
73
41
|
::-webkit-scrollbar {
|
package/src/styles/mdx.css
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: "JetBrains Mono";
|
|
3
|
-
font-weight: 100 900;
|
|
4
|
-
font-display: swap;
|
|
5
|
-
src: url(/fonts/JetBrainsMono-VF.woff2) format("woff2");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
@layer components {
|
|
9
2
|
code,
|
|
10
3
|
code > * > *,
|
|
@@ -13,7 +6,6 @@
|
|
|
13
6
|
pre {
|
|
14
7
|
font-family: var(--font-mono);
|
|
15
8
|
font-style: normal;
|
|
16
|
-
font-weight: 600;
|
|
17
9
|
font-optical-sizing: auto;
|
|
18
10
|
}
|
|
19
11
|
|
|
@@ -61,7 +53,7 @@
|
|
|
61
53
|
text-align: right;
|
|
62
54
|
content: counter(line);
|
|
63
55
|
counter-increment: line;
|
|
64
|
-
@apply text-
|
|
56
|
+
@apply text-accent-foreground text-xs;
|
|
65
57
|
}
|
|
66
58
|
|
|
67
59
|
[data-rehype-pretty-code-fragment] .line--highlighted,
|
package/src/types/unist.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface UnistNode extends Node {
|
|
|
17
17
|
__title__?: string
|
|
18
18
|
__marks__?: string[]
|
|
19
19
|
__event__?: string
|
|
20
|
+
__isMermaid__?: boolean
|
|
21
|
+
__mermaidLightSvg__?: string
|
|
22
|
+
__mermaidDarkSvg__?: string
|
|
23
|
+
className?: string[]
|
|
20
24
|
[key: string]: unknown
|
|
21
25
|
} & NpmCommands
|
|
22
26
|
attributes?: {
|
package/src/velite/config.ts
CHANGED
|
@@ -8,8 +8,7 @@ import { codeImport } from 'remark-code-import'
|
|
|
8
8
|
import remarkGfm from 'remark-gfm'
|
|
9
9
|
import type { Pluggable } from 'unified'
|
|
10
10
|
import { defineConfig, s, type ZodMeta } from 'velite'
|
|
11
|
-
import { rehypePreBlockSource, rehypeTitle, rhypeMetadataPlugin } from './plugins'
|
|
12
|
-
import { rehypeNpmCommand } from './rehype-npm-command'
|
|
11
|
+
import { rehypeMermaid, rehypeNpmCommand, rehypePreBlockSource, rehypeTitle, rhypeMetadataPlugin } from './plugins'
|
|
13
12
|
import { cleanTocItems } from './utils'
|
|
14
13
|
|
|
15
14
|
export type DocsVeliteConfigOptions = {
|
|
@@ -105,6 +104,7 @@ export function createDocsVeliteConfig({
|
|
|
105
104
|
],
|
|
106
105
|
rehypeTitle,
|
|
107
106
|
rehypePreBlockSource,
|
|
107
|
+
rehypeMermaid,
|
|
108
108
|
rehypeNpmCommand,
|
|
109
109
|
// @ts-ignore
|
|
110
110
|
[rehypeAutolinkHeadings, { properties: { ariaLabel: 'Link to section', className: ['subheading-anchor'] } }],
|
package/src/velite/index.ts
CHANGED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process'
|
|
2
|
+
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import type { UnistNode, UnistTree } from '@duck-docs/types'
|
|
6
|
+
import type { Nodes } from 'hast'
|
|
7
|
+
import { toString } from 'hast-util-to-string'
|
|
8
|
+
import { visit } from 'unist-util-visit'
|
|
9
|
+
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Helpers
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
function isMermaidCode(node: UnistNode): boolean {
|
|
15
|
+
const codeChild = node.children?.[0]
|
|
16
|
+
if (!codeChild || codeChild.type !== 'element' || codeChild.tagName !== 'code') return false
|
|
17
|
+
const dataLang = codeChild.properties?.['data-language']
|
|
18
|
+
const classes = codeChild.properties?.className
|
|
19
|
+
return dataLang === 'mermaid' || (Array.isArray(classes) && classes.includes('language-mermaid'))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Safely extract a string value from an mdxJsxAttribute. */
|
|
23
|
+
function extractAttrValue(attr: any): string | null {
|
|
24
|
+
if (!attr?.value) return null
|
|
25
|
+
if (typeof attr.value === 'string') return attr.value
|
|
26
|
+
if (attr.value?.type === 'mdxJsxAttributeValueExpression') {
|
|
27
|
+
try {
|
|
28
|
+
// eslint-disable-next-line no-new-func
|
|
29
|
+
return new Function('return ' + attr.value.value)()
|
|
30
|
+
} catch {
|
|
31
|
+
return null
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Create an mdxJsxAttribute with an expression value (properly escaped). */
|
|
38
|
+
function makeJsxStringAttr(name: string, value: string) {
|
|
39
|
+
return {
|
|
40
|
+
type: 'mdxJsxAttribute',
|
|
41
|
+
name,
|
|
42
|
+
value: {
|
|
43
|
+
type: 'mdxJsxAttributeValueExpression',
|
|
44
|
+
value: JSON.stringify(value),
|
|
45
|
+
data: {
|
|
46
|
+
estree: {
|
|
47
|
+
type: 'Program',
|
|
48
|
+
sourceType: 'module',
|
|
49
|
+
body: [
|
|
50
|
+
{
|
|
51
|
+
type: 'ExpressionStatement',
|
|
52
|
+
expression: { type: 'Literal', value, raw: JSON.stringify(value) },
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
comments: [],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Headless Chromium renderer - produces pixel-perfect SVGs using a real browser
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
/** Find the system Chromium / Chrome binary. */
|
|
67
|
+
function findChromium(): string {
|
|
68
|
+
for (const bin of ['chromium', 'google-chrome-stable', 'google-chrome', 'chromium-browser']) {
|
|
69
|
+
try {
|
|
70
|
+
const p = execSync(`which ${bin}`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim()
|
|
71
|
+
if (p) return p
|
|
72
|
+
} catch {
|
|
73
|
+
/* next */
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
throw new Error('[rehype-mermaid] No Chromium/Chrome binary found. Install chromium or google-chrome.')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let chromiumPath: string | null = null
|
|
80
|
+
|
|
81
|
+
function buildRenderHtml(diagrams: { source: string; id: string; theme: 'default' | 'dark' }[]): string {
|
|
82
|
+
return `<!DOCTYPE html><html><head>
|
|
83
|
+
<script type="module">
|
|
84
|
+
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
|
|
85
|
+
const diagrams = ${JSON.stringify(diagrams)};
|
|
86
|
+
const results = {};
|
|
87
|
+
for (const d of diagrams) {
|
|
88
|
+
try {
|
|
89
|
+
mermaid.initialize({ startOnLoad: false, theme: d.theme, fontFamily: 'sans-serif', securityLevel: 'loose' });
|
|
90
|
+
const { svg } = await mermaid.render(d.id, d.source);
|
|
91
|
+
results[d.id] = svg;
|
|
92
|
+
} catch (e) {
|
|
93
|
+
results[d.id] = '';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
document.title = 'DONE:' + btoa(unescape(encodeURIComponent(JSON.stringify(results))));
|
|
97
|
+
</script></head><body></body></html>`
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function renderSvgBatch(
|
|
101
|
+
diagrams: { source: string; id: string; theme: 'default' | 'dark' }[],
|
|
102
|
+
): Promise<Record<string, string>> {
|
|
103
|
+
if (!chromiumPath) chromiumPath = findChromium()
|
|
104
|
+
|
|
105
|
+
const dir = mkdtempSync(join(tmpdir(), 'mermaid-'))
|
|
106
|
+
try {
|
|
107
|
+
const htmlFile = join(dir, 'render.html')
|
|
108
|
+
writeFileSync(htmlFile, buildRenderHtml(diagrams))
|
|
109
|
+
|
|
110
|
+
const output = execSync(
|
|
111
|
+
`"${chromiumPath}" --headless --disable-gpu --no-sandbox --virtual-time-budget=15000 --dump-dom "file://${htmlFile}"`,
|
|
112
|
+
{ timeout: 60000, encoding: 'utf-8', maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'] },
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const titleMatch = output.match(/<title>DONE:([\s\S]*?)<\/title>/)
|
|
116
|
+
if (!titleMatch) throw new Error('Chromium did not produce output')
|
|
117
|
+
|
|
118
|
+
const json = decodeURIComponent(escape(Buffer.from(titleMatch[1]!, 'base64').toString('binary')))
|
|
119
|
+
const results: Record<string, string> = JSON.parse(json)
|
|
120
|
+
|
|
121
|
+
// Make SVGs responsive
|
|
122
|
+
for (const [id, svg] of Object.entries(results)) {
|
|
123
|
+
if (svg) {
|
|
124
|
+
results[id] = svg.replace(/\bwidth="[\d.]+"/, 'width="100%"')
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return results
|
|
129
|
+
} finally {
|
|
130
|
+
rmSync(dir, { recursive: true, force: true })
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
// Plugin
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
|
|
138
|
+
export function rehypeMermaid() {
|
|
139
|
+
return async (tree: UnistTree) => {
|
|
140
|
+
// Two kinds of entries: code-fence <pre> blocks and <MermaidDiagram> JSX elements
|
|
141
|
+
type CodeFenceEntry = { kind: 'fence'; node: UnistNode; pre: UnistNode; source: string }
|
|
142
|
+
type JsxEntry = { kind: 'jsx'; node: UnistNode; source: string }
|
|
143
|
+
type Entry = CodeFenceEntry | JsxEntry
|
|
144
|
+
|
|
145
|
+
const entries: Entry[] = []
|
|
146
|
+
|
|
147
|
+
visit(tree, (node: UnistNode) => {
|
|
148
|
+
// 1. <MermaidDiagram chart={`...`} /> JSX elements
|
|
149
|
+
if ((node as any).type === 'mdxJsxFlowElement' && (node as any).name === 'MermaidDiagram') {
|
|
150
|
+
const attrs = (node as any).attributes || []
|
|
151
|
+
const chartAttr = attrs.find((a: any) => a.type === 'mdxJsxAttribute' && a.name === 'chart')
|
|
152
|
+
const chart = extractAttrValue(chartAttr)
|
|
153
|
+
if (chart) {
|
|
154
|
+
entries.push({ kind: 'jsx', node, source: chart.trim() })
|
|
155
|
+
}
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// 2. rehypePrettyCode wrapper div (dual themes, two pre elements)
|
|
160
|
+
if (
|
|
161
|
+
node.type === 'element' &&
|
|
162
|
+
node.tagName === 'div' &&
|
|
163
|
+
node.properties &&
|
|
164
|
+
'data-rehype-pretty-code-fragment' in node.properties
|
|
165
|
+
) {
|
|
166
|
+
const pres = (node.children || []).filter((c: UnistNode) => c.type === 'element' && c.tagName === 'pre')
|
|
167
|
+
const mPre = pres.find((c: UnistNode) => isMermaidCode(c))
|
|
168
|
+
if (!mPre) return
|
|
169
|
+
const src = (mPre.properties?.__rawString__ as string) || toString(mPre as Nodes)
|
|
170
|
+
if (src) entries.push({ kind: 'fence', node, pre: mPre, source: src.trim() })
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// 3. Standalone <pre>
|
|
175
|
+
if (node.type === 'element' && node.tagName === 'pre' && isMermaidCode(node)) {
|
|
176
|
+
const src = (node.properties?.__rawString__ as string) || toString(node as Nodes)
|
|
177
|
+
if (src) entries.push({ kind: 'fence', node, pre: node, source: src.trim() })
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
if (entries.length === 0) return
|
|
182
|
+
|
|
183
|
+
// Build all diagrams in a single Chromium invocation (both themes)
|
|
184
|
+
const diagrams: { source: string; id: string; theme: 'default' | 'dark' }[] = []
|
|
185
|
+
for (let i = 0; i < entries.length; i++) {
|
|
186
|
+
const src = entries[i]!.source
|
|
187
|
+
diagrams.push({ source: src, id: `ml${i}`, theme: 'default' })
|
|
188
|
+
diagrams.push({ source: src, id: `md${i}`, theme: 'dark' })
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let results: Record<string, string> = {}
|
|
192
|
+
try {
|
|
193
|
+
results = await renderSvgBatch(diagrams)
|
|
194
|
+
} catch (err) {
|
|
195
|
+
console.warn(`[rehype-mermaid] Build-time render failed:`, (err as Error).message)
|
|
196
|
+
return
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (let i = 0; i < entries.length; i++) {
|
|
200
|
+
const entry = entries[i]!
|
|
201
|
+
const lightSvg = results[`ml${i}`] || ''
|
|
202
|
+
const darkSvg = results[`md${i}`] || ''
|
|
203
|
+
|
|
204
|
+
if (!lightSvg && !darkSvg) {
|
|
205
|
+
console.warn(`[rehype-mermaid] No SVG produced for diagram ${i}`)
|
|
206
|
+
continue
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (entry.kind === 'jsx') {
|
|
210
|
+
const attrs = (entry.node as any).attributes || []
|
|
211
|
+
if (lightSvg) attrs.push(makeJsxStringAttr('lightSvg', lightSvg))
|
|
212
|
+
if (darkSvg) attrs.push(makeJsxStringAttr('darkSvg', darkSvg))
|
|
213
|
+
;(entry.node as any).attributes = attrs
|
|
214
|
+
} else {
|
|
215
|
+
if (entry.node !== entry.pre) {
|
|
216
|
+
entry.node.children = [entry.pre]
|
|
217
|
+
}
|
|
218
|
+
entry.pre.properties = {
|
|
219
|
+
...entry.pre.properties,
|
|
220
|
+
__isMermaid__: true,
|
|
221
|
+
__mermaidLightSvg__: lightSvg,
|
|
222
|
+
__mermaidDarkSvg__: darkSvg,
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|