@publish.os/nextjs 0.0.1-alpha.91 → 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 (153) hide show
  1. package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
  2. package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -2
  3. package/compiler-assets/nextjs/defaults/group/page.tsx +7 -6
  4. package/compiler-assets/nextjs/defaults/project/next.config.mjs +2 -1
  5. package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
  6. package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
  7. package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
  8. package/compiler-assets/nextjs/shims/document.tsx +9 -1
  9. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +3 -0
  10. package/compiler-assets/nextjs/shims/proxy.ts +156 -54
  11. package/dist/{build-operation-5QMLXF7N.js → build-operation-CJDUL4OW.js} +5 -5
  12. package/dist/{chunk-GBPLER5H.js → chunk-3T4HVDSC.js} +2 -2
  13. package/dist/{chunk-UYGCOWRF.js → chunk-DX7PXFCM.js} +860 -50
  14. package/dist/{chunk-F3AGNDF4.js → chunk-DZ3VWEV5.js} +860 -575
  15. package/dist/{chunk-OXOFRXEI.js → chunk-NHSLTARU.js} +1284 -1164
  16. package/dist/{chunk-ORIUWJBQ.js → chunk-SBMDONTV.js} +3 -2
  17. package/dist/compiler.js +42 -23
  18. package/dist/components/blocks/agent-actions.d.ts +7 -7
  19. package/dist/components/blocks/agent-actions.js +1 -32
  20. package/dist/components/blocks/toc.d.ts +7 -7
  21. package/dist/components/ui/button.d.ts +1 -2
  22. package/dist/{compose-CVBJRAF6.js → compose-44GJSMXD.js} +2 -2
  23. package/dist/config/createNextConfig.js +2 -0
  24. package/dist/{dev-operation-OSHHWRWK.js → dev-operation-WNECBHZ5.js} +17 -7
  25. package/dist/{ide-support-CU6Z5PVR.js → ide-support-TG74L4FF.js} +3 -3
  26. package/dist/index.d.ts +143 -126
  27. package/dist/index.js +25 -0
  28. package/dist/kernel/components/blocks/AgentActions.d.ts +7 -7
  29. package/dist/kernel/components/blocks/AgentActions.js +1 -32
  30. package/dist/kernel/components/blocks/agent-actions.d.ts +1 -2
  31. package/dist/kernel/components/blocks/agent-actions.js +1 -32
  32. package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
  33. package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
  34. package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
  35. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
  36. package/dist/kernel/components/blocks/nav-breadcrumb.js +19 -13
  37. package/dist/kernel/components/blocks/navbar.d.ts +5 -4
  38. package/dist/kernel/components/blocks/navbar.js +62 -42
  39. package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
  40. package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
  41. package/dist/kernel/components/blocks/next-prev.js +29 -6
  42. package/dist/kernel/components/blocks/page-list.d.ts +4 -4
  43. package/dist/kernel/components/blocks/page-list.js +30 -7
  44. package/dist/kernel/components/blocks/search.d.ts +9 -15
  45. package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
  46. package/dist/kernel/components/blocks/sidebar-node.js +12 -2
  47. package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
  48. package/dist/kernel/components/blocks/sidebar.js +132 -26
  49. package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
  50. package/dist/kernel/components/blocks/toc-client.d.ts +7 -7
  51. package/dist/kernel/components/blocks/toc.d.ts +3 -3
  52. package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
  53. package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
  54. package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
  55. package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
  56. package/dist/kernel/components/mdx/components/figure-caption.d.ts +2 -2
  57. package/dist/kernel/components/mdx/components/figure.d.ts +3 -3
  58. package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
  59. package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
  60. package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
  61. package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
  62. package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
  63. package/dist/kernel/components/mdx/components/image-zoom.js +3 -2
  64. package/dist/kernel/components/mdx/components/image.d.ts +2 -2
  65. package/dist/kernel/components/mdx/components/image.js +1 -1
  66. package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
  67. package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
  68. package/dist/kernel/components/mdx/components/link.d.ts +3 -3
  69. package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
  70. package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
  71. package/dist/kernel/components/mdx/components/table.d.ts +7 -7
  72. package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
  73. package/dist/kernel/components/mdx/components/video-player.d.ts +2 -2
  74. package/dist/kernel/components/mdx/components/video.d.ts +2 -3
  75. package/dist/kernel/components/mdx/error-boundary.d.ts +2 -3
  76. package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
  77. package/dist/kernel/components/mdx/mdx.d.ts +42 -11
  78. package/dist/kernel/components/mdx/mdx.js +1 -1
  79. package/dist/kernel/components/next-image.d.ts +3 -3
  80. package/dist/kernel/components/ui/accordion.d.ts +7 -7
  81. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -3
  82. package/dist/kernel/components/ui/breadcrumb.d.ts +13 -13
  83. package/dist/kernel/components/ui/button-group.d.ts +5 -5
  84. package/dist/kernel/components/ui/button.d.ts +3 -3
  85. package/dist/kernel/components/ui/card.d.ts +7 -7
  86. package/dist/kernel/components/ui/dialog.d.ts +10 -10
  87. package/dist/kernel/components/ui/drawer.d.ts +12 -12
  88. package/dist/kernel/components/ui/kbd.d.ts +3 -3
  89. package/dist/kernel/components/ui/link.d.ts +3 -3
  90. package/dist/kernel/components/ui/menu.d.ts +22 -22
  91. package/dist/kernel/components/ui/mod-key.d.ts +2 -3
  92. package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
  93. package/dist/kernel/components/ui/popover.d.ts +11 -11
  94. package/dist/kernel/components/ui/progress.d.ts +7 -7
  95. package/dist/kernel/components/ui/scroll-area.d.ts +1 -2
  96. package/dist/kernel/components/ui/select.d.ts +16 -16
  97. package/dist/kernel/components/ui/separator.d.ts +3 -3
  98. package/dist/kernel/components/ui/table.d.ts +7 -7
  99. package/dist/kernel/components/ui/tabs.d.ts +12 -12
  100. package/dist/kernel/components/ui/tag.d.ts +3 -3
  101. package/dist/kernel/components/ui/text.d.ts +4 -4
  102. package/dist/kernel/components/ui/toast.d.ts +11 -11
  103. package/dist/kernel/components/ui/tooltip.d.ts +9 -9
  104. package/dist/kernel/defaults.registry.d.ts +2 -2
  105. package/dist/kernel/defaults.registry.js +2 -2
  106. package/dist/kernel/routes/agent/markdown.d.ts +4 -0
  107. package/dist/kernel/routes/agent/markdown.js +11 -7
  108. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  109. package/dist/kernel/routes/metadata/feed.d.ts +1 -2
  110. package/dist/kernel/routes/metadata/feed.js +34 -29
  111. package/dist/kernel/routes/metadata/llms.d.ts +3 -31
  112. package/dist/kernel/routes/metadata/llms.js +2 -200
  113. package/dist/kernel/routes/metadata/robots.d.ts +5 -3
  114. package/dist/kernel/routes/metadata/robots.js +4 -25
  115. package/dist/kernel/routes/metadata/sitemap.d.ts +15 -1
  116. package/dist/kernel/routes/metadata/sitemap.js +200 -112
  117. package/dist/kernel/routes/not-found.js +1 -1
  118. package/dist/kernel/routes/pages/group.d.ts +3 -3
  119. package/dist/kernel/routes/pages/group.js +10 -4
  120. package/dist/kernel/routes/pages/leaf.d.ts +9 -4
  121. package/dist/kernel/routes/pages/leaf.js +16 -8
  122. package/dist/kernel/routes/pages/root.d.ts +3 -3
  123. package/dist/kernel/routes/pages/root.js +20 -5
  124. package/dist/keyboard-shortcuts.d.ts +2 -2
  125. package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
  126. package/dist/resolvers/manifest-resolver.d.ts +2 -2
  127. package/dist/resolvers/manifest-resolver.js +65 -35
  128. package/dist/search.d.ts +2 -9
  129. package/dist/search.js +2 -7
  130. package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
  131. package/dist/theme-scope.d.ts +2 -2
  132. package/dist/types-BbqmOzLC.d.ts +168 -0
  133. package/dist/types-TjH1ek0X.d.ts +22 -0
  134. package/dist/types.d.ts +116 -91
  135. package/dist/{validate-local-source-SV44DBQT.js → validate-local-source-EN2GW4FR.js} +3 -3
  136. package/dist/{validate-publish-os-source-NZJF3TB2.js → validate-publish-os-source-OEWQDB7B.js} +2 -2
  137. package/init/seed/minimal/publish.os/blog/index.tsx +25 -22
  138. package/init/seed/minimal/publish.os/blog/page.tsx +31 -16
  139. package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +1 -1
  140. package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
  141. package/init/seed/minimal/publish.os/publish.os.config.json +13 -2
  142. package/init/seed/minimal/seed.json +1 -0
  143. package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
  144. package/package.json +4 -4
  145. package/release/app/phosphor/package.json +1 -1
  146. package/release/app/phosphor/pnpm-lock.yaml.template +53 -127
  147. package/release/compiler/pnpm-lock.yaml.template +49 -123
  148. package/release/release.json +4 -4
  149. package/dist/sidebar-types-DKpR27II.d.ts +0 -25
  150. package/dist/types-CJWRG05y.d.ts +0 -76
  151. package/dist/types-CUtrppxt.d.ts +0 -69
  152. package/dist/types-J2w_puPF.d.ts +0 -128
  153. package/dist/{button-BdCScEKi.d.ts → button-D6Xp2HBm.d.ts} +1 -1
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;
22
- };
23
- type OgIndexMetadata = OgMetadata & {
24
- scope?: "page" | "subtree";
15
+ image?: OgImageMetadata$1;
16
+ };
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,34 +160,33 @@ 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>;
156
191
  markdownRevision?: string;
