@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92

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 (284) hide show
  1. package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
  2. package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
  3. package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
  4. package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
  5. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
  6. package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
  7. package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
  8. package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
  9. package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
  10. package/compiler-assets/nextjs/shims/document.tsx +46 -0
  11. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -0
  12. package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
  13. package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
  14. package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
  15. package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
  16. package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
  17. package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
  18. package/compiler-assets/nextjs/shims/proxy.ts +254 -86
  19. package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
  20. package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
  21. package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
  22. package/dist/{build-operation-2JAYBSKF.js → build-operation-CJDUL4OW.js} +29 -23
  23. package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
  24. package/dist/capture-local-source-WGGDIUU2.js +258 -0
  25. package/dist/chunk-22RSSUNV.js +13 -0
  26. package/dist/chunk-3T4HVDSC.js +426 -0
  27. package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
  28. package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
  29. package/dist/chunk-5KAD7W53.js +248 -0
  30. package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
  31. package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
  32. package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
  33. package/dist/chunk-DX7PXFCM.js +2519 -0
  34. package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
  35. package/dist/chunk-EFO6AWXN.js +19 -0
  36. package/dist/chunk-IL4RJOKI.js +186 -0
  37. package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
  38. package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
  39. package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
  40. package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
  41. package/dist/compiler.d.ts +15 -2
  42. package/dist/compiler.js +111 -23
  43. package/dist/components/blocks/agent-actions.d.ts +81 -0
  44. package/dist/components/blocks/agent-actions.js +563 -0
  45. package/dist/components/blocks/toc.d.ts +43 -0
  46. package/dist/components/blocks/toc.js +136 -0
  47. package/dist/components/ui/button.d.ts +4 -0
  48. package/dist/components/ui/button.js +94 -0
  49. package/dist/compose-44GJSMXD.js +16 -0
  50. package/dist/config/createNextConfig.js +19 -3
  51. package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
  52. package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
  53. package/dist/ide-support-TG74L4FF.js +16 -0
  54. package/dist/index.d.ts +151 -95
  55. package/dist/index.js +25 -0
  56. package/dist/jsx-dev-runtime.d.ts +6 -0
  57. package/dist/jsx-dev-runtime.js +100 -0
  58. package/dist/jsx-runtime.d.ts +7 -0
  59. package/dist/jsx-runtime.js +97 -0
  60. package/dist/kernel/components/blocks/AgentActions.d.ts +37 -8
  61. package/dist/kernel/components/blocks/AgentActions.js +384 -174
  62. package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
  63. package/dist/kernel/components/blocks/agent-actions.js +563 -0
  64. package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
  65. package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
  66. package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
  67. package/dist/kernel/components/blocks/color-palette.js +4 -4
  68. package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
  69. package/dist/kernel/components/blocks/logo-block.js +1 -1
  70. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
  71. package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
  72. package/dist/kernel/components/blocks/navbar.d.ts +5 -4
  73. package/dist/kernel/components/blocks/navbar.js +79 -59
  74. package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
  75. package/dist/kernel/components/blocks/navigation-progress.js +2 -2
  76. package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
  77. package/dist/kernel/components/blocks/next-prev.js +30 -7
  78. package/dist/kernel/components/blocks/page-list.d.ts +4 -4
  79. package/dist/kernel/components/blocks/page-list.js +32 -9
  80. package/dist/kernel/components/blocks/search.d.ts +9 -15
  81. package/dist/kernel/components/blocks/search.js +16 -17
  82. package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
  83. package/dist/kernel/components/blocks/sidebar-node.js +13 -3
  84. package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
  85. package/dist/kernel/components/blocks/sidebar.js +137 -28
  86. package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
  87. package/dist/kernel/components/blocks/theme-toggle.js +5 -5
  88. package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
  89. package/dist/kernel/components/blocks/toc-client.js +495 -0
  90. package/dist/kernel/components/blocks/toc.d.ts +20 -2
  91. package/dist/kernel/components/blocks/toc.js +121 -179
  92. package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
  93. package/dist/kernel/components/mdx/components/blockquote.js +1 -1
  94. package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
  95. package/dist/kernel/components/mdx/components/callout.js +1 -1
  96. package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
  97. package/dist/kernel/components/mdx/components/code-block.js +2 -2
  98. package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
  99. package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
  100. package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
  101. package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
  102. package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
  103. package/dist/kernel/components/mdx/components/figure.js +23 -13
  104. package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
  105. package/dist/kernel/components/mdx/components/footnotes.js +1 -1
  106. package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
  107. package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
  108. package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
  109. package/dist/kernel/components/mdx/components/heading.js +6 -3
  110. package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
  111. package/dist/kernel/components/mdx/components/hr.js +2 -2
  112. package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
  113. package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
  114. package/dist/kernel/components/mdx/components/image.d.ts +2 -2
  115. package/dist/kernel/components/mdx/components/image.js +22 -17
  116. package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
  117. package/dist/kernel/components/mdx/components/inline-code.js +1 -1
  118. package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
  119. package/dist/kernel/components/mdx/components/kbd.js +2 -2
  120. package/dist/kernel/components/mdx/components/link.d.ts +6 -6
  121. package/dist/kernel/components/mdx/components/link.js +2 -2
  122. package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
  123. package/dist/kernel/components/mdx/components/paragraph.js +1 -1
  124. package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
  125. package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
  126. package/dist/kernel/components/mdx/components/table.d.ts +7 -7
  127. package/dist/kernel/components/mdx/components/table.js +2 -2
  128. package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
  129. package/dist/kernel/components/mdx/components/task-list.js +1 -1
  130. package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
  131. package/dist/kernel/components/mdx/components/video-player.js +6 -2
  132. package/dist/kernel/components/mdx/components/video.d.ts +5 -4
  133. package/dist/kernel/components/mdx/components/video.js +7 -5
  134. package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
  135. package/dist/kernel/components/mdx/error-boundary.js +2 -2
  136. package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
  137. package/dist/kernel/components/mdx/error-fallback.js +1 -1
  138. package/dist/kernel/components/mdx/mdx.d.ts +57 -16
  139. package/dist/kernel/components/mdx/mdx.js +232 -35
  140. package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
  141. package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
  142. package/dist/kernel/components/mdx/types.d.ts +1 -1
  143. package/dist/kernel/components/next-image.d.ts +12 -0
  144. package/dist/kernel/components/next-image.js +61 -0
  145. package/dist/kernel/components/ui/accordion.d.ts +7 -7
  146. package/dist/kernel/components/ui/accordion.js +1 -1
  147. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
  148. package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
  149. package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
  150. package/dist/kernel/components/ui/breadcrumb.js +4 -4
  151. package/dist/kernel/components/ui/button-group.d.ts +6 -6
  152. package/dist/kernel/components/ui/button-group.js +3 -3
  153. package/dist/kernel/components/ui/button.d.ts +59 -7
  154. package/dist/kernel/components/ui/button.js +43 -39
  155. package/dist/kernel/components/ui/card.d.ts +7 -7
  156. package/dist/kernel/components/ui/card.js +1 -1
  157. package/dist/kernel/components/ui/dialog.d.ts +10 -10
  158. package/dist/kernel/components/ui/dialog.js +1 -1
  159. package/dist/kernel/components/ui/drawer.d.ts +12 -12
  160. package/dist/kernel/components/ui/drawer.js +1 -1
  161. package/dist/kernel/components/ui/input.d.ts +2 -2
  162. package/dist/kernel/components/ui/input.js +1 -1
  163. package/dist/kernel/components/ui/kbd.d.ts +4 -4
  164. package/dist/kernel/components/ui/kbd.js +1 -1
  165. package/dist/kernel/components/ui/link.d.ts +11 -5
  166. package/dist/kernel/components/ui/link.js +2 -2
  167. package/dist/kernel/components/ui/menu.d.ts +22 -22
  168. package/dist/kernel/components/ui/menu.js +1 -1
  169. package/dist/kernel/components/ui/mod-key.d.ts +2 -3
  170. package/dist/kernel/components/ui/mod-key.js +2 -2
  171. package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
  172. package/dist/kernel/components/ui/navigation-menu.js +1 -1
  173. package/dist/kernel/components/ui/popover.d.ts +11 -11
  174. package/dist/kernel/components/ui/popover.js +1 -1
  175. package/dist/kernel/components/ui/progress.d.ts +7 -7
  176. package/dist/kernel/components/ui/progress.js +1 -1
  177. package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
  178. package/dist/kernel/components/ui/scroll-area.js +1 -1
  179. package/dist/kernel/components/ui/select.d.ts +16 -16
  180. package/dist/kernel/components/ui/select.js +1 -1
  181. package/dist/kernel/components/ui/separator.d.ts +3 -3
  182. package/dist/kernel/components/ui/separator.js +1 -1
  183. package/dist/kernel/components/ui/table.d.ts +7 -7
  184. package/dist/kernel/components/ui/table.js +1 -1
  185. package/dist/kernel/components/ui/tabs.d.ts +12 -12
  186. package/dist/kernel/components/ui/tabs.js +1 -1
  187. package/dist/kernel/components/ui/tag.d.ts +3 -3
  188. package/dist/kernel/components/ui/tag.js +1 -1
  189. package/dist/kernel/components/ui/text.d.ts +4 -4
  190. package/dist/kernel/components/ui/text.js +1 -1
  191. package/dist/kernel/components/ui/toast.d.ts +11 -11
  192. package/dist/kernel/components/ui/toast.js +1 -1
  193. package/dist/kernel/components/ui/tooltip.d.ts +9 -9
  194. package/dist/kernel/components/ui/tooltip.js +1 -1
  195. package/dist/kernel/defaults.registry.d.ts +4 -17
  196. package/dist/kernel/defaults.registry.js +4 -19
  197. package/dist/kernel/routes/agent/markdown.d.ts +7 -0
  198. package/dist/kernel/routes/agent/markdown.js +229 -54
  199. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  200. package/dist/kernel/routes/layouts/group.js +5 -7
  201. package/dist/kernel/routes/metadata/feed.d.ts +1 -2
  202. package/dist/kernel/routes/metadata/feed.js +119 -88
  203. package/dist/kernel/routes/metadata/llms.d.ts +3 -23
  204. package/dist/kernel/routes/metadata/llms.js +2 -103
  205. package/dist/kernel/routes/metadata/og-image.js +1 -1
  206. package/dist/kernel/routes/metadata/robots.d.ts +5 -3
  207. package/dist/kernel/routes/metadata/robots.js +4 -25
  208. package/dist/kernel/routes/metadata/sitemap.d.ts +36 -3
  209. package/dist/kernel/routes/metadata/sitemap.js +277 -49
  210. package/dist/kernel/routes/not-found.d.ts +34 -0
  211. package/dist/kernel/routes/not-found.js +213 -0
  212. package/dist/kernel/routes/pages/group.d.ts +5 -5
  213. package/dist/kernel/routes/pages/group.js +11 -5
  214. package/dist/kernel/routes/pages/leaf.d.ts +38 -6
  215. package/dist/kernel/routes/pages/leaf.js +21 -12
  216. package/dist/kernel/routes/pages/root.d.ts +5 -5
  217. package/dist/kernel/routes/pages/root.js +21 -6
  218. package/dist/keyboard-shortcuts.d.ts +2 -2
  219. package/dist/keyboard-shortcuts.js +1 -1
  220. package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
  221. package/dist/resolvers/manifest-resolver.d.ts +2 -2
  222. package/dist/resolvers/manifest-resolver.js +65 -35
  223. package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
  224. package/dist/search.d.ts +2 -9
  225. package/dist/search.js +9 -16
  226. package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
  227. package/dist/theme-scope.d.ts +2 -2
  228. package/dist/theme-scope.js +1 -1
  229. package/dist/types-BbqmOzLC.d.ts +168 -0
  230. package/dist/types-TjH1ek0X.d.ts +22 -0
  231. package/dist/types-sM2g9nW0.d.ts +12 -0
  232. package/dist/types.d.ts +117 -91
  233. package/dist/utils/heading-ids.js +30 -11
  234. package/dist/utils/toc-selection.d.ts +7 -0
  235. package/dist/utils/toc-selection.js +14 -0
  236. package/dist/validate-local-source-EN2GW4FR.js +16 -0
  237. package/dist/validate-publish-os-source-OEWQDB7B.js +14 -0
  238. package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
  239. package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
  240. package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
  241. package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
  242. package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
  243. package/init/seed/minimal/publish.os/blog/index.tsx +85 -0
  244. package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
  245. package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
  246. package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
  247. package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
  248. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
  249. package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
  250. package/init/seed/minimal/publish.os/publish.os.config.json +17 -2
  251. package/init/seed/minimal/publish.os/theme.css +3 -3
  252. package/init/seed/minimal/seed.json +12 -4
  253. package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
  254. package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
  255. package/package.json +48 -23
  256. package/release/app/phosphor/package.json +4 -4
  257. package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
  258. package/release/compiler/package.json +5 -3
  259. package/release/compiler/pnpm-lock.yaml.template +153 -183
  260. package/release/release.json +6 -6
  261. package/dist/button-CtzUJB8u.d.ts +0 -11
  262. package/dist/chunk-535TM4A5.js +0 -1455
  263. package/dist/chunk-B2V22WRT.js +0 -297
  264. package/dist/chunk-NECL5IBJ.js +0 -318
  265. package/dist/chunk-SVYGXXYR.js +0 -36
  266. package/dist/chunk-UF6ATARM.js +0 -1100
  267. package/dist/compose-NN23UJGC.js +0 -13
  268. package/dist/ide-support-ZNW7ODFY.js +0 -15
  269. package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
  270. package/dist/kernel/components/blocks/design-system-preview.js +0 -667
  271. package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
  272. package/dist/kernel/components/blocks/link-playground.js +0 -744
  273. package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
  274. package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
  275. package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
  276. package/dist/kernel/components/ui/theme-toggle.js +0 -53
  277. package/dist/sidebar-types-DKpR27II.d.ts +0 -25
  278. package/dist/types-BzkZty3r.d.ts +0 -147
  279. package/dist/types-CJWRG05y.d.ts +0 -76
  280. package/dist/types-CUtrppxt.d.ts +0 -69
  281. package/dist/validate-local-source-XRL2Y7XE.js +0 -14
  282. package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
  283. package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
  284. package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
