@publish.os/nextjs 0.0.1-alpha.81 → 0.0.1-alpha.91

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 (265) hide show
  1. package/compiler-assets/nextjs/defaults/app/globals.css +1 -0
  2. package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
  3. package/compiler-assets/nextjs/defaults/group/layout.tsx +8 -8
  4. package/compiler-assets/nextjs/defaults/group/page.tsx +44 -43
  5. package/compiler-assets/nextjs/defaults/project/next.config.mjs +33 -13
  6. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -3
  7. package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
  8. package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
  9. package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
  10. package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
  11. package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
  12. package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
  13. package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
  14. package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
  15. package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
  16. package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
  17. package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
  18. package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
  19. package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
  20. package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
  21. package/compiler-assets/nextjs/shims/document.tsx +38 -0
  22. package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
  23. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +18 -2
  24. package/compiler-assets/nextjs/shims/global-layout.tsx +19 -85
  25. package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
  26. package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
  27. package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
  28. package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
  29. package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
  30. package/compiler-assets/nextjs/shims/proxy.ts +143 -65
  31. package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
  32. package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
  33. package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +30 -0
  34. package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
  35. package/compiler-assets/nextjs/shims/site-mdx-components.tsx +112 -0
  36. package/compiler-assets/nextjs/shims/site-mdx.tsx +17 -0
  37. package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
  38. package/dist/build-operation-5QMLXF7N.js +89 -0
  39. package/dist/{button-CFdx-ohV.d.ts → button-BdCScEKi.d.ts} +6 -6
  40. package/dist/capture-local-source-WGGDIUU2.js +258 -0
  41. package/dist/chunk-22RSSUNV.js +13 -0
  42. package/dist/chunk-4BC2L2KA.js +620 -0
  43. package/dist/chunk-5J3YUNRY.js +121 -0
  44. package/dist/chunk-5KAD7W53.js +248 -0
  45. package/dist/chunk-6C65KV7O.js +142 -0
  46. package/dist/chunk-6D2E6UMD.js +695 -0
  47. package/dist/chunk-7NY22B5U.js +161 -0
  48. package/dist/chunk-AI2UULNX.js +9 -0
  49. package/dist/chunk-EFO6AWXN.js +19 -0
  50. package/dist/chunk-F3AGNDF4.js +2377 -0
  51. package/dist/chunk-GBPLER5H.js +426 -0
  52. package/dist/chunk-IL4RJOKI.js +186 -0
  53. package/dist/chunk-NNBJZPFM.js +193 -0
  54. package/dist/chunk-ORIUWJBQ.js +58 -0
  55. package/dist/chunk-OXOFRXEI.js +7129 -0
  56. package/dist/chunk-UYGCOWRF.js +1709 -0
  57. package/dist/chunk-WL75GQ5M.js +80 -0
  58. package/dist/compiler.d.ts +54 -7
  59. package/dist/compiler.js +121 -13147
  60. package/dist/components/blocks/agent-actions.d.ts +81 -0
  61. package/dist/components/blocks/agent-actions.js +594 -0
  62. package/dist/components/blocks/toc.d.ts +43 -0
  63. package/dist/components/blocks/toc.js +136 -0
  64. package/dist/components/ui/button.d.ts +5 -0
  65. package/dist/components/ui/button.js +94 -0
  66. package/dist/compose-CVBJRAF6.js +16 -0
  67. package/dist/config/createNextConfig.js +27 -0
  68. package/dist/dev-operation-OSHHWRWK.js +1095 -0
  69. package/dist/framework-selection-ZVO323PK.js +11 -0
  70. package/dist/ide-support-CU6Z5PVR.js +16 -0
  71. package/dist/index.d.ts +55 -4
  72. package/dist/jsx-dev-runtime.d.ts +6 -0
  73. package/dist/jsx-dev-runtime.js +100 -0
  74. package/dist/jsx-runtime.d.ts +7 -0
  75. package/dist/jsx-runtime.js +97 -0
  76. package/dist/kernel/components/blocks/AgentActions.d.ts +35 -6
  77. package/dist/kernel/components/blocks/AgentActions.js +401 -150
  78. package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
  79. package/dist/kernel/components/blocks/agent-actions.js +594 -0
  80. package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
  81. package/dist/kernel/components/blocks/color-palette.js +4 -4
  82. package/dist/kernel/components/blocks/logo-block.js +3 -3
  83. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
  84. package/dist/kernel/components/blocks/nav-breadcrumb.js +22 -7
  85. package/dist/kernel/components/blocks/navbar.d.ts +2 -2
  86. package/dist/kernel/components/blocks/navbar.js +406 -65
  87. package/dist/kernel/components/blocks/navigation-progress.js +6 -3
  88. package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
  89. package/dist/kernel/components/blocks/next-prev.js +12 -24
  90. package/dist/kernel/components/blocks/page-list.d.ts +1 -1
  91. package/dist/kernel/components/blocks/page-list.js +7 -6
  92. package/dist/kernel/components/blocks/search.d.ts +83 -58
  93. package/dist/kernel/components/blocks/search.js +554 -428
  94. package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
  95. package/dist/kernel/components/blocks/sidebar-node.js +12 -10
  96. package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
  97. package/dist/kernel/components/blocks/sidebar.js +24 -14
  98. package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
  99. package/dist/kernel/components/blocks/theme-toggle.js +47 -1
  100. package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
  101. package/dist/kernel/components/blocks/toc-client.js +495 -0
  102. package/dist/kernel/components/blocks/toc.d.ts +19 -1
  103. package/dist/kernel/components/blocks/toc.js +122 -180
  104. package/dist/kernel/components/mdx/components/blockquote.js +2 -2
  105. package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
  106. package/dist/kernel/components/mdx/components/callout.js +67 -36
  107. package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
  108. package/dist/kernel/components/mdx/components/code-block.js +106 -5
  109. package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
  110. package/dist/kernel/components/mdx/components/copy-code-button.js +61 -0
  111. package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
  112. package/dist/kernel/components/mdx/components/figure-caption.js +4 -3
  113. package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
  114. package/dist/kernel/components/mdx/components/figure.js +24 -14
  115. package/dist/kernel/components/mdx/components/footnotes.js +1 -1
  116. package/dist/kernel/components/mdx/components/heading-copy-link.js +4 -4
  117. package/dist/kernel/components/mdx/components/heading.js +6 -3
  118. package/dist/kernel/components/mdx/components/hr.js +2 -2
  119. package/dist/kernel/components/mdx/components/image-zoom.js +2 -2
  120. package/dist/kernel/components/mdx/components/image.d.ts +1 -1
  121. package/dist/kernel/components/mdx/components/image.js +94 -68
  122. package/dist/kernel/components/mdx/components/inline-code.js +2 -2
  123. package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
  124. package/dist/kernel/components/mdx/components/kbd.js +5 -4
  125. package/dist/kernel/components/mdx/components/link.d.ts +35 -4
  126. package/dist/kernel/components/mdx/components/link.js +3 -3
  127. package/dist/kernel/components/mdx/components/paragraph.js +2 -5
  128. package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
  129. package/dist/kernel/components/mdx/components/table.js +2 -2
  130. package/dist/kernel/components/mdx/components/task-list.js +2 -2
  131. package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
  132. package/dist/kernel/components/mdx/components/video-player.js +8 -4
  133. package/dist/kernel/components/mdx/components/video.d.ts +5 -3
  134. package/dist/kernel/components/mdx/components/video.js +8 -6
  135. package/dist/kernel/components/mdx/error-boundary.js +2 -2
  136. package/dist/kernel/components/mdx/error-fallback.js +1 -1
  137. package/dist/kernel/components/mdx/mdx.d.ts +28 -14
  138. package/dist/kernel/components/mdx/mdx.js +336 -63
  139. package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
  140. package/dist/kernel/components/mdx/rehype-heading-ids.js +6 -4
  141. package/dist/kernel/components/next-image.d.ts +12 -0
  142. package/dist/kernel/components/next-image.js +61 -0
  143. package/dist/kernel/components/ui/accordion.js +1 -1
  144. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +6 -23
  145. package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
  146. package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
  147. package/dist/kernel/components/ui/breadcrumb.js +10 -8
  148. package/dist/kernel/components/ui/button-group.js +8 -7
  149. package/dist/kernel/components/ui/button.d.ts +58 -6
  150. package/dist/kernel/components/ui/button.js +43 -39
  151. package/dist/kernel/components/ui/card.d.ts +2 -2
  152. package/dist/kernel/components/ui/card.js +1 -1
  153. package/dist/kernel/components/ui/dialog.js +1 -1
  154. package/dist/kernel/components/ui/drawer.d.ts +3 -1
  155. package/dist/kernel/components/ui/drawer.js +6 -2
  156. package/dist/kernel/components/ui/input.d.ts +2 -2
  157. package/dist/kernel/components/ui/input.js +1 -1
  158. package/dist/kernel/components/ui/kbd.js +10 -17
  159. package/dist/kernel/components/ui/link.d.ts +11 -3
  160. package/dist/kernel/components/ui/link.js +12 -11
  161. package/dist/kernel/components/ui/menu.js +6 -6
  162. package/dist/kernel/components/ui/mod-key.d.ts +10 -0
  163. package/dist/kernel/components/ui/mod-key.js +36 -0
  164. package/dist/kernel/components/ui/navigation-menu.js +3 -3
  165. package/dist/kernel/components/ui/popover.js +1 -1
  166. package/dist/kernel/components/ui/progress.js +2 -2
  167. package/dist/kernel/components/ui/scroll-area.js +5 -5
  168. package/dist/kernel/components/ui/select.js +8 -11
  169. package/dist/kernel/components/ui/separator.js +1 -1
  170. package/dist/kernel/components/ui/table.js +1 -1
  171. package/dist/kernel/components/ui/tabs.js +1 -1
  172. package/dist/kernel/components/ui/tag.js +1 -1
  173. package/dist/kernel/components/ui/text.d.ts +2 -2
  174. package/dist/kernel/components/ui/text.js +1 -1
  175. package/dist/kernel/components/ui/toast.js +1 -1
  176. package/dist/kernel/components/ui/tooltip.js +1 -1
  177. package/dist/kernel/defaults.registry.d.ts +11 -24
  178. package/dist/kernel/defaults.registry.js +11 -26
  179. package/dist/kernel/routes/agent/markdown.d.ts +3 -1
  180. package/dist/kernel/routes/agent/markdown.js +219 -48
  181. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  182. package/dist/kernel/routes/layouts/group.js +5 -7
  183. package/dist/kernel/routes/metadata/feed.d.ts +1 -1
  184. package/dist/kernel/routes/metadata/feed.js +111 -81
  185. package/dist/kernel/routes/metadata/llms.d.ts +12 -3
  186. package/dist/kernel/routes/metadata/llms.js +156 -59
  187. package/dist/kernel/routes/metadata/og-image.js +1 -1
  188. package/dist/kernel/routes/metadata/robots.d.ts +1 -1
  189. package/dist/kernel/routes/metadata/robots.js +2 -2
  190. package/dist/kernel/routes/metadata/sitemap.d.ts +26 -4
  191. package/dist/kernel/routes/metadata/sitemap.js +206 -38
  192. package/dist/kernel/routes/not-found.d.ts +34 -0
  193. package/dist/kernel/routes/not-found.js +213 -0
  194. package/dist/kernel/routes/pages/group.d.ts +2 -2
  195. package/dist/kernel/routes/pages/group.js +21 -13
  196. package/dist/kernel/routes/pages/leaf.d.ts +28 -1
  197. package/dist/kernel/routes/pages/leaf.js +25 -16
  198. package/dist/kernel/routes/pages/root.js +19 -13
  199. package/dist/keyboard-shortcuts.js +1 -1
  200. package/dist/resolvers/manifest-resolver.js +29 -6
  201. package/dist/search.d.ts +6 -7
  202. package/dist/search.js +52 -29
  203. package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
  204. package/dist/theme-scope.js +1 -1
  205. package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
  206. package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
  207. package/dist/{types-CIwwieNw.d.ts → types-J2w_puPF.d.ts} +11 -10
  208. package/dist/types.d.ts +15 -6
  209. package/dist/utils/heading-ids.js +30 -11
  210. package/dist/utils/toc-selection.d.ts +7 -0
  211. package/dist/utils/toc-selection.js +14 -0
  212. package/dist/validate-local-source-SV44DBQT.js +16 -0
  213. package/dist/validate-publish-os-source-NZJF3TB2.js +14 -0
  214. package/init/seed/minimal/.gitignore +1 -0
  215. package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
  216. package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
  217. package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
  218. package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
  219. package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
  220. package/init/seed/minimal/publish.os/blog/index.tsx +82 -0
  221. package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
  222. package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
  223. package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
  224. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +6 -11
  225. package/init/seed/minimal/publish.os/docs/content/groups.mdx +6 -7
  226. package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
  227. package/init/seed/minimal/publish.os/publish.os.config.json +7 -7
  228. package/init/seed/minimal/publish.os/theme.css +52 -24
  229. package/init/seed/minimal/publish.os/tsconfig.json +3 -0
  230. package/init/seed/minimal/seed.json +12 -2
  231. package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
  232. package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
  233. package/init/seed/scratch/seed.json +5 -0
  234. package/package.json +55 -44
  235. package/release/app/phosphor/package.json +5 -5
  236. package/release/app/phosphor/pnpm-lock.yaml.template +553 -377
  237. package/release/app/phosphor/pnpm-workspace.yaml +3 -0
  238. package/release/compiler/package.json +5 -3
  239. package/release/compiler/pnpm-lock.yaml.template +500 -303
  240. package/release/compiler/pnpm-workspace.yaml +3 -0
  241. package/release/release.json +8 -37
  242. package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
  243. package/dist/icons.d.ts +0 -1
  244. package/dist/icons.js +0 -2
  245. package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
  246. package/dist/kernel/components/blocks/design-system-preview.js +0 -648
  247. package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
  248. package/dist/kernel/components/blocks/link-playground.js +0 -744
  249. package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
  250. package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
  251. package/dist/kernel/components/mdx/components/pre.d.ts +0 -6
  252. package/dist/kernel/components/mdx/components/pre.js +0 -18
  253. package/dist/kernel/components/ui/meta-key.d.ts +0 -17
  254. package/dist/kernel/components/ui/meta-key.js +0 -9
  255. package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
  256. package/dist/kernel/components/ui/theme-toggle.js +0 -58
  257. package/dist/kernel/framework-icons.d.ts +0 -1
  258. package/dist/kernel/framework-icons.js +0 -39
  259. package/dist/link-CYaCRDb6.d.ts +0 -35
  260. package/release/app/lucide/package.json +0 -30
  261. package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
  262. package/release/app/lucide/pnpm-workspace.yaml +0 -11
  263. package/release/app/tabler/package.json +0 -30
  264. package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
  265. package/release/app/tabler/pnpm-workspace.yaml +0 -11
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-Bgchdfd6.js';
2
+ import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-DKpR27II.js';
3
3
  import 'react';
