docusaurus/assets/js/bdab9796.c1c93af7.js
2025-05-30 17:26:10 +00:00

1 line
No EOL
9.9 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["77235"],{54343:function(e,l,n){n.d(l,{Z:()=>t});let t={tocCollapsibleButton:"tocCollapsibleButton_IbtT",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_Nor3"}},89102:function(e,l,n){n.d(l,{Z:()=>t});let t={tocCollapsible:"tocCollapsible_BEWm",tocCollapsibleContent:"tocCollapsibleContent_FG8F",tocCollapsibleExpanded:"tocCollapsibleExpanded_FzA_"}},22438:function(e,l,n){n.d(l,{Z:()=>t});let t={tableOfContentsInline:"tableOfContentsInline_2sru"}},67079:function(e,l,n){n.d(l,{Z:()=>t});let t={browserWindow:"browserWindow_my1Q",browserWindowHeader:"browserWindowHeader_jXSR",row:"row_KZDM",buttons:"buttons_uHc7",right:"right_oyze",browserWindowAddressBar:"browserWindowAddressBar_Pd8y",dot:"dot_giz1",browserWindowMenuIcon:"browserWindowMenuIcon_Vhuh",bar:"bar_rrRL",browserWindowBody:"browserWindowBody_Idgs"}},88732:function(e,l,n){n.r(l),n.d(l,{assets:()=>v,contentTitle:()=>c,default:()=>f,frontMatter:()=>d,metadata:()=>t,toc:()=>u});var t=n(15309),o=n(85893),s=n(80980),i=n(44456),r=n(42518),a=n(39858);let d={toc_min_heading_level:2,toc_max_heading_level:6},c=void 0,v={},u=[{value:"lvl 6",id:"lvl-6",level:6},{value:"lvl 5",id:"lvl-5",level:5},{value:"lvl 4",id:"lvl-4",level:4},{value:"lvl 5",id:"lvl-5-1",level:5},{value:"lvl 4",id:"lvl-4-1",level:4},{value:"lvl 3",id:"lvl-3",level:3},{value:"lvl 2",id:"lvl-2",level:2},{value:"lvl 2",id:"lvl-2-1",level:2},{value:"lvl 3",id:"lvl-3-1",level:3},{value:"lvl 4",id:"lvl-4-2",level:4},{value:"lvl 5",id:"lvl-5-2",level:5},{value:"lvl 6",id:"lvl-6-1",level:6},{value:"lvl 2",id:"lvl-2-2",level:2},{value:"lvl 3",id:"lvl-3-2",level:3},{value:"lvl 4",id:"lvl-4-3",level:4},{value:"lvl 5",id:"lvl-5-3",level:5},{value:"lvl 6",id:"lvl-6-2",level:6}];function h(e){let l={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",hr:"hr",p:"p",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.p,{children:"Test the TOC behavior of a real-world MD doc with invalid headings"}),"\n",(0,o.jsx)(l.hr,{}),"\n",(0,o.jsx)(l.p,{children:"BAD HEADINGS:"}),"\n",(0,o.jsx)(l.h6,{id:"lvl-6",children:"lvl 6"}),"\n",(0,o.jsx)(l.h5,{id:"lvl-5",children:"lvl 5"}),"\n",(0,o.jsx)(l.h4,{id:"lvl-4",children:"lvl 4"}),"\n",(0,o.jsx)(l.h5,{id:"lvl-5-1",children:"lvl 5"}),"\n",(0,o.jsx)(l.h4,{id:"lvl-4-1",children:"lvl 4"}),"\n",(0,o.jsx)(l.h3,{id:"lvl-3",children:"lvl 3"}),"\n",(0,o.jsx)(l.h2,{id:"lvl-2",children:"lvl 2"}),"\n",(0,o.jsx)(l.h1,{id:"lvl-1",children:"lvl 1"}),"\n",(0,o.jsx)(l.hr,{}),"\n",(0,o.jsx)(l.p,{children:"GOOD HEADINGS:"}),"\n",(0,o.jsx)(l.h2,{id:"lvl-2-1",children:"lvl 2"}),"\n",(0,o.jsx)(l.h3,{id:"lvl-3-1",children:"lvl 3"}),"\n",(0,o.jsx)(l.h4,{id:"lvl-4-2",children:"lvl 4"}),"\n",(0,o.jsx)(l.h5,{id:"lvl-5-2",children:"lvl 5"}),"\n",(0,o.jsx)(l.h6,{id:"lvl-6-1",children:"lvl 6"}),"\n",(0,o.jsx)(l.h2,{id:"lvl-2-2",children:"lvl 2"}),"\n",(0,o.jsx)(l.h3,{id:"lvl-3-2",children:"lvl 3"}),"\n",(0,o.jsx)(l.h4,{id:"lvl-4-3",children:"lvl 4"}),"\n",(0,o.jsx)(l.h5,{id:"lvl-5-3",children:"lvl 5"}),"\n",(0,o.jsx)(l.h6,{id:"lvl-6-2",children:"lvl 6"}),"\n",(0,o.jsx)(l.hr,{}),"\n",(0,o.jsx)(l.p,{children:"INLINE:"}),"\n","\n","\n",(0,o.jsx)(i.Z,{children:(0,o.jsx)(r.Z,{toc:u,minHeadingLevel:2,maxHeadingLevel:6})}),"\n",(0,o.jsx)(l.hr,{}),"\n",(0,o.jsx)(l.p,{children:"COLLAPSIBLE:"}),"\n","\n",(0,o.jsx)(i.Z,{children:(0,o.jsx)(a.Z,{toc:u,minHeadingLevel:2,maxHeadingLevel:6})})]})}function f(e={}){let{wrapper:l}={...(0,s.a)(),...e.components};return l?(0,o.jsx)(l,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}f.displayName="MDXContent(_dogfooding/_docs tests/toc/toc-test-bad.mdx)"},31770:function(e,l,n){n.d(l,{Z:()=>r});var t=n(85893);n(67294);var o=n(90496),s=n(77827),i=n(54343);function r(e){let{collapsed:l,...n}=e;return(0,t.jsx)("button",{type:"button",...n,className:(0,o.Z)("clean-btn",i.Z.tocCollapsibleButton,!l&&i.Z.tocCollapsibleButtonExpanded,n.className),children:(0,t.jsx)(s.Z,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}},39858:function(e,l,n){n.d(l,{Z:()=>d});var t=n(85893);n(67294);var o=n(90496),s=n(97812),i=n(31373),r=n(31770),a=n(89102);function d(e){let{toc:l,className:n,minHeadingLevel:d,maxHeadingLevel:c}=e,{collapsed:v,toggleCollapsed:u}=(0,s.u)({initialState:!0});return(0,t.jsxs)("div",{className:(0,o.Z)(a.Z.tocCollapsible,!v&&a.Z.tocCollapsibleExpanded,n),children:[(0,t.jsx)(r.Z,{collapsed:v,onClick:u}),(0,t.jsx)(s.z,{lazy:!0,className:a.Z.tocCollapsibleContent,collapsed:v,children:(0,t.jsx)(i.Z,{toc:l,minHeadingLevel:d,maxHeadingLevel:c})})]})}},42518:function(e,l,n){n.d(l,{Z:()=>i});var t=n(85893);n(67294);var o=n(31373),s=n(22438);function i(e){let{toc:l,minHeadingLevel:n,maxHeadingLevel:i}=e;return(0,t.jsx)("div",{className:s.Z.tableOfContentsInline,children:(0,t.jsx)(o.Z,{toc:l,minHeadingLevel:n,maxHeadingLevel:i,className:"table-of-contents",linkClassName:null})})}},77655:function(e,l,n){n.d(l,{Z:()=>i});var t=n(85893),o=n(67294),s=n(35363);let i=o.memo(function e(l){let{toc:n,className:o,linkClassName:i,isChild:r}=l;return n.length?(0,t.jsx)("ul",{className:r?void 0:o,children:n.map(l=>(0,t.jsxs)("li",{children:[(0,t.jsx)(s.Z,{to:`#${l.id}`,className:i??void 0,dangerouslySetInnerHTML:{__html:l.value}}),(0,t.jsx)(e,{isChild:!0,toc:l.children,className:o,linkClassName:i})]},l.id))}):null})},31373:function(e,l,n){n.d(l,{Z:()=>d});var t=n(85893),o=n(67294),s=n(26378),i=n(79910),r=n(16394),a=n(77655);function d(e){let{toc:l,className:n="table-of-contents table-of-contents__left-border",linkClassName:d="table-of-contents__link",linkActiveClassName:c,minHeadingLevel:v,maxHeadingLevel:u,...h}=e,f=(0,s.L)(),b=v??f.tableOfContents.minHeadingLevel,m=u??f.tableOfContents.maxHeadingLevel,x=(0,i.b)({toc:l,minHeadingLevel:b,maxHeadingLevel:m}),p=(0,o.useMemo)(()=>{if(d&&c)return{linkClassName:d,linkActiveClassName:c,minHeadingLevel:b,maxHeadingLevel:m}},[d,c,b,m]);return(0,r.S)(p),(0,t.jsx)(a.Z,{toc:x,className:n,linkClassName:d,...h})}},16394:function(e,l,n){n.d(l,{S:()=>i});var t=n(67294),o=n(26378);function s(e){let l=e.getBoundingClientRect();return l.top===l.bottom?s(e.parentNode):l}function i(e){let l=(0,t.useRef)(void 0),n=function(){let e=(0,t.useRef)(0),{navbar:{hideOnScroll:l}}=(0,o.L)();return(0,t.useEffect)(()=>{e.current=l?0:document.querySelector(".navbar").clientHeight},[l]),e}();(0,t.useEffect)(()=>{if(!e)return()=>{};let{linkClassName:t,linkActiveClassName:o,minHeadingLevel:i,maxHeadingLevel:r}=e;function a(){let e=Array.from(document.getElementsByClassName(t)),a=function(e,l){let{anchorTopOffset:n}=l,t=e.find(e=>s(e).top>=n);if(t){var o;return(o=s(t)).top>0&&o.bottom<window.innerHeight/2?t:e[e.indexOf(t)-1]??null}return e[e.length-1]??null}(function(e){let{minHeadingLevel:l,maxHeadingLevel:n}=e,t=[];for(let e=l;e<=n;e+=1)t.push(`h${e}.anchor`);return Array.from(document.querySelectorAll(t.join()))}({minHeadingLevel:i,maxHeadingLevel:r}),{anchorTopOffset:n.current}),d=e.find(e=>a&&a.id===decodeURIComponent(e.href.substring(e.href.indexOf("#")+1)));e.forEach(e=>{e===d?(l.current&&l.current!==e&&l.current.classList.remove(o),e.classList.add(o),l.current=e):e.classList.remove(o)})}return document.addEventListener("scroll",a),document.addEventListener("resize",a),a(),()=>{document.removeEventListener("scroll",a),document.removeEventListener("resize",a)}},[e,n])}},79910:function(e,l,n){n.d(l,{b:()=>o});var t=n(67294);function o(e){let{toc:l,minHeadingLevel:n,maxHeadingLevel:o}=e;return(0,t.useMemo)(()=>(function e(l){let{toc:n,minHeadingLevel:t,maxHeadingLevel:o}=l;return n.flatMap(l=>{let n=e({toc:l.children,minHeadingLevel:t,maxHeadingLevel:o});return l.level>=t&&l.level<=o?[{...l,children:n}]:n})})({toc:function(e){let l=e.map(e=>({...e,parentIndex:-1,children:[]})),n=Array(7).fill(-1);l.forEach((e,l)=>{let t=n.slice(2,e.level);e.parentIndex=Math.max(...t),n[e.level]=l});let t=[];return l.forEach(e=>{let{parentIndex:n,...o}=e;n>=0?l[n].children.push(o):t.push(o)}),t}(l),minHeadingLevel:n,maxHeadingLevel:o}),[l,n,o])}},44456:function(e,l,n){n.d(l,{Z:()=>i});var t=n(85893);n(67294);var o=n(90496),s=n(67079);function i(e){let{children:l,minHeight:n,url:i="http://localhost:3000",style:r,bodyStyle:a}=e;return(0,t.jsxs)("div",{className:s.Z.browserWindow,style:{...r,minHeight:n},children:[(0,t.jsxs)("div",{className:s.Z.browserWindowHeader,children:[(0,t.jsxs)("div",{className:s.Z.buttons,children:[(0,t.jsx)("span",{className:s.Z.dot,style:{background:"#f25f58"}}),(0,t.jsx)("span",{className:s.Z.dot,style:{background:"#fbbe3c"}}),(0,t.jsx)("span",{className:s.Z.dot,style:{background:"#58cb42"}})]}),(0,t.jsx)("div",{className:(0,o.Z)(s.Z.browserWindowAddressBar,"text--truncate"),children:i}),(0,t.jsx)("div",{className:s.Z.browserWindowMenuIcon,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:s.Z.bar}),(0,t.jsx)("span",{className:s.Z.bar}),(0,t.jsx)("span",{className:s.Z.bar})]})})]}),(0,t.jsx)("div",{className:s.Z.browserWindowBody,style:a,children:l})]})}},80980:function(e,l,n){n.d(l,{Z:()=>r,a:()=>i});var t=n(67294);let o={},s=t.createContext(o);function i(e){let l=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(l):{...l,...e}},[l,e])}function r(e){let l;return l=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),t.createElement(s.Provider,{value:l},e.children)}},15309:function(e){e.exports=JSON.parse('{"id":"toc/toc-test-bad","title":"toc-test-bad","description":"Test the TOC behavior of a real-world MD doc with invalid headings","source":"@site/_dogfooding/_docs tests/toc/toc-test-bad.mdx","sourceDirName":"toc","slug":"/toc/toc-test-bad","permalink":"/tests/docs/toc/toc-test-bad","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1748625776000,"frontMatter":{"toc_min_heading_level":2,"toc_max_heading_level":6},"sidebar":"sidebar","previous":{"title":"toc-_-_","permalink":"/tests/docs/toc/toc-_-_"},"next":{"title":"toc-test-good","permalink":"/tests/docs/toc/toc-test-good"}}')}}]);