@@ -1,8 +1,7 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ReactNode, ComponentPropsWithRef, ComponentPropsWithoutRef } from 'react';
4
3
  import { useRender } from '@base-ui/react/use-render';
5
- import { B as ButtonProps } from '../../../button-c3WGnxIj.js';
4
+ import { B as ButtonProps } from '../../../button-D6Xp2HBm.js';
6
5
  import { Dialog } from '@base-ui/react/dialog';
7
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
8
7
  import { Input } from '@base-ui/react/input';
@@ -18,17 +17,12 @@ type SearchResult = {
18
17
  excerpt: string;
19
18
  id: string;
20
19
  meta: {
21
- author?: string;
22
20
  description?: string;
23
21
  group?: string;
24
- image?: string;
25
22
  nodeId?: string;
26
23
  path?: string;
27
- publishedAt?: string;
28
24
  section?: string;
29
- tags?: string;
30
25
  title?: string;
31
- updatedAt?: string;
32
26
  };
33
27
  plainExcerpt: string;
34
28
  score?: number;
@@ -45,7 +39,7 @@ type SearchProviderProps = {
45
39
  open?: boolean;
46
40
  shortcut?: string | false;
47
41
  };
48
- declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps): react_jsx_runtime.JSX.Element;
42
+ declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps): react.JSX.Element;
49
43
 
