@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/types.d.ts CHANGED
@@ -1,10 +1,90 @@
1
1
  import { RefObject } from 'react';
2
2
 
3
+ type OgImageMetadata$1 = string | {
4
+ src: string;
5
+ alt?: string;
6
+ };
7
+ type OgMetadata$1 = {
8
+ title?: string;
9
+ description?: string;
10
+ image?: OgImageMetadata$1;
11
+ };
12
+ type PageStatus$1 = "published" | "draft";
13
+ type PageMetadata$1 = {
14
+ openGraph?: OgMetadata$1;
15
+ robots?: {
16
+ index?: boolean;
17
+ follow?: boolean;
18
+ };
19
+ };
20
+ type PageFrontmatter$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
21
+ title: string;
22
+ description: string;
23
+ slug: string;
24
+ status: PageStatus$1;
25
+ metadata: PageMetadata$1;
26
+ };
27
+ type PageData$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
28
+ fileID: string;
29
+ group: string;
30
+ path: string;
31
+ frontmatter: PageFrontmatter$1<TCustom>;
32
+ body: string;
33
+ };
34
+ type NavigationPageNode = {
35
+ id: string;
36
+ type: "page";
37
+ label: string;
38
+ href: string;
39
+ page: Omit<PageData$1, "body">;
40
+ children?: NavigationNode[];
41
+ };
42
+ type NavigationGroupNode = {
43
+ id: string;
44
+ type: "group";
45
+ label: string;
46
+ groupKey: string;
47
+ route: string;
48
+ presentation: "page" | "folder";
49
+ href?: string;
50
+ children: NavigationNode[];
51
+ };
52
+ type NavigationContainerNode = {
53
+ id: string;
54
+ type: "section" | "folder";
55
+ label: string;
56
+ children: NavigationNode[];
57
+ };
58
+ type NavigationLinkNode = {
59
+ id: string;
60
+ type: "link";
61
+ label: string;
62
+ href: string;
63
+ };
64
+ type NavigationViewNode = {
65
+ id: string;
66
+ type: "view";
67
+ label?: string;
68
+ viewId?: string;
69
+ items: NavigationNode[];
70
+ };
71
+ type NavigationSwitchViewNode = {
72
+ id: string;
73
+ type: "switch-view";
74
+ label: string;
75
+ target: string | {
76
+ view: string;
77
+ };
78
+ };
79
+ type NavigationNode = NavigationPageNode | NavigationGroupNode | NavigationContainerNode | NavigationLinkNode | NavigationViewNode | NavigationSwitchViewNode;
80
+ type ResolvedNavigation = {
81
+ rootGroup: string;
82
+ items: NavigationNode[];
83
+ };
84
+
3
85
  type SearchInput = {
4
86
  filters?: {
5
- author?: string;
6
87
  group?: string;
7
- tag?: string;
8
88
  };
9
89
  limit?: number;
10
90
  offset?: number;
@@ -21,17 +101,12 @@ type SearchResult = {
21
101
  excerpt: string;
22
102
  id: string;
23
103
  meta: {
24
- author?: string;
25
104
  description?: string;
26
105
  group?: string;
27
- image?: string;
28
106
  nodeId?: string;
29
107
  path?: string;
30
- publishedAt?: string;
31
108
  section?: string;
32
- tags?: string;
33
109
  title?: string;
34
- updatedAt?: string;
35
110
  };
36
111
  plainExcerpt: string;
37
112
  score?: number;
@@ -88,7 +163,7 @@ type SiteData = {
88
163
  name: string;
89
164
  description?: string;
90
165
  origin?: string;
91
- og?: OgIndexMetadata;
166
+ metadata?: IndexMetadata;
92
167
  };
93
168
  type OgImageMetadata = string | {
94
169
  src: string;
@@ -99,8 +174,10 @@ type OgMetadata = {
99
174
  description?: string;
100
175
  image?: OgImageMetadata;
101
176
  };
102
- type OgIndexMetadata = OgMetadata & {
103
- scope?: "page" | "subtree";
177
+ type IndexMetadata = {
178
+ openGraph?: OgMetadata & {
179
+ scope?: "page" | "subtree";
180
+ };
104
181
  };
105
182
  type Author = {
106
183
  id?: string;
@@ -109,83 +186,32 @@ type Author = {
109
186
  avatar?: string;
110
187
  url?: string;
111
188
  };
112
- type PageStatus = "published" | "draft" | "archived";
113
- type PageFrontmatter = {
189
+ type PageStatus = "published" | "draft";
190
+ type PageMetadata = {
191
+ openGraph?: OgMetadata;
192
+ robots?: {
193
+ index?: boolean;
194
+ follow?: boolean;
195
+ };
196
+ };
197
+ type PageFrontmatter<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
114
198
  title: string;
115
- slug?: string;
116
- description?: string;
117
- status?: PageStatus;
118
- publishedAt?: string;
119
- updatedAt?: string;
120
- authors?: (string | Author)[];
121
- tags?: string[];
122
- [key: string]: unknown;
123
- };
124
- type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
125
- fileID: string;
126
- group: string;
199
+ description: string;
127
200
  slug: string;
128
- path: string;
129
- title: string;
130
- description?: string;
131
201
  status: PageStatus;
132
- publishedAt?: string;
133
- updatedAt?: string;
134
- authors: Author[];
135
- tags: string[];
136
- og?: OgMetadata;
137
- meta: TMeta;
138
- body: string;
139
- };
140
- type PageSummary<TMeta extends Record<string, unknown> = Record<string, unknown>> = Omit<PageData<TMeta>, "body"> & {
141
- body?: string;
202
+ metadata: PageMetadata;
142
203
  };
143
- type PageNode = {
144
- type: "page";
204
+ type PageData<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
145
205
  fileID: string;
146
- title: string;
147
- path: string;
148
- href?: string;
149
206
  group: string;
150
- description?: string;
151
- status: PageStatus;
152
- publishedAt?: string;
153
- updatedAt?: string;
154
- authors: Author[];
155
- tags?: string[];
156
- og?: OgMetadata;
157
- meta: Record<string, unknown>;
158
- };
159
- type SectionNode = {
160
- type: "section";
161
- id: string;
162
- title: string;
163
- path?: string;
164
- href?: string;
165
- group?: string;
166
- children: TreeNode[];
167
- };
168
- type FolderNode = {
169
- type: "folder";
170
- id: string;
171
- title: string;
172
- path?: string;
173
- href?: string;
174
- group?: string;
175
- children: TreeNode[];
207
+ path: string;
208
+ frontmatter: PageFrontmatter<TCustom>;
209
+ body: string;
176
210
  };
177
- type LinkNode = {
178
- type: "link";
179
- id: string;
180
- title: string;
181
- href: string;
211
+ type PageSummary<TCustom extends Record<string, unknown> = Record<string, unknown>> = Omit<PageData<TCustom>, "body"> & {
212
+ body?: string;
182
213
  };
183
- type TreeNode = PageNode | SectionNode | FolderNode | LinkNode;
184
- type NavPage = PageNode;
185
- type NavLink = LinkNode;
186
- type NavSection = SectionNode;
187
- type NavFolder = FolderNode;
188
- type NavItem = TreeNode;
214
+
189
215
  type RouteRecord = {
190
216
  fileID: string;
191
217
  slug: string;
@@ -207,9 +233,9 @@ type GroupManifest = {
207
233
  path: string;
208
234
  origin?: string;
209
235
  ancestry?: string[];
210
- og?: OgIndexMetadata;
236
+ metadata?: IndexMetadata;
211
237
  meta?: Record<string, unknown>;
212
- tree: TreeNode[];
238
+ navigation: ResolvedNavigation;
213
239
  pages: PageData[];
214
240
  };
215
241
  type ManifestLike = {
@@ -217,34 +243,33 @@ type ManifestLike = {
217
243
  groups: Record<string, GroupManifest>;
218
244
  routes: RouteRecord[];
219
245
  pages: PageData[];
220
- tree: TreeNode[];
221
246
  attribution?: Record<string, ResolvedAttribution>;
222
247
  contentHash: string;
223
248
  };
224
249
  type RootLayoutProps = {
225
250
  children: React.ReactNode;
226
251
  site: SiteData;
227
- tree: TreeNode[];
252
+ navigation: ResolvedNavigation;
228
253
  currentPath?: string;
229
254
  currentGroup?: GroupContext;
230
255
  activeGroups?: readonly GroupContext[];
231
256
  };
232
257
  type RootPageProps = {
233
258
  site: SiteData;
234
- tree: TreeNode[];
259
+ navigation: ResolvedNavigation;
235
260
  };
236
261
  type LayoutProps = {
237
262
  children: React.ReactNode;
238
263
  site: SiteData;
239
- tree: TreeNode[];
240
- node: TreeNode;
264
+ navigation: ResolvedNavigation;
265
+ node: NavigationNode;
241
266
  currentPath: string;
242
267
  group: string;
243
268
  };
244
269
  type PageProps<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
245
270
  site: SiteData;
246
- tree: TreeNode[];
247
- node: TreeNode;
271
+ navigation: ResolvedNavigation;
272
+ node: NavigationNode;
248
273
  page: PageData<TMeta>;
249
274
  markdownRevision?: string;
250
275
  currentPath: string;
@@ -252,8 +277,8 @@ type PageProps<TMeta extends Record<string, unknown> = Record<string, unknown>>
252
277
  };
253
278
  type IndexPageProps = {
254
279
  site: SiteData;
255
- tree: TreeNode[];
256
- node: TreeNode;
280
+ navigation: ResolvedNavigation;
281
+ node: NavigationNode;
257
282
  currentPath: string;
258
283
  group: string;
259
284
  };
@@ -274,4 +299,4 @@ type GroupContext = {
274
299
 
275
300
  declare const __publishOsTypesModule = true;
276
301
 
277
- export { type Author, type FolderNode, type GroupContext, type GroupForcedMode, type GroupManifest, type Heading, type IndexPageProps, type LayoutProps, type LinkNode, type ManifestLike, type NavFolder, type NavItem, type NavLink, type NavPage, type NavSection, type OgImageMetadata, type OgIndexMetadata, type OgMetadata, type PageData, type PageFrontmatter, type PageNode, type PageProps, type PageStatus, type PageSummary, type ResolvedAttribution, type RootLayoutProps, type RootPageProps, type RouteRecord, type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type SearchInput, type SearchOutput, type SearchResult, type SearchStatus, type SearchSubResult, type SectionNode, type SiteData, type ThemeMode, type TreeNode, __publishOsTypesModule };
302
+ export { type Author, type GroupContext, type GroupForcedMode, type GroupManifest, type Heading, type IndexMetadata, type IndexPageProps, type LayoutProps, type ManifestLike, type NavigationContainerNode, type NavigationGroupNode, type NavigationLinkNode, type NavigationNode, type NavigationPageNode, type NavigationSwitchViewNode, type NavigationViewNode, type OgImageMetadata, type OgMetadata, type PageData, type PageFrontmatter, type PageMetadata, type PageProps, type PageStatus, type PageSummary, type ResolvedAttribution, type ResolvedNavigation, type RootLayoutProps, type RootPageProps, type RouteRecord, type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type SearchInput, type SearchOutput, type SearchResult, type SearchStatus, type SearchSubResult, type SiteData, type ThemeMode, __publishOsTypesModule };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  validateLocalSource
3
- } from "./chunk-ORIUWJBQ.js";
3
+ } from "./chunk-SBMDONTV.js";
4
4
  import "./chunk-NNBJZPFM.js";
5
- import "./chunk-F3AGNDF4.js";
5
+ import "./chunk-DZ3VWEV5.js";
6
6
  import "./chunk-7NY22B5U.js";
7
- import "./chunk-UYGCOWRF.js";
7
+ import "./chunk-DX7PXFCM.js";
8
8
  import "./chunk-EFO6AWXN.js";
9
9
  import "./chunk-5KAD7W53.js";
10
10
  import "./chunk-WL75GQ5M.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  validatePublishOsSource
3
- } from "./chunk-F3AGNDF4.js";
3
+ } from "./chunk-DZ3VWEV5.js";
4
4
  import "./chunk-7NY22B5U.js";
5
- import "./chunk-UYGCOWRF.js";
5
+ import "./chunk-DX7PXFCM.js";
6
6
  import "./chunk-EFO6AWXN.js";
7
7
  import "./chunk-5KAD7W53.js";
8
8
  import "./chunk-WL75GQ5M.js";
@@ -1,54 +1,57 @@
1
+ import { authoredDate, authorNames } from "@components/blog/frontmatter";
1
2
  import type {
2
3
  IndexPageProps,
3
- PageNode,
4
- TreeNode,
4
+ NavigationNode,
5
+ NavigationPageNode,
5
6
  } from "@publish.os/nextjs/types";
6
7
  import { prettyDate } from "@publish.os/nextjs/utils/pretty-date";
7
8
  import Link from "next/link";
8
9
 
9
- function pageNodes(nodes: TreeNode[]): PageNode[] {
10
+ function pageNodes(nodes: NavigationNode[]): NavigationPageNode[] {
10
11
  return nodes.flatMap((node) => {
11
12
  if (node.type === "page") return [node];
12
- if (node.type === "section" || node.type === "folder") {
13
+ if (
14
+ node.type === "section" ||
15
+ node.type === "folder" ||
16
+ node.type === "group"
17
+ ) {
13
18
  return pageNodes(node.children);
14
19
  }
20
+ if (node.type === "view") return pageNodes(node.items);
15
21
  return [];
16
22
  });
17
23
  }
18
24
 
19
- export default function BlogIndex({ node, tree }: IndexPageProps) {
20
- const posts = pageNodes(tree)
21
- .filter((page) => page.status === "published")
22
- .sort(
23
- (a, b) =>
24
- (b.publishedAt ?? "").localeCompare(a.publishedAt ?? "") ||
25
- a.path.localeCompare(b.path),
26
- );
25
+ export default function BlogIndex({ node, navigation }: IndexPageProps) {
26
+ const posts = pageNodes(navigation.items).filter(
27
+ (entry) => entry.page.frontmatter.status === "published",
28
+ );
27
29
 
28
30
  return (
29
31
  <section className="w-full px-4 py-12 md:px-5 lg:px-6 lg:py-16">
30
32
  <h1 className="mb-10 text-balance text-5xl font-medium leading-none tracking-tight text-foreground-1">
31
- {node.title}
33
+ {node.type === "page" ? node.page.frontmatter.title : node.label}
32
34
  </h1>
33
35
  {posts.length > 0 ? (
34
36
  <ul>
35
37
  {posts.map((post) => {
36
- const authors = post.authors
37
- .map((author) => author.name)
38
- .join(", ");
39
- const date = prettyDate(post.publishedAt);
38
+ const authors = authorNames(post.page.frontmatter.authors);
39
+ const publishedAt = authoredDate(post.page.frontmatter.publishedAt);
40
+ const date = prettyDate(publishedAt);
40
41
 
41
42
  return (
42
43
  <li
43
44
  className="border-b border-stroke-4 last:border-b-0"
44
- key={post.path}
45
+ key={post.page.path}
45
46
  >
46
47
  <Link
47
48
  className="-mx-4 flex min-h-12 items-center gap-6 rounded-card px-4 py-4 text-sm text-foreground-1 hover:bg-surface-hover active:bg-surface-active focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke"
48
- href={post.path}
49
- title={post.title}
49
+ href={post.href}
50
+ title={post.page.frontmatter.title}
50
51
  >
51
- <span className="min-w-0 flex-1 truncate">{post.title}</span>
52
+ <span className="min-w-0 flex-1 truncate">
53
+ {post.page.frontmatter.title}
54
+ </span>
52
55
  <span className="hidden min-w-0 max-w-[45%] items-baseline gap-1.5 text-foreground-3 md:flex">
53
56
  {authors ? (
54
57
  <span className="truncate">{authors}</span>
@@ -57,7 +60,7 @@ export default function BlogIndex({ node, tree }: IndexPageProps) {
57
60
  {date ? (
58
61
  <time
59
62
  className="shrink-0 whitespace-nowrap"
60
- dateTime={post.publishedAt}
63
+ dateTime={publishedAt}
61
64
  >
62
65
  {date}
63
66
  </time>
@@ -1,30 +1,45 @@
1
+ import { CopyLink } from "@components/blog/copy-link";
2
+ import { authoredDate, authorNames } from "@components/blog/frontmatter";
3
+ import { Link } from "@components/ui/link";
1
4
  import { CaretLeftIcon } from "@phosphor-icons/react/ssr";
2
5
  import { MDX } from "@publish.os/nextjs/mdx";
3
6
  import type { PageProps } from "@publish.os/nextjs/types";
4
7
  import { prettyDate } from "@publish.os/nextjs/utils/pretty-date";
5
8
  import Image from "next/image";
6
- import Link from "next/link";
7
- import { CopyLink } from "../components/blog/copy-link";
8
9
 
9
10
  type BlogMeta = {
11
+ authors?: unknown;
10
12
  image?: { src: string; alt: string };
13
+ publishedAt?: unknown;
11
14
  };
12
15
 
13
16
  export default function BlogLeaf({ page }: PageProps<BlogMeta>) {
14
- const authors = page.authors.map((author) => author.name).join(", ");
15
- const date = prettyDate(page.publishedAt);
17
+ const authors = authorNames(page.frontmatter.authors);
18
+ const publishedAt = authoredDate(page.frontmatter.publishedAt);
19
+ const date = prettyDate(publishedAt);
20
+ const image = page.frontmatter.image;
21
+ const cover =
22
+ image &&
23
+ typeof image === "object" &&
24
+ typeof image.src === "string" &&
25
+ typeof image.alt === "string"
26
+ ? image
27
+ : undefined;
16
28
 
17
29
  return (
18
30
  <div className="flex min-h-0 min-w-0 flex-1 flex-col px-4 pt-6 md:px-5 lg:px-6 lg:pt-8">
19
31
  <nav aria-label="Blog" className="mb-8 lg:mb-12">
20
32
  <Link
21
- className="-ms-2 inline-flex min-h-11 items-center gap-1.5 rounded-button px-2 text-sm text-foreground-3 hover:text-foreground-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke"
33
+ className="-ms-2 inline-flex min-h-11 items-center px-2 text-foreground-3 hover:text-foreground-1"
22
34
  href="/blog"
35
+ leftIcon={
36
+ <CaretLeftIcon
37
+ aria-hidden="true"
38
+ className="size-3.5 shrink-0 rtl:rotate-180"
39
+ />
40
+ }
41
+ size="sm"
23
42
  >
24
- <CaretLeftIcon
25
- aria-hidden="true"
26
- className="size-3.5 shrink-0 rtl:rotate-180"
27
- />
28
43
  Blog
29
44
  </Link>
30
45
  </nav>
@@ -32,24 +47,24 @@ export default function BlogLeaf({ page }: PageProps<BlogMeta>) {
32
47
  <header>
33
48
  <div className="mx-auto w-full max-w-2xl">
34
49
  <h1 className="text-balance text-center text-4xl font-medium leading-tight tracking-tight text-foreground-1 md:text-5xl">
35
- {page.title}
50
+ {page.frontmatter.title}
36
51
  </h1>
37
52
  </div>
38
- {page.meta.image ? (
53
+ {cover ? (
39
54
  <Image
40
- alt={page.meta.image.alt}
55
+ alt={cover.alt}
41
56
  className="mt-10 aspect-2/1 w-full rounded-media border border-stroke-3 object-cover"
42
57
  height={800}
43
58
  priority
44
59
  sizes="(max-width: 896px) 100vw, 896px"
45
- src={page.meta.image.src}
60
+ src={cover.src}
46
61
  width={1600}
47
62
  />
48
63
  ) : null}
49
64
  <div className="mx-auto w-full max-w-2xl">
50
- {page.description ? (
65
+ {page.frontmatter.description ? (
51
66
  <p className="mt-12 text-pretty text-center text-base italic leading-7 text-foreground-2">
52
- {page.description}
67
+ {page.frontmatter.description}
53
68
  </p>
54
69
  ) : null}
55
70
  <hr className="my-10 border-stroke-3" />
@@ -64,7 +79,7 @@ export default function BlogLeaf({ page }: PageProps<BlogMeta>) {
64
79
  <p className="flex flex-wrap items-baseline gap-x-1.5 text-sm text-foreground-3">
65
80
  {authors ? <span>{authors}</span> : null}
66
81
  {authors && date ? <span aria-hidden="true">·</span> : null}
67
- {date ? <time dateTime={page.publishedAt}>{date}</time> : null}
82
+ {date ? <time dateTime={publishedAt}>{date}</time> : null}
68
83
  </p>
69
84
  ) : null}
70
85
  <CopyLink className="ms-auto" path={page.path} />
@@ -31,7 +31,7 @@ export function CopyLink({
31
31
  <div className={className}>
32
32
  <Link
33
33
  aria-busy={status === "pending" || undefined}
34
- className="inline-flex min-h-11 items-center text-foreground-3 hover:text-foreground-1 active:text-foreground-1 motion-safe:transition-[color,scale] motion-safe:duration-150 motion-safe:active:scale-[0.96] motion-reduce:transition-none"
34
+ className="inline-flex min-h-11 items-center text-foreground-3 hover:text-foreground-1 motion-safe:active:scale-[0.96]"
35
35
  href={path}
36
36
  leftIcon={<LinkSimpleIcon aria-hidden="true" />}
37
37
  onClick={(event) => {
@@ -0,0 +1,41 @@
1
+ export function authorNames(value: unknown): string {
2
+ if (!Array.isArray(value)) return "";
3
+ return value
4
+ .flatMap((author: unknown) => {
5
+ if (typeof author === "string") return [author];
6
+ if (
7
+ author &&
8
+ typeof author === "object" &&
9
+ "name" in author &&
10
+ typeof author.name === "string"
11
+ ) {
12
+ return [author.name];
13
+ }
14
+ return [];
15
+ })
16
+ .join(", ");
17
+ }
18
+
19
+ export function stringList(value: unknown): string {
20
+ return Array.isArray(value)
21
+ ? value
22
+ .filter((item): item is string => typeof item === "string")
23
+ .join(", ")
24
+ : "";
25
+ }
26
+
27
+ export function authoredDate(value: unknown): string | undefined {
28
+ if (typeof value !== "string") return undefined;
29
+ if (
30
+ !/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?$/.test(
31
+ value,
32
+ )
33
+ )
34
+ return undefined;
35
+ const timestamp = Date.parse(value);
36
+ if (!Number.isFinite(timestamp)) return undefined;
37
+ const day = value.slice(0, 10);
38
+ if (new Date(`${day}T00:00:00Z`).toISOString().slice(0, 10) !== day)
39
+ return undefined;
40
+ return value;
41
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "runtime": "@publish.os/nextjs@0.0.1-alpha.91",
3
+ "runtime": "@publish.os/nextjs@0.0.1-alpha.92",
4
4
  "site": {
5
5
  "name": "publish.os guides",
6
6
  "description": "Documentation and updates for your project."
@@ -16,6 +16,17 @@
16
16
  },
17
17
  "groups": {
18
18
  "docs": { "title": "Docs" },
19
- "blog": { "title": "Blog" }
19
+ "blog": {
20
+ "title": "Blog",
21
+ "navigation": {
22
+ "items": [],
23
+ "sort": {
24
+ "source": "frontmatter",
25
+ "field": "publishedAt",
26
+ "type": "date",
27
+ "direction": "desc"
28
+ }
29
+ }
30
+ }
20
31
  }
21
32
  }
@@ -17,6 +17,7 @@
17
17
  "blog/layout.tsx",
18
18
  "blog/page.tsx",
19
19
  "components/blog/copy-link.tsx",
20
+ "components/blog/frontmatter.ts",
20
21
  "blog/content/hello-world.mdx",
21
22
  "blog/content/series-a.mdx"
22
23
  ]
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "version": 1,
3
- "runtime": "@publish.os/nextjs@0.0.1-alpha.91"
3
+ "runtime": "@publish.os/nextjs@0.0.1-alpha.92"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@publish.os/nextjs",
3
- "version": "0.0.1-alpha.91",
3
+ "version": "0.0.1-alpha.92",
4
4
  "description": "Components and routes for generated publishOS Next.js sites.",
5
5
  "homepage": "https://publish.dev",
6
6
  "bugs": {
@@ -534,7 +534,6 @@
534
534
  "class-variance-authority": "0.7.1",
535
535
  "cn": "^0.2.6",
536
536
  "fontkit": "^2.0.4",
537
- "gray-matter": "^4.0.3",
538
537
  "next-mdx-remote": "^6.0.0",
539
538
  "next-themes": "^0.4.0",
540
539
  "postcss": "8.5.28",
@@ -548,10 +547,11 @@
548
547
  "remark-stringify": "^11.0.0",
549
548
  "saxes": "^6.0.0",
550
549
  "sharp": "0.35.5",
551
- "shiki": "^4.4.3",
550
+ "shiki": "^4.5.0",
552
551
  "tar": "7.5.22",
553
552
  "unified": "^11.0.5",
554
- "zod": "^3.23.8"
553
+ "yaml": "2.9.1",
554
+ "zod": "^4.6.7"
555
555
  },
556
556
  "peerDependencies": {
557
557
  "next": ">=16.4.2",
@@ -2,7 +2,7 @@
2
2
  "engines": {
3
3
  "node": "^24.22.1"
4
4
  },
5
- "name": "publish-os-nextjs-app-phosphor-install",
5
+ "name": "publish-os-site",
6
6
  "packageManager": "pnpm@12.3.0",
7
7
  "private": true,
8
8
  "type": "module",