boltdocs 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +41 -37
- package/dist/client/index.d.ts +41 -37
- package/dist/client/index.js +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +30 -3
- package/dist/node/index.d.mts +30 -3
- package/dist/node/index.mjs +1 -1
- package/dist/node-Bogvkxao.mjs +101 -0
- package/dist/node-CXaog6St.cjs +101 -0
- package/dist/{package-CR0HF9x3.mjs → package-Bqbn1AYK.mjs} +1 -1
- package/dist/{package-Dgmsc_l5.cjs → package-CFP44vfn.cjs} +1 -1
- package/dist/{search-dialog-DMK5OpgH.cjs → search-dialog-CV3eJzMm.cjs} +1 -1
- package/dist/{search-dialog-3lvKsbVG.js → search-dialog-DNTomKgu.js} +1 -1
- package/dist/use-search-CS3gH19M.js +6 -0
- package/dist/use-search-DBpJZQuw.cjs +6 -0
- package/package.json +3 -2
- package/src/client/components/ui-base/head.tsx +10 -3
- package/src/client/hooks/use-i18n.ts +4 -3
- package/src/client/hooks/use-localized-to.ts +1 -4
- package/src/client/hooks/use-routes.ts +4 -4
- package/src/client/hooks/use-sidebar.ts +3 -0
- package/src/client/hooks/use-version.ts +19 -6
- package/src/client/index.ts +2 -3
- package/src/client/ssg/boltdocs-shell.tsx +46 -14
- package/src/client/ssg/create-routes.tsx +56 -12
- package/src/client/store/boltdocs-context.tsx +24 -5
- package/src/shared/config-utils.ts +12 -0
- package/src/shared/types.ts +187 -0
- package/dist/node-BgvNl2Ay.mjs +0 -89
- package/dist/node-vkbb0MK7.cjs +0 -89
- package/dist/use-search-C9bxCqfF.js +0 -6
- package/dist/use-search-DcfZSunO.cjs +0 -6
- package/src/client/components/default-layout.tsx +0 -89
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{useLocation as e}from"react-router-dom";import{Children as t,createContext as n,forwardRef as r,use as i,useContext as a,useEffect as o,useImperativeHandle as s,useMemo as c,useRef as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import*as m from"react-aria-components";import{Breadcrumb as h,Breadcrumbs as g,Button as _,Link as v,Separator as ee,ToggleButton as te}from"react-aria-components";import{Check as ne,ChevronDown as re,ChevronLeft as ie,ChevronRight as y,CornerDownLeft as ae,Dot as oe,ExternalLink as se,FileText as ce,Hash as le,Moon as ue,Search as b,Sun as de}from"lucide-react";import{clsx as fe}from"clsx";import{twMerge as pe}from"tailwind-merge";import{cva as me}from"class-variance-authority";import he from"scroll-into-view-if-needed";import{Index as ge}from"flexsearch";import _e from"virtual:boltdocs-search";const x=Symbol.for(`__BDOCS_BOLTDOCS_CONTEXT__`),S=Symbol.for(`__BDOCS_BOLTDOCS_INSTANCE__`),ve=globalThis[x]||(globalThis[x]=n(void 0));function ye({children:e,initialLocale:t=``,initialVersion:n=``}){let r=(typeof window>`u`||window.location.pathname.split(`/`).filter(Boolean),{locale:t,version:n}),[i,a]=u(r.locale),[o,s]=u(r.version),[l,d]=u(!1),p=c(()=>({currentLocale:i,currentVersion:o,setLocale:e=>a(e||``),setVersion:e=>s(e||``),hasHydrated:l,setHasHydrated:d}),[i,o,l]);return typeof globalThis<`u`&&(globalThis[S]=p),f(ve.Provider,{value:p,children:e})}function C(){let e=i(ve);if(!e&&typeof globalThis<`u`&&globalThis[S])return globalThis[S];if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}const w=Symbol.for(`__BDOCS_CONFIG_CONTEXT__`),T=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`),E=globalThis[w]||(globalThis[w]=n(null));function D(){let e=i(E);if(!e&&typeof globalThis<`u`&&globalThis[T])return globalThis[T];if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}function O(...e){return pe(fe(e))}const k=me(`flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none`,{variants:{variant:{primary:`bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg`,secondary:`bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong`,outline:`bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500`,ghost:`bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main`,danger:`bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15`,success:`bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15`,warning:`bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15`,info:`bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15`,subtle:`bg-primary-500/10 text-primary-500 hover:bg-primary-500/20`,link:`bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline`},size:{sm:`min-h-8 px-3.5 text-[0.8125rem] gap-1.5`,md:`min-h-10 px-5 text-[0.9375rem] gap-2`,lg:`min-h-12 px-7 text-[1.05rem] gap-2.5`},rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`},iconSize:{sm:`w-8 h-8 p-0`,md:`w-10 h-10 p-0`,lg:`w-12 h-12 p-0`},disabled:{true:`opacity-50 cursor-not-allowed pointer-events-none`,false:null}},defaultVariants:{variant:`primary`,size:`md`,rounded:`md`}}),be=({href:e,icon:t,iconPosition:n=`left`,isIconOnly:r,children:i,className:a,variant:o,size:s,rounded:c,iconSize:l,disabled:u,...h})=>{let g=r||!i&&!!t,_=g?f(`span`,{className:`inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]`,children:t}):p(d,{children:[t&&n===`left`&&f(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t}),f(`span`,{className:`flex items-center`,children:i}),t&&n===`right`&&f(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t})]});return e?f(m.Link,{href:e,className:O(k({variant:o,size:s,rounded:c,iconSize:g?l:void 0,disabled:u}),a),...h,children:_}):f(m.Button,{className:O(k({variant:o,size:s,rounded:c,iconSize:g?l:void 0,disabled:u}),a),...h,children:_})};function A(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const j=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`GitHub`}),f(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})]}),xe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`Discord`}),f(`path`,{d:`M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z`})]}),Se=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`X`}),f(`path`,{d:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`})]}),Ce=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`Bluesky`}),f(`path`,{d:`M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026`})]}),we=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`TypeScript`}),f(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),Te=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`JavaScript`}),f(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),Ee=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`JSON`}),f(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),De=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`CSS`}),f(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),Oe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`HTML`}),f(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),ke=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`React`}),f(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),f(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),f(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),f(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),Ae=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`Markdown`}),f(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),je=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...A(e),children:[f(`title`,{children:`Shell`}),f(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),Me=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`YAML`}),f(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),Ne=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...A(e),children:[f(`title`,{children:`Rust`}),f(`path`,{fill:`#EA580C`,fillRule:`evenodd`,d:`M12.58 2.136a.287.287 0 00-.488 0l-.526.85a8.974 8.974 0 00-.232.022l-.683-.73a.287.287 0 00-.478.096l-.35.935c-.075.021-.15.044-.224.067l-.812-.583a.287.287 0 00-.45.187l-.162.989a9.088 9.088 0 00-.204.11l-.913-.417a.287.287 0 00-.406.272l.036 1.005a9.099 9.099 0 00-.175.144l-.98-.231a.287.287 0 00-.345.345l.231.98a9.125 9.125 0 00-.144.175L4.27 6.316a.287.287 0 00-.271.406l.416.913a9.036 9.036 0 00-.11.203L3.317 8a.287.287 0 00-.187.45l.584.813a8.953 8.953 0 00-.068.223l-.935.35a.287.287 0 00-.095.479l.73.682a8.966 8.966 0 00-.023.233l-.85.526a.287.287 0 000 .488l.85.526c.007.078.014.156.023.233l-.73.682a.287.287 0 00.095.479l.935.35.068.223-.584.812a.287.287 0 00.187.451l.99.162c.035.068.072.135.109.203l-.416.913a.287.287 0 00.271.406l1.006-.036c.047.059.095.117.143.174l-.23.981a.287.287 0 00.344.345l.981-.23c.057.048.115.095.174.142l-.036 1.006a.287.287 0 00.406.272l.914-.417c.067.038.135.074.203.11l.161.99a.287.287 0 00.451.186l.813-.584c.074.024.148.046.223.068l.35.935a.287.287 0 00.478.095l.683-.73c.077.01.154.017.232.023l.526.85a.287.287 0 00.489 0l.526-.85c.078-.006.155-.014.232-.023l.682.73a.287.287 0 00.479-.095l.35-.935c.075-.022.15-.044.223-.068l.813.584a.287.287 0 00.45-.187l.162-.99a8.77 8.77 0 00.203-.109l.913.417a.287.287 0 00.406-.272l-.035-1.006c.058-.047.116-.094.174-.143l.98.231a.287.287 0 00.346-.345l-.231-.98.143-.175 1.006.036a.287.287 0 00.271-.406l-.416-.913a9.4 9.4 0 00.109-.203l.99-.162a.287.287 0 00.187-.45l-.584-.813a8.43 8.43 0 00.067-.223l.935-.35a.287.287 0 00.096-.479l-.73-.682c.009-.077.016-.155.023-.233l.85-.526a.287.287 0 000-.488l-.85-.526a8.844 8.844 0 00-.023-.233l.73-.682a.287.287 0 00-.096-.479l-.934-.35a9.246 9.246 0 00-.068-.223l.584-.812A.287.287 0 0021.357 8l-.99-.162a8.92 8.92 0 00-.11-.203l.417-.913a.287.287 0 00-.271-.406l-1.006.036a9.178 9.178 0 00-.143-.174l.23-.981a.287.287 0 00-.345-.345l-.98.23a9.43 9.43 0 00-.174-.142l.035-1.006a.287.287 0 00-.405-.272l-.914.417a9.11 9.11 0 00-.203-.11l-.162-.99a.287.287 0 00-.45-.186l-.813.584a9.088 9.088 0 00-.223-.068l-.35-.935a.287.287 0 00-.479-.095l-.682.73a9.062 9.062 0 00-.232-.023l-.526-.85zm-.257 1.62a.592.592 0 01.578.596.595.595 0 11-.578-.595zm1.363.98A7.324 7.324 0 0118.7 8.309l-.702 1.585a.547.547 0 00.275.717l1.352.6c.041.422.047.847.015 1.27h-.752c-.075 0-.106.05-.106.123v.344c0 .812-.457.99-.859 1.034-.383.044-.806-.161-.86-.394-.22-1.24-.583-1.526-1.152-1.975l-.041-.033c.736-.467 1.502-1.158 1.502-2.08 0-.998-.683-1.625-1.148-1.934-.655-.43-1.379-.516-1.574-.516H6.88a7.324 7.324 0 014.098-2.312l.916.96a.54.54 0 00.766.018l1.026-.978zm-8.46 4.407a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm14.192.026a.595.595 0 11-.035 1.19.595.595 0 01.035-1.19zm-13.07.096h1.037v4.678H5.291a7.324 7.324 0 01-.237-2.797l1.282-.57a.542.542 0 00.276-.716l-.264-.595zm4.33.05h2.47c.128 0 .901.147.901.727 0 .48-.593.653-1.081.653h-2.293l.002-1.38zm0 3.36h1.892c.172 0 .924.05 1.164 1.011.026.104.064.291.107.503.078.389.174.861.247 1.06.113.345.57 1.034 1.058 1.034h3.089c-.207.277-.433.54-.677.785l-1.258-.27a.544.544 0 00-.645.417l-.298 1.394a7.323 7.323 0 01-6.108-.03l-.298-1.392a.542.542 0 00-.643-.418l-1.23.264a7.32 7.32 0 01-.636-.75h5.984c.067 0 .113-.011.113-.074v-2.117c0-.061-.046-.075-.113-.075h-1.75l.001-1.341zm-2.763 4.848a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm8.814.027a.596.596 0 11-.035 1.19.596.596 0 01.035-1.19z`,clipRule:`evenodd`})]}),Pe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`Rust`}),f(`path`,{fill:`#F87171`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),M=({className:e,children:t,...n})=>f(m.Tooltip,{...n,offset:8,className:t=>O(`group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none`,`data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100`,`data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75`,`data-[placement=top]:slide-in-from-bottom-1`,`data-[placement=bottom]:slide-in-from-top-1`,`data-[placement=left]:slide-in-from-right-1`,`data-[placement=right]:slide-in-from-left-1`,typeof e==`function`?e(t):e),children:e=>p(d,{children:[f(m.OverlayArrow,{children:p(`svg`,{width:8,height:8,viewBox:`0 0 8 8`,className:`fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90`,children:[f(`title`,{children:`Arrow`}),f(`path`,{d:`M0 0 L4 4 L8 0`})]})}),typeof t==`function`?t(e):t]})}),N=({content:e,children:t,delay:n=500,closeDelay:r=0,...i})=>p(m.TooltipTrigger,{delay:n,closeDelay:r,children:[t,f(M,{...i,children:e})]});N.Root=N,N.Content=M;const P=n({routes:[]});function Fe(){return a(P)}function Ie({routes:e,children:t}){return f(P.Provider,{value:{routes:e},children:t})}function F(){let{routes:t}=Fe(),n=D(),r=e(),{hasHydrated:i,currentLocale:a,currentVersion:o}=C(),s=e=>e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e,c=s(r.pathname),l=t?.find?.(e=>s(e.path)===c),u=n.i18n?l?.locale||(i?a:void 0)||n.i18n.defaultLocale:void 0,d=n.versions?l?.version||(i?o:void 0)||n.versions.defaultVersion:void 0,f=t?.filter?.(e=>{let r=n.i18n?(e.locale||n.i18n.defaultLocale)===u:!0,i=n.versions?(e.version||n.versions.defaultVersion)===d:!0;if(!(r&&i))return!1;let a=n.i18n;if(a){let n=!!l?.locale,r=!!e.locale;if(t?.some?.(t=>t!==e&&t.filePath===e.filePath&&t.version===e.version&&(t.locale||a.defaultLocale)===(e.locale||a.defaultLocale))&&n!==r)return!1}return!0}),p=n.i18n?.localeConfigs?.[u]?.label||n.i18n?.locales[u]||u,m=n.versions?.versions?.find?.(e=>e.path===d)?.label||d;return{routes:f,allRoutes:t,currentRoute:l,currentLocale:u,currentLocaleLabel:p,availableLocales:n.i18n?Object.entries(n.i18n.locales).map(([e,t])=>({key:e,label:n.i18n?.localeConfigs?.[e]?.label||t,isCurrent:e===u})):[],currentVersion:d,currentVersionLabel:m,availableVersions:n.versions?n.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===d})):[],config:n}}function I(e){let t=D(),{currentLocale:n,currentVersion:r}=F();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}const L=r((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=I(n??``),c=e=>{i?.(e)},l=e=>{a?.(e)};return f(v,{...o,ref:t,href:s,onMouseEnter:c,onFocus:l})});L.displayName=`Link`;const R=r((t,n)=>{let{href:r,end:i=!1,className:a,children:o,...s}=t,c=e(),l=I(r??``),u=i?c.pathname===l:c.pathname.startsWith(l),d=typeof a==`function`?a({isActive:u}):O(a,u&&`active`),p=typeof o==`function`?o({isActive:u}):o;return f(L,{...s,ref:n,href:r,className:d,children:p})});R.displayName=`NavLink`;const z=({children:e,className:t,...n})=>f(`header`,{className:O(`boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md`,t),...n,children:e}),Le=({children:e,className:t})=>f(`div`,{className:O(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),Re=({children:e,className:t})=>f(`div`,{className:O(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),ze=({children:e,className:t})=>f(`div`,{className:O(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),Be=({children:e,className:t})=>f(`div`,{className:O(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),Ve=({src:e,alt:t,width:n=24,height:r=24,className:i})=>f(L,{href:`/`,className:O(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?f(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),He=({children:e,className:t})=>f(L,{href:`/`,children:f(`span`,{className:O(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),Ue=({children:e,className:t})=>f(`nav`,{className:O(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),We=({label:e,href:t,active:n,to:r,className:i})=>p(L,{href:t,target:r===`external`?`_blank`:void 0,className:O(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,{"text-primary-500":n,"text-text-muted hover:text-text-main":!n},i),children:[e,r===`external`&&f(`span`,{className:`ml-1 inline-block`,children:f(se,{size:12})})]}),Ge=({className:e,onPress:t})=>{let[n,r]=u(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return o(()=>{r(!0)},[]),p(_,{onPress:t,className:O(`flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer`,`transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,`w-full max-w-[720px] justify-between`,e),children:[p(`div`,{className:`flex items-center gap-2`,children:[f(b,{size:16}),f(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),p(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[f(`kbd`,{className:`flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium`,children:i?`⌘`:`Ctrl`}),f(`kbd`,{className:`flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium`,children:`K`})]})]})},Ke=({className:e,theme:t,onThemeChange:n})=>f(te,{isSelected:t===`dark`,onChange:n,className:O(`rounded-md p-2 text-text-muted outline-none cursor-pointer`,`transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,e),"aria-label":`Toggle theme`,children:f(t===`dark`?de:ue,{size:20})}),qe=({name:e})=>{if(e===`github`)return f(j,{});if(e===`discord`)return f(xe,{});if(e===`x`)return f(Se,{});if(e===`bluesky`)return f(Ce,{})};z.Root=z,z.Left=Re,z.Right=ze,z.Center=Be,z.Logo=Ve,z.Title=He,z.Links=Ue,z.Link=We,z.SearchTrigger=Ge,z.Theme=Ke,z.Socials=({icon:e,link:t,className:n})=>f(L,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:O(`rounded-md p-2 text-text-muted outline-none transition-colors`,`hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:f(qe,{name:e})}),z.Split=({className:e})=>f(ee,{orientation:`vertical`,className:O(`h-6 w-px bg-border-subtle mx-1`,e)}),z.Content=Le;const B=({children:e,className:t,...n})=>f(`nav`,{className:O(`relative flex items-center`,t),...n,children:e});B.Root=B,B.List=({children:e,className:t})=>f(`div`,{className:O(`flex list-none items-center gap-1`,t),children:e}),B.Item=({children:e,label:t,className:n})=>p(m.MenuTrigger,{children:[p(m.Button,{className:O(`flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors cursor-pointer`,`text-text-muted hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:[t,f(re,{size:14,className:`transition-transform`})]}),f(m.Popover,{placement:`bottom start`,className:`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards`,children:f(m.Menu,{className:`w-56 outline-none rounded-xl border border-border-subtle bg-bg-surface p-2 shadow-xl ring-1 ring-border-strong/5`,children:e})})]}),B.Link=({label:e,href:t,description:n,className:r,children:i,...a})=>f(m.MenuItem,{href:t,className:O(`block rounded-lg px-3 py-2 text-sm outline-none cursor-pointer transition-colors`,`hover:bg-bg-muted focus:bg-bg-muted`,r),...a,children:i||p(d,{children:[f(`div`,{className:`font-semibold text-text-main`,children:e}),n&&f(`div`,{className:`text-xs text-text-muted line-clamp-1 mt-0.5`,children:n})]})});const V=({children:e,isOpen:t,onOpenChange:n,className:r})=>f(m.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:O(`fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20`,`entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out`),children:f(m.Modal,{className:O(`mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none`,`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95`,r),children:f(m.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});V.Root=V,V.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=m.Autocomplete;return f(`div`,{className:t,children:f(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},V.Input=({className:e,...t})=>p(m.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[f(b,{className:`h-5 w-5 text-text-muted`}),f(m.Input,{...t,className:O(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),f(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted`,children:f(`kbd`,{className:`font-sans`,children:`ESC`})})]}),V.List=({children:e,className:t,...n})=>f(m.ListBox,{...n,className:O(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),V.Item=Object.assign(({children:e,className:t,...n})=>f(m.ListBoxItem,{...n,className:O(`group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors`,`text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white`,t),children:t=>p(d,{children:[e,(t.isFocused||t.isSelected)&&p(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[f(`span`,{className:`text-[10px]`,children:`Select`}),f(ae,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>f(`div`,{className:O(`shrink-0`,t),children:f(e?le:ce,{size:18})}),Title:({children:e,className:t})=>f(`span`,{className:O(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>f(`span`,{className:O(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function Je(e,t){let n=l(e);o(()=>{n.current!==e&&(t(e),n.current=e)},[e,t])}function H(e){return e.startsWith(`#`)?e.slice(1):null}var Ye=class{items=[];single=!1;observer=null;onChange;callback(e){if(e.length===0)return;for(let t of e){let e=this.items.find(e=>e.id===t.target.id);e&&(e.active=t.isIntersecting,e.fallback=!t.isIntersecting&&t.boundingClientRect.top<100)}let t=-1;for(let e=this.items.length-1;e>=0;e--)if(this.items[e].fallback){t=e;break}t===-1&&this.items.length>0&&(t=0),this.items=this.items.map((e,n)=>({...e,active:n===t,t:n===t?Date.now():e.t})),this.onChange?.()}setItems(e){let t=this.observer;if(t)for(let e of this.items){let n=document.getElementById(e.id);n&&t.unobserve(n)}this.items=[];for(let t of e){let e=H(t.url);e&&this.items.push({id:e,active:!1,fallback:!1,t:0,original:t})}this.watchItems(),typeof window<`u`&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(e){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),e),this.watchItems())}watchItems(){if(this.observer)for(let e of this.items){let t=document.getElementById(e.id);t&&this.observer.observe(t)}}unwatch(){this.observer?.disconnect(),this.observer=null}};const U=n(null),W=n(null);function G(){let e=i(U);if(!e)throw Error(`Component must be used under the <AnchorProvider /> component.`);return e}function Xe(){let e=G();return c(()=>{let t;for(let n of e)n.active&&(!t||n.t>t.t)&&(t=n);return t?.id},[e])}function Ze(){let e=G();return c(()=>{let t=[];for(let n of e)n.active&&t.push(n.id);return t},[e])}function Qe({containerRef:e,children:t}){return f(W.Provider,{value:e,children:t})}function $e({toc:e,single:t=!1,children:n}){let r=c(()=>new Ye,[]),[i,a]=u(r.items);return r.single=t,o(()=>{r.setItems(e)},[r,e]),o(()=>(r.watch({rootMargin:`-100px 0% 0% 0%`,threshold:0}),r.onChange=()=>a([...r.items]),()=>{r.unwatch()}),[r]),f(U.Provider,{value:i,children:n})}const K=({children:e,className:t})=>f(`nav`,{className:O(`sticky top-navbar hidden xl:flex flex-col shrink-0`,`w-toc`,`py-8 pl-6 pr-4`,t),children:e}),et=({children:e,className:t,...n})=>f(`div`,{className:O(`mb-4 text-xs font-bold text-text-main`,t),...n,children:e}),q=({children:e,className:t,ref:n,...r})=>{let i=l(null);return s(n,()=>i.current),f(`div`,{ref:i,className:O(`relative overflow-y-auto boltdocs-otp-content`,t),...r,children:e})};q.displayName=`OnThisPageContent`,K.Root=K,K.Header=et,K.Content=q,K.List=({children:e,className:t})=>f(`ul`,{className:O(`relative space-y-1 text-sm border-l border-border-subtle`,t),children:e}),K.Item=({level:e,children:t,className:n})=>f(`li`,{className:O(e===3&&`pl-3`,n),children:t}),K.Link=({children:e,href:t,active:n,onClick:r,className:a})=>{let s=i(U),c=i(W),d=t?H(t):null,p=l(null),[m,h]=u(n);return Je(d&&s?s.find(e=>e.id===d)?.active:null,e=>{e!==null&&e!==m&&(h(!!e),e&&p.current&&c?.current&&he(p.current,{behavior:`smooth`,block:`center`,inline:`center`,scrollMode:`if-needed`,boundary:c.current}))}),o(()=>{n!==void 0&&h(n)},[n]),f(`a`,{ref:p,href:t,onClick:r,"data-active":m,className:O(`block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main`,m?`text-primary-500 font-medium`:`text-text-muted`,a),children:e})},K.Indicator=({style:e,className:t})=>f(`div`,{className:O(`absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300`,t),style:e});const J=({children:e,className:t})=>f(`nav`,{className:O(`grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle`,t),children:e});J.Root=J,J.Link=({children:e,to:t,direction:n,className:r})=>{let i=n===`next`;return p(m.Link,{href:t,className:O(`flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none`,`transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i?`text-right justify-end`:`text-left justify-start`,r),children:[!i&&f(ie,{className:`mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1`}),f(`div`,{className:`flex flex-col gap-1 flex-1`,children:e}),i&&f(y,{className:`ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1`})]})},J.Title=({children:e,className:t})=>f(`span`,{className:O(`text-xs font-medium uppercase text-text-muted`,t),children:e}),J.Description=({children:e,className:t})=>f(`span`,{className:O(`text-base font-bold text-text-main truncate`,t),children:e}),J.Icon=({children:e})=>f(d,{children:e});const Y=({children:e,className:t=``,...n})=>f(`div`,{className:O(`w-full`,t),...n,children:e});Y.Root=Y,Y.List=({children:e,className:t=``})=>f(`div`,{role:`tablist`,className:O(`relative flex flex-row items-center border-b border-border-subtle`,t),children:e}),Y.Item=({children:e,id:t,selected:n,className:r=``,...i})=>f(`button`,{role:`tab`,"aria-selected":n,className:O(`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none`,n?`text-primary-500`:`text-text-muted hover:text-text-main`,r),...i,children:e}),Y.Content=({children:e,className:t=``})=>f(`div`,{className:O(`p-4 outline-none`,t),children:e}),Y.Indicator=({className:e=``,style:t})=>f(`div`,{className:O(`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300`,e),style:t});const tt=({badge:e})=>{let t={new:`bg-primary-500/20 text-primary-500`,updated:`bg-gray-500/20 text-gray-500`,deprecated:`bg-red-500/20 text-red-500`};if(typeof e==`object`&&e?.expires){let t=new Date(e.expires),n=new Date,r=t.getTime()-n.getTime();if(Math.ceil(r/(1e3*60*60*24))===0)return null}let n=typeof e==`string`?e:e?.text;return f(`span`,{className:O(`ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap`,t[n]||t.new),children:n})},X=({children:e,className:t})=>f(`aside`,{className:O(`boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0`,`w-sidebar h-full`,`overflow-y-auto border-r border-border-subtle bg-bg-main`,`py-6 px-4`,t),children:f(`nav`,{className:`flex-1 space-y-6`,children:e})});X.Root=X,X.Group=({children:e,title:t,icon:n,className:r})=>p(`div`,{className:O(`space-y-1`,r),children:[t&&f(`div`,{className:O(`flex w-full items-center justify-between px-2 py-1.5 text-sm font-semibold`,`text-text-main`),children:p(`div`,{className:`flex items-center gap-2`,children:[n&&f(n,{size:14}),t]})}),e&&f(`div`,{className:`space-y-0.5`,children:e})]}),X.SubGroup=({label:e,href:t,active:n,icon:r,badge:i,className:a,isOpen:o=!1,onToggle:s,children:c})=>p(`div`,{className:`space-y-0.5`,children:[p(`div`,{className:`flex items-center w-full`,children:[p(L,{href:t,className:O(`group flex flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none`,`transition-all duration-200 ease-in-out`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n?`bg-primary-500/10 text-primary-500 font-medium`:`text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1`,a),children:[r&&f(r,{size:16,className:O(n?`text-primary-500`:`text-text-muted group-hover:text-text-main`)}),f(`span`,{className:`truncate`,children:e}),i&&f(tt,{badge:i})]}),c&&f(m.Button,{onPress:s,className:`flex items-center justify-center p-1.5 ml-1 rounded-md text-text-muted hover:bg-bg-surface hover:text-text-main transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 cursor-pointer`,children:f(y,{size:16,className:O(`transition-transform duration-200`,o&&`rotate-90`)})})]}),o&&c&&f(`div`,{className:`pl-4 ml-[7px] border-l border-border-subtle/50 space-y-0.5 mt-0.5`,children:c})]}),X.GroupItem=({children:e,className:t})=>f(`div`,{className:O(t),children:e}),X.Link=({label:e,href:t,active:n,icon:r,badge:i,className:a})=>p(L,{href:t,className:O(`group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none`,`transition-all duration-200 ease-in-out`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,{"bg-primary-500/10 text-primary-500 font-medium":n,"text-text-muted hover:bg-bg-muted hover:text-text-main":!n},a),children:[r&&f(r,{size:16,className:O(n?`text-primary-500`:`text-text-muted group-hover:text-text-main`)}),f(`span`,{className:`truncate`,children:e}),i&&f(tt,{badge:i})]});const Z=({children:e,className:t,...n})=>f(g,{className:O(`flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted`,t),...n,children:e});Z.Root=Z,Z.Item=({children:e,className:t,...n})=>f(h,{className:O(`flex items-center mb-0 gap-1.5`,t),...n,children:e}),Z.Link=({children:e,href:t,className:n,...r})=>f(v,{href:t,className:O(`transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,`current:font-medium current:text-text-main current:pointer-events-none cursor-pointer`,n),...r,children:e}),Z.Separator=({className:e})=>f(y,{size:14,className:O(`shrink-0 text-text-dim`,e)});const nt=({children:e,className:t,vertical:n=!1})=>f(`div`,{className:O(`inline-flex`,n?`flex-col`:`flex-row`,!n&&[`[&>*:not(:first-child)]:-ml-px`,`[&>*:first-child]:rounded-r-none`,`[&>*:last-child]:rounded-l-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-l-full`,`[&>*:last-child]:rounded-r-full`],t?.includes(`rounded-xl`)&&[`[&>*:first-child]:rounded-l-xl`,`[&>*:last-child]:rounded-r-xl`],t?.includes(`rounded-lg`)&&[`[&>*:first-child]:rounded-l-lg`,`[&>*:last-child]:rounded-r-lg`]],n&&[`[&>*:not(:first-child)]:-mt-px`,`[&>*:first-child]:rounded-b-none`,`[&>*:last-child]:rounded-t-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-t-full`,`[&>*:last-child]:rounded-b-full`]],t),children:e}),Q=({children:e,className:t,showArrow:n,...r})=>p(m.Popover,{offset:8,...r,className:m.composeRenderProps(t,e=>O(`z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none`,e)),children:[n&&f(m.OverlayArrow,{className:`group`,children:f(`svg`,{viewBox:`0 0 12 12`,className:`block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90`,"aria-hidden":`true`,children:f(`path`,{d:`M0 0 L6 6 L12 0`})})}),e]});function rt(e){let[n,r]=t.toArray(e.children).slice(0,2);return p(m.MenuTrigger,{...e,children:[n,f(Q,{placement:e.placement,className:`min-w-35`,children:r})]})}function it(e){let[n,r]=t.toArray(e.children).slice(0,2);return p(m.SubmenuTrigger,{...e,children:[n,f(Q,{offset:-4,crossOffset:-4,children:r})]})}function $(e){return f(m.Menu,{...e,className:m.composeRenderProps(e.className,e=>O(`p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75`,e))})}function at(e){let t=e.textValue||(typeof e.children==`string`?e.children:void 0);return f(m.MenuItem,{...e,textValue:t,className:m.composeRenderProps(e.className,(e,{isFocused:t,isPressed:n,isDisabled:r})=>O(`group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none`,`text-text-main text-[12px]`,{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":t,"bg-bg-surface-elevanted":n,"opacity-40 grayscale pointer-events-none":r},e)),children:m.composeRenderProps(e.children,(e,{selectionMode:t,isSelected:n,hasSubmenu:r})=>p(d,{children:[t!==`none`&&p(`span`,{className:`flex items-center size-4 shrink-0 justify-center`,children:[n&&t===`multiple`&&f(ne,{className:`size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200`}),n&&t===`single`&&f(oe,{className:`size-5 text-primary-500 animate-in zoom-in-50 duration-200`})]}),f(`div`,{className:`flex flex-row w-full transition-colors items-center gap-2 py-1 px-1`,children:e}),r&&f(y,{className:`size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors`})]}))})}function ot({title:e,...t}){return p(m.MenuSection,{...t,className:O(`flex flex-col gap-0.5`,t.className),children:[e&&f(m.Header,{className:`px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none`,children:e}),f(m.Collection,{items:t.items,children:t.children})]})}function st(e){return f(m.Separator,{...e,className:`mx-2 my-1.5 border-t border-border-subtle/50`})}$.Root=$,$.Item=at,$.Trigger=rt,$.SubTrigger=it,$.Section=ot,$.Separator=st;function ct({className:e,variant:t=`rect`,...n}){return f(`div`,{className:O(`animate-pulse bg-bg-muted`,t===`circle`?`rounded-full`:`rounded-md`,e),...n})}function lt(e){let{currentLocale:t,currentVersion:n}=F(),[r,i]=u(!1),[a,s]=u(``),[l,d]=u(null);return o(()=>{if(!r||l)return;let e=new ge({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of _e)e.add(t.id,`${t.title} ${t.content}`);d(e)},[r,l]),{isOpen:r,setIsOpen:i,query:a,setQuery:s,list:c(()=>{if(!a)return e.filter(e=>{let r=!t||e.locale===t,i=!n||e.version===n;return r&&i}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!l)return[];let r=l.search(a,{limit:20,suggest:!0}),i=[],o=new Set;for(let e of r){let r=_e.find(t=>t.id===e);if(!r)continue;let a=!t||r.locale===t,s=!n||r.version===n;!a||!s||o.has(r.url)||(o.add(r.url),i.push({id:r.url,title:r.title,path:r.url,bio:r.display,groupTitle:r.display.split(` > `)[0],isHeading:r.url.includes(`#`)}))}return i.slice(0,10)},[a,l,t,n,e]),input:{value:a,onChange:e=>s(e.target.value)}}}export{Ee as A,E as B,Ie as C,De as D,Pe as E,we as F,ye as H,Me as I,be as L,ke as M,Ne as N,j as O,je as P,k as R,F as S,Oe as T,C as U,D as V,B as _,nt as a,R as b,Y as c,K as d,Qe as f,V as g,G as h,Q as i,Ae as j,Te as k,J as l,Ze as m,ct as n,Z as o,Xe as p,$ as r,X as s,lt as t,$e as u,z as v,N as w,I as x,L as y,O as z};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react-router-dom`),u=require(`react`),d=require(`react/jsx-runtime`),f=require(`react-aria-components`);f=c(f);let p=require(`lucide-react`),m=require(`clsx`),h=require(`tailwind-merge`),g=require(`flexsearch`),_=require(`virtual:boltdocs-search`);_=c(_);const v=Symbol.for(`__BDOCS_BOLTDOCS_CONTEXT__`),y=Symbol.for(`__BDOCS_BOLTDOCS_INSTANCE__`),b=globalThis[v]||(globalThis[v]=(0,u.createContext)(void 0));function x({children:e,initialLocale:t=``,initialVersion:n=``}){let r=(typeof window>`u`||window.location.pathname.split(`/`).filter(Boolean),{locale:t,version:n}),[i,a]=(0,u.useState)(r.locale),[o,s]=(0,u.useState)(r.version),[c,l]=(0,u.useState)(!1),f=(0,u.useMemo)(()=>({currentLocale:i,currentVersion:o,setLocale:e=>a(e||``),setVersion:e=>s(e||``),hasHydrated:c,setHasHydrated:l}),[i,o,c]);return typeof globalThis<`u`&&(globalThis[y]=f),(0,d.jsx)(b.Provider,{value:f,children:e})}function S(){let e=(0,u.use)(b);if(!e&&typeof globalThis<`u`&&globalThis[y])return globalThis[y];if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}const C=Symbol.for(`__BDOCS_CONFIG_CONTEXT__`),w=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`),T=globalThis[C]||(globalThis[C]=(0,u.createContext)(null));function E(){let e=(0,u.use)(T);if(!e&&typeof globalThis<`u`&&globalThis[w])return globalThis[w];if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}function D(...e){return(0,h.twMerge)((0,m.clsx)(e))}function O(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const k=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`GitHub`}),(0,d.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})]}),A=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`Discord`}),(0,d.jsx)(`path`,{d:`M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z`})]}),j=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`X`}),(0,d.jsx)(`path`,{d:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`})]}),M=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`Bluesky`}),(0,d.jsx)(`path`,{d:`M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026`})]}),ee=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`TypeScript`}),(0,d.jsx)(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),te=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`JavaScript`}),(0,d.jsx)(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),N=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`JSON`}),(0,d.jsx)(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),P=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`CSS`}),(0,d.jsx)(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),F=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`HTML`}),(0,d.jsx)(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),I=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`React`}),(0,d.jsx)(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),L=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Markdown`}),(0,d.jsx)(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),R=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Shell`}),(0,d.jsx)(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),z=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`YAML`}),(0,d.jsx)(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),B=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Rust`}),(0,d.jsx)(`path`,{fill:`#EA580C`,fillRule:`evenodd`,d:`M12.58 2.136a.287.287 0 00-.488 0l-.526.85a8.974 8.974 0 00-.232.022l-.683-.73a.287.287 0 00-.478.096l-.35.935c-.075.021-.15.044-.224.067l-.812-.583a.287.287 0 00-.45.187l-.162.989a9.088 9.088 0 00-.204.11l-.913-.417a.287.287 0 00-.406.272l.036 1.005a9.099 9.099 0 00-.175.144l-.98-.231a.287.287 0 00-.345.345l.231.98a9.125 9.125 0 00-.144.175L4.27 6.316a.287.287 0 00-.271.406l.416.913a9.036 9.036 0 00-.11.203L3.317 8a.287.287 0 00-.187.45l.584.813a8.953 8.953 0 00-.068.223l-.935.35a.287.287 0 00-.095.479l.73.682a8.966 8.966 0 00-.023.233l-.85.526a.287.287 0 000 .488l.85.526c.007.078.014.156.023.233l-.73.682a.287.287 0 00.095.479l.935.35.068.223-.584.812a.287.287 0 00.187.451l.99.162c.035.068.072.135.109.203l-.416.913a.287.287 0 00.271.406l1.006-.036c.047.059.095.117.143.174l-.23.981a.287.287 0 00.344.345l.981-.23c.057.048.115.095.174.142l-.036 1.006a.287.287 0 00.406.272l.914-.417c.067.038.135.074.203.11l.161.99a.287.287 0 00.451.186l.813-.584c.074.024.148.046.223.068l.35.935a.287.287 0 00.478.095l.683-.73c.077.01.154.017.232.023l.526.85a.287.287 0 00.489 0l.526-.85c.078-.006.155-.014.232-.023l.682.73a.287.287 0 00.479-.095l.35-.935c.075-.022.15-.044.223-.068l.813.584a.287.287 0 00.45-.187l.162-.99a8.77 8.77 0 00.203-.109l.913.417a.287.287 0 00.406-.272l-.035-1.006c.058-.047.116-.094.174-.143l.98.231a.287.287 0 00.346-.345l-.231-.98.143-.175 1.006.036a.287.287 0 00.271-.406l-.416-.913a9.4 9.4 0 00.109-.203l.99-.162a.287.287 0 00.187-.45l-.584-.813a8.43 8.43 0 00.067-.223l.935-.35a.287.287 0 00.096-.479l-.73-.682c.009-.077.016-.155.023-.233l.85-.526a.287.287 0 000-.488l-.85-.526a8.844 8.844 0 00-.023-.233l.73-.682a.287.287 0 00-.096-.479l-.934-.35a9.246 9.246 0 00-.068-.223l.584-.812A.287.287 0 0021.357 8l-.99-.162a8.92 8.92 0 00-.11-.203l.417-.913a.287.287 0 00-.271-.406l-1.006.036a9.178 9.178 0 00-.143-.174l.23-.981a.287.287 0 00-.345-.345l-.98.23a9.43 9.43 0 00-.174-.142l.035-1.006a.287.287 0 00-.405-.272l-.914.417a9.11 9.11 0 00-.203-.11l-.162-.99a.287.287 0 00-.45-.186l-.813.584a9.088 9.088 0 00-.223-.068l-.35-.935a.287.287 0 00-.479-.095l-.682.73a9.062 9.062 0 00-.232-.023l-.526-.85zm-.257 1.62a.592.592 0 01.578.596.595.595 0 11-.578-.595zm1.363.98A7.324 7.324 0 0118.7 8.309l-.702 1.585a.547.547 0 00.275.717l1.352.6c.041.422.047.847.015 1.27h-.752c-.075 0-.106.05-.106.123v.344c0 .812-.457.99-.859 1.034-.383.044-.806-.161-.86-.394-.22-1.24-.583-1.526-1.152-1.975l-.041-.033c.736-.467 1.502-1.158 1.502-2.08 0-.998-.683-1.625-1.148-1.934-.655-.43-1.379-.516-1.574-.516H6.88a7.324 7.324 0 014.098-2.312l.916.96a.54.54 0 00.766.018l1.026-.978zm-8.46 4.407a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm14.192.026a.595.595 0 11-.035 1.19.595.595 0 01.035-1.19zm-13.07.096h1.037v4.678H5.291a7.324 7.324 0 01-.237-2.797l1.282-.57a.542.542 0 00.276-.716l-.264-.595zm4.33.05h2.47c.128 0 .901.147.901.727 0 .48-.593.653-1.081.653h-2.293l.002-1.38zm0 3.36h1.892c.172 0 .924.05 1.164 1.011.026.104.064.291.107.503.078.389.174.861.247 1.06.113.345.57 1.034 1.058 1.034h3.089c-.207.277-.433.54-.677.785l-1.258-.27a.544.544 0 00-.645.417l-.298 1.394a7.323 7.323 0 01-6.108-.03l-.298-1.392a.542.542 0 00-.643-.418l-1.23.264a7.32 7.32 0 01-.636-.75h5.984c.067 0 .113-.011.113-.074v-2.117c0-.061-.046-.075-.113-.075h-1.75l.001-1.341zm-2.763 4.848a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm8.814.027a.596.596 0 11-.035 1.19.596.596 0 01.035-1.19z`,clipRule:`evenodd`})]}),V=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Rust`}),(0,d.jsx)(`path`,{fill:`#F87171`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),H=(0,u.createContext)({routes:[]});function U(){return(0,u.useContext)(H)}function W({routes:e,children:t}){return(0,d.jsx)(H.Provider,{value:{routes:e},children:t})}function G(){let{routes:e}=U(),t=E(),n=(0,l.useLocation)(),{hasHydrated:r,currentLocale:i,currentVersion:a}=S(),o=e=>e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e,s=o(n.pathname),c=e?.find?.(e=>o(e.path)===s),u=t.i18n?c?.locale||(r?i:void 0)||t.i18n.defaultLocale:void 0,d=t.versions?c?.version||(r?a:void 0)||t.versions.defaultVersion:void 0,f=e?.filter?.(n=>{let r=t.i18n?(n.locale||t.i18n.defaultLocale)===u:!0,i=t.versions?(n.version||t.versions.defaultVersion)===d:!0;if(!(r&&i))return!1;let a=t.i18n;if(a){let t=!!c?.locale,r=!!n.locale;if(e?.some?.(e=>e!==n&&e.filePath===n.filePath&&e.version===n.version&&(e.locale||a.defaultLocale)===(n.locale||a.defaultLocale))&&t!==r)return!1}return!0}),p=t.i18n?.localeConfigs?.[u]?.label||t.i18n?.locales[u]||u,m=t.versions?.versions?.find?.(e=>e.path===d)?.label||d;return{routes:f,allRoutes:e,currentRoute:c,currentLocale:u,currentLocaleLabel:p,availableLocales:t.i18n?Object.entries(t.i18n.locales).map(([e,n])=>({key:e,label:t.i18n?.localeConfigs?.[e]?.label||n,isCurrent:e===u})):[],currentVersion:d,currentVersionLabel:m,availableVersions:t.versions?t.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===d})):[],config:t}}function K(e){let t=E(),{currentLocale:n,currentVersion:r}=G();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}const q=(0,u.forwardRef)((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=K(n??``),c=e=>{i?.(e)},l=e=>{a?.(e)};return(0,d.jsx)(f.Link,{...o,ref:t,href:s,onMouseEnter:c,onFocus:l})});q.displayName=`Link`;const J=(0,u.forwardRef)((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=(0,l.useLocation)(),c=K(n??``),u=r?s.pathname===c:s.pathname.startsWith(c),f=typeof i==`function`?i({isActive:u}):D(i,u&&`active`),p=typeof a==`function`?a({isActive:u}):a;return(0,d.jsx)(q,{...o,ref:t,href:n,className:f,children:p})});J.displayName=`NavLink`;const Y=({children:e,className:t,...n})=>(0,d.jsx)(`header`,{className:D(`boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md`,t),...n,children:e}),X=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),Z=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),ne=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),re=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),ie=({src:e,alt:t,width:n=24,height:r=24,className:i})=>(0,d.jsx)(q,{href:`/`,className:D(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?(0,d.jsx)(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),ae=({children:e,className:t})=>(0,d.jsx)(q,{href:`/`,children:(0,d.jsx)(`span`,{className:D(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),oe=({children:e,className:t})=>(0,d.jsx)(`nav`,{className:D(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),se=({label:e,href:t,active:n,to:r,className:i})=>(0,d.jsxs)(q,{href:t,target:r===`external`?`_blank`:void 0,className:D(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,{"text-primary-500":n,"text-text-muted hover:text-text-main":!n},i),children:[e,r===`external`&&(0,d.jsx)(`span`,{className:`ml-1 inline-block`,children:(0,d.jsx)(p.ExternalLink,{size:12})})]}),Q=({className:e,onPress:t})=>{let[n,r]=(0,u.useState)(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,u.useEffect)(()=>{r(!0)},[]),(0,d.jsxs)(f.Button,{onPress:t,className:D(`flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer`,`transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,`w-full max-w-[720px] justify-between`,e),children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(p.Search,{size:16}),(0,d.jsx)(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),(0,d.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[(0,d.jsx)(`kbd`,{className:`flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium`,children:i?`⌘`:`Ctrl`}),(0,d.jsx)(`kbd`,{className:`flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium`,children:`K`})]})]})},ce=({className:e,theme:t,onThemeChange:n})=>(0,d.jsx)(f.ToggleButton,{isSelected:t===`dark`,onChange:n,className:D(`rounded-md p-2 text-text-muted outline-none cursor-pointer`,`transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,e),"aria-label":`Toggle theme`,children:t===`dark`?(0,d.jsx)(p.Sun,{size:20}):(0,d.jsx)(p.Moon,{size:20})}),le=({name:e})=>{if(e===`github`)return(0,d.jsx)(k,{});if(e===`discord`)return(0,d.jsx)(A,{});if(e===`x`)return(0,d.jsx)(j,{});if(e===`bluesky`)return(0,d.jsx)(M,{})};Y.Root=Y,Y.Left=Z,Y.Right=ne,Y.Center=re,Y.Logo=ie,Y.Title=ae,Y.Links=oe,Y.Link=se,Y.SearchTrigger=Q,Y.Theme=ce,Y.Socials=({icon:e,link:t,className:n})=>(0,d.jsx)(q,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:D(`rounded-md p-2 text-text-muted outline-none transition-colors`,`hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:(0,d.jsx)(le,{name:e})}),Y.Split=({className:e})=>(0,d.jsx)(f.Separator,{orientation:`vertical`,className:D(`h-6 w-px bg-border-subtle mx-1`,e)}),Y.Content=X;const $=({children:e,isOpen:t,onOpenChange:n,className:r})=>(0,d.jsx)(f.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:D(`fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20`,`entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out`),children:(0,d.jsx)(f.Modal,{className:D(`mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none`,`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95`,r),children:(0,d.jsx)(f.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});$.Root=$,$.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=f.Autocomplete;return(0,d.jsx)(`div`,{className:t,children:(0,d.jsx)(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},$.Input=({className:e,...t})=>(0,d.jsxs)(f.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[(0,d.jsx)(p.Search,{className:`h-5 w-5 text-text-muted`}),(0,d.jsx)(f.Input,{...t,className:D(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),(0,d.jsx)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted`,children:(0,d.jsx)(`kbd`,{className:`font-sans`,children:`ESC`})})]}),$.List=({children:e,className:t,...n})=>(0,d.jsx)(f.ListBox,{...n,className:D(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),$.Item=Object.assign(({children:e,className:t,...n})=>(0,d.jsx)(f.ListBoxItem,{...n,className:D(`group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors`,`text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white`,t),children:t=>(0,d.jsxs)(d.Fragment,{children:[e,(t.isFocused||t.isSelected)&&(0,d.jsxs)(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[(0,d.jsx)(`span`,{className:`text-[10px]`,children:`Select`}),(0,d.jsx)(p.CornerDownLeft,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>(0,d.jsx)(`div`,{className:D(`shrink-0`,t),children:e?(0,d.jsx)(p.Hash,{size:18}):(0,d.jsx)(p.FileText,{size:18})}),Title:({children:e,className:t})=>(0,d.jsx)(`span`,{className:D(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>(0,d.jsx)(`span`,{className:D(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function ue(e){let{currentLocale:t,currentVersion:n}=G(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!r||s)return;let e=new g.Index({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of _.default)e.add(t.id,`${t.title} ${t.content}`);c(e)},[r,s]),{isOpen:r,setIsOpen:i,query:a,setQuery:o,list:(0,u.useMemo)(()=>{if(!a)return e.filter(e=>{let r=!t||e.locale===t,i=!n||e.version===n;return r&&i}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!s)return[];let r=s.search(a,{limit:20,suggest:!0}),i=[],o=new Set;for(let e of r){let r=_.default.find(t=>t.id===e);if(!r)continue;let a=!t||r.locale===t,s=!n||r.version===n;!a||!s||o.has(r.url)||(o.add(r.url),i.push({id:r.url,title:r.title,path:r.url,bio:r.display,groupTitle:r.display.split(` > `)[0],isHeading:r.url.includes(`#`)}))}return i.slice(0,10)},[a,s,t,n,e]),input:{value:a,onChange:e=>o(e.target.value)}}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return ee}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boltdocs",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "A lightweight documentation generator for React projects.",
|
|
5
5
|
"main": "dist/node/index.mjs",
|
|
6
6
|
"module": "dist/node/index.mjs",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
33
|
"bin",
|
|
34
|
-
"src/client"
|
|
34
|
+
"src/client",
|
|
35
|
+
"src/shared"
|
|
35
36
|
],
|
|
36
37
|
"keywords": [
|
|
37
38
|
"docs",
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { useLocation } from 'react-router-dom'
|
|
2
|
-
import {
|
|
2
|
+
import type { ComponentType, ReactNode } from 'react'
|
|
3
|
+
import * as ReactHelmetAsync from 'react-helmet-async'
|
|
3
4
|
import { useConfig } from '../../app/config-context'
|
|
4
5
|
|
|
6
|
+
type HelmetModule = {
|
|
7
|
+
Helmet?: ComponentType<{ children?: ReactNode }>
|
|
8
|
+
default?: { Helmet?: ComponentType<{ children?: ReactNode }> }
|
|
9
|
+
}
|
|
10
|
+
const helmetModule = ReactHelmetAsync as unknown as HelmetModule
|
|
11
|
+
const Helmet = helmetModule.Helmet || helmetModule.default?.Helmet || (({ children }) => <>{children}</>)
|
|
12
|
+
|
|
5
13
|
interface HeadProps {
|
|
6
14
|
siteTitle: string
|
|
7
15
|
siteDescription?: string
|
|
8
|
-
routes: Array<{ path: string; title: string; description?: string; seo?: Record<string,
|
|
16
|
+
routes: Array<{ path: string; title: string; description?: string; seo?: Record<string, unknown> }>
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
export function Head({ siteTitle, siteDescription, routes }: HeadProps) {
|
|
@@ -29,7 +37,6 @@ export function Head({ siteTitle, siteDescription, routes }: HeadProps) {
|
|
|
29
37
|
const ogImage = seo['og:image'] || defaultOgImage
|
|
30
38
|
|
|
31
39
|
return (
|
|
32
|
-
// @ts-ignore
|
|
33
40
|
<Helmet>
|
|
34
41
|
<title>{finalTitle}</title>
|
|
35
42
|
<meta name="description" content={pageDescription} />
|
|
@@ -2,19 +2,20 @@ import { useNavigate } from 'react-router-dom'
|
|
|
2
2
|
import { getBaseFilePath } from '../utils/get-base-file-path'
|
|
3
3
|
import { useRoutes } from './use-routes'
|
|
4
4
|
import { useBoltdocsContext } from '../store/boltdocs-context'
|
|
5
|
+
import type { BoltdocsLocale } from '../../shared/types'
|
|
5
6
|
|
|
6
7
|
export interface LocaleOption {
|
|
7
|
-
key:
|
|
8
|
+
key: BoltdocsLocale
|
|
8
9
|
label: string
|
|
9
10
|
value: string
|
|
10
11
|
isCurrent: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export interface UseI18nReturn {
|
|
14
|
-
currentLocale:
|
|
15
|
+
currentLocale: BoltdocsLocale | undefined
|
|
15
16
|
currentLocaleLabel: string | undefined
|
|
16
17
|
availableLocales: LocaleOption[]
|
|
17
|
-
handleLocaleChange: (locale:
|
|
18
|
+
handleLocaleChange: (locale: BoltdocsLocale) => void
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -54,10 +54,7 @@ export function useLocalizedTo(to: RouterLinkProps['to']) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (i18n && activeLocale) {
|
|
57
|
-
|
|
58
|
-
if (activeLocale !== i18n.defaultLocale) {
|
|
59
|
-
resultParts.push(activeLocale)
|
|
60
|
-
}
|
|
57
|
+
resultParts.push(activeLocale)
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
resultParts.push(...routeContent)
|
|
@@ -95,7 +95,7 @@ export function useRoutes() {
|
|
|
95
95
|
? Object.entries(config.i18n.locales).map(([key, defaultLabel]) => {
|
|
96
96
|
const localeConfig = config.i18n?.localeConfigs?.[key]
|
|
97
97
|
return {
|
|
98
|
-
key,
|
|
98
|
+
key: key as import('../../shared/types').BoltdocsLocale,
|
|
99
99
|
label: localeConfig?.label || defaultLabel,
|
|
100
100
|
isCurrent: key === currentLocale,
|
|
101
101
|
}
|
|
@@ -104,7 +104,7 @@ export function useRoutes() {
|
|
|
104
104
|
|
|
105
105
|
const availableVersions = config.versions
|
|
106
106
|
? config.versions.versions.map((v) => ({
|
|
107
|
-
key: v.path,
|
|
107
|
+
key: v.path as import('../../shared/types').BoltdocsVersion,
|
|
108
108
|
label: v.label,
|
|
109
109
|
isCurrent: v.path === currentVersion,
|
|
110
110
|
}))
|
|
@@ -114,10 +114,10 @@ export function useRoutes() {
|
|
|
114
114
|
routes,
|
|
115
115
|
allRoutes,
|
|
116
116
|
currentRoute,
|
|
117
|
-
currentLocale,
|
|
117
|
+
currentLocale: currentLocale as import('../../shared/types').BoltdocsLocale,
|
|
118
118
|
currentLocaleLabel,
|
|
119
119
|
availableLocales,
|
|
120
|
-
currentVersion,
|
|
120
|
+
currentVersion: currentVersion as import('../../shared/types').BoltdocsVersion,
|
|
121
121
|
currentVersionLabel,
|
|
122
122
|
availableVersions,
|
|
123
123
|
config,
|
|
@@ -26,6 +26,9 @@ export function useSidebar(routes: ComponentRoute[]) {
|
|
|
26
26
|
>()
|
|
27
27
|
|
|
28
28
|
for (const route of filteredRoutes) {
|
|
29
|
+
// Skip home pages or external pages from the sidebar if they are not explicitly grouped
|
|
30
|
+
if (!route.filePath && !route.group) continue
|
|
31
|
+
|
|
29
32
|
if (!route.group) {
|
|
30
33
|
ungrouped.push(route)
|
|
31
34
|
} else {
|
|
@@ -2,19 +2,20 @@ import { useNavigate } from 'react-router-dom'
|
|
|
2
2
|
import { getBaseFilePath } from '../utils/get-base-file-path'
|
|
3
3
|
import { useRoutes } from './use-routes'
|
|
4
4
|
import { useBoltdocsContext } from '../store/boltdocs-context'
|
|
5
|
+
import type { BoltdocsVersion } from '../../shared/types'
|
|
5
6
|
|
|
6
7
|
export interface VersionOption {
|
|
7
|
-
key:
|
|
8
|
+
key: BoltdocsVersion
|
|
8
9
|
label: string
|
|
9
10
|
value: string
|
|
10
11
|
isCurrent: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export interface UseVersionReturn {
|
|
14
|
-
currentVersion:
|
|
15
|
+
currentVersion: BoltdocsVersion | undefined
|
|
15
16
|
currentVersionLabel: string | undefined
|
|
16
17
|
availableVersions: VersionOption[]
|
|
17
|
-
handleVersionChange: (version:
|
|
18
|
+
handleVersionChange: (version: BoltdocsVersion) => void
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -34,9 +35,21 @@ export function useVersion(): UseVersionReturn {
|
|
|
34
35
|
// Update store
|
|
35
36
|
setVersion(version)
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
// If we are on the home page or a path that doesn't belong to the documentation,
|
|
39
|
+
// we stay on the current page.
|
|
40
|
+
const localePaths = config.i18n ? Object.keys(config.i18n.locales).map(l => `/${l}`) : []
|
|
41
|
+
const isHome = !currentRoute ||
|
|
42
|
+
currentRoute.path === '/' ||
|
|
43
|
+
currentRoute.path === config.base ||
|
|
44
|
+
currentRoute.path === '' ||
|
|
45
|
+
localePaths.includes(currentRoute.path)
|
|
46
|
+
|
|
47
|
+
if (isHome) {
|
|
48
|
+
return
|
|
49
|
+
}
|
|
38
50
|
|
|
39
51
|
if (currentRoute) {
|
|
52
|
+
let targetPath = `/docs/${version}`
|
|
40
53
|
const baseFile = getBaseFilePath(
|
|
41
54
|
currentRoute.filePath,
|
|
42
55
|
currentRoute.version,
|
|
@@ -63,9 +76,9 @@ export function useVersion(): UseVersionReturn {
|
|
|
63
76
|
? versionIndexRoute.path
|
|
64
77
|
: `/docs/${version}${currentLocale ? `/${currentLocale}` : ''}`
|
|
65
78
|
}
|
|
79
|
+
|
|
80
|
+
navigate(targetPath)
|
|
66
81
|
}
|
|
67
|
-
|
|
68
|
-
navigate(targetPath)
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
const availableVersions = routeContext.availableVersions.map((v) => ({
|
package/src/client/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export type { BoltdocsConfig, BoltdocsThemeConfig } from '../shared/types'
|
|
2
|
-
export { defineConfig } from '../shared/config-utils'
|
|
3
1
|
export type {
|
|
4
2
|
ComponentRoute,
|
|
5
3
|
LayoutProps,
|
|
6
4
|
} from './types'
|
|
5
|
+
export type { BoltdocsLocale, BoltdocsVersion, BoltdocsTypes } from '../shared/types'
|
|
7
6
|
export * from './ssg'
|
|
8
7
|
export { useConfig } from './app/config-context'
|
|
9
8
|
export { useTheme } from './app/theme-context'
|
|
@@ -14,7 +13,6 @@ export { useMdxComponents } from './app/mdx-components-context'
|
|
|
14
13
|
export * from './hooks/index'
|
|
15
14
|
// Composable layout building blocks
|
|
16
15
|
export { DocsLayout } from './components/docs-layout'
|
|
17
|
-
export { DefaultLayout } from './components/default-layout'
|
|
18
16
|
|
|
19
17
|
// Default UI components (for use in custom layout.tsx)
|
|
20
18
|
export { Navbar } from './components/ui-base/navbar'
|
|
@@ -104,3 +102,4 @@ export { Skeleton as PrimitiveSkeleton } from './components/primitives/skeleton'
|
|
|
104
102
|
|
|
105
103
|
// Utilities
|
|
106
104
|
export { cn } from './utils/cn'
|
|
105
|
+
export { getTranslated } from './utils/i18n'
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react'
|
|
2
|
+
import type { ComponentType, ReactNode } from 'react'
|
|
2
3
|
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
|
|
3
4
|
import { RouterProvider } from 'react-aria-components'
|
|
4
5
|
import { BoltdocsProvider, useBoltdocsContext } from '../store/boltdocs-context'
|
|
5
6
|
import { ThemeProvider } from '../app/theme-context'
|
|
6
7
|
import { MdxComponentsProvider } from '../app/mdx-components-context'
|
|
7
|
-
import
|
|
8
|
+
import * as ReactHelmetAsync from 'react-helmet-async'
|
|
8
9
|
import { ConfigContext } from '../app/config-context'
|
|
9
10
|
import { ScrollHandler } from '../app/scroll-handler'
|
|
10
11
|
import { mdxComponentsDefault } from '../app/mdx-component'
|
|
@@ -14,6 +15,16 @@ import type { ComponentRoute } from '../types'
|
|
|
14
15
|
|
|
15
16
|
import virtualCustomComponents from 'virtual:boltdocs-mdx-components'
|
|
16
17
|
|
|
18
|
+
type HelmetProviderModule = {
|
|
19
|
+
HelmetProvider?: ComponentType<{ children?: ReactNode }>
|
|
20
|
+
default?: { HelmetProvider?: ComponentType<{ children?: ReactNode }> }
|
|
21
|
+
}
|
|
22
|
+
const helmetProviderModule = ReactHelmetAsync as unknown as HelmetProviderModule
|
|
23
|
+
const HelmetProvider =
|
|
24
|
+
helmetProviderModule.HelmetProvider
|
|
25
|
+
|| helmetProviderModule.default?.HelmetProvider
|
|
26
|
+
|| (({ children }) => <>{children}</>)
|
|
27
|
+
|
|
17
28
|
/**
|
|
18
29
|
* Updates the HTML lang and dir attributes based on the current locale configuration.
|
|
19
30
|
*/
|
|
@@ -60,12 +71,15 @@ function StoreSync({ config }: { config: BoltdocsConfig }) {
|
|
|
60
71
|
}
|
|
61
72
|
|
|
62
73
|
// 2. Locale detection
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
if (config.i18n && parts.length > cIdx) {
|
|
75
|
+
const potentialLocale = parts[cIdx]
|
|
76
|
+
const isLocale = Array.isArray(config.i18n.locales)
|
|
77
|
+
? config.i18n.locales.includes(potentialLocale)
|
|
78
|
+
: !!config.i18n.locales[potentialLocale]
|
|
79
|
+
|
|
80
|
+
if (isLocale) {
|
|
81
|
+
detectedLocale = potentialLocale
|
|
82
|
+
}
|
|
69
83
|
} else if (config.i18n && parts.length === 0) {
|
|
70
84
|
detectedLocale = currentLocale || config.i18n.defaultLocale
|
|
71
85
|
}
|
|
@@ -103,25 +117,43 @@ export function BoltdocsShell({
|
|
|
103
117
|
)
|
|
104
118
|
|
|
105
119
|
const navigate = useNavigate()
|
|
120
|
+
const { pathname } = useLocation()
|
|
121
|
+
|
|
122
|
+
const currentPath = useMemo(() => {
|
|
123
|
+
const p = pathname || '/'
|
|
124
|
+
return p.endsWith('/') && p.length > 1 ? p.slice(0, -1) : p
|
|
125
|
+
}, [pathname])
|
|
126
|
+
|
|
127
|
+
const currentRoute = useMemo(() =>
|
|
128
|
+
routes.find((r) => {
|
|
129
|
+
const rp = r.path === '' ? '/' : r.path
|
|
130
|
+
const normalize = (path: string) => path.endsWith('/') && path.length > 1 ? path.slice(0, -1) : path
|
|
131
|
+
return normalize(rp) === currentPath
|
|
132
|
+
}),
|
|
133
|
+
[routes, currentPath]
|
|
134
|
+
)
|
|
106
135
|
|
|
107
136
|
return (
|
|
108
137
|
<HelmetProvider>
|
|
109
|
-
<
|
|
138
|
+
<RoutesProvider routes={routes}>
|
|
110
139
|
<ThemeProvider>
|
|
111
140
|
<MdxComponentsProvider components={allComponents}>
|
|
112
141
|
<ConfigContext.Provider value={config}>
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
|
|
142
|
+
<RouterProvider navigate={navigate}>
|
|
143
|
+
<ScrollHandler />
|
|
144
|
+
<BoltdocsProvider
|
|
145
|
+
initialLocale={currentRoute?.locale}
|
|
146
|
+
initialVersion={currentRoute?.version}
|
|
147
|
+
>
|
|
116
148
|
<StoreSync config={config} />
|
|
117
149
|
<I18nUpdater config={config} />
|
|
118
150
|
<Outlet />
|
|
119
|
-
</
|
|
120
|
-
</
|
|
151
|
+
</BoltdocsProvider>
|
|
152
|
+
</RouterProvider>
|
|
121
153
|
</ConfigContext.Provider>
|
|
122
154
|
</MdxComponentsProvider>
|
|
123
155
|
</ThemeProvider>
|
|
124
|
-
</
|
|
156
|
+
</RoutesProvider>
|
|
125
157
|
</HelmetProvider>
|
|
126
158
|
)
|
|
127
159
|
}
|
|
@@ -23,11 +23,21 @@ function findModuleKey(
|
|
|
23
23
|
filePath: string,
|
|
24
24
|
): string | undefined {
|
|
25
25
|
const normalizedFilePath = filePath.replace(/\\/g, '/')
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
26
|
+
const keys = Object.keys(modules)
|
|
27
|
+
if (keys.length === 0) return undefined
|
|
28
|
+
|
|
29
|
+
// Detect docs directory from keys (e.g., "/docs/...")
|
|
30
|
+
const firstKey = keys[0].replace(/\\/g, '/')
|
|
31
|
+
const parts = firstKey.split('/').filter(Boolean)
|
|
32
|
+
const docsDirName = parts[0] || 'docs'
|
|
33
|
+
|
|
34
|
+
const targetKey = `/${docsDirName}/${normalizedFilePath}`
|
|
35
|
+
const targetKeyAlt = `./${docsDirName}/${normalizedFilePath}`
|
|
36
|
+
|
|
37
|
+
return keys.find((key) => {
|
|
38
|
+
const k = key.replace(/\\/g, '/')
|
|
39
|
+
return k === targetKey || k === targetKeyAlt || k.endsWith(targetKey)
|
|
40
|
+
})
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
@@ -53,6 +63,8 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
53
63
|
return `${b}${p}` || '/'
|
|
54
64
|
}
|
|
55
65
|
|
|
66
|
+
const allMetadata: ComponentRoute[] = [...routesData]
|
|
67
|
+
|
|
56
68
|
// 1. Documentation routes
|
|
57
69
|
const docRoutes: RouteRecord[] = routesData.map((route) => {
|
|
58
70
|
const moduleKey = findModuleKey(mdxModules, route.filePath)
|
|
@@ -86,16 +98,24 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
86
98
|
|
|
87
99
|
// 2. Home page route
|
|
88
100
|
if (HomePage) {
|
|
89
|
-
const
|
|
101
|
+
const homeConfigs = [{ path: withBase('/'), locale: config.i18n?.defaultLocale }]
|
|
90
102
|
if (config.i18n) {
|
|
91
103
|
Object.keys(config.i18n.locales).forEach((locale) => {
|
|
92
|
-
|
|
104
|
+
homeConfigs.push({ path: withBase(`/${locale}`), locale })
|
|
93
105
|
})
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
|
|
108
|
+
homeConfigs.forEach(({ path, locale }) => {
|
|
97
109
|
// Avoid duplicate routes if documentation also maps to '/'
|
|
98
110
|
if (!children.find((r) => r.path === path)) {
|
|
111
|
+
allMetadata.push({
|
|
112
|
+
path,
|
|
113
|
+
locale,
|
|
114
|
+
title: 'Home',
|
|
115
|
+
filePath: '',
|
|
116
|
+
headings: [],
|
|
117
|
+
} as any)
|
|
118
|
+
|
|
99
119
|
children.push({
|
|
100
120
|
path,
|
|
101
121
|
element: (
|
|
@@ -103,6 +123,10 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
103
123
|
<HomePage />
|
|
104
124
|
</EffectiveExternalLayout>
|
|
105
125
|
),
|
|
126
|
+
loader: async () => ({
|
|
127
|
+
path,
|
|
128
|
+
locale,
|
|
129
|
+
}),
|
|
106
130
|
getStaticPaths: () => [path],
|
|
107
131
|
})
|
|
108
132
|
}
|
|
@@ -114,6 +138,14 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
114
138
|
Object.entries(externalPages).forEach(([rawPath, ExtComponent]) => {
|
|
115
139
|
const path = withBase(rawPath)
|
|
116
140
|
if (!children.find((r) => r.path === path)) {
|
|
141
|
+
allMetadata.push({
|
|
142
|
+
path,
|
|
143
|
+
locale: config.i18n?.defaultLocale,
|
|
144
|
+
title: rawPath,
|
|
145
|
+
filePath: '',
|
|
146
|
+
headings: [],
|
|
147
|
+
} as any)
|
|
148
|
+
|
|
117
149
|
children.push({
|
|
118
150
|
path,
|
|
119
151
|
element: (
|
|
@@ -121,6 +153,10 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
121
153
|
<ExtComponent />
|
|
122
154
|
</EffectiveExternalLayout>
|
|
123
155
|
),
|
|
156
|
+
loader: async () => ({
|
|
157
|
+
path,
|
|
158
|
+
locale: config.i18n?.defaultLocale,
|
|
159
|
+
}),
|
|
124
160
|
getStaticPaths: () => [path],
|
|
125
161
|
})
|
|
126
162
|
|
|
@@ -131,6 +167,14 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
131
167
|
`/${locale}${rawPath === '/' ? '' : rawPath}`,
|
|
132
168
|
)
|
|
133
169
|
if (!children.find((r) => r.path === localePath)) {
|
|
170
|
+
allMetadata.push({
|
|
171
|
+
path: localePath,
|
|
172
|
+
locale,
|
|
173
|
+
title: rawPath,
|
|
174
|
+
filePath: '',
|
|
175
|
+
headings: [],
|
|
176
|
+
} as any)
|
|
177
|
+
|
|
134
178
|
children.push({
|
|
135
179
|
path: localePath,
|
|
136
180
|
element: (
|
|
@@ -138,6 +182,10 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
138
182
|
<ExtComponent />
|
|
139
183
|
</EffectiveExternalLayout>
|
|
140
184
|
),
|
|
185
|
+
loader: async () => ({
|
|
186
|
+
path: localePath,
|
|
187
|
+
locale,
|
|
188
|
+
}),
|
|
141
189
|
getStaticPaths: () => [localePath],
|
|
142
190
|
})
|
|
143
191
|
}
|
|
@@ -157,10 +205,6 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
|
|
|
157
205
|
),
|
|
158
206
|
})
|
|
159
207
|
|
|
160
|
-
// --- 5. Construct Metadata for UI Providers ---
|
|
161
|
-
// We need to pass the full metadata to BoltdocsShell so that Sidebar/Tabs can work.
|
|
162
|
-
const allMetadata: ComponentRoute[] = [...routesData]
|
|
163
|
-
|
|
164
208
|
// Wrap everything in the Boltdocs shell (providers)
|
|
165
209
|
return [
|
|
166
210
|
{
|