50
44
  type DialogPortalProps = ComponentPropsWithRef<typeof Dialog.Portal>;
51
45
 
@@ -60,13 +54,13 @@ type SearchResultsProps = Omit<ComponentPropsWithRef<"div">, "children"> & {
60
54
  emptyText?: string;
61
55
  itemClassName?: string;
62
56
  };
63
- declare function SearchResults({ children, className, emptyText, itemClassName, ...props }: SearchResultsProps): react_jsx_runtime.JSX.Element | null;
57
+ declare function SearchResults({ children, className, emptyText, itemClassName, ...props }: SearchResultsProps): react.JSX.Element | null;
64
58
  type SearchFooterProps = ComponentPropsWithRef<"div">;
65
- declare function SearchFooter({ children, className, ...props }: SearchFooterProps): react_jsx_runtime.JSX.Element | null;
59
+ declare function SearchFooter({ children, className, ...props }: SearchFooterProps): react.JSX.Element | null;
66
60
 
67
61
  declare function SearchProgressBar({ className }: {
68
62
  className?: string;
69
- }): react_jsx_runtime.JSX.Element;
63
+ }): react.JSX.Element;
70
64
 
71
65
  type SearchTriggerProps = ButtonProps & {
72
66
  icon?: ReactNode;
@@ -85,7 +79,7 @@ type SearchDialogProps = {
85
79
  mobileQuery?: string;
86
80
  title?: string;
87
81
  };
88
- declare function DialogContent({ children, className, container, description, mobileQuery, title, }: SearchDialogProps): react_jsx_runtime.JSX.Element;
82
+ declare function DialogContent({ children, className, container, description, mobileQuery, title, }: SearchDialogProps): react.JSX.Element;
89
83
  type SearchInputProps = Omit<InputProps, "value" | "defaultValue" | "onValueChange"> & {
90
84
  ref?: ComponentPropsWithRef<"input">["ref"];
91
85
  closeClassName?: string;
@@ -94,11 +88,11 @@ type SearchInputProps = Omit<InputProps, "value" | "defaultValue" | "onValueChan
94
88
  rootClassName?: string;
95
89
  showCloseShortcut?: boolean;
96
90
  };
97
- declare function SearchInputField({ className, closeClassName, closeLabel, icon, onChange, onKeyDown, placeholder, ref, rootClassName, showCloseShortcut, ...props }: SearchInputProps): react_jsx_runtime.JSX.Element;
91
+ declare function SearchInputField({ className, closeClassName, closeLabel, icon, onChange, onKeyDown, placeholder, ref, rootClassName, showCloseShortcut, ...props }: SearchInputProps): react.JSX.Element;
98
92
  type SearchCommandProps = ComponentPropsWithRef<"div">;
99
- declare function Command({ children, className, ...props }?: SearchCommandProps): react_jsx_runtime.JSX.Element;
93
+ declare function Command({ children, className, ...props }?: SearchCommandProps): react.JSX.Element;
100
94
  type SearchProps = Omit<SearchProviderProps, "children">;
101
- declare function Search(props: SearchProps): react_jsx_runtime.JSX.Element;
95
+ declare function Search(props: SearchProps): react.JSX.Element;
102
96
  declare namespace Search {
103
97
  var Root: typeof SearchProvider;
104
98
  var Trigger: typeof Trigger;
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/modules/search/search-block.tsx
4
4
  import { useRender } from "@base-ui/react/use-render";
5
- import { Button } from "@publish.os/nextjs/kernel/components/ui/button";
5
+ import { Button } from "@components/ui/button";
6
6
  import {
7
7
  Dialog,
8
8
  DialogBackdrop,
@@ -10,7 +10,7 @@ import {
10
10
  DialogPopup,
11
11
  DialogPortal,
12
12
  DialogTitle
13
- } from "@publish.os/nextjs/kernel/components/ui/dialog";
13
+ } from "@components/ui/dialog";
14
14
  import {
15
15
  Drawer,
16
16
  DrawerBackdrop,
@@ -20,11 +20,11 @@ import {
20
20
  DrawerTitle,
21
21
  DrawerViewport,
22
22
  DrawerVirtualKeyboardProvider
23
- } from "@publish.os/nextjs/kernel/components/ui/drawer";
24
- import { Input } from "@publish.os/nextjs/kernel/components/ui/input";
25
- import { Kbd as Kbd2, kbdVariants } from "@publish.os/nextjs/kernel/components/ui/kbd";
26
- import { ModKey } from "@publish.os/nextjs/kernel/components/ui/mod-key";
27
- import { Separator as Separator2 } from "@publish.os/nextjs/kernel/components/ui/separator";
23
+ } from "@components/ui/drawer";
24
+ import { Input } from "@components/ui/input";
25
+ import { Kbd as Kbd2 } from "@components/ui/kbd";
26
+ import { ModKey } from "@components/ui/mod-key";
27
+ import { Separator as Separator2 } from "@components/ui/separator";
28
28
  import { MagnifyingGlassIcon } from "@phosphor-icons/react/ssr";
29
29
  import { formatShortcut } from "@publish.os/nextjs/keyboard-shortcuts";
30
30
  import {
@@ -38,21 +38,21 @@ import {
38
38
  } from "react";
39
39
 
40
40
  // src/modules/search/results.tsx
41
- import { Kbd } from "@publish.os/nextjs/kernel/components/ui/kbd";
41
+ import { Kbd } from "@components/ui/kbd";
42
42
  import {
43
43
  ScrollAreaContent,
44
44
  ScrollAreaRoot,
45
45
  ScrollAreaScrollbar,
46
46
  ScrollAreaThumb,
47
47
  ScrollAreaViewport
48
- } from "@publish.os/nextjs/kernel/components/ui/scroll-area";
49
- import { Separator } from "@publish.os/nextjs/kernel/components/ui/separator";
48
+ } from "@components/ui/scroll-area";
49
+ import { Separator } from "@components/ui/separator";
50
50
  import { ArrowElbowDownLeftIcon } from "@phosphor-icons/react/ssr";
51
51
  import { useSearchBlock } from "@publish.os/nextjs/search";
52
52
  import { cn } from "@publish.os/nextjs/utils/cn";
53
53
  import NextLink from "next/link";
54
54
  import { useEffect } from "react";
55
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
55
+ import { Fragment, jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
56
56
  var SEARCH_RESULT_SNIPPET_LENGTH = 180;
57
57
  function getSearchPanel({
58
58
  displayResults,
@@ -323,11 +323,11 @@ import {
323
323
  Progress,
324
324
  ProgressIndicator,
325
325
  ProgressTrack
326
- } from "@publish.os/nextjs/kernel/components/ui/progress";
326
+ } from "@components/ui/progress";
327
327
  import { useSearchBlock as useSearchBlock2 } from "@publish.os/nextjs/search";
328
328
  import { cn as cn2 } from "@publish.os/nextjs/utils/cn";
329
329
  import { useLayoutEffect, useRef, useState } from "react";
330
- import { jsx as jsx2 } from "react/jsx-runtime";
330
+ import { jsx as jsx2 } from "@publish.os/nextjs/jsx-runtime";
331
331
  var INITIAL_PROGRESS = 5, FAST_PHASE_END = 25, TARGET_PROGRESS = 95, FAST_DURATION = 50, MAX_DURATION = 5e3, COMPLETE_DURATION = 200, EXIT_DURATION = 150;
332
332
  function SearchProgressBar({ className }) {
333
333
  let {
@@ -393,7 +393,7 @@ function SearchProgressBar({ className }) {
393
393
  }
394
394
 
395
395
  // src/modules/search/search-block.tsx
396
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
396
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "@publish.os/nextjs/jsx-runtime";
397
397
  function Trigger({
398
398
  children,
399
399
  className,
@@ -625,13 +625,12 @@ function SearchInputField({
625
625
  {
626
626
  "aria-label": "Close search",
627
627
  className: cn3(
628
- kbdVariants({ size: "xs" }),
629
- "absolute right-4 top-1/2 hidden -translate-y-1/2 cursor-pointer text-foreground-2 before:absolute before:left-1/2 before:top-1/2 before:size-10 before:-translate-1/2 before:content-[''] active:translate-y-[calc(-50%_+_1px)] md:inline-flex",
628
+ "absolute right-4 top-1/2 hidden -translate-y-1/2 cursor-pointer before:absolute before:left-1/2 before:top-1/2 before:size-10 before:-translate-1/2 before:content-[''] active:translate-y-[calc(-50%_+_1px)] md:inline-flex",
630
629
  closeClassName
631
630
  ),
632
631
  onClick: () => setOpen(!1),
633
632
  type: "button",
634
- children: closeLabel
633
+ children: /* @__PURE__ */ jsx3(Kbd2, { size: "xs", children: closeLabel })
635
634
  }
636
635
  ) : null,
637
636
  /* @__PURE__ */ jsx3(Separator2, { className: "absolute inset-x-0 bottom-0 z-content md:hidden group-data-[search-presentation=drawer]/search:block group-data-[search-presentation=dialog]/search:hidden" })
@@ -1,8 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-DKpR27II.js';
3
- import 'react';
4
- import '../../../types-CJWRG05y.js';
1
+ import * as react from 'react';
2
+ import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-CMrMM0Nj.js';
5
3
 
6
- declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps): react_jsx_runtime.JSX.Element | null;
4
+ declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onSwitchView, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps): react.JSX.Element | null;
7
5
 
8
6
  export { SidebarNode, SidebarNodePrimitiveProps };
@@ -3,7 +3,7 @@ import { CaretRightIcon } from "@phosphor-icons/react/ssr";
3
3
  import { cn } from "@publish.os/nextjs/utils/cn";
4
4
  import { cva } from "class-variance-authority";
5
5
  import NextLink from "next/link";
6
- import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
7
7
  var SIDEBAR_NODE_VARIANT = "base", depthClassByDepth = {
8
8
  0: "pl-2",
9
9
  1: "pl-5",
@@ -157,6 +157,7 @@ function SidebarNode({
157
157
  isExpandable = !1,
158
158
  node,
159
159
  onLinkClick,
160
+ onSwitchView,
160
161
  onToggle,
161
162
  parentExpanded,
162
163
  title
@@ -174,7 +175,7 @@ function SidebarNode({
174
175
  }
175
176
  ),
176
177
  children
177
- ] }) : node.type === "folder" ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
178
+ ] }) : node.type === "folder" || node.type === "group" && node.presentation === "folder" ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
178
179
  /* @__PURE__ */ jsx(
179
180
  "button",
180
181
  {
@@ -200,7 +201,16 @@ function SidebarNode({
200
201
  }
201
202
  ),
202
203
  children
203
- ] }) : href ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
204
+ ] }) : node.type === "switch-view" ? /* @__PURE__ */ jsx("li", { className: "select-none", children: /* @__PURE__ */ jsx(
205
+ "button",
206
+ {
207
+ className: "block w-full rounded-button text-left focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
208
+ onClick: onSwitchView,
209
+ tabIndex: parentExpanded ? void 0 : -1,
210
+ type: "button",
211
+ children: /* @__PURE__ */ jsx(RowInner, { activeState, depth, interactive: !0, children: /* @__PURE__ */ jsx(RowText, { title }) })
212
+ }
213
+ ) }) : href ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
204
214
  /* @__PURE__ */ jsx(
205
215
  SidebarLink,
206
216
  {
@@ -1,15 +1,14 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { a as SidebarTreeNode } from '../../../sidebar-types-DKpR27II.js';
4
- export { b as SidebarActiveState, c as SidebarDepth, S as SidebarNodePrimitiveProps } from '../../../sidebar-types-DKpR27II.js';
5
- import '../../../types-CJWRG05y.js';
3
+ import { R as ResolvedNavigation } from '../../../sidebar-types-CMrMM0Nj.js';
4
+ export { a as SidebarActiveState, b as SidebarDepth, c as SidebarNavigationNode, S as SidebarNodePrimitiveProps } from '../../../sidebar-types-CMrMM0Nj.js';
6
5
 
7
6
  type SidebarProps = {
8
7
  className?: string;
9
8
  currentPath?: string;
10
9
  title?: ReactNode;
11
- tree: SidebarTreeNode[];
10
+ navigation: ResolvedNavigation;
12
11
  };
13
- declare function Sidebar({ className, currentPath, title, tree }: SidebarProps): react_jsx_runtime.JSX.Element;
12
+ declare function Sidebar({ className, currentPath, title, navigation, }: SidebarProps): react.JSX.Element;
14
13
 
15
- export { Sidebar, type SidebarProps, SidebarTreeNode };
14
+ export { Sidebar, type SidebarProps };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
 
3
3
  // src/components/block/sidebar/sidebar.tsx
4
- import { SidebarNode } from "@publish.os/nextjs/kernel/components/blocks/sidebar-node";
5
- import { ScrollArea } from "@publish.os/nextjs/kernel/components/ui/scroll-area";
4
+ import { SidebarNode } from "@components/blocks/sidebar-node";
5
+ import { ScrollArea } from "@components/ui/scroll-area";
6
6
  import { cn } from "@publish.os/nextjs/utils/cn";
7
7
  import { usePathname } from "next/navigation";
8
8
  import {
@@ -15,51 +15,112 @@ import {
15
15
  useRef,
16
16
  useState
17
17
  } from "react";
18
- import { jsx, jsxs } from "react/jsx-runtime";
18
+
19
+ // src/components/block/sidebar/sidebar-navigation-view.ts
19
20
  function normalizePath(path) {
20
21
  if (!path) return "";
21
22
  let [withoutQuery = ""] = path.split(/[?#]/);
22
23
  return withoutQuery === "/" ? "/" : withoutQuery.replace(/\/+$/g, "");
23
24
  }
25
+ function nodePath(node) {
26
+ if (node.type === "page") return node.page.path;
27
+ if (node.type === "group") return node.route;
28
+ }
29
+ function pathSpecificity(nodes, path) {
30
+ let normalizedPath = normalizePath(path), specificity = -1;
31
+ for (let node of nodes) {
32
+ let candidate = normalizePath(nodePath(node));
33
+ candidate && (normalizedPath === candidate || normalizedPath.startsWith(`${candidate}/`)) && (specificity = Math.max(specificity, candidate.length)), node.type === "view" ? specificity = Math.max(specificity, pathSpecificity(node.items, path)) : "children" in node && (specificity = Math.max(
34
+ specificity,
35
+ pathSpecificity(node.children ?? [], path)
36
+ ));
37
+ }
38
+ return specificity;
39
+ }
40
+ function focusedViewForPath(nodes, path) {
41
+ let selected, selectedDepth = -1, selectedSpecificity = -1;
42
+ function visit(entries, depth) {
43
+ for (let node of entries)
44
+ if (node.type === "view") {
45
+ let specificity = pathSpecificity(node.items, path);
46
+ specificity >= 0 && (depth > selectedDepth || depth === selectedDepth && specificity > selectedSpecificity) && (selected = node, selectedDepth = depth, selectedSpecificity = specificity), visit(node.items, depth + 1);
47
+ } else "children" in node && visit(node.children ?? [], depth);
48
+ }
49
+ return visit(nodes, 0), selected;
50
+ }
51
+ function focusedViewForTarget(nodes, target) {
52
+ if (typeof target != "string")
53
+ return findNamedView(nodes, target.view);
54
+ let group = findGroup(nodes, target);
55
+ return group ? focusedViewForPath(nodes, group.route) : findNamedView(nodes, target);
56
+ }
57
+ function findNavigationView(nodes, viewId) {
58
+ if (viewId)
59
+ for (let node of nodes) {
60
+ if (node.type === "view" && (node.viewId === viewId || node.id === viewId))
61
+ return node;
62
+ let nested = node.type === "view" ? findNavigationView(node.items, viewId) : "children" in node ? findNavigationView(node.children ?? [], viewId) : void 0;
63
+ if (nested) return nested;
64
+ }
65
+ }
66
+ function findNamedView(nodes, viewId) {
67
+ return findNavigationView(nodes, viewId);
68
+ }
69
+ function findGroup(nodes, groupKey) {
70
+ for (let node of nodes) {
71
+ if (node.type === "group" && node.groupKey === groupKey) return node;
72
+ let nested = node.type === "view" ? findGroup(node.items, groupKey) : "children" in node ? findGroup(node.children ?? [], groupKey) : void 0;
73
+ if (nested) return nested;
74
+ }
75
+ }
76
+
77
+ // src/components/block/sidebar/sidebar.tsx
78
+ import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
79
+ function normalizePath2(path) {
80
+ if (!path) return "";
81
+ let [withoutQuery = ""] = path.split(/[?#]/);
82
+ return withoutQuery === "/" ? "/" : withoutQuery.replace(/\/+$/g, "");
83
+ }
24
84
  function isExternalHref(href) {
25
85
  return /^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith("//");
26
86
  }
27
87
  function nodeHref(node) {
28
- if (node.type === "link" || "href" in node && typeof node.href == "string") return node.href;
29
- if ("path" in node && typeof node.path == "string") return node.path;
88
+ if (node.type === "link" || node.type === "page" || node.type === "group" && node.presentation === "page") return node.href;
30
89
  }
31
- function nodePath(node) {
32
- if (node.type !== "link" && "path" in node && typeof node.path == "string")
33
- return node.path;
90
+ function nodePath2(node) {
91
+ if (node.type === "page") return node.page.path;
92
+ if (node.type === "group" && node.presentation === "page") return node.route;
34
93
  }
35
94
  function nodeChildren(node) {
36
- return Array.isArray(node.children) ? node.children : [];
95
+ return node.type === "view" ? node.items : "children" in node ? node.children ?? [] : [];
37
96
  }
38
97
  function nodeKey(node, parentKey) {
39
- let prefix = parentKey ? `${parentKey}/` : "";
40
- return node.type === "page" ? `${prefix}page:${node.fileID}` : node.type === "link" ? `${prefix}link:${node.id}` : `${prefix}${node.type}:${node.id}`;
98
+ return `${parentKey ? `${parentKey}/` : ""}${node.type}:${node.id}`;
41
99
  }
42
100
  function isActivePath(path, currentPath) {
43
101
  if (!path || isExternalHref(path)) return !1;
44
- let normalizedPath = normalizePath(path), normalizedCurrentPath = normalizePath(currentPath);
102
+ let normalizedPath = normalizePath2(path), normalizedCurrentPath = normalizePath2(currentPath);
45
103
  return normalizedPath ? normalizedCurrentPath === normalizedPath || normalizedCurrentPath.startsWith(`${normalizedPath}/`) : !1;
46
104
  }
47
105
  function isExactActivePath(path, currentPath) {
48
- return !path || isExternalHref(path) ? !1 : normalizePath(path) === normalizePath(currentPath);
106
+ return !path || isExternalHref(path) ? !1 : normalizePath2(path) === normalizePath2(currentPath);
49
107
  }
50
108
  function createActiveIndex({
51
109
  currentPath,
52
- tree
110
+ nodes
53
111
  }) {
54
112
  let activeIndex = /* @__PURE__ */ new Map();
55
113
  function visit(node) {
56
- let path = nodePath(node), exactActive = isExactActivePath(path, currentPath), pathActive = node.type === "page" && isActivePath(path, currentPath), childActive = nodeChildren(node).some(visit), activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
114
+ let path = nodePath2(node), exactActive = isExactActivePath(path, currentPath), pathActive = (node.type === "page" || node.type === "group") && isActivePath(path, currentPath), childActive = !1;
115
+ for (let child of nodeChildren(node))
116
+ childActive = visit(child) || childActive;
117
+ let activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
57
118
  return activeIndex.set(node, {
58
119
  activeState,
59
120
  initiallyExpanded: exactActive || pathActive || childActive
60
121
  }), exactActive || pathActive || childActive;
61
122
  }
62
- for (let node of tree)
123
+ for (let node of nodes)
63
124
  visit(node);
64
125
  return activeIndex;
65
126
  }
@@ -70,7 +131,7 @@ function nodeContentId({
70
131
  instanceId,
71
132
  node
72
133
  }) {
73
- let key = "path" in node && node.path ? node.path : node.type === "page" ? node.fileID : node.id;
134
+ let key = node.type === "page" ? node.page.path : node.type === "group" ? node.route : node.id;
74
135
  return `sidebar-${safeIdPart(instanceId)}-${safeIdPart(key)}`;
75
136
  }
76
137
  function clampDepth(depth) {
@@ -85,6 +146,7 @@ function ExpandableChildren({
85
146
  expanded,
86
147
  instanceId,
87
148
  nodes,
149
+ onSwitchView,
88
150
  parentExpanded,
89
151
  renderChildren
90
152
  }) {
@@ -109,6 +171,7 @@ function ExpandableChildren({
109
171
  instanceId,
110
172
  itemKey: nodeKey(child, contentId),
111
173
  node: child,
174
+ onSwitchView,
112
175
  parentExpanded: childFocusable
113
176
  },
114
177
  nodeKey(child, contentId)
@@ -124,18 +187,19 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
124
187
  instanceId,
125
188
  itemKey,
126
189
  node,
190
+ onSwitchView,
127
191
  parentExpanded
128
192
  }) {
129
- let nodes = nodeChildren(node), href = nodeHref(node), activeInfo = activeIndex.get(node), activeState = activeInfo?.activeState, initiallyExpanded = !!activeInfo?.initiallyExpanded, isExpandable = nodes.length > 0 && (node.type === "folder" || node.type === "page"), [expanded, setExpanded] = useState(initiallyExpanded), [renderChildren, setRenderChildren] = useState(initiallyExpanded), interactedRef = useRef(!1), lastPathRef = useRef(normalizePath(currentPath)), contentId = nodeContentId({ instanceId, node });
193
+ let nodes = nodeChildren(node), href = nodeHref(node), activeInfo = activeIndex.get(node), activeState = activeInfo?.activeState, initiallyExpanded = !!activeInfo?.initiallyExpanded, hasChildren = nodes.length > 0, isExpandable = hasChildren && (node.type === "folder" || node.type === "page" || node.type === "group" && node.presentation === "folder"), [expanded, setExpanded] = useState(initiallyExpanded), [renderChildren, setRenderChildren] = useState(initiallyExpanded), interactedRef = useRef(!1), lastPathRef = useRef(normalizePath2(currentPath)), contentId = nodeContentId({ instanceId, node });
130
194
  useEffect(() => {
131
- let normalizedCurrentPath = normalizePath(currentPath);
195
+ let normalizedCurrentPath = normalizePath2(currentPath);
132
196
  lastPathRef.current !== normalizedCurrentPath && (interactedRef.current = !1, lastPathRef.current = normalizedCurrentPath), initiallyExpanded && !expanded && !interactedRef.current && (setRenderChildren(!0), startTransition(() => setExpanded(!0)));
133
197
  }, [currentPath, expanded, initiallyExpanded]);
134
198
  let toggleExpanded = useCallback(() => {
135
199
  interactedRef.current = !0, setRenderChildren(!0), setExpanded((value) => !value);
136
200
  }, []), expandOnNavigate = useCallback(() => {
137
201
  interactedRef.current = !0, setRenderChildren(!0), setExpanded(!0);
138
- }, []), pageWithChildrenLinkClick = node.type === "page" && nodes.length > 0 ? expandOnNavigate : void 0, children = isExpandable && nodes.length > 0 ? /* @__PURE__ */ jsx(
202
+ }, []), pageWithChildrenLinkClick = (node.type === "page" || node.type === "group" && node.presentation === "page") && hasChildren ? expandOnNavigate : void 0, children = isExpandable && hasChildren ? /* @__PURE__ */ jsx(
139
203
  ExpandableChildren,
140
204
  {
141
205
  activeIndex,
@@ -146,10 +210,11 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
146
210
  expanded,
147
211
  instanceId,
148
212
  nodes,
213
+ onSwitchView,
149
214
  parentExpanded,
150
215
  renderChildren
151
216
  }
152
- ) : node.type === "section" && nodes.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ jsx(
217
+ ) : node.type === "section" && hasChildren ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ jsx(
153
218
  SidebarTreeItem2,
154
219
  {
155
220
  activeIndex,
@@ -159,11 +224,26 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
159
224
  instanceId,
160
225
  itemKey: nodeKey(child, itemKey),
161
226
  node: child,
227
+ onSwitchView,
228
+ parentExpanded
229
+ },
230
+ nodeKey(child, itemKey)
231
+ )) }) : node.type === "view" && hasChildren ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ jsx(
232
+ SidebarTreeItem2,
233
+ {
234
+ activeIndex,
235
+ activeItemRef,
236
+ currentPath,
237
+ depth,
238
+ instanceId,
239
+ itemKey: nodeKey(child, itemKey),
240
+ node: child,
241
+ onSwitchView,
162
242
  parentExpanded
163
243
  },
164
244
  nodeKey(child, itemKey)
165
245
  )) }) : null;
166
- return /* @__PURE__ */ jsx(
246
+ return node.type === "view" ? children : /* @__PURE__ */ jsx(
167
247
  SidebarNode,
168
248
  {
169
249
  activeState,
@@ -175,17 +255,45 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
175
255
  isExpandable,
176
256
  node,
177
257
  onLinkClick: pageWithChildrenLinkClick,
258
+ onSwitchView: node.type === "switch-view" ? () => onSwitchView(node.target) : void 0,
178
259
  onToggle: isExpandable ? toggleExpanded : void 0,
179
260
  parentExpanded,
180
- title: node.title,
261
+ title: node.label ?? "",
181
262
  children
182
263
  }
183
264
  );
184
265
  });
185
- function Sidebar({ className, currentPath, title, tree }) {
186
- let resolvedCurrentPath = usePathname() ?? currentPath ?? "", instanceId = useId(), activeItemRef = useRef(null), viewportRef = useRef(null), activeIndex = useMemo(
187
- () => createActiveIndex({ currentPath: resolvedCurrentPath, tree }),
188
- [resolvedCurrentPath, tree]
266
+ function Sidebar({
267
+ className,
268
+ currentPath,
269
+ title,
270
+ navigation
271
+ }) {
272
+ let resolvedCurrentPath = usePathname() ?? currentPath ?? "", normalizedCurrentPath = normalizePath2(resolvedCurrentPath), [selection, setSelection] = useState(() => ({
273
+ path: normalizedCurrentPath,
274
+ viewId: focusedViewForPath(navigation.items, resolvedCurrentPath)?.id
275
+ })), defaultViewId = focusedViewForPath(
276
+ navigation.items,
277
+ resolvedCurrentPath
278
+ )?.id, viewId = selection.path === normalizedCurrentPath ? selection.viewId : defaultViewId, selectedView = findNavigationView(navigation.items, viewId), visibleNodes = selectedView?.type === "view" ? selectedView.items : navigation.items, switchView = useCallback(
279
+ (target) => {
280
+ let targetView = focusedViewForTarget(navigation.items, target);
281
+ setSelection({ path: normalizedCurrentPath, viewId: targetView?.id });
282
+ },
283
+ [navigation.items, normalizedCurrentPath]
284
+ );
285
+ useEffect(() => {
286
+ setSelection({
287
+ path: normalizedCurrentPath,
288
+ viewId: defaultViewId
289
+ });
290
+ }, [defaultViewId, normalizedCurrentPath]);
291
+ let instanceId = useId(), activeItemRef = useRef(null), viewportRef = useRef(null), activeIndex = useMemo(
292
+ () => createActiveIndex({
293
+ currentPath: resolvedCurrentPath,
294
+ nodes: visibleNodes
295
+ }),
296
+ [resolvedCurrentPath, visibleNodes]
189
297
  );
190
298
  return useEffect(() => {
191
299
  let viewport = viewportRef.current, win = viewport?.ownerDocument.defaultView;
@@ -216,7 +324,7 @@ function Sidebar({ className, currentPath, title, tree }) {
216
324
  scrollbarClassName: "opacity-0 transition-opacity data-[hovering]:opacity-100 data-[scrolling]:opacity-100",
217
325
  variant: "gradient",
218
326
  viewportRef,
219
- children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px px-2 py-3", children: tree.map((node) => /* @__PURE__ */ jsx(
327
+ children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px px-2 py-3", children: visibleNodes.map((node) => /* @__PURE__ */ jsx(
220
328
  SidebarTreeItem,
221
329
  {
222
330
  activeIndex,
@@ -226,6 +334,7 @@ function Sidebar({ className, currentPath, title, tree }) {
226
334
  instanceId,
227
335
  itemKey: nodeKey(node, ""),
228
336
  node,
337
+ onSwitchView: switchView,
229
338
  parentExpanded: !0
230
339
  },
231
340
  nodeKey(node, "")
@@ -1,10 +1,9 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as ButtonProps } from '../../../button-c3WGnxIj.js';
1
+ import * as react from 'react';
2
+ import { B as ButtonProps } from '../../../button-D6Xp2HBm.js';
3
3
  import 'class-variance-authority/types';
4
4
  import 'class-variance-authority';
5
- import 'react';
6
5
 
7
6
  type ThemeToggleProps = Omit<ButtonProps, "children" | "iconOnly" | "leftIcon" | "loading" | "rightIcon">;
8
- declare function ThemeToggle({ className, onClick, size, title, type, variant, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
7
+ declare function ThemeToggle({ className, onClick, size, title, type, variant, ...props }: ThemeToggleProps): react.JSX.Element;
9
8
 
10
9
  export { ThemeToggle, type ThemeToggleProps };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
 
3
- // src/components/ui/theme-toggle.tsx
4
- import { Button } from "@publish.os/nextjs/kernel/components/ui/button";
5
- import { MonitorIcon, MoonIcon, SunIcon } from "@phosphor-icons/react/ssr";
3
+ // src/components/block/theme-toggle.tsx
4
+ import { Button } from "@components/ui/button";
5
+ import { CircleHalfIcon, MoonIcon, SunIcon } from "@phosphor-icons/react/ssr";
6
6
  import { useTheme } from "next-themes";
7
7
  import { useEffect, useMemo, useState } from "react";
8
- import { jsx } from "react/jsx-runtime";
8
+ import { jsx } from "@publish.os/nextjs/jsx-runtime";
9
9
  var themeOrder = ["system", "light", "dark"];
10
10
  function ThemeIcon({ theme }) {
11
- return theme === "light" ? /* @__PURE__ */ jsx(SunIcon, { "aria-hidden": "true", size: 16 }) : theme === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { "aria-hidden": "true", size: 16 }) : /* @__PURE__ */ jsx(MonitorIcon, { "aria-hidden": "true", size: 16 });
11
+ return theme === "light" ? /* @__PURE__ */ jsx(SunIcon, { "aria-hidden": "true", size: 16, weight: "fill" }) : theme === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { "aria-hidden": "true", size: 16, weight: "fill" }) : /* @__PURE__ */ jsx(CircleHalfIcon, { "aria-hidden": "true", size: 16, weight: "fill" });
12
12
  }
13
13
  function normalizeTheme(theme) {
14
14
  return theme === "light" || theme === "dark" ? theme : "system";
@@ -0,0 +1,40 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ type TocHeading = {
5
+ id: string;
6
+ level: number;
7
+ text: string;
8
+ };
9
+
10
+ type TocClientProps = {
11
+ className: string;
12
+ desktopClassName: string;
13
+ desktopListClassName?: string;
14
+ headings: TocHeading[];
15
+ levels: [number, number];
16
+ listClassName?: string;
17
+ mobileClassName: string;
18
+ mobileQuery: string;
19
+ readingOffset?: number;
20
+ title: string;
21
+ children: ReactNode;
22
+ };
23
+ declare function TocClientProvider({ className, desktopClassName, desktopListClassName, headings, levels, listClassName, mobileClassName, mobileQuery, readingOffset, title, children, }: TocClientProps): react.JSX.Element;
24
+ declare function TocDesktop({ children }: {
25
+ children?: ReactNode;
26
+ }): react.JSX.Element;
27
+ declare function TocMobile({ children }: {
28
+ children?: ReactNode;
29
+ }): react.JSX.Element;
30
+ declare function TocMobileHeader({ children }: {
31
+ children?: ReactNode;
32
+ }): react.JSX.Element;
33
+ declare function TocLinksSlot({ className, listClassName, viewport, }: {
34
+ className?: string;
35
+ listClassName?: string;
36
+ viewport?: "desktop" | "mobile";
37
+ }): react.JSX.Element;
38
+ declare function TocTitle({ children, className, ...props }: React.ComponentPropsWithoutRef<"span">): react.JSX.Element;
39
+
40
+ export { TocClientProvider, TocDesktop, TocLinksSlot, TocMobile, TocMobileHeader, TocTitle };