4
- import '../../../types-DHBm7-j6.js';
4
+ import '../../../types-CJWRG05y.js';
5
5
 
6
6
  declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps): react_jsx_runtime.JSX.Element | null;
7
7
 
@@ -1,9 +1,9 @@
1
- // src/components/block/navigation/sidebar-node.tsx
2
- import { FrameworkChevronRightIcon as ChevronRight } from "@publish.os/nextjs/kernel/framework-icons";
1
+ // src/components/block/sidebar/sidebar-node.tsx
2
+ 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",
@@ -42,12 +42,12 @@ var SIDEBAR_NODE_VARIANT = "base", depthClassByDepth = {
42
42
  variant: {
43
43
  base: [
44
44
  "font-normal text-foreground-2 hover:bg-surface-hover hover:text-foreground-1",
45
- "data-[state=child-path-active]:bg-surface-2 data-[state=child-path-active]:font-medium data-[state=child-path-active]:text-foreground-1",
46
- "data-[state=path-active]:bg-surface-active data-[state=path-active]:font-medium data-[state=path-active]:text-foreground-1 data-[state=path-active]:shadow-xs"
45
+ "data-[state=child-path-active]:bg-surface-active data-[state=child-path-active]:text-foreground-1",
46
+ "data-[state=path-active]:bg-surface-active data-[state=path-active]:font-medium data-[state=path-active]:text-foreground-1"
47
47
  ].join(" "),
48
48
  minimal: [
49
49
  "font-normal text-foreground-2 hover:text-foreground-1 hover:opacity-90",
50
- "data-[state=child-path-active]:font-medium data-[state=child-path-active]:text-foreground-1",
50
+ "data-[state=child-path-active]:text-foreground-1",
51
51
  "data-[state=path-active]:font-semibold data-[state=path-active]:text-foreground-1 data-[state=path-active]:[text-shadow:0_0_0_currentColor]"
52
52
  ].join(" ")
53
53
  }
@@ -78,10 +78,10 @@ function Caret({ active, expanded }) {
78
78
  "span",
79
79
  {
80
80
  className: cn(
81
- "block transition-transform duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",
81
+ "block transition-transform duration-300 ease-in-out",
82
82
  expanded ? "rotate-90" : "rotate-0"
83
83
  ),
84
- children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", size: 13 })
84
+ children: /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", size: 13 })
85
85
  }
86
86
  )
87
87
  }
