docusaurus/assets/js/a4c9d663.6d58a5cd.js
2024-10-11 08:53:13 +00:00

1 line
No EOL
29 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["5042"],{2238:function(e,n,s){s.r(n),s.d(n,{metadata:()=>i,contentTitle:()=>u,default:()=>p,assets:()=>c,toc:()=>d,frontMatter:()=>a});var i=JSON.parse('{"id":"using-plugins","title":"Using Plugins","description":"The Docusaurus core doesn\'t provide any feature of its own. All features are delegated to individual plugins: the docs feature provided by the docs plugin; the blog feature provided by the blog plugin; or individual pages provided by the pages plugin. If there are no plugins installed, the site won\'t contain any routes.","source":"@site/docs/using-plugins.mdx","sourceDirName":".","slug":"/using-plugins","permalink":"/docs/using-plugins","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/using-plugins.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1728636624000,"frontMatter":{},"sidebar":"docs","previous":{"title":"SEO","permalink":"/docs/seo"},"next":{"title":"Deployment","permalink":"/docs/deployment"}}'),t=s("24246"),r=s("80980"),l=s("15398"),o=s("58636");let a={},u="Using Plugins",c={},d=[{value:"Installing a plugin",id:"installing-a-plugin",level:2},{value:"Configuring plugins",id:"configuring-plugins",level:2},{value:"Multi-instance plugins and plugin IDs",id:"multi-instance-plugins-and-plugin-ids",level:2},{value:"Using themes",id:"using-themes",level:2},{value:"Using presets",id:"using-presets",level:2},{value:"<code>@docusaurus/preset-classic</code>",id:"docusauruspreset-classic",level:3},{value:"Installing presets",id:"installing-presets",level:3},{value:"Creating presets",id:"creating-presets",level:3},{value:"Module shorthands",id:"module-shorthands",level:2}];function h(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"using-plugins",children:"Using Plugins"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"The Docusaurus core doesn't provide any feature of its own."})," All features are delegated to individual plugins: the ",(0,t.jsx)(n.a,{href:"/docs/docs-introduction",children:"docs"})," feature provided by the ",(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-docs",children:"docs plugin"}),"; the ",(0,t.jsx)(n.a,{href:"/docs/blog",children:"blog"})," feature provided by the ",(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-blog",children:"blog plugin"}),"; or individual ",(0,t.jsx)(n.a,{href:"/docs/creating-pages",children:"pages"})," provided by the ",(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-pages",children:"pages plugin"}),". If there are no plugins installed, the site won't contain any routes."]}),"\n",(0,t.jsxs)(n.p,{children:["You may not need to install common plugins one-by-one though: they can be distributed as a bundle in a ",(0,t.jsx)(n.a,{href:"#using-presets",children:"preset"}),". For most users, plugins are configured through the preset configuration."]}),"\n",(0,t.jsxs)(n.p,{children:["We maintain a ",(0,t.jsx)(n.a,{href:"/docs/api/plugins",children:"list of official plugins"}),", but the community has also created some ",(0,t.jsx)(n.a,{href:"/community/resources#community-plugins",children:"unofficial plugins"}),". If you want to add any feature: autogenerating doc pages, executing custom scripts, integrating other services... be sure to check out the list: someone may have implemented it for you!"]}),"\n",(0,t.jsxs)(n.p,{children:["If you are feeling energetic, you can also read ",(0,t.jsx)(n.a,{href:"/docs/advanced/plugins",children:"the plugin guide"})," or ",(0,t.jsx)(n.a,{href:"/docs/api/plugin-methods/",children:"plugin method references"})," for how to make a plugin yourself."]}),"\n",(0,t.jsx)(n.h2,{id:"installing-a-plugin",children:"Installing a plugin"}),"\n",(0,t.jsx)(n.p,{children:"A plugin is usually an npm package, so you install them like other npm packages using npm."}),"\n",(0,t.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save docusaurus-plugin-name\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add docusaurus-plugin-name\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add docusaurus-plugin-name\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["Then you add it in your site's ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"}),"'s ",(0,t.jsx)(n.code,{children:"plugins"})," option:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n // highlight-next-line\n plugins: ['@docusaurus/plugin-content-pages'],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"Docusaurus can also load plugins from your local directory, with something like the following:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n // highlight-next-line\n plugins: ['./src/plugins/docusaurus-local-plugin'],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"Paths should be absolute or relative to the config file."}),"\n",(0,t.jsx)(n.h2,{id:"configuring-plugins",children:"Configuring plugins"}),"\n",(0,t.jsx)(n.p,{children:"For the most basic usage of plugins, you can provide just the plugin name or the path to the plugin."}),"\n",(0,t.jsx)(n.p,{children:'However, plugins can have options specified by wrapping the name and an options object in a two-member tuple inside your config. This style is usually called "Babel Style".'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n plugins: [\n // highlight-start\n [\n '@docusaurus/plugin-xxx',\n {\n /* options */\n },\n ],\n // highlight-end\n ],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n // Basic usage.\n '@docusaurus/plugin-debug',\n\n // With options object (babel style)\n [\n '@docusaurus/plugin-sitemap',\n {\n changefreq: 'weekly',\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsx)(n.h2,{id:"multi-instance-plugins-and-plugin-ids",children:"Multi-instance plugins and plugin IDs"}),"\n",(0,t.jsxs)(n.p,{children:["All Docusaurus content plugins can support multiple plugin instances. For example, it may be useful to have ",(0,t.jsx)(n.a,{href:"/docs/docs-multi-instance",children:"multiple docs plugin instances"})," or ",(0,t.jsx)(n.a,{href:"/docs/blog#multiple-blogs",children:"multiple blogs"}),". It is required to assign a unique ID to each plugin instance, and by default, the plugin ID is ",(0,t.jsx)(n.code,{children:"default"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n '@docusaurus/plugin-content-docs',\n {\n // highlight-next-line\n id: 'docs-1',\n // other options\n },\n ],\n [\n '@docusaurus/plugin-content-docs',\n {\n // highlight-next-line\n id: 'docs-2',\n // other options\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:['At most one plugin instance can be the "default plugin instance", by omitting the ',(0,t.jsx)(n.code,{children:"id"})," attribute, or using ",(0,t.jsx)(n.code,{children:"id: 'default'"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"using-themes",children:"Using themes"}),"\n",(0,t.jsxs)(n.p,{children:["Themes are loaded in the exact same way as plugins. From the consumer perspective, the ",(0,t.jsx)(n.code,{children:"themes"})," and ",(0,t.jsx)(n.code,{children:"plugins"})," entries are interchangeable when installing and configuring a plugin. The only nuance is that themes are loaded after plugins, and it's possible for ",(0,t.jsx)(n.a,{href:"/docs/advanced/client#theme-aliases",children:"a theme to override a plugin's default theme components"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"themes"})," and ",(0,t.jsx)(n.code,{children:"plugins"})," options lead to different ",(0,t.jsx)(n.a,{href:"#module-shorthands",children:"shorthand resolutions"}),", so if you want to take advantage of shorthands, be sure to use the right entry!"]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n // highlight-next-line\n themes: ['@docusaurus/theme-classic', '@docusaurus/theme-live-codeblock'],\n};\n"})}),"\n",(0,t.jsx)(n.h2,{id:"using-presets",children:"Using presets"}),"\n",(0,t.jsxs)(n.p,{children:["Presets are bundles of plugins and themes. For example, instead of letting you register and configure ",(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-docs"}),", ",(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-blog"}),", etc. one after the other in the config file, we have ",(0,t.jsx)(n.code,{children:"@docusaurus/preset-classic"})," preset allows you to configure them in one centralized place."]}),"\n",(0,t.jsx)(n.h3,{id:"docusauruspreset-classic",children:(0,t.jsx)(n.code,{children:"@docusaurus/preset-classic"})}),"\n",(0,t.jsxs)(n.p,{children:["The classic preset is shipped by default to new Docusaurus websites created with ",(0,t.jsx)(n.a,{href:"/docs/installation#scaffold-project-website",children:(0,t.jsx)(n.code,{children:"create-docusaurus"})}),". It contains the following themes and plugins:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/themes/configuration",children:(0,t.jsx)(n.code,{children:"@docusaurus/theme-classic"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/themes/@docusaurus/theme-search-algolia",children:(0,t.jsx)(n.code,{children:"@docusaurus/theme-search-algolia"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-docs",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-docs"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-blog",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-blog"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-content-pages",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-pages"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-debug",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-debug"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-google-gtag"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-tag-manager",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-google-tag-manager"})})}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-analytics",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-google-analytics"})})," (",(0,t.jsx)(n.strong,{children:"deprecated"}),")"]}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-sitemap",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-sitemap"})})}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"The classic preset will relay each option entry to the respective plugin/theme."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n // Debug defaults to true in dev, false in prod\n debug: undefined,\n // Will be passed to @docusaurus/theme-classic.\n theme: {\n customCss: ['./src/css/custom.css'],\n },\n // Will be passed to @docusaurus/plugin-content-docs (false to disable)\n docs: {},\n // Will be passed to @docusaurus/plugin-content-blog (false to disable)\n blog: {},\n // Will be passed to @docusaurus/plugin-content-pages (false to disable)\n pages: {},\n // Will be passed to @docusaurus/plugin-sitemap (false to disable)\n sitemap: {},\n // Will be passed to @docusaurus/plugin-google-gtag (only enabled when explicitly specified)\n gtag: {},\n // Will be passed to @docusaurus/plugin-google-tag-manager (only enabled when explicitly specified)\n googleTagManager: {},\n // DEPRECATED: Will be passed to @docusaurus/plugin-google-analytics (only enabled when explicitly specified)\n googleAnalytics: {},\n },\n ],\n ],\n};\n"})}),"\n",(0,t.jsx)(n.h3,{id:"installing-presets",children:"Installing presets"}),"\n",(0,t.jsx)(n.p,{children:"A preset is usually an npm package, so you install them like other npm packages using npm."}),"\n",(0,t.jsxs)(l.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/preset-classic\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/preset-classic\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/preset-classic\n"})})})]}),"\n",(0,t.jsxs)(n.p,{children:["Then, add it in your site's ",(0,t.jsx)(n.code,{children:"docusaurus.config.js"}),"'s ",(0,t.jsx)(n.code,{children:"presets"})," option:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n // highlight-next-line\n presets: ['@docusaurus/preset-classic'],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"Preset paths can be relative to the config file:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n // ...\n // highlight-next-line\n presets: ['./src/presets/docusaurus-local-preset'],\n};\n"})}),"\n",(0,t.jsx)(n.h3,{id:"creating-presets",children:"Creating presets"}),"\n",(0,t.jsxs)(n.p,{children:["A preset is a function with the same shape as the ",(0,t.jsx)(n.a,{href:"/docs/api/plugin-methods/#plugin-constructor",children:"plugin constructor"}),". It should return an object of ",(0,t.jsx)(n.code,{children:"{ plugins: PluginConfig[], themes: PluginConfig[] }"}),", in the same as how they are accepted in the site config. For example, you can specify a preset that includes the following themes and plugins:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="src/presets/docusaurus-preset-multi-docs.js"',children:"export default function preset(context, opts = {}) {\n return {\n themes: [['docusaurus-theme-awesome', opts.theme]],\n plugins: [\n // Using three docs plugins at the same time!\n // Assigning a unique ID for each without asking the user to do it\n ['@docusaurus/plugin-content-docs', {...opts.docs1, id: 'docs1'}],\n ['@docusaurus/plugin-content-docs', {...opts.docs2, id: 'docs2'}],\n ['@docusaurus/plugin-content-docs', {...opts.docs3, id: 'docs3'}],\n ],\n };\n}\n"})}),"\n",(0,t.jsx)(n.p,{children:"Then in your Docusaurus config, you may configure the preset:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n presets: [\n // highlight-start\n [\n './src/presets/docusaurus-preset-multi-docs.js',\n {\n theme: {hello: 'world'},\n docs1: {path: '/docs'},\n docs2: {path: '/community'},\n docs3: {path: '/api'},\n },\n ],\n // highlight-end\n ],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"This is equivalent of doing:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themes: [['docusaurus-theme-awesome', {hello: 'world'}]],\n plugins: [\n ['@docusaurus/plugin-content-docs', {id: 'docs1', path: '/docs'}],\n ['@docusaurus/plugin-content-docs', {id: 'docs2', path: '/community'}],\n ['@docusaurus/plugin-content-docs', {id: 'docs3', path: '/api'}],\n ],\n};\n"})}),"\n",(0,t.jsx)(n.p,{children:"This is especially useful when some plugins and themes are intended to be used together. You can even link their options together, e.g. pass one option to multiple plugins."}),"\n",(0,t.jsx)(n.h2,{id:"module-shorthands",children:"Module shorthands"}),"\n",(0,t.jsx)(n.p,{children:"Docusaurus supports shorthands for plugins, themes, and presets. When it sees a plugin/theme/preset name, it tries to load one of the following, in that order:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"[name]"})," (like ",(0,t.jsx)(n.code,{children:"content-docs"}),")"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"@docusaurus/[moduleType]-[name]"})," (like ",(0,t.jsx)(n.code,{children:"@docusaurus/plugin-content-docs"}),")"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"docusaurus-[moduleType]-[name]"})," (like ",(0,t.jsx)(n.code,{children:"docusaurus-plugin-content-docs"}),")"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["where ",(0,t.jsx)(n.code,{children:"moduleType"})," is one of ",(0,t.jsx)(n.code,{children:"'preset'"}),", ",(0,t.jsx)(n.code,{children:"'theme'"}),", ",(0,t.jsx)(n.code,{children:"'plugin'"}),", depending on which field the module name is declared in. The first module name that's successfully found is loaded."]}),"\n",(0,t.jsxs)(n.p,{children:["If the name is scoped (beginning with ",(0,t.jsx)(n.code,{children:"@"}),"), the name is first split into scope and package name by the first slash:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"@scope\n^----^\n scope (no name!)\n\n@scope/awesome\n^----^ ^-----^\n scope name\n\n@scope/awesome/main\n^----^ ^----------^\n scope name\n"})}),"\n",(0,t.jsxs)(n.p,{children:["If there is no name (like ",(0,t.jsx)(n.code,{children:"@jquery"}),"), ",(0,t.jsx)(n.code,{children:"[scope]/docusaurus-[moduleType]"})," (i.e. ",(0,t.jsx)(n.code,{children:"@jquery/docusaurus-plugin"}),") is loaded. Otherwise, the following are attempted:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"[scope]/[name]"})," (like ",(0,t.jsx)(n.code,{children:"@jquery/content-docs"}),")"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"[scope]/docusaurus-[moduleType]-[name]"})," (like ",(0,t.jsx)(n.code,{children:"@jquery/docusaurus-plugin-content-docs"}),")"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Below are some examples, for a plugin registered in the ",(0,t.jsx)(n.code,{children:"plugins"})," field. Note that unlike ",(0,t.jsx)(n.a,{href:"https://eslint.org/docs/user-guide/configuring/plugins#configuring-plugins",children:"ESLint"})," or ",(0,t.jsx)(n.a,{href:"https://babeljs.io/docs/en/options#name-normalization",children:"Babel"})," where a consistent naming convention for plugins is mandated, Docusaurus permits greater naming freedom, so the resolutions are not certain, but follows the priority defined above."]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Declaration"}),(0,t.jsx)(n.th,{children:"May be resolved as"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"awesome"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"docusaurus-plugin-awesome"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"sitemap"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-sitemap",children:(0,t.jsx)(n.code,{children:"@docusaurus/plugin-sitemap"})})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"@my-company"})}),(0,t.jsxs)(n.td,{children:[(0,t.jsx)(n.code,{children:"@my-company/docusaurus-plugin"})," (the only possible resolution!)"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"@my-company/awesome"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"@my-company/docusaurus-plugin-awesome"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"@my-company/awesome/web"})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"@my-company/docusaurus-plugin-awesome/web"})})]})]})]})]})}function p(e={}){let{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},58636:function(e,n,s){s.d(n,{Z:()=>l});var i=s("24246");s("27378");var t=s("90496");let r="tabItem_pnkT";function l(e){var n=e.children,s=e.hidden,l=e.className;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r,l),hidden:s,children:n})}},15398:function(e,n,s){s.d(n,{Z:()=>k});var i=s("24246"),t=s("27378"),r=s("90496"),l=s("54947"),o=s("3620"),a=s("844"),u=s("97486"),c=s("32263"),d=s("16971");function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var s=0,i=Array(n);s<n;s++)i[s]=e[s];return i}function p(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var s,i,t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r=[],l=!0,o=!1;try{for(t=t.call(e);!(l=(s=t.next()).done)&&(r.push(s.value),!n||r.length!==n);l=!0);}catch(e){o=!0,i=e}finally{try{!l&&null!=t.return&&t.return()}finally{if(o)throw i}}return r}}(e,n)||function(e,n){if(e){if("string"==typeof e)return h(e,n);var s=Object.prototype.toString.call(e).slice(8,-1);if("Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return h(e,n)}}(e,n)||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 g(e){var n,s;return null!==(s=null===(n=t.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var n,s;if(!e||(0,t.isValidElement)(e)&&(n=e.props)&&(void 0===n?"undefined":(s=n)&&"undefined"!=typeof Symbol&&s.constructor===Symbol?"symbol":typeof s)=="object"&&"value"in n)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===n?void 0:n.filter(Boolean))&&void 0!==s?s:[]}function f(e){var n=e.value;return e.tabValues.some(function(e){return e.value===n})}var m=s("71607");let j="tabList_Qoir",x="tabItem_AQgk";function b(e){for(var n=1;n<arguments.length;n++){var s=null!=arguments[n]?arguments[n]:{},i=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(s).filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable}))),i.forEach(function(n){var i,t,r;i=e,t=n,r=s[n],t in i?Object.defineProperty(i,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[t]=r})}return e}function y(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);s.push.apply(s,i)}return s})(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))}),e}function v(e){var n=e.className,s=e.block,t=e.selectedValue,o=e.selectValue,a=e.tabValues,u=[],c=(0,l.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var n=e.currentTarget,s=a[u.indexOf(n)].value;s!==t&&(c(n),o(s))},h=function(e){var n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var s,i=u.indexOf(e.currentTarget)+1;n=null!==(s=u[i])&&void 0!==s?s:u[0];break;case"ArrowLeft":var t,r=u.indexOf(e.currentTarget)-1;n=null!==(t=u[r])&&void 0!==t?t:u[u.length-1]}null==n||n.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":s},n),children:a.map(function(e){var n=e.value,s=e.label,l=e.attributes;return(0,i.jsx)("li",y(b({role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:function(e){return u.push(e)},onKeyDown:h,onClick:d},l),{className:(0,r.Z)("tabs__item",x,null==l?void 0:l.className,{"tabs__item--active":t===n}),children:null!=s?s:n}),n)})})}function w(e){var n=e.lazy,s=e.children,l=e.selectedValue,o=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){var a=o.find(function(e){return e.props.value===l});return a?(0,t.cloneElement)(a,{className:(0,r.Z)("margin-top--md",a.props.className)}):null}return(0,i.jsx)("div",{className:"margin-top--md",children:o.map(function(e,n){return(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})})})}function O(e){var n=function(e){var n,s,i,r,l,h,m,j,x,b,y,v,w,O,k=e.defaultValue,I=e.queryString,T=e.groupId;var P=(s=(n=e).values,i=n.children,(0,t.useMemo)(function(){var e=null!=s?s:g(i).map(function(e){var n=e.props;return{value:n.value,label:n.label,attributes:n.attributes,default:n.default}});return!function(e){var n=(0,c.lx)(e,function(e,n){return e.value===n.value});if(n.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(n.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[s,i])),D=p((0,t.useState)(function(){return function(e){var n,s=e.defaultValue,i=e.tabValues;if(0===i.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(s){if(!f({value:s,tabValues:i}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(s,'" but none of its children has the corresponding value. Available values are: ').concat(i.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return s}var t=null!==(n=i.find(function(e){return e.default}))&&void 0!==n?n:i[0];if(!t)throw Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:k,tabValues:P})}),2),N=D[0],S=D[1];var E=p((l=(r={queryString:void 0!==I&&I,groupId:T}).queryString,h=r.groupId,m=(0,o.k6)(),j=function(e){var n=e.queryString,s=void 0!==n&&n,i=e.groupId;if("string"==typeof s)return s;if(!1===s)return null;if(!0===s&&!i)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!=i?i:null}({queryString:void 0!==l&&l,groupId:h}),[(0,u._X)(j),(0,t.useCallback)(function(e){if(!!j){var n,s,i=new URLSearchParams(m.location.search);i.set(j,e),m.replace((n=function(e){for(var n=1;n<arguments.length;n++){var s=null!=arguments[n]?arguments[n]:{},i=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(s).filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable}))),i.forEach(function(n){var i,t,r;i=e,t=n,r=s[n],t in i?Object.defineProperty(i,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[t]=r})}return e}({},m.location),s=(s={search:i.toString()},s),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):(function(e,n){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);s.push.apply(s,i)}return s})(Object(s)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(s,e))}),n))}},[j,m])]),2),A=E[0],q=E[1];var C=p((b=(x=({groupId:T}).groupId)?"docusaurus.tab.".concat(x):null,v=(y=p((0,d.Nk)(b),2))[0],w=y[1],[v,(0,t.useCallback)(function(e){if(!!b)w.set(e)},[b,w])]),2),V=C[0],Z=C[1];var U=f({value:O=null!=A?A:V,tabValues:P})?O:null;return(0,a.Z)(function(){U&&S(U)},[U]),{selectedValue:N,selectValue:(0,t.useCallback)(function(e){if(!f({value:e,tabValues:P}))throw Error("Can't select invalid tab value=".concat(e));S(e),q(e),Z(e)},[q,Z,P]),tabValues:P}}(e);return(0,i.jsxs)("div",{className:(0,r.Z)("tabs-container",j),children:[(0,i.jsx)(v,b({},n,e)),(0,i.jsx)(w,b({},n,e))]})}function k(e){var n=(0,m.Z)();return(0,i.jsx)(O,y(b({},e),{children:g(e.children)}),String(n))}},80980:function(e,n,s){s.d(n,{Z:function(){return o},a:function(){return l}});var i=s(27378);let t={},r=i.createContext(t);function l(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);