@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
- package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- 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 +46 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
- package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
- package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
- package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
- package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
- package/compiler-assets/nextjs/shims/proxy.ts +254 -86
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
- package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
- package/dist/{build-operation-2JAYBSKF.js → build-operation-CJDUL4OW.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-3T4HVDSC.js +426 -0
- package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
- package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
- package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
- package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
- package/dist/chunk-DX7PXFCM.js +2519 -0
- package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +111 -23
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +563 -0
- package/dist/components/blocks/toc.d.ts +43 -0
- package/dist/components/blocks/toc.js +136 -0
- package/dist/components/ui/button.d.ts +4 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-44GJSMXD.js +16 -0
- package/dist/config/createNextConfig.js +19 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-TG74L4FF.js +16 -0
- package/dist/index.d.ts +151 -95
- package/dist/index.js +25 -0
- package/dist/jsx-dev-runtime.d.ts +6 -0
- package/dist/jsx-dev-runtime.js +100 -0
- package/dist/jsx-runtime.d.ts +7 -0
- package/dist/jsx-runtime.js +97 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +37 -8
- package/dist/kernel/components/blocks/AgentActions.js +384 -174
- package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
- package/dist/kernel/components/blocks/agent-actions.js +563 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +79 -59
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +30 -7
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +32 -9
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +13 -3
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +137 -28
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- package/dist/kernel/components/blocks/theme-toggle.js +5 -5
- package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
- package/dist/kernel/components/blocks/toc-client.js +495 -0
- package/dist/kernel/components/blocks/toc.d.ts +20 -2
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +22 -17
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +6 -6
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -4
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +57 -16
- package/dist/kernel/components/mdx/mdx.js +232 -35
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/next-image.d.ts +12 -0
- package/dist/kernel/components/next-image.js +61 -0
- package/dist/kernel/components/ui/accordion.d.ts +7 -7
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +6 -6
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +59 -7
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- package/dist/kernel/components/ui/drawer.js +1 -1
- package/dist/kernel/components/ui/input.d.ts +2 -2
- package/dist/kernel/components/ui/input.js +1 -1
- package/dist/kernel/components/ui/kbd.d.ts +4 -4
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +11 -5
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
- package/dist/kernel/components/ui/scroll-area.js +1 -1
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +4 -17
- package/dist/kernel/defaults.registry.js +4 -19
- package/dist/kernel/routes/agent/markdown.d.ts +7 -0
- package/dist/kernel/routes/agent/markdown.js +229 -54
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +5 -7
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +119 -88
- package/dist/kernel/routes/metadata/llms.d.ts +3 -23
- package/dist/kernel/routes/metadata/llms.js +2 -103
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- 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 +36 -3
- package/dist/kernel/routes/metadata/sitemap.js +277 -49
- package/dist/kernel/routes/not-found.d.ts +34 -0
- package/dist/kernel/routes/not-found.js +213 -0
- package/dist/kernel/routes/pages/group.d.ts +5 -5
- package/dist/kernel/routes/pages/group.js +11 -5
- package/dist/kernel/routes/pages/leaf.d.ts +38 -6
- package/dist/kernel/routes/pages/leaf.js +21 -12
- package/dist/kernel/routes/pages/root.d.ts +5 -5
- package/dist/kernel/routes/pages/root.js +21 -6
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/keyboard-shortcuts.js +1 -1
- 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/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +2 -9
- package/dist/search.js +9 -16
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/theme-scope.js +1 -1
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +117 -91
- package/dist/utils/heading-ids.js +30 -11
- package/dist/utils/toc-selection.d.ts +7 -0
- package/dist/utils/toc-selection.js +14 -0
- package/dist/validate-local-source-EN2GW4FR.js +16 -0
- package/dist/validate-publish-os-source-OEWQDB7B.js +14 -0
- package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
- package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
- package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
- package/init/seed/minimal/publish.os/blog/index.tsx +85 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
- package/init/seed/minimal/publish.os/publish.os.config.json +17 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +12 -4
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +48 -23
- package/release/app/phosphor/package.json +4 -4
- package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +153 -183
- package/release/release.json +6 -6
- package/dist/button-CtzUJB8u.d.ts +0 -11
- package/dist/chunk-535TM4A5.js +0 -1455
- package/dist/chunk-B2V22WRT.js +0 -297
- package/dist/chunk-NECL5IBJ.js +0 -318
- package/dist/chunk-SVYGXXYR.js +0 -36
- package/dist/chunk-UF6ATARM.js +0 -1100
- package/dist/compose-NN23UJGC.js +0 -13
- package/dist/ide-support-ZNW7ODFY.js +0 -15
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -667
- package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/link-playground.js +0 -744
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -53
- package/dist/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-BzkZty3r.d.ts +0 -147
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- package/dist/validate-local-source-XRL2Y7XE.js +0 -14
- package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
- package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/lib/runtime/metadata/canonical-url.ts
|
|
2
2
|
function canonicalUrl(manifest, path, group) {
|
|
3
3
|
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
4
|
-
if (!origin)
|
|
4
|
+
if (!origin)
|
|
5
|
+
return /^[a-z][a-z\d+.-]*:/i.test(path) ? path : new URL(path, "https://publish.invalid").pathname;
|
|
5
6
|
try {
|
|
6
7
|
return new URL(path, `${origin}/`).toString();
|
|
7
8
|
} catch {
|
|
@@ -10,18 +11,33 @@ function canonicalUrl(manifest, path, group) {
|
|
|
10
11
|
}
|
|
11
12
|
function navigationUrl(manifest, path, group) {
|
|
12
13
|
let origin = manifest.groups[group]?.origin ?? manifest.site.origin;
|
|
13
|
-
return !origin || origin === manifest.site.origin ? path : canonicalUrl(manifest, path, group);
|
|
14
|
+
return !origin || origin === manifest.site.origin ? new URL(path, "https://publish.invalid").pathname : canonicalUrl(manifest, path, group);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
// src/manifest-resolver.ts
|
|
17
|
-
function
|
|
18
|
+
function findPageNode(nodes, id) {
|
|
18
19
|
for (let node of nodes) {
|
|
19
|
-
if (node.type === "page")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
if (node.type === "page" && node.page.fileID === id) return node;
|
|
21
|
+
if ("children" in node && node.children) {
|
|
22
|
+
let found = findPageNode(node.children, id);
|
|
23
|
+
if (found) return found;
|
|
24
|
+
}
|
|
25
|
+
if (node.type === "view") {
|
|
26
|
+
let found = findPageNode(node.items, id);
|
|
27
|
+
if (found) return found;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
function findGroupNode(nodes, groupKey) {
|
|
33
|
+
for (let node of nodes) {
|
|
34
|
+
if (node.type === "group" && node.groupKey === groupKey) return node;
|
|
35
|
+
if ("children" in node && node.children) {
|
|
36
|
+
let found = findGroupNode(node.children, groupKey);
|
|
37
|
+
if (found) return found;
|
|
38
|
+
}
|
|
39
|
+
if (node.type === "view") {
|
|
40
|
+
let found = findGroupNode(node.items, groupKey);
|
|
25
41
|
if (found) return found;
|
|
26
42
|
}
|
|
27
43
|
}
|
|
@@ -29,43 +45,53 @@ function findNodeInTree(nodes, id) {
|
|
|
29
45
|
}
|
|
30
46
|
function pageNode(manifest, page) {
|
|
31
47
|
return {
|
|
48
|
+
id: `page:${page.group}:${page.fileID}`,
|
|
32
49
|
type: "page",
|
|
33
|
-
|
|
34
|
-
title: page.title,
|
|
35
|
-
path: page.path,
|
|
50
|
+
label: page.frontmatter.title,
|
|
36
51
|
href: navigationUrl(manifest, page.path, page.group),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
tags: page.tags,
|
|
44
|
-
meta: page.meta
|
|
52
|
+
page: {
|
|
53
|
+
fileID: page.fileID,
|
|
54
|
+
group: page.group,
|
|
55
|
+
path: page.path,
|
|
56
|
+
frontmatter: page.frontmatter
|
|
57
|
+
}
|
|
45
58
|
};
|
|
46
59
|
}
|
|
47
60
|
function groupNode(manifest, group) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
let inNavigation = findGroupNode(group.navigation.items, group.key);
|
|
62
|
+
return inNavigation || {
|
|
63
|
+
type: "group",
|
|
64
|
+
id: `group:${group.key}`,
|
|
65
|
+
label: group.title,
|
|
66
|
+
groupKey: group.key,
|
|
67
|
+
route: group.path,
|
|
68
|
+
presentation: "page",
|
|
53
69
|
href: navigationUrl(manifest, group.path, group.key),
|
|
54
|
-
|
|
55
|
-
children: group.tree
|
|
70
|
+
children: group.navigation.items
|
|
56
71
|
};
|
|
57
72
|
}
|
|
58
73
|
function resolveLeaf(manifest, group, slug) {
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
let segments;
|
|
75
|
+
try {
|
|
76
|
+
segments = (Array.isArray(slug) ? slug : slug.split("/")).map(
|
|
77
|
+
(segment) => decodeURIComponent(segment).normalize("NFC")
|
|
78
|
+
);
|
|
79
|
+
} catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if (segments.some((segment) => /[/\\\0]/u.test(segment))) return null;
|
|
83
|
+
let slugPath = segments.join("/"), groupData = manifest.groups[group];
|
|
84
|
+
if (!groupData) return null;
|
|
85
|
+
let pagePath = `${groupData.path === "/" ? "" : groupData.path.replace(/\/$/, "")}/${slugPath}`, page = manifest.pages.find(
|
|
86
|
+
(p) => p.group === group && p.path.normalize("NFC") === pagePath
|
|
87
|
+
) ?? null;
|
|
88
|
+
return page ? {
|
|
63
89
|
site: {
|
|
64
90
|
...manifest.site,
|
|
65
91
|
origin: groupData.origin ?? manifest.site.origin
|
|
66
92
|
},
|
|
67
|
-
|
|
68
|
-
node:
|
|
93
|
+
navigation: groupData.navigation,
|
|
94
|
+
node: findPageNode(groupData.navigation.items, page.fileID) ?? pageNode(manifest, page),
|
|
69
95
|
page,
|
|
70
96
|
currentPath: page.path,
|
|
71
97
|
group
|
|
@@ -78,7 +104,7 @@ function resolveGroup(manifest, group) {
|
|
|
78
104
|
...manifest.site,
|
|
79
105
|
origin: groupData.origin ?? manifest.site.origin
|
|
80
106
|
},
|
|
81
|
-
|
|
107
|
+
navigation: groupData.navigation,
|
|
82
108
|
node: groupNode(manifest, groupData),
|
|
83
109
|
currentPath: groupData.path,
|
|
84
110
|
group
|
|
@@ -90,7 +116,11 @@ function resolveGroupLayout(manifest, group, children) {
|
|
|
90
116
|
}
|
|
91
117
|
function listStaticParams(manifest, group) {
|
|
92
118
|
let groupData = manifest.groups[group];
|
|
93
|
-
|
|
119
|
+
if (!groupData) return [];
|
|
120
|
+
let basePath = groupData.path === "/" ? "" : groupData.path.replace(/\/$/, "");
|
|
121
|
+
return groupData.pages.map((page) => ({
|
|
122
|
+
slug: page.path.slice(basePath.length).replace(/^\//, "").split("/")
|
|
123
|
+
}));
|
|
94
124
|
}
|
|
95
125
|
export {
|
|
96
126
|
listStaticParams,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
type OgImageEntryLike = {
|
|
2
|
+
key: string;
|
|
3
|
+
routePath: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
source: "asset" | "generated" | "remote";
|
|
7
|
+
url: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
alt: string;
|
|
11
|
+
group?: string;
|
|
12
|
+
logo?: {
|
|
13
|
+
dataUri?: string;
|
|
14
|
+
height?: number;
|
|
15
|
+
kind: "logo" | "mark" | "wordmark";
|
|
16
|
+
url: string;
|
|
17
|
+
width?: number;
|
|
18
|
+
};
|
|
19
|
+
siteName?: string;
|
|
20
|
+
siteUrl?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
background?: string;
|
|
23
|
+
textPrimary?: string;
|
|
24
|
+
textSecondary?: string;
|
|
25
|
+
accent?: string;
|
|
26
|
+
stroke?: string;
|
|
27
|
+
theme?: "light" | "dark";
|
|
28
|
+
fonts?: {
|
|
29
|
+
main: OgFontRoleLike;
|
|
30
|
+
mono: OgFontRoleLike;
|
|
31
|
+
};
|
|
32
|
+
emoji?: Readonly<Record<string, string>>;
|
|
33
|
+
fallbackGlyphs?: Partial<Record<"main" | "mono", Readonly<Record<string, string>>>>;
|
|
34
|
+
fallbackFonts?: ReadonlyArray<{
|
|
35
|
+
family: string;
|
|
36
|
+
data: string;
|
|
37
|
+
style: "normal" | "italic";
|
|
38
|
+
weight: number;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
type OgManifestLike = {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
generated: Record<string, OgImageEntryLike>;
|
|
45
|
+
};
|
|
46
|
+
type OgFontRoleLike = {
|
|
47
|
+
family: string;
|
|
48
|
+
files?: ReadonlyArray<{
|
|
49
|
+
data: string;
|
|
50
|
+
path?: string;
|
|
51
|
+
probe?: string;
|
|
52
|
+
style: "normal" | "italic";
|
|
53
|
+
weight: number;
|
|
54
|
+
}>;
|
|
55
|
+
sourceType: "google" | "local";
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type { OgManifestLike as O };
|
package/dist/search.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { RefObject, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type SearchInput = {
|
|
5
5
|
filters?: {
|
|
6
|
-
author?: string;
|
|
7
6
|
group?: string;
|
|
8
|
-
tag?: string;
|
|
9
7
|
};
|
|
10
8
|
limit?: number;
|
|
11
9
|
offset?: number;
|
|
@@ -22,17 +20,12 @@ type SearchResult = {
|
|
|
22
20
|
excerpt: string;
|
|
23
21
|
id: string;
|
|
24
22
|
meta: {
|
|
25
|
-
author?: string;
|
|
26
23
|
description?: string;
|
|
27
24
|
group?: string;
|
|
28
|
-
image?: string;
|
|
29
25
|
nodeId?: string;
|
|
30
26
|
path?: string;
|
|
31
|
-
publishedAt?: string;
|
|
32
27
|
section?: string;
|
|
33
|
-
tags?: string;
|
|
34
28
|
title?: string;
|
|
35
|
-
updatedAt?: string;
|
|
36
29
|
};
|
|
37
30
|
plainExcerpt: string;
|
|
38
31
|
score?: number;
|
|
@@ -91,6 +84,6 @@ type SearchProviderProps = {
|
|
|
91
84
|
open?: boolean;
|
|
92
85
|
shortcut?: string | false;
|
|
93
86
|
};
|
|
94
|
-
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps):
|
|
87
|
+
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps): react.JSX.Element;
|
|
95
88
|
|
|
96
89
|
export { type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type SearchInput, type SearchOutput, SearchProvider, type SearchProviderProps, type SearchResult, type SearchStatus, type SearchSubResult, search, useSearch, useSearchBlock };
|
package/dist/search.js
CHANGED
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
} from "react";
|
|
17
17
|
|
|
18
18
|
// src/lib/hosting/framework-paths.ts
|
|
19
|
-
var FRAMEWORK_PREFIX = "/publishos",
|
|
20
|
-
var OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`,
|
|
19
|
+
var FRAMEWORK_PREFIX = "/publishos", SOURCE_ASSET_PREFIX = `${FRAMEWORK_PREFIX}/assets`, INTERNAL_PREFIX = `${FRAMEWORK_PREFIX}/internal`, SITE_API_PREFIX = `${FRAMEWORK_PREFIX}/api`, SEARCH_PREFIX = `${INTERNAL_PREFIX}/search`, PAGEFIND_MODULE_URL = `${SEARCH_PREFIX}/pagefind.js`, PAGEFIND_ENTRY_URL = `${SEARCH_PREFIX}/pagefind-entry.json`, IMAGE_OPTIMIZER_PATH = `${SITE_API_PREFIX}/image`;
|
|
20
|
+
var OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`, PUBLIC_INTERNAL_DIRECTORY = INTERNAL_PREFIX.slice(1), PUBLIC_FONT_DIRECTORY = `${PUBLIC_INTERNAL_DIRECTORY}/fonts`, PUBLIC_SEARCH_DIRECTORY = `public/${PUBLIC_INTERNAL_DIRECTORY}/search`, FRAMEWORK_PROXY_MATCHER = `/((?!${FRAMEWORK_PREFIX.slice(1)}(?:/|$)|_next/static|_next/image|_next/webpack-hmr).*)`;
|
|
21
21
|
|
|
22
22
|
// src/modules/search/search.tsx
|
|
23
|
-
import { jsx } from "
|
|
23
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
24
24
|
var EMPTY_SEARCH_OUTPUT = {
|
|
25
25
|
items: [],
|
|
26
26
|
nextOffset: null,
|
|
@@ -95,13 +95,8 @@ async function withPagefindIndex(revision, run) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
function pagefindFilters(filters) {
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
author: filters.author,
|
|
101
|
-
group: filters.group,
|
|
102
|
-
tag: filters.tag
|
|
103
|
-
}).filter((entry) => !!entry[1]);
|
|
104
|
-
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
98
|
+
if (filters)
|
|
99
|
+
return filters.group ? { group: filters.group } : void 0;
|
|
105
100
|
}
|
|
106
101
|
function titleForResult(data) {
|
|
107
102
|
return data.meta?.title ?? data.sub_results?.find((subResult) => subResult.title)?.title ?? data.url;
|
|
@@ -176,20 +171,18 @@ async function runPagefindSearch(input) {
|
|
|
176
171
|
let status = await fetchSearchStatus(input.signal), blockedByStatus = status ? statusOutput(status) : null;
|
|
177
172
|
return blockedByStatus || await withPagefindIndex(status?.revision, async (pagefind) => {
|
|
178
173
|
let limit = normalized.limit ?? DEFAULT_SEARCH_LIMIT, offset = normalized.offset ?? 0, result = await pagefind.search(normalized.q, {
|
|
179
|
-
filters: pagefindFilters(normalized.filters)
|
|
180
|
-
limit,
|
|
181
|
-
offset
|
|
174
|
+
filters: pagefindFilters(normalized.filters)
|
|
182
175
|
});
|
|
183
176
|
if (!result) return EMPTY_SEARCH_OUTPUT;
|
|
184
|
-
let items = await Promise.all(
|
|
185
|
-
|
|
177
|
+
let total = result.results.length, page = result.results.slice(offset, offset + limit), items = await Promise.all(
|
|
178
|
+
page.map(
|
|
186
179
|
async (pagefindResult) => toSearchResult({
|
|
187
180
|
data: await pagefindResult.data(),
|
|
188
181
|
fallbackId: pagefindResult.id,
|
|
189
182
|
score: pagefindResult.score
|
|
190
183
|
})
|
|
191
184
|
)
|
|
192
|
-
),
|
|
185
|
+
), nextOffset = offset + limit < total ? offset + limit : null;
|
|
193
186
|
return {
|
|
194
187
|
items,
|
|
195
188
|
nextOffset,
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Ref, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
type OgImageMetadata = string | {
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
};
|
|
7
|
+
type OgMetadata = {
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
image?: OgImageMetadata;
|
|
11
|
+
};
|
|
12
|
+
type PageStatus = "published" | "draft";
|
|
13
|
+
type PageMetadata = {
|
|
14
|
+
openGraph?: OgMetadata;
|
|
15
|
+
robots?: {
|
|
16
|
+
index?: boolean;
|
|
17
|
+
follow?: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type PageFrontmatter<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
status: PageStatus;
|
|
25
|
+
metadata: PageMetadata;
|
|
26
|
+
};
|
|
27
|
+
type PageData<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
|
|
28
|
+
fileID: string;
|
|
29
|
+
group: string;
|
|
30
|
+
path: string;
|
|
31
|
+
frontmatter: PageFrontmatter<TCustom>;
|
|
32
|
+
body: string;
|
|
33
|
+
};
|
|
34
|
+
type NavigationPageNode = {
|
|
35
|
+
id: string;
|
|
36
|
+
type: "page";
|
|
37
|
+
label: string;
|
|
38
|
+
href: string;
|
|
39
|
+
page: Omit<PageData, "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
|
+
|
|
85
|
+
type SidebarNavigationNode = NavigationNode;
|
|
86
|
+
type SidebarActiveState = "path-active" | "child-path-active";
|
|
87
|
+
type SidebarDepth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
88
|
+
type SidebarNodePrimitiveProps = {
|
|
89
|
+
activeState?: SidebarActiveState;
|
|
90
|
+
activeItemRef?: Ref<HTMLDivElement>;
|
|
91
|
+
children?: ReactNode;
|
|
92
|
+
contentId?: string;
|
|
93
|
+
depth: SidebarDepth;
|
|
94
|
+
expanded?: boolean;
|
|
95
|
+
href?: string;
|
|
96
|
+
isExpandable?: boolean;
|
|
97
|
+
node: SidebarNavigationNode;
|
|
98
|
+
onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
99
|
+
onSwitchView?: () => void;
|
|
100
|
+
onToggle?: () => void;
|
|
101
|
+
parentExpanded: boolean;
|
|
102
|
+
title: string;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type { ResolvedNavigation as R, SidebarNodePrimitiveProps as S, SidebarActiveState as a, SidebarDepth as b, SidebarNavigationNode as c };
|
package/dist/theme-scope.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type ThemeScopeProps = Readonly<{
|
|
@@ -9,7 +9,7 @@ type ThemeScopeProviderProps = Readonly<{
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
group?: string;
|
|
11
11
|
}>;
|
|
12
|
-
declare function ThemeScopeProvider({ children, group, }: ThemeScopeProviderProps):
|
|
12
|
+
declare function ThemeScopeProvider({ children, group, }: ThemeScopeProviderProps): react.JSX.Element;
|
|
13
13
|
declare function useThemeScope(): ThemeScopeProps;
|
|
14
14
|
|
|
15
15
|
export { type ThemeScopeProps, ThemeScopeProvider, type ThemeScopeProviderProps, useThemeScope };
|
package/dist/theme-scope.js
CHANGED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
type OgImageMetadata$1 = string | {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
};
|
|
5
|
+
type OgMetadata$1 = {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
image?: OgImageMetadata$1;
|
|
9
|
+
};
|
|
10
|
+
type PageStatus$1 = "published" | "draft";
|
|
11
|
+
type PageMetadata$1 = {
|
|
12
|
+
openGraph?: OgMetadata$1;
|
|
13
|
+
robots?: {
|
|
14
|
+
index?: boolean;
|
|
15
|
+
follow?: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type PageFrontmatter$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
status: PageStatus$1;
|
|
23
|
+
metadata: PageMetadata$1;
|
|
24
|
+
};
|
|
25
|
+
type PageData$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
|
|
26
|
+
fileID: string;
|
|
27
|
+
group: string;
|
|
28
|
+
path: string;
|
|
29
|
+
frontmatter: PageFrontmatter$1<TCustom>;
|
|
30
|
+
body: string;
|
|
31
|
+
};
|
|
32
|
+
type NavigationPageNode = {
|
|
33
|
+
id: string;
|
|
34
|
+
type: "page";
|
|
35
|
+
label: string;
|
|
36
|
+
href: string;
|
|
37
|
+
page: Omit<PageData$1, "body">;
|
|
38
|
+
children?: NavigationNode[];
|
|
39
|
+
};
|
|
40
|
+
type NavigationGroupNode = {
|
|
41
|
+
id: string;
|
|
42
|
+
type: "group";
|
|
43
|
+
label: string;
|
|
44
|
+
groupKey: string;
|
|
45
|
+
route: string;
|
|
46
|
+
presentation: "page" | "folder";
|
|
47
|
+
href?: string;
|
|
48
|
+
children: NavigationNode[];
|
|
49
|
+
};
|
|
50
|
+
type NavigationContainerNode = {
|
|
51
|
+
id: string;
|
|
52
|
+
type: "section" | "folder";
|
|
53
|
+
label: string;
|
|
54
|
+
children: NavigationNode[];
|
|
55
|
+
};
|
|
56
|
+
type NavigationLinkNode = {
|
|
57
|
+
id: string;
|
|
58
|
+
type: "link";
|
|
59
|
+
label: string;
|
|
60
|
+
href: string;
|
|
61
|
+
};
|
|
62
|
+
type NavigationViewNode = {
|
|
63
|
+
id: string;
|
|
64
|
+
type: "view";
|
|
65
|
+
label?: string;
|
|
66
|
+
viewId?: string;
|
|
67
|
+
items: NavigationNode[];
|
|
68
|
+
};
|
|
69
|
+
type NavigationSwitchViewNode = {
|
|
70
|
+
id: string;
|
|
71
|
+
type: "switch-view";
|
|
72
|
+
label: string;
|
|
73
|
+
target: string | {
|
|
74
|
+
view: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
type NavigationNode = NavigationPageNode | NavigationGroupNode | NavigationContainerNode | NavigationLinkNode | NavigationViewNode | NavigationSwitchViewNode;
|
|
78
|
+
type ResolvedNavigation = {
|
|
79
|
+
rootGroup: string;
|
|
80
|
+
items: NavigationNode[];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
type SiteData = {
|
|
84
|
+
name: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
origin?: string;
|
|
87
|
+
metadata?: IndexMetadata;
|
|
88
|
+
};
|
|
89
|
+
type OgImageMetadata = string | {
|
|
90
|
+
src: string;
|
|
91
|
+
alt?: string;
|
|
92
|
+
};
|
|
93
|
+
type OgMetadata = {
|
|
94
|
+
title?: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
image?: OgImageMetadata;
|
|
97
|
+
};
|
|
98
|
+
type IndexMetadata = {
|
|
99
|
+
openGraph?: OgMetadata & {
|
|
100
|
+
scope?: "page" | "subtree";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
type PageStatus = "published" | "draft";
|
|
104
|
+
type PageMetadata = {
|
|
105
|
+
openGraph?: OgMetadata;
|
|
106
|
+
robots?: {
|
|
107
|
+
index?: boolean;
|
|
108
|
+
follow?: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
type PageFrontmatter<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
|
|
112
|
+
title: string;
|
|
113
|
+
description: string;
|
|
114
|
+
slug: string;
|
|
115
|
+
status: PageStatus;
|
|
116
|
+
metadata: PageMetadata;
|
|
117
|
+
};
|
|
118
|
+
type PageData<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
|
|
119
|
+
fileID: string;
|
|
120
|
+
group: string;
|
|
121
|
+
path: string;
|
|
122
|
+
frontmatter: PageFrontmatter<TCustom>;
|
|
123
|
+
body: string;
|
|
124
|
+
};
|
|
125
|
+
type RouteRecord = {
|
|
126
|
+
fileID: string;
|
|
127
|
+
slug: string;
|
|
128
|
+
path: string;
|
|
129
|
+
group: string;
|
|
130
|
+
};
|
|
131
|
+
type ResolvedAttribution = {
|
|
132
|
+
enabled: false;
|
|
133
|
+
} | {
|
|
134
|
+
enabled: true;
|
|
135
|
+
variant: "publish-dev";
|
|
136
|
+
label?: string;
|
|
137
|
+
hrefLabel?: string;
|
|
138
|
+
href: string;
|
|
139
|
+
};
|
|
140
|
+
type GroupManifest = {
|
|
141
|
+
key: string;
|
|
142
|
+
title: string;
|
|
143
|
+
path: string;
|
|
144
|
+
origin?: string;
|
|
145
|
+
ancestry?: string[];
|
|
146
|
+
metadata?: IndexMetadata;
|
|
147
|
+
meta?: Record<string, unknown>;
|
|
148
|
+
navigation: ResolvedNavigation;
|
|
149
|
+
pages: PageData[];
|
|
150
|
+
};
|
|
151
|
+
type ManifestLike = {
|
|
152
|
+
site: SiteData;
|
|
153
|
+
groups: Record<string, GroupManifest>;
|
|
154
|
+
routes: RouteRecord[];
|
|
155
|
+
pages: PageData[];
|
|
156
|
+
attribution?: Record<string, ResolvedAttribution>;
|
|
157
|
+
contentHash: string;
|
|
158
|
+
};
|
|
159
|
+
type LayoutProps = {
|
|
160
|
+
children: React.ReactNode;
|
|
161
|
+
site: SiteData;
|
|
162
|
+
navigation: ResolvedNavigation;
|
|
163
|
+
node: NavigationNode;
|
|
164
|
+
currentPath: string;
|
|
165
|
+
group: string;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export type { LayoutProps as L, ManifestLike as M };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type SiteData = {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
origin?: string;
|
|
5
|
+
metadata?: IndexMetadata;
|
|
6
|
+
};
|
|
7
|
+
type OgImageMetadata = string | {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
};
|
|
11
|
+
type OgMetadata = {
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
image?: OgImageMetadata;
|
|
15
|
+
};
|
|
16
|
+
type IndexMetadata = {
|
|
17
|
+
openGraph?: OgMetadata & {
|
|
18
|
+
scope?: "page" | "subtree";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type { SiteData as S };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MDXComponents as MDXComponents$1 } from 'mdx/types.js';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type MDXComponents = MDXComponents$1;
|
|
5
|
+
type MdxErrorBoundaryProps = {
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
pageId?: string;
|
|
8
|
+
slug?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type { MdxErrorBoundaryProps as M, MDXComponents as a };
|