@publish.os/nextjs 0.0.1-alpha.8 → 0.0.1-alpha.90
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/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +7 -3
- package/compiler-assets/nextjs/defaults/group/page.tsx +35 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +22 -11
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +1 -4
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
- package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
- package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
- package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
- package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +16 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +11 -43
- package/compiler-assets/nextjs/shims/proxy.ts +21 -9
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
- package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +34 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +100 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +12 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-2JAYBSKF.js +83 -0
- package/dist/button-CtzUJB8u.d.ts +11 -0
- package/dist/{button-CFdx-ohV.d.ts → button-c3WGnxIj.d.ts} +3 -3
- package/dist/chunk-535TM4A5.js +1455 -0
- package/dist/chunk-726GV2NF.js +2344 -0
- package/dist/chunk-7OGTPSKI.js +156 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-B2V22WRT.js +297 -0
- package/dist/chunk-DLDFHU7Y.js +191 -0
- package/dist/chunk-DWA3ZRGW.js +142 -0
- package/dist/chunk-GGKFQ3MA.js +621 -0
- package/dist/chunk-H6XILMZX.js +6154 -0
- package/dist/chunk-NECL5IBJ.js +318 -0
- package/dist/chunk-SVYGXXYR.js +36 -0
- package/dist/chunk-UF6ATARM.js +1100 -0
- package/dist/chunk-VO2I7MTM.js +56 -0
- package/dist/chunk-WDY4IK6Z.js +128 -0
- package/dist/chunk-WKTEO6RS.js +586 -0
- package/dist/chunk-YLTOLYWM.js +92 -0
- package/dist/compiler.d.ts +41 -7
- package/dist/compiler.js +48 -13143
- package/dist/compose-NN23UJGC.js +13 -0
- package/dist/config/createNextConfig.js +13 -0
- package/dist/dev-operation-TZDVJCN7.js +1055 -0
- package/dist/framework-selection-X4U6Y6QC.js +10 -0
- package/dist/ide-support-ZNW7ODFY.js +15 -0
- package/dist/index.d.ts +15 -3
- package/dist/kernel/components/blocks/AgentActions.js +71 -61
- package/dist/kernel/components/blocks/design-system-preview.d.ts +1 -1
- package/dist/kernel/components/blocks/design-system-preview.js +32 -13
- package/dist/kernel/components/blocks/link-playground.js +2 -2
- package/dist/kernel/components/blocks/logo-block.js +2 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +20 -5
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +401 -60
- package/dist/kernel/components/blocks/navigation-progress-playground.js +4 -4
- package/dist/kernel/components/blocks/navigation-progress.js +4 -1
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +11 -23
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +5 -4
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +553 -426
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +11 -9
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +18 -11
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +48 -2
- package/dist/kernel/components/blocks/toc.js +3 -3
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +66 -35
- package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
- package/dist/kernel/components/mdx/components/code-block.js +106 -5
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
- package/dist/kernel/components/mdx/components/copy-code-button.js +60 -0
- package/dist/kernel/components/mdx/components/figure-caption.js +1 -1
- package/dist/kernel/components/mdx/components/figure.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +1 -1
- package/dist/kernel/components/mdx/components/image.js +77 -56
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +3 -2
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +1 -1
- package/dist/kernel/components/mdx/components/paragraph.js +1 -4
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.js +2 -2
- package/dist/kernel/components/mdx/components/video.js +1 -1
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +12 -8
- package/dist/kernel/components/mdx/mdx.js +115 -39
- package/dist/kernel/components/mdx/rehype-heading-ids.js +1 -1
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +6 -23
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +6 -4
- package/dist/kernel/components/ui/button-group.d.ts +1 -1
- package/dist/kernel/components/ui/button-group.js +5 -4
- package/dist/kernel/components/ui/button.d.ts +2 -2
- package/dist/kernel/components/ui/button.js +6 -6
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +5 -1
- package/dist/kernel/components/ui/input.d.ts +4 -4
- package/dist/kernel/components/ui/kbd.d.ts +1 -1
- package/dist/kernel/components/ui/kbd.js +9 -16
- package/dist/kernel/components/ui/link.d.ts +5 -3
- package/dist/kernel/components/ui/link.js +10 -9
- package/dist/kernel/components/ui/menu.js +5 -5
- package/dist/kernel/components/ui/mod-key.d.ts +10 -0
- package/dist/kernel/components/ui/mod-key.js +36 -0
- package/dist/kernel/components/ui/navigation-menu.js +2 -2
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +8 -8
- package/dist/kernel/components/ui/scroll-area.js +4 -4
- package/dist/kernel/components/ui/select.js +7 -10
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/theme-toggle.d.ts +3 -3
- package/dist/kernel/components/ui/theme-toggle.js +4 -9
- package/dist/kernel/defaults.registry.d.ts +9 -9
- package/dist/kernel/defaults.registry.js +9 -9
- package/dist/kernel/routes/agent/markdown.d.ts +0 -1
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.js +13 -9
- package/dist/kernel/routes/metadata/llms.d.ts +2 -1
- package/dist/kernel/routes/metadata/llms.js +4 -4
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +6 -3
- package/dist/kernel/routes/metadata/sitemap.js +48 -20
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +20 -12
- package/dist/kernel/routes/pages/leaf.d.ts +2 -2
- package/dist/kernel/routes/pages/leaf.js +20 -12
- package/dist/kernel/routes/pages/root.d.ts +2 -2
- package/dist/kernel/routes/pages/root.js +18 -12
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +47 -22
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/{types-CIwwieNw.d.ts → types-BzkZty3r.d.ts} +23 -3
- package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
- package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
- package/dist/types.d.ts +14 -6
- package/dist/validate-local-source-XRL2Y7XE.js +14 -0
- package/dist/validate-publish-os-source-DAPZ4QGE.js +12 -0
- package/init/seed/minimal/.gitignore +1 -0
- 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
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +6 -10
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +1 -1
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +3 -7
- package/init/seed/minimal/publish.os/theme.css +52 -24
- package/init/seed/minimal/publish.os/tsconfig.json +3 -0
- package/init/seed/minimal/seed.json +4 -1
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
- package/init/seed/scratch/seed.json +5 -0
- package/package.json +12 -26
- package/release/app/phosphor/package.json +3 -3
- package/release/app/phosphor/pnpm-lock.yaml.template +523 -360
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +1 -1
- package/release/compiler/pnpm-lock.yaml.template +439 -286
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +7 -36
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
- package/dist/icons.d.ts +0 -1
- package/dist/icons.js +0 -2
- package/dist/kernel/components/mdx/components/pre.d.ts +0 -6
- package/dist/kernel/components/mdx/components/pre.js +0 -18
- package/dist/kernel/components/ui/meta-key.d.ts +0 -17
- package/dist/kernel/components/ui/meta-key.js +0 -9
- package/dist/kernel/framework-icons.d.ts +0 -1
- package/dist/kernel/framework-icons.js +0 -39
- package/dist/link-CYaCRDb6.d.ts +0 -35
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +0 -58
- package/dist/types-sM2g9nW0.d.ts +0 -12
- package/release/app/lucide/package.json +0 -30
- package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
- package/release/app/lucide/pnpm-workspace.yaml +0 -11
- package/release/app/tabler/package.json +0 -30
- package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
- package/release/app/tabler/pnpm-workspace.yaml +0 -11
|
@@ -3,8 +3,8 @@ import { tags } from "@publish.os/nextjs/cache/tags";
|
|
|
3
3
|
import { cacheLife, cacheTag } from "next/cache";
|
|
4
4
|
|
|
5
5
|
// src/lib/runtime/metadata/canonical-url.ts
|
|
6
|
-
function canonicalUrl(manifest, path) {
|
|
7
|
-
let origin = manifest.site.
|
|
6
|
+
function canonicalUrl(manifest, path, group) {
|
|
7
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
8
8
|
if (!origin) return path;
|
|
9
9
|
try {
|
|
10
10
|
return new URL(path, `${origin}/`).toString();
|
|
@@ -53,9 +53,9 @@ async function llmsTxt(manifest, options = {}) {
|
|
|
53
53
|
);
|
|
54
54
|
let pages = manifest.pages.filter((page) => page.status === "published").filter((page) => pageInScope(page, options)), lines = (options.limit ? pages.slice(0, options.limit) : pages).map((page) => {
|
|
55
55
|
let description = options.includeDescriptions && page.description ? ` - ${page.description}` : "";
|
|
56
|
-
return `- [${page.title}](${canonicalUrl(manifest, page.path)})${description}`;
|
|
56
|
+
return `- [${page.title}](${canonicalUrl(manifest, page.path, page.group)})${description}`;
|
|
57
57
|
}), linkLines = (options.links ?? []).map(
|
|
58
|
-
(link) => `- [${link.title}](${canonicalUrl(manifest, link.path)})`
|
|
58
|
+
(link) => `- [${link.title}](${canonicalUrl(manifest, link.path, link.group)})`
|
|
59
59
|
), linkSection = linkLines.length ? `
|
|
60
60
|
|
|
61
61
|
## Group LLM indexes
|
|
@@ -3,8 +3,8 @@ import { tags } from "@publish.os/nextjs/cache/tags";
|
|
|
3
3
|
import { cacheLife, cacheTag } from "next/cache";
|
|
4
4
|
|
|
5
5
|
// src/lib/runtime/metadata/canonical-url.ts
|
|
6
|
-
function canonicalUrl(manifest, path) {
|
|
7
|
-
let origin = manifest.site.
|
|
6
|
+
function canonicalUrl(manifest, path, group) {
|
|
7
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
8
8
|
if (!origin) return path;
|
|
9
9
|
try {
|
|
10
10
|
return new URL(path, `${origin}/`).toString();
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { MarkdownRouteArtifactManifest } from '../agent/markdown.js';
|
|
2
|
-
import { M as ManifestLike } from '../../../types-
|
|
2
|
+
import { M as ManifestLike } from '../../../types-BzkZty3r.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type SitemapRouteOptions = {
|
|
5
|
+
group?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function createSitemapXmlRoute(manifest: ManifestLike, options?: SitemapRouteOptions): () => Promise<Response>;
|
|
5
8
|
declare function createSitemapMarkdownRoute(manifest: ManifestLike, artifactManifest: MarkdownRouteArtifactManifest): () => Promise<Response>;
|
|
6
9
|
|
|
7
|
-
export { createSitemapMarkdownRoute, createSitemapXmlRoute };
|
|
10
|
+
export { type SitemapRouteOptions, createSitemapMarkdownRoute, createSitemapXmlRoute };
|
|
@@ -3,8 +3,8 @@ import { tags } from "@publish.os/nextjs/cache/tags";
|
|
|
3
3
|
import { cacheLife, cacheTag } from "next/cache";
|
|
4
4
|
|
|
5
5
|
// src/lib/runtime/metadata/canonical-url.ts
|
|
6
|
-
function canonicalUrl(manifest, path) {
|
|
7
|
-
let origin = manifest.site.
|
|
6
|
+
function canonicalUrl(manifest, path, group) {
|
|
7
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
8
8
|
if (!origin) return path;
|
|
9
9
|
try {
|
|
10
10
|
return new URL(path, `${origin}/`).toString();
|
|
@@ -34,53 +34,81 @@ function createCachedTextResponse(options) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/route-metadata-sitemap.ts
|
|
37
|
+
var ROOT_CONTENT_GROUP_KEY = "__root";
|
|
37
38
|
function xmlEscape(value) {
|
|
38
39
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
function groupOrigin(manifest, groupKey) {
|
|
42
|
+
return manifest.groups[groupKey]?.origin ?? manifest.site.origin;
|
|
43
|
+
}
|
|
44
|
+
function pathInScope(path, basePath) {
|
|
45
|
+
return basePath === "/" || path === basePath || path.startsWith(`${basePath}/`);
|
|
46
|
+
}
|
|
47
|
+
function rootMountedGroup(manifest, origin) {
|
|
48
|
+
return Object.values(manifest.groups).find(
|
|
49
|
+
(group) => group.key !== ROOT_CONTENT_GROUP_KEY && group.path === "/" && groupOrigin(manifest, group.key) === origin
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
async function sitemapXml(manifest, options) {
|
|
41
53
|
"use cache";
|
|
42
54
|
cacheLife("page"), cacheTag(tags.site(), tags.sitemap(), tags.manifest(manifest.contentHash));
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
let targetGroup = options.group ? manifest.groups[options.group] : void 0, basePath = targetGroup?.path ?? "/", origin = targetGroup ? groupOrigin(manifest, targetGroup.key) : manifest.site.origin, homeGroup = targetGroup ?? rootMountedGroup(manifest, origin), groups = Object.values(manifest.groups).filter(
|
|
56
|
+
(group) => groupOrigin(manifest, group.key) === origin && pathInScope(group.path, basePath)
|
|
57
|
+
), urls = [
|
|
58
|
+
{
|
|
59
|
+
path: homeGroup?.path ?? "/",
|
|
60
|
+
group: homeGroup?.key
|
|
61
|
+
},
|
|
62
|
+
...groups.map((group) => ({ path: group.path, group: group.key })),
|
|
63
|
+
...manifest.pages.filter((page) => page.status === "published").filter((page) => groupOrigin(manifest, page.group) === origin).filter((page) => pathInScope(page.path, basePath)).map((page) => ({ path: page.path, group: page.group }))
|
|
47
64
|
];
|
|
48
65
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
49
66
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
50
|
-
${[...new
|
|
51
|
-
(
|
|
52
|
-
|
|
67
|
+
${[...new Map(
|
|
68
|
+
urls.map(({ path, group }) => {
|
|
69
|
+
let url = canonicalUrl(manifest, path, group);
|
|
70
|
+
return [url, url];
|
|
71
|
+
})
|
|
72
|
+
).values()].map((url) => ` <url><loc>${xmlEscape(url)}</loc></url>`).join(`
|
|
53
73
|
`)}
|
|
54
74
|
</urlset>
|
|
55
75
|
`;
|
|
56
76
|
}
|
|
57
|
-
function createSitemapXmlRoute(manifest) {
|
|
77
|
+
function createSitemapXmlRoute(manifest, options = {}) {
|
|
58
78
|
return async function() {
|
|
59
79
|
return createCachedTextResponse({
|
|
60
|
-
body: await sitemapXml(manifest),
|
|
80
|
+
body: await sitemapXml(manifest, options),
|
|
61
81
|
contentType: "application/xml; charset=utf-8"
|
|
62
82
|
});
|
|
63
83
|
};
|
|
64
84
|
}
|
|
65
85
|
async function sitemapMarkdown(manifest, artifactManifest) {
|
|
66
|
-
let groups = Object.values(manifest.groups).sort((a, b) => a.path.localeCompare(b.path)).map(
|
|
67
|
-
(group) => `- [${group.title}](${canonicalUrl(manifest, group.path)})`
|
|
68
|
-
), pages = manifest.pages.filter((page) => page.status === "published").sort((a, b) => a.path.localeCompare(b.path)).map((page) => {
|
|
69
|
-
let markdownPath = artifactManifest.byHtmlPath[page.path], markdown = markdownPath ? ` ([Markdown](${canonicalUrl(manifest, markdownPath)}))` : "";
|
|
70
|
-
return `- [${page.title}](${canonicalUrl(manifest, page.path)})${markdown}`;
|
|
86
|
+
let origin = manifest.site.origin, rootGroup = rootMountedGroup(manifest, origin), groups = Object.values(manifest.groups).filter((group) => group.key !== ROOT_CONTENT_GROUP_KEY).filter((group) => groupOrigin(manifest, group.key) === origin).sort((a, b) => a.path.localeCompare(b.path)).map(
|
|
87
|
+
(group) => `- [${group.title}](${canonicalUrl(manifest, group.path, group.key)})`
|
|
88
|
+
), pages = manifest.pages.filter((page) => page.status === "published").filter((page) => groupOrigin(manifest, page.group) === origin).sort((a, b) => a.path.localeCompare(b.path)).map((page) => {
|
|
89
|
+
let markdownPath = artifactManifest.byHtmlPath[page.path], markdown = markdownPath ? ` ([Markdown](${canonicalUrl(manifest, markdownPath, page.group)}))` : "";
|
|
90
|
+
return `- [${page.title}](${canonicalUrl(manifest, page.path, page.group)})${markdown}`;
|
|
71
91
|
});
|
|
72
92
|
return [
|
|
73
|
-
`# ${manifest.site.name} Sitemap`,
|
|
93
|
+
`# ${rootGroup?.title ?? manifest.site.name} Sitemap`,
|
|
74
94
|
"## Agent indexes",
|
|
75
95
|
`- [LLMS index](${canonicalUrl(manifest, "/llms.txt")})`,
|
|
76
96
|
`- [Full LLMS index](${canonicalUrl(manifest, "/llms-full.txt")})`,
|
|
77
97
|
`- [XML sitemap](${canonicalUrl(manifest, "/sitemap.xml")})`,
|
|
78
98
|
"## Sections",
|
|
79
99
|
groups.length ? groups.join(`
|
|
80
|
-
`) : `- [Home](${canonicalUrl(
|
|
100
|
+
`) : `- [${rootGroup?.title ?? "Home"}](${canonicalUrl(
|
|
101
|
+
manifest,
|
|
102
|
+
rootGroup?.path ?? "/",
|
|
103
|
+
rootGroup?.key
|
|
104
|
+
)})`,
|
|
81
105
|
"## Pages",
|
|
82
106
|
pages.length ? pages.join(`
|
|
83
|
-
`) : `- [Home](${canonicalUrl(
|
|
107
|
+
`) : `- [${rootGroup?.title ?? "Home"}](${canonicalUrl(
|
|
108
|
+
manifest,
|
|
109
|
+
rootGroup?.path ?? "/",
|
|
110
|
+
rootGroup?.key
|
|
111
|
+
)})`,
|
|
84
112
|
""
|
|
85
113
|
].join(`
|
|
86
114
|
|
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { Metadata } from 'next';
|
|
3
3
|
import { ReactElement } from 'react';
|
|
4
4
|
import { OgManifestLike } from '../metadata/og-image.js';
|
|
5
|
-
import { M as ManifestLike, I as IndexPageProps } from '../../../types-
|
|
5
|
+
import { M as ManifestLike, I as IndexPageProps } from '../../../types-BzkZty3r.js';
|
|
6
6
|
|
|
7
7
|
type IndexPageComponent = (props: IndexPageProps) => ReactElement | Promise<ReactElement>;
|
|
8
8
|
type GroupRouteConfig = {
|
|
@@ -20,6 +20,17 @@ var isDev = process.env.NODE_ENV !== "production", isDebugEnabled = process.env.
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
24
|
+
function canonicalUrl(manifest, path, group) {
|
|
25
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
26
|
+
if (!origin) return path;
|
|
27
|
+
try {
|
|
28
|
+
return new URL(path, `${origin}/`).toString();
|
|
29
|
+
} catch {
|
|
30
|
+
return path;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
// src/lib/runtime/metadata/agent-metadata.ts
|
|
24
35
|
function normalizePath(path) {
|
|
25
36
|
let prefixed = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -27,11 +38,13 @@ function normalizePath(path) {
|
|
|
27
38
|
}
|
|
28
39
|
function agentReadableAlternates({
|
|
29
40
|
canonicalPath,
|
|
41
|
+
group,
|
|
30
42
|
manifest,
|
|
31
43
|
markdownPath
|
|
32
44
|
}) {
|
|
45
|
+
let canonical = canonicalUrl(manifest, normalizePath(canonicalPath), group);
|
|
33
46
|
return {
|
|
34
|
-
...
|
|
47
|
+
...canonical.startsWith("http") ? { canonical } : {},
|
|
35
48
|
types: {
|
|
36
49
|
...markdownPath ? { "text/markdown": normalizePath(markdownPath) } : {},
|
|
37
50
|
"text/plain": "/llms.txt"
|
|
@@ -40,29 +53,22 @@ function agentReadableAlternates({
|
|
|
40
53
|
}
|
|
41
54
|
|
|
42
55
|
// src/lib/runtime/metadata/social-metadata.ts
|
|
43
|
-
function absoluteUrl({
|
|
44
|
-
path,
|
|
45
|
-
siteUrl
|
|
46
|
-
}) {
|
|
47
|
-
if (/^https?:\/\//i.test(path)) return path;
|
|
48
|
-
if (siteUrl)
|
|
49
|
-
return new URL(path, siteUrl).toString();
|
|
50
|
-
}
|
|
51
56
|
function createSocialMetadata({
|
|
52
57
|
canonicalPath,
|
|
53
58
|
description,
|
|
59
|
+
group,
|
|
54
60
|
manifest,
|
|
55
61
|
ogManifest,
|
|
56
62
|
title,
|
|
57
63
|
type = "website"
|
|
58
64
|
}) {
|
|
59
|
-
let key = ogManifest?.routes?.[canonicalPath],
|
|
65
|
+
let key = ogManifest?.routes?.[canonicalPath], entry = key ? ogManifest?.entries?.[key] : void 0, url = canonicalUrl(manifest, canonicalPath, group), hasOrigin = (group ? manifest.groups[group]?.origin : void 0) ?? manifest.site.origin, imageUrl = entry && (/^https?:\/\//i.test(entry.url) || hasOrigin) ? canonicalUrl(manifest, entry.url, group) : void 0;
|
|
60
66
|
return !entry || !imageUrl ? {
|
|
61
67
|
openGraph: {
|
|
62
68
|
description,
|
|
63
69
|
title,
|
|
64
70
|
type,
|
|
65
|
-
...url ? { url } : {}
|
|
71
|
+
...url.startsWith("http") ? { url } : {}
|
|
66
72
|
},
|
|
67
73
|
twitter: {
|
|
68
74
|
card: "summary",
|
|
@@ -83,7 +89,7 @@ function createSocialMetadata({
|
|
|
83
89
|
siteName: manifest.site.name,
|
|
84
90
|
title,
|
|
85
91
|
type,
|
|
86
|
-
...url ? { url } : {}
|
|
92
|
+
...url.startsWith("http") ? { url } : {}
|
|
87
93
|
},
|
|
88
94
|
twitter: {
|
|
89
95
|
card: "summary_large_image",
|
|
@@ -125,11 +131,13 @@ function createGroupMetadata({
|
|
|
125
131
|
description,
|
|
126
132
|
alternates: groupData ? agentReadableAlternates({
|
|
127
133
|
canonicalPath: groupData.path,
|
|
134
|
+
group,
|
|
128
135
|
manifest
|
|
129
136
|
}) : void 0,
|
|
130
137
|
...createSocialMetadata({
|
|
131
138
|
canonicalPath,
|
|
132
139
|
description,
|
|
140
|
+
group,
|
|
133
141
|
manifest,
|
|
134
142
|
ogManifest,
|
|
135
143
|
title
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Metadata } from 'next';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { PageProps, ManifestLike, ResolvedAttribution } from '../../../types.js';
|
|
4
|
+
import { OgManifestLike } from '../metadata/og-image.js';
|
|
5
|
+
import { a as PageProps, M as ManifestLike, R as ResolvedAttribution } from '../../../types-BzkZty3r.js';
|
|
6
6
|
|
|
7
7
|
type LeafComponent = (props: PageProps) => ReactElement | Promise<ReactElement>;
|
|
8
8
|
type PoweredByFooterComponent = (props: {
|
|
@@ -29,6 +29,17 @@ var isDev = process.env.NODE_ENV !== "production", isDebugEnabled = process.env.
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
33
|
+
function canonicalUrl(manifest, path, group) {
|
|
34
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
35
|
+
if (!origin) return path;
|
|
36
|
+
try {
|
|
37
|
+
return new URL(path, `${origin}/`).toString();
|
|
38
|
+
} catch {
|
|
39
|
+
return path;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
// src/lib/runtime/metadata/agent-metadata.ts
|
|
33
44
|
function normalizePath(path) {
|
|
34
45
|
let prefixed = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -40,11 +51,13 @@ function markdownPathForHtmlPath(path) {
|
|
|
40
51
|
}
|
|
41
52
|
function agentReadableAlternates({
|
|
42
53
|
canonicalPath,
|
|
54
|
+
group,
|
|
43
55
|
manifest,
|
|
44
56
|
markdownPath
|
|
45
57
|
}) {
|
|
58
|
+
let canonical = canonicalUrl(manifest, normalizePath(canonicalPath), group);
|
|
46
59
|
return {
|
|
47
|
-
...
|
|
60
|
+
...canonical.startsWith("http") ? { canonical } : {},
|
|
48
61
|
types: {
|
|
49
62
|
...markdownPath ? { "text/markdown": normalizePath(markdownPath) } : {},
|
|
50
63
|
"text/plain": "/llms.txt"
|
|
@@ -53,29 +66,22 @@ function agentReadableAlternates({
|
|
|
53
66
|
}
|
|
54
67
|
|
|
55
68
|
// src/lib/runtime/metadata/social-metadata.ts
|
|
56
|
-
function absoluteUrl({
|
|
57
|
-
path,
|
|
58
|
-
siteUrl
|
|
59
|
-
}) {
|
|
60
|
-
if (/^https?:\/\//i.test(path)) return path;
|
|
61
|
-
if (siteUrl)
|
|
62
|
-
return new URL(path, siteUrl).toString();
|
|
63
|
-
}
|
|
64
69
|
function createSocialMetadata({
|
|
65
70
|
canonicalPath,
|
|
66
71
|
description,
|
|
72
|
+
group,
|
|
67
73
|
manifest,
|
|
68
74
|
ogManifest,
|
|
69
75
|
title,
|
|
70
76
|
type = "website"
|
|
71
77
|
}) {
|
|
72
|
-
let key = ogManifest?.routes?.[canonicalPath],
|
|
78
|
+
let key = ogManifest?.routes?.[canonicalPath], entry = key ? ogManifest?.entries?.[key] : void 0, url = canonicalUrl(manifest, canonicalPath, group), hasOrigin = (group ? manifest.groups[group]?.origin : void 0) ?? manifest.site.origin, imageUrl = entry && (/^https?:\/\//i.test(entry.url) || hasOrigin) ? canonicalUrl(manifest, entry.url, group) : void 0;
|
|
73
79
|
return !entry || !imageUrl ? {
|
|
74
80
|
openGraph: {
|
|
75
81
|
description,
|
|
76
82
|
title,
|
|
77
83
|
type,
|
|
78
|
-
...url ? { url } : {}
|
|
84
|
+
...url.startsWith("http") ? { url } : {}
|
|
79
85
|
},
|
|
80
86
|
twitter: {
|
|
81
87
|
card: "summary",
|
|
@@ -96,7 +102,7 @@ function createSocialMetadata({
|
|
|
96
102
|
siteName: manifest.site.name,
|
|
97
103
|
title,
|
|
98
104
|
type,
|
|
99
|
-
...url ? { url } : {}
|
|
105
|
+
...url.startsWith("http") ? { url } : {}
|
|
100
106
|
},
|
|
101
107
|
twitter: {
|
|
102
108
|
card: "summary_large_image",
|
|
@@ -231,12 +237,14 @@ function createLeafMetadata({
|
|
|
231
237
|
description: resolved.page.description,
|
|
232
238
|
alternates: agentReadableAlternates({
|
|
233
239
|
canonicalPath: resolved.page.path,
|
|
240
|
+
group,
|
|
234
241
|
manifest,
|
|
235
242
|
markdownPath: markdownPathForHtmlPath(resolved.page.path)
|
|
236
243
|
}),
|
|
237
244
|
...createSocialMetadata({
|
|
238
245
|
canonicalPath: resolved.page.path,
|
|
239
246
|
description: resolved.page.description,
|
|
247
|
+
group,
|
|
240
248
|
manifest,
|
|
241
249
|
ogManifest,
|
|
242
250
|
title: resolved.page.title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Metadata } from 'next';
|
|
3
3
|
import { ReactElement } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { RootPageProps, ManifestLike } from '../../../types.js';
|
|
4
|
+
import { OgManifestLike } from '../metadata/og-image.js';
|
|
5
|
+
import { b as RootPageProps, M as ManifestLike } from '../../../types-BzkZty3r.js';
|
|
6
6
|
|
|
7
7
|
type RootPageComponent = (props: RootPageProps) => ReactElement | Promise<ReactElement>;
|
|
8
8
|
type RootRouteConfig = {
|
|
@@ -18,6 +18,17 @@ var isDev = process.env.NODE_ENV !== "production", isDebugEnabled = process.env.
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
22
|
+
function canonicalUrl(manifest, path, group) {
|
|
23
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
24
|
+
if (!origin) return path;
|
|
25
|
+
try {
|
|
26
|
+
return new URL(path, `${origin}/`).toString();
|
|
27
|
+
} catch {
|
|
28
|
+
return path;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
21
32
|
// src/lib/runtime/metadata/agent-metadata.ts
|
|
22
33
|
function normalizePath(path) {
|
|
23
34
|
let prefixed = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -25,11 +36,13 @@ function normalizePath(path) {
|
|
|
25
36
|
}
|
|
26
37
|
function agentReadableAlternates({
|
|
27
38
|
canonicalPath,
|
|
39
|
+
group,
|
|
28
40
|
manifest,
|
|
29
41
|
markdownPath
|
|
30
42
|
}) {
|
|
43
|
+
let canonical = canonicalUrl(manifest, normalizePath(canonicalPath), group);
|
|
31
44
|
return {
|
|
32
|
-
...
|
|
45
|
+
...canonical.startsWith("http") ? { canonical } : {},
|
|
33
46
|
types: {
|
|
34
47
|
...markdownPath ? { "text/markdown": normalizePath(markdownPath) } : {},
|
|
35
48
|
"text/plain": "/llms.txt"
|
|
@@ -38,29 +51,22 @@ function agentReadableAlternates({
|
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
// src/lib/runtime/metadata/social-metadata.ts
|
|
41
|
-
function absoluteUrl({
|
|
42
|
-
path,
|
|
43
|
-
siteUrl
|
|
44
|
-
}) {
|
|
45
|
-
if (/^https?:\/\//i.test(path)) return path;
|
|
46
|
-
if (siteUrl)
|
|
47
|
-
return new URL(path, siteUrl).toString();
|
|
48
|
-
}
|
|
49
54
|
function createSocialMetadata({
|
|
50
55
|
canonicalPath,
|
|
51
56
|
description,
|
|
57
|
+
group,
|
|
52
58
|
manifest,
|
|
53
59
|
ogManifest,
|
|
54
60
|
title,
|
|
55
61
|
type = "website"
|
|
56
62
|
}) {
|
|
57
|
-
let key = ogManifest?.routes?.[canonicalPath],
|
|
63
|
+
let key = ogManifest?.routes?.[canonicalPath], entry = key ? ogManifest?.entries?.[key] : void 0, url = canonicalUrl(manifest, canonicalPath, group), hasOrigin = (group ? manifest.groups[group]?.origin : void 0) ?? manifest.site.origin, imageUrl = entry && (/^https?:\/\//i.test(entry.url) || hasOrigin) ? canonicalUrl(manifest, entry.url, group) : void 0;
|
|
58
64
|
return !entry || !imageUrl ? {
|
|
59
65
|
openGraph: {
|
|
60
66
|
description,
|
|
61
67
|
title,
|
|
62
68
|
type,
|
|
63
|
-
...url ? { url } : {}
|
|
69
|
+
...url.startsWith("http") ? { url } : {}
|
|
64
70
|
},
|
|
65
71
|
twitter: {
|
|
66
72
|
card: "summary",
|
|
@@ -81,7 +87,7 @@ function createSocialMetadata({
|
|
|
81
87
|
siteName: manifest.site.name,
|
|
82
88
|
title,
|
|
83
89
|
type,
|
|
84
|
-
...url ? { url } : {}
|
|
90
|
+
...url.startsWith("http") ? { url } : {}
|
|
85
91
|
},
|
|
86
92
|
twitter: {
|
|
87
93
|
card: "summary_large_image",
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
2
|
+
function canonicalUrl(manifest, path, group) {
|
|
3
|
+
let origin = (group && manifest.groups[group]?.origin) ?? manifest.site.origin;
|
|
4
|
+
if (!origin) return path;
|
|
5
|
+
try {
|
|
6
|
+
return new URL(path, `${origin}/`).toString();
|
|
7
|
+
} catch {
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function navigationUrl(manifest, path, group) {
|
|
12
|
+
let origin = manifest.groups[group]?.origin ?? manifest.site.origin;
|
|
13
|
+
return !origin || origin === manifest.site.origin ? path : canonicalUrl(manifest, path, group);
|
|
14
|
+
}
|
|
15
|
+
|
|
1
16
|
// src/manifest-resolver.ts
|
|
2
17
|
function findNodeInTree(nodes, id) {
|
|
3
18
|
for (let node of nodes) {
|
|
@@ -12,12 +27,13 @@ function findNodeInTree(nodes, id) {
|
|
|
12
27
|
}
|
|
13
28
|
return null;
|
|
14
29
|
}
|
|
15
|
-
function pageNode(page) {
|
|
30
|
+
function pageNode(manifest, page) {
|
|
16
31
|
return {
|
|
17
32
|
type: "page",
|
|
18
33
|
fileID: page.fileID,
|
|
19
34
|
title: page.title,
|
|
20
35
|
path: page.path,
|
|
36
|
+
href: navigationUrl(manifest, page.path, page.group),
|
|
21
37
|
group: page.group,
|
|
22
38
|
description: page.description,
|
|
23
39
|
status: page.status,
|
|
@@ -28,12 +44,13 @@ function pageNode(page) {
|
|
|
28
44
|
meta: page.meta
|
|
29
45
|
};
|
|
30
46
|
}
|
|
31
|
-
function groupNode(group) {
|
|
47
|
+
function groupNode(manifest, group) {
|
|
32
48
|
return {
|
|
33
49
|
type: "section",
|
|
34
50
|
id: group.key,
|
|
35
51
|
title: group.title,
|
|
36
52
|
path: group.path,
|
|
53
|
+
href: navigationUrl(manifest, group.path, group.key),
|
|
37
54
|
group: group.key,
|
|
38
55
|
children: group.tree
|
|
39
56
|
};
|
|
@@ -43,9 +60,12 @@ function resolveLeaf(manifest, group, slug) {
|
|
|
43
60
|
if (!page) return null;
|
|
44
61
|
let groupData = manifest.groups[group];
|
|
45
62
|
return groupData ? {
|
|
46
|
-
site:
|
|
63
|
+
site: {
|
|
64
|
+
...manifest.site,
|
|
65
|
+
origin: groupData.origin ?? manifest.site.origin
|
|
66
|
+
},
|
|
47
67
|
tree: groupData.tree,
|
|
48
|
-
node: findNodeInTree(groupData.tree, page.fileID) ?? pageNode(page),
|
|
68
|
+
node: findNodeInTree(groupData.tree, page.fileID) ?? pageNode(manifest, page),
|
|
49
69
|
page,
|
|
50
70
|
currentPath: page.path,
|
|
51
71
|
group
|
|
@@ -54,9 +74,12 @@ function resolveLeaf(manifest, group, slug) {
|
|
|
54
74
|
function resolveGroup(manifest, group) {
|
|
55
75
|
let groupData = manifest.groups[group];
|
|
56
76
|
return groupData ? {
|
|
57
|
-
site:
|
|
77
|
+
site: {
|
|
78
|
+
...manifest.site,
|
|
79
|
+
origin: groupData.origin ?? manifest.site.origin
|
|
80
|
+
},
|
|
58
81
|
tree: groupData.tree,
|
|
59
|
-
node: groupNode(groupData),
|
|
82
|
+
node: groupNode(manifest, groupData),
|
|
60
83
|
currentPath: groupData.path,
|
|
61
84
|
group
|
|
62
85
|
} : null;
|
package/dist/search.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ type SearchOutput = {
|
|
|
47
47
|
status: SearchStatus;
|
|
48
48
|
total: number;
|
|
49
49
|
};
|
|
50
|
-
type SearchBlockVariant = "desktop" | "mobile";
|
|
51
50
|
type SearchBlockState = {
|
|
52
51
|
displayResults: SearchResult[];
|
|
53
52
|
isTyping: boolean;
|
|
@@ -71,8 +70,9 @@ type SearchBlockMeta = {
|
|
|
71
70
|
inputRef: RefObject<HTMLInputElement | null>;
|
|
72
71
|
listId: string;
|
|
73
72
|
listRef: RefObject<HTMLDivElement | null>;
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
popupId: string;
|
|
74
|
+
shortcut: string | false;
|
|
75
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
76
76
|
};
|
|
77
77
|
type SearchBlockContextValue = {
|
|
78
78
|
actions: SearchBlockActions;
|
|
@@ -89,9 +89,8 @@ type SearchProviderProps = {
|
|
|
89
89
|
limit?: number;
|
|
90
90
|
onOpenChange?: (open: boolean) => void;
|
|
91
91
|
open?: boolean;
|
|
92
|
-
shortcut?: string;
|
|
93
|
-
variant?: SearchBlockVariant;
|
|
92
|
+
shortcut?: string | false;
|
|
94
93
|
};
|
|
95
|
-
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut,
|
|
94
|
+
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps): react_jsx_runtime.JSX.Element;
|
|
96
95
|
|
|
97
|
-
export { type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type
|
|
96
|
+
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 };
|