157
192
  currentPath: string;
@@ -159,8 +194,8 @@ type PageProps<TMeta extends Record<string, unknown> = Record<string, unknown>>
159
194
  };
160
195
  type IndexPageProps = {
161
196
  site: SiteData;
162
- tree: TreeNode[];
163
- node: TreeNode;
197
+ navigation: ResolvedNavigation;
198
+ node: NavigationNode;
164
199
  currentPath: string;
165
200
  group: string;
166
201
  };
@@ -179,66 +214,26 @@ type GroupContext = {
179
214
  };
180
215
 
181
216
  type PageListProps = {
182
- tree: TreeNode[];
217
+ navigation: ResolvedNavigation;
183
218
  currentPath?: string;
184
219
  className?: string;
185
220
  };
186
- 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;
187
222
 
188
223
  type FeedScope = "site" | "group" | "self";
189
224
  type FeedRouteOptions = {
190
225
  scope?: FeedScope;
191
226
  group?: string;
192
227
  limit?: number;
193
- status?: PageStatus[];
194
228
  };
195
229
  declare function createRssFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
196
230
  declare function createAtomFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
197
231
  declare function createJsonFeedRoute(manifest: ManifestLike, options?: FeedRouteOptions): () => Promise<Response>;
198
232
 
199
- type MarkdownRouteArtifact = {
233
+ type LlmsTxtOutput = {
200
234
  body: string;
201
- bodyHash?: string;
202
- byteSize?: number;
203
- htmlPath: string;
204
- markdownPath: string;
205
- sourceHash?: string;
206
- title: string;
207
- };
208
- type MarkdownRouteArtifactIndexEntry = Omit<MarkdownRouteArtifact, "body"> & {
209
- shardId: string;
210
- };
211
- type MarkdownRouteArtifactIndex = Record<string, MarkdownRouteArtifactIndexEntry>;
212
- type MarkdownRouteArtifactShardMetadata = {
213
- byteSize: number;
214
- contentHash: string;
215
- id: string;
216
- modulePath: string;
217
- pageCount: number;
218
- };
219
- type MarkdownRouteArtifactManifest = {
220
- byHtmlPath: Record<string, string>;
221
- byMarkdownPath: MarkdownRouteArtifactIndex;
222
- shards: MarkdownRouteArtifactShardMetadata[];
223
- };
224
-
225
- type LlmsRouteOptions = {
226
- scope?: "site" | "group" | "self";
227
- group?: string;
228
- limit?: number;
229
- includeDescriptions?: boolean;
230
- links?: Array<{
231
- title: string;
232
- path: string;
233
- group?: string;
234
- }>;
235
- otherGroupLinks?: Array<{
236
- title: string;
237
- path: string;
238
- group?: string;
239
- }>;
240
235
  };
241
- declare function createLlmsTxtRoute(manifest: ManifestLike, options?: LlmsRouteOptions, artifactManifest?: MarkdownRouteArtifactManifest): () => Promise<Response>;
236
+ declare function createLlmsTxtRoute(output: LlmsTxtOutput): () => Response;
242
237
 
243
238
  type OgImageEntryLike = {
244
239
  key: string;
@@ -311,7 +306,11 @@ declare function createOgImageStaticParams({ manifest }: OgImageRouteConfig): {
311
306
  key: string;
312
307
  }[];
313
308
 
314
- 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;
315
314
 
316
315
  type SitemapReference = {
317
316
  path: string;
@@ -320,6 +319,7 @@ type SitemapReference = {
320
319
  type SitemapRouteOptions = {
321
320
  group?: string;
322
321
  path?: string;
322
+ includeUrls?: SitemapReference[];
323
323
  sitemaps?: SitemapReference[];
324
324
  exclude?: SitemapReference[];
325
325
  };
@@ -329,7 +329,7 @@ type ResolvedLeaf = PageProps;
329
329
  type ResolvedGroup = Omit<IndexPageProps, "children">;
330
330
  declare function resolveLeaf(manifest: ManifestLike, group: string, slug: string | string[]): ResolvedLeaf | null;
331
331
  declare function resolveGroup(manifest: ManifestLike, group: string): ResolvedGroup | null;
332
- 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;
333
333
  declare function listStaticParams(manifest: ManifestLike, group: string): Array<{
334
334
  slug: string[];
335
335
  }>;
@@ -354,4 +354,21 @@ declare function createHeadingIdGenerator(): HeadingIdGenerator;
354
354
  declare function extractMdxHeadings(content: string | undefined, levels: [number, number]): MdxHeadingItem[];
355
355
  declare function urlIdToText(urlId: string): string;
356
356
 
357
- 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
  };
@@ -1,7 +1,7 @@
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
7
  readonly variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
@@ -56,23 +56,23 @@ type AgentActionsProps = ComponentPropsWithoutRef<"div"> & {
56
56
  markdownLinkLabel?: string;
57
57
  showMarkdownLink?: boolean;
58
58
  };
59
- declare function AgentActionsToolbar({ className, ...props }: ComponentPropsWithoutRef<"div">): react_jsx_runtime.JSX.Element;
59
+ declare function AgentActionsToolbar({ className, ...props }: ComponentPropsWithoutRef<"div">): react.JSX.Element;
60
60
  declare function AgentActionsMarkdownLink(): ReactNode;
61
61
  declare function AgentActionsPrimaryAction({ action }: {
62
62
  action?: AgentActionConfig;
63
63
  }): ReactNode;
64
- declare function AgentActionsFeedback(): react_jsx_runtime.JSX.Element;
64
+ declare function AgentActionsFeedback(): react.JSX.Element;
65
65
  declare function AgentActionsGroup({ title, children, }: {
66
66
  title?: string;
67
67
  children: ReactNode;
68
- }): react_jsx_runtime.JSX.Element;
68
+ }): react.JSX.Element;
69
69
  declare function AgentActionsItem({ action }: {
70
70
  action: AgentActionConfig;
71
71
  }): ReactNode;
72
72
  declare function AgentActionsMenu({ children }: {
73
73
  children?: ReactNode;
74
- }): react_jsx_runtime.JSX.Element;
75
- declare function AgentActionsRoot(props: AgentActionsProps): react_jsx_runtime.JSX.Element;
74
+ }): react.JSX.Element;
75
+ declare function AgentActionsRoot(props: AgentActionsProps): react.JSX.Element;
76
76
  declare const AgentActions: typeof AgentActionsRoot & {
77
77
  Feedback: typeof AgentActionsFeedback;
78
78
  Group: typeof AgentActionsGroup;
@@ -44,7 +44,7 @@ function normalizePath(path) {
44
44
  }
45
45
  function markdownPathForPagePath(path) {
46
46
  let normalized = normalizePath(path);
47
- return normalized === "/" ? "/index.md" : normalized.endsWith(".md") ? normalized : `${normalized}.md`;
47
+ return normalized === "/" ? "/index.md" : `${normalized}.md`;
48
48
  }
49
49
  function isAbsoluteUrl(url) {
50
50
  return /^[a-z][a-z\d+\-.]*:/i.test(url);
@@ -77,42 +77,11 @@ var DEFAULT_PRIMARY_ACTION = {
77
77
  id: "open-in-ai",
78
78
  title: "Open in",
79
79
  actions: [
80
- {
81
- id: "open-claude",
82
- title: "Claude",
83
- href: ({ prompt }) => providerPromptUrl("https://claude.ai/new", prompt),
84
- openInNew: !0
85
- },
86
80
  {
87
81
  id: "open-chatgpt",
88
82
  title: "ChatGPT",
89
83
  href: ({ prompt }) => providerPromptUrl("https://chatgpt.com/?hints=search", prompt),
90
84
  openInNew: !0
91
- },
92
- {
93
- id: "open-cursor",
94
- title: "Cursor",
95
- href: ({ prompt }) => providerPromptUrl("https://cursor.com/link/prompt", prompt, "text"),
96
- openInNew: !0
97
- },
98
- {
99
- id: "open-copilot",
100
- title: "Copilot",
101
- href: ({ prompt }) => providerPromptUrl("https://copilot.microsoft.com/", prompt),
102
- openInNew: !0
103
- },
104
- {
105
- id: "open-t3-chat",
106
- title: "T3 Chat",
107
- href: ({ prompt }) => providerPromptUrl("https://t3.chat/new", prompt),
108
- openInNew: !0
109
- },
110
- {
111
- id: "open-github",
112
- title: "GitHub source",
113
- href: ({ sourceUrl }) => sourceUrl,
114
- openInNew: !0,
115
- disabled: ({ sourceUrl }) => !sourceUrl
116
85
  }
117
86
  ]
118
87
  },
@@ -1,5 +1,4 @@
1
- import 'react/jsx-runtime';
2
- export { AgentActionConfig, AgentActionContext, AgentActionCopyTarget, AgentActionGroup, AgentActions, AgentActionsProps, Feedback, Group, Item, MarkdownLink, Menu, PrimaryAction, Root, Toolbar } from './AgentActions.js';
3
1
  import 'react';
2
+ export { AgentActionConfig, AgentActionContext, AgentActionCopyTarget, AgentActionGroup, AgentActions, AgentActionsProps, Feedback, Group, Item, MarkdownLink, Menu, PrimaryAction, Root, Toolbar } from './AgentActions.js';
4
3
  import 'class-variance-authority/types';
5
4
  import 'class-variance-authority';
@@ -44,7 +44,7 @@ function normalizePath(path) {
44
44
  }
45
45
  function markdownPathForPagePath(path) {
46
46
  let normalized = normalizePath(path);
47
- return normalized === "/" ? "/index.md" : normalized.endsWith(".md") ? normalized : `${normalized}.md`;
47
+ return normalized === "/" ? "/index.md" : `${normalized}.md`;
48
48
  }
49
49
  function isAbsoluteUrl(url) {
50
50
  return /^[a-z][a-z\d+\-.]*:/i.test(url);
@@ -77,42 +77,11 @@ var DEFAULT_PRIMARY_ACTION = {
77
77
  id: "open-in-ai",
78
78
  title: "Open in",
79
79
  actions: [
80
- {
81
- id: "open-claude",
82
- title: "Claude",
83
- href: ({ prompt }) => providerPromptUrl("https://claude.ai/new", prompt),
84
- openInNew: !0
85
- },
86
80
  {
87
81
  id: "open-chatgpt",
88
82
  title: "ChatGPT",
89
83
  href: ({ prompt }) => providerPromptUrl("https://chatgpt.com/?hints=search", prompt),
90
84
  openInNew: !0
91
- },
92
- {
93
- id: "open-cursor",
94
- title: "Cursor",
95
- href: ({ prompt }) => providerPromptUrl("https://cursor.com/link/prompt", prompt, "text"),
96
- openInNew: !0
97
- },
98
- {
99
- id: "open-copilot",
100
- title: "Copilot",
101
- href: ({ prompt }) => providerPromptUrl("https://copilot.microsoft.com/", prompt),
102
- openInNew: !0
103
- },
104
- {
105
- id: "open-t3-chat",
106
- title: "T3 Chat",
107
- href: ({ prompt }) => providerPromptUrl("https://t3.chat/new", prompt),
108
- openInNew: !0
109
- },
110
- {
111
- id: "open-github",
112
- title: "GitHub source",
113
- href: ({ sourceUrl }) => sourceUrl,
114
- openInNew: !0,
115
- disabled: ({ sourceUrl }) => !sourceUrl
116
85
  }
117
86
  ]
118
87
  },
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
3
3
 
4
4
  type AnimatedIconSwapProps = Omit<ComponentPropsWithoutRef<"span">, "children"> & {
@@ -11,6 +11,6 @@ type AnimatedIconSwapProps = Omit<ComponentPropsWithoutRef<"span">, "children">
11
11
  /** Square wrapper size in pixels. */
12
12
  size: number;
13
13
  };
14
- declare function AnimatedIconSwap({ active, activeIcon, className, defaultIcon, size, style, ...props }: AnimatedIconSwapProps): react_jsx_runtime.JSX.Element;
14
+ declare function AnimatedIconSwap({ active, activeIcon, className, defaultIcon, size, style, ...props }: AnimatedIconSwapProps): react.JSX.Element;
15
15
 
16
16
  export { AnimatedIconSwap, type AnimatedIconSwapProps };
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
 
3
3
  declare function collectTokenNamesFromCssText(css: string): string[];
4
4
  declare function deriveTokenGroup(name: string): string;
5
- declare function ColorPalette(): react_jsx_runtime.JSX.Element;
5
+ declare function ColorPalette(): react.JSX.Element;
6
6
 
7
7
  export { collectTokenNamesFromCssText, ColorPalette as default, deriveTokenGroup };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
 
3
3
  type LogoBlockAsset = {
4
4
  readonly outputPath: string;
@@ -16,6 +16,6 @@ type LogoBlockProps = {
16
16
  maxWidth?: number;
17
17
  siteName: string;
18
18
  };
19
- declare function LogoBlock({ className, logo, maxHeight, maxWidth, siteName, }: LogoBlockProps): react_jsx_runtime.JSX.Element;
19
+ declare function LogoBlock({ className, logo, maxHeight, maxWidth, siteName, }: LogoBlockProps): react.JSX.Element;
20
20
 
21
21
  export { LogoBlock, type LogoBlockAsset, type LogoBlockLogo, type LogoBlockProps };
@@ -1,19 +1,20 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
  import * as class_variance_authority_types from 'class-variance-authority/types';
3
3
  import { VariantProps } from 'class-variance-authority';
4
- import { S as SiteData, T as TreeNode } from '../../../types-CUtrppxt.js';
4
+ import { S as SiteData } from '../../../types-TjH1ek0X.js';
5
+ import { R as ResolvedNavigation } from '../../../manifest-types-CcVPH_jh.js';
5
6
 
6
7
  declare const breadcrumbVariants: (props?: ({
7
8
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
8
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
10
  type BreadcrumbVariantProps = VariantProps<typeof breadcrumbVariants>;
10
11
 
11
- declare function NavBreadcrumb({ currentPath, showRoot, size, site, tree, }: {
12
+ declare function NavBreadcrumb({ currentPath, showRoot, size, site, navigation, }: {
12
13
  currentPath?: string;
13
14
  showRoot?: boolean;
14
15
  size?: BreadcrumbVariantProps["size"];
15
16
  site: SiteData;
16
- tree: TreeNode[];
17
- }): react_jsx_runtime.JSX.Element | null;
17
+ navigation: ResolvedNavigation;
18
+ }): react.JSX.Element | null;
18
19
 
19
20
  export { NavBreadcrumb };