docusaurus/assets/js/a715936c.008d926f.js
2025-06-02 16:47:21 +00:00

1 line
No EOL
8.3 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["57301"],{55701:function(e,r,t){t.d(r,{Z:()=>a});let a={tabItem:"tabItem_pnkT"}},93195:function(e,r,t){t.d(r,{Z:()=>a});let a={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},3872:function(e,r,t){t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>l,default:()=>h,frontMatter:()=>u,metadata:()=>a,toc:()=>d});var a=t(82325),n=t(85893),s=t(80980),i=t(4575),o=t(54636);let u={sidebar_position:5,slug:"/api/themes/@docusaurus/theme-mermaid"},l="\uD83D\uDCE6 theme-mermaid",c={},d=[{value:"Configuration",id:"configuration",level:2}];function m(e){let r={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.header,{children:(0,n.jsx)(r.h1,{id:"-theme-mermaid",children:"\uD83D\uDCE6 theme-mermaid"})}),"\n",(0,n.jsxs)(r.p,{children:["This theme provides a ",(0,n.jsx)(r.code,{children:"@theme/Mermaid"})," component that is powered by ",(0,n.jsx)(r.a,{href:"https://mermaid-js.github.io/",children:"mermaid"}),". You can read more on ",(0,n.jsx)(r.a,{href:"/docs/markdown-features/diagrams",children:"diagrams"})," documentation."]}),"\n",(0,n.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,n.jsx)(o.Z,{value:"npm",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"npm install --save @docusaurus/theme-mermaid\n"})})}),(0,n.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"yarn add @docusaurus/theme-mermaid\n"})})}),(0,n.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"pnpm add @docusaurus/theme-mermaid\n"})})}),(0,n.jsx)(o.Z,{value:"bun",label:"Bun",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"bun add @docusaurus/theme-mermaid\n"})})})]}),"\n",(0,n.jsx)(r.h2,{id:"configuration",children:"Configuration"}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themes: ['@docusaurus/theme-mermaid'],\n // In order for Mermaid code blocks in Markdown to work,\n // you also need to enable the Remark plugin with this option\n markdown: {\n mermaid: true,\n },\n};\n"})})]})}function h(e={}){let{wrapper:r}={...(0,s.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}},54636:function(e,r,t){t.d(r,{Z:()=>i});var a=t(85893);t(67294);var n=t(90496),s=t(55701);function i(e){let{children:r,hidden:t,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.Z)(s.Z.tabItem,i),hidden:t,children:r})}},4575:function(e,r,t){t.d(r,{Z:()=>h});var a=t(85893),n=t(67294),s=t(90496),i=t(54947),o=t(30623),u=t(71607),l=t(93195);function c(e){let{className:r,block:t,selectedValue:n,selectValue:o,tabValues:u}=e,c=[],{blockElementScrollPositionUntilNextRender:d}=(0,i.o5)(),m=e=>{let r=e.currentTarget,t=u[c.indexOf(r)].value;t!==n&&(d(r),o(t))},h=e=>{let r=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{let t=c.indexOf(e.currentTarget)+1;r=c[t]??c[0];break}case"ArrowLeft":{let t=c.indexOf(e.currentTarget)-1;r=c[t]??c[c.length-1]}}r?.focus()};return(0,a.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":t},r),children:u.map(e=>{let{value:r,label:t,attributes:i}=e;return(0,a.jsx)("li",{role:"tab",tabIndex:n===r?0:-1,"aria-selected":n===r,ref:e=>{c.push(e)},onKeyDown:h,onClick:m,...i,className:(0,s.Z)("tabs__item",l.Z.tabItem,i?.className,{"tabs__item--active":n===r}),children:t??r},r)})})}function d(e){let{lazy:r,children:t,selectedValue:i}=e,o=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){let e=o.find(e=>e.props.value===i);return e?(0,n.cloneElement)(e,{className:(0,s.Z)("margin-top--md",e.props.className)}):null}return(0,a.jsx)("div",{className:"margin-top--md",children:o.map((e,r)=>(0,n.cloneElement)(e,{key:r,hidden:e.props.value!==i}))})}function m(e){let r=(0,o.Y)(e);return(0,a.jsxs)("div",{className:(0,s.Z)("tabs-container",l.Z.tabList),children:[(0,a.jsx)(c,{...r,...e}),(0,a.jsx)(d,{...r,...e})]})}function h(e){let r=(0,u.Z)();return(0,a.jsx)(m,{...e,children:(0,o.h)(e.children)},String(r))}},30623:function(e,r,t){t.d(r,{Y:()=>d,h:()=>l});var a=t(67294),n=t(3620),s=t(844),i=t(97486),o=t(32263),u=t(16971);function l(e){return a.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,a.isValidElement)(e)&&function(e){let{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function c(e){let{value:r,tabValues:t}=e;return t.some(e=>e.value===r)}function d(e){let{defaultValue:r,queryString:t=!1,groupId:d}=e,m=function(e){let{values:r,children:t}=e;return(0,a.useMemo)(()=>{let e=r??l(t).map(e=>{let{props:{value:r,label:t,attributes:a,default:n}}=e;return{value:r,label:t,attributes:a,default:n}}),a=(0,o.lx)(e,(e,r)=>e.value===r.value);if(a.length>0)throw Error(`Docusaurus error: Duplicate values "${a.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[r,t])}(e),[h,p]=(0,a.useState)(()=>(function(e){let{defaultValue:r,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(r){if(!c({value:r,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}let a=t.find(e=>e.default)??t[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value})({defaultValue:r,tabValues:m})),[f,b]=function(e){let{queryString:r=!1,groupId:t}=e,s=(0,n.k6)(),o=function(e){let{queryString:r=!1,groupId:t}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:r,groupId:t});return[(0,i._X)(o),(0,a.useCallback)(e=>{if(!o)return;let r=new URLSearchParams(s.location.search);r.set(o,e),s.replace({...s.location,search:r.toString()})},[o,s])]}({queryString:t,groupId:d}),[v,g]=function(e){let{groupId:r}=e,t=r?`docusaurus.tab.${r}`:null,[n,s]=(0,u.Nk)(t);return[n,(0,a.useCallback)(e=>{t&&s.set(e)},[t,s])]}({groupId:d}),x=(()=>{let e=f??v;return c({value:e,tabValues:m})?e:null})();return(0,s.Z)(()=>{x&&p(x)},[x]),{selectedValue:h,selectValue:(0,a.useCallback)(e=>{if(!c({value:e,tabValues:m}))throw Error(`Can't select invalid tab value=${e}`);p(e),b(e),g(e)},[b,g,m]),tabValues:m}}},80980:function(e,r,t){t.d(r,{Z:()=>o,a:()=>i});var a=t(67294);let n={},s=a.createContext(n);function i(e){let r=a.useContext(s);return a.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),a.createElement(s.Provider,{value:r},e.children)}},82325:function(e){e.exports=JSON.parse('{"id":"api/themes/theme-mermaid","title":"\uD83D\uDCE6 theme-mermaid","description":"This theme provides a @theme/Mermaid component that is powered by mermaid. You can read more on diagrams documentation.","source":"@site/docs/api/themes/theme-mermaid.mdx","sourceDirName":"api/themes","slug":"/api/themes/@docusaurus/theme-mermaid","permalink":"/docs/api/themes/@docusaurus/theme-mermaid","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/themes/theme-mermaid.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1748882647000,"sidebarPosition":5,"frontMatter":{"sidebar_position":5,"slug":"/api/themes/@docusaurus/theme-mermaid"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 theme-search-algolia","permalink":"/docs/api/themes/@docusaurus/theme-search-algolia"},"next":{"title":"\uD83D\uDCE6 create-docusaurus","permalink":"/docs/api/misc/create-docusaurus"}}')}}]);