boltdocs 2.1.1 → 2.3.0

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.
Files changed (133) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bin/boltdocs.js +2 -2
  3. package/dist/base-ui/index.d.mts +25 -0
  4. package/dist/base-ui/index.d.ts +25 -0
  5. package/dist/base-ui/index.js +1 -0
  6. package/dist/base-ui/index.mjs +1 -0
  7. package/dist/{cache-Q4T6VAUL.mjs → cache-P6WK424C.mjs} +1 -1
  8. package/dist/chunk-22NXDNP4.mjs +74 -0
  9. package/dist/chunk-2HUVMMJU.mjs +1 -0
  10. package/dist/chunk-2Z5T6EAU.mjs +1 -0
  11. package/dist/chunk-CRZGOE32.mjs +1 -0
  12. package/dist/chunk-HA6543SL.mjs +1 -0
  13. package/dist/chunk-JD3RSDE4.mjs +1 -0
  14. package/dist/chunk-JZXLCA2E.mjs +1 -0
  15. package/dist/chunk-NBCYHLAA.mjs +1 -0
  16. package/dist/chunk-RPUERTVC.mjs +1 -0
  17. package/dist/chunk-T3W44KWY.mjs +1 -0
  18. package/dist/chunk-URTD6E6S.mjs +1 -0
  19. package/dist/chunk-W2NB4T6V.mjs +1 -0
  20. package/dist/chunk-Y4RRHPXC.mjs +1 -0
  21. package/dist/client/index.d.mts +13 -115
  22. package/dist/client/index.d.ts +13 -115
  23. package/dist/client/index.js +1 -1
  24. package/dist/client/index.mjs +1 -1
  25. package/dist/client/ssr.js +1 -1
  26. package/dist/client/ssr.mjs +1 -1
  27. package/dist/client/types.d.mts +3 -0
  28. package/dist/client/types.d.ts +3 -0
  29. package/dist/client/types.js +1 -0
  30. package/dist/client/types.mjs +0 -0
  31. package/dist/copy-markdown-C-90ixSe.d.ts +15 -0
  32. package/dist/copy-markdown-CbS8X-qe.d.mts +15 -0
  33. package/dist/{client/hooks → hooks}/index.d.mts +16 -11
  34. package/dist/{client/hooks → hooks}/index.d.ts +16 -11
  35. package/dist/hooks/index.js +1 -0
  36. package/dist/hooks/index.mjs +1 -0
  37. package/dist/integrations/index.d.mts +48 -0
  38. package/dist/integrations/index.d.ts +48 -0
  39. package/dist/integrations/index.js +1 -0
  40. package/dist/integrations/index.mjs +1 -0
  41. package/dist/link-DfBwCeZc.d.mts +68 -0
  42. package/dist/link-DfBwCeZc.d.ts +68 -0
  43. package/dist/loading-B7X5Wchs.d.ts +66 -0
  44. package/dist/loading-WuaQbsKb.d.mts +66 -0
  45. package/dist/{client/components/mdx → mdx}/index.d.mts +6 -38
  46. package/dist/{client/components/mdx → mdx}/index.d.ts +6 -38
  47. package/dist/mdx/index.js +1 -0
  48. package/dist/mdx/index.mjs +1 -0
  49. package/dist/node/cli-entry.js +31 -27
  50. package/dist/node/cli-entry.mjs +5 -1
  51. package/dist/node/index.d.mts +44 -14
  52. package/dist/node/index.d.ts +44 -14
  53. package/dist/node/index.js +24 -24
  54. package/dist/node/index.mjs +1 -1
  55. package/dist/primitives/index.d.mts +301 -0
  56. package/dist/primitives/index.d.ts +301 -0
  57. package/dist/primitives/index.js +1 -0
  58. package/dist/primitives/index.mjs +1 -0
  59. package/dist/search-dialog-ZRXBAQJ5.mjs +1 -0
  60. package/dist/{types-Cp21DHI6.d.mts → types-j7jvWsJj.d.mts} +63 -17
  61. package/dist/{types-Cp21DHI6.d.ts → types-j7jvWsJj.d.ts} +63 -17
  62. package/dist/{use-routes-xLhumjbV.d.ts → use-routes-Cd806kGw.d.ts} +1 -1
  63. package/dist/{use-routes-8Iei6jTp.d.mts → use-routes-DDL0_jkQ.d.mts} +1 -1
  64. package/package.json +35 -8
  65. package/src/client/app/index.tsx +155 -35
  66. package/src/client/app/mdx-component.tsx +7 -3
  67. package/src/client/app/theme-context.tsx +47 -23
  68. package/src/client/components/default-layout.tsx +16 -6
  69. package/src/client/components/primitives/breadcrumbs.tsx +1 -1
  70. package/src/client/components/primitives/navbar.tsx +8 -5
  71. package/src/client/components/primitives/search-dialog.tsx +15 -6
  72. package/src/client/components/primitives/sidebar.tsx +3 -2
  73. package/src/client/components/primitives/skeleton.tsx +26 -0
  74. package/src/client/components/ui-base/breadcrumbs.tsx +1 -1
  75. package/src/client/components/ui-base/index.ts +17 -0
  76. package/src/client/components/ui-base/loading.tsx +43 -73
  77. package/src/client/components/ui-base/navbar.tsx +74 -39
  78. package/src/client/components/ui-base/page-nav.tsx +2 -1
  79. package/src/client/components/ui-base/powered-by.tsx +11 -5
  80. package/src/client/components/ui-base/search-dialog.tsx +16 -5
  81. package/src/client/components/ui-base/sidebar.tsx +33 -22
  82. package/src/client/components/ui-base/tabs.tsx +4 -1
  83. package/src/client/components/ui-base/theme-toggle.tsx +35 -15
  84. package/src/client/hooks/use-i18n.ts +38 -7
  85. package/src/client/hooks/use-localized-to.ts +51 -73
  86. package/src/client/hooks/use-navbar.ts +10 -3
  87. package/src/client/hooks/use-page-nav.ts +27 -6
  88. package/src/client/hooks/use-routes.ts +62 -17
  89. package/src/client/hooks/use-search.ts +84 -46
  90. package/src/client/hooks/use-sidebar.ts +6 -2
  91. package/src/client/hooks/use-version.ts +5 -0
  92. package/src/client/integrations/index.ts +1 -0
  93. package/src/client/store/use-boltdocs-store.ts +44 -0
  94. package/src/client/theme/neutral.css +29 -0
  95. package/src/client/types.ts +4 -2
  96. package/src/client/utils/i18n.ts +23 -0
  97. package/src/node/{cli.ts → cli/build.ts} +17 -23
  98. package/src/node/cli/dev.ts +22 -0
  99. package/src/node/cli/doctor.ts +243 -0
  100. package/src/node/cli/index.ts +9 -0
  101. package/src/node/cli/ui.ts +54 -0
  102. package/src/node/cli-entry.ts +16 -16
  103. package/src/node/config.ts +54 -17
  104. package/src/node/index.ts +1 -1
  105. package/src/node/mdx/cache.ts +12 -0
  106. package/src/node/mdx/highlighter.ts +47 -0
  107. package/src/node/mdx/index.ts +114 -0
  108. package/src/node/mdx/rehype-shiki.ts +53 -0
  109. package/src/node/mdx/remark-shiki.ts +61 -0
  110. package/src/node/plugin/entry.ts +1 -1
  111. package/src/node/plugin/html.ts +8 -4
  112. package/src/node/plugin/index.ts +135 -72
  113. package/src/node/routes/index.ts +34 -13
  114. package/src/node/routes/parser.ts +13 -5
  115. package/src/node/search/index.ts +55 -0
  116. package/src/node/ssg/index.ts +15 -7
  117. package/src/node/ssg/robots.ts +7 -4
  118. package/src/node/utils.ts +32 -2
  119. package/tsup.config.ts +7 -2
  120. package/dist/chunk-52MVMZWS.mjs +0 -1
  121. package/dist/chunk-BVWWKXJH.mjs +0 -1
  122. package/dist/chunk-DVY3RDXD.mjs +0 -1
  123. package/dist/chunk-FUVYCYWC.mjs +0 -1
  124. package/dist/chunk-GBLMDJ2B.mjs +0 -1
  125. package/dist/chunk-ISPX45DF.mjs +0 -1
  126. package/dist/chunk-PNXZMUCO.mjs +0 -1
  127. package/dist/chunk-V2ZHKQSP.mjs +0 -74
  128. package/dist/client/components/mdx/index.js +0 -1
  129. package/dist/client/components/mdx/index.mjs +0 -1
  130. package/dist/client/hooks/index.js +0 -1
  131. package/dist/client/hooks/index.mjs +0 -1
  132. package/dist/search-dialog-TWGYKF2D.mjs +0 -1
  133. package/src/node/mdx.ts +0 -279