@@ -112,7 +112,7 @@ function RowInner({
112
112
  );
113
113
  }
114
114
  function RowText({ title }) {
115
- return /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 whitespace-normal break-words text-pretty", children: title });
115
+ return /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 whitespace-normal wrap-break-word text-pretty", children: title });
116
116
  }
117
117
  function ExternalLinkIndicator() {
118
118
  return /* @__PURE__ */ jsx(
@@ -128,6 +128,7 @@ function SidebarLink({
128
128
  active,
129
129
  children,
130
130
  className,
131
+ external = !1,
131
132
  href,
132
133
  onClick,
133
134
  parentExpanded,
@@ -143,7 +144,7 @@ function SidebarLink({
143
144
  tabIndex: parentExpanded ? void 0 : -1,
144
145
  ...props
145
146
  };
146
- return isExternalHref(href) ? /* @__PURE__ */ jsx("a", { href, rel: mergeRel(void 0), target: "_blank", ...commonProps, children }) : /* @__PURE__ */ jsx(NextLink, { href, ...commonProps, children });
147
+ return external && isExternalHref(href) ? /* @__PURE__ */ jsx("a", { href, rel: mergeRel(void 0), target: "_blank", ...commonProps, children }) : /* @__PURE__ */ jsx(NextLink, { href, ...commonProps, children });
147
148
  }
148
149
  function SidebarNode({
149
150
  activeState,
@@ -206,6 +207,7 @@ function SidebarNode({
206
207
  active: isActive,
207
208
  "aria-controls": isExpandable ? contentId : void 0,
208
209
  "aria-expanded": isExpandable ? expanded : void 0,
210
+ external: isExternalLinkNode,
209
211
  href,
210
212
  onClick: onLinkClick,
211
213
  parentExpanded,
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { a as SidebarTreeNode } from '../../../sidebar-types-Bgchdfd6.js';
4
- export { b as SidebarActiveState, c as SidebarDepth, S as SidebarNodePrimitiveProps } from '../../../sidebar-types-Bgchdfd6.js';
5
- import '../../../types-DHBm7-j6.js';
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';
6
6
 
7
7
  type SidebarProps = {
8
8
  className?: string;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
 
3
- // src/components/block/navigation/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";
3
+ // src/components/block/sidebar/sidebar.tsx
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,7 +15,7 @@ import {
15
15
  useRef,
16
16
  useState
17
17
  } from "react";
18
- import { jsx, jsxs } from "react/jsx-runtime";
18
+ import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
19
19
  function normalizePath(path) {
20
20
  if (!path) return "";
21
21
  let [withoutQuery = ""] = path.split(/[?#]/);
@@ -25,9 +25,13 @@ function isExternalHref(href) {
25
25
  return /^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith("//");
26
26
  }
27
27
  function nodeHref(node) {
28
- if (node.type === "link") return node.href;
28
+ if (node.type === "link" || "href" in node && typeof node.href == "string") return node.href;
29
29
  if ("path" in node && typeof node.path == "string") return node.path;
30
30
  }
31
+ function nodePath(node) {
32
+ if (node.type !== "link" && "path" in node && typeof node.path == "string")
33
+ return node.path;
34
+ }
31
35
  function nodeChildren(node) {
32
36
  return Array.isArray(node.children) ? node.children : [];
33
37
  }
@@ -49,7 +53,10 @@ function createActiveIndex({
49
53
  }) {
50
54
  let activeIndex = /* @__PURE__ */ new Map();
51
55
  function visit(node) {
52
- let href = nodeHref(node), exactActive = isExactActivePath(href, currentPath), pathActive = node.type === "page" && isActivePath(href, currentPath), childActive = nodeChildren(node).some(visit), activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
56
+ let path = nodePath(node), exactActive = isExactActivePath(path, currentPath), pathActive = node.type === "page" && isActivePath(path, currentPath), childActive = !1;
57
+ for (let child of nodeChildren(node))
58
+ childActive = visit(child) || childActive;
59
+ let activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
53
60
  return activeIndex.set(node, {
54
61
  activeState,
55
62
  initiallyExpanded: exactActive || pathActive || childActive
@@ -90,7 +97,7 @@ function ExpandableChildren({
90
97
  {
91
98
  "aria-hidden": !expanded,
92
99
  className: cn(
93
- "grid overflow-hidden transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",
100
+ "grid overflow-hidden transition-[grid-template-rows] duration-300 ease-in-out",
94
101
  expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
95
102
  ),
96
103
  "data-state": expanded ? "open" : "closed",
@@ -179,18 +186,20 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
179
186
  );
180
187
  });
181
188
  function Sidebar({ className, currentPath, title, tree }) {
182
- let resolvedCurrentPath = usePathname() ?? currentPath ?? "", instanceId = useId(), activeItemRef = useRef(null), activeIndex = useMemo(
189
+ let resolvedCurrentPath = usePathname() ?? currentPath ?? "", instanceId = useId(), activeItemRef = useRef(null), viewportRef = useRef(null), activeIndex = useMemo(
183
190
  () => createActiveIndex({ currentPath: resolvedCurrentPath, tree }),
184
191
  [resolvedCurrentPath, tree]
185
192
  );
186
193
  return useEffect(() => {
187
- let scrollPath = resolvedCurrentPath, frame = window.requestAnimationFrame(() => {
188
- scrollPath && activeItemRef.current?.scrollIntoView({
189
- block: "nearest",
190
- inline: "nearest"
191
- });
194
+ let viewport = viewportRef.current, win = viewport?.ownerDocument.defaultView;
195
+ if (!resolvedCurrentPath || !viewport || !win) return;
196
+ let frame = win.requestAnimationFrame(() => {
197
+ let item = activeItemRef.current;
198
+ if (!item) return;
199
+ let itemBounds = item.getBoundingClientRect(), viewportBounds = viewport.getBoundingClientRect();
200
+ itemBounds.top < viewportBounds.top ? viewport.scrollTop += itemBounds.top - viewportBounds.top : itemBounds.bottom > viewportBounds.bottom && (viewport.scrollTop += itemBounds.bottom - viewportBounds.bottom);
192
201
  });
193
- return () => window.cancelAnimationFrame(frame);
202
+ return () => win.cancelAnimationFrame(frame);
194
203
  }, [resolvedCurrentPath]), /* @__PURE__ */ jsxs(
195
204
  "nav",
196
205
  {
@@ -209,6 +218,7 @@ function Sidebar({ className, currentPath, title, tree }) {
209
218
  mask: { height: 24 },
210
219
  scrollbarClassName: "opacity-0 transition-opacity data-[hovering]:opacity-100 data-[scrolling]:opacity-100",
211
220
  variant: "gradient",
221
+ viewportRef,
212
222
  children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px px-2 py-3", children: tree.map((node) => /* @__PURE__ */ jsx(
213
223
  SidebarTreeItem,
214
224
  {
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as ButtonProps } from '../../../button-CFdx-ohV.js';
2
+ import { B as ButtonProps } from '../../../button-BdCScEKi.js';
3
3
  import 'class-variance-authority/types';
4
4
  import 'class-variance-authority';
5
5
  import 'react';
@@ -7,4 +7,4 @@ import 'react';
7
7
  type ThemeToggleProps = Omit<ButtonProps, "children" | "iconOnly" | "leftIcon" | "loading" | "rightIcon">;
8
8
  declare function ThemeToggle({ className, onClick, size, title, type, variant, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
9
9
 
10
- export { ThemeToggle };
10
+ export { ThemeToggle, type ThemeToggleProps };
@@ -1,7 +1,53 @@
1
1
  "use client";
2
2
 
3
3
  // src/components/block/theme-toggle.tsx
4
- import { ThemeToggle } from "@publish.os/nextjs/kernel/components/ui/theme-toggle";
4
+ import { Button } from "@components/ui/button";
5
+ import { CircleHalfIcon, MoonIcon, SunIcon } from "@phosphor-icons/react/ssr";
6
+ import { useTheme } from "next-themes";
7
+ import { useEffect, useMemo, useState } from "react";
8
+ import { jsx } from "@publish.os/nextjs/jsx-runtime";
9
+ var themeOrder = ["system", "light", "dark"];
10
+ function ThemeIcon({ theme }) {
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
+ }
13
+ function normalizeTheme(theme) {
14
+ return theme === "light" || theme === "dark" ? theme : "system";
15
+ }
16
+ function ThemeToggle({
17
+ className,
18
+ onClick,
19
+ size = "sm",
20
+ title,
21
+ type = "button",
22
+ variant = "ghost",
23
+ ...props
24
+ }) {
25
+ let { theme, setTheme } = useTheme(), [mounted, setMounted] = useState(!1), activeTheme = normalizeTheme(theme), nextTheme = useMemo(() => {
26
+ let index = themeOrder.indexOf(activeTheme);
27
+ return themeOrder[(index + 1) % themeOrder.length] ?? "system";
28
+ }, [activeTheme]);
29
+ useEffect(() => {
30
+ setMounted(!0);
31
+ }, []);
32
+ let label = mounted ? `Switch to ${nextTheme} theme` : "Theme preference";
33
+ return /* @__PURE__ */ jsx(
34
+ Button,
35
+ {
36
+ "aria-label": props["aria-label"] ?? label,
37
+ className,
38
+ iconOnly: !0,
39
+ onClick: (event) => {
40
+ onClick?.(event), event.defaultPrevented || setTheme(nextTheme);
41
+ },
42
+ size,
43
+ title: title ?? label,
44
+ type,
45
+ variant,
46
+ ...props,
47
+ children: /* @__PURE__ */ jsx(ThemeIcon, { theme: mounted ? activeTheme : "system" })
48
+ }
49
+ );
50
+ }
5
51
  export {
6
52
  ThemeToggle
7
53
  };
@@ -0,0 +1,40 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
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_runtime.JSX.Element;
24
+ declare function TocDesktop({ children }: {
25
+ children?: ReactNode;
26
+ }): react_jsx_runtime.JSX.Element;
27
+ declare function TocMobile({ children }: {
28
+ children?: ReactNode;
29
+ }): react_jsx_runtime.JSX.Element;
30
+ declare function TocMobileHeader({ children }: {
31
+ children?: ReactNode;
32
+ }): react_jsx_runtime.JSX.Element;
33
+ declare function TocLinksSlot({ className, listClassName, viewport, }: {
34
+ className?: string;
35
+ listClassName?: string;
36
+ viewport?: "desktop" | "mobile";
37
+ }): react_jsx_runtime.JSX.Element;
38
+ declare function TocTitle({ children, className, ...props }: React.ComponentPropsWithoutRef<"span">): react_jsx_runtime.JSX.Element;
39
+
40
+ export { TocClientProvider, TocDesktop, TocLinksSlot, TocMobile, TocMobileHeader, TocTitle };