@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.
- package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -2
- package/compiler-assets/nextjs/defaults/group/page.tsx +7 -6
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +2 -1
- package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
- package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
- package/compiler-assets/nextjs/shims/document.tsx +9 -1
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +3 -0
- package/compiler-assets/nextjs/shims/proxy.ts +156 -54
- package/dist/{build-operation-5QMLXF7N.js → build-operation-CJDUL4OW.js} +5 -5
- package/dist/{chunk-GBPLER5H.js → chunk-3T4HVDSC.js} +2 -2
- package/dist/{chunk-UYGCOWRF.js → chunk-DX7PXFCM.js} +860 -50
- package/dist/{chunk-F3AGNDF4.js → chunk-DZ3VWEV5.js} +860 -575
- package/dist/{chunk-OXOFRXEI.js → chunk-NHSLTARU.js} +1284 -1164
- package/dist/{chunk-ORIUWJBQ.js → chunk-SBMDONTV.js} +3 -2
- package/dist/compiler.js +42 -23
- package/dist/components/blocks/agent-actions.d.ts +7 -7
- package/dist/components/blocks/agent-actions.js +1 -32
- package/dist/components/blocks/toc.d.ts +7 -7
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/{compose-CVBJRAF6.js → compose-44GJSMXD.js} +2 -2
- package/dist/config/createNextConfig.js +2 -0
- package/dist/{dev-operation-OSHHWRWK.js → dev-operation-WNECBHZ5.js} +17 -7
- package/dist/{ide-support-CU6Z5PVR.js → ide-support-TG74L4FF.js} +3 -3
- package/dist/index.d.ts +143 -126
- package/dist/index.js +25 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +7 -7
- package/dist/kernel/components/blocks/AgentActions.js +1 -32
- package/dist/kernel/components/blocks/agent-actions.d.ts +1 -2
- package/dist/kernel/components/blocks/agent-actions.js +1 -32
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +19 -13
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +62 -42
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +29 -6
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +30 -7
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +12 -2
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +132 -26
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- package/dist/kernel/components/blocks/toc-client.d.ts +7 -7
- package/dist/kernel/components/blocks/toc.d.ts +3 -3
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +2 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +3 -3
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +3 -2
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +1 -1
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/link.d.ts +3 -3
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/video-player.d.ts +2 -2
- package/dist/kernel/components/mdx/components/video.d.ts +2 -3
- package/dist/kernel/components/mdx/error-boundary.d.ts +2 -3
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/mdx.d.ts +42 -11
- package/dist/kernel/components/mdx/mdx.js +1 -1
- package/dist/kernel/components/next-image.d.ts +3 -3
- package/dist/kernel/components/ui/accordion.d.ts +7 -7
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -3
- package/dist/kernel/components/ui/breadcrumb.d.ts +13 -13
- package/dist/kernel/components/ui/button-group.d.ts +5 -5
- package/dist/kernel/components/ui/button.d.ts +3 -3
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- package/dist/kernel/components/ui/kbd.d.ts +3 -3
- package/dist/kernel/components/ui/link.d.ts +3 -3
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/scroll-area.d.ts +1 -2
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/defaults.registry.d.ts +2 -2
- package/dist/kernel/defaults.registry.js +2 -2
- package/dist/kernel/routes/agent/markdown.d.ts +4 -0
- package/dist/kernel/routes/agent/markdown.js +11 -7
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +34 -29
- package/dist/kernel/routes/metadata/llms.d.ts +3 -31
- package/dist/kernel/routes/metadata/llms.js +2 -200
- package/dist/kernel/routes/metadata/robots.d.ts +5 -3
- package/dist/kernel/routes/metadata/robots.js +4 -25
- package/dist/kernel/routes/metadata/sitemap.d.ts +15 -1
- package/dist/kernel/routes/metadata/sitemap.js +200 -112
- package/dist/kernel/routes/not-found.js +1 -1
- package/dist/kernel/routes/pages/group.d.ts +3 -3
- package/dist/kernel/routes/pages/group.js +10 -4
- package/dist/kernel/routes/pages/leaf.d.ts +9 -4
- package/dist/kernel/routes/pages/leaf.js +16 -8
- package/dist/kernel/routes/pages/root.d.ts +3 -3
- package/dist/kernel/routes/pages/root.js +20 -5
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +65 -35
- package/dist/search.d.ts +2 -9
- package/dist/search.js +2 -7
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types.d.ts +116 -91
- package/dist/{validate-local-source-SV44DBQT.js → validate-local-source-EN2GW4FR.js} +3 -3
- package/dist/{validate-publish-os-source-NZJF3TB2.js → validate-publish-os-source-OEWQDB7B.js} +2 -2
- package/init/seed/minimal/publish.os/blog/index.tsx +25 -22
- package/init/seed/minimal/publish.os/blog/page.tsx +31 -16
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +1 -1
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +13 -2
- package/init/seed/minimal/seed.json +1 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +4 -4
- package/release/app/phosphor/package.json +1 -1
- package/release/app/phosphor/pnpm-lock.yaml.template +53 -127
- package/release/compiler/pnpm-lock.yaml.template +49 -123
- package/release/release.json +4 -4
- package/dist/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- package/dist/types-J2w_puPF.d.ts +0 -128
- 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
|
-
|
|
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
|
|
103
|
-
|
|
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"
|
|
113
|
-
type
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
|
178
|
-
|
|
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
|
-
|
|
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
|
-
|
|
236
|
+
metadata?: IndexMetadata;
|
|
211
237
|
meta?: Record<string, unknown>;
|
|
212
|
-
|
|
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
|
-
|
|
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
|
-
|
|
259
|
+
navigation: ResolvedNavigation;
|
|
235
260
|
};
|
|
236
261
|
type LayoutProps = {
|
|
237
262
|
children: React.ReactNode;
|
|
238
263
|
site: SiteData;
|
|
239
|
-
|
|
240
|
-
node:
|
|
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
|
-
|
|
247
|
-
node:
|
|
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
|
-
|
|
256
|
-
node:
|
|
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
|
|
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-
|
|
3
|
+
} from "./chunk-SBMDONTV.js";
|
|
4
4
|
import "./chunk-NNBJZPFM.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-DZ3VWEV5.js";
|
|
6
6
|
import "./chunk-7NY22B5U.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DX7PXFCM.js";
|
|
8
8
|
import "./chunk-EFO6AWXN.js";
|
|
9
9
|
import "./chunk-5KAD7W53.js";
|
|
10
10
|
import "./chunk-WL75GQ5M.js";
|
package/dist/{validate-publish-os-source-NZJF3TB2.js → validate-publish-os-source-OEWQDB7B.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePublishOsSource
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DZ3VWEV5.js";
|
|
4
4
|
import "./chunk-7NY22B5U.js";
|
|
5
|
-
import "./chunk-
|
|
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
|
-
|
|
4
|
-
|
|
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:
|
|
10
|
+
function pageNodes(nodes: NavigationNode[]): NavigationPageNode[] {
|
|
10
11
|
return nodes.flatMap((node) => {
|
|
11
12
|
if (node.type === "page") return [node];
|
|
12
|
-
if (
|
|
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,
|
|
20
|
-
const posts = pageNodes(
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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.
|
|
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">
|
|
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={
|
|
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
|
|
15
|
-
const
|
|
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
|
|
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
|
-
{
|
|
53
|
+
{cover ? (
|
|
39
54
|
<Image
|
|
40
|
-
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={
|
|
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={
|
|
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
|
|
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.
|
|
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": {
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@publish.os/nextjs",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
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.
|
|
550
|
+
"shiki": "^4.5.0",
|
|
552
551
|
"tar": "7.5.22",
|
|
553
552
|
"unified": "^11.0.5",
|
|
554
|
-
"
|
|
553
|
+
"yaml": "2.9.1",
|
|
554
|
+
"zod": "^4.6.7"
|
|
555
555
|
},
|
|
556
556
|
"peerDependencies": {
|
|
557
557
|
"next": ">=16.4.2",
|