@publish.os/nextjs 0.0.1-alpha.2 → 0.0.1-alpha.4

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 (396) hide show
  1. package/README.md +3 -9
  2. package/dist/cache/tags.cjs +3 -0
  3. package/dist/cache/tags.d.cts +1 -0
  4. package/dist/cache/tags.d.ts +1 -0
  5. package/dist/cache/tags.js +3 -0
  6. package/dist/config.cjs +78 -0
  7. package/dist/config.d.cts +101 -0
  8. package/dist/config.d.ts +101 -0
  9. package/dist/config.js +48 -0
  10. package/dist/index.cjs +1043 -124
  11. package/dist/index.d.cts +11 -7
  12. package/dist/index.d.ts +11 -7
  13. package/dist/index.js +1031 -111
  14. package/dist/kernel/components/blocks/AgentActions.cjs +425 -0
  15. package/dist/kernel/components/blocks/AgentActions.d.cts +52 -0
  16. package/dist/kernel/components/blocks/AgentActions.d.ts +52 -0
  17. package/dist/kernel/components/blocks/AgentActions.js +429 -0
  18. package/dist/kernel/components/blocks/animated-icon-swap.cjs +101 -0
  19. package/dist/kernel/components/blocks/animated-icon-swap.d.cts +16 -0
  20. package/dist/kernel/components/blocks/animated-icon-swap.d.ts +16 -0
  21. package/dist/kernel/components/blocks/animated-icon-swap.js +74 -0
  22. package/dist/kernel/components/blocks/color-palette.cjs +413 -0
  23. package/dist/kernel/components/blocks/color-palette.d.cts +7 -0
  24. package/dist/kernel/components/blocks/color-palette.d.ts +7 -0
  25. package/dist/kernel/components/blocks/color-palette.js +407 -0
  26. package/dist/kernel/components/blocks/design-system-preview.cjs +592 -0
  27. package/dist/kernel/components/blocks/design-system-preview.d.cts +29 -0
  28. package/dist/kernel/components/blocks/design-system-preview.d.ts +29 -0
  29. package/dist/kernel/components/blocks/design-system-preview.js +655 -0
  30. package/dist/kernel/components/blocks/link-playground.cjs +816 -0
  31. package/dist/kernel/components/blocks/link-playground.d.cts +5 -0
  32. package/dist/kernel/components/blocks/link-playground.d.ts +5 -0
  33. package/dist/kernel/components/blocks/link-playground.js +792 -0
  34. package/dist/kernel/components/blocks/logo-block.cjs +156 -0
  35. package/dist/kernel/components/blocks/logo-block.d.cts +21 -0
  36. package/dist/kernel/components/blocks/logo-block.d.ts +21 -0
  37. package/dist/kernel/components/blocks/logo-block.js +129 -0
  38. package/dist/{components → kernel/components/blocks}/nav-breadcrumb.cjs +19 -38
  39. package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +11 -0
  40. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +11 -0
  41. package/dist/{components → kernel/components/blocks}/nav-breadcrumb.js +22 -30
  42. package/dist/kernel/components/blocks/navbar.cjs +154 -0
  43. package/dist/kernel/components/blocks/navbar.d.cts +16 -0
  44. package/dist/kernel/components/blocks/navbar.d.ts +16 -0
  45. package/dist/kernel/components/blocks/navbar.js +122 -0
  46. package/dist/kernel/components/blocks/navigation-progress-playground.cjs +735 -0
  47. package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +5 -0
  48. package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +5 -0
  49. package/dist/kernel/components/blocks/navigation-progress-playground.js +722 -0
  50. package/dist/kernel/components/blocks/navigation-progress.cjs +270 -0
  51. package/dist/kernel/components/blocks/navigation-progress.d.cts +16 -0
  52. package/dist/kernel/components/blocks/navigation-progress.d.ts +16 -0
  53. package/dist/kernel/components/blocks/navigation-progress.js +249 -0
  54. package/dist/kernel/components/blocks/next-prev.cjs +142 -0
  55. package/dist/kernel/components/blocks/next-prev.d.cts +11 -0
  56. package/dist/kernel/components/blocks/next-prev.d.ts +11 -0
  57. package/dist/kernel/components/blocks/next-prev.js +105 -0
  58. package/dist/{components → kernel/components/blocks}/page-list.cjs +7 -16
  59. package/dist/{components → kernel/components/blocks}/page-list.d.cts +1 -1
  60. package/dist/{components → kernel/components/blocks}/page-list.d.ts +1 -1
  61. package/dist/{components → kernel/components/blocks}/page-list.js +6 -5
  62. package/dist/kernel/components/blocks/search.cjs +717 -0
  63. package/dist/kernel/components/blocks/search.d.cts +77 -0
  64. package/dist/kernel/components/blocks/search.d.ts +77 -0
  65. package/dist/kernel/components/blocks/search.js +697 -0
  66. package/dist/kernel/components/blocks/sidebar-node.cjs +309 -0
  67. package/dist/kernel/components/blocks/sidebar-node.d.cts +8 -0
  68. package/dist/kernel/components/blocks/sidebar-node.d.ts +8 -0
  69. package/dist/kernel/components/blocks/sidebar-node.js +272 -0
  70. package/dist/kernel/components/blocks/sidebar.cjs +317 -0
  71. package/dist/kernel/components/blocks/sidebar.d.cts +33 -0
  72. package/dist/kernel/components/blocks/sidebar.d.ts +33 -0
  73. package/dist/kernel/components/blocks/sidebar.js +302 -0
  74. package/dist/kernel/components/blocks/theme-toggle.cjs +31 -0
  75. package/dist/kernel/components/blocks/theme-toggle.d.cts +6 -0
  76. package/dist/kernel/components/blocks/theme-toggle.d.ts +6 -0
  77. package/dist/kernel/components/blocks/theme-toggle.js +7 -0
  78. package/dist/kernel/components/blocks/toc.cjs +356 -0
  79. package/dist/kernel/components/blocks/toc.d.cts +10 -0
  80. package/dist/kernel/components/blocks/toc.d.ts +10 -0
  81. package/dist/kernel/components/blocks/toc.js +330 -0
  82. package/dist/kernel/components/mdx/components/blockquote.cjs +66 -0
  83. package/dist/kernel/components/mdx/components/blockquote.d.cts +6 -0
  84. package/dist/kernel/components/mdx/components/blockquote.d.ts +6 -0
  85. package/dist/kernel/components/mdx/components/blockquote.js +39 -0
  86. package/dist/kernel/components/mdx/components/callout.cjs +137 -0
  87. package/dist/kernel/components/mdx/components/callout.d.cts +18 -0
  88. package/dist/kernel/components/mdx/components/callout.d.ts +18 -0
  89. package/dist/kernel/components/mdx/components/callout.js +109 -0
  90. package/dist/kernel/components/mdx/components/code-block.cjs +39 -0
  91. package/dist/kernel/components/mdx/components/code-block.d.cts +9 -0
  92. package/dist/kernel/components/mdx/components/code-block.d.ts +9 -0
  93. package/dist/kernel/components/mdx/components/code-block.js +14 -0
  94. package/dist/kernel/components/mdx/components/figure-caption.cjs +63 -0
  95. package/dist/kernel/components/mdx/components/figure-caption.d.cts +6 -0
  96. package/dist/kernel/components/mdx/components/figure-caption.d.ts +6 -0
  97. package/dist/kernel/components/mdx/components/figure-caption.js +36 -0
  98. package/dist/kernel/components/mdx/components/figure.cjs +78 -0
  99. package/dist/kernel/components/mdx/components/figure.d.cts +10 -0
  100. package/dist/kernel/components/mdx/components/figure.d.ts +10 -0
  101. package/dist/kernel/components/mdx/components/figure.js +53 -0
  102. package/dist/kernel/components/mdx/components/footnotes.cjs +66 -0
  103. package/dist/kernel/components/mdx/components/footnotes.d.cts +6 -0
  104. package/dist/kernel/components/mdx/components/footnotes.d.ts +6 -0
  105. package/dist/kernel/components/mdx/components/footnotes.js +39 -0
  106. package/dist/kernel/components/mdx/components/heading-copy-link.cjs +108 -0
  107. package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +23 -0
  108. package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +23 -0
  109. package/dist/kernel/components/mdx/components/heading-copy-link.js +81 -0
  110. package/dist/kernel/components/mdx/components/heading.cjs +166 -0
  111. package/dist/kernel/components/mdx/components/heading.d.cts +8 -0
  112. package/dist/kernel/components/mdx/components/heading.d.ts +8 -0
  113. package/dist/kernel/components/mdx/components/heading.js +144 -0
  114. package/dist/kernel/components/mdx/components/hr.cjs +34 -0
  115. package/dist/kernel/components/mdx/components/hr.d.cts +9 -0
  116. package/dist/kernel/components/mdx/components/hr.d.ts +9 -0
  117. package/dist/kernel/components/mdx/components/hr.js +9 -0
  118. package/dist/kernel/components/mdx/components/image-zoom.cjs +49 -0
  119. package/dist/kernel/components/mdx/components/image-zoom.d.cts +10 -0
  120. package/dist/kernel/components/mdx/components/image-zoom.d.ts +10 -0
  121. package/dist/kernel/components/mdx/components/image-zoom.js +15 -0
  122. package/dist/kernel/components/mdx/components/image.cjs +192 -0
  123. package/dist/kernel/components/mdx/components/image.d.cts +21 -0
  124. package/dist/kernel/components/mdx/components/image.d.ts +21 -0
  125. package/dist/kernel/components/mdx/components/image.js +157 -0
  126. package/dist/kernel/components/mdx/components/inline-code.cjs +66 -0
  127. package/dist/kernel/components/mdx/components/inline-code.d.cts +6 -0
  128. package/dist/kernel/components/mdx/components/inline-code.d.ts +6 -0
  129. package/dist/kernel/components/mdx/components/inline-code.js +39 -0
  130. package/dist/kernel/components/mdx/components/kbd.cjs +34 -0
  131. package/dist/kernel/components/mdx/components/kbd.d.cts +10 -0
  132. package/dist/kernel/components/mdx/components/kbd.d.ts +10 -0
  133. package/dist/kernel/components/mdx/components/kbd.js +9 -0
  134. package/dist/{components/providers.cjs → kernel/components/mdx/components/link.cjs} +20 -15
  135. package/dist/kernel/components/mdx/components/link.d.cts +11 -0
  136. package/dist/kernel/components/mdx/components/link.d.ts +11 -0
  137. package/dist/kernel/components/mdx/components/link.js +26 -0
  138. package/dist/kernel/components/mdx/components/paragraph.cjs +87 -0
  139. package/dist/kernel/components/mdx/components/paragraph.d.cts +5 -0
  140. package/dist/kernel/components/mdx/components/paragraph.d.ts +5 -0
  141. package/dist/kernel/components/mdx/components/paragraph.js +60 -0
  142. package/dist/kernel/components/mdx/components/pre.cjs +66 -0
  143. package/dist/kernel/components/mdx/components/pre.d.cts +6 -0
  144. package/dist/kernel/components/mdx/components/pre.d.ts +6 -0
  145. package/dist/kernel/components/mdx/components/pre.js +39 -0
  146. package/dist/kernel/components/mdx/components/strikethrough.cjs +63 -0
  147. package/dist/kernel/components/mdx/components/strikethrough.d.cts +6 -0
  148. package/dist/kernel/components/mdx/components/strikethrough.d.ts +6 -0
  149. package/dist/kernel/components/mdx/components/strikethrough.js +36 -0
  150. package/dist/kernel/components/mdx/components/table.cjs +59 -0
  151. package/dist/kernel/components/mdx/components/table.d.cts +10 -0
  152. package/dist/kernel/components/mdx/components/table.d.ts +10 -0
  153. package/dist/kernel/components/mdx/components/table.js +36 -0
  154. package/dist/kernel/components/mdx/components/task-list.cjs +88 -0
  155. package/dist/kernel/components/mdx/components/task-list.d.cts +8 -0
  156. package/dist/kernel/components/mdx/components/task-list.d.ts +8 -0
  157. package/dist/kernel/components/mdx/components/task-list.js +60 -0
  158. package/dist/kernel/components/mdx/components/video-player.cjs +173 -0
  159. package/dist/kernel/components/mdx/components/video-player.d.cts +18 -0
  160. package/dist/kernel/components/mdx/components/video-player.d.ts +18 -0
  161. package/dist/kernel/components/mdx/components/video-player.js +147 -0
  162. package/dist/kernel/components/mdx/components/video.cjs +185 -0
  163. package/dist/kernel/components/mdx/components/video.d.cts +15 -0
  164. package/dist/kernel/components/mdx/components/video.d.ts +15 -0
  165. package/dist/kernel/components/mdx/components/video.js +162 -0
  166. package/dist/kernel/components/mdx/error-boundary.cjs +62 -0
  167. package/dist/{mdx → kernel/components/mdx}/error-boundary.d.cts +3 -8
  168. package/dist/{mdx → kernel/components/mdx}/error-boundary.d.ts +3 -8
  169. package/dist/kernel/components/mdx/error-boundary.js +38 -0
  170. package/dist/{mdx → kernel/components/mdx}/error-fallback.cjs +8 -8
  171. package/dist/{mdx → kernel/components/mdx}/error-fallback.js +8 -8
  172. package/dist/kernel/components/mdx/mdx.cjs +141 -0
  173. package/dist/kernel/components/mdx/mdx.d.cts +22 -0
  174. package/dist/kernel/components/mdx/mdx.d.ts +22 -0
  175. package/dist/kernel/components/mdx/mdx.js +109 -0
  176. package/dist/kernel/components/mdx/rehype-heading-ids.cjs +113 -0
  177. package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +10 -0
  178. package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +10 -0
  179. package/dist/kernel/components/mdx/rehype-heading-ids.js +86 -0
  180. package/dist/kernel/components/mdx/types.cjs +18 -0
  181. package/dist/kernel/components/mdx/types.d.cts +18 -0
  182. package/dist/kernel/components/mdx/types.d.ts +18 -0
  183. package/dist/kernel/components/mdx/types.js +0 -0
  184. package/dist/kernel/components/ui/accordion.cjs +104 -0
  185. package/dist/kernel/components/ui/accordion.d.cts +16 -0
  186. package/dist/kernel/components/ui/accordion.d.ts +16 -0
  187. package/dist/kernel/components/ui/accordion.js +76 -0
  188. package/dist/kernel/components/ui/badge.cjs +75 -0
  189. package/dist/kernel/components/ui/badge.d.cts +12 -0
  190. package/dist/kernel/components/ui/badge.d.ts +12 -0
  191. package/dist/kernel/components/ui/badge.js +47 -0
  192. package/dist/kernel/components/ui/breadcrumb-trail.cjs +238 -0
  193. package/dist/kernel/components/ui/breadcrumb-trail.d.cts +13 -0
  194. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +13 -0
  195. package/dist/kernel/components/ui/breadcrumb-trail.js +225 -0
  196. package/dist/kernel/components/ui/breadcrumb.cjs +399 -0
  197. package/dist/kernel/components/ui/breadcrumb.d.cts +52 -0
  198. package/dist/kernel/components/ui/breadcrumb.d.ts +52 -0
  199. package/dist/kernel/components/ui/breadcrumb.js +365 -0
  200. package/dist/kernel/components/ui/button-group.cjs +144 -0
  201. package/dist/kernel/components/ui/button-group.d.cts +19 -0
  202. package/dist/kernel/components/ui/button-group.d.ts +19 -0
  203. package/dist/kernel/components/ui/button-group.js +116 -0
  204. package/dist/kernel/components/ui/button.cjs +147 -0
  205. package/dist/kernel/components/ui/button.d.cts +23 -0
  206. package/dist/kernel/components/ui/button.d.ts +23 -0
  207. package/dist/kernel/components/ui/button.js +121 -0
  208. package/dist/kernel/components/ui/card.cjs +133 -0
  209. package/dist/kernel/components/ui/card.d.cts +17 -0
  210. package/dist/kernel/components/ui/card.d.ts +17 -0
  211. package/dist/kernel/components/ui/card.js +101 -0
  212. package/dist/kernel/components/ui/dialog.cjs +149 -0
  213. package/dist/kernel/components/ui/dialog.d.cts +22 -0
  214. package/dist/kernel/components/ui/dialog.d.ts +22 -0
  215. package/dist/kernel/components/ui/dialog.js +118 -0
  216. package/dist/kernel/components/ui/drawer.cjs +163 -0
  217. package/dist/kernel/components/ui/drawer.d.cts +24 -0
  218. package/dist/kernel/components/ui/drawer.d.ts +24 -0
  219. package/dist/kernel/components/ui/drawer.js +131 -0
  220. package/dist/kernel/components/ui/input.cjs +96 -0
  221. package/dist/kernel/components/ui/input.d.cts +18 -0
  222. package/dist/kernel/components/ui/input.d.ts +18 -0
  223. package/dist/kernel/components/ui/input.js +70 -0
  224. package/dist/kernel/components/ui/kbd.cjs +105 -0
  225. package/dist/kernel/components/ui/kbd.d.cts +13 -0
  226. package/dist/kernel/components/ui/kbd.d.ts +13 -0
  227. package/dist/kernel/components/ui/kbd.js +77 -0
  228. package/dist/kernel/components/ui/link.cjs +253 -0
  229. package/dist/kernel/components/ui/link.d.cts +31 -0
  230. package/dist/kernel/components/ui/link.d.ts +31 -0
  231. package/dist/kernel/components/ui/link.js +217 -0
  232. package/dist/kernel/components/ui/menu.cjs +301 -0
  233. package/dist/kernel/components/ui/menu.d.cts +70 -0
  234. package/dist/kernel/components/ui/menu.d.ts +70 -0
  235. package/dist/kernel/components/ui/menu.js +256 -0
  236. package/dist/kernel/components/ui/meta-key.cjs +34 -0
  237. package/dist/kernel/components/ui/meta-key.d.cts +12 -0
  238. package/dist/kernel/components/ui/meta-key.d.ts +12 -0
  239. package/dist/kernel/components/ui/meta-key.js +9 -0
  240. package/dist/kernel/components/ui/navigation-menu.cjs +253 -0
  241. package/dist/kernel/components/ui/navigation-menu.d.cts +47 -0
  242. package/dist/kernel/components/ui/navigation-menu.d.ts +47 -0
  243. package/dist/kernel/components/ui/navigation-menu.js +216 -0
  244. package/dist/kernel/components/ui/popover.cjs +168 -0
  245. package/dist/kernel/components/ui/popover.d.cts +24 -0
  246. package/dist/kernel/components/ui/popover.d.ts +24 -0
  247. package/dist/kernel/components/ui/popover.js +136 -0
  248. package/dist/kernel/components/ui/progress.cjs +112 -0
  249. package/dist/kernel/components/ui/progress.d.cts +16 -0
  250. package/dist/kernel/components/ui/progress.d.ts +16 -0
  251. package/dist/kernel/components/ui/progress.js +84 -0
  252. package/dist/kernel/components/ui/scroll-area.cjs +413 -0
  253. package/dist/kernel/components/ui/scroll-area.d.cts +58 -0
  254. package/dist/kernel/components/ui/scroll-area.d.ts +58 -0
  255. package/dist/kernel/components/ui/scroll-area.js +390 -0
  256. package/dist/kernel/components/ui/select.cjs +244 -0
  257. package/dist/kernel/components/ui/select.d.cts +40 -0
  258. package/dist/kernel/components/ui/select.d.ts +40 -0
  259. package/dist/kernel/components/ui/select.js +205 -0
  260. package/dist/kernel/components/ui/separator.cjs +73 -0
  261. package/dist/kernel/components/ui/separator.d.cts +8 -0
  262. package/dist/kernel/components/ui/separator.d.ts +8 -0
  263. package/dist/kernel/components/ui/separator.js +48 -0
  264. package/dist/kernel/components/ui/table.cjs +131 -0
  265. package/dist/kernel/components/ui/table.d.cts +11 -0
  266. package/dist/kernel/components/ui/table.d.ts +11 -0
  267. package/dist/kernel/components/ui/table.js +99 -0
  268. package/dist/kernel/components/ui/tabs.cjs +450 -0
  269. package/dist/kernel/components/ui/tabs.d.cts +82 -0
  270. package/dist/kernel/components/ui/tabs.d.ts +82 -0
  271. package/dist/kernel/components/ui/tabs.js +409 -0
  272. package/dist/kernel/components/ui/text.cjs +184 -0
  273. package/dist/kernel/components/ui/text.d.cts +17 -0
  274. package/dist/kernel/components/ui/text.d.ts +17 -0
  275. package/dist/kernel/components/ui/text.js +156 -0
  276. package/dist/kernel/components/ui/theme-toggle.cjs +108 -0
  277. package/dist/kernel/components/ui/theme-toggle.d.cts +10 -0
  278. package/dist/kernel/components/ui/theme-toggle.d.ts +10 -0
  279. package/dist/kernel/components/ui/theme-toggle.js +84 -0
  280. package/dist/kernel/components/ui/toast.cjs +154 -0
  281. package/dist/kernel/components/ui/toast.d.cts +26 -0
  282. package/dist/kernel/components/ui/toast.d.ts +26 -0
  283. package/dist/kernel/components/ui/toast.js +120 -0
  284. package/dist/kernel/components/ui/tooltip.cjs +127 -0
  285. package/dist/kernel/components/ui/tooltip.d.cts +20 -0
  286. package/dist/kernel/components/ui/tooltip.d.ts +20 -0
  287. package/dist/kernel/components/ui/tooltip.js +97 -0
  288. package/dist/kernel/defaults.registry.cjs +541 -0
  289. package/dist/kernel/defaults.registry.d.cts +469 -0
  290. package/dist/kernel/defaults.registry.d.ts +469 -0
  291. package/dist/kernel/defaults.registry.js +516 -0
  292. package/dist/kernel/routes/agent/markdown.cjs +202 -0
  293. package/dist/kernel/routes/agent/markdown.d.cts +58 -0
  294. package/dist/kernel/routes/agent/markdown.d.ts +58 -0
  295. package/dist/kernel/routes/agent/markdown.js +174 -0
  296. package/dist/{layouts → kernel/routes/layouts}/group.cjs +39 -15
  297. package/dist/kernel/routes/layouts/group.d.cts +20 -0
  298. package/dist/kernel/routes/layouts/group.d.ts +20 -0
  299. package/dist/{layouts → kernel/routes/layouts}/group.js +39 -15
  300. package/dist/kernel/routes/metadata/feed.cjs +293 -0
  301. package/dist/kernel/routes/metadata/feed.d.cts +20 -0
  302. package/dist/kernel/routes/metadata/feed.d.ts +20 -0
  303. package/dist/kernel/routes/metadata/feed.js +265 -0
  304. package/dist/kernel/routes/metadata/llms.cjs +239 -0
  305. package/dist/kernel/routes/metadata/llms.d.cts +26 -0
  306. package/dist/kernel/routes/metadata/llms.d.ts +26 -0
  307. package/dist/kernel/routes/metadata/llms.js +211 -0
  308. package/dist/kernel/routes/metadata/og-image.cjs +630 -0
  309. package/dist/kernel/routes/metadata/og-image.d.cts +62 -0
  310. package/dist/kernel/routes/metadata/og-image.d.ts +62 -0
  311. package/dist/kernel/routes/metadata/og-image.js +604 -0
  312. package/dist/{routes → kernel/routes/metadata}/robots.cjs +59 -5
  313. package/dist/{routes → kernel/routes/metadata}/robots.d.cts +2 -1
  314. package/dist/{routes → kernel/routes/metadata}/robots.d.ts +2 -1
  315. package/dist/kernel/routes/metadata/robots.js +123 -0
  316. package/dist/kernel/routes/metadata/sitemap.cjs +192 -0
  317. package/dist/kernel/routes/metadata/sitemap.d.cts +8 -0
  318. package/dist/kernel/routes/metadata/sitemap.d.ts +8 -0
  319. package/dist/kernel/routes/metadata/sitemap.js +166 -0
  320. package/dist/{pages → kernel/routes/pages}/group.cjs +107 -6
  321. package/dist/{pages → kernel/routes/pages}/group.d.cts +4 -2
  322. package/dist/{pages → kernel/routes/pages}/group.d.ts +4 -2
  323. package/dist/{pages → kernel/routes/pages}/group.js +107 -6
  324. package/dist/kernel/routes/pages/leaf.cjs +421 -0
  325. package/dist/kernel/routes/pages/leaf.d.cts +36 -0
  326. package/dist/kernel/routes/pages/leaf.d.ts +36 -0
  327. package/dist/kernel/routes/pages/leaf.js +397 -0
  328. package/dist/{pages → kernel/routes/pages}/root.cjs +108 -6
  329. package/dist/{pages → kernel/routes/pages}/root.d.cts +4 -2
  330. package/dist/{pages → kernel/routes/pages}/root.d.ts +4 -2
  331. package/dist/kernel/routes/pages/root.js +203 -0
  332. package/dist/keyboard-shortcuts.cjs +345 -0
  333. package/dist/keyboard-shortcuts.d.cts +34 -0
  334. package/dist/keyboard-shortcuts.d.ts +34 -0
  335. package/dist/keyboard-shortcuts.js +326 -0
  336. package/dist/resolvers/manifest-resolver.cjs +7 -3
  337. package/dist/resolvers/manifest-resolver.d.cts +2 -2
  338. package/dist/resolvers/manifest-resolver.d.ts +2 -2
  339. package/dist/resolvers/manifest-resolver.js +7 -3
  340. package/dist/search.cjs +411 -0
  341. package/dist/search.d.cts +20 -0
  342. package/dist/search.d.ts +20 -0
  343. package/dist/search.js +393 -0
  344. package/dist/types.cjs +12 -0
  345. package/dist/types.d.cts +132 -7
  346. package/dist/types.d.ts +132 -7
  347. package/dist/types.js +5 -0
  348. package/dist/utils/heading-ids.cjs +119 -0
  349. package/dist/utils/heading-ids.d.cts +15 -0
  350. package/dist/utils/heading-ids.d.ts +15 -0
  351. package/dist/utils/heading-ids.js +90 -0
  352. package/package.json +59 -38
  353. package/release/package.json +23 -0
  354. package/release/pnpm-lock.yaml +1192 -0
  355. package/release/release.json +39 -0
  356. package/dist/components/color-palette.cjs +0 -408
  357. package/dist/components/color-palette.d.cts +0 -5
  358. package/dist/components/color-palette.d.ts +0 -5
  359. package/dist/components/color-palette.js +0 -388
  360. package/dist/components/nav-breadcrumb.d.cts +0 -9
  361. package/dist/components/nav-breadcrumb.d.ts +0 -9
  362. package/dist/components/providers.d.cts +0 -8
  363. package/dist/components/providers.d.ts +0 -8
  364. package/dist/components/providers.js +0 -20
  365. package/dist/components/site-header.cjs +0 -302
  366. package/dist/components/site-header.d.cts +0 -12
  367. package/dist/components/site-header.d.ts +0 -12
  368. package/dist/components/site-header.js +0 -268
  369. package/dist/components/theme-toggle.cjs +0 -147
  370. package/dist/components/theme-toggle.d.cts +0 -5
  371. package/dist/components/theme-toggle.d.ts +0 -5
  372. package/dist/components/theme-toggle.js +0 -123
  373. package/dist/layouts/group.d.cts +0 -15
  374. package/dist/layouts/group.d.ts +0 -15
  375. package/dist/mdx/error-boundary.cjs +0 -94
  376. package/dist/mdx/error-boundary.js +0 -70
  377. package/dist/mdx/mdx.cjs +0 -182
  378. package/dist/mdx/mdx.d.cts +0 -10
  379. package/dist/mdx/mdx.d.ts +0 -10
  380. package/dist/mdx/mdx.js +0 -147
  381. package/dist/pages/leaf.cjs +0 -203
  382. package/dist/pages/leaf.d.cts +0 -23
  383. package/dist/pages/leaf.d.ts +0 -23
  384. package/dist/pages/leaf.js +0 -176
  385. package/dist/pages/root.js +0 -101
  386. package/dist/routes/llms.cjs +0 -101
  387. package/dist/routes/llms.d.cts +0 -7
  388. package/dist/routes/llms.d.ts +0 -7
  389. package/dist/routes/llms.js +0 -76
  390. package/dist/routes/robots.js +0 -69
  391. package/dist/routes/sitemap.cjs +0 -108
  392. package/dist/routes/sitemap.d.cts +0 -5
  393. package/dist/routes/sitemap.d.ts +0 -5
  394. package/dist/routes/sitemap.js +0 -83
  395. /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.cts +0 -0
  396. /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.ts +0 -0
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/kernel/components/blocks/sidebar.tsx
22
+ var sidebar_exports = {};
23
+ __export(sidebar_exports, {
24
+ Sidebar: () => Sidebar
25
+ });
26
+ module.exports = __toCommonJS(sidebar_exports);
27
+ var import_sidebar_node = require("./sidebar-node.js");
28
+ var import_scroll_area = require("../ui/scroll-area.js");
29
+
30
+ // src/utils/cn.ts
31
+ var import_clsx = require("clsx");
32
+ var import_tailwind_merge = require("tailwind-merge");
33
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
34
+ extend: {
35
+ classGroups: {
36
+ z: [
37
+ "z-content",
38
+ "z-nav",
39
+ "z-overlay",
40
+ "z-modal",
41
+ "z-search",
42
+ "z-toast",
43
+ "z-progress"
44
+ ]
45
+ }
46
+ }
47
+ });
48
+ function cn(...inputs) {
49
+ return twMerge((0, import_clsx.clsx)(inputs));
50
+ }
51
+
52
+ // src/kernel/components/blocks/sidebar.tsx
53
+ var import_navigation = require("next/navigation");
54
+ var import_react = require("react");
55
+ var import_jsx_runtime = require("react/jsx-runtime");
56
+ function normalizePath(path) {
57
+ if (!path) return "";
58
+ const [withoutQuery = ""] = path.split(/[?#]/);
59
+ if (withoutQuery === "/") return "/";
60
+ return withoutQuery.replace(/\/+$/g, "");
61
+ }
62
+ function isExternalHref(href) {
63
+ return /^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith("//");
64
+ }
65
+ function nodeHref(node) {
66
+ if (node.type === "link") return node.href;
67
+ if ("path" in node && typeof node.path === "string") return node.path;
68
+ return void 0;
69
+ }
70
+ function nodeChildren(node) {
71
+ return Array.isArray(node.children) ? node.children : [];
72
+ }
73
+ function nodeKey(node, parentKey) {
74
+ const prefix = parentKey ? `${parentKey}/` : "";
75
+ if (node.type === "page") return `${prefix}page:${node.fileID}`;
76
+ if (node.type === "link") return `${prefix}link:${node.id}`;
77
+ return `${prefix}${node.type}:${node.id}`;
78
+ }
79
+ function isActivePath(path, currentPath) {
80
+ if (!path || isExternalHref(path)) return false;
81
+ const normalizedPath = normalizePath(path);
82
+ const normalizedCurrentPath = normalizePath(currentPath);
83
+ if (!normalizedPath) return false;
84
+ return normalizedCurrentPath === normalizedPath || normalizedCurrentPath.startsWith(`${normalizedPath}/`);
85
+ }
86
+ function isExactActivePath(path, currentPath) {
87
+ if (!path || isExternalHref(path)) return false;
88
+ return normalizePath(path) === normalizePath(currentPath);
89
+ }
90
+ function createActiveIndex({
91
+ currentPath,
92
+ tree
93
+ }) {
94
+ const activeIndex = /* @__PURE__ */ new Map();
95
+ function visit(node) {
96
+ const href = nodeHref(node);
97
+ const exactActive = isExactActivePath(href, currentPath);
98
+ const pathActive = node.type === "page" && isActivePath(href, currentPath);
99
+ const childActive = nodeChildren(node).some(visit);
100
+ const activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
101
+ activeIndex.set(node, {
102
+ activeState,
103
+ initiallyExpanded: exactActive || pathActive || childActive
104
+ });
105
+ return exactActive || pathActive || childActive;
106
+ }
107
+ for (const node of tree) {
108
+ visit(node);
109
+ }
110
+ return activeIndex;
111
+ }
112
+ function safeIdPart(value) {
113
+ return value.replace(/[^a-zA-Z0-9-]/g, "-");
114
+ }
115
+ function nodeContentId({
116
+ instanceId,
117
+ node
118
+ }) {
119
+ const key = "path" in node && node.path ? node.path : node.type === "page" ? node.fileID : node.id;
120
+ return `sidebar-${safeIdPart(instanceId)}-${safeIdPart(key)}`;
121
+ }
122
+ function clampDepth(depth) {
123
+ return Math.min(depth, 12);
124
+ }
125
+ function ExpandableChildren({
126
+ activeIndex,
127
+ activeItemRef,
128
+ contentId,
129
+ currentPath,
130
+ depth,
131
+ expanded,
132
+ instanceId,
133
+ nodes,
134
+ parentExpanded,
135
+ renderChildren
136
+ }) {
137
+ const childFocusable = parentExpanded && expanded;
138
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
139
+ "div",
140
+ {
141
+ "aria-hidden": !expanded,
142
+ className: cn(
143
+ "grid overflow-hidden transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",
144
+ expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
145
+ ),
146
+ "data-state": expanded ? "open" : "closed",
147
+ id: contentId,
148
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px py-0.5", children: renderChildren ? nodes.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ SidebarTreeItem,
150
+ {
151
+ activeIndex,
152
+ activeItemRef,
153
+ currentPath,
154
+ depth: clampDepth(depth + 1),
155
+ instanceId,
156
+ itemKey: nodeKey(child, contentId),
157
+ node: child,
158
+ parentExpanded: childFocusable
159
+ },
160
+ nodeKey(child, contentId)
161
+ )) : null }) })
162
+ }
163
+ );
164
+ }
165
+ var SidebarTreeItem = (0, import_react.memo)(function SidebarTreeItem2({
166
+ activeIndex,
167
+ activeItemRef,
168
+ currentPath,
169
+ depth,
170
+ instanceId,
171
+ itemKey,
172
+ node,
173
+ parentExpanded
174
+ }) {
175
+ const nodes = nodeChildren(node);
176
+ const href = nodeHref(node);
177
+ const activeInfo = activeIndex.get(node);
178
+ const activeState = activeInfo?.activeState;
179
+ const initiallyExpanded = Boolean(activeInfo?.initiallyExpanded);
180
+ const isExpandable = nodes.length > 0 && (node.type === "folder" || node.type === "page");
181
+ const [expanded, setExpanded] = (0, import_react.useState)(initiallyExpanded);
182
+ const [renderChildren, setRenderChildren] = (0, import_react.useState)(initiallyExpanded);
183
+ const interactedRef = (0, import_react.useRef)(false);
184
+ const lastPathRef = (0, import_react.useRef)(normalizePath(currentPath));
185
+ const contentId = nodeContentId({ instanceId, node });
186
+ (0, import_react.useEffect)(() => {
187
+ const normalizedCurrentPath = normalizePath(currentPath);
188
+ const pathChanged = lastPathRef.current !== normalizedCurrentPath;
189
+ if (pathChanged) {
190
+ interactedRef.current = false;
191
+ lastPathRef.current = normalizedCurrentPath;
192
+ }
193
+ if (initiallyExpanded && !expanded && !interactedRef.current) {
194
+ setRenderChildren(true);
195
+ (0, import_react.startTransition)(() => setExpanded(true));
196
+ }
197
+ }, [currentPath, expanded, initiallyExpanded]);
198
+ const toggleExpanded = (0, import_react.useCallback)(() => {
199
+ interactedRef.current = true;
200
+ setRenderChildren(true);
201
+ setExpanded((value) => !value);
202
+ }, []);
203
+ const expandOnNavigate = (0, import_react.useCallback)(() => {
204
+ interactedRef.current = true;
205
+ setRenderChildren(true);
206
+ setExpanded(true);
207
+ }, []);
208
+ const pageWithChildrenLinkClick = node.type === "page" && nodes.length > 0 ? expandOnNavigate : void 0;
209
+ const children = isExpandable && nodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
+ ExpandableChildren,
211
+ {
212
+ activeIndex,
213
+ activeItemRef,
214
+ contentId,
215
+ currentPath,
216
+ depth,
217
+ expanded,
218
+ instanceId,
219
+ nodes,
220
+ parentExpanded,
221
+ renderChildren
222
+ }
223
+ ) : node.type === "section" && nodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
224
+ SidebarTreeItem2,
225
+ {
226
+ activeIndex,
227
+ activeItemRef,
228
+ currentPath,
229
+ depth,
230
+ instanceId,
231
+ itemKey: nodeKey(child, itemKey),
232
+ node: child,
233
+ parentExpanded
234
+ },
235
+ nodeKey(child, itemKey)
236
+ )) }) : null;
237
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
238
+ import_sidebar_node.SidebarNode,
239
+ {
240
+ activeState,
241
+ activeItemRef: activeState === "path-active" ? activeItemRef : void 0,
242
+ contentId: isExpandable ? contentId : void 0,
243
+ depth,
244
+ expanded: isExpandable ? expanded : void 0,
245
+ href,
246
+ isExpandable,
247
+ node,
248
+ onLinkClick: pageWithChildrenLinkClick,
249
+ onToggle: isExpandable ? toggleExpanded : void 0,
250
+ parentExpanded,
251
+ title: node.title,
252
+ children
253
+ }
254
+ );
255
+ });
256
+ function Sidebar({ className, currentPath, title, tree }) {
257
+ const pathname = (0, import_navigation.usePathname)();
258
+ const resolvedCurrentPath = pathname ?? currentPath ?? "";
259
+ const instanceId = (0, import_react.useId)();
260
+ const activeItemRef = (0, import_react.useRef)(null);
261
+ const activeIndex = (0, import_react.useMemo)(
262
+ () => createActiveIndex({ currentPath: resolvedCurrentPath, tree }),
263
+ [resolvedCurrentPath, tree]
264
+ );
265
+ (0, import_react.useEffect)(() => {
266
+ const scrollPath = resolvedCurrentPath;
267
+ const frame = window.requestAnimationFrame(() => {
268
+ if (!scrollPath) return;
269
+ activeItemRef.current?.scrollIntoView({
270
+ block: "nearest",
271
+ inline: "nearest"
272
+ });
273
+ });
274
+ return () => window.cancelAnimationFrame(frame);
275
+ }, [resolvedCurrentPath]);
276
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
277
+ "nav",
278
+ {
279
+ "aria-label": "Documentation navigation",
280
+ className: cn(
281
+ "flex h-full min-h-0 w-(--layout-sidebar-width) min-w-(--layout-sidebar-width) max-w-(--layout-sidebar-width) flex-col overflow-hidden pb-4",
282
+ className
283
+ ),
284
+ children: [
285
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 px-5 pb-2 pt-5 text-xs font-semibold uppercase tracking-wide text-foreground-3", children: title }) : null,
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
287
+ import_scroll_area.ScrollArea,
288
+ {
289
+ className: "min-h-0 flex-1",
290
+ corner: true,
291
+ mask: { height: 24 },
292
+ scrollbarClassName: "opacity-0 transition-opacity data-[hovering]:opacity-100 data-[scrolling]:opacity-100",
293
+ variant: "gradient",
294
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px px-2 py-3", children: tree.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
295
+ SidebarTreeItem,
296
+ {
297
+ activeIndex,
298
+ activeItemRef,
299
+ currentPath: resolvedCurrentPath,
300
+ depth: 0,
301
+ instanceId,
302
+ itemKey: nodeKey(node, ""),
303
+ node,
304
+ parentExpanded: true
305
+ },
306
+ nodeKey(node, "")
307
+ )) })
308
+ }
309
+ )
310
+ ]
311
+ }
312
+ );
313
+ }
314
+ // Annotate the CommonJS export names for ESM import in node:
315
+ 0 && (module.exports = {
316
+ Sidebar
317
+ });
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { TreeNode } from '@publish.os/nextjs/types';
3
+ import { Ref, ReactNode, MouseEvent } from 'react';
4
+
5
+ type SidebarTreeNode = TreeNode & {
6
+ children?: SidebarTreeNode[];
7
+ };
8
+ type SidebarActiveState = "path-active" | "child-path-active";
9
+ type SidebarDepth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
+ type SidebarNodePrimitiveProps = {
11
+ activeState?: SidebarActiveState;
12
+ activeItemRef?: Ref<HTMLDivElement>;
13
+ children?: ReactNode;
14
+ contentId?: string;
15
+ depth: SidebarDepth;
16
+ expanded?: boolean;
17
+ href?: string;
18
+ isExpandable?: boolean;
19
+ node: SidebarTreeNode;
20
+ onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
21
+ onToggle?: () => void;
22
+ parentExpanded: boolean;
23
+ title: string;
24
+ };
25
+ type SidebarProps = {
26
+ className?: string;
27
+ currentPath?: string;
28
+ title?: ReactNode;
29
+ tree: SidebarTreeNode[];
30
+ };
31
+ declare function Sidebar({ className, currentPath, title, tree }: SidebarProps): react_jsx_runtime.JSX.Element;
32
+
33
+ export { Sidebar, type SidebarActiveState, type SidebarDepth, type SidebarNodePrimitiveProps, type SidebarProps, type SidebarTreeNode };
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { TreeNode } from '@publish.os/nextjs/types';
3
+ import { Ref, ReactNode, MouseEvent } from 'react';
4
+
5
+ type SidebarTreeNode = TreeNode & {
6
+ children?: SidebarTreeNode[];
7
+ };
8
+ type SidebarActiveState = "path-active" | "child-path-active";
9
+ type SidebarDepth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
+ type SidebarNodePrimitiveProps = {
11
+ activeState?: SidebarActiveState;
12
+ activeItemRef?: Ref<HTMLDivElement>;
13
+ children?: ReactNode;
14
+ contentId?: string;
15
+ depth: SidebarDepth;
16
+ expanded?: boolean;
17
+ href?: string;
18
+ isExpandable?: boolean;
19
+ node: SidebarTreeNode;
20
+ onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
21
+ onToggle?: () => void;
22
+ parentExpanded: boolean;
23
+ title: string;
24
+ };
25
+ type SidebarProps = {
26
+ className?: string;
27
+ currentPath?: string;
28
+ title?: ReactNode;
29
+ tree: SidebarTreeNode[];
30
+ };
31
+ declare function Sidebar({ className, currentPath, title, tree }: SidebarProps): react_jsx_runtime.JSX.Element;
32
+
33
+ export { Sidebar, type SidebarActiveState, type SidebarDepth, type SidebarNodePrimitiveProps, type SidebarProps, type SidebarTreeNode };
@@ -0,0 +1,302 @@
1
+ "use client";
2
+
3
+ // src/kernel/components/blocks/sidebar.tsx
4
+ import { SidebarNode } from "./sidebar-node.js";
5
+ import { ScrollArea } from "../ui/scroll-area.js";
6
+
7
+ // src/utils/cn.ts
8
+ import { clsx } from "clsx";
9
+ import { extendTailwindMerge } from "tailwind-merge";
10
+ var twMerge = extendTailwindMerge({
11
+ extend: {
12
+ classGroups: {
13
+ z: [
14
+ "z-content",
15
+ "z-nav",
16
+ "z-overlay",
17
+ "z-modal",
18
+ "z-search",
19
+ "z-toast",
20
+ "z-progress"
21
+ ]
22
+ }
23
+ }
24
+ });
25
+ function cn(...inputs) {
26
+ return twMerge(clsx(inputs));
27
+ }
28
+
29
+ // src/kernel/components/blocks/sidebar.tsx
30
+ import { usePathname } from "next/navigation";
31
+ import {
32
+ memo,
33
+ startTransition,
34
+ useCallback,
35
+ useEffect,
36
+ useId,
37
+ useMemo,
38
+ useRef,
39
+ useState
40
+ } from "react";
41
+ import { jsx, jsxs } from "react/jsx-runtime";
42
+ function normalizePath(path) {
43
+ if (!path) return "";
44
+ const [withoutQuery = ""] = path.split(/[?#]/);
45
+ if (withoutQuery === "/") return "/";
46
+ return withoutQuery.replace(/\/+$/g, "");
47
+ }
48
+ function isExternalHref(href) {
49
+ return /^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith("//");
50
+ }
51
+ function nodeHref(node) {
52
+ if (node.type === "link") return node.href;
53
+ if ("path" in node && typeof node.path === "string") return node.path;
54
+ return void 0;
55
+ }
56
+ function nodeChildren(node) {
57
+ return Array.isArray(node.children) ? node.children : [];
58
+ }
59
+ function nodeKey(node, parentKey) {
60
+ const prefix = parentKey ? `${parentKey}/` : "";
61
+ if (node.type === "page") return `${prefix}page:${node.fileID}`;
62
+ if (node.type === "link") return `${prefix}link:${node.id}`;
63
+ return `${prefix}${node.type}:${node.id}`;
64
+ }
65
+ function isActivePath(path, currentPath) {
66
+ if (!path || isExternalHref(path)) return false;
67
+ const normalizedPath = normalizePath(path);
68
+ const normalizedCurrentPath = normalizePath(currentPath);
69
+ if (!normalizedPath) return false;
70
+ return normalizedCurrentPath === normalizedPath || normalizedCurrentPath.startsWith(`${normalizedPath}/`);
71
+ }
72
+ function isExactActivePath(path, currentPath) {
73
+ if (!path || isExternalHref(path)) return false;
74
+ return normalizePath(path) === normalizePath(currentPath);
75
+ }
76
+ function createActiveIndex({
77
+ currentPath,
78
+ tree
79
+ }) {
80
+ const activeIndex = /* @__PURE__ */ new Map();
81
+ function visit(node) {
82
+ const href = nodeHref(node);
83
+ const exactActive = isExactActivePath(href, currentPath);
84
+ const pathActive = node.type === "page" && isActivePath(href, currentPath);
85
+ const childActive = nodeChildren(node).some(visit);
86
+ const activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
87
+ activeIndex.set(node, {
88
+ activeState,
89
+ initiallyExpanded: exactActive || pathActive || childActive
90
+ });
91
+ return exactActive || pathActive || childActive;
92
+ }
93
+ for (const node of tree) {
94
+ visit(node);
95
+ }
96
+ return activeIndex;
97
+ }
98
+ function safeIdPart(value) {
99
+ return value.replace(/[^a-zA-Z0-9-]/g, "-");
100
+ }
101
+ function nodeContentId({
102
+ instanceId,
103
+ node
104
+ }) {
105
+ const key = "path" in node && node.path ? node.path : node.type === "page" ? node.fileID : node.id;
106
+ return `sidebar-${safeIdPart(instanceId)}-${safeIdPart(key)}`;
107
+ }
108
+ function clampDepth(depth) {
109
+ return Math.min(depth, 12);
110
+ }
111
+ function ExpandableChildren({
112
+ activeIndex,
113
+ activeItemRef,
114
+ contentId,
115
+ currentPath,
116
+ depth,
117
+ expanded,
118
+ instanceId,
119
+ nodes,
120
+ parentExpanded,
121
+ renderChildren
122
+ }) {
123
+ const childFocusable = parentExpanded && expanded;
124
+ return /* @__PURE__ */ jsx(
125
+ "div",
126
+ {
127
+ "aria-hidden": !expanded,
128
+ className: cn(
129
+ "grid overflow-hidden transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",
130
+ expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
131
+ ),
132
+ "data-state": expanded ? "open" : "closed",
133
+ id: contentId,
134
+ children: /* @__PURE__ */ jsx("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px py-0.5", children: renderChildren ? nodes.map((child) => /* @__PURE__ */ jsx(
135
+ SidebarTreeItem,
136
+ {
137
+ activeIndex,
138
+ activeItemRef,
139
+ currentPath,
140
+ depth: clampDepth(depth + 1),
141
+ instanceId,
142
+ itemKey: nodeKey(child, contentId),
143
+ node: child,
144
+ parentExpanded: childFocusable
145
+ },
146
+ nodeKey(child, contentId)
147
+ )) : null }) })
148
+ }
149
+ );
150
+ }
151
+ var SidebarTreeItem = memo(function SidebarTreeItem2({
152
+ activeIndex,
153
+ activeItemRef,
154
+ currentPath,
155
+ depth,
156
+ instanceId,
157
+ itemKey,
158
+ node,
159
+ parentExpanded
160
+ }) {
161
+ const nodes = nodeChildren(node);
162
+ const href = nodeHref(node);
163
+ const activeInfo = activeIndex.get(node);
164
+ const activeState = activeInfo?.activeState;
165
+ const initiallyExpanded = Boolean(activeInfo?.initiallyExpanded);
166
+ const isExpandable = nodes.length > 0 && (node.type === "folder" || node.type === "page");
167
+ const [expanded, setExpanded] = useState(initiallyExpanded);
168
+ const [renderChildren, setRenderChildren] = useState(initiallyExpanded);
169
+ const interactedRef = useRef(false);
170
+ const lastPathRef = useRef(normalizePath(currentPath));
171
+ const contentId = nodeContentId({ instanceId, node });
172
+ useEffect(() => {
173
+ const normalizedCurrentPath = normalizePath(currentPath);
174
+ const pathChanged = lastPathRef.current !== normalizedCurrentPath;
175
+ if (pathChanged) {
176
+ interactedRef.current = false;
177
+ lastPathRef.current = normalizedCurrentPath;
178
+ }
179
+ if (initiallyExpanded && !expanded && !interactedRef.current) {
180
+ setRenderChildren(true);
181
+ startTransition(() => setExpanded(true));
182
+ }
183
+ }, [currentPath, expanded, initiallyExpanded]);
184
+ const toggleExpanded = useCallback(() => {
185
+ interactedRef.current = true;
186
+ setRenderChildren(true);
187
+ setExpanded((value) => !value);
188
+ }, []);
189
+ const expandOnNavigate = useCallback(() => {
190
+ interactedRef.current = true;
191
+ setRenderChildren(true);
192
+ setExpanded(true);
193
+ }, []);
194
+ const pageWithChildrenLinkClick = node.type === "page" && nodes.length > 0 ? expandOnNavigate : void 0;
195
+ const children = isExpandable && nodes.length > 0 ? /* @__PURE__ */ jsx(
196
+ ExpandableChildren,
197
+ {
198
+ activeIndex,
199
+ activeItemRef,
200
+ contentId,
201
+ currentPath,
202
+ depth,
203
+ expanded,
204
+ instanceId,
205
+ nodes,
206
+ parentExpanded,
207
+ renderChildren
208
+ }
209
+ ) : node.type === "section" && nodes.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ jsx(
210
+ SidebarTreeItem2,
211
+ {
212
+ activeIndex,
213
+ activeItemRef,
214
+ currentPath,
215
+ depth,
216
+ instanceId,
217
+ itemKey: nodeKey(child, itemKey),
218
+ node: child,
219
+ parentExpanded
220
+ },
221
+ nodeKey(child, itemKey)
222
+ )) }) : null;
223
+ return /* @__PURE__ */ jsx(
224
+ SidebarNode,
225
+ {
226
+ activeState,
227
+ activeItemRef: activeState === "path-active" ? activeItemRef : void 0,
228
+ contentId: isExpandable ? contentId : void 0,
229
+ depth,
230
+ expanded: isExpandable ? expanded : void 0,
231
+ href,
232
+ isExpandable,
233
+ node,
234
+ onLinkClick: pageWithChildrenLinkClick,
235
+ onToggle: isExpandable ? toggleExpanded : void 0,
236
+ parentExpanded,
237
+ title: node.title,
238
+ children
239
+ }
240
+ );
241
+ });
242
+ function Sidebar({ className, currentPath, title, tree }) {
243
+ const pathname = usePathname();
244
+ const resolvedCurrentPath = pathname ?? currentPath ?? "";
245
+ const instanceId = useId();
246
+ const activeItemRef = useRef(null);
247
+ const activeIndex = useMemo(
248
+ () => createActiveIndex({ currentPath: resolvedCurrentPath, tree }),
249
+ [resolvedCurrentPath, tree]
250
+ );
251
+ useEffect(() => {
252
+ const scrollPath = resolvedCurrentPath;
253
+ const frame = window.requestAnimationFrame(() => {
254
+ if (!scrollPath) return;
255
+ activeItemRef.current?.scrollIntoView({
256
+ block: "nearest",
257
+ inline: "nearest"
258
+ });
259
+ });
260
+ return () => window.cancelAnimationFrame(frame);
261
+ }, [resolvedCurrentPath]);
262
+ return /* @__PURE__ */ jsxs(
263
+ "nav",
264
+ {
265
+ "aria-label": "Documentation navigation",
266
+ className: cn(
267
+ "flex h-full min-h-0 w-(--layout-sidebar-width) min-w-(--layout-sidebar-width) max-w-(--layout-sidebar-width) flex-col overflow-hidden pb-4",
268
+ className
269
+ ),
270
+ children: [
271
+ title ? /* @__PURE__ */ jsx("div", { className: "shrink-0 px-5 pb-2 pt-5 text-xs font-semibold uppercase tracking-wide text-foreground-3", children: title }) : null,
272
+ /* @__PURE__ */ jsx(
273
+ ScrollArea,
274
+ {
275
+ className: "min-h-0 flex-1",
276
+ corner: true,
277
+ mask: { height: 24 },
278
+ scrollbarClassName: "opacity-0 transition-opacity data-[hovering]:opacity-100 data-[scrolling]:opacity-100",
279
+ variant: "gradient",
280
+ children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px px-2 py-3", children: tree.map((node) => /* @__PURE__ */ jsx(
281
+ SidebarTreeItem,
282
+ {
283
+ activeIndex,
284
+ activeItemRef,
285
+ currentPath: resolvedCurrentPath,
286
+ depth: 0,
287
+ instanceId,
288
+ itemKey: nodeKey(node, ""),
289
+ node,
290
+ parentExpanded: true
291
+ },
292
+ nodeKey(node, "")
293
+ )) })
294
+ }
295
+ )
296
+ ]
297
+ }
298
+ );
299
+ }
300
+ export {
301
+ Sidebar
302
+ };