@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.91
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/layout.tsx +1 -5
- package/compiler-assets/nextjs/defaults/group/page.tsx +31 -22
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +19 -10
- 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/shims/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +2 -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 +126 -60
- 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-5QMLXF7N.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-BdCScEKi.d.ts} +3 -3
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -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-EFO6AWXN.js +19 -0
- package/dist/{chunk-726GV2NF.js → chunk-F3AGNDF4.js} +100 -67
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-ORIUWJBQ.js} +8 -6
- package/dist/{chunk-H6XILMZX.js → chunk-OXOFRXEI.js} +1806 -831
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +90 -21
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +594 -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 +5 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-CVBJRAF6.js +16 -0
- package/dist/config/createNextConfig.js +17 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-OSHHWRWK.js} +121 -81
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +40 -1
- 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 +35 -6
- package/dist/kernel/components/blocks/AgentActions.js +383 -142
- package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
- package/dist/kernel/components/blocks/agent-actions.js +594 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -2
- package/dist/kernel/components/blocks/navbar.js +17 -17
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.js +1 -1
- package/dist/kernel/components/blocks/page-list.js +2 -2
- package/dist/kernel/components/blocks/search.d.ts +1 -1
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.js +1 -1
- package/dist/kernel/components/blocks/sidebar.js +7 -4
- package/dist/kernel/components/blocks/theme-toggle.d.ts +1 -1
- 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 +19 -1
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +1 -1
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +21 -16
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +3 -3
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +20 -10
- package/dist/kernel/components/mdx/mdx.js +231 -34
- 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.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -2
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +1 -1
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +56 -4
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- 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 +1 -1
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +8 -2
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.js +1 -1
- 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 +1 -1
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +1 -1
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +2 -15
- package/dist/kernel/defaults.registry.js +2 -17
- package/dist/kernel/routes/agent/markdown.d.ts +3 -0
- package/dist/kernel/routes/agent/markdown.js +219 -48
- 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 -1
- package/dist/kernel/routes/metadata/feed.js +109 -83
- package/dist/kernel/routes/metadata/llms.d.ts +11 -3
- package/dist/kernel/routes/metadata/llms.js +154 -57
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/sitemap.d.ts +22 -3
- package/dist/kernel/routes/metadata/sitemap.js +183 -43
- 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 +2 -2
- package/dist/kernel/routes/pages/group.js +1 -1
- package/dist/kernel/routes/pages/leaf.d.ts +30 -3
- package/dist/kernel/routes/pages/leaf.js +5 -4
- package/dist/kernel/routes/pages/root.d.ts +2 -2
- package/dist/kernel/routes/pages/root.js +1 -1
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.js +7 -9
- package/dist/theme-scope.js +1 -1
- package/dist/{types-BzkZty3r.d.ts → types-J2w_puPF.d.ts} +1 -20
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +1 -0
- 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-SV44DBQT.js +16 -0
- package/dist/validate-publish-os-source-NZJF3TB2.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 +82 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -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 +6 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +11 -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 +45 -20
- package/release/app/phosphor/package.json +3 -3
- package/release/app/phosphor/pnpm-lock.yaml.template +88 -75
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +118 -74
- 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/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
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useRef,
|
|
14
14
|
useState
|
|
15
15
|
} from "react";
|
|
16
|
-
import { jsx, jsxs } from "
|
|
16
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
17
17
|
var scrollAreaVariants = cva(
|
|
18
18
|
"relative overflow-hidden rounded-scrollarea text-foreground-1",
|
|
19
19
|
{
|
|
@@ -6,7 +6,7 @@ import { CaretDownIcon, CheckIcon } from "@phosphor-icons/react/ssr";
|
|
|
6
6
|
import { useThemeScope } from "@publish.os/nextjs/theme-scope";
|
|
7
7
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
|
-
import { jsx } from "
|
|
9
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
10
10
|
var selectTriggerVariants = cva(
|
|
11
11
|
[
|
|
12
12
|
"inline-flex w-full min-w-0 items-center justify-between gap-2 rounded-input border border-stroke-2 bg-surface-1 text-foreground-1 transition-colors",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/ui/separator.tsx
|
|
2
2
|
import { Separator as BaseSeparator } from "@base-ui/react/separator";
|
|
3
3
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
|
-
import { jsx } from "
|
|
4
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
5
5
|
function Separator({
|
|
6
6
|
className,
|
|
7
7
|
orientation = "horizontal",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/ui/tag.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { jsx } from "
|
|
4
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
5
5
|
var tagVariants = cva(
|
|
6
6
|
"inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-tag border px-2 py-0.5 text-xs font-medium leading-5 [&_svg]:shrink-0",
|
|
7
7
|
{
|
|
@@ -6,7 +6,7 @@ import { ElementType, ComponentPropsWithoutRef } from 'react';
|
|
|
6
6
|
declare const textVariants: (props?: ({
|
|
7
7
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null | undefined;
|
|
8
8
|
variant?: "body" | "label" | "overline" | "headline" | null | undefined;
|
|
9
|
-
weight?: "
|
|
9
|
+
weight?: "medium" | "default" | "bold" | "semibold" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
type TextProps<T extends ElementType = "p"> = {
|
|
12
12
|
as?: T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/ui/text.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { jsx } from "
|
|
4
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
5
5
|
var textVariants = cva(
|
|
6
6
|
"text-[var(--text-foreground,var(--foreground-1))]",
|
|
7
7
|
{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Toast as BaseToast } from "@base-ui/react/toast";
|
|
5
5
|
import { useThemeScope } from "@publish.os/nextjs/theme-scope";
|
|
6
6
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
7
|
-
import { jsx } from "
|
|
7
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
8
8
|
var createToastManager = BaseToast.createToastManager, useToastManager = BaseToast.useToastManager;
|
|
9
9
|
function ToastProvider(props) {
|
|
10
10
|
return /* @__PURE__ */ jsx(BaseToast.Provider, { ...props });
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
|
|
5
5
|
import { useThemeScope } from "@publish.os/nextjs/theme-scope";
|
|
6
6
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
7
|
-
import { jsx } from "
|
|
7
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
8
8
|
function TooltipProvider(props) {
|
|
9
9
|
return /* @__PURE__ */ jsx(BaseTooltip.Provider, { ...props });
|
|
10
10
|
}
|
|
@@ -36,8 +36,8 @@ declare const kernelDefaultsRegistry: {
|
|
|
36
36
|
readonly name: "AgentActions";
|
|
37
37
|
readonly status: "available";
|
|
38
38
|
readonly description: "Agent-readable page actions for opening Markdown in AI chats, copying Markdown, and linking to Markdown artifacts.";
|
|
39
|
-
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/
|
|
40
|
-
readonly projectPath: "publish.os/components/blocks/
|
|
39
|
+
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/agent-actions";
|
|
40
|
+
readonly projectPath: "publish.os/components/blocks/agent-actions.tsx";
|
|
41
41
|
readonly contract: "AgentActionsProps";
|
|
42
42
|
}, {
|
|
43
43
|
readonly category: "ui";
|
|
@@ -245,12 +245,6 @@ declare const kernelDefaultsRegistry: {
|
|
|
245
245
|
readonly description: "Route transition progress indicator backed by the Progress primitive.";
|
|
246
246
|
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/navigation-progress";
|
|
247
247
|
readonly projectPath: "publish.os/components/blocks/navigation-progress.tsx";
|
|
248
|
-
}, {
|
|
249
|
-
readonly category: "block";
|
|
250
|
-
readonly name: "LinkPlayground";
|
|
251
|
-
readonly status: "available";
|
|
252
|
-
readonly description: "Design-system playground for tuning UI and MDX link styling.";
|
|
253
|
-
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/link-playground";
|
|
254
248
|
}, {
|
|
255
249
|
readonly category: "block";
|
|
256
250
|
readonly name: "NavBreadcrumb";
|
|
@@ -287,13 +281,6 @@ declare const kernelDefaultsRegistry: {
|
|
|
287
281
|
readonly description: "Current token/color preview block. Will be replaced by DesignSystemPreview.";
|
|
288
282
|
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/color-palette";
|
|
289
283
|
readonly projectPath: "publish.os/components/blocks/color-palette.tsx";
|
|
290
|
-
}, {
|
|
291
|
-
readonly category: "block";
|
|
292
|
-
readonly name: "DesignSystemPreview";
|
|
293
|
-
readonly status: "available";
|
|
294
|
-
readonly description: "Tabbed preview for active tokens, typography, UI, MDX, and blocks.";
|
|
295
|
-
readonly kernelImport: "@publish.os/nextjs/kernel/components/blocks/design-system-preview";
|
|
296
|
-
readonly projectPath: "publish.os/components/blocks/design-system-preview.tsx";
|
|
297
284
|
}, {
|
|
298
285
|
readonly category: "mdx";
|
|
299
286
|
readonly name: "Heading";
|
|
@@ -24,8 +24,8 @@ var kernelDefaultsRegistry = {
|
|
|
24
24
|
name: "AgentActions",
|
|
25
25
|
status: "available",
|
|
26
26
|
description: "Agent-readable page actions for opening Markdown in AI chats, copying Markdown, and linking to Markdown artifacts.",
|
|
27
|
-
kernelImport: "@publish.os/nextjs/kernel/components/blocks/
|
|
28
|
-
projectPath: "publish.os/components/blocks/
|
|
27
|
+
kernelImport: "@publish.os/nextjs/kernel/components/blocks/agent-actions",
|
|
28
|
+
projectPath: "publish.os/components/blocks/agent-actions.tsx",
|
|
29
29
|
contract: "AgentActionsProps"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
@@ -262,13 +262,6 @@ var kernelDefaultsRegistry = {
|
|
|
262
262
|
kernelImport: "@publish.os/nextjs/kernel/components/blocks/navigation-progress",
|
|
263
263
|
projectPath: "publish.os/components/blocks/navigation-progress.tsx"
|
|
264
264
|
},
|
|
265
|
-
{
|
|
266
|
-
category: "block",
|
|
267
|
-
name: "LinkPlayground",
|
|
268
|
-
status: "available",
|
|
269
|
-
description: "Design-system playground for tuning UI and MDX link styling.",
|
|
270
|
-
kernelImport: "@publish.os/nextjs/kernel/components/blocks/link-playground"
|
|
271
|
-
},
|
|
272
265
|
{
|
|
273
266
|
category: "block",
|
|
274
267
|
name: "NavBreadcrumb",
|
|
@@ -310,14 +303,6 @@ var kernelDefaultsRegistry = {
|
|
|
310
303
|
kernelImport: "@publish.os/nextjs/kernel/components/blocks/color-palette",
|
|
311
304
|
projectPath: "publish.os/components/blocks/color-palette.tsx"
|
|
312
305
|
},
|
|
313
|
-
{
|
|
314
|
-
category: "block",
|
|
315
|
-
name: "DesignSystemPreview",
|
|
316
|
-
status: "available",
|
|
317
|
-
description: "Tabbed preview for active tokens, typography, UI, MDX, and blocks.",
|
|
318
|
-
kernelImport: "@publish.os/nextjs/kernel/components/blocks/design-system-preview",
|
|
319
|
-
projectPath: "publish.os/components/blocks/design-system-preview.tsx"
|
|
320
|
-
},
|
|
321
306
|
{
|
|
322
307
|
category: "mdx",
|
|
323
308
|
name: "Heading",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NotFoundScope } from '../not-found.js';
|
|
2
|
+
|
|
1
3
|
type MarkdownRouteArtifact = {
|
|
2
4
|
body: string;
|
|
3
5
|
bodyHash?: string;
|
|
@@ -37,6 +39,7 @@ type MarkdownRouteDiscoveryLinks = {
|
|
|
37
39
|
};
|
|
38
40
|
type MarkdownRouteHandlerOptions = {
|
|
39
41
|
discoveryLinks?: MarkdownRouteDiscoveryLinks;
|
|
42
|
+
notFoundScopes?: readonly NotFoundScope[];
|
|
40
43
|
};
|
|
41
44
|
type RouteContext = {
|
|
42
45
|
params?: Promise<{
|
|
@@ -34,12 +34,196 @@ function createCachedTextResponse(options) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
// src/route-not-found.ts
|
|
38
|
+
var MAX_PATH_LENGTH = 2048, UNSAFE_PATH_CHARACTERS = /[\p{Cc}\p{Cs}\u200b-\u200f\u2028-\u202f\u2060-\u206f\ufeff]/u, INTERNAL_PATHS = ["/__publishos", "/_next", "/_not-found", "/publishos"], DEFAULT_MARKDOWN = serializeNotFoundMarkdown({
|
|
39
|
+
recommendations: [],
|
|
40
|
+
indexes: []
|
|
41
|
+
});
|
|
42
|
+
function normalizePublicPath(pathname) {
|
|
43
|
+
let path = pathname.split(/[?#]/u, 1)[0];
|
|
44
|
+
if (!path?.startsWith("/") || path.startsWith("//") || path.length > MAX_PATH_LENGTH || UNSAFE_PATH_CHARACTERS.test(path))
|
|
45
|
+
return;
|
|
46
|
+
let segments = [];
|
|
47
|
+
for (let segment of path.split("/")) {
|
|
48
|
+
if (!segment) continue;
|
|
49
|
+
let decoded;
|
|
50
|
+
try {
|
|
51
|
+
decoded = decodeURIComponent(segment);
|
|
52
|
+
} catch {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (decoded === "." || decoded === ".." || /[/\\]/u.test(decoded) || /%[\da-f]{2}/iu.test(decoded) || UNSAFE_PATH_CHARACTERS.test(decoded))
|
|
56
|
+
return;
|
|
57
|
+
segments.push(decoded);
|
|
58
|
+
}
|
|
59
|
+
return `/${segments.join("/")}`;
|
|
60
|
+
}
|
|
61
|
+
function containsPath({ parent, path }) {
|
|
62
|
+
return parent === "/" || path === parent || path.startsWith(`${parent}/`);
|
|
63
|
+
}
|
|
64
|
+
function missingPagePath(pathname) {
|
|
65
|
+
let normalized = normalizePublicPath(pathname);
|
|
66
|
+
if (!normalized) return;
|
|
67
|
+
let path = normalized.endsWith(".md") ? normalized.slice(0, -3) || "/" : normalized;
|
|
68
|
+
return INTERNAL_PATHS.some((parent) => containsPath({ parent, path })) ? void 0 : path;
|
|
69
|
+
}
|
|
70
|
+
function resolveNotFoundScope({
|
|
71
|
+
scopes,
|
|
72
|
+
pathname
|
|
73
|
+
}) {
|
|
74
|
+
let path = missingPagePath(pathname);
|
|
75
|
+
if (!path) return;
|
|
76
|
+
let matched, matchedLength = -1;
|
|
77
|
+
for (let scope of scopes) {
|
|
78
|
+
let scopePath = normalizePublicPath(scope.path);
|
|
79
|
+
!scopePath || !containsPath({ parent: scopePath, path }) || (scopePath.length > matchedLength || scopePath.length === matchedLength && scope.group && !matched?.group) && (matched = scope, matchedLength = scopePath.length);
|
|
80
|
+
}
|
|
81
|
+
return matched;
|
|
82
|
+
}
|
|
83
|
+
function trustedHostname(origin) {
|
|
84
|
+
if (origin)
|
|
85
|
+
try {
|
|
86
|
+
let url = new URL(origin);
|
|
87
|
+
return !["http:", "https:"].includes(url.protocol) || url.username || url.password ? void 0 : url.host.replace(/`/gu, "%60");
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function requestExplanation({
|
|
93
|
+
pathname,
|
|
94
|
+
origin
|
|
95
|
+
}) {
|
|
96
|
+
let path = pathname.split("/").map(encodeURIComponent).join("/"), hostname = trustedHostname(origin);
|
|
97
|
+
return `No page exists at \`${path}\`${hostname ? ` on ${hostname}` : ""}.`;
|
|
98
|
+
}
|
|
99
|
+
function indexKind(link) {
|
|
100
|
+
if (link.kind) return link.kind;
|
|
101
|
+
switch (link.title) {
|
|
102
|
+
case "Sitemap":
|
|
103
|
+
return "sitemap";
|
|
104
|
+
case "Markdown sitemap":
|
|
105
|
+
return "sitemap-md";
|
|
106
|
+
case "llms.txt":
|
|
107
|
+
case "LLMS index":
|
|
108
|
+
return "llms";
|
|
109
|
+
case "llms-full.txt":
|
|
110
|
+
return "llms-full";
|
|
111
|
+
default:
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function publicRecoveryHref(href) {
|
|
116
|
+
if (href.includes("\\") || UNSAFE_PATH_CHARACTERS.test(href))
|
|
117
|
+
return;
|
|
118
|
+
let relative = href.startsWith("/") && !href.startsWith("//");
|
|
119
|
+
try {
|
|
120
|
+
let url = new URL(
|
|
121
|
+
href,
|
|
122
|
+
relative ? "https://publishos.invalid" : void 0
|
|
123
|
+
);
|
|
124
|
+
return !["http:", "https:"].includes(url.protocol) || url.username || url.password ? void 0 : relative ? `${url.pathname}${url.search}${url.hash}` : url.href;
|
|
125
|
+
} catch {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function markdownText(value) {
|
|
130
|
+
return value.replace(/\s+/gu, " ").replace(/[\p{Cc}\p{Cs}]/gu, "").trim().replace(/[\\`*_[\]{}<>|~]/gu, "\\$&");
|
|
131
|
+
}
|
|
132
|
+
function markdownLink(link) {
|
|
133
|
+
let title = markdownText(link.title), href = publicRecoveryHref(link.href)?.replace(
|
|
134
|
+
/[()`<>]/gu,
|
|
135
|
+
(character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`
|
|
136
|
+
);
|
|
137
|
+
if (!title || !href) return;
|
|
138
|
+
let description = link.description ? markdownText(link.description) : void 0;
|
|
139
|
+
return `- [${title}](${href})${description ? `: ${description}` : ""}`;
|
|
140
|
+
}
|
|
141
|
+
function serializeNotFoundMarkdown({
|
|
142
|
+
recommendations,
|
|
143
|
+
indexes
|
|
144
|
+
}) {
|
|
145
|
+
let sections = [
|
|
146
|
+
{ title: "Recommendations", links: recommendations },
|
|
147
|
+
{ title: "For crawlers and agents", links: indexes }
|
|
148
|
+
], lines = [
|
|
149
|
+
"# 404 \u2014 Not Found",
|
|
150
|
+
"",
|
|
151
|
+
"This page does not exist. Please check the URL and try again.",
|
|
152
|
+
""
|
|
153
|
+
];
|
|
154
|
+
for (let section of sections) {
|
|
155
|
+
let links = section.links.map(markdownLink).filter((link) => link !== void 0);
|
|
156
|
+
links.length && lines.push(`## ${section.title}`, "", ...links, "");
|
|
157
|
+
}
|
|
158
|
+
return lines.join(`
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
function discoveryHeaders(scope) {
|
|
162
|
+
let headers = new Headers(), links = [];
|
|
163
|
+
for (let link of scope?.indexes ?? []) {
|
|
164
|
+
let kind = indexKind(link), href = /[\s<>"\\]/u.test(link.href) ? void 0 : publicRecoveryHref(link.href);
|
|
165
|
+
if (!(!kind || !href))
|
|
166
|
+
switch (kind) {
|
|
167
|
+
case "llms":
|
|
168
|
+
if (scope?.describedBy !== void 0) break;
|
|
169
|
+
links.push(`<${href}>; rel="describedby"; type="text/plain"`), headers.set("x-publishos-llms", href);
|
|
170
|
+
break;
|
|
171
|
+
case "llms-full":
|
|
172
|
+
links.push(
|
|
173
|
+
`<${href}>; rel="related"; type="text/plain"; title="Full content"`
|
|
174
|
+
);
|
|
175
|
+
break;
|
|
176
|
+
case "sitemap":
|
|
177
|
+
case "sitemap-md":
|
|
178
|
+
links.push(
|
|
179
|
+
`<${href}>; rel="sitemap"; type="${kind === "sitemap-md" ? "text/markdown" : "application/xml"}"`
|
|
180
|
+
), headers.set("x-publishos-sitemap", href);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (scope?.describedBy !== void 0) {
|
|
185
|
+
let href = /[\s<>"\\]/u.test(scope.describedBy) ? void 0 : publicRecoveryHref(scope.describedBy);
|
|
186
|
+
href && (links.push(`<${href}>; rel="describedby"; type="text/plain"`), headers.set("x-publishos-llms", href));
|
|
187
|
+
}
|
|
188
|
+
return links.length && headers.set("link", links.join(", ")), headers;
|
|
189
|
+
}
|
|
190
|
+
function createNotFoundTextResponse({
|
|
191
|
+
scope,
|
|
192
|
+
pathname,
|
|
193
|
+
method,
|
|
194
|
+
contentType = "text/markdown; charset=utf-8",
|
|
195
|
+
vary = !1
|
|
196
|
+
}) {
|
|
197
|
+
let path = pathname === void 0 ? void 0 : missingPagePath(pathname), resolvedScope = scope && (pathname === void 0 || resolveNotFoundScope({ scopes: [scope], pathname })) ? scope : void 0, body = resolvedScope?.markdown ?? DEFAULT_MARKDOWN;
|
|
198
|
+
if (resolvedScope && path) {
|
|
199
|
+
let explanation = requestExplanation({
|
|
200
|
+
pathname: path,
|
|
201
|
+
origin: scope?.origin
|
|
202
|
+
}), headingEnd = body.indexOf(`
|
|
203
|
+
|
|
204
|
+
`);
|
|
205
|
+
body = headingEnd === -1 ? `${body}
|
|
206
|
+
|
|
207
|
+
${explanation}
|
|
208
|
+
` : `${body.slice(0, headingEnd)}
|
|
209
|
+
|
|
210
|
+
${explanation}
|
|
211
|
+
|
|
212
|
+
${body.slice(headingEnd + 2)}`;
|
|
213
|
+
}
|
|
214
|
+
let headers = discoveryHeaders(resolvedScope);
|
|
215
|
+
return vary && headers.set("vary", "Accept, User-Agent"), createCachedTextResponse({
|
|
216
|
+
body,
|
|
217
|
+
cachePolicy: "short",
|
|
218
|
+
contentType,
|
|
219
|
+
headers,
|
|
220
|
+
method,
|
|
221
|
+
noindex: !0,
|
|
222
|
+
status: 404
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
37
226
|
// src/route-agent-markdown.ts
|
|
38
|
-
var DEFAULT_DISCOVERY_LINKS = {
|
|
39
|
-
home: "/",
|
|
40
|
-
llms: "/llms.txt",
|
|
41
|
-
sitemap: "/sitemap.md"
|
|
42
|
-
};
|
|
43
227
|
function debugMarkdownResponse(details) {
|
|
44
228
|
log.debug("[agent-route]", "md-response", details);
|
|
45
229
|
}
|
|
@@ -62,56 +246,28 @@ function markdownHeaders(artifact) {
|
|
|
62
246
|
contentType: "text/markdown; charset=utf-8"
|
|
63
247
|
};
|
|
64
248
|
}
|
|
65
|
-
function
|
|
66
|
-
return [
|
|
67
|
-
"# Not found",
|
|
68
|
-
"",
|
|
69
|
-
...[
|
|
70
|
-
discoveryLinks.home ? `> Home: ${discoveryLinks.home}` : void 0,
|
|
71
|
-
discoveryLinks.sitemap ? `> Sitemap: ${discoveryLinks.sitemap}` : void 0,
|
|
72
|
-
discoveryLinks.llms ? `> LLMS index: ${discoveryLinks.llms}` : void 0
|
|
73
|
-
].filter((line) => !!line),
|
|
74
|
-
"",
|
|
75
|
-
"The requested Markdown page was not found.",
|
|
76
|
-
""
|
|
77
|
-
].join(`
|
|
78
|
-
`);
|
|
79
|
-
}
|
|
80
|
-
function notFoundResponse(method, discoveryLinks, artifactPath, reason) {
|
|
249
|
+
function notFoundResponse(method, scopes, artifactPath, reason) {
|
|
81
250
|
return debugMarkdownResponse({
|
|
82
251
|
artifactPath,
|
|
83
252
|
method,
|
|
84
253
|
reason,
|
|
85
254
|
status: 404
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
method,
|
|
91
|
-
noindex: !0,
|
|
92
|
-
status: 404
|
|
255
|
+
}), createNotFoundTextResponse({
|
|
256
|
+
scope: artifactPath ? resolveNotFoundScope({ scopes, pathname: artifactPath }) : void 0,
|
|
257
|
+
pathname: artifactPath,
|
|
258
|
+
method
|
|
93
259
|
});
|
|
94
260
|
}
|
|
95
|
-
async function markdownResponse(artifacts,
|
|
261
|
+
async function markdownResponse(artifacts, scopes, method, context) {
|
|
96
262
|
let params = await Promise.resolve(context.params), artifactPath = normalizeArtifactPath(params?.path);
|
|
97
263
|
if (!artifactPath)
|
|
98
|
-
return notFoundResponse(method,
|
|
264
|
+
return notFoundResponse(method, scopes, void 0, "invalid-path");
|
|
99
265
|
let artifactKey = findArtifactKey(artifacts.index, artifactPath);
|
|
100
266
|
if (!artifactKey)
|
|
101
|
-
return notFoundResponse(
|
|
102
|
-
method,
|
|
103
|
-
discoveryLinks,
|
|
104
|
-
artifactPath,
|
|
105
|
-
"missing-index"
|
|
106
|
-
);
|
|
267
|
+
return notFoundResponse(method, scopes, artifactPath, "missing-index");
|
|
107
268
|
let artifact = await artifacts.loadArtifact(artifactKey);
|
|
108
269
|
if (!artifact)
|
|
109
|
-
return notFoundResponse(
|
|
110
|
-
method,
|
|
111
|
-
discoveryLinks,
|
|
112
|
-
artifactPath,
|
|
113
|
-
"missing-shard"
|
|
114
|
-
);
|
|
270
|
+
return notFoundResponse(method, scopes, artifactPath, "missing-shard");
|
|
115
271
|
let { contentType, headers } = markdownHeaders(artifact);
|
|
116
272
|
return debugMarkdownResponse({
|
|
117
273
|
artifactPath: artifact.markdownPath,
|
|
@@ -127,13 +283,28 @@ async function markdownResponse(artifacts, discoveryLinks, method, context) {
|
|
|
127
283
|
});
|
|
128
284
|
}
|
|
129
285
|
function createMarkdownRouteHandlers(artifacts, options = {}) {
|
|
130
|
-
let discoveryLinks = {
|
|
131
|
-
...
|
|
132
|
-
|
|
133
|
-
|
|
286
|
+
let links = options.discoveryLinks, recommendations = links?.home ? [{ title: "Go home", href: links.home }] : [], indexes = [
|
|
287
|
+
...links?.sitemap ? [
|
|
288
|
+
{
|
|
289
|
+
title: "Markdown sitemap",
|
|
290
|
+
href: links.sitemap,
|
|
291
|
+
kind: "sitemap-md"
|
|
292
|
+
}
|
|
293
|
+
] : [],
|
|
294
|
+
...links?.llms ? [{ title: "llms.txt", href: links.llms, kind: "llms" }] : []
|
|
295
|
+
], scopes = options.notFoundScopes ?? (links ? [
|
|
296
|
+
{
|
|
297
|
+
id: "root",
|
|
298
|
+
path: "/",
|
|
299
|
+
htmlPath: "",
|
|
300
|
+
recommendations,
|
|
301
|
+
indexes,
|
|
302
|
+
markdown: serializeNotFoundMarkdown({ recommendations, indexes })
|
|
303
|
+
}
|
|
304
|
+
] : []);
|
|
134
305
|
return {
|
|
135
|
-
GET: (_request, context) => markdownResponse(artifacts,
|
|
136
|
-
HEAD: (_request, context) => markdownResponse(artifacts,
|
|
306
|
+
GET: (_request, context) => markdownResponse(artifacts, scopes, "GET", context),
|
|
307
|
+
HEAD: (_request, context) => markdownResponse(artifacts, scopes, "HEAD", context),
|
|
137
308
|
generateStaticParams: () => Object.keys(artifacts.index).map((artifactPath) => ({
|
|
138
309
|
path: artifactPath.replace(/^\//, "").replace(/\.md$/, "").split("/")
|
|
139
310
|
}))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { M as ManifestLike, L as LayoutProps } from '../../../types-
|
|
3
|
+
import { M as ManifestLike, L as LayoutProps } from '../../../types-J2w_puPF.js';
|
|
4
4
|
|
|
5
5
|
type LayoutComponent = (props: LayoutProps) => ReactElement | Promise<ReactElement>;
|
|
6
6
|
type GroupLayoutConfig = {
|
|
@@ -21,8 +21,8 @@ var isDev = process.env.NODE_ENV !== "production", isDebugEnabled = process.env.
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
// src/route-layout-group.tsx
|
|
24
|
-
import { jsx } from "
|
|
25
|
-
var manifests = /* @__PURE__ */ new Map()
|
|
24
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
25
|
+
var manifests = /* @__PURE__ */ new Map();
|
|
26
26
|
async function CachedGroupLayoutData({
|
|
27
27
|
routeGroup,
|
|
28
28
|
layoutGroup
|
|
@@ -39,12 +39,10 @@ function createGroupLayout({
|
|
|
39
39
|
manifest,
|
|
40
40
|
layouts
|
|
41
41
|
}) {
|
|
42
|
-
return manifests.set(group, manifest),
|
|
43
|
-
log.debug("[render]", `${group}/layout`);
|
|
44
|
-
let chain = layoutChains.get(group);
|
|
45
|
-
chain?.length || notFound();
|
|
42
|
+
return manifests.set(group, manifest), async function({ children }) {
|
|
43
|
+
log.debug("[render]", `${group}/layout`), layouts.length || notFound();
|
|
46
44
|
let resolvedLayouts = await Promise.all(
|
|
47
|
-
|
|
45
|
+
layouts.map(async (item) => ({
|
|
48
46
|
item,
|
|
49
47
|
props: await CachedGroupLayoutData({
|
|
50
48
|
layoutGroup: item.group,
|