zudoku 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.js +0 -6
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/common.d.ts +288 -420
- package/dist/config/validators/common.js +0 -10
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +108 -161
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Markdown.d.ts +1 -3
- package/dist/lib/components/Markdown.js +14 -8
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/index.d.ts +1 -2
- package/dist/lib/core/ZudokuContext.d.ts +0 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +15 -10
- package/dist/lib/ui/SyntaxHighlight.js +60 -10
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -9
- package/dist/lib/util/MdxComponents.js +10 -9
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/config.js +0 -34
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +11 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AuthenticationPlugin-DPCuR3xm.js +58 -0
- package/lib/{AuthenticationPlugin-EeQpQI3D.js.map → AuthenticationPlugin-DPCuR3xm.js.map} +1 -1
- package/lib/{Button-Bdk_Ij3U.js → Button-BBNrKpQd.js} +3 -3
- package/lib/{Button-Bdk_Ij3U.js.map → Button-BBNrKpQd.js.map} +1 -1
- package/lib/{Callout-XadUe37J.js → Callout-D3Ja4OPX.js} +12 -12
- package/lib/{Callout-XadUe37J.js.map → Callout-D3Ja4OPX.js.map} +1 -1
- package/lib/{CategoryHeading-DZi-Szor.js → CategoryHeading-D06WK_Wo.js} +2 -2
- package/lib/{CategoryHeading-DZi-Szor.js.map → CategoryHeading-D06WK_Wo.js.map} +1 -1
- package/lib/{Dialog-CNf2oWXG.js → Dialog-ByYz4ABw.js} +2 -2
- package/lib/{Dialog-CNf2oWXG.js.map → Dialog-ByYz4ABw.js.map} +1 -1
- package/lib/{Drawer-BPBxzel2.js → Drawer-CEwbkLDb.js} +25 -25
- package/lib/{Drawer-BPBxzel2.js.map → Drawer-CEwbkLDb.js.map} +1 -1
- package/lib/Markdown-mFpg_n9p.js +17125 -0
- package/lib/Markdown-mFpg_n9p.js.map +1 -0
- package/lib/MdxPage-Cm7atiW3.js +85 -0
- package/lib/{MdxPage-Dxbq6lFr.js.map → MdxPage-Cm7atiW3.js.map} +1 -1
- package/lib/{OasProvider-DKpTJMH2.js → OasProvider-CZiF_RMW.js} +4 -4
- package/lib/{OasProvider-DKpTJMH2.js.map → OasProvider-CZiF_RMW.js.map} +1 -1
- package/lib/{OperationList-DVOyNeno.js → OperationList-CMMzLfIZ.js} +1417 -1385
- package/lib/{OperationList-DVOyNeno.js.map → OperationList-CMMzLfIZ.js.map} +1 -1
- package/lib/{Pagination-COMmV-g9.js → Pagination-DLPL5z77.js} +4 -4
- package/lib/{Pagination-COMmV-g9.js.map → Pagination-DLPL5z77.js.map} +1 -1
- package/lib/RouteGuard-DRtEu9nh.js +744 -0
- package/lib/{RouteGuard-CGqivwrh.js.map → RouteGuard-DRtEu9nh.js.map} +1 -1
- package/lib/{SchemaList-BTWzXyYQ.js → SchemaList-_d3Mf4IX.js} +44 -43
- package/lib/{SchemaList-BTWzXyYQ.js.map → SchemaList-_d3Mf4IX.js.map} +1 -1
- package/lib/{SchemaView-DNKKW3nB.js → SchemaView-J7Srn-Iy.js} +11 -7
- package/lib/{SchemaView-DNKKW3nB.js.map → SchemaView-J7Srn-Iy.js.map} +1 -1
- package/lib/Select-CT64Ou40.js +223 -0
- package/lib/{Select-m-ITdvFa.js.map → Select-CT64Ou40.js.map} +1 -1
- package/lib/SlotletProvider-CS_nO-XT.js +340 -0
- package/lib/SlotletProvider-CS_nO-XT.js.map +1 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js +2890 -0
- package/lib/SyntaxHighlight-CxhyyMkF.js.map +1 -0
- package/lib/{Toc-CzMOgcPS.js → Toc-D_tV8_Ri.js} +3 -3
- package/lib/{Toc-CzMOgcPS.js.map → Toc-D_tV8_Ri.js.map} +1 -1
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js → chunk-BAXFHI7N-BVBOl9s0.js} +264 -257
- package/lib/{chunk-BAXFHI7N-CFrZQ7Oh.js.map → chunk-BAXFHI7N-BVBOl9s0.js.map} +1 -1
- package/lib/{circular-D__GEK2G.js → circular-ByJI6Mci.js} +47 -47
- package/lib/{circular-D__GEK2G.js.map → circular-ByJI6Mci.js.map} +1 -1
- package/lib/{cn-CwJPJKOE.js → cn-qaFjX9_3.js} +29 -28
- package/lib/{cn-CwJPJKOE.js.map → cn-qaFjX9_3.js.map} +1 -1
- package/lib/{createServer-B4l2NSkt.js → createServer-IW7v5hWm.js} +3868 -3724
- package/lib/{createServer-B4l2NSkt.js.map → createServer-IW7v5hWm.js.map} +1 -1
- package/lib/hook-CldJlP5c.js +1478 -0
- package/lib/{hook-CyNmcNr8.js.map → hook-CldJlP5c.js.map} +1 -1
- package/lib/{index-CCS3ifKs.js → index-BPqJMdth.js} +733 -690
- package/lib/{index-CCS3ifKs.js.map → index-BPqJMdth.js.map} +1 -1
- package/lib/{index-Z13x6tPX.js → index-CPNSgwSb.js} +5 -5
- package/lib/{index-Z13x6tPX.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/{index-CrcNWbel.js → index-CuBIgTKC.js} +9 -9
- package/lib/{index-CrcNWbel.js.map → index-CuBIgTKC.js.map} +1 -1
- package/lib/{index-zddirpDj.js → index-DcHeSvkE.js} +609 -581
- package/lib/{index-zddirpDj.js.map → index-DcHeSvkE.js.map} +1 -1
- package/lib/index-DnQftvP4.js +5031 -0
- package/lib/{index-BcMPFdRU.js.map → index-DnQftvP4.js.map} +1 -1
- package/lib/{index--oeBayMa.js → index-DwT-v3zK.js} +2 -2
- package/lib/{index--oeBayMa.js.map → index-DwT-v3zK.js.map} +1 -1
- package/lib/{index-BvvmIczU.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-BvvmIczU.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/{invariant-D3QcI9fa.js.map → invariant-Caa8-XvF.js.map} +1 -1
- package/lib/mutation-DBQh7AOZ.js +211 -0
- package/lib/{mutation-narTVsCe.js.map → mutation-DBQh7AOZ.js.map} +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js +7 -0
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -0
- package/lib/prism-csharp.min-C43x1RY2.js +63 -0
- package/lib/prism-csharp.min-C43x1RY2.js.map +1 -0
- package/lib/prism-java.min-CQzr40NQ.js +35 -0
- package/lib/prism-java.min-CQzr40NQ.js.map +1 -0
- package/lib/prism-javascript.min-CEqHqgbm.js +9 -0
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +2 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js +61 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -0
- package/lib/prism-markup-BNGj0Tvm.js +174 -0
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js +38 -0
- package/lib/prism-ruby.min-L9OdQ6tU.js.map +1 -0
- package/lib/prism-typescript.min-qTySPvCh.js +34 -0
- package/lib/prism-typescript.min-qTySPvCh.js.map +1 -0
- package/lib/processors/removeParameters.js +28 -27
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js +17 -17
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +7 -7
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +175 -175
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Command.js +58 -58
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +6 -4
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useExposedProps-n1u49409.js → useExposedProps-DbIZXspi.js} +2 -2
- package/lib/{useExposedProps-n1u49409.js.map → useExposedProps-DbIZXspi.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +31 -28
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +68 -62
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +483 -475
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +45 -45
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +28 -25
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +27 -26
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +110 -107
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +6 -16
- package/src/app/main.css +3 -53
- package/src/app/main.tsx +0 -7
- package/src/lib/components/Markdown.tsx +24 -29
- package/src/lib/core/ZudokuContext.ts +0 -4
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +2 -5
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +2 -2
- package/src/lib/ui/Callout.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +182 -18
- package/src/lib/util/MdxComponents.tsx +14 -27
- package/dist/lib/shiki.d.ts +0 -35
- package/dist/lib/shiki.js +0 -103
- package/dist/lib/shiki.js.map +0 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -16
- package/dist/lib/ui/CodeBlock.js +0 -18
- package/dist/lib/ui/CodeBlock.js.map +0 -1
- package/dist/vite/plugin-shiki-register.d.ts +0 -3
- package/dist/vite/plugin-shiki-register.js +0 -38
- package/dist/vite/plugin-shiki-register.js.map +0 -1
- package/lib/AuthenticationPlugin-EeQpQI3D.js +0 -55
- package/lib/Markdown-1l-DtDbF.js +0 -7688
- package/lib/Markdown-1l-DtDbF.js.map +0 -1
- package/lib/MdxPage-Dxbq6lFr.js +0 -84
- package/lib/RouteGuard-CGqivwrh.js +0 -733
- package/lib/Select-m-ITdvFa.js +0 -211
- package/lib/SlotletProvider-DhK1Fmm9.js +0 -254
- package/lib/SlotletProvider-DhK1Fmm9.js.map +0 -1
- package/lib/SyntaxHighlight-CJ6FoYvt.js +0 -9104
- package/lib/SyntaxHighlight-CJ6FoYvt.js.map +0 -1
- package/lib/hook-CyNmcNr8.js +0 -1443
- package/lib/index-BcMPFdRU.js +0 -4975
- package/lib/invariant-D3QcI9fa.js +0 -22
- package/lib/mutation-narTVsCe.js +0 -196
- package/lib/ui/CodeBlock.js +0 -83
- package/lib/ui/CodeBlock.js.map +0 -1
- package/src/lib/shiki.ts +0 -129
- package/src/lib/ui/CodeBlock.tsx +0 -102
- package/src/shiki/langs/abap.js +0 -1
- package/src/shiki/langs/actionscript-3.js +0 -1
- package/src/shiki/langs/ada.js +0 -1
- package/src/shiki/langs/angular-expression.js +0 -1
- package/src/shiki/langs/angular-html.js +0 -1
- package/src/shiki/langs/angular-inline-style.js +0 -1
- package/src/shiki/langs/angular-inline-template.js +0 -1
- package/src/shiki/langs/angular-let-declaration.js +0 -1
- package/src/shiki/langs/angular-template-blocks.js +0 -1
- package/src/shiki/langs/angular-template.js +0 -1
- package/src/shiki/langs/angular-ts.js +0 -1
- package/src/shiki/langs/apache.js +0 -1
- package/src/shiki/langs/apex.js +0 -1
- package/src/shiki/langs/apl.js +0 -1
- package/src/shiki/langs/applescript.js +0 -1
- package/src/shiki/langs/ara.js +0 -1
- package/src/shiki/langs/asciidoc.js +0 -1
- package/src/shiki/langs/asm.js +0 -1
- package/src/shiki/langs/astro.js +0 -1
- package/src/shiki/langs/awk.js +0 -1
- package/src/shiki/langs/ballerina.js +0 -1
- package/src/shiki/langs/bat.js +0 -1
- package/src/shiki/langs/beancount.js +0 -1
- package/src/shiki/langs/berry.js +0 -1
- package/src/shiki/langs/bibtex.js +0 -1
- package/src/shiki/langs/bicep.js +0 -1
- package/src/shiki/langs/blade.js +0 -1
- package/src/shiki/langs/bsl.js +0 -1
- package/src/shiki/langs/c.js +0 -1
- package/src/shiki/langs/cadence.js +0 -1
- package/src/shiki/langs/cairo.js +0 -1
- package/src/shiki/langs/clarity.js +0 -1
- package/src/shiki/langs/clojure.js +0 -1
- package/src/shiki/langs/cmake.js +0 -1
- package/src/shiki/langs/cobol.js +0 -1
- package/src/shiki/langs/codeowners.js +0 -1
- package/src/shiki/langs/codeql.js +0 -1
- package/src/shiki/langs/coffee.js +0 -1
- package/src/shiki/langs/common-lisp.js +0 -1
- package/src/shiki/langs/coq.js +0 -1
- package/src/shiki/langs/cpp-macro.js +0 -1
- package/src/shiki/langs/cpp.js +0 -1
- package/src/shiki/langs/crystal.js +0 -1
- package/src/shiki/langs/csharp.js +0 -1
- package/src/shiki/langs/css.js +0 -1
- package/src/shiki/langs/csv.js +0 -1
- package/src/shiki/langs/cue.js +0 -1
- package/src/shiki/langs/cypher.js +0 -1
- package/src/shiki/langs/d.js +0 -1
- package/src/shiki/langs/dart.js +0 -1
- package/src/shiki/langs/dax.js +0 -1
- package/src/shiki/langs/desktop.js +0 -1
- package/src/shiki/langs/diff.js +0 -1
- package/src/shiki/langs/docker.js +0 -1
- package/src/shiki/langs/dotenv.js +0 -1
- package/src/shiki/langs/dream-maker.js +0 -1
- package/src/shiki/langs/edge.js +0 -1
- package/src/shiki/langs/elixir.js +0 -1
- package/src/shiki/langs/elm.js +0 -1
- package/src/shiki/langs/emacs-lisp.js +0 -1
- package/src/shiki/langs/erb.js +0 -1
- package/src/shiki/langs/erlang.js +0 -1
- package/src/shiki/langs/es-tag-css.js +0 -1
- package/src/shiki/langs/es-tag-glsl.js +0 -1
- package/src/shiki/langs/es-tag-html.js +0 -1
- package/src/shiki/langs/es-tag-sql.js +0 -1
- package/src/shiki/langs/es-tag-xml.js +0 -1
- package/src/shiki/langs/fennel.js +0 -1
- package/src/shiki/langs/fish.js +0 -1
- package/src/shiki/langs/fluent.js +0 -1
- package/src/shiki/langs/fortran-fixed-form.js +0 -1
- package/src/shiki/langs/fortran-free-form.js +0 -1
- package/src/shiki/langs/fsharp.js +0 -1
- package/src/shiki/langs/gdresource.js +0 -1
- package/src/shiki/langs/gdscript.js +0 -1
- package/src/shiki/langs/gdshader.js +0 -1
- package/src/shiki/langs/genie.js +0 -1
- package/src/shiki/langs/gherkin.js +0 -1
- package/src/shiki/langs/git-commit.js +0 -1
- package/src/shiki/langs/git-rebase.js +0 -1
- package/src/shiki/langs/gleam.js +0 -1
- package/src/shiki/langs/glimmer-js.js +0 -1
- package/src/shiki/langs/glimmer-ts.js +0 -1
- package/src/shiki/langs/glsl.js +0 -1
- package/src/shiki/langs/gnuplot.js +0 -1
- package/src/shiki/langs/go.js +0 -1
- package/src/shiki/langs/graphql.js +0 -1
- package/src/shiki/langs/groovy.js +0 -1
- package/src/shiki/langs/hack.js +0 -1
- package/src/shiki/langs/haml.js +0 -1
- package/src/shiki/langs/handlebars.js +0 -1
- package/src/shiki/langs/haskell.js +0 -1
- package/src/shiki/langs/haxe.js +0 -1
- package/src/shiki/langs/hcl.js +0 -1
- package/src/shiki/langs/hjson.js +0 -1
- package/src/shiki/langs/hlsl.js +0 -1
- package/src/shiki/langs/html-derivative.js +0 -1
- package/src/shiki/langs/html.js +0 -1
- package/src/shiki/langs/http.js +0 -1
- package/src/shiki/langs/hxml.js +0 -1
- package/src/shiki/langs/hy.js +0 -1
- package/src/shiki/langs/imba.js +0 -1
- package/src/shiki/langs/ini.js +0 -1
- package/src/shiki/langs/java.js +0 -1
- package/src/shiki/langs/javascript.js +0 -1
- package/src/shiki/langs/jinja-html.js +0 -1
- package/src/shiki/langs/jinja.js +0 -1
- package/src/shiki/langs/jison.js +0 -1
- package/src/shiki/langs/json.js +0 -1
- package/src/shiki/langs/json5.js +0 -1
- package/src/shiki/langs/jsonc.js +0 -1
- package/src/shiki/langs/jsonl.js +0 -1
- package/src/shiki/langs/jsonnet.js +0 -1
- package/src/shiki/langs/jssm.js +0 -1
- package/src/shiki/langs/jsx.js +0 -1
- package/src/shiki/langs/julia.js +0 -1
- package/src/shiki/langs/kotlin.js +0 -1
- package/src/shiki/langs/kusto.js +0 -1
- package/src/shiki/langs/latex.js +0 -1
- package/src/shiki/langs/lean.js +0 -1
- package/src/shiki/langs/less.js +0 -1
- package/src/shiki/langs/liquid.js +0 -1
- package/src/shiki/langs/llvm.js +0 -1
- package/src/shiki/langs/log.js +0 -1
- package/src/shiki/langs/logo.js +0 -1
- package/src/shiki/langs/lua.js +0 -1
- package/src/shiki/langs/luau.js +0 -1
- package/src/shiki/langs/make.js +0 -1
- package/src/shiki/langs/markdown-vue.js +0 -1
- package/src/shiki/langs/markdown.js +0 -1
- package/src/shiki/langs/marko.js +0 -1
- package/src/shiki/langs/matlab.js +0 -1
- package/src/shiki/langs/mdc.js +0 -1
- package/src/shiki/langs/mdx.js +0 -1
- package/src/shiki/langs/mermaid.js +0 -1
- package/src/shiki/langs/mipsasm.js +0 -1
- package/src/shiki/langs/mojo.js +0 -1
- package/src/shiki/langs/move.js +0 -1
- package/src/shiki/langs/narrat.js +0 -1
- package/src/shiki/langs/nextflow.js +0 -1
- package/src/shiki/langs/nginx.js +0 -1
- package/src/shiki/langs/nim.js +0 -1
- package/src/shiki/langs/nix.js +0 -1
- package/src/shiki/langs/nushell.js +0 -1
- package/src/shiki/langs/objective-c.js +0 -1
- package/src/shiki/langs/objective-cpp.js +0 -1
- package/src/shiki/langs/ocaml.js +0 -1
- package/src/shiki/langs/pascal.js +0 -1
- package/src/shiki/langs/perl.js +0 -1
- package/src/shiki/langs/php.js +0 -1
- package/src/shiki/langs/plsql.js +0 -1
- package/src/shiki/langs/po.js +0 -1
- package/src/shiki/langs/polar.js +0 -1
- package/src/shiki/langs/postcss.js +0 -1
- package/src/shiki/langs/powerquery.js +0 -1
- package/src/shiki/langs/powershell.js +0 -1
- package/src/shiki/langs/prisma.js +0 -1
- package/src/shiki/langs/prolog.js +0 -1
- package/src/shiki/langs/proto.js +0 -1
- package/src/shiki/langs/pug.js +0 -1
- package/src/shiki/langs/puppet.js +0 -1
- package/src/shiki/langs/purescript.js +0 -1
- package/src/shiki/langs/python.js +0 -1
- package/src/shiki/langs/qml.js +0 -1
- package/src/shiki/langs/qmldir.js +0 -1
- package/src/shiki/langs/qss.js +0 -1
- package/src/shiki/langs/r.js +0 -1
- package/src/shiki/langs/racket.js +0 -1
- package/src/shiki/langs/raku.js +0 -1
- package/src/shiki/langs/razor.js +0 -1
- package/src/shiki/langs/reg.js +0 -1
- package/src/shiki/langs/regexp.js +0 -1
- package/src/shiki/langs/rel.js +0 -1
- package/src/shiki/langs/riscv.js +0 -1
- package/src/shiki/langs/rst.js +0 -1
- package/src/shiki/langs/ruby.js +0 -1
- package/src/shiki/langs/rust.js +0 -1
- package/src/shiki/langs/sas.js +0 -1
- package/src/shiki/langs/sass.js +0 -1
- package/src/shiki/langs/scala.js +0 -1
- package/src/shiki/langs/scheme.js +0 -1
- package/src/shiki/langs/scss.js +0 -1
- package/src/shiki/langs/sdbl.js +0 -1
- package/src/shiki/langs/shaderlab.js +0 -1
- package/src/shiki/langs/shellscript.js +0 -1
- package/src/shiki/langs/shellsession.js +0 -1
- package/src/shiki/langs/smalltalk.js +0 -1
- package/src/shiki/langs/solidity.js +0 -1
- package/src/shiki/langs/soy.js +0 -1
- package/src/shiki/langs/sparql.js +0 -1
- package/src/shiki/langs/splunk.js +0 -1
- package/src/shiki/langs/sql.js +0 -1
- package/src/shiki/langs/ssh-config.js +0 -1
- package/src/shiki/langs/stata.js +0 -1
- package/src/shiki/langs/stylus.js +0 -1
- package/src/shiki/langs/svelte.js +0 -1
- package/src/shiki/langs/swift.js +0 -1
- package/src/shiki/langs/system-verilog.js +0 -1
- package/src/shiki/langs/systemd.js +0 -1
- package/src/shiki/langs/talonscript.js +0 -1
- package/src/shiki/langs/tasl.js +0 -1
- package/src/shiki/langs/tcl.js +0 -1
- package/src/shiki/langs/templ.js +0 -1
- package/src/shiki/langs/terraform.js +0 -1
- package/src/shiki/langs/tex.js +0 -1
- package/src/shiki/langs/toml.js +0 -1
- package/src/shiki/langs/ts-tags.js +0 -1
- package/src/shiki/langs/tsv.js +0 -1
- package/src/shiki/langs/tsx.js +0 -1
- package/src/shiki/langs/turtle.js +0 -1
- package/src/shiki/langs/twig.js +0 -1
- package/src/shiki/langs/typescript.js +0 -1
- package/src/shiki/langs/typespec.js +0 -1
- package/src/shiki/langs/typst.js +0 -1
- package/src/shiki/langs/v.js +0 -1
- package/src/shiki/langs/vala.js +0 -1
- package/src/shiki/langs/vb.js +0 -1
- package/src/shiki/langs/verilog.js +0 -1
- package/src/shiki/langs/vhdl.js +0 -1
- package/src/shiki/langs/viml.js +0 -1
- package/src/shiki/langs/vue-directives.js +0 -1
- package/src/shiki/langs/vue-html.js +0 -1
- package/src/shiki/langs/vue-interpolations.js +0 -1
- package/src/shiki/langs/vue-sfc-style-variable-injection.js +0 -1
- package/src/shiki/langs/vue.js +0 -1
- package/src/shiki/langs/vyper.js +0 -1
- package/src/shiki/langs/wasm.js +0 -1
- package/src/shiki/langs/wenyan.js +0 -1
- package/src/shiki/langs/wgsl.js +0 -1
- package/src/shiki/langs/wikitext.js +0 -1
- package/src/shiki/langs/wit.js +0 -1
- package/src/shiki/langs/wolfram.js +0 -1
- package/src/shiki/langs/xml.js +0 -1
- package/src/shiki/langs/xsl.js +0 -1
- package/src/shiki/langs/yaml.js +0 -1
- package/src/shiki/langs/zenscript.js +0 -1
- package/src/shiki/langs/zig.js +0 -1
- package/src/shiki/themes/andromeeda.js +0 -1
- package/src/shiki/themes/aurora-x.js +0 -1
- package/src/shiki/themes/ayu-dark.js +0 -1
- package/src/shiki/themes/catppuccin-frappe.js +0 -1
- package/src/shiki/themes/catppuccin-latte.js +0 -1
- package/src/shiki/themes/catppuccin-macchiato.js +0 -1
- package/src/shiki/themes/catppuccin-mocha.js +0 -1
- package/src/shiki/themes/dark-plus.js +0 -1
- package/src/shiki/themes/dracula-soft.js +0 -1
- package/src/shiki/themes/dracula.js +0 -1
- package/src/shiki/themes/everforest-dark.js +0 -1
- package/src/shiki/themes/everforest-light.js +0 -1
- package/src/shiki/themes/github-dark-default.js +0 -1
- package/src/shiki/themes/github-dark-dimmed.js +0 -1
- package/src/shiki/themes/github-dark-high-contrast.js +0 -1
- package/src/shiki/themes/github-dark.js +0 -1
- package/src/shiki/themes/github-light-default.js +0 -1
- package/src/shiki/themes/github-light-high-contrast.js +0 -1
- package/src/shiki/themes/github-light.js +0 -1
- package/src/shiki/themes/gruvbox-dark-hard.js +0 -1
- package/src/shiki/themes/gruvbox-dark-medium.js +0 -1
- package/src/shiki/themes/gruvbox-dark-soft.js +0 -1
- package/src/shiki/themes/gruvbox-light-hard.js +0 -1
- package/src/shiki/themes/gruvbox-light-medium.js +0 -1
- package/src/shiki/themes/gruvbox-light-soft.js +0 -1
- package/src/shiki/themes/houston.js +0 -1
- package/src/shiki/themes/kanagawa-dragon.js +0 -1
- package/src/shiki/themes/kanagawa-lotus.js +0 -1
- package/src/shiki/themes/kanagawa-wave.js +0 -1
- package/src/shiki/themes/laserwave.js +0 -1
- package/src/shiki/themes/light-plus.js +0 -1
- package/src/shiki/themes/material-theme-darker.js +0 -1
- package/src/shiki/themes/material-theme-lighter.js +0 -1
- package/src/shiki/themes/material-theme-ocean.js +0 -1
- package/src/shiki/themes/material-theme-palenight.js +0 -1
- package/src/shiki/themes/material-theme.js +0 -1
- package/src/shiki/themes/min-dark.js +0 -1
- package/src/shiki/themes/min-light.js +0 -1
- package/src/shiki/themes/monokai.js +0 -1
- package/src/shiki/themes/night-owl.js +0 -1
- package/src/shiki/themes/nord.js +0 -1
- package/src/shiki/themes/one-dark-pro.js +0 -1
- package/src/shiki/themes/one-light.js +0 -1
- package/src/shiki/themes/plastic.js +0 -1
- package/src/shiki/themes/poimandres.js +0 -1
- package/src/shiki/themes/red.js +0 -1
- package/src/shiki/themes/rose-pine-dawn.js +0 -1
- package/src/shiki/themes/rose-pine-moon.js +0 -1
- package/src/shiki/themes/rose-pine.js +0 -1
- package/src/shiki/themes/slack-dark.js +0 -1
- package/src/shiki/themes/slack-ochin.js +0 -1
- package/src/shiki/themes/snazzy-light.js +0 -1
- package/src/shiki/themes/solarized-dark.js +0 -1
- package/src/shiki/themes/solarized-light.js +0 -1
- package/src/shiki/themes/synthwave-84.js +0 -1
- package/src/shiki/themes/tokyo-night.js +0 -1
- package/src/shiki/themes/vesper.js +0 -1
- package/src/shiki/themes/vitesse-black.js +0 -1
- package/src/shiki/themes/vitesse-dark.js +0 -1
- package/src/shiki/themes/vitesse-light.js +0 -1
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
import { memo } from "react";
|
|
2
|
-
import
|
|
2
|
+
import rehypeRaw from "rehype-raw";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
|
-
import {
|
|
4
|
+
import { visit } from "unist-util-visit";
|
|
5
5
|
import { MdxComponents } from "../util/MdxComponents.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ReactMarkdown } from "./ReactMarkdown.js";
|
|
7
|
+
|
|
8
|
+
// same as in packages/dev-portal/framework/vite.ts
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
const rehypeCodeBlockPlugin = () => (tree: any) => {
|
|
11
|
+
visit(tree, "element", (node, _index, parent) => {
|
|
12
|
+
if (node.tagName === "code") {
|
|
13
|
+
node.properties.inline = String(parent?.tagName !== "pre");
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
7
17
|
|
|
8
18
|
const remarkPlugins = [remarkGfm];
|
|
19
|
+
const rehypePlugins = [rehypeCodeBlockPlugin, rehypeRaw];
|
|
9
20
|
|
|
10
21
|
// other styles are defined in main.css .prose
|
|
11
22
|
export const ProseClasses = "prose dark:prose-invert prose-neutral";
|
|
12
23
|
|
|
13
24
|
export const Markdown = memo(
|
|
14
|
-
({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const rehypePlugins = createConfiguredShikiRehypePlugins(
|
|
25
|
-
syntaxHighlighting?.themes,
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div className={className}>
|
|
30
|
-
<MarkdownHooks
|
|
31
|
-
remarkPlugins={remarkPlugins}
|
|
32
|
-
rehypePlugins={rehypePlugins}
|
|
33
|
-
components={{ ...MdxComponents, ...components }}
|
|
34
|
-
>
|
|
35
|
-
{content}
|
|
36
|
-
</MarkdownHooks>
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
},
|
|
25
|
+
({ content, className }: { content: string; className?: string }) => (
|
|
26
|
+
<ReactMarkdown
|
|
27
|
+
remarkPlugins={remarkPlugins}
|
|
28
|
+
rehypePlugins={rehypePlugins}
|
|
29
|
+
components={MdxComponents}
|
|
30
|
+
className={className}
|
|
31
|
+
>
|
|
32
|
+
{content}
|
|
33
|
+
</ReactMarkdown>
|
|
34
|
+
),
|
|
40
35
|
);
|
|
41
36
|
|
|
42
37
|
Markdown.displayName = "Markdown";
|
|
@@ -2,7 +2,6 @@ import type { QueryClient } from "@tanstack/react-query";
|
|
|
2
2
|
import { createNanoEvents } from "nanoevents";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
4
|
import type { Location } from "react-router";
|
|
5
|
-
import type { BundledTheme } from "shiki";
|
|
6
5
|
import type { z } from "zod";
|
|
7
6
|
import type {
|
|
8
7
|
FooterSchema,
|
|
@@ -90,9 +89,6 @@ export type ZudokuContextOptions = {
|
|
|
90
89
|
};
|
|
91
90
|
overrides?: ComponentsContextType;
|
|
92
91
|
protectedRoutes?: string[];
|
|
93
|
-
syntaxHighlighting?: {
|
|
94
|
-
themes?: { light: BundledTheme; dark: BundledTheme };
|
|
95
|
-
};
|
|
96
92
|
};
|
|
97
93
|
|
|
98
94
|
export class ZudokuContext {
|
|
@@ -49,7 +49,7 @@ export const CollapsibleCode = ({
|
|
|
49
49
|
)}
|
|
50
50
|
>
|
|
51
51
|
{!open && isOverflowing && (
|
|
52
|
-
<div className=" absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/60 dark:to-zinc-950/90 z-10
|
|
52
|
+
<div className=" absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/60 dark:to-zinc-950/90 z-10 group-hover:to-transparent"></div>
|
|
53
53
|
)}
|
|
54
54
|
<div ref={contentRef}>{children}</div>
|
|
55
55
|
{!open && isOverflowing && (
|
|
@@ -68,10 +68,7 @@ export const CollapsibleCode = ({
|
|
|
68
68
|
</CollapsibleContent>
|
|
69
69
|
{isOverflowing && (
|
|
70
70
|
<div
|
|
71
|
-
className={cn(
|
|
72
|
-
"flex justify-center w-full py-2 bg-muted/50",
|
|
73
|
-
!open && "hidden",
|
|
74
|
-
)}
|
|
71
|
+
className={cn("flex justify-center w-full mb-2", !open && "hidden")}
|
|
75
72
|
>
|
|
76
73
|
<CollapsibleTrigger asChild>
|
|
77
74
|
<Button variant="outline" size="sm">
|
|
@@ -225,7 +225,7 @@ export const Sidecar = ({
|
|
|
225
225
|
<SyntaxHighlight
|
|
226
226
|
language={selectedLang}
|
|
227
227
|
noBackground
|
|
228
|
-
className="[--scrollbar-color:gray]
|
|
228
|
+
className="[--scrollbar-color:gray] text-xs max-h-[500px] p-2"
|
|
229
229
|
code={code!}
|
|
230
230
|
/>
|
|
231
231
|
</CollapsibleCode>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SchemaObject } from "../../oas/parser/index.js";
|
|
3
3
|
import { SyntaxHighlight } from "../../ui/SyntaxHighlight.js";
|
|
4
4
|
import { CollapsibleCode } from "./CollapsibleCode.js";
|
|
5
5
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
@@ -97,7 +97,7 @@ export const SidecarExamples = ({
|
|
|
97
97
|
<SyntaxHighlight
|
|
98
98
|
language={language}
|
|
99
99
|
noBackground
|
|
100
|
-
className="[--scrollbar-color:gray]
|
|
100
|
+
className="[--scrollbar-color:gray] text-xs max-h-[500px] p-2"
|
|
101
101
|
code={formattedExample}
|
|
102
102
|
/>
|
|
103
103
|
</CollapsibleCode>
|
package/src/lib/ui/Callout.tsx
CHANGED
|
@@ -77,7 +77,7 @@ export const Callout = ({
|
|
|
77
77
|
"grid grid-cols-[min-content_1fr] items-baseline grid-rows-[fit-content_1fr] gap-x-4 gap-y-2",
|
|
78
78
|
!icon && title && "flex flex-col gap-2",
|
|
79
79
|
"[&_a]:underline [&_a]:decoration-current [&_a]:decoration-from-font [&_a]:underline-offset-4 hover:[&_a]:decoration-1",
|
|
80
|
-
"[&
|
|
80
|
+
"[&_code]:!bg-gray-50 [&_code]:dark:!bg-gray-800 [&_code]:!border-none",
|
|
81
81
|
"[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:ps-4 [&_ul>li]:ps-1 [&_ul>li]:my-1",
|
|
82
82
|
icon && title && "items-center",
|
|
83
83
|
border,
|
|
@@ -1,22 +1,186 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import {
|
|
2
|
+
Highlight,
|
|
3
|
+
Prism,
|
|
4
|
+
themes,
|
|
5
|
+
type HighlightProps,
|
|
6
|
+
} from "prism-react-renderer";
|
|
7
|
+
|
|
8
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
9
|
+
|
|
10
|
+
globalThis.Prism = Prism;
|
|
11
|
+
// @ts-expect-error This is untyped
|
|
12
|
+
void import("prismjs/components/prism-bash.min.js");
|
|
13
|
+
// @ts-expect-error This is untyped
|
|
14
|
+
void import("prismjs/components/prism-ruby.min.js");
|
|
15
|
+
// @ts-expect-error This is untyped
|
|
16
|
+
void import("prismjs/components/prism-markup.js");
|
|
17
|
+
// @ts-expect-error This is untyped
|
|
18
|
+
void import("prismjs/components/prism-json.min.js");
|
|
19
|
+
// @ts-expect-error This is untyped
|
|
20
|
+
void import("prismjs/components/prism-java.min.js");
|
|
21
|
+
// @ts-expect-error This is untyped
|
|
22
|
+
void import("prismjs/components/prism-csharp.min.js");
|
|
23
|
+
// @ts-expect-error This is untyped
|
|
24
|
+
void import("prismjs/components/prism-objectivec.min.js");
|
|
25
|
+
// @ts-expect-error This is untyped
|
|
26
|
+
void import("prismjs/components/prism-markdown.min.js");
|
|
27
|
+
// @ts-expect-error This is untyped
|
|
28
|
+
void import("prismjs/components/prism-javascript.min.js");
|
|
29
|
+
// @ts-expect-error This is untyped
|
|
30
|
+
void import("prismjs/components/prism-typescript.min.js");
|
|
31
|
+
// @ts-expect-error This is untyped
|
|
32
|
+
void import("prismjs/components/prism-jsstacktrace.min.js");
|
|
33
|
+
|
|
34
|
+
import { useTheme } from "next-themes";
|
|
35
|
+
import { memo, useState } from "react";
|
|
36
|
+
import { ClientOnly } from "../components/ClientOnly.js";
|
|
37
|
+
import { cn } from "../util/cn.js";
|
|
38
|
+
|
|
39
|
+
export type SyntaxHighlightProps = {
|
|
40
|
+
className?: string;
|
|
41
|
+
noBackground?: boolean;
|
|
42
|
+
wrapLines?: boolean;
|
|
43
|
+
showLanguageIndicator?: boolean;
|
|
44
|
+
language?: string;
|
|
45
|
+
title?: string;
|
|
46
|
+
children?: string;
|
|
47
|
+
code?: string;
|
|
48
|
+
showCopy?: "hover" | "always" | "never";
|
|
49
|
+
showCopyText?: boolean;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
} & Omit<HighlightProps, "children" | "language">;
|
|
52
|
+
|
|
53
|
+
const remapLang = {
|
|
54
|
+
mdx: "md",
|
|
55
|
+
} as Record<string, string>;
|
|
56
|
+
|
|
57
|
+
const SyntaxHighlightInner = ({
|
|
58
|
+
language = "plain",
|
|
59
|
+
showCopy = "hover",
|
|
60
|
+
showCopyText,
|
|
61
|
+
title,
|
|
62
|
+
children,
|
|
63
|
+
disabled,
|
|
64
|
+
...props
|
|
65
|
+
}: SyntaxHighlightProps) => {
|
|
66
|
+
const { resolvedTheme } = useTheme();
|
|
67
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
68
|
+
|
|
69
|
+
const code = children ?? props.code;
|
|
70
|
+
|
|
71
|
+
if (!code) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const highlightTheme =
|
|
76
|
+
resolvedTheme === "dark" ? themes.vsDark : themes.github;
|
|
77
|
+
|
|
78
|
+
// hardcoded values from the themes to avoid color flash in SSR
|
|
79
|
+
const themeColorClasses =
|
|
80
|
+
"bg-[#f6f8fa] text-[#393a34] dark:bg-[#1e1e1e] dark:text-[#9cdcfe]";
|
|
81
|
+
|
|
82
|
+
const Wrapper = ({
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
style,
|
|
86
|
+
}: {
|
|
87
|
+
children: React.ReactNode;
|
|
88
|
+
className?: string;
|
|
89
|
+
style?: React.CSSProperties;
|
|
90
|
+
}) => (
|
|
91
|
+
<div className="relative group">
|
|
92
|
+
{title && (
|
|
93
|
+
<div className="text-xs text-muted-foreground absolute top-2 font-mono border-b w-full pb-2 px-4 ">
|
|
94
|
+
{title}
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
<pre
|
|
98
|
+
className={cn(
|
|
99
|
+
"relative scrollbar overflow-x-auto",
|
|
100
|
+
props.className,
|
|
101
|
+
props.noBackground ? "!bg-transparent" : themeColorClasses,
|
|
102
|
+
props.wrapLines && "whitespace-pre-wrap break-words",
|
|
103
|
+
title && "pt-10",
|
|
104
|
+
className,
|
|
105
|
+
)}
|
|
106
|
+
style={style}
|
|
107
|
+
>
|
|
108
|
+
{children}
|
|
109
|
+
</pre>
|
|
110
|
+
{props.showLanguageIndicator && (
|
|
111
|
+
<span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
|
|
112
|
+
{language}
|
|
113
|
+
</span>
|
|
114
|
+
)}
|
|
115
|
+
{showCopy !== "never" && (
|
|
116
|
+
<button
|
|
117
|
+
type="button"
|
|
118
|
+
aria-label="Copy code"
|
|
119
|
+
title="Copy code"
|
|
120
|
+
className={cn(
|
|
121
|
+
"absolute top-2 right-2 p-2 hover:outline hover:outline-border/75 dark:hover:outline-border rounded-md text-sm text-muted-foreground transition",
|
|
122
|
+
showCopy === "hover"
|
|
123
|
+
? "opacity-0 group-hover:opacity-100 group-hover:bg-zinc-100 group-hover:dark:bg-zinc-700"
|
|
124
|
+
: "bg-zinc-100 dark:bg-zinc-700",
|
|
125
|
+
showCopyText && "flex gap-2 items-center font-medium",
|
|
126
|
+
)}
|
|
127
|
+
disabled={isCopied}
|
|
128
|
+
onClick={() => {
|
|
129
|
+
setIsCopied(true);
|
|
130
|
+
void navigator.clipboard.writeText(code);
|
|
131
|
+
setTimeout(() => setIsCopied(false), 2000);
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{isCopied ? (
|
|
135
|
+
<CheckIcon
|
|
136
|
+
className="text-emerald-600"
|
|
137
|
+
size={16}
|
|
138
|
+
strokeWidth={2.5}
|
|
139
|
+
absoluteStrokeWidth
|
|
140
|
+
/>
|
|
141
|
+
) : (
|
|
142
|
+
<CopyIcon size={16} />
|
|
143
|
+
)}
|
|
144
|
+
{showCopyText && "Copy"}
|
|
145
|
+
</button>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
if (disabled) {
|
|
151
|
+
return (
|
|
152
|
+
<ClientOnly fallback={<Wrapper>{code}</Wrapper>}>
|
|
153
|
+
<Wrapper>{code}</Wrapper>
|
|
154
|
+
</ClientOnly>
|
|
16
155
|
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<ClientOnly fallback={<Wrapper>{code}</Wrapper>}>
|
|
160
|
+
<Highlight
|
|
161
|
+
theme={highlightTheme}
|
|
162
|
+
language={remapLang[language] ?? language}
|
|
163
|
+
{...props}
|
|
164
|
+
code={code}
|
|
165
|
+
>
|
|
166
|
+
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
|
167
|
+
<Wrapper className={className} style={style}>
|
|
168
|
+
{tokens.map((line, i) => (
|
|
169
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
170
|
+
<div key={i} {...getLineProps({ line })}>
|
|
171
|
+
{line.map((token, key) => (
|
|
172
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
173
|
+
<span key={key} {...getTokenProps({ token })} />
|
|
174
|
+
))}
|
|
175
|
+
</div>
|
|
176
|
+
))}
|
|
177
|
+
</Wrapper>
|
|
178
|
+
)}
|
|
179
|
+
</Highlight>
|
|
180
|
+
</ClientOnly>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
17
183
|
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
);
|
|
184
|
+
export const SyntaxHighlight = memo(SyntaxHighlightInner);
|
|
21
185
|
|
|
22
186
|
SyntaxHighlight.displayName = "SyntaxHighlight";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type MDXComponents } from "mdx/types.js";
|
|
2
|
-
import { CodeBlock } from "zudoku/ui/CodeBlock.js";
|
|
3
2
|
import { AnchorLink } from "../components/AnchorLink.js";
|
|
4
3
|
import { Heading } from "../components/Heading.js";
|
|
5
4
|
import { InlineCode } from "../components/InlineCode.js";
|
|
@@ -7,7 +6,6 @@ import { Button } from "../ui/Button.js";
|
|
|
7
6
|
import { Callout } from "../ui/Callout.js";
|
|
8
7
|
import { Stepper } from "../ui/Stepper.js";
|
|
9
8
|
import { SyntaxHighlight } from "../ui/SyntaxHighlight.js";
|
|
10
|
-
import { cn } from "./cn.js";
|
|
11
9
|
|
|
12
10
|
export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
|
|
13
11
|
|
|
@@ -64,37 +62,26 @@ export const MdxComponents = {
|
|
|
64
62
|
caution: (props) => <Callout type="caution" {...props} />,
|
|
65
63
|
warning: (props) => <Callout type="caution" {...props} />,
|
|
66
64
|
danger: (props) => <Callout type="danger" {...props} />,
|
|
67
|
-
pre: (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
node: _node,
|
|
73
|
-
children,
|
|
74
|
-
title,
|
|
75
|
-
inline,
|
|
76
|
-
showLineNumbers,
|
|
77
|
-
...props
|
|
78
|
-
}) => {
|
|
79
|
-
const match = className?.match(/language?-(\w+)/);
|
|
65
|
+
pre: ({ children }) => <>{children}</>,
|
|
66
|
+
code: ({ className, children, ...props }) => {
|
|
67
|
+
// `inline` provided by the rehype plugin, as react-markdown removed support for that
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
+
const { inline, title } = props as Record<string, unknown>;
|
|
80
70
|
|
|
81
|
-
if (inline ===
|
|
82
|
-
return
|
|
83
|
-
<InlineCode className={cn(className, "inline")}>{children}</InlineCode>
|
|
84
|
-
);
|
|
71
|
+
if (inline === true || inline === "true") {
|
|
72
|
+
return <InlineCode className={className}>{children}</InlineCode>;
|
|
85
73
|
}
|
|
86
74
|
|
|
75
|
+
const match = className?.match(/language?-(\w+)/);
|
|
76
|
+
|
|
87
77
|
return (
|
|
88
|
-
<
|
|
78
|
+
<SyntaxHighlight
|
|
89
79
|
language={match?.[1]}
|
|
80
|
+
className="rounded-xl p-4 border dark:!bg-foreground/10 dark:border-transparent"
|
|
90
81
|
showLanguageIndicator
|
|
91
|
-
|
|
92
|
-
title={title}
|
|
93
|
-
|
|
94
|
-
<code className={cn(className, "not-inline")} {...props}>
|
|
95
|
-
{children}
|
|
96
|
-
</code>
|
|
97
|
-
</CodeBlock>
|
|
82
|
+
code={String(children).trim()}
|
|
83
|
+
title={typeof title === "string" ? title : undefined}
|
|
84
|
+
/>
|
|
98
85
|
);
|
|
99
86
|
},
|
|
100
87
|
} satisfies MdxComponentsType;
|
package/dist/lib/shiki.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
|
|
2
|
-
import type { Root } from "hast";
|
|
3
|
-
import { type JSX } from "react";
|
|
4
|
-
import type { BundledLanguage, BundledTheme } from "shiki";
|
|
5
|
-
export declare const highlighter: import("shiki").HighlighterCore;
|
|
6
|
-
export declare const defaultHighlightOptions: {
|
|
7
|
-
themes: {
|
|
8
|
-
light: "github-light";
|
|
9
|
-
dark: "github-dark";
|
|
10
|
-
};
|
|
11
|
-
defaultColor: false;
|
|
12
|
-
inline: "tailing-curly-colon";
|
|
13
|
-
addLanguageClass: true;
|
|
14
|
-
transformers: import("shiki").ShikiTransformer[];
|
|
15
|
-
parseMetaString: (str: string) => any;
|
|
16
|
-
};
|
|
17
|
-
export declare const defaultLanguages: BundledLanguage[];
|
|
18
|
-
export declare const createConfiguredShikiRehypePlugins: (themes?: {
|
|
19
|
-
light: BundledTheme;
|
|
20
|
-
dark: BundledTheme;
|
|
21
|
-
}) => ((() => (tree: Root) => void) | [typeof rehypeShikiFromHighlighter, import("shiki").HighlighterCore, {
|
|
22
|
-
themes: {
|
|
23
|
-
light: BundledTheme;
|
|
24
|
-
dark: BundledTheme;
|
|
25
|
-
};
|
|
26
|
-
defaultColor: false;
|
|
27
|
-
inline: "tailing-curly-colon";
|
|
28
|
-
addLanguageClass: true;
|
|
29
|
-
transformers: import("shiki").ShikiTransformer[];
|
|
30
|
-
parseMetaString: (str: string) => any;
|
|
31
|
-
}])[];
|
|
32
|
-
export declare const highlight: (code: string, lang?: string, themes?: {
|
|
33
|
-
light: BundledTheme;
|
|
34
|
-
dark: BundledTheme;
|
|
35
|
-
}) => JSX.Element;
|
package/dist/lib/shiki.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
|
|
2
|
-
import { transformerMetaHighlight, transformerMetaWordHighlight, } from "@shikijs/transformers";
|
|
3
|
-
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
4
|
-
import { Fragment } from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { createHighlighterCore } from "shiki/core";
|
|
7
|
-
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
8
|
-
import { visit } from "unist-util-visit";
|
|
9
|
-
import { cn } from "./util/cn.js";
|
|
10
|
-
const engine = createJavaScriptRegexEngine({ forgiving: true });
|
|
11
|
-
export const highlighter = await createHighlighterCore({
|
|
12
|
-
engine,
|
|
13
|
-
langAlias: {
|
|
14
|
-
markup: "html",
|
|
15
|
-
svg: "xml",
|
|
16
|
-
mathml: "xml",
|
|
17
|
-
atom: "xml",
|
|
18
|
-
ssml: "xml",
|
|
19
|
-
rss: "xml",
|
|
20
|
-
webmanifest: "json",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
export const defaultHighlightOptions = {
|
|
24
|
-
themes: {
|
|
25
|
-
light: "github-light",
|
|
26
|
-
dark: "github-dark",
|
|
27
|
-
},
|
|
28
|
-
defaultColor: false,
|
|
29
|
-
inline: "tailing-curly-colon",
|
|
30
|
-
addLanguageClass: true,
|
|
31
|
-
transformers: [transformerMetaHighlight(), transformerMetaWordHighlight()],
|
|
32
|
-
parseMetaString: (str) => {
|
|
33
|
-
// Matches key="value", key=value, or key attributes
|
|
34
|
-
const matches = str.matchAll(/([a-z0-9]+)(?:=(["'])(.*?)\2|=(.*?)(?:\s|$)|(?:\s|$))/gi);
|
|
35
|
-
return Object.fromEntries(Array.from(matches).map((match) => {
|
|
36
|
-
const key = match[1];
|
|
37
|
-
const value = match[3] || match[4] || true;
|
|
38
|
-
return [key, value];
|
|
39
|
-
}));
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
export const defaultLanguages = [
|
|
43
|
-
"shellscript",
|
|
44
|
-
"javascript",
|
|
45
|
-
"jsx",
|
|
46
|
-
"typescript",
|
|
47
|
-
"tsx",
|
|
48
|
-
"json",
|
|
49
|
-
"python",
|
|
50
|
-
"java",
|
|
51
|
-
"go",
|
|
52
|
-
"csharp",
|
|
53
|
-
"kotlin",
|
|
54
|
-
"objective-c",
|
|
55
|
-
"php",
|
|
56
|
-
"ruby",
|
|
57
|
-
"swift",
|
|
58
|
-
"css",
|
|
59
|
-
"html",
|
|
60
|
-
"xml",
|
|
61
|
-
"yaml",
|
|
62
|
-
"markdown",
|
|
63
|
-
"mdx",
|
|
64
|
-
];
|
|
65
|
-
const rehypeCodeBlockPlugin = () => (tree) => {
|
|
66
|
-
visit(tree, "element", (node, _index, parent) => {
|
|
67
|
-
if (node.tagName !== "code")
|
|
68
|
-
return;
|
|
69
|
-
const isCodeBlock = parent?.type === "element" && parent.tagName === "pre";
|
|
70
|
-
node.properties.inline = JSON.stringify(!isCodeBlock);
|
|
71
|
-
// Pass through properties from <pre> to <code> so we can handle it in `code` only
|
|
72
|
-
if (isCodeBlock) {
|
|
73
|
-
node.properties = {
|
|
74
|
-
...node.properties,
|
|
75
|
-
...structuredClone(parent.properties),
|
|
76
|
-
class: cn(node.properties.class, parent.properties.class),
|
|
77
|
-
};
|
|
78
|
-
parent.properties = {};
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
export const createConfiguredShikiRehypePlugins = (themes) => {
|
|
83
|
-
return [
|
|
84
|
-
[
|
|
85
|
-
rehypeShikiFromHighlighter,
|
|
86
|
-
highlighter,
|
|
87
|
-
{
|
|
88
|
-
...defaultHighlightOptions,
|
|
89
|
-
themes: themes ?? defaultHighlightOptions.themes,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
rehypeCodeBlockPlugin,
|
|
93
|
-
];
|
|
94
|
-
};
|
|
95
|
-
export const highlight = (code, lang = "text", themes) => {
|
|
96
|
-
const value = highlighter.codeToHast(code, {
|
|
97
|
-
lang,
|
|
98
|
-
...defaultHighlightOptions,
|
|
99
|
-
themes: themes ?? defaultHighlightOptions.themes,
|
|
100
|
-
});
|
|
101
|
-
return toJsxRuntime(value, { Fragment, jsx, jsxs });
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=shiki.js.map
|
package/dist/lib/shiki.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shiki.js","sourceRoot":"","sources":["../../src/lib/shiki.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type CodeBlockProps = {
|
|
3
|
-
className?: string;
|
|
4
|
-
noBackground?: boolean;
|
|
5
|
-
wrapLines?: boolean;
|
|
6
|
-
showLanguageIndicator?: boolean;
|
|
7
|
-
language?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
code?: ReactNode;
|
|
11
|
-
showCopy?: "hover" | "always" | "never";
|
|
12
|
-
showCopyText?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
showLineNumbers?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare const CodeBlock: ({ children, title, language, showCopy, showCopyText, showLanguageIndicator, showLineNumbers, ...props }: CodeBlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
package/dist/lib/ui/CodeBlock.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
3
|
-
import { useRef, useState } from "react";
|
|
4
|
-
import { cn } from "../util/cn.js";
|
|
5
|
-
export const CodeBlock = ({ children, title, language, showCopy = "hover", showCopyText, showLanguageIndicator = true, showLineNumbers, ...props }) => {
|
|
6
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
7
|
-
const ref = useRef(null);
|
|
8
|
-
if (!children)
|
|
9
|
-
return null;
|
|
10
|
-
return (_jsxs("div", { className: cn("code-block-wrapper relative group bg-muted/50 rounded-md", showLineNumbers && "line-numbers"), children: [title && (_jsx("div", { className: "text-xs text-muted-foreground top-2 font-mono border-b w-full py-2 px-4 ", children: title })), _jsx("div", { className: cn("code-block text-sm not-prose scrollbar overflow-x-auto scrollbar p-4", props.className), ref: ref, children: children }), showLanguageIndicator && (_jsx("span", { className: cn("absolute top-1.5 right-3 !text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0", title && "top-12"), children: language })), showCopy !== "never" && (_jsxs("button", { type: "button", "aria-label": "Copy code", title: "Copy code", className: cn("absolute top-2 right-2 p-2 hover:outline hover:outline-border/75 dark:hover:outline-border rounded-md text-sm text-muted-foreground transition", title && "top-10", showCopy === "hover" && "opacity-0 group-hover:opacity-100", showCopyText && "flex gap-2 items-center font-medium"), disabled: isCopied, onClick: () => {
|
|
11
|
-
if (!ref.current?.textContent)
|
|
12
|
-
return;
|
|
13
|
-
setIsCopied(true);
|
|
14
|
-
void navigator.clipboard.writeText(ref.current.textContent);
|
|
15
|
-
setTimeout(() => setIsCopied(false), 2000);
|
|
16
|
-
}, children: [isCopied ? (_jsx(CheckIcon, { className: "text-emerald-600", size: 16, strokeWidth: 2.5, absoluteStrokeWidth: true })) : (_jsx(CopyIcon, { size: 16 })), showCopyText && "Copy"] }))] }));
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=CodeBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/lib/ui/CodeBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAiBnC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,OAAO,EAClB,YAAY,EACZ,qBAAqB,GAAG,IAAI,EAC5B,eAAe,EACf,GAAG,KAAK,EACO,EAAE,EAAE;IACnB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,0DAA0D,EAC1D,eAAe,IAAI,cAAc,CAClC,aAEA,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,0EAA0E,YACtF,KAAK,GACF,CACP,EACD,cACE,SAAS,EAAE,EAAE,CACX,sEAAsE,EACtE,KAAK,CAAC,SAAS,CAChB,EACD,GAAG,EAAE,GAAG,YAEP,QAAQ,GACL,EACL,qBAAqB,IAAI,CACxB,eACE,SAAS,EAAE,EAAE,CACX,wGAAwG,EACxG,KAAK,IAAI,QAAQ,CAClB,YAEA,QAAQ,GACJ,CACR,EACA,QAAQ,KAAK,OAAO,IAAI,CACvB,kBACE,IAAI,EAAC,QAAQ,gBACF,WAAW,EACtB,KAAK,EAAC,WAAW,EACjB,SAAS,EAAE,EAAE,CACX,gJAAgJ,EAChJ,KAAK,IAAI,QAAQ,EACjB,QAAQ,KAAK,OAAO,IAAI,mCAAmC,EAC3D,YAAY,IAAI,qCAAqC,CACtD,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW;wBAAE,OAAO;oBAEtC,WAAW,CAAC,IAAI,CAAC,CAAC;oBAClB,KAAK,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;oBAC5D,UAAU,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;gBAC7C,CAAC,aAEA,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,SAAS,IACR,SAAS,EAAC,kBAAkB,EAC5B,IAAI,EAAE,EAAE,EACR,WAAW,EAAE,GAAG,EAChB,mBAAmB,SACnB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,CACvB,EACA,YAAY,IAAI,MAAM,IAChB,CACV,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { defaultHighlightOptions, defaultLanguages, highlighter, } from "../lib/shiki.js";
|
|
2
|
-
export const viteShikiRegisterPlugin = (getCurrentConfig) => {
|
|
3
|
-
const virtualModuleId = "virtual:zudoku-shiki-register";
|
|
4
|
-
const resolvedVirtualModuleId = "\0" + virtualModuleId;
|
|
5
|
-
return {
|
|
6
|
-
name: "vite-plugin-shiki-register",
|
|
7
|
-
resolveId(id) {
|
|
8
|
-
if (id === virtualModuleId) {
|
|
9
|
-
return resolvedVirtualModuleId;
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
async load(id) {
|
|
13
|
-
if (id !== resolvedVirtualModuleId)
|
|
14
|
-
return;
|
|
15
|
-
const config = getCurrentConfig();
|
|
16
|
-
const languages = config.syntaxHighlighting?.languages ?? defaultLanguages;
|
|
17
|
-
const themes = Object.values(config.syntaxHighlighting?.themes ?? defaultHighlightOptions.themes);
|
|
18
|
-
await Promise.all([
|
|
19
|
-
highlighter.loadTheme(...themes.map((theme) => import(`@shikijs/themes/${theme}`))),
|
|
20
|
-
highlighter.loadLanguage(...languages.map((lang) => import(`@shikijs/langs/${lang}`))),
|
|
21
|
-
]);
|
|
22
|
-
const code = [
|
|
23
|
-
"export const registerShiki = async (highlighter) => {",
|
|
24
|
-
" await Promise.all([",
|
|
25
|
-
" highlighter.loadTheme(",
|
|
26
|
-
themes.map((t) => `import('zudoku/shiki/themes/${t}')`).join(","),
|
|
27
|
-
" ),",
|
|
28
|
-
" highlighter.loadLanguage(",
|
|
29
|
-
languages.map((l) => `import('zudoku/shiki/langs/${l}')`).join(","),
|
|
30
|
-
" ),",
|
|
31
|
-
" ]);",
|
|
32
|
-
"};",
|
|
33
|
-
];
|
|
34
|
-
return code.join("\n");
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=plugin-shiki-register.js.map
|