boltdocs 2.3.0 → 2.4.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/CHANGELOG.md +20 -0
- package/dist/base-ui/index.d.mts +3 -3
- package/dist/base-ui/index.d.ts +3 -3
- package/dist/base-ui/index.js +1 -1
- package/dist/base-ui/index.mjs +1 -1
- package/dist/chunk-2DI3OGHV.mjs +1 -0
- package/dist/chunk-64AJ5QLT.mjs +1 -0
- package/dist/chunk-DDX52BX4.mjs +1 -0
- package/dist/chunk-HRZDSFR5.mjs +1 -0
- package/dist/chunk-PPVDMDEL.mjs +1 -0
- package/dist/{chunk-HA6543SL.mjs → chunk-UBE4CKOA.mjs} +1 -1
- package/dist/chunk-UWT4AJTH.mjs +73 -0
- package/dist/chunk-WWJ7WKDI.mjs +1 -0
- package/dist/client/index.d.mts +15 -21
- package/dist/client/index.d.ts +15 -21
- package/dist/client/index.js +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client/ssr.js +1 -1
- package/dist/client/ssr.mjs +1 -1
- package/dist/client/types.d.mts +1 -1
- package/dist/client/types.d.ts +1 -1
- package/dist/client/types.js +1 -1
- package/dist/{copy-markdown-CbS8X-qe.d.mts → copy-markdown--9yjpbyy.d.mts} +1 -1
- package/dist/{copy-markdown-C-90ixSe.d.ts → copy-markdown-l2MYkcG7.d.ts} +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/integrations/index.d.mts +1 -1
- package/dist/integrations/index.d.ts +1 -1
- package/dist/{loading-B7X5Wchs.d.ts → loading-BwUos0wZ.d.mts} +2 -11
- package/dist/{loading-WuaQbsKb.d.mts → loading-nlnUD01v.d.ts} +2 -11
- package/dist/mdx/index.d.mts +4 -2
- package/dist/mdx/index.d.ts +4 -2
- package/dist/mdx/index.js +1 -1
- package/dist/mdx/index.mjs +1 -1
- package/dist/node/cli-entry.js +16 -17
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.d.mts +0 -9
- package/dist/node/index.d.ts +0 -9
- package/dist/node/index.js +13 -14
- package/dist/node/index.mjs +1 -1
- package/dist/primitives/index.d.mts +11 -20
- package/dist/primitives/index.d.ts +11 -20
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/index.mjs +1 -1
- package/dist/search-dialog-OONKKC5H.mjs +1 -0
- package/dist/{types-j7jvWsJj.d.ts → types-opDA2E9-.d.mts} +4 -11
- package/dist/{types-j7jvWsJj.d.mts → types-opDA2E9-.d.ts} +4 -11
- package/dist/{use-routes-Cd806kGw.d.ts → use-routes-DNwgTRpU.d.ts} +1 -1
- package/dist/{use-routes-DDL0_jkQ.d.mts → use-routes-DrT80Eom.d.mts} +1 -1
- package/package.json +1 -1
- package/src/client/app/index.tsx +20 -9
- package/src/client/app/mdx-components-context.tsx +2 -2
- package/src/client/app/mdx-page.tsx +0 -1
- package/src/client/app/scroll-handler.tsx +21 -10
- package/src/client/components/default-layout.tsx +0 -2
- package/src/client/components/docs-layout.tsx +34 -4
- package/src/client/components/icons-dev.tsx +154 -0
- package/src/client/components/mdx/code-block.tsx +57 -5
- package/src/client/components/mdx/component-preview.tsx +1 -0
- package/src/client/components/mdx/file-tree.tsx +35 -0
- package/src/client/components/primitives/helpers/observer.ts +30 -39
- package/src/client/components/primitives/index.ts +1 -0
- package/src/client/components/primitives/menu.tsx +18 -12
- package/src/client/components/primitives/navbar.tsx +31 -90
- package/src/client/components/primitives/on-this-page.tsx +7 -161
- package/src/client/components/primitives/popover.tsx +1 -2
- package/src/client/components/ui-base/copy-markdown.tsx +4 -10
- package/src/client/components/ui-base/index.ts +0 -1
- package/src/client/components/ui-base/navbar.tsx +10 -9
- package/src/client/hooks/use-navbar.ts +37 -6
- package/src/client/index.ts +0 -1
- package/src/client/theme/neutral.css +2 -3
- package/src/client/types.ts +2 -2
- package/src/node/config.ts +0 -14
- package/src/node/mdx/cache.ts +1 -1
- package/src/node/mdx/index.ts +2 -0
- package/src/node/mdx/rehype-shiki.ts +9 -0
- package/src/node/mdx/remark-code-meta.ts +35 -0
- package/src/node/mdx/remark-shiki.ts +1 -1
- package/src/node/plugin/entry.ts +21 -14
- package/src/node/plugin/index.ts +22 -4
- package/src/node/routes/parser.ts +3 -0
- package/src/node/ssg/index.ts +76 -16
- package/dist/chunk-22NXDNP4.mjs +0 -74
- package/dist/chunk-2HUVMMJU.mjs +0 -1
- package/dist/chunk-CRZGOE32.mjs +0 -1
- package/dist/chunk-RPUERTVC.mjs +0 -1
- package/dist/chunk-URTD6E6S.mjs +0 -1
- package/dist/chunk-W2NB4T6V.mjs +0 -1
- package/dist/search-dialog-ZRXBAQJ5.mjs +0 -1
- package/src/client/components/ui-base/progress-bar.tsx +0 -67
package/dist/primitives/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lt=Object.create;var _=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var dt=(e,t)=>{for(var o in t)_(e,o,{get:t[o],enumerable:!0})},ve=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mt(t))!ut.call(e,n)&&n!==o&&_(e,n,{get:()=>t[n],enumerable:!(r=ct(t,n))||r.enumerable});return e};var w=(e,t,o)=>(o=e!=null?lt(pt(e)):{},ve(t||!e||!e.__esModule?_(o,"default",{value:e,enumerable:!0}):o,e)),ft=e=>ve(_({},"__esModule",{value:!0}),e);var po={};dt(po,{AnchorProvider:()=>Et,BreadcrumbsItem:()=>oo,BreadcrumbsLink:()=>ro,BreadcrumbsRoot:()=>to,BreadcrumbsSeparator:()=>no,Button:()=>se,ButtonGroup:()=>so,Icon:()=>we,Link:()=>B,Menu:()=>ae,MenuItem:()=>le,MenuSection:()=>ao,MenuSeparator:()=>lo,MenuTrigger:()=>ie,NavLink:()=>Qe,NavbarCenter:()=>Ct,NavbarContent:()=>ht,NavbarItem:()=>At,NavbarLeft:()=>bt,NavbarLink:()=>Pt,NavbarLinks:()=>Rt,NavbarLogo:()=>yt,NavbarMenu:()=>kt,NavbarRight:()=>vt,NavbarRoot:()=>xt,NavbarSearchTrigger:()=>wt,NavbarSocials:()=>Bt,NavbarSplit:()=>It,NavbarTheme:()=>Tt,NavbarTitle:()=>Nt,OnThisPageContent:()=>We,OnThisPageHeader:()=>Dt,OnThisPageIndicator:()=>Ft,OnThisPageItem:()=>Ht,OnThisPageLink:()=>Wt,OnThisPageList:()=>Vt,OnThisPageRoot:()=>zt,PageNavDescription:()=>Ke,PageNavIcon:()=>Xe,PageNavLink:()=>je,PageNavRoot:()=>Ge,PageNavTitle:()=>_e,Popover:()=>te,ScrollProvider:()=>Ot,SearchDialogAutocomplete:()=>Be,SearchDialogInput:()=>Ie,SearchDialogItemBio:()=>Ee,SearchDialogItemIcon:()=>Me,SearchDialogItemRoot:()=>Se,SearchDialogItemTitle:()=>Oe,SearchDialogList:()=>Le,SearchDialogRoot:()=>Ae,Separator:()=>I.Separator,SidebarGroup:()=>Qt,SidebarGroupItem:()=>Yt,SidebarLink:()=>eo,SidebarRoot:()=>qt,SubmenuTrigger:()=>io,TabsContent:()=>Kt,TabsIndicator:()=>Xt,TabsItem:()=>_t,TabsList:()=>jt,TabsRoot:()=>Gt,ToggleButton:()=>I.ToggleButton,Tooltip:()=>mo,buttonVariants:()=>he,cn:()=>s,useActiveAnchor:()=>St,useActiveAnchors:()=>Mt,useItems:()=>de,useScrollStatus:()=>He});module.exports=ft(po);var X=require("react");var Pe=require("react-aria-components"),k=require("lucide-react");var N=require("react/jsx-runtime");function K(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var Ce=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"GitHub"}),(0,N.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"})]}),ye=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Discord"}),(0,N.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"})]}),Ne=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"X"}),(0,N.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"})]});var Re=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Bluesky"}),(0,N.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"})]});var a=require("react/jsx-runtime"),xt=({children:e,className:t,...o})=>(0,a.jsx)("header",{className:s("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),ht=({children:e,className:t})=>(0,a.jsx)("div",{className:s("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),bt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-4",t),children:e}),vt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-2 md:gap-4",t),children:e}),Ct=({children:e,className:t})=>(0,a.jsx)("div",{className:s("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),yt=({src:e,alt:t,width:o=24,height:r=24,className:n})=>(0,a.jsx)(B,{href:"/",className:s("flex items-center gap-2 shrink-0 outline-none",n),children:e?(0,a.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Nt=({children:e,className:t})=>(0,a.jsx)("span",{className:s("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Rt=({children:e,className:t})=>(0,a.jsx)("nav",{className:s("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Pt=({label:e,href:t,active:o,to:r,className:n})=>(0,a.jsxs)(B,{href:t,target:r==="external"?"_blank":void 0,className:s("transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500 font-bold":o,"text-text-muted hover:text-text-main font-medium":!o},n),children:[e,r==="external"&&(0,a.jsx)("span",{className:"ml-1 inline-block",children:(0,a.jsx)(k.ExternalLink,{size:12})})]}),wt=({className:e,onPress:t})=>{let[o,r]=(0,X.useState)(!1),n=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,X.useEffect)(()=>{r(!0)},[]),(0,a.jsxs)(Pe.Button,{onPress:t,className:s("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-[320px] justify-between",e),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(k.Search,{size:16}),(0,a.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,a.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,a.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:n?"\u2318":"Ctrl"}),(0,a.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"})]})]})},Tt=({className:e,theme:t,onThemeChange:o})=>(0,a.jsx)(I.ToggleButton,{isSelected:t==="dark",onChange:o,className:s("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,a.jsx)(k.Sun,{size:20}):(0,a.jsx)(k.Moon,{size:20})}),kt=({label:e,children:t,className:o,icon:r})=>(0,a.jsxs)(ie,{placement:"bottom end",children:[(0,a.jsxs)(se,{variant:"ghost",className:s("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:[r&&(0,a.jsx)("span",{className:"flex items-center shrink-0",children:r}),(0,a.jsx)("span",{className:"text-[13px] font-bold uppercase tracking-wide",children:e}),(0,a.jsx)(k.ChevronDown,{size:14,className:"ml-0.5 opacity-50"})]}),(0,a.jsx)(ae,{className:"min-w-[180px]",children:t})]}),At=({label:e,className:t,onPress:o,isCurrent:r})=>(0,a.jsx)(le,{onAction:o,className:s(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),we=({name:e})=>{if(e==="github")return(0,a.jsx)(Ce,{});if(e==="discord")return(0,a.jsx)(ye,{});if(e==="x")return(0,a.jsx)(Ne,{});if(e==="bluesky")return(0,a.jsx)(Re,{})},Bt=({icon:e,link:t,className:o})=>(0,a.jsx)(B,{href:t,target:"_blank",rel:"noopener noreferrer",className:s("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",o),children:(0,a.jsx)(we,{name:e})}),It=({className:e})=>(0,a.jsx)(I.Separator,{orientation:"vertical",className:s("h-6 w-px bg-border-subtle mx-1",e)});var F=w(require("react-aria-components")),Lt=require("lucide-react");var Te=require("clsx"),ke=require("tailwind-merge");function s(...e){return(0,ke.twMerge)((0,Te.clsx)(e))}var ce=require("react/jsx-runtime");var b=w(require("react-aria-components")),L=require("lucide-react");var u=require("react/jsx-runtime"),Ae=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,u.jsx)(b.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:s("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,u.jsx)(b.Modal,{className:s("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,u.jsx)(b.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Be=({children:e,className:t,onSelectionChange:o,...r})=>(0,u.jsx)("div",{className:t,children:(0,u.jsx)(b.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Ie=({className:e,...t})=>(0,u.jsxs)(b.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,u.jsx)(L.Search,{className:"h-5 w-5 text-text-muted"}),(0,u.jsx)(b.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,u.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,u.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Le=({children:e,className:t,...o})=>(0,u.jsx)(b.ListBox,{...o,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Se=({children:e,className:t,...o})=>(0,u.jsx)(b.ListBoxItem,{...o,className:s("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:r=>(0,u.jsxs)(u.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,u.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,u.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,u.jsx)(L.CornerDownLeft,{size:10})]})]})}),Me=({isHeading:e,className:t})=>(0,u.jsx)("div",{className:s("shrink-0",t),children:e?(0,u.jsx)(L.Hash,{size:18}):(0,u.jsx)(L.FileText,{size:18})}),Oe=({children:e,className:t})=>(0,u.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ee=({children:e,className:t})=>(0,u.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),wo={Root:Ae,Autocomplete:Be,Input:Ie,List:Le,Item:Object.assign(Se,{Icon:Me,Title:Oe,Bio:Ee})};var d=require("react"),De=w(require("scroll-into-view-if-needed"));var U=require("react");function ze(e,t){let o=(0,U.useRef)(e);(0,U.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function me(e){return e.startsWith("#")?e.slice(1):null}var A=require("react/jsx-runtime"),ue=(0,d.createContext)(null),Ve=(0,d.createContext)(null),pe=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let n=t.find(m=>m.target.id===r.id),i=n?n.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(i=!1),r.active!==i&&(r={...r,t:Date.now(),active:i,fallback:!1}),i&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,n=Number.MAX_VALUE,i=-1;for(let m=0;m<this.items.length;m++){let l=document.getElementById(this.items[m].id);if(!l)continue;let c=Math.abs(r-l.getBoundingClientRect().top);c<n&&(i=m,n=c)}i!==-1&&(this.items[i]={...this.items[i],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let n=document.getElementById(r.id);n&&o.unobserve(n)}this.items=[];for(let r of t){let n=me(r.url);n&&this.items.push({id:n,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};function de(){let e=(0,d.use)(ue);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function He(e){let[t,o]=(0,d.useState)({isOverflowing:!1,isAtBottom:!1});return(0,d.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let m=r.scrollHeight>r.clientHeight,l=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:m,isAtBottom:l})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let i=new MutationObserver(n);return i.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),i.disconnect()}},[e]),t}function St(){let e=de();return(0,d.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Mt(){let e=de();return(0,d.useMemo)(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function Ot({containerRef:e,children:t}){return(0,A.jsx)(Ve.Provider,{value:e,children:t})}function Et({toc:e,single:t=!1,children:o}){let r=(0,d.useMemo)(()=>new pe,[]),[n,i]=(0,d.useState)(r.items);return r.single=t,(0,d.useEffect)(()=>{r.setItems(e)},[r,e]),(0,d.useEffect)(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),(0,A.jsx)(ue.Provider,{value:n,children:o})}var zt=({children:e,className:t})=>(0,A.jsx)("nav",{className:s("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),Dt=({children:e,className:t,...o})=>(0,A.jsx)("div",{className:s("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),We=({children:e,className:t,ref:o,...r})=>{let n=(0,d.useRef)(null);(0,d.useImperativeHandle)(o,()=>n.current);let{isOverflowing:i,isAtBottom:m}=He(n);return(0,A.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",i&&!m&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};We.displayName="OnThisPageContent";var Vt=({children:e,className:t})=>(0,A.jsx)("ul",{className:s("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Ht=({level:e,children:t,className:o})=>(0,A.jsx)("li",{className:s(e===3&&"pl-3",o),children:t}),Wt=({children:e,href:t,active:o,onClick:r,className:n})=>{let i=(0,d.use)(ue),m=(0,d.use)(Ve),l=t?me(t):null,c=(0,d.useRef)(null),[C,y]=(0,d.useState)(o);return ze(l&&i?i.find(g=>g.id===l)?.active:null,g=>{g!==null&&g!==C&&(y(!!g),g&&c.current&&m?.current&&(0,De.default)(c.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:m.current}))}),(0,d.useEffect)(()=>{o!==void 0&&y(o)},[o]),(0,A.jsx)("a",{ref:c,href:t,onClick:r,"data-active":C,className:s("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",C?"text-primary-500 font-medium":"text-text-muted",n),children:e})},Ft=({style:e,className:t})=>(0,A.jsx)("div",{className:s("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e});var Fe=w(require("react-aria-components")),Z=require("lucide-react");var R=require("react/jsx-runtime"),Ge=({children:e,className:t})=>(0,R.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),je=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,R.jsxs)(Fe.Link,{href:t,className:s("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",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&(0,R.jsx)(Z.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,R.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,R.jsx)(Z.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},_e=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Ke=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),Xe=({children:e})=>(0,R.jsx)(R.Fragment,{children:e}),Ho={PageNavRoot:Ge,PageNavLink:Object.assign(je,{Title:_e,Description:Ke,Icon:Xe})};var M=require("react/jsx-runtime"),Gt=({children:e,className:t="",...o})=>(0,M.jsx)("div",{className:s("w-full",t),...o,children:e}),jt=({children:e,className:t=""})=>(0,M.jsx)("div",{role:"tablist",className:s("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),_t=({children:e,id:t,selected:o,className:r="",...n})=>(0,M.jsx)("button",{role:"tab","aria-selected":o,className:s("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...n,children:e}),Kt=({children:e,className:t=""})=>(0,M.jsx)("div",{className:s("p-4 outline-none",t),children:e}),Xt=({className:e="",style:t})=>(0,M.jsx)("div",{className:s("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t});var ge=w(require("react")),Je=require("react-aria-components"),qe=require("react-router-dom");var $=require("react"),Ut=(0,$.createContext)(null);function J(){let e=(0,$.use)(Ut);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var Ze=require("react-router-dom");var O=require("react"),$t=require("react/jsx-runtime"),Zt=(0,O.createContext)({preload:()=>{},routes:[]});function q(){return(0,O.use)(Zt)}var Ue=require("zustand"),Q=require("zustand/middleware"),Y=(0,Ue.create)()((0,Q.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Q.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function $e(){let{routes:e}=q(),t=J(),o=(0,Ze.useLocation)(),r=Y(p=>p.currentLocale),n=Y(p=>p.currentVersion),i=Y(p=>p.hasHydrated),m=e.find(p=>p.path===o.pathname),l=t.i18n?m?.locale||(i?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?m?.version||(i?n:void 0)||t.versions.defaultVersion:void 0,C=e.filter(p=>{let oe=t.i18n?(p.locale||t.i18n.defaultLocale)===l:!0,re=t.versions?(p.version||t.versions.defaultVersion)===c:!0;if(!(oe&&re))return!1;let ne=t.i18n;if(ne){let it=!!m?.locale,at=!!p.locale;if(e.some(j=>j!==p&&j.filePath===p.filePath&&j.version===p.version&&(j.locale||ne.defaultLocale)===(p.locale||ne.defaultLocale))&&it!==at)return!1}return!0}),g=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,S=t.versions?.versions.find(p=>p.path===c)?.label||c,nt=t.i18n?Object.entries(t.i18n.locales).map(([p,oe])=>{let re=t.i18n?.localeConfigs?.[p];return{key:p,label:re?.label||oe,isCurrent:p===l}}):[],st=t.versions?t.versions.versions.map(p=>({key:p.path,label:p.label,isCurrent:p.path===c})):[];return{routes:C,allRoutes:e,currentRoute:m,currentLocale:l,currentLocaleLabel:g,availableLocales:nt,currentVersion:c,currentVersionLabel:S,availableVersions:st,config:t}}function fe(e){let t=J(),{currentLocale:o,currentVersion:r}=$e();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,i=t.versions;if(!n&&!i)return e;let m=e.startsWith("/docs"),l=e.split("/").filter(Boolean),c=0;l[c]==="docs"&&c++,i&&l.length>c&&i.versions.find(S=>S.path===l[c])&&c++,n&&l.length>c&&n.locales[l[c]]&&c++;let C=l.slice(c),y=[];m&&(y.push("docs"),i&&r&&y.push(r)),n&&o&&o!==n.defaultLocale&&y.push(o),y.push(...C);let g=`/${y.join("/")}`;return g.length>1&&g.endsWith("/")?g.slice(0,-1):g||"/"}var xe=require("react/jsx-runtime"),B=ge.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:i,...m}=e,l=fe(o??""),{preload:c}=q();return(0,xe.jsx)(Je.Link,{...m,ref:t,href:l,onMouseEnter:g=>{n?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)},onFocus:g=>{i?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)}})});B.displayName="Link";var Qe=ge.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:i,...m}=e,l=(0,qe.useLocation)(),c=fe(o??""),C=r?l.pathname===c:l.pathname.startsWith(c),y=typeof n=="function"?n({isActive:C}):s(n,C&&"active"),g=typeof i=="function"?i({isActive:C}):i;return(0,xe.jsx)(B,{...m,ref:t,href:o,className:y,children:g})});Qe.displayName="NavLink";var Ye=w(require("react-aria-components")),et=require("lucide-react");var v=require("react/jsx-runtime"),Jt=({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 r=new Date(e.expires),n=new Date,i=r.getTime()-n.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,v.jsx)("span",{className:s("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[o]||t.new),children:o})},qt=({children:e,className:t})=>(0,v.jsx)("aside",{className:s("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:(0,v.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),Qt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:n,className:i})=>(0,v.jsxs)("div",{className:s("space-y-1",i),children:[t&&(0,v.jsxs)(Ye.Button,{onPress:n,className:s("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,v.jsx)(o,{size:14}),t]}),(0,v.jsx)(et.ChevronRight,{size:14,className:s("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,v.jsx)("div",{className:"space-y-0.5",children:e})]}),Yt=({children:e,className:t})=>(0,v.jsx)("div",{className:s(t),children:e}),eo=({label:e,href:t,active:o,icon:r,badge:n,className:i})=>(0,v.jsxs)(B,{href:t,className:s("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",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1",i),children:[r&&(0,v.jsx)(r,{size:16,className:s(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,v.jsx)("span",{className:"truncate",children:e}),n&&(0,v.jsx)(Jt,{badge:n})]});var E=require("react-aria-components"),tt=require("lucide-react");var G=require("react/jsx-runtime"),to=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumbs,{className:s("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),oo=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumb,{className:s("flex items-center mb-0 gap-1.5",t),...o,children:e}),ro=({children:e,href:t,className:o,...r})=>(0,G.jsx)(E.Link,{href:t,className:s("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",o),...r,children:e}),no=({className:e})=>(0,G.jsx)(tt.ChevronRight,{size:14,className:s("shrink-0 text-text-dim",e)});var ee=w(require("react-aria-components"));var ot=require("class-variance-authority"),T=require("react/jsx-runtime"),he=(0,ot.cva)("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"}}),se=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:i,variant:m,size:l,rounded:c,iconSize:C,disabled:y,...g})=>{let W=r||!n&&!!t,S=W?(0,T.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,T.jsxs)(T.Fragment,{children:[t&&o==="left"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,T.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,T.jsx)(ee.Link,{href:e,className:s(he({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S}):(0,T.jsx)(ee.Button,{className:s(he({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S})};var rt=require("react/jsx-runtime"),so=({children:e,className:t,vertical:o=!1})=>(0,rt.jsx)("div",{className:s("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*: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"]],o&&["[&>*: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});var V=require("lucide-react"),be=w(require("react")),h=w(require("react-aria-components"));var D=w(require("react-aria-components"));var z=require("react/jsx-runtime"),te=({children:e,className:t,showArrow:o,...r})=>(0,z.jsxs)(D.Popover,{offset:8,...r,className:D.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&(0,z.jsx)(D.OverlayArrow,{className:"group",children:(0,z.jsx)("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:(0,z.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var x=require("react/jsx-runtime");function ie(e){let[t,o]=be.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(h.MenuTrigger,{...e,children:[t,(0,x.jsx)(te,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function io(e){let[t,o]=be.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(h.SubmenuTrigger,{...e,children:[t,(0,x.jsx)(te,{offset:-4,crossOffset:-4,children:o})]})}function ae(e){return(0,x.jsx)(h.Menu,{...e,className:h.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function le(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,x.jsx)(h.MenuItem,{...e,textValue:t,className:h.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:i})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",i&&"opacity-40 grayscale pointer-events-none",o)),children:h.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:i})=>(0,x.jsxs)(x.Fragment,{children:[r!=="none"&&(0,x.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,x.jsx)(V.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&r==="single"&&(0,x.jsx)(V.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,x.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),i&&(0,x.jsx)(V.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function ao({title:e,...t}){return(0,x.jsxs)(h.MenuSection,{...t,className:s("flex flex-col gap-0.5",t.className),children:[e&&(0,x.jsx)(h.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,x.jsx)(h.Collection,{items:t.items,children:t.children})]})}function lo(e){return(0,x.jsx)(h.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var H=w(require("react-aria-components"));var P=require("react/jsx-runtime"),co=({className:e,children:t,...o})=>(0,P.jsx)(H.Tooltip,{...o,offset:8,className:r=>s("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(r):e),children:r=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(H.OverlayArrow,{children:(0,P.jsxs)("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:[(0,P.jsx)("title",{children:"Arrow"}),(0,P.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),mo=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>(0,P.jsxs)(H.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,P.jsx)(co,{...n,children:e})]});var I=require("react-aria-components");
|
|
1
|
+
"use strict";var nt=Object.create;var J=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var ct=(e,t)=>{for(var o in t)J(e,o,{get:t[o],enumerable:!0})},ge=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of at(t))!lt.call(e,s)&&s!==o&&J(e,s,{get:()=>t[s],enumerable:!(r=st(t,s))||r.enumerable});return e};var N=(e,t,o)=>(o=e!=null?nt(it(e)):{},ge(t||!e||!e.__esModule?J(o,"default",{value:e,enumerable:!0}):o,e)),pt=e=>ge(J({},"__esModule",{value:!0}),e);var po={};ct(po,{AnchorProvider:()=>Bt,BreadcrumbsItem:()=>$t,BreadcrumbsLink:()=>qt,BreadcrumbsRoot:()=>Zt,BreadcrumbsSeparator:()=>Qt,Button:()=>Ut,ButtonGroup:()=>eo,Icon:()=>ye,Link:()=>T,Menu:()=>ro,MenuItem:()=>no,MenuSection:()=>so,MenuSeparator:()=>ao,MenuTrigger:()=>to,NavLink:()=>_e,NavbarCenter:()=>xt,NavbarContent:()=>ut,NavbarLeft:()=>ft,NavbarLink:()=>Ct,NavbarLinks:()=>bt,NavbarLogo:()=>ht,NavbarRight:()=>gt,NavbarRoot:()=>dt,NavbarSearchTrigger:()=>yt,NavbarSocials:()=>Pt,NavbarSplit:()=>wt,NavbarTheme:()=>Rt,NavbarTitle:()=>vt,OnThisPageContent:()=>ze,OnThisPageHeader:()=>St,OnThisPageIndicator:()=>zt,OnThisPageItem:()=>Mt,OnThisPageLink:()=>Ot,OnThisPageList:()=>It,OnThisPageRoot:()=>Lt,PageNavDescription:()=>We,PageNavIcon:()=>Fe,PageNavLink:()=>He,PageNavRoot:()=>Ee,PageNavTitle:()=>De,Popover:()=>oe,ScrollProvider:()=>kt,SearchDialogAutocomplete:()=>Ne,SearchDialogInput:()=>Ae,SearchDialogItemBio:()=>Se,SearchDialogItemIcon:()=>Be,SearchDialogItemRoot:()=>ke,SearchDialogItemTitle:()=>Le,SearchDialogList:()=>Te,SearchDialogRoot:()=>we,Separator:()=>L.Separator,SidebarGroup:()=>Xt,SidebarGroupItem:()=>_t,SidebarLink:()=>Yt,SidebarRoot:()=>Kt,Skeleton:()=>co,SubmenuTrigger:()=>oo,TabsContent:()=>Dt,TabsIndicator:()=>Wt,TabsItem:()=>Ht,TabsList:()=>Et,TabsRoot:()=>Vt,ToggleButton:()=>L.ToggleButton,Tooltip:()=>lo,buttonVariants:()=>ue,cn:()=>n,useActiveAnchor:()=>At,useActiveAnchors:()=>Tt,useItems:()=>ce});module.exports=pt(po);var X=require("react");var Ce=require("react-aria-components"),B=require("lucide-react");var R=require("react/jsx-runtime");function K(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var xe=e=>(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,R.jsx)("title",{children:"GitHub"}),(0,R.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"})]}),he=e=>(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,R.jsx)("title",{children:"Discord"}),(0,R.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"})]}),ve=e=>(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,R.jsx)("title",{children:"X"}),(0,R.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"})]});var be=e=>(0,R.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,R.jsx)("title",{children:"Bluesky"}),(0,R.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"})]});var i=require("react/jsx-runtime"),dt=({children:e,className:t,...o})=>(0,i.jsx)("header",{className:n("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),ut=({children:e,className:t})=>(0,i.jsx)("div",{className:n("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),ft=({children:e,className:t})=>(0,i.jsx)("div",{className:n("flex flex-1 items-center justify-start gap-4 min-w-0",t),children:e}),gt=({children:e,className:t})=>(0,i.jsx)("div",{className:n("flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0",t),children:e}),xt=({children:e,className:t})=>(0,i.jsx)("div",{className:n("hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full",t),children:e}),ht=({src:e,alt:t,width:o=24,height:r=24,className:s})=>(0,i.jsx)(T,{href:"/",className:n("flex items-center gap-2 shrink-0 outline-none",s),children:e?(0,i.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),vt=({children:e,className:t})=>(0,i.jsx)(T,{href:"/",children:(0,i.jsx)("span",{className:n("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e})}),bt=({children:e,className:t})=>(0,i.jsx)("nav",{className:n("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Ct=({label:e,href:t,active:o,to:r,className:s})=>(0,i.jsxs)(T,{href:t,target:r==="external"?"_blank":void 0,className:n("transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500":o,"text-text-muted hover:text-text-main":!o},s),children:[e,r==="external"&&(0,i.jsx)("span",{className:"ml-1 inline-block",children:(0,i.jsx)(B.ExternalLink,{size:12})})]}),yt=({className:e,onPress:t})=>{let[o,r]=(0,X.useState)(!1),s=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,X.useEffect)(()=>{r(!0)},[]),(0,i.jsxs)(Ce.Button,{onPress:t,className:n("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,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(B.Search,{size:16}),(0,i.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,i.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,i.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:s?"\u2318":"Ctrl"}),(0,i.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"})]})]})},Rt=({className:e,theme:t,onThemeChange:o})=>(0,i.jsx)(L.ToggleButton,{isSelected:t==="dark",onChange:o,className:n("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,i.jsx)(B.Sun,{size:20}):(0,i.jsx)(B.Moon,{size:20})}),ye=({name:e})=>{if(e==="github")return(0,i.jsx)(xe,{});if(e==="discord")return(0,i.jsx)(he,{});if(e==="x")return(0,i.jsx)(ve,{});if(e==="bluesky")return(0,i.jsx)(be,{})},Pt=({icon:e,link:t,className:o})=>(0,i.jsx)(T,{href:t,target:"_blank",rel:"noopener noreferrer",className:n("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",o),children:(0,i.jsx)(ye,{name:e})}),wt=({className:e})=>(0,i.jsx)(L.Separator,{orientation:"vertical",className:n("h-6 w-px bg-border-subtle mx-1",e)});var F=N(require("react-aria-components")),Nt=require("lucide-react");var Re=require("clsx"),Pe=require("tailwind-merge");function n(...e){return(0,Pe.twMerge)((0,Re.clsx)(e))}var ae=require("react/jsx-runtime");var v=N(require("react-aria-components")),S=require("lucide-react");var m=require("react/jsx-runtime"),we=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,m.jsx)(v.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:n("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,m.jsx)(v.Modal,{className:n("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,m.jsx)(v.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Ne=({children:e,className:t,onSelectionChange:o,...r})=>(0,m.jsx)("div",{className:t,children:(0,m.jsx)(v.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Ae=({className:e,...t})=>(0,m.jsxs)(v.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,m.jsx)(S.Search,{className:"h-5 w-5 text-text-muted"}),(0,m.jsx)(v.Input,{...t,className:n("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,m.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,m.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Te=({children:e,className:t,...o})=>(0,m.jsx)(v.ListBox,{...o,className:n("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),ke=({children:e,className:t,...o})=>(0,m.jsx)(v.ListBoxItem,{...o,className:n("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:r=>(0,m.jsxs)(m.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,m.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,m.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,m.jsx)(S.CornerDownLeft,{size:10})]})]})}),Be=({isHeading:e,className:t})=>(0,m.jsx)("div",{className:n("shrink-0",t),children:e?(0,m.jsx)(S.Hash,{size:18}):(0,m.jsx)(S.FileText,{size:18})}),Le=({children:e,className:t})=>(0,m.jsx)("span",{className:n("block font-medium truncate flex-1 text-sm",t),children:e}),Se=({children:e,className:t})=>(0,m.jsx)("span",{className:n("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),wo={Root:we,Autocomplete:Ne,Input:Ae,List:Te,Item:Object.assign(ke,{Icon:Be,Title:Le,Bio:Se})};var u=require("react"),Me=N(require("scroll-into-view-if-needed"));var _=require("react");function Ie(e,t){let o=(0,_.useRef)(e);(0,_.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function ie(e){return e.startsWith("#")?e.slice(1):null}var Y=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;for(let r of t){let s=this.items.find(a=>a.id===r.target.id);if(s){s.active=r.isIntersecting;let a=100;s.fallback=!r.isIntersecting&&r.boundingClientRect.top<a}}let o=-1;for(let r=this.items.length-1;r>=0;r--)if(this.items[r].fallback){o=r;break}o===-1&&this.items.length>0&&(o=0),this.items=this.items.map((r,s)=>({...r,active:s===o,t:s===o?Date.now():r.t})),this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let s=document.getElementById(r.id);s&&o.unobserve(s)}this.items=[];for(let r of t){let s=ie(r.url);s&&this.items.push({id:s,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};var k=require("react/jsx-runtime"),le=(0,u.createContext)(null),Oe=(0,u.createContext)(null);function ce(){let e=(0,u.use)(le);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function At(){let e=ce();return(0,u.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Tt(){let e=ce();return(0,u.useMemo)(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function kt({containerRef:e,children:t}){return(0,k.jsx)(Oe.Provider,{value:e,children:t})}function Bt({toc:e,single:t=!1,children:o}){let r=(0,u.useMemo)(()=>new Y,[]),[s,a]=(0,u.useState)(r.items);return r.single=t,(0,u.useEffect)(()=>{r.setItems(e)},[r,e]),(0,u.useEffect)(()=>(r.watch({rootMargin:"-100px 0% 0% 0%",threshold:0}),r.onChange=()=>a([...r.items]),()=>{r.unwatch()}),[r]),(0,k.jsx)(le.Provider,{value:s,children:o})}var Lt=({children:e,className:t})=>(0,k.jsx)("nav",{className:n("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),St=({children:e,className:t,...o})=>(0,k.jsx)("div",{className:n("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),ze=({children:e,className:t,ref:o,...r})=>{let s=(0,u.useRef)(null);return(0,u.useImperativeHandle)(o,()=>s.current),(0,k.jsx)("div",{ref:s,className:n("relative overflow-y-auto boltdocs-otp-content",t),...r,children:e})};ze.displayName="OnThisPageContent";var It=({children:e,className:t})=>(0,k.jsx)("ul",{className:n("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Mt=({level:e,children:t,className:o})=>(0,k.jsx)("li",{className:n(e===3&&"pl-3",o),children:t}),Ot=({children:e,href:t,active:o,onClick:r,className:s})=>{let a=(0,u.use)(le),h=(0,u.use)(Oe),l=t?ie(t):null,c=(0,u.useRef)(null),[C,y]=(0,u.useState)(o);return Ie(l&&a?a.find(f=>f.id===l)?.active:null,f=>{f!==null&&f!==C&&(y(!!f),f&&c.current&&h?.current&&(0,Me.default)(c.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:h.current}))}),(0,u.useEffect)(()=>{o!==void 0&&y(o)},[o]),(0,k.jsx)("a",{ref:c,href:t,onClick:r,"data-active":C,className:n("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",C?"text-primary-500 font-medium":"text-text-muted",s),children:e})},zt=({style:e,className:t})=>(0,k.jsx)("div",{className:n("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e});var Ve=N(require("react-aria-components")),Z=require("lucide-react");var P=require("react/jsx-runtime"),Ee=({children:e,className:t})=>(0,P.jsx)("nav",{className:n("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),He=({children:e,to:t,direction:o,className:r})=>{let s=o==="next";return(0,P.jsxs)(Ve.Link,{href:t,className:n("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",s?"text-right justify-end":"text-left justify-start",r),children:[!s&&(0,P.jsx)(Z.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,P.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),s&&(0,P.jsx)(Z.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},De=({children:e,className:t})=>(0,P.jsx)("span",{className:n("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),We=({children:e,className:t})=>(0,P.jsx)("span",{className:n("text-base font-bold text-text-main truncate",t),children:e}),Fe=({children:e})=>(0,P.jsx)(P.Fragment,{children:e}),Ho={PageNavRoot:Ee,PageNavLink:Object.assign(He,{Title:De,Description:We,Icon:Fe})};var M=require("react/jsx-runtime"),Vt=({children:e,className:t="",...o})=>(0,M.jsx)("div",{className:n("w-full",t),...o,children:e}),Et=({children:e,className:t=""})=>(0,M.jsx)("div",{role:"tablist",className:n("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),Ht=({children:e,id:t,selected:o,className:r="",...s})=>(0,M.jsx)("button",{role:"tab","aria-selected":o,className:n("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...s,children:e}),Dt=({children:e,className:t=""})=>(0,M.jsx)("div",{className:n("p-4 outline-none",t),children:e}),Wt=({className:e="",style:t})=>(0,M.jsx)("div",{className:n("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t});var me=N(require("react")),Ke=require("react-aria-components"),Xe=require("react-router-dom");var $=require("react"),Ft=(0,$.createContext)(null);function q(){let e=(0,$.use)(Ft);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var je=require("react-router-dom");var O=require("react"),jt=require("react/jsx-runtime"),Gt=(0,O.createContext)({preload:()=>{},routes:[]});function Q(){return(0,O.use)(Gt)}var Ge=require("zustand"),U=require("zustand/middleware"),ee=(0,Ge.create)()((0,U.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,U.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Je(){let{routes:e}=Q(),t=q(),o=(0,je.useLocation)(),r=ee(p=>p.currentLocale),s=ee(p=>p.currentVersion),a=ee(p=>p.hasHydrated),h=e.find(p=>p.path===o.pathname),l=t.i18n?h?.locale||(a?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?h?.version||(a?s:void 0)||t.versions.defaultVersion:void 0,C=e.filter(p=>{let re=t.i18n?(p.locale||t.i18n.defaultLocale)===l:!0,ne=t.versions?(p.version||t.versions.defaultVersion)===c:!0;if(!(re&&ne))return!1;let se=t.i18n;if(se){let ot=!!h?.locale,rt=!!p.locale;if(e.some(j=>j!==p&&j.filePath===p.filePath&&j.version===p.version&&(j.locale||se.defaultLocale)===(p.locale||se.defaultLocale))&&ot!==rt)return!1}return!0}),f=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,I=t.versions?.versions.find(p=>p.path===c)?.label||c,et=t.i18n?Object.entries(t.i18n.locales).map(([p,re])=>{let ne=t.i18n?.localeConfigs?.[p];return{key:p,label:ne?.label||re,isCurrent:p===l}}):[],tt=t.versions?t.versions.versions.map(p=>({key:p.path,label:p.label,isCurrent:p.path===c})):[];return{routes:C,allRoutes:e,currentRoute:h,currentLocale:l,currentLocaleLabel:f,availableLocales:et,currentVersion:c,currentVersionLabel:I,availableVersions:tt,config:t}}function pe(e){let t=q(),{currentLocale:o,currentVersion:r}=Je();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let s=t.i18n,a=t.versions;if(!s&&!a)return e;let h=e.startsWith("/docs"),l=e.split("/").filter(Boolean),c=0;l[c]==="docs"&&c++,a&&l.length>c&&a.versions.find(I=>I.path===l[c])&&c++,s&&l.length>c&&s.locales[l[c]]&&c++;let C=l.slice(c),y=[];h&&(y.push("docs"),a&&r&&y.push(r)),s&&o&&o!==s.defaultLocale&&y.push(o),y.push(...C);let f=`/${y.join("/")}`;return f.length>1&&f.endsWith("/")?f.slice(0,-1):f||"/"}var de=require("react/jsx-runtime"),T=me.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:s,onFocus:a,...h}=e,l=pe(o??""),{preload:c}=Q();return(0,de.jsx)(Ke.Link,{...h,ref:t,href:l,onMouseEnter:f=>{s?.(f),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)},onFocus:f=>{a?.(f),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)}})});T.displayName="Link";var _e=me.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:s,children:a,...h}=e,l=(0,Xe.useLocation)(),c=pe(o??""),C=r?l.pathname===c:l.pathname.startsWith(c),y=typeof s=="function"?s({isActive:C}):n(s,C&&"active"),f=typeof a=="function"?a({isActive:C}):a;return(0,de.jsx)(T,{...h,ref:t,href:o,className:y,children:f})});_e.displayName="NavLink";var Ye=N(require("react-aria-components")),Ze=require("lucide-react");var b=require("react/jsx-runtime"),Jt=({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 r=new Date(e.expires),s=new Date,a=r.getTime()-s.getTime();if(Math.ceil(a/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,b.jsx)("span",{className:n("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[o]||t.new),children:o})},Kt=({children:e,className:t})=>(0,b.jsx)("aside",{className:n("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:(0,b.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),Xt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:s,className:a})=>(0,b.jsxs)("div",{className:n("space-y-1",a),children:[t&&(0,b.jsxs)(Ye.Button,{onPress:s,className:n("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,b.jsx)(o,{size:14}),t]}),(0,b.jsx)(Ze.ChevronRight,{size:14,className:n("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,b.jsx)("div",{className:"space-y-0.5",children:e})]}),_t=({children:e,className:t})=>(0,b.jsx)("div",{className:n(t),children:e}),Yt=({label:e,href:t,active:o,icon:r,badge:s,className:a})=>(0,b.jsxs)(T,{href:t,className:n("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",o?"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&&(0,b.jsx)(r,{size:16,className:n(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,b.jsx)("span",{className:"truncate",children:e}),s&&(0,b.jsx)(Jt,{badge:s})]});var z=require("react-aria-components"),$e=require("lucide-react");var G=require("react/jsx-runtime"),Zt=({children:e,className:t,...o})=>(0,G.jsx)(z.Breadcrumbs,{className:n("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),$t=({children:e,className:t,...o})=>(0,G.jsx)(z.Breadcrumb,{className:n("flex items-center mb-0 gap-1.5",t),...o,children:e}),qt=({children:e,href:t,className:o,...r})=>(0,G.jsx)(z.Link,{href:t,className:n("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",o),...r,children:e}),Qt=({className:e})=>(0,G.jsx)($e.ChevronRight,{size:14,className:n("shrink-0 text-text-dim",e)});var te=N(require("react-aria-components"));var qe=require("class-variance-authority"),A=require("react/jsx-runtime"),ue=(0,qe.cva)("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"}}),Ut=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:s,className:a,variant:h,size:l,rounded:c,iconSize:C,disabled:y,...f})=>{let W=r||!s&&!!t,I=W?(0,A.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,A.jsxs)(A.Fragment,{children:[t&&o==="left"&&(0,A.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,A.jsx)("span",{className:"flex items-center",children:s}),t&&o==="right"&&(0,A.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,A.jsx)(te.Link,{href:e,className:n(ue({variant:h,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),a),...f,children:I}):(0,A.jsx)(te.Button,{className:n(ue({variant:h,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),a),...f,children:I})};var Qe=require("react/jsx-runtime"),eo=({children:e,className:t,vertical:o=!1})=>(0,Qe.jsx)("div",{className:n("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*: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"]],o&&["[&>*: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});var H=require("lucide-react"),fe=N(require("react")),x=N(require("react-aria-components"));var E=N(require("react-aria-components"));var V=require("react/jsx-runtime"),oe=({children:e,className:t,showArrow:o,...r})=>(0,V.jsxs)(E.Popover,{offset:8,...r,className:E.composeRenderProps(t,s=>n("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none",s)),children:[o&&(0,V.jsx)(E.OverlayArrow,{className:"group",children:(0,V.jsx)("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:(0,V.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var g=require("react/jsx-runtime");function to(e){let[t,o]=fe.default.Children.toArray(e.children).slice(0,2);return(0,g.jsxs)(x.MenuTrigger,{...e,children:[t,(0,g.jsx)(oe,{placement:e.placement,className:"min-w-35",children:o})]})}function oo(e){let[t,o]=fe.default.Children.toArray(e.children).slice(0,2);return(0,g.jsxs)(x.SubmenuTrigger,{...e,children:[t,(0,g.jsx)(oe,{offset:-4,crossOffset:-4,children:o})]})}function ro(e){return(0,g.jsx)(x.Menu,{...e,className:x.composeRenderProps(e.className,t=>n("p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75",t))})}function no(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,g.jsx)(x.MenuItem,{...e,textValue:t,className:x.composeRenderProps(e.className,(o,{isFocused:r,isPressed:s,isDisabled:a})=>n("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":r,"bg-bg-surface-elevanted":s,"opacity-40 grayscale pointer-events-none":a},o)),children:x.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:s,hasSubmenu:a})=>(0,g.jsxs)(g.Fragment,{children:[r!=="none"&&(0,g.jsxs)("span",{className:"flex items-center size-4 shrink-0 justify-center",children:[s&&r==="multiple"&&(0,g.jsx)(H.Check,{className:"size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),s&&r==="single"&&(0,g.jsx)(H.Dot,{className:"size-5 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,g.jsx)("div",{className:"flex flex-row w-full transition-colors items-center gap-2 py-1 px-1",children:o}),a&&(0,g.jsx)(H.ChevronRight,{className:"size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function so({title:e,...t}){return(0,g.jsxs)(x.MenuSection,{...t,className:n("flex flex-col gap-0.5",t.className),children:[e&&(0,g.jsx)(x.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,g.jsx)(x.Collection,{items:t.items,children:t.children})]})}function ao(e){return(0,g.jsx)(x.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var D=N(require("react-aria-components"));var w=require("react/jsx-runtime"),io=({className:e,children:t,...o})=>(0,w.jsx)(D.Tooltip,{...o,offset:8,className:r=>n("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(r):e),children:r=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(D.OverlayArrow,{children:(0,w.jsxs)("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:[(0,w.jsx)("title",{children:"Arrow"}),(0,w.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),lo=({content:e,children:t,delay:o=500,closeDelay:r=0,...s})=>(0,w.jsxs)(D.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,w.jsx)(io,{...s,children:e})]});var Ue=require("react/jsx-runtime");function co({className:e,variant:t="rect",...o}){return(0,Ue.jsx)("div",{className:n("animate-pulse bg-bg-muted",t==="circle"?"rounded-full":"rounded-md",e),...o})}var L=require("react-aria-components");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as
|
|
1
|
+
import{$ as O,A as p,Aa as ka,B as q,Ba as la,C as r,D as s,Da as ma,E as t,Ea as na,Fa as oa,G as u,H as v,I as w,J as x,K as y,L as z,M as A,N as B,O as C,P as D,Q as E,R as F,S as G,T as H,U as I,V as J,W as K,X as L,Y as M,Z as N,a,aa as P,b,ba as Q,c,ca as R,d,da as S,e,fa as T,ga as U,ha as V,ia as W,ja as X,la as Y,ma as Z,na as _,oa as $,q as f,qa as aa,r as g,ra as ba,s as h,sa as ca,t as i,ta as da,u as j,ua as ea,v as k,va as fa,w as l,wa as ga,x as m,xa as ha,y as n,ya as ia,z as o,za as ja}from"../chunk-WWJ7WKDI.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{G as AnchorProvider,ba as BreadcrumbsItem,ca as BreadcrumbsLink,aa as BreadcrumbsRoot,da as BreadcrumbsSeparator,e as Button,ea as ButtonGroup,r as Icon,b as Link,ia as Menu,ja as MenuItem,ka as MenuSection,la as MenuSeparator,ga as MenuTrigger,c as NavLink,k as NavbarCenter,h as NavbarContent,i as NavbarLeft,o as NavbarLink,n as NavbarLinks,l as NavbarLogo,j as NavbarRight,g as NavbarRoot,p as NavbarSearchTrigger,s as NavbarSocials,t as NavbarSplit,q as NavbarTheme,m as NavbarTitle,J as OnThisPageContent,I as OnThisPageHeader,N as OnThisPageIndicator,L as OnThisPageItem,M as OnThisPageLink,K as OnThisPageList,H as OnThisPageRoot,R as PageNavDescription,S as PageNavIcon,P as PageNavLink,O as PageNavRoot,Q as PageNavTitle,fa as Popover,F as ScrollProvider,v as SearchDialogAutocomplete,w as SearchDialogInput,B as SearchDialogItemBio,z as SearchDialogItemIcon,y as SearchDialogItemRoot,A as SearchDialogItemTitle,x as SearchDialogList,u as SearchDialogRoot,na as Separator,Z as SidebarGroup,_ as SidebarGroupItem,$ as SidebarLink,Y as SidebarRoot,ma as Skeleton,ha as SubmenuTrigger,W as TabsContent,X as TabsIndicator,V as TabsItem,U as TabsList,T as TabsRoot,oa as ToggleButton,f as Tooltip,d as buttonVariants,a as cn,D as useActiveAnchor,E as useActiveAnchors,C as useItems};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-UBE4CKOA.mjs";import"./chunk-2Z5T6EAU.mjs";import"./chunk-WWJ7WKDI.mjs";import"./chunk-NBCYHLAA.mjs";import"./chunk-JZXLCA2E.mjs";export{a as SearchDialog};
|
|
@@ -40,13 +40,6 @@ interface BoltdocsThemeConfig {
|
|
|
40
40
|
label: string | Record<string, string>;
|
|
41
41
|
/** URL path or external link */
|
|
42
42
|
href: string;
|
|
43
|
-
/** Nested items for NavigationMenu */
|
|
44
|
-
items?: Array<{
|
|
45
|
-
/** Text to display (can be a string or a map of translations) */
|
|
46
|
-
label: string | Record<string, string>;
|
|
47
|
-
/** URL path or external link */
|
|
48
|
-
href: string;
|
|
49
|
-
}>;
|
|
50
43
|
}>;
|
|
51
44
|
/** Items to display in the sidebar, organized optionally by group URLs */
|
|
52
45
|
sidebar?: Record<string, Array<{
|
|
@@ -217,8 +210,6 @@ interface BoltdocsConfig {
|
|
|
217
210
|
versions?: BoltdocsVersionsConfig;
|
|
218
211
|
/** Custom plugins for extending functionality */
|
|
219
212
|
plugins?: BoltdocsPlugin[];
|
|
220
|
-
/** Map of custom external route paths to component file paths */
|
|
221
|
-
external?: Record<string, string>;
|
|
222
213
|
/** External integrations configuration */
|
|
223
214
|
integrations?: BoltdocsIntegrationsConfig;
|
|
224
215
|
/** Configuration for the robots.txt file */
|
|
@@ -307,6 +298,10 @@ interface CreateBoltdocsAppOptions {
|
|
|
307
298
|
homePage?: React__default.ComponentType;
|
|
308
299
|
/** Custom external pages mapped by their route path */
|
|
309
300
|
externalPages?: Record<string, React__default.ComponentType>;
|
|
301
|
+
/** Optional custom layout for external pages */
|
|
302
|
+
externalLayout?: React__default.ComponentType<{
|
|
303
|
+
children: React__default.ReactNode;
|
|
304
|
+
}>;
|
|
310
305
|
/** Optional custom MDX components provided by plugins */
|
|
311
306
|
components?: Record<string, React__default.ComponentType>;
|
|
312
307
|
}
|
|
@@ -394,8 +389,6 @@ interface NavbarLink {
|
|
|
394
389
|
active: boolean;
|
|
395
390
|
/** Optional icon or string for external link indication */
|
|
396
391
|
to?: string;
|
|
397
|
-
/** Nested items for NavigationMenu */
|
|
398
|
-
items?: NavbarLink[];
|
|
399
392
|
}
|
|
400
393
|
|
|
401
394
|
export type { BoltdocsConfig as B, ComponentRoute as C, LayoutProps as L, NavbarLink as N, OnThisPageProps as O, SandboxEmbedOptions as S, TabsProps as T, BoltdocsTab as a, CreateBoltdocsAppOptions as b, BoltdocsThemeConfig as c, SandboxFile as d, SandboxFiles as e, SandboxOptions as f, BoltdocsSocialLink as g, SidebarProps as h, SiteConfig as i };
|
|
@@ -40,13 +40,6 @@ interface BoltdocsThemeConfig {
|
|
|
40
40
|
label: string | Record<string, string>;
|
|
41
41
|
/** URL path or external link */
|
|
42
42
|
href: string;
|
|
43
|
-
/** Nested items for NavigationMenu */
|
|
44
|
-
items?: Array<{
|
|
45
|
-
/** Text to display (can be a string or a map of translations) */
|
|
46
|
-
label: string | Record<string, string>;
|
|
47
|
-
/** URL path or external link */
|
|
48
|
-
href: string;
|
|
49
|
-
}>;
|
|
50
43
|
}>;
|
|
51
44
|
/** Items to display in the sidebar, organized optionally by group URLs */
|
|
52
45
|
sidebar?: Record<string, Array<{
|
|
@@ -217,8 +210,6 @@ interface BoltdocsConfig {
|
|
|
217
210
|
versions?: BoltdocsVersionsConfig;
|
|
218
211
|
/** Custom plugins for extending functionality */
|
|
219
212
|
plugins?: BoltdocsPlugin[];
|
|
220
|
-
/** Map of custom external route paths to component file paths */
|
|
221
|
-
external?: Record<string, string>;
|
|
222
213
|
/** External integrations configuration */
|
|
223
214
|
integrations?: BoltdocsIntegrationsConfig;
|
|
224
215
|
/** Configuration for the robots.txt file */
|
|
@@ -307,6 +298,10 @@ interface CreateBoltdocsAppOptions {
|
|
|
307
298
|
homePage?: React__default.ComponentType;
|
|
308
299
|
/** Custom external pages mapped by their route path */
|
|
309
300
|
externalPages?: Record<string, React__default.ComponentType>;
|
|
301
|
+
/** Optional custom layout for external pages */
|
|
302
|
+
externalLayout?: React__default.ComponentType<{
|
|
303
|
+
children: React__default.ReactNode;
|
|
304
|
+
}>;
|
|
310
305
|
/** Optional custom MDX components provided by plugins */
|
|
311
306
|
components?: Record<string, React__default.ComponentType>;
|
|
312
307
|
}
|
|
@@ -394,8 +389,6 @@ interface NavbarLink {
|
|
|
394
389
|
active: boolean;
|
|
395
390
|
/** Optional icon or string for external link indication */
|
|
396
391
|
to?: string;
|
|
397
|
-
/** Nested items for NavigationMenu */
|
|
398
|
-
items?: NavbarLink[];
|
|
399
392
|
}
|
|
400
393
|
|
|
401
394
|
export type { BoltdocsConfig as B, ComponentRoute as C, LayoutProps as L, NavbarLink as N, OnThisPageProps as O, SandboxEmbedOptions as S, TabsProps as T, BoltdocsTab as a, CreateBoltdocsAppOptions as b, BoltdocsThemeConfig as c, SandboxFile as d, SandboxFiles as e, SandboxOptions as f, BoltdocsSocialLink as g, SidebarProps as h, SiteConfig as i };
|
package/package.json
CHANGED
package/src/client/app/index.tsx
CHANGED
|
@@ -16,6 +16,8 @@ import { DocsLayout } from './docs-layout'
|
|
|
16
16
|
import { MdxPage } from './mdx-page'
|
|
17
17
|
import { MdxComponentsProvider } from './mdx-components-context'
|
|
18
18
|
import { mdxComponentsDefault } from './mdx-component'
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import virtualCustomComponents from 'virtual:boltdocs-mdx-components'
|
|
19
21
|
import { useRoutes } from '../hooks/use-routes'
|
|
20
22
|
import { useLocation } from 'react-router-dom'
|
|
21
23
|
import { useBoltdocsStore } from '../store/use-boltdocs-store'
|
|
@@ -103,6 +105,7 @@ export function AppShell({
|
|
|
103
105
|
hot,
|
|
104
106
|
homePage: HomePage,
|
|
105
107
|
externalPages,
|
|
108
|
+
externalLayout: ExternalLayout,
|
|
106
109
|
components: customComponents = {},
|
|
107
110
|
}: {
|
|
108
111
|
initialRoutes: ComponentRoute[]
|
|
@@ -115,11 +118,13 @@ export function AppShell({
|
|
|
115
118
|
hot?: CreateBoltdocsAppOptions['hot']
|
|
116
119
|
homePage?: React.ComponentType
|
|
117
120
|
externalPages?: Record<string, React.ComponentType>
|
|
121
|
+
externalLayout?: React.ComponentType<{ children: React.ReactNode }>
|
|
118
122
|
components?: Record<string, React.ComponentType>
|
|
119
123
|
}) {
|
|
120
124
|
const [routesInfo, setRoutesInfo] = useState<ComponentRoute[]>(initialRoutes)
|
|
121
125
|
const [config, setConfig] = useState(initialConfig)
|
|
122
126
|
const computedExternalPages = externalPages || {}
|
|
127
|
+
const EffectiveExternalLayout = ExternalLayout || UserLayout
|
|
123
128
|
|
|
124
129
|
const resolvedRoutes = useMemo(() => {
|
|
125
130
|
return routesInfo
|
|
@@ -164,7 +169,11 @@ export function AppShell({
|
|
|
164
169
|
}, [hot])
|
|
165
170
|
|
|
166
171
|
const allComponents = useMemo(
|
|
167
|
-
() => ({
|
|
172
|
+
() => ({
|
|
173
|
+
...mdxComponentsDefault,
|
|
174
|
+
...virtualCustomComponents,
|
|
175
|
+
...customComponents,
|
|
176
|
+
}),
|
|
168
177
|
[customComponents],
|
|
169
178
|
)
|
|
170
179
|
|
|
@@ -200,9 +209,9 @@ export function AppShell({
|
|
|
200
209
|
<Route
|
|
201
210
|
path="/"
|
|
202
211
|
element={
|
|
203
|
-
<
|
|
212
|
+
<EffectiveExternalLayout>
|
|
204
213
|
<HomePage />
|
|
205
|
-
</
|
|
214
|
+
</EffectiveExternalLayout>
|
|
206
215
|
}
|
|
207
216
|
/>
|
|
208
217
|
{config.i18n &&
|
|
@@ -211,9 +220,9 @@ export function AppShell({
|
|
|
211
220
|
key={`home-${locale}`}
|
|
212
221
|
path={`/${locale}`}
|
|
213
222
|
element={
|
|
214
|
-
<
|
|
223
|
+
<EffectiveExternalLayout>
|
|
215
224
|
<HomePage />
|
|
216
|
-
</
|
|
225
|
+
</EffectiveExternalLayout>
|
|
217
226
|
}
|
|
218
227
|
/>
|
|
219
228
|
))}
|
|
@@ -229,9 +238,9 @@ export function AppShell({
|
|
|
229
238
|
<Route
|
|
230
239
|
path={extPath}
|
|
231
240
|
element={
|
|
232
|
-
<
|
|
241
|
+
<EffectiveExternalLayout>
|
|
233
242
|
<ExtComponent />
|
|
234
|
-
</
|
|
243
|
+
</EffectiveExternalLayout>
|
|
235
244
|
}
|
|
236
245
|
/>
|
|
237
246
|
{config.i18n &&
|
|
@@ -240,9 +249,9 @@ export function AppShell({
|
|
|
240
249
|
key={`${extPath}-${locale}`}
|
|
241
250
|
path={`/${locale}${cleanPath}`}
|
|
242
251
|
element={
|
|
243
|
-
<
|
|
252
|
+
<EffectiveExternalLayout>
|
|
244
253
|
<ExtComponent />
|
|
245
|
-
</
|
|
254
|
+
</EffectiveExternalLayout>
|
|
246
255
|
}
|
|
247
256
|
/>
|
|
248
257
|
))}
|
|
@@ -299,6 +308,7 @@ export function createBoltdocsApp(options: CreateBoltdocsAppOptions) {
|
|
|
299
308
|
hot,
|
|
300
309
|
homePage,
|
|
301
310
|
externalPages,
|
|
311
|
+
externalLayout,
|
|
302
312
|
components,
|
|
303
313
|
} = options
|
|
304
314
|
const container = document.querySelector(target)
|
|
@@ -319,6 +329,7 @@ export function createBoltdocsApp(options: CreateBoltdocsAppOptions) {
|
|
|
319
329
|
hot={hot}
|
|
320
330
|
homePage={homePage}
|
|
321
331
|
externalPages={externalPages}
|
|
332
|
+
externalLayout={externalLayout}
|
|
322
333
|
components={components}
|
|
323
334
|
/>
|
|
324
335
|
</BrowserRouter>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, use } from 'react'
|
|
2
2
|
|
|
3
3
|
export type MdxComponentsType = Record<string, React.ComponentType<any>>
|
|
4
4
|
|
|
5
5
|
const MdxComponentsContext = createContext<MdxComponentsType>({})
|
|
6
6
|
|
|
7
7
|
export function useMdxComponents() {
|
|
8
|
-
return
|
|
8
|
+
return use(MdxComponentsContext)
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function MdxComponentsProvider({
|
|
@@ -11,29 +11,40 @@ export function ScrollHandler() {
|
|
|
11
11
|
|
|
12
12
|
// biome-ignore lint/correctness/useExhaustiveDependencies: pathname is used as a trigger for scroll-to-top on navigation
|
|
13
13
|
useLayoutEffect(() => {
|
|
14
|
-
const container = document.querySelector('.boltdocs-content')
|
|
15
|
-
|
|
14
|
+
const container = document.querySelector('.boltdocs-content') || window
|
|
15
|
+
|
|
16
|
+
// Helper to get scroll top
|
|
17
|
+
const getScrollTop = () => {
|
|
18
|
+
if (container === window) return window.scrollY
|
|
19
|
+
return (container as HTMLElement).scrollTop
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Helper to scroll
|
|
23
|
+
const scrollTo = (top: number, behavior: ScrollBehavior = 'auto') => {
|
|
24
|
+
if (container === window) {
|
|
25
|
+
window.scrollTo({ top, behavior })
|
|
26
|
+
} else {
|
|
27
|
+
(container as HTMLElement).scrollTo({ top, behavior })
|
|
28
|
+
}
|
|
29
|
+
}
|
|
16
30
|
|
|
17
31
|
if (hash) {
|
|
18
32
|
const id = hash.replace('#', '')
|
|
19
33
|
const element = document.getElementById(id)
|
|
20
34
|
if (element) {
|
|
21
35
|
const offset = 80
|
|
22
|
-
const
|
|
36
|
+
const containerTop = container === window ? 0 : (container as HTMLElement).getBoundingClientRect().top
|
|
23
37
|
const elementRect = element.getBoundingClientRect().top
|
|
24
|
-
const elementPosition = elementRect -
|
|
25
|
-
const offsetPosition = elementPosition - offset +
|
|
38
|
+
const elementPosition = elementRect - containerTop
|
|
39
|
+
const offsetPosition = elementPosition - offset + getScrollTop()
|
|
26
40
|
|
|
27
|
-
|
|
28
|
-
top: offsetPosition,
|
|
29
|
-
behavior: 'smooth',
|
|
30
|
-
})
|
|
41
|
+
scrollTo(offsetPosition, 'smooth')
|
|
31
42
|
return
|
|
32
43
|
}
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
// Scroll to top on navigation when no hash is specified
|
|
36
|
-
|
|
47
|
+
scrollTo(0)
|
|
37
48
|
}, [pathname, hash])
|
|
38
49
|
|
|
39
50
|
return null
|
|
@@ -5,7 +5,6 @@ import { OnThisPage } from '@components/ui-base/on-this-page'
|
|
|
5
5
|
import { Head } from '@components/ui-base/head'
|
|
6
6
|
import { Breadcrumbs } from '@components/ui-base/breadcrumbs'
|
|
7
7
|
import { PageNav } from '@components/ui-base/page-nav'
|
|
8
|
-
import { ProgressBar } from '@components/ui-base/progress-bar'
|
|
9
8
|
import { ErrorBoundary } from '@components/ui-base/error-boundary'
|
|
10
9
|
import { CopyMarkdown } from '@components/ui-base/copy-markdown'
|
|
11
10
|
import { useRoutes } from '@client/hooks/use-routes'
|
|
@@ -40,7 +39,6 @@ export function DefaultLayout({ children }: LayoutProps) {
|
|
|
40
39
|
|
|
41
40
|
return (
|
|
42
41
|
<DocsLayout>
|
|
43
|
-
<ProgressBar />
|
|
44
42
|
<Head
|
|
45
43
|
siteTitle={
|
|
46
44
|
getTranslated(config.theme?.title, currentLocale) || 'Boltdocs'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type React from 'react'
|
|
2
2
|
import { cn } from '@client/utils/cn'
|
|
3
|
+
import { useLocation } from '../hooks'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Props shared by all layout slot components.
|
|
@@ -60,17 +61,37 @@ function Content({ children, className, style }: SlotProps) {
|
|
|
60
61
|
<main
|
|
61
62
|
className={cn(
|
|
62
63
|
'boltdocs-content flex-1 min-w-0 overflow-y-auto',
|
|
64
|
+
'contain-layout', // Optimization: isolate main content layout
|
|
63
65
|
className,
|
|
64
66
|
)}
|
|
65
67
|
style={style}
|
|
66
68
|
>
|
|
67
|
-
|
|
68
|
-
{children}
|
|
69
|
-
</div>
|
|
69
|
+
{children}
|
|
70
70
|
</main>
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* MDX Content wrapper with standard page padding and max-width logic.
|
|
76
|
+
*/
|
|
77
|
+
function ContentMdx({ children, className, style }: SlotProps) {
|
|
78
|
+
const { pathname } = useLocation()
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
className={cn(
|
|
82
|
+
'boltdocs-page mx-auto pt-4 pb-20 px-4 sm:px-8',
|
|
83
|
+
{
|
|
84
|
+
'max-w-content-max': pathname.includes('/docs/'),
|
|
85
|
+
},
|
|
86
|
+
className,
|
|
87
|
+
)}
|
|
88
|
+
style={style}
|
|
89
|
+
>
|
|
90
|
+
{children}
|
|
91
|
+
</div>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
74
95
|
/**
|
|
75
96
|
* Content header row (breadcrumbs + copy markdown).
|
|
76
97
|
*/
|
|
@@ -96,10 +117,19 @@ function ContentFooter({ children, className, style }: SlotProps) {
|
|
|
96
117
|
)
|
|
97
118
|
}
|
|
98
119
|
|
|
120
|
+
interface DocsLayoutComponent extends React.FC<SlotProps> {
|
|
121
|
+
Body: typeof Body
|
|
122
|
+
Content: typeof Content
|
|
123
|
+
ContentMdx: typeof ContentMdx
|
|
124
|
+
ContentHeader: typeof ContentHeader
|
|
125
|
+
ContentFooter: typeof ContentFooter
|
|
126
|
+
}
|
|
127
|
+
|
|
99
128
|
// Attach sub-components to the root
|
|
100
129
|
export const DocsLayout = Object.assign(DocsLayoutRoot, {
|
|
101
130
|
Body,
|
|
102
131
|
Content,
|
|
132
|
+
ContentMdx,
|
|
103
133
|
ContentHeader,
|
|
104
134
|
ContentFooter,
|
|
105
|
-
})
|
|
135
|
+
}) as DocsLayoutComponent
|