@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
package/dist/index.d.ts CHANGED
@@ -1,98 +1,134 @@
1
1
  export { tags } from './cache/tags.js';
2
2
  export { createNextConfig } from './config/createNextConfig.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import React$1, { ReactNode } from 'react';
3
+ import * as react from 'react';
4
+ import react__default, { ReactNode } from 'react';
5
5
  import { CnFunction } from 'cn';
6
6
  import 'next';
7
7
 
8
- type SiteData = {
9
- name: string;
10
- description?: string;
11
- origin?: string;
12
- og?: OgIndexMetadata;
13
- };
14
- type OgImageMetadata = string | {
8
+ type OgImageMetadata$1 = string | {
15
9
  src: string;
16
10
  alt?: string;
17
11
  };
18
- type OgMetadata = {
12
+ type OgMetadata$1 = {
19
13
  title?: string;
20
14
  description?: string;
21
- image?: OgImageMetadata;
15
+ image?: OgImageMetadata$1;
22
16
  };
23
- type OgIndexMetadata = OgMetadata & {
24
- scope?: "page" | "subtree";
17
+ type PageStatus$1 = "published" | "draft";
18
+ type PageMetadata$1 = {
19
+ openGraph?: OgMetadata$1;
20
+ robots?: {
21
+ index?: boolean;
22
+ follow?: boolean;
23
+ };
25
24
  };
26
- type Author = {
27
- id?: string;
28
- name: string;
29
- handle?: string;
30
- avatar?: string;
31
- url?: string;
25
+ type PageFrontmatter$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
26
+ title: string;
27
+ description: string;
28
+ slug: string;
29
+ status: PageStatus$1;
30
+ metadata: PageMetadata$1;
32
31
  };
33
- type PageStatus = "published" | "draft" | "archived";
34
- type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
32
+ type PageData$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
35
33
  fileID: string;
36
34
  group: string;
37
- slug: string;
38
35
  path: string;
39
- title: string;
40
- description?: string;
41
- status: PageStatus;
42
- publishedAt?: string;
43
- updatedAt?: string;
44
- authors: Author[];
45
- tags: string[];
46
- og?: OgMetadata;
47
- meta: TMeta;
36
+ frontmatter: PageFrontmatter$1<TCustom>;
48
37
  body: string;
49
38
  };
50
- type PageNode = {
39
+ type NavigationPageNode = {
40
+ id: string;
51
41
  type: "page";
52
- fileID: string;
53
- title: string;
54
- path: string;
55
- href?: string;
56
- group: string;
57
- description?: string;
58
- status: PageStatus;
59
- publishedAt?: string;
60
- updatedAt?: string;
61
- authors: Author[];
62
- tags?: string[];
63
- og?: OgMetadata;
64
- meta: Record<string, unknown>;
65
- };
66
- type SectionNode = {
67
- type: "section";
42
+ label: string;
43
+ href: string;
44
+ page: Omit<PageData$1, "body">;
45
+ children?: NavigationNode[];
46
+ };
47
+ type NavigationGroupNode = {
68
48
  id: string;
69
- title: string;
70
- path?: string;
49
+ type: "group";
50
+ label: string;
51
+ groupKey: string;
52
+ route: string;
53
+ presentation: "page" | "folder";
71
54
  href?: string;
72
- group?: string;
73
- children: TreeNode[];
55
+ children: NavigationNode[];
74
56
  };
75
- type FolderNode = {
76
- type: "folder";
57
+ type NavigationContainerNode = {
77
58
  id: string;
78
- title: string;
79
- path?: string;
80
- href?: string;
81
- group?: string;
82
- children: TreeNode[];
59
+ type: "section" | "folder";
60
+ label: string;
61
+ children: NavigationNode[];
83
62
  };
84
- type LinkNode = {
63
+ type NavigationLinkNode = {
64
+ id: string;
85
65
  type: "link";
66
+ label: string;
67
+ href: string;
68
+ };
69
+ type NavigationViewNode = {
70
+ id: string;
71
+ type: "view";
72
+ label?: string;
73
+ viewId?: string;
74
+ items: NavigationNode[];
75
+ };
76
+ type NavigationSwitchViewNode = {
86
77
  id: string;
78
+ type: "switch-view";
79
+ label: string;
80
+ target: string | {
81
+ view: string;
82
+ };
83
+ };
84
+ type NavigationNode = NavigationPageNode | NavigationGroupNode | NavigationContainerNode | NavigationLinkNode | NavigationViewNode | NavigationSwitchViewNode;
85
+ type ResolvedNavigation = {
86
+ rootGroup: string;
87
+ items: NavigationNode[];
88
+ };
89
+
90
+ type SiteData = {
91
+ name: string;
92
+ description?: string;
93
+ origin?: string;
94
+ metadata?: IndexMetadata;
95
+ };
96
+ type OgImageMetadata = string | {
97
+ src: string;
98
+ alt?: string;
99
+ };
100
+ type OgMetadata = {
101
+ title?: string;
102
+ description?: string;
103
+ image?: OgImageMetadata;
104
+ };
105
+ type IndexMetadata = {
106
+ openGraph?: OgMetadata & {
107
+ scope?: "page" | "subtree";
108
+ };
109
+ };
110
+ type PageStatus = "published" | "draft";
111
+ type PageMetadata = {
112
+ openGraph?: OgMetadata;
113
+ robots?: {
114
+ index?: boolean;
115
+ follow?: boolean;
116
+ };
117
+ };
118
+ type PageFrontmatter<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
87
119
  title: string;
88
- href: string;
120
+ description: string;
121
+ slug: string;
122
+ status: PageStatus;
123
+ metadata: PageMetadata;
124
+ };
125
+ type PageData<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
126
+ fileID: string;
127
+ group: string;
128
+ path: string;
129
+ frontmatter: PageFrontmatter<TCustom>;
130
+ body: string;
89
131
  };
90
- type TreeNode = PageNode | SectionNode | FolderNode | LinkNode;
91
- type NavPage = PageNode;
92
- type NavLink = LinkNode;
93
- type NavSection = SectionNode;
94
- type NavFolder = FolderNode;
95
- type NavItem = TreeNode;
96
132
  type RouteRecord = {
97
133
  fileID: string;
98
134
  slug: string;
@@ -114,9 +150,9 @@ type GroupManifest = {
114
150
  path: string;
115
151
  origin?: string;
116
152
  ancestry?: string[];
117
- og?: OgIndexMetadata;
153
+ metadata?: IndexMetadata;
118
154
  meta?: Record<string, unknown>;
119
- tree: TreeNode[];
155
+ navigation: ResolvedNavigation;
120
156
  pages: PageData[];
121
157
  };
122
158
  type ManifestLike = {
@@ -124,42 +160,42 @@ type ManifestLike = {
124
160
  groups: Record<string, GroupManifest>;
125
161
  routes: RouteRecord[];
126
162
  pages: PageData[];
127
- tree: TreeNode[];
128
163
  attribution?: Record<string, ResolvedAttribution>;
129
164
  contentHash: string;
130
165
  };
131
166
  type RootLayoutProps = {
132
167
  children: React.ReactNode;
133
168
  site: SiteData;
134
- tree: TreeNode[];
169
+ navigation: ResolvedNavigation;
135
170
  currentPath?: string;
136
171
  currentGroup?: GroupContext;
137
172
  activeGroups?: readonly GroupContext[];
138
173
  };
139
174
  type RootPageProps = {
140
175
  site: SiteData;
141
- tree: TreeNode[];
176
+ navigation: ResolvedNavigation;
142
177
  };
143
178
  type LayoutProps = {
144
179
  children: React.ReactNode;
145
180
  site: SiteData;
146
- tree: TreeNode[];
147
- node: TreeNode;
181
+ navigation: ResolvedNavigation;
182
+ node: NavigationNode;
148
183
  currentPath: string;
149
184
  group: string;
150
185
  };
151
186
  type PageProps<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
152
187
  site: SiteData;
153
- tree: TreeNode[];
154
- node: TreeNode;
188
+ navigation: ResolvedNavigation;
189
+ node: NavigationNode;
155
190
  page: PageData<TMeta>;
191
+ markdownRevision?: string;
156
192
  currentPath: string;
157
193
  group: string;
158
194
  };
159
195
  type IndexPageProps = {
160
196
  site: SiteData;
161
- tree: TreeNode[];
162
- node: TreeNode;
197
+ navigation: ResolvedNavigation;
198
+ node: NavigationNode;
163
199
  currentPath: string;
164
200
  group: string;
165
201
  };
@@ -178,35 +214,26 @@ type GroupContext = {
178
214
  };
179
215
 
180
216
  type PageListProps = {
181
- tree: TreeNode[];
217
+ navigation: ResolvedNavigation;
182
218
  currentPath?: string;
183
219
  className?: string;
184
220
  };
185
- declare function PageList({ tree, currentPath, className }: PageListProps): react_jsx_runtime.JSX.Element | null;
221
+ declare function PageList({ navigation, currentPath, className, }: PageListProps): react.JSX.Element | null;
186
222
 
187
223
  type FeedScope = "site" | "group" | "self";
188
224
  type FeedRouteOptions = {
189
225
  scope?: FeedScope;
190
226
  group?: string;
191
227
  limit?: number;
192
- status?: PageStatus[];
193
228
  };
194
229
  declare function createRssFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
195
230
  declare function createAtomFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
196
231
  declare function createJsonFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
197
232
 
198
- type LlmsRouteOptions = {
199
- scope?: "site" | "group" | "self";
200
- group?: string;
201
- limit?: number;
202
- includeDescriptions?: boolean;
203
- links?: Array<{
204
- title: string;
205
- path: string;
206
- group?: string;
207
- }>;
233
+ type LlmsTxtOutput = {
234
+ body: string;
208
235
  };
209
- declare function createLlmsTxtRoute(manifest: ManifestLike, options?: LlmsRouteOptions): () => Promise<Response>;
236
+ declare function createLlmsTxtRoute(output: LlmsTxtOutput): () => Response;
210
237
 
211
238
  type OgImageEntryLike = {
212
239
  key: string;
@@ -279,10 +306,22 @@ declare function createOgImageStaticParams({ manifest }: OgImageRouteConfig): {
279
306
  key: string;
280
307
  }[];
281
308
 
282
- declare function createRobotsTxtRoute(manifest: ManifestLike): () => Promise<Response>;
309
+ declare function createRobotsTxtRoute(defaultOutput: {
310
+ body: string;
311
+ }, outputsByOrigin?: Record<string, {
312
+ body: string;
313
+ }>): (request: Request) => Response;
283
314
 
315
+ type SitemapReference = {
316
+ path: string;
317
+ group?: string;
318
+ };
284
319
  type SitemapRouteOptions = {
285
320
  group?: string;
321
+ path?: string;
322
+ includeUrls?: SitemapReference[];
323
+ sitemaps?: SitemapReference[];
324
+ exclude?: SitemapReference[];
286
325
  };
287
326
  declare function createSitemapXmlRoute(manifest: ManifestLike, options?: SitemapRouteOptions): () => Promise<Response>;
288
327
 
@@ -290,7 +329,7 @@ type ResolvedLeaf = PageProps;
290
329
  type ResolvedGroup = Omit<IndexPageProps, "children">;
291
330
  declare function resolveLeaf(manifest: ManifestLike, group: string, slug: string | string[]): ResolvedLeaf | null;
292
331
  declare function resolveGroup(manifest: ManifestLike, group: string): ResolvedGroup | null;
293
- declare function resolveGroupLayout(manifest: ManifestLike, group: string, children: React$1.ReactNode): LayoutProps | null;
332
+ declare function resolveGroupLayout(manifest: ManifestLike, group: string, children: react__default.ReactNode): LayoutProps | null;
294
333
  declare function listStaticParams(manifest: ManifestLike, group: string): Array<{
295
334
  slug: string[];
296
335
  }>;
@@ -315,4 +354,21 @@ declare function createHeadingIdGenerator(): HeadingIdGenerator;
315
354
  declare function extractMdxHeadings(content: string | undefined, levels: [number, number]): MdxHeadingItem[];
316
355
  declare function urlIdToText(urlId: string): string;
317
356
 
318
- export { type GroupContext, type HeadingIdGenerator, type IndexPageProps, type LayoutProps, type ManifestLike, type MdxHeadingItem, type NavFolder, type NavItem, type NavLink, type NavPage, type NavSection, type OgImageMetadata, type OgMetadata, type PageData, PageList, type PageProps, type ResolvedAttribution, type RootLayoutProps, type RootPageProps, type SiteData, type TreeNode, cleanHeadingText, cn, createAtomFeedRoute, createHeadingIdGenerator, createJsonFeedRoute, createLlmsTxtRoute, createOgImageRoute, createOgImageStaticParams, createRobotsTxtRoute, createRssFeedRoute, createSitemapXmlRoute, extractMdxHeadings, headingToHTMLId, listStaticParams, resolveGroup, resolveGroupLayout, resolveLeaf, urlIdToText };
357
+ type NavigationPageSelection = {
358
+ id: string;
359
+ label: string;
360
+ href: string;
361
+ path: string;
362
+ page: NavigationPageNode["page"];
363
+ group?: never;
364
+ } | {
365
+ id: string;
366
+ label: string;
367
+ href: string;
368
+ path: string;
369
+ page?: never;
370
+ group: NavigationGroupNode;
371
+ };
372
+ declare function selectNavigationPages(nodes: NavigationNode[]): NavigationPageSelection[];
373
+
374
+ export { type GroupContext, type HeadingIdGenerator, type IndexPageProps, type LayoutProps, type ManifestLike, type MdxHeadingItem, type NavigationContainerNode, type NavigationGroupNode, type NavigationLinkNode, type NavigationNode, type NavigationPageNode, type NavigationPageSelection, type NavigationSwitchViewNode, type NavigationViewNode, type OgImageMetadata, type OgMetadata, type PageData, PageList, type PageProps, type ResolvedAttribution, type ResolvedNavigation, type RootLayoutProps, type RootPageProps, type SiteData, cleanHeadingText, cn, createAtomFeedRoute, createHeadingIdGenerator, createJsonFeedRoute, createLlmsTxtRoute, createOgImageRoute, createOgImageStaticParams, createRobotsTxtRoute, createRssFeedRoute, createSitemapXmlRoute, extractMdxHeadings, headingToHTMLId, listStaticParams, resolveGroup, resolveGroupLayout, resolveLeaf, selectNavigationPages, urlIdToText };
package/dist/index.js CHANGED
@@ -28,6 +28,30 @@ import {
28
28
  headingToHTMLId,
29
29
  urlIdToText
30
30
  } from "@publish.os/nextjs/utils/heading-ids";
31
+
32
+ // src/components/block/page-navigation/page-nodes.ts
33
+ function selectNavigationPages(nodes) {
34
+ return nodes.flatMap((node) => node.type === "page" ? [
35
+ {
36
+ id: node.id,
37
+ label: node.label,
38
+ href: node.href,
39
+ path: node.page.path,
40
+ page: node.page
41
+ }
42
+ ] : node.type === "group" ? [
43
+ ...node.presentation === "page" ? [
44
+ {
45
+ id: node.id,
46
+ label: node.label,
47
+ href: node.href ?? node.route,
48
+ path: node.route,
49
+ group: node
50
+ }
51
+ ] : [],
52
+ ...selectNavigationPages(node.children)
53
+ ] : node.type === "section" || node.type === "folder" ? selectNavigationPages(node.children) : node.type === "view" ? selectNavigationPages(node.items) : []);
54
+ }
31
55
  export {
32
56
  PageList,
33
57
  cleanHeadingText,
@@ -48,6 +72,7 @@ export {
48
72
  resolveGroup,
49
73
  resolveGroupLayout,
50
74
  resolveLeaf,
75
+ selectNavigationPages,
51
76
  tags,
52
77
  urlIdToText
53
78
  };
@@ -0,0 +1,6 @@
1
+ import { jsxDEV as jsxDEV$1 } from 'react/jsx-dev-runtime';
2
+ export { Fragment, JSX } from 'react/jsx-dev-runtime';
3
+
4
+ declare const jsxDEV: typeof jsxDEV$1;
5
+
6
+ export { jsxDEV };
@@ -0,0 +1,100 @@
1
+ // src/jsx-dev-runtime.ts
2
+ import { jsxDEV as reactJsxDEV } from "react/jsx-dev-runtime";
3
+
4
+ // src/lib/hosting/framework-paths.ts
5
+ var FRAMEWORK_PREFIX = "/publishos", SOURCE_ASSET_PREFIX = `${FRAMEWORK_PREFIX}/assets`, INTERNAL_PREFIX = `${FRAMEWORK_PREFIX}/internal`, SITE_API_PREFIX = `${FRAMEWORK_PREFIX}/api`, SEARCH_PREFIX = `${INTERNAL_PREFIX}/search`, PAGEFIND_MODULE_URL = `${SEARCH_PREFIX}/pagefind.js`, PAGEFIND_ENTRY_URL = `${SEARCH_PREFIX}/pagefind-entry.json`, IMAGE_OPTIMIZER_PATH = `${SITE_API_PREFIX}/image`;
6
+ var OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`, PUBLIC_INTERNAL_DIRECTORY = INTERNAL_PREFIX.slice(1), PUBLIC_FONT_DIRECTORY = `${PUBLIC_INTERNAL_DIRECTORY}/fonts`, PUBLIC_SEARCH_DIRECTORY = `public/${PUBLIC_INTERNAL_DIRECTORY}/search`, FRAMEWORK_PROXY_MATCHER = `/((?!${FRAMEWORK_PREFIX.slice(1)}(?:/|$)|_next/static|_next/image|_next/webpack-hmr).*)`;
7
+
8
+ // src/lib/assets/map-source-asset-url.ts
9
+ var SOURCE_ASSET_PATH = "/assets/", URL_PROPS = [
10
+ "action",
11
+ "cite",
12
+ "data",
13
+ "formAction",
14
+ "href",
15
+ "poster",
16
+ "src",
17
+ "xlinkHref"
18
+ ];
19
+ function hasUnsafeControlCharacters(value) {
20
+ for (let character of value) {
21
+ let code = character.codePointAt(0) ?? 0;
22
+ if (code <= 31 || code >= 127 && code <= 159) return !0;
23
+ }
24
+ return !1;
25
+ }
26
+ function assertSafeAssetPath(path) {
27
+ if (path.includes("\\") || hasUnsafeControlCharacters(path))
28
+ throw new TypeError("Local asset URLs must use safe path segments.");
29
+ for (let segment of path.split("/")) {
30
+ if (!segment)
31
+ throw new TypeError("Local asset URLs must use safe path segments.");
32
+ let decoded;
33
+ try {
34
+ decoded = decodeURIComponent(segment);
35
+ } catch {
36
+ throw new TypeError("Local asset URLs must use valid URL encoding.");
37
+ }
38
+ if (decoded === "." || decoded === ".." || decoded.includes("/") || decoded.includes("\\") || hasUnsafeControlCharacters(decoded))
39
+ throw new TypeError("Local asset URLs must use safe path segments.");
40
+ }
41
+ }
42
+ function mapSourceAssetUrl(value) {
43
+ if (typeof value != "string" || !value.startsWith(SOURCE_ASSET_PATH))
44
+ return value;
45
+ let suffixIndex = value.search(/[?#]/u), pathname = suffixIndex < 0 ? value : value.slice(0, suffixIndex), suffix = suffixIndex < 0 ? "" : value.slice(suffixIndex), path = pathname.slice(SOURCE_ASSET_PATH.length);
46
+ return assertSafeAssetPath(path), `${SOURCE_ASSET_PREFIX}/${path}${suffix}`;
47
+ }
48
+ function mapSourceSet(value) {
49
+ let candidates = [], cursor = 0;
50
+ for (; cursor < value.length; ) {
51
+ for (; cursor < value.length && /[\s,]/u.test(value[cursor] ?? ""); )
52
+ cursor += 1;
53
+ if (cursor >= value.length) break;
54
+ let start = cursor;
55
+ for (; cursor < value.length && !/\s/u.test(value[cursor] ?? ""); )
56
+ cursor += 1;
57
+ let url = value.slice(start, cursor), endsCandidate = url.endsWith(",");
58
+ endsCandidate && (url = url.replace(/,+$/u, ""));
59
+ let mapped = String(mapSourceAssetUrl(url));
60
+ if (endsCandidate) {
61
+ candidates.push(mapped);
62
+ continue;
63
+ }
64
+ for (; cursor < value.length && /\s/u.test(value[cursor] ?? ""); )
65
+ cursor += 1;
66
+ let descriptorStart = cursor;
67
+ for (; cursor < value.length && value[cursor] !== ","; ) cursor += 1;
68
+ let descriptor = value.slice(descriptorStart, cursor).trim();
69
+ candidates.push(descriptor ? `${mapped} ${descriptor}` : mapped), value[cursor] === "," && (cursor += 1);
70
+ }
71
+ return candidates.join(", ");
72
+ }
73
+ function mapSourceAssetProps(props) {
74
+ if (!props || typeof props != "object") return props;
75
+ let source = props, mapped;
76
+ for (let name of URL_PROPS) {
77
+ let value = source[name], next = mapSourceAssetUrl(value);
78
+ next !== value && (mapped ??= { ...source }, mapped[name] = next);
79
+ }
80
+ if (typeof source.srcSet == "string") {
81
+ let next = mapSourceSet(source.srcSet);
82
+ next !== source.srcSet && (mapped ??= { ...source }, mapped.srcSet = next);
83
+ }
84
+ return mapped ?? props;
85
+ }
86
+
87
+ // src/jsx-dev-runtime.ts
88
+ import { Fragment } from "react/jsx-dev-runtime";
89
+ var jsxDEV = (type, props, key, isStaticChildren, source, self) => reactJsxDEV(
90
+ type,
91
+ mapSourceAssetProps(props),
92
+ key,
93
+ isStaticChildren,
94
+ source,
95
+ self
96
+ );
97
+ export {
98
+ Fragment,
99
+ jsxDEV
100
+ };
@@ -0,0 +1,7 @@
1
+ import { jsx as jsx$1, jsxs as jsxs$1 } from 'react/jsx-runtime';
2
+ export { Fragment, JSX } from 'react/jsx-runtime';
3
+
4
+ declare const jsx: typeof jsx$1;
5
+ declare const jsxs: typeof jsxs$1;
6
+
7
+ export { jsx, jsxs };
@@ -0,0 +1,97 @@
1
+ // src/jsx-runtime.ts
2
+ import {
3
+ Fragment,
4
+ jsx as reactJsx,
5
+ jsxs as reactJsxs
6
+ } from "react/jsx-runtime";
7
+
8
+ // src/lib/hosting/framework-paths.ts
9
+ var FRAMEWORK_PREFIX = "/publishos", SOURCE_ASSET_PREFIX = `${FRAMEWORK_PREFIX}/assets`, INTERNAL_PREFIX = `${FRAMEWORK_PREFIX}/internal`, SITE_API_PREFIX = `${FRAMEWORK_PREFIX}/api`, SEARCH_PREFIX = `${INTERNAL_PREFIX}/search`, PAGEFIND_MODULE_URL = `${SEARCH_PREFIX}/pagefind.js`, PAGEFIND_ENTRY_URL = `${SEARCH_PREFIX}/pagefind-entry.json`, IMAGE_OPTIMIZER_PATH = `${SITE_API_PREFIX}/image`;
10
+ var OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`, PUBLIC_INTERNAL_DIRECTORY = INTERNAL_PREFIX.slice(1), PUBLIC_FONT_DIRECTORY = `${PUBLIC_INTERNAL_DIRECTORY}/fonts`, PUBLIC_SEARCH_DIRECTORY = `public/${PUBLIC_INTERNAL_DIRECTORY}/search`, FRAMEWORK_PROXY_MATCHER = `/((?!${FRAMEWORK_PREFIX.slice(1)}(?:/|$)|_next/static|_next/image|_next/webpack-hmr).*)`;
11
+
12
+ // src/lib/assets/map-source-asset-url.ts
13
+ var SOURCE_ASSET_PATH = "/assets/", URL_PROPS = [
14
+ "action",
15
+ "cite",
16
+ "data",
17
+ "formAction",
18
+ "href",
19
+ "poster",
20
+ "src",
21
+ "xlinkHref"
22
+ ];
23
+ function hasUnsafeControlCharacters(value) {
24
+ for (let character of value) {
25
+ let code = character.codePointAt(0) ?? 0;
26
+ if (code <= 31 || code >= 127 && code <= 159) return !0;
27
+ }
28
+ return !1;
29
+ }
30
+ function assertSafeAssetPath(path) {
31
+ if (path.includes("\\") || hasUnsafeControlCharacters(path))
32
+ throw new TypeError("Local asset URLs must use safe path segments.");
33
+ for (let segment of path.split("/")) {
34
+ if (!segment)
35
+ throw new TypeError("Local asset URLs must use safe path segments.");
36
+ let decoded;
37
+ try {
38
+ decoded = decodeURIComponent(segment);
39
+ } catch {
40
+ throw new TypeError("Local asset URLs must use valid URL encoding.");
41
+ }
42
+ if (decoded === "." || decoded === ".." || decoded.includes("/") || decoded.includes("\\") || hasUnsafeControlCharacters(decoded))
43
+ throw new TypeError("Local asset URLs must use safe path segments.");
44
+ }
45
+ }
46
+ function mapSourceAssetUrl(value) {
47
+ if (typeof value != "string" || !value.startsWith(SOURCE_ASSET_PATH))
48
+ return value;
49
+ let suffixIndex = value.search(/[?#]/u), pathname = suffixIndex < 0 ? value : value.slice(0, suffixIndex), suffix = suffixIndex < 0 ? "" : value.slice(suffixIndex), path = pathname.slice(SOURCE_ASSET_PATH.length);
50
+ return assertSafeAssetPath(path), `${SOURCE_ASSET_PREFIX}/${path}${suffix}`;
51
+ }
52
+ function mapSourceSet(value) {
53
+ let candidates = [], cursor = 0;
54
+ for (; cursor < value.length; ) {
55
+ for (; cursor < value.length && /[\s,]/u.test(value[cursor] ?? ""); )
56
+ cursor += 1;
57
+ if (cursor >= value.length) break;
58
+ let start = cursor;
59
+ for (; cursor < value.length && !/\s/u.test(value[cursor] ?? ""); )
60
+ cursor += 1;
61
+ let url = value.slice(start, cursor), endsCandidate = url.endsWith(",");
62
+ endsCandidate && (url = url.replace(/,+$/u, ""));
63
+ let mapped = String(mapSourceAssetUrl(url));
64
+ if (endsCandidate) {
65
+ candidates.push(mapped);
66
+ continue;
67
+ }
68
+ for (; cursor < value.length && /\s/u.test(value[cursor] ?? ""); )
69
+ cursor += 1;
70
+ let descriptorStart = cursor;
71
+ for (; cursor < value.length && value[cursor] !== ","; ) cursor += 1;
72
+ let descriptor = value.slice(descriptorStart, cursor).trim();
73
+ candidates.push(descriptor ? `${mapped} ${descriptor}` : mapped), value[cursor] === "," && (cursor += 1);
74
+ }
75
+ return candidates.join(", ");
76
+ }
77
+ function mapSourceAssetProps(props) {
78
+ if (!props || typeof props != "object") return props;
79
+ let source = props, mapped;
80
+ for (let name of URL_PROPS) {
81
+ let value = source[name], next = mapSourceAssetUrl(value);
82
+ next !== value && (mapped ??= { ...source }, mapped[name] = next);
83
+ }
84
+ if (typeof source.srcSet == "string") {
85
+ let next = mapSourceSet(source.srcSet);
86
+ next !== source.srcSet && (mapped ??= { ...source }, mapped.srcSet = next);
87
+ }
88
+ return mapped ?? props;
89
+ }
90
+
91
+ // src/jsx-runtime.ts
92
+ var jsx = (type, props, key) => reactJsx(type, mapSourceAssetProps(props), key), jsxs = (type, props, key) => reactJsxs(type, mapSourceAssetProps(props), key);
93
+ export {
94
+ Fragment,
95
+ jsx,
96
+ jsxs
97
+ };
@@ -1,12 +1,12 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
+ import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
3
4
  import { VariantProps } from 'class-variance-authority';
4
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
8
- size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
- iconOnly?: boolean | null | undefined;
7
+ readonly variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
8
+ readonly size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
+ readonly iconOnly?: boolean | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
12
12
 
@@ -38,12 +38,13 @@ type AgentActionGroup = {
38
38
  title?: string;
39
39
  actions: AgentActionConfig[];
40
40
  };
41
- type AgentActionsProps = Omit<ComponentPropsWithoutRef<"div">, "children"> & {
41
+ type AgentActionsProps = ComponentPropsWithoutRef<"div"> & {
42
42
  pagePath?: string;
43
43
  pageUrl?: string;
44
44
  markdownPath?: string;
45
45
  markdownUrl?: string;
46
46
  markdown?: string;
47
+ markdownRevision?: string;
47
48
  siteUrl?: string;
48
49
  sourceUrl?: string;
49
50
  prompt?: string;
@@ -52,7 +53,35 @@ type AgentActionsProps = Omit<ComponentPropsWithoutRef<"div">, "children"> & {
52
53
  buttonSize?: ButtonVariantProps["size"];
53
54
  buttonVariant?: ButtonVariantProps["variant"];
54
55
  menuLabel?: string;
56
+ markdownLinkLabel?: string;
57
+ showMarkdownLink?: boolean;
58
+ };
59
+ declare function AgentActionsToolbar({ className, ...props }: ComponentPropsWithoutRef<"div">): react.JSX.Element;
60
+ declare function AgentActionsMarkdownLink(): ReactNode;
61
+ declare function AgentActionsPrimaryAction({ action }: {
62
+ action?: AgentActionConfig;
63
+ }): ReactNode;
64
+ declare function AgentActionsFeedback(): react.JSX.Element;
65
+ declare function AgentActionsGroup({ title, children, }: {
66
+ title?: string;
67
+ children: ReactNode;
68
+ }): react.JSX.Element;
69
+ declare function AgentActionsItem({ action }: {
70
+ action: AgentActionConfig;
71
+ }): ReactNode;
72
+ declare function AgentActionsMenu({ children }: {
73
+ children?: ReactNode;
74
+ }): react.JSX.Element;
75
+ declare function AgentActionsRoot(props: AgentActionsProps): react.JSX.Element;
76
+ declare const AgentActions: typeof AgentActionsRoot & {
77
+ Feedback: typeof AgentActionsFeedback;
78
+ Group: typeof AgentActionsGroup;
79
+ Item: typeof AgentActionsItem;
80
+ MarkdownLink: typeof AgentActionsMarkdownLink;
81
+ Menu: typeof AgentActionsMenu;
82
+ PrimaryAction: typeof AgentActionsPrimaryAction;
83
+ Root: typeof AgentActionsRoot;
84
+ Toolbar: typeof AgentActionsToolbar;
55
85
  };
56
- declare function AgentActions({ actionGroups, buttonSize, buttonVariant, className, markdown, markdownPath, markdownUrl, menuLabel, pagePath, pageUrl, primaryAction, prompt, siteUrl, sourceUrl, ...props }: AgentActionsProps): react_jsx_runtime.JSX.Element;
57
86
 
58
- export { type AgentActionConfig, type AgentActionContext, type AgentActionCopyTarget, type AgentActionGroup, AgentActions, type AgentActionsProps };
87
+ export { type AgentActionConfig, type AgentActionContext, type AgentActionCopyTarget, type AgentActionGroup, AgentActions, type AgentActionsProps, AgentActionsFeedback as Feedback, AgentActionsGroup as Group, AgentActionsItem as Item, AgentActionsMarkdownLink as MarkdownLink, AgentActionsMenu as Menu, AgentActionsPrimaryAction as PrimaryAction, AgentActionsRoot as Root, AgentActionsToolbar as Toolbar };