docusaurus/assets/js/a715936c.702966ff.js
2024-10-23 11:59:30 +00:00

1 line
No EOL
11 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["57301"],{10317:function(e,r,t){t.r(r),t.d(r,{metadata:()=>n,contentTitle:()=>s,default:()=>f,assets:()=>c,toc:()=>d,frontMatter:()=>l});var n=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":1729684612000,"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"}}'),a=t("24246"),o=t("80980"),u=t("15398"),i=t("58636");let l={sidebar_position:5,slug:"/api/themes/@docusaurus/theme-mermaid"},s="\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,o.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.header,{children:(0,a.jsx)(r.h1,{id:"-theme-mermaid",children:"\uD83D\uDCE6 theme-mermaid"})}),"\n",(0,a.jsxs)(r.p,{children:["This theme provides a ",(0,a.jsx)(r.code,{children:"@theme/Mermaid"})," component that is powered by ",(0,a.jsx)(r.a,{href:"https://mermaid-js.github.io/",children:"mermaid"}),". You can read more on ",(0,a.jsx)(r.a,{href:"/docs/markdown-features/diagrams",children:"diagrams"})," documentation."]}),"\n",(0,a.jsxs)(u.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(i.Z,{value:"npm",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"npm install --save @docusaurus/theme-mermaid\n"})})}),(0,a.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"yarn add @docusaurus/theme-mermaid\n"})})}),(0,a.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"pnpm add @docusaurus/theme-mermaid\n"})})})]}),"\n",(0,a.jsx)(r.h2,{id:"configuration",children:"Configuration"}),"\n",(0,a.jsx)(r.pre,{children:(0,a.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 f(e={}){let{wrapper:r}={...(0,o.a)(),...e.components};return r?(0,a.jsx)(r,{...e,children:(0,a.jsx)(m,{...e})}):m(e)}},58636:function(e,r,t){t.d(r,{Z:()=>u});var n=t("24246");t("27378");var a=t("90496");let o="tabItem_pnkT";function u(e){var r=e.children,t=e.hidden,u=e.className;return(0,n.jsx)("div",{role:"tabpanel",className:(0,a.Z)(o,u),hidden:t,children:r})}},15398:function(e,r,t){t.d(r,{Z:()=>k});var n=t("24246"),a=t("27378"),o=t("90496"),u=t("54947"),i=t("3620"),l=t("844"),s=t("97486"),c=t("32263"),d=t("16971");function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],u=!0,i=!1;try{for(a=a.call(e);!(u=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);u=!0);}catch(e){i=!0,n=e}finally{try{!u&&null!=a.return&&a.return()}finally{if(i)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var r,t;return null!==(t=null===(r=a.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var r,t;if(!e||(0,a.isValidElement)(e)&&(r=e.props)&&(void 0===r?"undefined":(t=r)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"&&"value"in r)return e;throw Error("Docusaurus error: Bad <Tabs> child <".concat("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.'))}))||void 0===r?void 0:r.filter(Boolean))&&void 0!==t?t:[]}function h(e){var r=e.value;return e.tabValues.some(function(e){return e.value===r})}var b=t("71607");let v="tabList_Qoir",y="tabItem_AQgk";function g(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n,a,o;n=e,a=r,o=t[r],a in n?Object.defineProperty(n,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[a]=o})}return e}function j(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function O(e){var r=e.className,t=e.block,a=e.selectedValue,i=e.selectValue,l=e.tabValues,s=[],c=(0,u.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var r=e.currentTarget,t=l[s.indexOf(r)].value;t!==a&&(c(r),i(t))},m=function(e){var r=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var t,n=s.indexOf(e.currentTarget)+1;r=null!==(t=s[n])&&void 0!==t?t:s[0];break;case"ArrowLeft":var a,o=s.indexOf(e.currentTarget)-1;r=null!==(a=s[o])&&void 0!==a?a:s[s.length-1]}null==r||r.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},r),children:l.map(function(e){var r=e.value,t=e.label,u=e.attributes;return(0,n.jsx)("li",j(g({role:"tab",tabIndex:a===r?0:-1,"aria-selected":a===r,ref:function(e){return s.push(e)},onKeyDown:m,onClick:d},u),{className:(0,o.Z)("tabs__item",y,null==u?void 0:u.className,{"tabs__item--active":a===r}),children:null!=t?t:r}),r)})})}function w(e){var r=e.lazy,t=e.children,u=e.selectedValue,i=(Array.isArray(t)?t:[t]).filter(Boolean);if(r){var l=i.find(function(e){return e.props.value===u});return l?(0,a.cloneElement)(l,{className:(0,o.Z)("margin-top--md",l.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:i.map(function(e,r){return(0,a.cloneElement)(e,{key:r,hidden:e.props.value!==u})})})}function x(e){var r=function(e){var r,t,n,o,u,m,b,v,y,g,j,O,w,x,k=e.defaultValue,S=e.queryString,P=e.groupId;var I=(t=(r=e).values,n=r.children,(0,a.useMemo)(function(){var e=null!=t?t:p(n).map(function(e){var r=e.props;return{value:r.value,label:r.label,attributes:r.attributes,default:r.default}});return!function(e){var r=(0,c.lx)(e,function(e,r){return e.value===r.value});if(r.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(r.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[t,n])),V=f((0,a.useState)(function(){return function(e){var r,t=e.defaultValue,n=e.tabValues;if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!h({value:t,tabValues:n}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(t,'" but none of its children has the corresponding value. Available values are: ').concat(n.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return t}var a=null!==(r=n.find(function(e){return e.default}))&&void 0!==r?r:n[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:k,tabValues:I})}),2),E=V[0],T=V[1];var N=f((u=(o={queryString:void 0!==S&&S,groupId:P}).queryString,m=o.groupId,b=(0,i.k6)(),v=function(e){var r=e.queryString,t=void 0!==r&&r,n=e.groupId;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)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 null!=n?n:null}({queryString:void 0!==u&&u,groupId:m}),[(0,s._X)(v),(0,a.useCallback)(function(e){if(!!v){var r,t,n=new URLSearchParams(b.location.search);n.set(v,e),b.replace((r=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n,a,o;n=e,a=r,o=t[r],a in n?Object.defineProperty(n,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[a]=o})}return e}({},b.location),t=(t={search:n.toString()},t),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):(function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r))}},[v,b])]),2),D=N[0],A=N[1];var C=f((g=(y=({groupId:P}).groupId)?"docusaurus.tab.".concat(y):null,O=(j=f((0,d.Nk)(g),2))[0],w=j[1],[O,(0,a.useCallback)(function(e){if(!!g)w.set(e)},[g,w])]),2),Z=C[0],q=C[1];var _=h({value:x=null!=D?D:Z,tabValues:I})?x:null;return(0,l.Z)(function(){_&&T(_)},[_]),{selectedValue:E,selectValue:(0,a.useCallback)(function(e){if(!h({value:e,tabValues:I}))throw Error("Can't select invalid tab value=".concat(e));T(e),A(e),q(e)},[A,q,I]),tabValues:I}}(e);return(0,n.jsxs)("div",{className:(0,o.Z)("tabs-container",v),children:[(0,n.jsx)(O,g({},r,e)),(0,n.jsx)(w,g({},r,e))]})}function k(e){var r=(0,b.Z)();return(0,n.jsx)(x,j(g({},e),{children:p(e.children)}),String(r))}},80980:function(e,r,t){t.d(r,{Z:function(){return i},a:function(){return u}});var n=t(27378);let a={},o=n.createContext(a);function u(e){let r=n.useContext(o);return n.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function i(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),n.createElement(o.Provider,{value:r},e.children)}}}]);