mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-04 20:57:17 +02:00
1 line
No EOL
8.5 KiB
JavaScript
1 line
No EOL
8.5 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["40250"],{18802:function(e,t,n){n.r(t),n.d(t,{assets:function(){return c},contentTitle:function(){return u},default:function(){return h},frontMatter:function(){return i},metadata:function(){return r},someExport:function(){return d},toc:function(){return p}});var r=n(56877),l=n(24246),s=n(80980),o=n(15398),a=n(58636);let i={title:"Blog post MDX Feed tests",authors:["slorber"],tags:["paginated-tag","blog","docusaurus","long-long","long-long-long","long-long-long-long"],hide_reading_time:!0},u=void 0,c={authorsImageUrls:[void 0]},d=42,p=[{value:"Imports",id:"imports",level:2},{value:"Exports",id:"exports",level:2},{value:"Tabs test",id:"tabs-test",level:2}];function g(e){let t={code:"code",h2:"h2",p:"p",...(0,s.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.p,{children:"Some MDX tests, mostly to test how the RSS feed render those"}),"\n","\n",(0,l.jsx)(t.h2,{id:"imports",children:"Imports"}),"\n",(0,l.jsx)(t.p,{children:"Here are some imports:"}),"\n","\n",(0,l.jsx)(t.h2,{id:"exports",children:"Exports"}),"\n",(0,l.jsx)(t.p,{children:"Here are some exports:"}),"\n","\n",(0,l.jsx)(t.h2,{id:"tabs-test",children:"Tabs test"}),"\n",(0,l.jsx)(t.p,{children:"Here are some tabs:"}),"\n",(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(a.Z,{value:"apple",label:"Apple",children:(0,l.jsx)(t.p,{children:"This is an apple \uD83C\uDF4E"})}),(0,l.jsx)(a.Z,{value:"orange",label:"Orange",children:(0,l.jsx)(t.p,{children:"This is an orange \uD83C\uDF4A"})})]}),"\n",(0,l.jsxs)(t.p,{children:["Here are some tabs, inside ",(0,l.jsx)(t.code,{children:"mdx-code-block"}),":"]}),"\n",(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(a.Z,{value:"apple",label:"Apple",children:(0,l.jsx)(t.p,{children:"This is an apple \uD83C\uDF4E"})}),(0,l.jsx)(a.Z,{value:"orange",label:"Orange",children:(0,l.jsx)(t.p,{children:"This is an orange \uD83C\uDF4A"})})]})]})}function h(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(g,{...e})}):g(e)}},58636:function(e,t,n){n.d(t,{Z:()=>o});var r=n("24246");n("27378");var l=n("90496");let s="tabItem_pnkT";function o(e){let{children:t,hidden:n,className:o}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,l.Z)(s,o),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>j});var r=n("24246"),l=n("27378"),s=n("90496"),o=n("54947"),a=n("3620"),i=n("844"),u=n("97486"),c=n("32263"),d=n("16971");function p(e){return l.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||l.isValidElement(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(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 g(e){let{value:t,tabValues:n}=e;return n.some(e=>e.value===t)}var h=n("71607");let f="tabList_Qoir",b="tabItem_AQgk";function m(e){let{className:t,block:n,selectedValue:l,selectValue:a,tabValues:i}=e,u=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.o5)(),d=e=>{let t=e.currentTarget,n=i[u.indexOf(t)].value;n!==l&&(c(t),a(n))},p=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{let n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},t),children:i.map(e=>{let{value:t,label:n,attributes:o}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,ref:e=>u.push(e),onKeyDown:p,onClick:d,...o,className:(0,s.Z)("tabs__item",b,o?.className,{"tabs__item--active":l===t}),children:n??t},t)})})}function x(e){let{lazy:t,children:n,selectedValue:o}=e,a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){let e=a.find(e=>e.props.value===o);return e?(0,l.cloneElement)(e,{className:(0,s.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:a.map((e,t)=>(0,l.cloneElement)(e,{key:t,hidden:e.props.value!==o}))})}function v(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,s=function(e){let{values:t,children:n}=e;return(0,l.useMemo)(()=>{let e=t??p(n).map(e=>{let{props:{value:t,label:n,attributes:r,default:l}}=e;return{value:t,label:n,attributes:r,default:l}});return!function(e){let t=(0,c.lx)(e,(e,t)=>e.value===t.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,n])}(e),[o,h]=(0,l.useState)(()=>(function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!g({value:t,tabValues:n}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:s})),[f,b]=function(e){let{queryString:t=!1,groupId:n}=e,r=(0,a.k6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;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 n??null}({queryString:t,groupId:n}),o=(0,u._X)(s);return[o,(0,l.useCallback)(e=>{if(!s)return;let t=new URLSearchParams(r.location.search);t.set(s,e),r.replace({...r.location,search:t.toString()})},[s,r])]}({queryString:n,groupId:r}),[m,x]=function(e){var t;let{groupId:n}=e;let r=(t=n)?`docusaurus.tab.${t}`:null,[s,o]=(0,d.Nk)(r);return[s,(0,l.useCallback)(e=>{if(!!r)o.set(e)},[r,o])]}({groupId:r}),v=(()=>{let e=f??m;return g({value:e,tabValues:s})?e:null})();return(0,i.Z)(()=>{v&&h(v)},[v]),{selectedValue:o,selectValue:(0,l.useCallback)(e=>{if(!g({value:e,tabValues:s}))throw Error(`Can't select invalid tab value=${e}`);h(e),b(e),x(e)},[b,x,s]),tabValues:s}}(e);return(0,r.jsxs)("div",{className:(0,s.Z)("tabs-container",f),children:[(0,r.jsx)(m,{...t,...e}),(0,r.jsx)(x,{...t,...e})]})}function j(e){let t=(0,h.Z)();return(0,r.jsx)(v,{...e,children:p(e.children)},String(t))}},80980:function(e,t,n){n.d(t,{Z:function(){return a},a:function(){return o}});var r=n(27378);let l={},s=r.createContext(l);function o(e){let t=r.useContext(s);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),r.createElement(s.Provider,{value:t},e.children)}},56877:function(e){e.exports=JSON.parse('{"permalink":"/tests/blog/2021/10/07/blog-post-mdx-feed-tests","editUrl":"https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_blog-tests/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx","source":"@site/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx","title":"Blog post MDX Feed tests","description":"Some MDX tests, mostly to test how the RSS feed render those","date":"2021-10-07T00:00:00.000Z","tags":[{"inline":false,"label":"Paginated-tag","permalink":"/tests/blog/tags/paginated-tag"},{"inline":false,"label":"Blog","permalink":"/tests/blog/tags/blog"},{"inline":false,"label":"Docusaurus","permalink":"/tests/blog/tags/docusaurus"},{"inline":false,"label":"Long-long","permalink":"/tests/blog/tags/long-long"},{"inline":false,"label":"Long-long-long","permalink":"/tests/blog/tags/long-long-long"},{"inline":false,"label":"Long-long-long-long","permalink":"/tests/blog/tags/long-long-long-long"}],"hasTruncateMarker":true,"authors":[{"name":"Sebastien Lorber","title":"Docusaurus maintainer","url":"https://sebastienlorber.com","page":{"permalink":"/tests/blog/authors/slorber"},"socials":{"x":"https://x.com/sebastienlorber"},"imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"title":"Blog post MDX Feed tests","authors":["slorber"],"tags":["paginated-tag","blog","docusaurus","long-long","long-long-long","long-long-long-long"],"hide_reading_time":true},"unlisted":false,"prevItem":{"title":"Blog post MDX require Feed tests","permalink":"/tests/blog/2021/10/08/blog-post-mdx-require-feed-tests"},"nextItem":{"title":"Post with duplicate title","permalink":"/tests/blog/2021/09/13/dup-title"}}')}}]); |