@@ -0,0 +1 @@
1
+ import{c as $,g as H}from"./chunk-NBCYHLAA.mjs";import{useState as Ce,useEffect as ye}from"react";import{Button as Ne}from"react-aria-components";import{Search as Re,Sun as we,Moon as Pe,ExternalLink as Te,ChevronDown as Ae}from"lucide-react";import{jsx as b,jsxs as k}from"react/jsx-runtime";function A(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var ee=e=>k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...A(e),children:[b("title",{children:"GitHub"}),b("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"})]}),te=e=>k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...A(e),children:[b("title",{children:"Discord"}),b("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"})]}),oe=e=>k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...A(e),children:[b("title",{children:"X"}),b("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"})]}),oo=e=>k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...A(e),children:[b("title",{children:"CodeSandbox"}),b("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]}),re=e=>k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...A(e),children:[b("title",{children:"Bluesky"}),b("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"})]});import{jsx as a,jsxs as R}from"react/jsx-runtime";var ke=({children:e,className:t,...o})=>a("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}),Ie=({children:e,className:t})=>a("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}),Be=({children:e,className:t})=>a("div",{className:n("flex items-center gap-4",t),children:e}),Le=({children:e,className:t})=>a("div",{className:n("flex items-center gap-2 md:gap-4",t),children:e}),Se=({children:e,className:t})=>a("div",{className:n("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),Me=({src:e,alt:t,width:o=24,height:r=24,className:s})=>a(y,{href:"/",className:n("flex items-center gap-2 shrink-0 outline-none",s),children:e?a("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Oe=({children:e,className:t})=>a("span",{className:n("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Ee=({children:e,className:t})=>a("nav",{className:n("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),ze=({label:e,href:t,active:o,to:r,className:s})=>R(y,{href:t,target:r==="external"?"_blank":void 0,className:n("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},s),children:[e,r==="external"&&a("span",{className:"ml-1 inline-block",children:a(Te,{size:12})})]}),De=({className:e,onPress:t})=>{let[o,r]=Ce(!1),s=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return ye(()=>{r(!0)},[]),R(Ne,{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-[320px] justify-between",e),children:[R("div",{className:"flex items-center gap-2",children:[a(Re,{size:16}),a("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),R("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[a("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"}),a("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"})]})]})},He=({className:e,theme:t,onThemeChange:o})=>a(ie,{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"?a(we,{size:20}):a(Pe,{size:20})}),lo=({label:e,children:t,className:o,icon:r})=>R(V,{placement:"bottom end",children:[R(ne,{variant:"ghost",className:n("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&&a("span",{className:"flex items-center shrink-0",children:r}),a("span",{className:"text-[13px] font-bold uppercase tracking-wide",children:e}),a(Ae,{size:14,className:"ml-0.5 opacity-50"})]}),a(G,{className:"min-w-[180px]",children:t})]}),Ve=({label:e,className:t,onPress:o,isCurrent:r})=>a(F,{onAction:o,className:n(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),Ge=({name:e})=>{if(e==="github")return a(ee,{});if(e==="discord")return a(te,{});if(e==="x")return a(oe,{});if(e==="bluesky")return a(re,{})},Fe=({icon:e,link:t,className:o})=>a(y,{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:a(Ge,{name:e})}),We=({className:e})=>a(se,{orientation:"vertical",className:n("h-6 w-px bg-border-subtle mx-1",e)}),co={NavbarRoot:ke,NavbarLeft:Be,NavbarRight:Le,NavbarCenter:Se,NavbarLogo:Me,Title:Oe,Links:Ee,Link:ze,SearchTrigger:De,Theme:He,Item:Ve,Socials:Fe,Split:We,Content:Ie};import*as I from"react-aria-components";import{ChevronDown as bo}from"lucide-react";import{clsx as je}from"clsx";import{twMerge as _e}from"tailwind-merge";function n(...e){return _e(je(e))}import{Fragment as No,jsx as Co,jsxs as yo}from"react/jsx-runtime";import*as d from"react-aria-components";import{Search as Xe,Hash as Ke,FileText as Ue,CornerDownLeft as Ze}from"lucide-react";import{Fragment as rt,jsx as p,jsxs as W}from"react/jsx-runtime";var qe=({children:e,isOpen:t,onOpenChange:o,className:r})=>p(d.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:p(d.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:p(d.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Je=({children:e,className:t,onSelectionChange:o,...r})=>p("div",{className:t,children:p(d.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Qe=({className:e,...t})=>W(d.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[p(Xe,{className:"h-5 w-5 text-text-muted"}),p(d.Input,{...t,className:n("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),p("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:p("kbd",{className:"font-sans",children:"ESC"})})]}),Ye=({children:e,className:t,...o})=>p(d.ListBox,{...o,className:n("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),$e=({children:e,className:t,...o})=>p(d.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=>W(rt,{children:[e,(r.isFocused||r.isSelected)&&W("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[p("span",{className:"text-[10px]",children:"Select"}),p(Ze,{size:10})]})]})}),et=({isHeading:e,className:t})=>p("div",{className:n("shrink-0",t),children:e?p(Ke,{size:18}):p(Ue,{size:18})}),tt=({children:e,className:t})=>p("span",{className:n("block font-medium truncate flex-1 text-sm",t),children:e}),ot=({children:e,className:t})=>p("span",{className:n("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),To={Root:qe,Autocomplete:Je,Input:Qe,List:Ye,Item:Object.assign($e,{Icon:et,Title:tt,Bio:ot})};import{createContext as le,use as _,useEffect as M,useImperativeHandle as it,useMemo as K,useRef as ce,useState as U}from"react";import at from"scroll-into-view-if-needed";import{useEffect as nt,useRef as st}from"react";function ae(e,t){let o=st(e);nt(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function j(e){return e.startsWith("#")?e.slice(1):null}import{jsx as v}from"react/jsx-runtime";var Z=le(null),me=le(null),X=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 s=t.find(l=>l.target.id===r.id),i=s?s.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,s=Number.MAX_VALUE,i=-1;for(let l=0;l<this.items.length;l++){let c=document.getElementById(this.items[l].id);if(!c)continue;let u=Math.abs(r-c.getBoundingClientRect().top);u<s&&(i=l,s=u)}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 s=document.getElementById(r.id);s&&o.unobserve(s)}this.items=[];for(let r of t){let s=j(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}};function pe(){let e=_(Z);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function lt(e){let[t,o]=U({isOverflowing:!1,isAtBottom:!1});return M(()=>{let r=e.current;if(!r)return;let s=()=>{let l=r.scrollHeight>r.clientHeight,c=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:l,isAtBottom:c})};s(),r.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s);let i=new MutationObserver(s);return i.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",s),window.removeEventListener("resize",s),i.disconnect()}},[e]),t}function Ho(){let e=pe();return K(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Vo(){let e=pe();return K(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function Go({containerRef:e,children:t}){return v(me.Provider,{value:e,children:t})}function Fo({toc:e,single:t=!1,children:o}){let r=K(()=>new X,[]),[s,i]=U(r.items);return r.single=t,M(()=>{r.setItems(e)},[r,e]),M(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),v(Z.Provider,{value:s,children:o})}var ct=({children:e,className:t})=>v("nav",{className:n("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),mt=({children:e,className:t,...o})=>v("div",{className:n("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),de=({children:e,className:t,ref:o,...r})=>{let s=ce(null);it(o,()=>s.current);let{isOverflowing:i,isAtBottom:l}=lt(s);return v("div",{ref:s,className:n("relative overflow-y-auto boltdocs-otp-content",i&&!l&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};de.displayName="OnThisPageContent";var pt=({children:e,className:t})=>v("ul",{className:n("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),dt=({level:e,children:t,className:o})=>v("li",{className:n(e===3&&"pl-3",o),children:t}),ut=({children:e,href:t,active:o,onClick:r,className:s})=>{let i=_(Z),l=_(me),c=t?j(t):null,u=ce(null),[g,C]=U(o);return ae(c&&i?i.find(f=>f.id===c)?.active:null,f=>{f!==null&&f!==g&&(C(!!f),f&&u.current&&l?.current&&at(u.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:l.current}))}),M(()=>{o!==void 0&&C(o)},[o]),v("a",{ref:u,href:t,onClick:r,"data-active":g,className:n("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",g?"text-primary-500 font-medium":"text-text-muted",s),children:e})},ft=({style:e,className:t})=>v("div",{className:n("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e}),Wo={OnThisPageRoot:ct,OnThisPageHeader:mt,OnThisPageContent:de,OnThisPageList:pt,OnThisPageItem:dt,OnThisPageLink:ut,OnThisPageIndicator:ft};import*as ue from"react-aria-components";import{ChevronLeft as gt,ChevronRight as xt}from"lucide-react";import{Fragment as Rt,jsx as N,jsxs as Nt}from"react/jsx-runtime";var bt=({children:e,className:t})=>N("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}),ht=({children:e,to:t,direction:o,className:r})=>{let s=o==="next";return Nt(ue.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&&N(gt,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),N("div",{className:"flex flex-col gap-1 flex-1",children:e}),s&&N(xt,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},vt=({children:e,className:t})=>N("span",{className:n("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Ct=({children:e,className:t})=>N("span",{className:n("text-base font-bold text-text-main truncate",t),children:e}),yt=({children:e})=>N(Rt,{children:e}),Uo={PageNavRoot:bt,PageNavLink:Object.assign(ht,{Title:vt,Description:Ct,Icon:yt})};import{jsx as B}from"react/jsx-runtime";var wt=({children:e,className:t="",...o})=>B("div",{className:n("w-full",t),...o,children:e}),Pt=({children:e,className:t=""})=>B("div",{role:"tablist",className:n("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),Tt=({children:e,id:t,selected:o,className:r="",...s})=>B("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}),At=({children:e,className:t=""})=>B("div",{className:n("p-4 outline-none",t),children:e}),kt=({className:e="",style:t})=>B("div",{className:n("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t}),Qo={TabsRoot:wt,TabsList:Pt,TabsItem:Tt,TabsContent:At,TabsIndicator:kt};import fe from"react";import{Link as It}from"react-aria-components";import{useLocation as Bt}from"react-router-dom";import{jsx as ge}from"react/jsx-runtime";var y=fe.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:s,onFocus:i,...l}=e,c=H(o??""),{preload:u}=$();return ge(It,{...l,ref:t,href:c,onMouseEnter:f=>{s?.(f),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&u(c)},onFocus:f=>{i?.(f),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&u(c)}})});y.displayName="Link";var Lt=fe.forwardRef((e,t)=>{let{href:o,end:r=!1,className:s,children:i,...l}=e,c=Bt(),u=H(o??""),g=r?c.pathname===u:c.pathname.startsWith(u),C=typeof s=="function"?s({isActive:g}):n(s,g&&"active"),f=typeof i=="function"?i({isActive:g}):i;return ge(y,{...l,ref:t,href:o,className:C,children:f})});Lt.displayName="NavLink";import*as xe from"react-aria-components";import{ChevronRight as St}from"lucide-react";import{jsx as h,jsxs as O}from"react/jsx-runtime";var Mt=({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,i=r.getTime()-s.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return h("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})},Ot=({children:e,className:t})=>h("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:h("nav",{className:"flex-1 space-y-6",children:e})}),Et=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:s,className:i})=>O("div",{className:n("space-y-1",i),children:[t&&O(xe.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:[O("div",{className:"flex items-center gap-2",children:[o&&h(o,{size:14}),t]}),h(St,{size:14,className:n("transition-transform duration-200",r&&"rotate-90")})]}),r&&h("div",{className:"space-y-0.5",children:e})]}),zt=({children:e,className:t})=>h("div",{className:n(t),children:e}),Dt=({label:e,href:t,active:o,icon:r,badge:s,className:i})=>O(y,{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",i),children:[r&&h(r,{size:16,className:n(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),h("span",{className:"truncate",children:e}),s&&h(Mt,{badge:s})]}),pr={SidebarRoot:Ot,SidebarGroup:Et,SidebarGroupItem:zt,SidebarLink:Dt};import{Breadcrumb as Ht,Breadcrumbs as Vt,Link as Gt}from"react-aria-components";import{ChevronRight as Ft}from"lucide-react";import{jsx as E}from"react/jsx-runtime";var br=({children:e,className:t,...o})=>E(Vt,{className:n("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),hr=({children:e,className:t,...o})=>E(Ht,{className:n("flex items-center mb-0 gap-1.5",t),...o,children:e}),vr=({children:e,href:t,className:o,...r})=>E(Gt,{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}),Cr=({className:e})=>E(Ft,{size:14,className:n("shrink-0 text-text-dim",e)});import*as z from"react-aria-components";import{cva as Wt}from"class-variance-authority";import{Fragment as jt,jsx as w,jsxs as _t}from"react/jsx-runtime";var be=Wt("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"}}),ne=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:s,className:i,variant:l,size:c,rounded:u,iconSize:g,disabled:C,...f})=>{let D=r||!s&&!!t,Y=D?w("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):_t(jt,{children:[t&&o==="left"&&w("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),w("span",{className:"flex items-center",children:s}),t&&o==="right"&&w("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?w(z.Link,{href:e,className:n(be({variant:l,size:c,rounded:u,iconSize:D?g:void 0,disabled:C}),i),...f,children:Y}):w(z.Button,{className:n(be({variant:l,size:c,rounded:u,iconSize:D?g:void 0,disabled:C}),i),...f,children:Y})};import{jsx as Xt}from"react/jsx-runtime";var kr=({children:e,className:t,vertical:o=!1})=>Xt("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});import{Check as Ut,ChevronRight as Zt,Dot as qt}from"lucide-react";import he from"react";import*as m from"react-aria-components";import*as P from"react-aria-components";import{jsx as q,jsxs as Kt}from"react/jsx-runtime";var J=({children:e,className:t,showArrow:o,...r})=>Kt(P.Popover,{offset:8,...r,className:P.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","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",s)),children:[o&&q(P.OverlayArrow,{className:"group",children:q("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:q("path",{d:"M0 0 L6 6 L12 0"})})}),e]});import{Fragment as $t,jsx as x,jsxs as L}from"react/jsx-runtime";function V(e){let[t,o]=he.Children.toArray(e.children).slice(0,2);return L(m.MenuTrigger,{...e,children:[t,x(J,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function Jt(e){let[t,o]=he.Children.toArray(e.children).slice(0,2);return L(m.SubmenuTrigger,{...e,children:[t,x(J,{offset:-4,crossOffset:-4,children:o})]})}function G(e){return x(m.Menu,{...e,className:m.composeRenderProps(e.className,t=>n("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function F(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return x(m.MenuItem,{...e,textValue:t,className:m.composeRenderProps(e.className,(o,{isFocused:r,isPressed:s,isDisabled:i})=>n("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",s&&"scale-[0.98] bg-primary-500/15",i&&"opacity-40 grayscale pointer-events-none",o)),children:m.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:s,hasSubmenu:i})=>L($t,{children:[r!=="none"&&L("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[s&&r==="multiple"&&x(Ut,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),s&&r==="single"&&x(qt,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),x("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),i&&x(Zt,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function Qt({title:e,...t}){return L(m.MenuSection,{...t,className:n("flex flex-col gap-0.5",t.className),children:[e&&x(m.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),x(m.Collection,{items:t.items,children:t.children})]})}function Yt(e){return x(m.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var Hr={Root:G,Item:F,Trigger:V,SubTrigger:Jt,Section:Qt,Separator:Yt};import*as T from"react-aria-components";import{Fragment as to,jsx as S,jsxs as Q}from"react/jsx-runtime";var eo=({className:e,children:t,...o})=>S(T.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=>Q(to,{children:[S(T.OverlayArrow,{children:Q("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:[S("title",{children:"Arrow"}),S("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),Wr=({content:e,children:t,delay:o=500,closeDelay:r=0,...s})=>Q(T.TooltipTrigger,{delay:o,closeDelay:r,children:[t,S(eo,{...s,children:e})]});import{Separator as se,ToggleButton as ie}from"react-aria-components";export{n as a,y as b,Lt as c,be as d,ne as e,ee as f,oo as g,Wr as h,ke as i,Ie as j,Be as k,Le as l,Se as m,Me as n,Oe as o,Ee as p,ze as q,De as r,He as s,lo as t,Ve as u,Ge as v,Fe as w,We as x,co as y,qe as z,Je as A,Qe as B,Ye as C,$e as D,et as E,tt as F,ot as G,pe as H,lt as I,Ho as J,Vo as K,Go as L,Fo as M,ct as N,mt as O,de as P,pt as Q,dt as R,ut as S,ft as T,Wo as U,bt as V,ht as W,vt as X,Ct as Y,yt as Z,Uo as _,wt as $,Pt as aa,Tt as ba,At as ca,kt as da,Qo as ea,Ot as fa,Et as ga,zt as ha,Dt as ia,pr as ja,br as ka,hr as la,vr as ma,Cr as na,kr as oa,J as pa,V as qa,Jt as ra,G as sa,F as ta,Qt as ua,Yt as va,Hr as wa,se as xa,ie as ya};
@@ -0,0 +1 @@
1
+ var E=Object.defineProperty;var y=(s,t)=>()=>(s&&(t=s(s=0)),t);var V=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),q=(s,t)=>{for(var e in t)E(s,e,{get:t[e],enumerable:!0})};import J from"path";import{fileURLToPath as X}from"url";var u=y(()=>{"use strict"});import P from"fs";import L from"gray-matter";import O from"isomorphic-dompurify";function tt(s){return s.replace(/\\/g,"/")}function M(s){return s.replace(/^\d+\./,"")}function et(s){let t=s.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function st(s){return/\.mdx?$/.test(s)}function m(s){try{return P.statSync(s).mtimeMs}catch{return 0}}function rt(s){let t=P.readFileSync(s,"utf-8");try{let{data:e,content:r}=L(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function A(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function it(s){return A(s)}function nt(s){let e=s.split("/").map(M).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function at(s){return O.sanitize(s)}function ct(s){return O.sanitize(s,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function ot(s){return s.charAt(0).toUpperCase()+s.slice(1)}function ht(s,t){return s?typeof s=="string"?s:t&&s[t]?s[t]:Object.values(s)[0]||"":""}var _=y(()=>{"use strict";u()});import a from"fs";import o from"path";import g from"crypto";import d from"zlib";import{promisify as l}from"util";async function vt(){await h.flush()}var p,B,f,S,xt,C,N,R,j,I,x,v,h,b,z,$,K=y(()=>{u();_();p=l(a.writeFile),B=l(a.readFile),f=l(a.mkdir),S=l(a.rename),xt=l(a.unlink),C=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",N="assets",R="shards",j=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),I=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",x=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},v=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},h=new v,b=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:I,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=o.resolve(e,C,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!a.existsSync(this.cachePath)))try{let t=a.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=d.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,n=this.compress;h.add(async()=>{try{await f(o.dirname(r),{recursive:!0});let i=Buffer.from(e);n&&(i=d.gzipSync(i));let c=`${r}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||m(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:m(t)})}isValid(t){let e=this.entries.get(t);return e?m(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await h.flush()}},z=class{index=new Map;memoryCache=new x(j);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=o.resolve(e,C,`transform-${t}`),this.shardsDir=o.resolve(this.baseDir,R),this.indexPath=o.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&a.existsSync(this.indexPath))try{let t=a.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;h.add(async()=>{await f(o.dirname(e),{recursive:!0}),await p(e,t)})}async getMany(t){let e=new Map,r=[];for(let n of t){let i=this.memoryCache.get(n);i?e.set(n,i):this.index.has(n)&&r.push(n)}if(r.length>0){let n=await Promise.all(r.map(async i=>{let c=this.index.get(i),T=o.resolve(this.shardsDir,`${c}.gz`);try{let w=await B(T),D=d.gunzipSync(w).toString("utf-8");return this.memoryCache.set(i,D),{key:i,val:D}}catch{return null}}));for(let i of n)i&&e.set(i.key,i.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let n=o.resolve(this.shardsDir,`${r}.gz`);if(!a.existsSync(n))return null;try{let i=a.readFileSync(n),c=d.gunzipSync(i).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=g.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let n=o.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{if(a.existsSync(n))return;await f(this.shardsDir,{recursive:!0});let i=d.gzipSync(Buffer.from(e)),c=`${n}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,n)})}get size(){return this.index.size}async flush(){await h.flush()}},$=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=o.resolve(t,C,N)}getFileHash(t){return g.createHash("md5").update(a.readFileSync(t)).digest("hex")}get(t,e){if(!a.existsSync(t))return null;let r=this.getFileHash(t),n=this.getCachedPath(t,`${e}-${r}`);return a.existsSync(n)?n:null}set(t,e,r){let n=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${n}`);h.add(async()=>{await f(this.assetsDir,{recursive:!0});let c=`${i}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,r),await S(c,i)})}getCachedPath(t,e){let r=o.extname(t),n=o.basename(t,r),i=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return o.join(this.assetsDir,`${n}.${i}${r}`)}clear(){a.existsSync(this.assetsDir)&&a.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await h.flush()}}});export{y as a,V as b,q as c,u as d,tt as e,M as f,et as g,st as h,rt as i,A as j,it as k,nt as l,at as m,ct as n,ot as o,ht as p,_ as q,b as r,z as s,$ as t,vt as u,K as v};
@@ -1,14 +1,17 @@
1
- import { c as CreateBoltdocsAppOptions, B as BoltdocsConfig, C as ComponentRoute, O as OnThisPageProps, S as SandboxOptions } from '../types-Cp21DHI6.mjs';
2
- export { d as BoltdocsThemeConfig, L as LayoutProps, e as SandboxEmbedOptions, f as SandboxFile, g as SandboxFiles } from '../types-Cp21DHI6.mjs';
3
- export { u as useRoutes } from '../use-routes-8Iei6jTp.mjs';
4
- import * as React$1 from 'react';
5
- import React__default, { Component, ReactNode, ErrorInfo } from 'react';
1
+ import { b as CreateBoltdocsAppOptions, B as BoltdocsConfig } from '../types-j7jvWsJj.mjs';
2
+ export { c as BoltdocsThemeConfig, C as ComponentRoute, L as LayoutProps, S as SandboxEmbedOptions, d as SandboxFile, e as SandboxFiles, f as SandboxOptions } from '../types-j7jvWsJj.mjs';
3
+ export { u as useRoutes } from '../use-routes-DDL0_jkQ.mjs';
4
+ import React__default from 'react';
6
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
- export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, ButtonProps, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, CopyMarkdown, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from './components/mdx/index.mjs';
6
+ export { B as Breadcrumbs, E as ErrorBoundary, H as Head, L as Loading, N as Navbar, a as NotFound, O as OnThisPage, P as PageNav, b as ProgressBar, S as Sidebar } from '../loading-WuaQbsKb.mjs';
7
+ export { C as CopyMarkdown } from '../copy-markdown-CbS8X-qe.mjs';
8
+ export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from '../mdx/index.mjs';
9
+ export { defineSandbox, embedSandbox, openSandbox } from '../integrations/index.mjs';
10
+ export { B as ButtonProps } from '../link-DfBwCeZc.mjs';
8
11
  import 'vite';
9
12
  import 'class-variance-authority/types';
10
- import 'react-aria-components';
11
13
  import 'class-variance-authority';
14
+ import 'react-aria-components';
12
15
 
13
16
  /**
14
17
  * Creates and mounts the Boltdocs documentation app.
@@ -38,10 +41,10 @@ declare function createBoltdocsApp(options: CreateBoltdocsAppOptions): void;
38
41
  */
39
42
  declare function useConfig(): BoltdocsConfig;
40
43
 
41
- type Theme = 'light' | 'dark';
44
+ type Theme = 'light' | 'dark' | 'system';
42
45
  interface ThemeContextType {
43
46
  theme: Theme;
44
- toggleTheme: () => void;
47
+ resolvedTheme: 'light' | 'dark';
45
48
  setTheme: (theme: Theme) => void;
46
49
  }
47
50
  declare function useTheme(): ThemeContextType;
@@ -102,109 +105,4 @@ interface LayoutProps {
102
105
  */
103
106
  declare function DefaultLayout({ children }: LayoutProps): react_jsx_runtime.JSX.Element;
104
107
 
105
- declare function Navbar(): react_jsx_runtime.JSX.Element;
106
-
107
- declare function Sidebar({ routes, config, }: {
108
- routes: ComponentRoute[];
109
- config: BoltdocsConfig;
110
- }): react_jsx_runtime.JSX.Element;
111
-
112
- declare function OnThisPage({ headings: rawHeadings, editLink, communityHelp, filePath, }: OnThisPageProps): react_jsx_runtime.JSX.Element | null;
113
-
114
- interface HeadProps {
115
- siteTitle: string;
116
- siteDescription?: string;
117
- routes: Array<{
118
- path: string;
119
- title: string;
120
- description?: string;
121
- }>;
122
- }
123
- declare function Head({ siteTitle, siteDescription, routes }: HeadProps): null;
124
-
125
- declare function Breadcrumbs(): react_jsx_runtime.JSX.Element | null;
126
-
127
- /**
128
- * Component to display the previous and next page navigation buttons.
129
- */
130
- declare function PageNav(): react_jsx_runtime.JSX.Element | null;
131
-
132
- /**
133
- * A reading progress bar component that tracks the scroll position
134
- * within the Boltdocs content area.
135
- *
136
- * It utilizes react-aria-components for accessibility and is fixed
137
- * to the top of the viewport for a premium, non-intrusive UI experience.
138
- */
139
- declare function ProgressBar(): react_jsx_runtime.JSX.Element;
140
-
141
- interface Props {
142
- children?: ReactNode;
143
- fallback?: ReactNode;
144
- }
145
- interface State {
146
- hasError: boolean;
147
- error?: Error;
148
- }
149
- declare class ErrorBoundary extends Component<Props, State> {
150
- state: State;
151
- static getDerivedStateFromError(error: Error): State;
152
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
153
- render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
154
- }
155
-
156
- declare function NotFound(): react_jsx_runtime.JSX.Element;
157
-
158
- /**
159
- * A premium loading component that includes an SVG fill animation
160
- * and a synchronized progress indicator.
161
- *
162
- * It features a glassmorphism container and a Bolt-style SVG logo
163
- * with a dynamic fill effect.
164
- */
165
- declare function Loading(): react_jsx_runtime.JSX.Element;
166
-
167
- /**
168
- * Helper to define a sandbox and get a URL for the CodeSandbox Define API.
169
- * Uses the official SDK `getParameters` for proper LZ-string compression.
170
- */
171
- declare function defineSandbox(options: SandboxOptions): {
172
- parameters: string;
173
- url: string;
174
- options: SandboxOptions;
175
- };
176
- /**
177
- * CORE API: Open a CodeSandbox using a form POST to the Define API.
178
- *
179
- * Uses a hidden form + POST which avoids URL length limits and is the
180
- * recommended approach from CodeSandbox documentation. The SDK's
181
- * `getParameters` handles LZ-string compression internally.
182
- */
183
- declare function openSandbox(options: SandboxOptions): {
184
- parameters: string;
185
- url: string;
186
- options: SandboxOptions;
187
- };
188
- /**
189
- * Generate an embeddable iframe URL for a CodeSandbox.
190
- *
191
- * This gives you more control than `openSandbox` — you can embed the sandbox
192
- * inline on the page rather than opening a new tab. The returned URL can be
193
- * used as the `src` of an `<iframe>`.
194
- *
195
- * @example
196
- * ```tsx
197
- * const url = embedSandbox({
198
- * files: { "index.js": { content: "console.log('hello')" } },
199
- * embed: { view: "editor", theme: "dark" },
200
- * }).url;
201
- * // url → "https://codesandbox.io/api/v1/sandboxes/define?parameters=…&embed=1&view=editor&theme=dark"
202
- * ```
203
- */
204
- declare function embedSandbox(options: SandboxOptions): {
205
- parameters: string;
206
- url: string;
207
- options: SandboxOptions;
208
- };
209
-
210
- export { BoltdocsConfig, Breadcrumbs, ComponentRoute, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, ErrorBoundary, Head, Loading, Navbar, NotFound, OnThisPage, PageNav, ProgressBar, SandboxOptions, Sidebar, createBoltdocsApp, defineSandbox, embedSandbox, openSandbox, useConfig, useMdxComponents, useTheme };
108
+ export { BoltdocsConfig, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, createBoltdocsApp, useConfig, useMdxComponents, useTheme };
@@ -1,14 +1,17 @@
1
- import { c as CreateBoltdocsAppOptions, B as BoltdocsConfig, C as ComponentRoute, O as OnThisPageProps, S as SandboxOptions } from '../types-Cp21DHI6.js';
2
- export { d as BoltdocsThemeConfig, L as LayoutProps, e as SandboxEmbedOptions, f as SandboxFile, g as SandboxFiles } from '../types-Cp21DHI6.js';
3
- export { u as useRoutes } from '../use-routes-xLhumjbV.js';
4
- import * as React$1 from 'react';
5
- import React__default, { Component, ReactNode, ErrorInfo } from 'react';
1
+ import { b as CreateBoltdocsAppOptions, B as BoltdocsConfig } from '../types-j7jvWsJj.js';
2
+ export { c as BoltdocsThemeConfig, C as ComponentRoute, L as LayoutProps, S as SandboxEmbedOptions, d as SandboxFile, e as SandboxFiles, f as SandboxOptions } from '../types-j7jvWsJj.js';
3
+ export { u as useRoutes } from '../use-routes-Cd806kGw.js';
4
+ import React__default from 'react';
6
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
- export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, ButtonProps, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, CopyMarkdown, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from './components/mdx/index.js';
6
+ export { B as Breadcrumbs, E as ErrorBoundary, H as Head, L as Loading, N as Navbar, a as NotFound, O as OnThisPage, P as PageNav, b as ProgressBar, S as Sidebar } from '../loading-B7X5Wchs.js';
7
+ export { C as CopyMarkdown } from '../copy-markdown-C-90ixSe.js';
8
+ export { Admonition, AdmonitionProps, Badge, BadgeProps, Button, Card, CardProps, Cards, CardsProps, Caution, CodeBlock, ComponentPreview, ComponentPreviewProps, ComponentProps, ComponentPropsProps, Danger, Field, FieldProps, FileTree, FileTreeProps, Image, ImageProps, Important, InfoBox, Link, LinkProps, List, ListProps, Note, Tab, TabProps, Table, TableProps, Tabs, TabsProps, Tip, Video, Warning } from '../mdx/index.js';
9
+ export { defineSandbox, embedSandbox, openSandbox } from '../integrations/index.js';
10
+ export { B as ButtonProps } from '../link-DfBwCeZc.js';
8
11
  import 'vite';
9
12
  import 'class-variance-authority/types';
10
- import 'react-aria-components';
11
13
  import 'class-variance-authority';
14
+ import 'react-aria-components';
12
15
 
13
16
  /**
14
17
  * Creates and mounts the Boltdocs documentation app.
@@ -38,10 +41,10 @@ declare function createBoltdocsApp(options: CreateBoltdocsAppOptions): void;
38
41
  */
39
42
  declare function useConfig(): BoltdocsConfig;
40
43
 
41
- type Theme = 'light' | 'dark';
44
+ type Theme = 'light' | 'dark' | 'system';
42
45
  interface ThemeContextType {
43
46
  theme: Theme;
44
- toggleTheme: () => void;
47
+ resolvedTheme: 'light' | 'dark';
45
48
  setTheme: (theme: Theme) => void;
46
49
  }
47
50
  declare function useTheme(): ThemeContextType;
@@ -102,109 +105,4 @@ interface LayoutProps {
102
105
  */
103
106
  declare function DefaultLayout({ children }: LayoutProps): react_jsx_runtime.JSX.Element;
104
107
 
105
- declare function Navbar(): react_jsx_runtime.JSX.Element;
106
-
107
- declare function Sidebar({ routes, config, }: {
108
- routes: ComponentRoute[];
109
- config: BoltdocsConfig;
110
- }): react_jsx_runtime.JSX.Element;
111
-
112
- declare function OnThisPage({ headings: rawHeadings, editLink, communityHelp, filePath, }: OnThisPageProps): react_jsx_runtime.JSX.Element | null;
113
-
114
- interface HeadProps {
115
- siteTitle: string;
116
- siteDescription?: string;
117
- routes: Array<{
118
- path: string;
119
- title: string;
120
- description?: string;
121
- }>;
122
- }
123
- declare function Head({ siteTitle, siteDescription, routes }: HeadProps): null;
124
-
125
- declare function Breadcrumbs(): react_jsx_runtime.JSX.Element | null;
126
-
127
- /**
128
- * Component to display the previous and next page navigation buttons.
129
- */
130
- declare function PageNav(): react_jsx_runtime.JSX.Element | null;
131
-
132
- /**
133
- * A reading progress bar component that tracks the scroll position
134
- * within the Boltdocs content area.
135
- *
136
- * It utilizes react-aria-components for accessibility and is fixed
137
- * to the top of the viewport for a premium, non-intrusive UI experience.
138
- */
139
- declare function ProgressBar(): react_jsx_runtime.JSX.Element;
140
-
141
- interface Props {
142
- children?: ReactNode;
143
- fallback?: ReactNode;
144
- }
145
- interface State {
146
- hasError: boolean;
147
- error?: Error;
148
- }
149
- declare class ErrorBoundary extends Component<Props, State> {
150
- state: State;
151
- static getDerivedStateFromError(error: Error): State;
152
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
153
- render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
154
- }
155
-
156
- declare function NotFound(): react_jsx_runtime.JSX.Element;
157
-
158
- /**
159
- * A premium loading component that includes an SVG fill animation
160
- * and a synchronized progress indicator.
161
- *
162
- * It features a glassmorphism container and a Bolt-style SVG logo
163
- * with a dynamic fill effect.
164
- */
165
- declare function Loading(): react_jsx_runtime.JSX.Element;
166
-
167
- /**
168
- * Helper to define a sandbox and get a URL for the CodeSandbox Define API.
169
- * Uses the official SDK `getParameters` for proper LZ-string compression.
170
- */
171
- declare function defineSandbox(options: SandboxOptions): {
172
- parameters: string;
173
- url: string;
174
- options: SandboxOptions;
175
- };
176
- /**
177
- * CORE API: Open a CodeSandbox using a form POST to the Define API.
178
- *
179
- * Uses a hidden form + POST which avoids URL length limits and is the
180
- * recommended approach from CodeSandbox documentation. The SDK's
181
- * `getParameters` handles LZ-string compression internally.
182
- */
183
- declare function openSandbox(options: SandboxOptions): {
184
- parameters: string;
185
- url: string;
186
- options: SandboxOptions;
187
- };
188
- /**
189
- * Generate an embeddable iframe URL for a CodeSandbox.
190
- *
191
- * This gives you more control than `openSandbox` — you can embed the sandbox
192
- * inline on the page rather than opening a new tab. The returned URL can be
193
- * used as the `src` of an `<iframe>`.
194
- *
195
- * @example
196
- * ```tsx
197
- * const url = embedSandbox({
198
- * files: { "index.js": { content: "console.log('hello')" } },
199
- * embed: { view: "editor", theme: "dark" },
200
- * }).url;
201
- * // url → "https://codesandbox.io/api/v1/sandboxes/define?parameters=…&embed=1&view=editor&theme=dark"
202
- * ```
203
- */
204
- declare function embedSandbox(options: SandboxOptions): {
205
- parameters: string;
206
- url: string;
207
- options: SandboxOptions;
208
- };
209
-
210
- export { BoltdocsConfig, Breadcrumbs, ComponentRoute, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, ErrorBoundary, Head, Loading, Navbar, NotFound, OnThisPage, PageNav, ProgressBar, SandboxOptions, Sidebar, createBoltdocsApp, defineSandbox, embedSandbox, openSandbox, useConfig, useMdxComponents, useTheme };
108
+ export { BoltdocsConfig, CreateBoltdocsAppOptions, DefaultLayout, DocsLayout, createBoltdocsApp, useConfig, useMdxComponents, useTheme };