mordoc 0.1.13 → 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 +7 -0
- package/bin/cli.js +24 -71
- package/dist/cli/asset-rewrite.d.ts +40 -0
- package/dist/cli/asset-rewrite.d.ts.map +1 -0
- package/dist/cli/asset-rewrite.js +67 -0
- package/dist/cli/asset-rewrite.js.map +1 -0
- package/dist/cli/build.d.ts +45 -15
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/build.js +186 -101
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/dev.d.ts +26 -14
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +116 -159
- package/dist/cli/dev.js.map +1 -1
- package/dist/cli/pagefind-indexer.d.ts +15 -0
- package/dist/cli/pagefind-indexer.d.ts.map +1 -0
- package/dist/cli/pagefind-indexer.js +68 -0
- package/dist/cli/pagefind-indexer.js.map +1 -0
- package/dist/cli/paths.d.ts +26 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +32 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/ssg-runner.d.ts +58 -0
- package/dist/cli/ssg-runner.d.ts.map +1 -0
- package/dist/cli/ssg-runner.js +126 -0
- package/dist/cli/ssg-runner.js.map +1 -0
- package/dist/config/assets-loader.d.ts +11 -0
- package/dist/config/assets-loader.d.ts.map +1 -0
- package/dist/config/assets-loader.js +46 -0
- package/dist/config/assets-loader.js.map +1 -0
- package/dist/config/language-loader.d.ts +11 -0
- package/dist/config/language-loader.d.ts.map +1 -0
- package/dist/config/language-loader.js +61 -0
- package/dist/config/language-loader.js.map +1 -0
- package/dist/config/language.d.ts +11 -0
- package/dist/config/language.d.ts.map +1 -0
- package/dist/config/language.js +61 -0
- package/dist/config/language.js.map +1 -0
- package/dist/config/sidenav-loader.d.ts +14 -0
- package/dist/config/sidenav-loader.d.ts.map +1 -0
- package/dist/config/sidenav-loader.js +78 -0
- package/dist/config/sidenav-loader.js.map +1 -0
- package/dist/config/site-loader.d.ts +11 -0
- package/dist/config/site-loader.d.ts.map +1 -0
- package/dist/config/site-loader.js +72 -0
- package/dist/config/site-loader.js.map +1 -0
- package/dist/config/site.d.ts +11 -0
- package/dist/config/site.d.ts.map +1 -0
- package/dist/config/site.js +72 -0
- package/dist/config/site.js.map +1 -0
- package/dist/config/topnav-loader.d.ts +10 -0
- package/dist/config/topnav-loader.d.ts.map +1 -0
- package/dist/config/topnav-loader.js +78 -0
- package/dist/config/topnav-loader.js.map +1 -0
- package/dist/config/translations-loader.d.ts +7 -0
- package/dist/config/translations-loader.d.ts.map +1 -0
- package/dist/config/translations-loader.js +51 -0
- package/dist/config/translations-loader.js.map +1 -0
- package/dist/content/content-loader.d.ts +16 -0
- package/dist/content/content-loader.d.ts.map +1 -0
- package/dist/content/content-loader.js +126 -0
- package/dist/content/content-loader.js.map +1 -0
- package/dist/content/content-parser.d.ts +12 -0
- package/dist/content/content-parser.d.ts.map +1 -0
- package/dist/content/content-parser.js +54 -0
- package/dist/content/content-parser.js.map +1 -0
- package/dist/content/content-transformer.d.ts +17 -0
- package/dist/content/content-transformer.d.ts.map +1 -0
- package/dist/content/content-transformer.js +94 -0
- package/dist/content/content-transformer.js.map +1 -0
- package/dist/content/markdoc-config.d.ts +13 -0
- package/dist/content/markdoc-config.d.ts.map +1 -0
- package/dist/content/markdoc-config.js +210 -0
- package/dist/content/markdoc-config.js.map +1 -0
- package/dist/content/slug.d.ts +26 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +31 -0
- package/dist/content/slug.js.map +1 -0
- package/dist/pipeline.d.ts +61 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +123 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/types/assets.d.ts +15 -0
- package/dist/types/assets.d.ts.map +1 -0
- package/dist/types/assets.js +2 -0
- package/dist/types/assets.js.map +1 -0
- package/dist/types/content.d.ts +114 -32
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/content.js +1 -6
- package/dist/types/content.js.map +1 -1
- package/dist/types/language.d.ts +9 -0
- package/dist/types/language.d.ts.map +1 -0
- package/dist/types/language.js +2 -0
- package/dist/types/language.js.map +1 -0
- package/dist/types/navigation.d.ts +24 -36
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/types/navigation.js +1 -6
- package/dist/types/navigation.js.map +1 -1
- package/dist/types/pipeline.d.ts +70 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +2 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/types/site.d.ts +20 -0
- package/dist/types/site.d.ts.map +1 -0
- package/dist/types/site.js +2 -0
- package/dist/types/site.js.map +1 -0
- package/dist/utils/lang-utils.d.ts +23 -0
- package/dist/utils/lang-utils.d.ts.map +1 -0
- package/dist/utils/lang-utils.js +40 -0
- package/dist/utils/lang-utils.js.map +1 -0
- package/dist/utils/paths.d.ts +25 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +31 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/vite/plugin.d.ts +93 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +435 -0
- package/dist/vite/plugin.js.map +1 -0
- package/package.json +46 -61
- package/src/app/App.module.css +82 -0
- package/src/app/App.tsx +95 -0
- package/src/app/content/Content.module.css +357 -0
- package/src/app/content/Content.tsx +212 -0
- package/src/app/content/callout/Callout.module.css +110 -0
- package/src/app/content/callout/Callout.tsx +82 -0
- package/src/app/content/card/Card.module.css +146 -0
- package/src/app/content/card/Card.tsx +110 -0
- package/src/app/content/card/CardGrid.module.css +22 -0
- package/src/app/content/card/CardGrid.tsx +34 -0
- package/src/app/content/code-block/CodeBlock.module.css +237 -0
- package/src/app/content/code-block/CodeBlock.tsx +123 -0
- package/src/app/content/heading/Heading.module.css +52 -0
- package/src/app/content/heading/Heading.tsx +75 -0
- package/src/app/content/image/Image.module.css +113 -0
- package/src/app/content/image/Image.tsx +98 -0
- package/src/app/content/link/ContentLink.tsx +46 -0
- package/src/app/data-context.tsx +39 -0
- package/src/app/entry-server.tsx +58 -0
- package/src/app/footer/Footer.module.css +36 -0
- package/src/app/footer/Footer.tsx +28 -0
- package/src/app/globals.d.ts +40 -0
- package/src/app/header/Header.module.css +205 -0
- package/src/app/header/Header.tsx +188 -0
- package/src/app/header/LanguagePicker.module.css +97 -0
- package/src/app/header/LanguagePicker.tsx +174 -0
- package/src/app/header/SearchBar.module.css +92 -0
- package/src/app/header/SearchBar.tsx +37 -0
- package/src/app/header/SearchModal.module.css +185 -0
- package/src/app/header/SearchModal.tsx +245 -0
- package/src/app/header/Topnav.module.css +37 -0
- package/src/app/header/Topnav.tsx +30 -0
- package/src/app/index.css +119 -0
- package/src/app/index.html +13 -0
- package/src/app/landing/LandingPage.module.css +14 -0
- package/src/app/landing/LandingPage.tsx +62 -0
- package/src/app/landing/button/Button.module.css +37 -0
- package/src/app/landing/button/Button.tsx +50 -0
- package/src/app/landing/hero/Hero.module.css +108 -0
- package/src/app/landing/hero/Hero.tsx +81 -0
- package/src/app/landing/section/Section.module.css +100 -0
- package/src/app/landing/section/Section.tsx +61 -0
- package/src/app/lang-utils.ts +11 -0
- package/src/app/main.tsx +67 -0
- package/src/app/not-found/NotFound.module.css +92 -0
- package/src/app/not-found/NotFound.tsx +34 -0
- package/src/app/routes.tsx +86 -0
- package/src/app/sidenav/Sidenav.module.css +239 -0
- package/src/app/sidenav/Sidenav.tsx +182 -0
- package/src/app/skeleton/Skeleton.module.css +100 -0
- package/src/app/skeleton/Skeleton.tsx +75 -0
- package/src/app/toc/Toc.module.css +59 -0
- package/src/app/toc/Toc.tsx +77 -0
- package/src/app/tsconfig.json +18 -0
- package/src/app/virtual-modules.d.ts +74 -0
- package/dist/assets/fonts/inter/Inter-Italic-VariableFont_opsz,wght.ttf +0 -0
- package/dist/assets/fonts/inter/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/dist/assets/fonts/inter/OFL.txt +0 -93
- package/dist/build/Builder.d.ts +0 -92
- package/dist/build/Builder.d.ts.map +0 -1
- package/dist/build/Builder.js +0 -394
- package/dist/build/Builder.js.map +0 -1
- package/dist/build/ClientBundler.d.ts +0 -48
- package/dist/build/ClientBundler.d.ts.map +0 -1
- package/dist/build/ClientBundler.js +0 -169
- package/dist/build/ClientBundler.js.map +0 -1
- package/dist/build/HtmlGenerator.d.ts +0 -46
- package/dist/build/HtmlGenerator.d.ts.map +0 -1
- package/dist/build/HtmlGenerator.js +0 -190
- package/dist/build/HtmlGenerator.js.map +0 -1
- package/dist/build/SearchIndexer.d.ts +0 -31
- package/dist/build/SearchIndexer.d.ts.map +0 -1
- package/dist/build/SearchIndexer.js +0 -116
- package/dist/build/SearchIndexer.js.map +0 -1
- package/dist/bundles/client.js +0 -126
- package/dist/cli/create-app.d.ts +0 -14
- package/dist/cli/create-app.d.ts.map +0 -1
- package/dist/cli/create-app.js +0 -241
- package/dist/cli/create-app.js.map +0 -1
- package/dist/client/App.d.ts +0 -17
- package/dist/client/App.d.ts.map +0 -1
- package/dist/client/App.js +0 -91
- package/dist/client/App.js.map +0 -1
- package/dist/client/contexts/ConfigContext.d.ts +0 -22
- package/dist/client/contexts/ConfigContext.d.ts.map +0 -1
- package/dist/client/contexts/ConfigContext.js +0 -27
- package/dist/client/contexts/ConfigContext.js.map +0 -1
- package/dist/client/contexts/ContentContext.d.ts +0 -31
- package/dist/client/contexts/ContentContext.d.ts.map +0 -1
- package/dist/client/contexts/ContentContext.js +0 -46
- package/dist/client/contexts/ContentContext.js.map +0 -1
- package/dist/client/contexts/SearchContext.d.ts +0 -38
- package/dist/client/contexts/SearchContext.d.ts.map +0 -1
- package/dist/client/contexts/SearchContext.js +0 -185
- package/dist/client/contexts/SearchContext.js.map +0 -1
- package/dist/client/contexts/ThemeContext.d.ts +0 -23
- package/dist/client/contexts/ThemeContext.d.ts.map +0 -1
- package/dist/client/contexts/ThemeContext.js +0 -53
- package/dist/client/contexts/ThemeContext.js.map +0 -1
- package/dist/client/hooks/useContent.d.ts +0 -12
- package/dist/client/hooks/useContent.d.ts.map +0 -1
- package/dist/client/hooks/useContent.js +0 -74
- package/dist/client/hooks/useContent.js.map +0 -1
- package/dist/client/hooks/useNavigation.d.ts +0 -15
- package/dist/client/hooks/useNavigation.d.ts.map +0 -1
- package/dist/client/hooks/useNavigation.js +0 -101
- package/dist/client/hooks/useNavigation.js.map +0 -1
- package/dist/client/hooks/useSearch.d.ts +0 -22
- package/dist/client/hooks/useSearch.d.ts.map +0 -1
- package/dist/client/hooks/useSearch.js +0 -64
- package/dist/client/hooks/useSearch.js.map +0 -1
- package/dist/client/main.d.ts +0 -5
- package/dist/client/main.d.ts.map +0 -1
- package/dist/client/main.js +0 -66
- package/dist/client/main.js.map +0 -1
- package/dist/components/Callout.d.ts +0 -9
- package/dist/components/Callout.d.ts.map +0 -1
- package/dist/components/Callout.js +0 -24
- package/dist/components/Callout.js.map +0 -1
- package/dist/components/Card.d.ts +0 -10
- package/dist/components/Card.d.ts.map +0 -1
- package/dist/components/Card.js +0 -15
- package/dist/components/Card.js.map +0 -1
- package/dist/components/CardGrid.d.ts +0 -8
- package/dist/components/CardGrid.d.ts.map +0 -1
- package/dist/components/CardGrid.js +0 -9
- package/dist/components/CardGrid.js.map +0 -1
- package/dist/components/CodeBlock.d.ts +0 -28
- package/dist/components/CodeBlock.d.ts.map +0 -1
- package/dist/components/CodeBlock.js +0 -80
- package/dist/components/CodeBlock.js.map +0 -1
- package/dist/components/ContentPage.d.ts +0 -9
- package/dist/components/ContentPage.d.ts.map +0 -1
- package/dist/components/ContentPage.js +0 -102
- package/dist/components/ContentPage.js.map +0 -1
- package/dist/components/Header.d.ts +0 -14
- package/dist/components/Header.d.ts.map +0 -1
- package/dist/components/Header.js +0 -30
- package/dist/components/Header.js.map +0 -1
- package/dist/components/Heading.d.ts +0 -16
- package/dist/components/Heading.d.ts.map +0 -1
- package/dist/components/Heading.js +0 -31
- package/dist/components/Heading.js.map +0 -1
- package/dist/components/Image.d.ts +0 -8
- package/dist/components/Image.d.ts.map +0 -1
- package/dist/components/Image.js +0 -24
- package/dist/components/Image.js.map +0 -1
- package/dist/components/Layout.d.ts +0 -14
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/components/Layout.js +0 -32
- package/dist/components/Layout.js.map +0 -1
- package/dist/components/MarkdocRenderer.d.ts +0 -15
- package/dist/components/MarkdocRenderer.d.ts.map +0 -1
- package/dist/components/MarkdocRenderer.js +0 -73
- package/dist/components/MarkdocRenderer.js.map +0 -1
- package/dist/components/MobileMenu.d.ts +0 -14
- package/dist/components/MobileMenu.d.ts.map +0 -1
- package/dist/components/MobileMenu.js +0 -45
- package/dist/components/MobileMenu.js.map +0 -1
- package/dist/components/PageNavigation.d.ts +0 -9
- package/dist/components/PageNavigation.d.ts.map +0 -1
- package/dist/components/PageNavigation.js +0 -23
- package/dist/components/PageNavigation.js.map +0 -1
- package/dist/components/SearchModal.d.ts +0 -9
- package/dist/components/SearchModal.d.ts.map +0 -1
- package/dist/components/SearchModal.js +0 -74
- package/dist/components/SearchModal.js.map +0 -1
- package/dist/components/SideNav.d.ts +0 -9
- package/dist/components/SideNav.d.ts.map +0 -1
- package/dist/components/SideNav.js +0 -66
- package/dist/components/SideNav.js.map +0 -1
- package/dist/components/TableOfContents.d.ts +0 -10
- package/dist/components/TableOfContents.d.ts.map +0 -1
- package/dist/components/TableOfContents.js +0 -151
- package/dist/components/TableOfContents.js.map +0 -1
- package/dist/config/ConfigLoader.d.ts +0 -50
- package/dist/config/ConfigLoader.d.ts.map +0 -1
- package/dist/config/ConfigLoader.js +0 -214
- package/dist/config/ConfigLoader.js.map +0 -1
- package/dist/config/StyleCompiler.d.ts +0 -17
- package/dist/config/StyleCompiler.d.ts.map +0 -1
- package/dist/config/StyleCompiler.js +0 -116
- package/dist/config/StyleCompiler.js.map +0 -1
- package/dist/config/ThemeGenerator.d.ts +0 -14
- package/dist/config/ThemeGenerator.d.ts.map +0 -1
- package/dist/config/ThemeGenerator.js +0 -129
- package/dist/config/ThemeGenerator.js.map +0 -1
- package/dist/content/ContentLoader.d.ts +0 -70
- package/dist/content/ContentLoader.d.ts.map +0 -1
- package/dist/content/ContentLoader.js +0 -146
- package/dist/content/ContentLoader.js.map +0 -1
- package/dist/content/ContentProcessor.d.ts +0 -84
- package/dist/content/ContentProcessor.d.ts.map +0 -1
- package/dist/content/ContentProcessor.js +0 -380
- package/dist/content/ContentProcessor.js.map +0 -1
- package/dist/content/RouteManager.d.ts +0 -69
- package/dist/content/RouteManager.d.ts.map +0 -1
- package/dist/content/RouteManager.js +0 -143
- package/dist/content/RouteManager.js.map +0 -1
- package/dist/styles/components/callout.d.ts +0 -11
- package/dist/styles/components/callout.d.ts.map +0 -1
- package/dist/styles/components/callout.js +0 -87
- package/dist/styles/components/callout.js.map +0 -1
- package/dist/styles/components/card.d.ts +0 -11
- package/dist/styles/components/card.d.ts.map +0 -1
- package/dist/styles/components/card.js +0 -179
- package/dist/styles/components/card.js.map +0 -1
- package/dist/styles/components/codeblock.d.ts +0 -11
- package/dist/styles/components/codeblock.d.ts.map +0 -1
- package/dist/styles/components/codeblock.js +0 -251
- package/dist/styles/components/codeblock.js.map +0 -1
- package/dist/styles/components/content.d.ts +0 -11
- package/dist/styles/components/content.d.ts.map +0 -1
- package/dist/styles/components/content.js +0 -197
- package/dist/styles/components/content.js.map +0 -1
- package/dist/styles/components/fonts.d.ts +0 -11
- package/dist/styles/components/fonts.d.ts.map +0 -1
- package/dist/styles/components/fonts.js +0 -34
- package/dist/styles/components/fonts.js.map +0 -1
- package/dist/styles/components/header.d.ts +0 -11
- package/dist/styles/components/header.d.ts.map +0 -1
- package/dist/styles/components/header.js +0 -293
- package/dist/styles/components/header.js.map +0 -1
- package/dist/styles/components/heading.d.ts +0 -11
- package/dist/styles/components/heading.d.ts.map +0 -1
- package/dist/styles/components/heading.js +0 -115
- package/dist/styles/components/heading.js.map +0 -1
- package/dist/styles/components/layout.d.ts +0 -11
- package/dist/styles/components/layout.d.ts.map +0 -1
- package/dist/styles/components/layout.js +0 -79
- package/dist/styles/components/layout.js.map +0 -1
- package/dist/styles/components/mobilemenu.d.ts +0 -11
- package/dist/styles/components/mobilemenu.d.ts.map +0 -1
- package/dist/styles/components/mobilemenu.js +0 -112
- package/dist/styles/components/mobilemenu.js.map +0 -1
- package/dist/styles/components/reset.d.ts +0 -11
- package/dist/styles/components/reset.d.ts.map +0 -1
- package/dist/styles/components/reset.js +0 -131
- package/dist/styles/components/reset.js.map +0 -1
- package/dist/styles/components/searchmodal.d.ts +0 -11
- package/dist/styles/components/searchmodal.d.ts.map +0 -1
- package/dist/styles/components/searchmodal.js +0 -333
- package/dist/styles/components/searchmodal.js.map +0 -1
- package/dist/styles/components/sidenav.d.ts +0 -11
- package/dist/styles/components/sidenav.d.ts.map +0 -1
- package/dist/styles/components/sidenav.js +0 -212
- package/dist/styles/components/sidenav.js.map +0 -1
- package/dist/styles/components/toc.d.ts +0 -11
- package/dist/styles/components/toc.d.ts.map +0 -1
- package/dist/styles/components/toc.js +0 -120
- package/dist/styles/components/toc.js.map +0 -1
- package/dist/styles/components/typography.d.ts +0 -11
- package/dist/styles/components/typography.d.ts.map +0 -1
- package/dist/styles/components/typography.js +0 -248
- package/dist/styles/components/typography.js.map +0 -1
- package/dist/styles/components/utility.d.ts +0 -11
- package/dist/styles/components/utility.d.ts.map +0 -1
- package/dist/styles/components/utility.js +0 -231
- package/dist/styles/components/utility.js.map +0 -1
- package/dist/styles/types.d.ts +0 -79
- package/dist/styles/types.d.ts.map +0 -1
- package/dist/styles/types.js +0 -7
- package/dist/styles/types.js.map +0 -1
- package/dist/styles/utils.d.ts +0 -21
- package/dist/styles/utils.d.ts.map +0 -1
- package/dist/styles/utils.js +0 -50
- package/dist/styles/utils.js.map +0 -1
- package/dist/styles/variables/main.d.ts +0 -15
- package/dist/styles/variables/main.d.ts.map +0 -1
- package/dist/styles/variables/main.js +0 -116
- package/dist/styles/variables/main.js.map +0 -1
- package/dist/types/config.d.ts +0 -43
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js +0 -7
- package/dist/types/config.js.map +0 -1
- package/dist/utils/language-utils.d.ts +0 -41
- package/dist/utils/language-utils.d.ts.map +0 -1
- package/dist/utils/language-utils.js +0 -79
- package/dist/utils/language-utils.js.map +0 -1
- package/dist/utils/slugify.d.ts +0 -20
- package/dist/utils/slugify.d.ts.map +0 -1
- package/dist/utils/slugify.js +0 -44
- package/dist/utils/slugify.js.map +0 -1
- package/templates/default/config/favicon.ico +0 -0
- package/templates/default/config/logo-dark.png +0 -0
- package/templates/default/config/logo.png +0 -0
- package/templates/default/config/sidenav.yaml +0 -36
- package/templates/default/config/site.json +0 -16
- package/templates/default/config/styles/main.json +0 -6
- package/templates/default/config/styles/typography.json +0 -6
- package/templates/default/content/en/changelog.md +0 -35
- package/templates/default/content/en/faq.md +0 -50
- package/templates/default/content/en/field-manual/engines.md +0 -59
- package/templates/default/content/en/field-manual/relativity.md +0 -46
- package/templates/default/content/en/field-manual/safety.md +0 -44
- package/templates/default/content/en/field-manual.md +0 -22
- package/templates/default/content/en/flight-school/navigation.md +0 -61
- package/templates/default/content/en/flight-school/primer.md +0 -64
- package/templates/default/content/en/flight-school.md +0 -48
- package/templates/default/content/en/index.md +0 -83
- package/templates/default/content/en/ship-systems/flux-sails.md +0 -33
- package/templates/default/content/en/ship-systems/photonic-core.md +0 -39
- package/templates/default/content/en/ship-systems.md +0 -25
- package/templates/default/package.json +0 -21
- package/templates/default/public/icons/academy.svg +0 -15
- package/templates/default/public/icons/manual.svg +0 -16
- package/templates/default/public/icons/relativity.svg +0 -16
- package/templates/default/public/icons/systems.svg +0 -14
- package/templates/default/public/icons/warning.svg +0 -14
- package/templates/default/public/images/flux-sails.svg +0 -33
- package/templates/default/public/images/photonic-core.svg +0 -44
- package/templates/default/public/images/starwake.svg +0 -49
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CardGrid — responsive CSS grid container for Card components.
|
|
3
|
+
*
|
|
4
|
+
* Column count is controlled by the `cols` attribute (1–4, default 3).
|
|
5
|
+
* The value is passed as a `--cols` CSS custom property so the grid
|
|
6
|
+
* layout is driven entirely by CSS, keeping component logic minimal.
|
|
7
|
+
* Responsive collapse (to 2-col at medium, 1-col at small) is handled
|
|
8
|
+
* in CardGrid.module.css via media queries.
|
|
9
|
+
*
|
|
10
|
+
* Registered as a Markdoc tag (`cardGrid`) in markdoc-config.ts and
|
|
11
|
+
* added to Content.tsx's components map.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import styles from './CardGrid.module.css';
|
|
16
|
+
|
|
17
|
+
interface CardGridProps {
|
|
18
|
+
cols?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function CardGrid({ cols = '3', children }: CardGridProps) {
|
|
23
|
+
const numCols = Math.max(1, Math.min(4, parseInt(cols, 10) || 3));
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
className={styles.cardGrid}
|
|
27
|
+
style={{ '--cols': numCols } as React.CSSProperties}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default CardGrid;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
CODE BLOCK TOKENS
|
|
3
|
+
============================================================ */
|
|
4
|
+
:root {
|
|
5
|
+
--cb-bg: var(--color-surface);
|
|
6
|
+
--cb-border: var(--color-border);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* ── Wrapper ────────────────────────────────────────────────── */
|
|
10
|
+
|
|
11
|
+
.wrapper {
|
|
12
|
+
position: relative;
|
|
13
|
+
margin: 1.25rem 0;
|
|
14
|
+
border-radius: var(--radius-lg);
|
|
15
|
+
border: 1px solid var(--cb-border);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ── Header ─────────────────────────────────────────────────── */
|
|
20
|
+
|
|
21
|
+
.header {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: center;
|
|
25
|
+
padding: 0.5rem 1rem;
|
|
26
|
+
background-color: var(--cb-bg);
|
|
27
|
+
border-bottom: 1px solid var(--cb-border);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.language {
|
|
31
|
+
font-size: 0.75rem;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: var(--color-fg-muted);
|
|
34
|
+
text-transform: capitalize;
|
|
35
|
+
font-family: var(--font-sans);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ── Copy button ─────────────────────────────────────────────── */
|
|
39
|
+
|
|
40
|
+
.copyButton {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
padding: 0.25rem;
|
|
45
|
+
background: transparent;
|
|
46
|
+
border: none;
|
|
47
|
+
color: var(--color-fg-muted);
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
border-radius: var(--radius-sm);
|
|
50
|
+
transition: background-color 150ms ease, color 150ms ease;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.copyButton:hover {
|
|
54
|
+
background-color: var(--color-bg-hover);
|
|
55
|
+
color: var(--color-fg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.copyButton:active {
|
|
59
|
+
transform: scale(0.95);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* ── Pre / code ──────────────────────────────────────────────── */
|
|
63
|
+
|
|
64
|
+
.pre {
|
|
65
|
+
margin: 0;
|
|
66
|
+
padding: 1.25rem 1.5rem;
|
|
67
|
+
background-color: var(--color-bg);
|
|
68
|
+
overflow-x: auto;
|
|
69
|
+
font-family: var(--font-mono);
|
|
70
|
+
font-size: 0.875rem;
|
|
71
|
+
line-height: 1.7;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pre code {
|
|
75
|
+
background: none;
|
|
76
|
+
border: none;
|
|
77
|
+
padding: 0;
|
|
78
|
+
font-size: inherit;
|
|
79
|
+
font-family: inherit;
|
|
80
|
+
font-weight: 400;
|
|
81
|
+
color: var(--color-fg);
|
|
82
|
+
border-radius: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Plain (no language) fallback */
|
|
86
|
+
.plain {
|
|
87
|
+
margin: 1.25rem 0;
|
|
88
|
+
padding: 1.25rem 1.5rem;
|
|
89
|
+
background: var(--color-surface);
|
|
90
|
+
border: 1px solid var(--cb-border);
|
|
91
|
+
border-radius: var(--radius-lg);
|
|
92
|
+
overflow-x: auto;
|
|
93
|
+
font-family: var(--font-mono);
|
|
94
|
+
font-size: 0.875rem;
|
|
95
|
+
line-height: 1.7;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.plain code {
|
|
99
|
+
background: none;
|
|
100
|
+
border: none;
|
|
101
|
+
padding: 0;
|
|
102
|
+
font-size: inherit;
|
|
103
|
+
font-family: inherit;
|
|
104
|
+
font-weight: 400;
|
|
105
|
+
color: var(--color-fg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ============================================================
|
|
109
|
+
PRISM TOKEN COLORS
|
|
110
|
+
Light values are default; dark values under .dark
|
|
111
|
+
============================================================ */
|
|
112
|
+
|
|
113
|
+
:global(.token.comment),
|
|
114
|
+
:global(.token.prolog),
|
|
115
|
+
:global(.token.doctype),
|
|
116
|
+
:global(.token.cdata) {
|
|
117
|
+
color: #6a737d;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:global(.dark) :global(.token.comment),
|
|
121
|
+
:global(.dark) :global(.token.prolog),
|
|
122
|
+
:global(.dark) :global(.token.doctype),
|
|
123
|
+
:global(.dark) :global(.token.cdata) {
|
|
124
|
+
color: #8b949e;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:global(.token.punctuation) {
|
|
128
|
+
color: #383a42;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:global(.dark) :global(.token.punctuation) {
|
|
132
|
+
color: #cdd9e5;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:global(.token.namespace) {
|
|
136
|
+
opacity: 0.7;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:global(.token.property),
|
|
140
|
+
:global(.token.tag),
|
|
141
|
+
:global(.token.boolean),
|
|
142
|
+
:global(.token.number),
|
|
143
|
+
:global(.token.constant),
|
|
144
|
+
:global(.token.symbol),
|
|
145
|
+
:global(.token.deleted) {
|
|
146
|
+
color: #0184bc;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:global(.dark) :global(.token.property),
|
|
150
|
+
:global(.dark) :global(.token.tag),
|
|
151
|
+
:global(.dark) :global(.token.boolean),
|
|
152
|
+
:global(.dark) :global(.token.number),
|
|
153
|
+
:global(.dark) :global(.token.constant),
|
|
154
|
+
:global(.dark) :global(.token.symbol),
|
|
155
|
+
:global(.dark) :global(.token.deleted) {
|
|
156
|
+
color: #79c0ff;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:global(.token.selector),
|
|
160
|
+
:global(.token.attr-name),
|
|
161
|
+
:global(.token.string),
|
|
162
|
+
:global(.token.char),
|
|
163
|
+
:global(.token.builtin),
|
|
164
|
+
:global(.token.inserted) {
|
|
165
|
+
color: #50a14f;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(.dark) :global(.token.selector),
|
|
169
|
+
:global(.dark) :global(.token.attr-name),
|
|
170
|
+
:global(.dark) :global(.token.string),
|
|
171
|
+
:global(.dark) :global(.token.char),
|
|
172
|
+
:global(.dark) :global(.token.builtin),
|
|
173
|
+
:global(.dark) :global(.token.inserted) {
|
|
174
|
+
color: #7ee787;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:global(.token.operator),
|
|
178
|
+
:global(.token.entity),
|
|
179
|
+
:global(.token.url),
|
|
180
|
+
:global(.language-css) :global(.token.string),
|
|
181
|
+
:global(.style) :global(.token.string) {
|
|
182
|
+
color: #a626a4;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:global(.dark) :global(.token.operator),
|
|
186
|
+
:global(.dark) :global(.token.entity),
|
|
187
|
+
:global(.dark) :global(.token.url),
|
|
188
|
+
:global(.dark) :global(.language-css) :global(.token.string),
|
|
189
|
+
:global(.dark) :global(.style) :global(.token.string) {
|
|
190
|
+
color: #d2a8ff;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:global(.token.atrule),
|
|
194
|
+
:global(.token.attr-value),
|
|
195
|
+
:global(.token.keyword) {
|
|
196
|
+
color: #a626a4;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:global(.dark) :global(.token.atrule),
|
|
200
|
+
:global(.dark) :global(.token.attr-value),
|
|
201
|
+
:global(.dark) :global(.token.keyword) {
|
|
202
|
+
color: #ff7b72;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:global(.token.function),
|
|
206
|
+
:global(.token.class-name) {
|
|
207
|
+
color: #c18401;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:global(.dark) :global(.token.function),
|
|
211
|
+
:global(.dark) :global(.token.class-name) {
|
|
212
|
+
color: #d29922;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:global(.token.regex),
|
|
216
|
+
:global(.token.important),
|
|
217
|
+
:global(.token.variable) {
|
|
218
|
+
color: #e45649;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:global(.dark) :global(.token.regex),
|
|
222
|
+
:global(.dark) :global(.token.important),
|
|
223
|
+
:global(.dark) :global(.token.variable) {
|
|
224
|
+
color: #ffa657;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
:global(.token.bold) {
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:global(.token.italic) {
|
|
232
|
+
font-style: italic;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
:global(.token.entity) {
|
|
236
|
+
cursor: help;
|
|
237
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeBlock — syntax-highlighted fenced code block with language label and copy button.
|
|
3
|
+
*
|
|
4
|
+
* Prism.js runs synchronously, so highlighting works identically in SSR (Node)
|
|
5
|
+
* and on the client — no hydration mismatch.
|
|
6
|
+
*
|
|
7
|
+
* `dangerouslySetInnerHTML` is safe here: Prism only emits its own span/token
|
|
8
|
+
* markup around already-escaped source text; no user-controlled HTML is injected.
|
|
9
|
+
*
|
|
10
|
+
* Wired up via the `fence` node in markdoc-config, which forwards `language`
|
|
11
|
+
* and `content` as props. Registered in Content.tsx's `components` map.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import Prism from 'prismjs';
|
|
16
|
+
|
|
17
|
+
import 'prismjs/components/prism-javascript';
|
|
18
|
+
import 'prismjs/components/prism-typescript';
|
|
19
|
+
import 'prismjs/components/prism-markup';
|
|
20
|
+
import 'prismjs/components/prism-css';
|
|
21
|
+
import 'prismjs/components/prism-json';
|
|
22
|
+
import 'prismjs/components/prism-yaml';
|
|
23
|
+
import 'prismjs/components/prism-bash';
|
|
24
|
+
import 'prismjs/components/prism-markdown';
|
|
25
|
+
import 'prismjs/components/prism-jsx';
|
|
26
|
+
import 'prismjs/components/prism-tsx';
|
|
27
|
+
import 'prismjs/components/prism-diff';
|
|
28
|
+
import 'prismjs/components/prism-sql';
|
|
29
|
+
|
|
30
|
+
import styles from './CodeBlock.module.css';
|
|
31
|
+
|
|
32
|
+
interface CodeBlockProps {
|
|
33
|
+
language?: string;
|
|
34
|
+
content?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const LANG_ALIASES: Record<string, string> = {
|
|
38
|
+
html: 'markup',
|
|
39
|
+
js: 'javascript',
|
|
40
|
+
ts: 'typescript',
|
|
41
|
+
sh: 'bash',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const DISPLAY_NAMES: Record<string, string> = {
|
|
45
|
+
markup: 'HTML',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function normalize(lang: string): string {
|
|
49
|
+
const lower = lang.toLowerCase();
|
|
50
|
+
return LANG_ALIASES[lower] ?? lower;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function displayName(normalized: string): string {
|
|
54
|
+
return DISPLAY_NAMES[normalized] ?? (normalized.charAt(0).toUpperCase() + normalized.slice(1));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function CodeBlock({ language = '', content = '' }: CodeBlockProps) {
|
|
58
|
+
const [copied, setCopied] = useState(false);
|
|
59
|
+
|
|
60
|
+
const code = content.trim();
|
|
61
|
+
|
|
62
|
+
if (!code) {
|
|
63
|
+
return <pre><code /></pre>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const hasLanguage = language.trim().length > 0;
|
|
67
|
+
|
|
68
|
+
if (!hasLanguage) {
|
|
69
|
+
return (
|
|
70
|
+
<pre className={styles.plain}>
|
|
71
|
+
<code>{code}</code>
|
|
72
|
+
</pre>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const lang = normalize(language);
|
|
77
|
+
const grammar = Prism.languages[lang];
|
|
78
|
+
const highlighted = grammar ? Prism.highlight(code, grammar, lang) : code;
|
|
79
|
+
|
|
80
|
+
const handleCopy = async () => {
|
|
81
|
+
// navigator.clipboard is unavailable in SSR and some sandboxed environments
|
|
82
|
+
if (typeof navigator === 'undefined') return;
|
|
83
|
+
try {
|
|
84
|
+
await navigator.clipboard.writeText(code);
|
|
85
|
+
setCopied(true);
|
|
86
|
+
setTimeout(() => setCopied(false), 2000);
|
|
87
|
+
} catch {
|
|
88
|
+
// silently ignore — copy button just won't give feedback
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div className={styles.wrapper} data-pagefind-ignore>
|
|
94
|
+
<div className={styles.header}>
|
|
95
|
+
<span className={styles.language}>{displayName(lang)}</span>
|
|
96
|
+
<button
|
|
97
|
+
className={styles.copyButton}
|
|
98
|
+
onClick={handleCopy}
|
|
99
|
+
aria-label="Copy code"
|
|
100
|
+
type="button"
|
|
101
|
+
>
|
|
102
|
+
{copied ? (
|
|
103
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
104
|
+
<path d="M20 6L9 17L4 12" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
|
105
|
+
</svg>
|
|
106
|
+
) : (
|
|
107
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
108
|
+
<path d="M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z" fill="currentColor" />
|
|
109
|
+
</svg>
|
|
110
|
+
)}
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
113
|
+
<pre className={`${styles.pre} language-${lang}`}>
|
|
114
|
+
<code
|
|
115
|
+
className={`language-${lang}`}
|
|
116
|
+
dangerouslySetInnerHTML={{ __html: highlighted }}
|
|
117
|
+
/>
|
|
118
|
+
</pre>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export default CodeBlock;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.heading {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: baseline;
|
|
5
|
+
gap: 0.35em;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.anchor {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
opacity: 0;
|
|
13
|
+
color: var(--color-fg-muted);
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
transition: opacity 0.15s ease, color 0.15s ease;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.heading:hover .anchor {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.anchor:hover {
|
|
24
|
+
color: var(--accent-emphasis);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.anchor:focus-visible {
|
|
28
|
+
outline: 2px solid var(--accent-emphasis);
|
|
29
|
+
outline-offset: 2px;
|
|
30
|
+
border-radius: 2px;
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.tooltip {
|
|
35
|
+
position: absolute;
|
|
36
|
+
bottom: calc(100% + 6px);
|
|
37
|
+
left: 50%;
|
|
38
|
+
transform: translateX(-50%);
|
|
39
|
+
background: var(--color-surface-elevated);
|
|
40
|
+
color: var(--color-fg);
|
|
41
|
+
font-size: 0.7rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
letter-spacing: 0.02em;
|
|
44
|
+
padding: 0.2em 0.55em;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
border: 1px solid var(--color-border);
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
/* Reset inherited heading styles */
|
|
50
|
+
font-style: normal;
|
|
51
|
+
line-height: 1.5;
|
|
52
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heading — renders h1–h6 with a hover-reveal anchor link icon.
|
|
3
|
+
*
|
|
4
|
+
* Clicking the icon does three things via a plain <a href="#id">:
|
|
5
|
+
* 1. Browser natively updates the URL to currentPath#id
|
|
6
|
+
* 2. Browser natively scrolls the heading into view (scroll-margin-top in
|
|
7
|
+
* Content.module.css already accounts for the fixed topnav offset)
|
|
8
|
+
* 3. onClick copies the full URL (with hash) to the clipboard and shows
|
|
9
|
+
* a brief "Copied" tooltip
|
|
10
|
+
*
|
|
11
|
+
* The icon is hidden by default and revealed on heading hover via CSS.
|
|
12
|
+
* Registered as a custom Markdoc `heading` node in markdoc-config.ts.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React, { useState } from 'react';
|
|
16
|
+
import styles from './Heading.module.css';
|
|
17
|
+
|
|
18
|
+
interface HeadingProps {
|
|
19
|
+
id: string;
|
|
20
|
+
level: number;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function LinkIcon() {
|
|
25
|
+
return (
|
|
26
|
+
<svg
|
|
27
|
+
width="0.75em"
|
|
28
|
+
height="0.75em"
|
|
29
|
+
viewBox="0 0 24 24"
|
|
30
|
+
fill="none"
|
|
31
|
+
stroke="currentColor"
|
|
32
|
+
strokeWidth="2"
|
|
33
|
+
strokeLinecap="round"
|
|
34
|
+
strokeLinejoin="round"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
>
|
|
37
|
+
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
38
|
+
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function Heading({ id, level, children }: HeadingProps) {
|
|
44
|
+
const [copied, setCopied] = useState(false);
|
|
45
|
+
const Tag = `h${level}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
46
|
+
|
|
47
|
+
function handleClick(e: React.MouseEvent<HTMLAnchorElement>) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
const el = document.getElementById(id);
|
|
50
|
+
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
51
|
+
history.pushState(null, '', `#${id}`);
|
|
52
|
+
const url = `${window.location.origin}${window.location.pathname}#${id}`;
|
|
53
|
+
navigator.clipboard.writeText(url).then(() => {
|
|
54
|
+
setCopied(true);
|
|
55
|
+
setTimeout(() => setCopied(false), 2000);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Tag id={id} className={styles.heading}>
|
|
61
|
+
{children}
|
|
62
|
+
<a
|
|
63
|
+
href={`#${id}`}
|
|
64
|
+
onClick={handleClick}
|
|
65
|
+
className={styles.anchor}
|
|
66
|
+
aria-label="Copy link to this section"
|
|
67
|
+
>
|
|
68
|
+
<LinkIcon />
|
|
69
|
+
{copied && <span className={styles.tooltip}>Copied</span>}
|
|
70
|
+
</a>
|
|
71
|
+
</Tag>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default Heading;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
IMAGE TOKENS
|
|
3
|
+
============================================================ */
|
|
4
|
+
:root {
|
|
5
|
+
--image-overlay-bg: rgba(0, 0, 0, 0.82);
|
|
6
|
+
--image-caption-color: var(--color-fg-muted);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* ── Inline figure ───────────────────────────────────────────── */
|
|
10
|
+
|
|
11
|
+
.figure {
|
|
12
|
+
margin: 1.5rem 0;
|
|
13
|
+
cursor: zoom-in;
|
|
14
|
+
display: inline-block;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.image {
|
|
19
|
+
display: block;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
height: auto;
|
|
22
|
+
border-radius: var(--radius-md);
|
|
23
|
+
border: 1px solid var(--color-border);
|
|
24
|
+
transition: filter 150ms ease, transform 150ms ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.figure:hover .image {
|
|
28
|
+
filter: brightness(0.95);
|
|
29
|
+
transform: scale(1.005);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.caption {
|
|
33
|
+
margin: 0.5rem 0 0;
|
|
34
|
+
font-size: 0.8125rem;
|
|
35
|
+
color: var(--image-caption-color);
|
|
36
|
+
text-align: center;
|
|
37
|
+
font-style: italic;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ── Lightbox overlay ────────────────────────────────────────── */
|
|
41
|
+
|
|
42
|
+
.overlay {
|
|
43
|
+
position: fixed;
|
|
44
|
+
inset: 0;
|
|
45
|
+
z-index: 1000;
|
|
46
|
+
background: var(--image-overlay-bg);
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
animation: overlayFadeIn 150ms ease forwards;
|
|
51
|
+
cursor: zoom-out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes overlayFadeIn {
|
|
55
|
+
from { opacity: 0; }
|
|
56
|
+
to { opacity: 1; }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* ── Close button ────────────────────────────────────────────── */
|
|
60
|
+
|
|
61
|
+
.closeButton {
|
|
62
|
+
position: fixed;
|
|
63
|
+
top: 1.25rem;
|
|
64
|
+
right: 1.25rem;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
width: 2.25rem;
|
|
69
|
+
height: 2.25rem;
|
|
70
|
+
background: rgba(255, 255, 255, 0.12);
|
|
71
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
72
|
+
border-radius: var(--radius-md);
|
|
73
|
+
color: #ffffff;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
transition: background 150ms ease;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.closeButton:hover {
|
|
79
|
+
background: rgba(255, 255, 255, 0.22);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ── Lightbox image ──────────────────────────────────────────── */
|
|
83
|
+
|
|
84
|
+
.lightboxImageWrap {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
align-items: center;
|
|
88
|
+
cursor: default;
|
|
89
|
+
max-width: min(90vw, 1200px);
|
|
90
|
+
animation: imageFadeIn 180ms ease forwards;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes imageFadeIn {
|
|
94
|
+
from { opacity: 0; transform: scale(0.97); }
|
|
95
|
+
to { opacity: 1; transform: scale(1); }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.lightboxImage {
|
|
99
|
+
display: block;
|
|
100
|
+
max-width: 100%;
|
|
101
|
+
max-height: 85vh;
|
|
102
|
+
object-fit: contain;
|
|
103
|
+
border-radius: var(--radius-md);
|
|
104
|
+
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.lightboxCaption {
|
|
108
|
+
margin: 0.75rem 0 0;
|
|
109
|
+
font-size: 0.875rem;
|
|
110
|
+
color: rgba(255, 255, 255, 0.65);
|
|
111
|
+
text-align: center;
|
|
112
|
+
font-style: italic;
|
|
113
|
+
}
|