@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
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// src/components/block/toc/toc.tsx
|
|
2
|
+
import {
|
|
3
|
+
TocClientProvider,
|
|
4
|
+
TocDesktop,
|
|
5
|
+
TocLinksSlot,
|
|
6
|
+
TocMobile,
|
|
7
|
+
TocMobileHeader,
|
|
8
|
+
TocTitle
|
|
9
|
+
} from "@publish.os/nextjs/kernel/components/blocks/toc-client";
|
|
10
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
11
|
+
|
|
12
|
+
// src/components/block/toc/extract-headings.ts
|
|
13
|
+
import remarkGfm from "remark-gfm";
|
|
14
|
+
import remarkMdx from "remark-mdx";
|
|
15
|
+
import remarkParse from "remark-parse";
|
|
16
|
+
import { unified } from "unified";
|
|
17
|
+
|
|
18
|
+
// src/components/mdx/heading-string.ts
|
|
19
|
+
var SELF_CLOSING_TAG_RE = /<[^>]+\/>/g, PAIRED_TAG_RE = /<\/?\w[^>]*>/g, MDX_BOLD_RE = /\*\*(.*?)\*\*/g, MDX_ITALIC_RE = /\*(.*?)\*/g, MDX_UNDERLINE_BOLD_RE = /__(.*?)__/g, MDX_UNDERLINE_ITALIC_RE = /_(.*?)_/g, MDX_STRIKETHROUGH_RE = /~~(.*?)~~/g, MDX_INLINE_CODE_RE = /`(.*?)`/g, MDX_LINK_RE = /\[(.*?)\]\(.*?\)/g, NON_ALPHANUMERIC_RE = /[^a-z0-9]+/g, LEADING_TRAILING_HYPHEN_RE = /^-+|-+$/g, LEADING_DIGIT_RE = /^(\d)/;
|
|
20
|
+
function cleanHeadingString(input) {
|
|
21
|
+
return input.replace(SELF_CLOSING_TAG_RE, "").replace(PAIRED_TAG_RE, "").replace(MDX_BOLD_RE, "$1").replace(MDX_ITALIC_RE, "$1").replace(MDX_UNDERLINE_BOLD_RE, "$1").replace(MDX_UNDERLINE_ITALIC_RE, "$1").replace(MDX_STRIKETHROUGH_RE, "$1").replace(MDX_INLINE_CODE_RE, "$1").replace(MDX_LINK_RE, "$1").trim();
|
|
22
|
+
}
|
|
23
|
+
function headingStringToHTMLId(input) {
|
|
24
|
+
let text = cleanHeadingString(input);
|
|
25
|
+
return text ? text.toLowerCase().replace(NON_ALPHANUMERIC_RE, "-").replace(LEADING_TRAILING_HYPHEN_RE, "").replace(LEADING_DIGIT_RE, "id-$1") || "heading" : "empty-heading";
|
|
26
|
+
}
|
|
27
|
+
function createHeadingStringIdGenerator() {
|
|
28
|
+
let nextSuffix = /* @__PURE__ */ new Map(), usedIds = /* @__PURE__ */ new Set();
|
|
29
|
+
return (input) => {
|
|
30
|
+
let baseId = headingStringToHTMLId(input);
|
|
31
|
+
if (baseId === "empty-heading") return baseId;
|
|
32
|
+
let suffix = nextSuffix.get(baseId) ?? 0, id = suffix === 0 ? baseId : `${baseId}-${suffix}`;
|
|
33
|
+
for (; usedIds.has(id); )
|
|
34
|
+
suffix += 1, id = `${baseId}-${suffix}`;
|
|
35
|
+
return nextSuffix.set(baseId, suffix + 1), usedIds.add(id), id;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/components/block/toc/extract-headings.ts
|
|
40
|
+
var parser = unified().use(remarkParse).use(remarkMdx).use(remarkGfm);
|
|
41
|
+
function nodeText(node) {
|
|
42
|
+
return node.type === "text" || node.type === "inlineCode" ? typeof node.value == "string" ? node.value : "" : node.type === "image" || node.type === "imageReference" ? node.alt ?? "" : node.type === "break" || node.name === "br" ? " " : node.type === "mdxTextExpression" || node.type === "mdxFlowExpression" ? "" : (node.children ?? []).map(nodeText).join("");
|
|
43
|
+
}
|
|
44
|
+
function extractTocHeadings(content, levels) {
|
|
45
|
+
let [minDepth, maxDepth] = levels, headingId = createHeadingStringIdGenerator(), headings = [], tree = parser.parse(content);
|
|
46
|
+
function visit(node) {
|
|
47
|
+
if (node.type === "heading" && node.depth) {
|
|
48
|
+
let text = nodeText(node).trim();
|
|
49
|
+
if (text) {
|
|
50
|
+
let id = headingId(text);
|
|
51
|
+
node.depth >= minDepth && node.depth <= maxDepth && headings.push({ id, level: node.depth, text });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (let child of node.children ?? []) visit(child);
|
|
55
|
+
}
|
|
56
|
+
return visit(tree), headings;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/components/block/toc/toc.tsx
|
|
60
|
+
import { Fragment, jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
61
|
+
var DEFAULT_LEVELS = [2, 3];
|
|
62
|
+
function TocRoot({
|
|
63
|
+
className,
|
|
64
|
+
content = "",
|
|
65
|
+
desktopClassName,
|
|
66
|
+
desktopListClassName,
|
|
67
|
+
levels = DEFAULT_LEVELS,
|
|
68
|
+
listClassName,
|
|
69
|
+
mobileClassName,
|
|
70
|
+
mobileQuery = "(max-width: 1279px)",
|
|
71
|
+
readingOffset,
|
|
72
|
+
title = "On this page",
|
|
73
|
+
children
|
|
74
|
+
}) {
|
|
75
|
+
let headings = extractTocHeadings(content, levels);
|
|
76
|
+
return headings.length <= 1 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
TocClientProvider,
|
|
79
|
+
{
|
|
80
|
+
className: cn("text-xs leading-5", className),
|
|
81
|
+
desktopClassName: cn("hidden xl:block", desktopClassName),
|
|
82
|
+
desktopListClassName,
|
|
83
|
+
headings,
|
|
84
|
+
levels,
|
|
85
|
+
listClassName,
|
|
86
|
+
mobileClassName: cn("xl:hidden", mobileClassName),
|
|
87
|
+
mobileQuery,
|
|
88
|
+
readingOffset,
|
|
89
|
+
title,
|
|
90
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
+
/* @__PURE__ */ jsx(TocDesktop, {}),
|
|
92
|
+
/* @__PURE__ */ jsx(TocMobile, {})
|
|
93
|
+
] })
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsxs("noscript", { children: [
|
|
97
|
+
/* @__PURE__ */ jsx("style", { children: "[data-toc-mobile-trigger]{display:none}" }),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"nav",
|
|
100
|
+
{
|
|
101
|
+
"aria-label": title,
|
|
102
|
+
className: cn(
|
|
103
|
+
"xl:hidden max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain border-b border-stroke-3 px-6 py-4 text-xs leading-5",
|
|
104
|
+
mobileClassName
|
|
105
|
+
),
|
|
106
|
+
children: /* @__PURE__ */ jsx("ol", { className: cn("space-y-1", listClassName), children: headings.map((heading) => /* @__PURE__ */ jsx(
|
|
107
|
+
"li",
|
|
108
|
+
{
|
|
109
|
+
className: heading.level === levels[0] + 1 ? "ps-3" : void 0,
|
|
110
|
+
children: /* @__PURE__ */ jsx(
|
|
111
|
+
"a",
|
|
112
|
+
{
|
|
113
|
+
className: "block min-h-6 whitespace-normal break-words text-foreground-3 no-underline hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke",
|
|
114
|
+
href: `#${heading.id}`,
|
|
115
|
+
children: heading.text
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
},
|
|
119
|
+
heading.id
|
|
120
|
+
)) })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
var Toc = Object.assign(TocRoot, {
|
|
127
|
+
Desktop: TocDesktop,
|
|
128
|
+
Links: TocLinksSlot,
|
|
129
|
+
Mobile: TocMobile,
|
|
130
|
+
MobileHeader: TocMobileHeader,
|
|
131
|
+
Root: TocRoot,
|
|
132
|
+
Title: TocTitle
|
|
133
|
+
});
|
|
134
|
+
export {
|
|
135
|
+
Toc
|
|
136
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import 'class-variance-authority/types';
|
|
3
|
+
import 'class-variance-authority';
|
|
4
|
+
import 'react';
|
|
5
|
+
export { Button, ButtonProps, ButtonVariantProps, buttonVariantBase, buttonVariantConfig, buttonVariants } from '../../kernel/components/ui/button.js';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// src/components/ui/button.tsx
|
|
2
|
+
import { Button as BaseButton } from "@base-ui/react/button";
|
|
3
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
6
|
+
var buttonVariantBase = [
|
|
7
|
+
"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-button border font-medium leading-none",
|
|
8
|
+
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
|
|
9
|
+
"disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
10
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
|
|
11
|
+
].join(" "), buttonVariantConfig = {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
solid: "border-accent-1 bg-accent-1 text-accent-1-foreground hover:not-data-disabled:border-accent-1-hover hover:not-data-disabled:bg-accent-1-hover active:not-data-disabled:border-accent-1-active active:not-data-disabled:bg-accent-1-active data-[state=path-active]:border-accent-1-hover data-[state=path-active]:bg-accent-1-hover",
|
|
15
|
+
soft: "border-0 bg-accent-2 text-accent-text-foreground hover:not-data-disabled:not-active:not-data-[state=path-active]:bg-accent-2-hover active:not-data-disabled:bg-accent-2-active data-[state=path-active]:bg-accent-2-active",
|
|
16
|
+
outline: "border-stroke-2 bg-transparent text-foreground-1 hover:not-data-disabled:bg-surface-hover active:not-data-disabled:bg-surface-active data-[state=path-active]:border-accent-2-stroke data-[state=path-active]:bg-accent-2-hover data-[state=path-active]:text-accent-1",
|
|
17
|
+
ghost: "border-transparent bg-transparent text-foreground-2 hover:not-data-disabled:not-active:not-data-[state=path-active]:bg-surface-hover hover:not-data-disabled:text-foreground-1 active:not-data-disabled:bg-surface-active active:not-data-disabled:text-foreground-1 data-[state=path-active]:bg-surface-active data-[state=path-active]:text-foreground-1"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
xs: "h-7 gap-1.5 px-2 text-xs leading-none",
|
|
21
|
+
sm: "h-8 px-3 text-sm leading-none",
|
|
22
|
+
md: "h-10 px-4 text-sm leading-none",
|
|
23
|
+
lg: "h-11 px-5 text-base leading-none",
|
|
24
|
+
xl: "h-12 px-6 text-base leading-none"
|
|
25
|
+
},
|
|
26
|
+
iconOnly: {
|
|
27
|
+
false: "",
|
|
28
|
+
true: "gap-0 px-0"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [
|
|
32
|
+
{ className: "size-7 p-0", iconOnly: !0, size: "xs" },
|
|
33
|
+
{ className: "size-8 p-0", iconOnly: !0, size: "sm" },
|
|
34
|
+
{ className: "size-10 p-0", iconOnly: !0, size: "md" },
|
|
35
|
+
{ className: "size-11 p-0", iconOnly: !0, size: "lg" },
|
|
36
|
+
{ className: "size-12 p-0", iconOnly: !0, size: "xl" }
|
|
37
|
+
],
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
iconOnly: !1,
|
|
40
|
+
size: "md",
|
|
41
|
+
variant: "solid"
|
|
42
|
+
}
|
|
43
|
+
}, buttonVariants = cva(buttonVariantBase, {
|
|
44
|
+
...buttonVariantConfig,
|
|
45
|
+
compoundVariants: buttonVariantConfig.compoundVariants.map((variant) => ({
|
|
46
|
+
...variant
|
|
47
|
+
}))
|
|
48
|
+
});
|
|
49
|
+
function Spinner() {
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: "size-4 animate-spin rounded-full border-2 border-current border-r-transparent"
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function Button({
|
|
59
|
+
active,
|
|
60
|
+
children,
|
|
61
|
+
className,
|
|
62
|
+
disabled,
|
|
63
|
+
iconOnly,
|
|
64
|
+
leftIcon,
|
|
65
|
+
loading,
|
|
66
|
+
rightIcon,
|
|
67
|
+
size,
|
|
68
|
+
type = "button",
|
|
69
|
+
variant,
|
|
70
|
+
...props
|
|
71
|
+
}) {
|
|
72
|
+
return /* @__PURE__ */ jsxs(
|
|
73
|
+
BaseButton,
|
|
74
|
+
{
|
|
75
|
+
className: cn(buttonVariants({ iconOnly, size, variant }), className),
|
|
76
|
+
"data-state": active ? "path-active" : void 0,
|
|
77
|
+
disabled: disabled || loading,
|
|
78
|
+
focusableWhenDisabled: loading,
|
|
79
|
+
type,
|
|
80
|
+
...props,
|
|
81
|
+
children: [
|
|
82
|
+
loading ? /* @__PURE__ */ jsx(Spinner, {}) : leftIcon,
|
|
83
|
+
children,
|
|
84
|
+
!loading && rightIcon
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
Button,
|
|
91
|
+
buttonVariantBase,
|
|
92
|
+
buttonVariantConfig,
|
|
93
|
+
buttonVariants
|
|
94
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composeFrameworkSource,
|
|
3
|
+
createIdeSourceArtifacts
|
|
4
|
+
} from "./chunk-OXOFRXEI.js";
|
|
5
|
+
import "./chunk-NNBJZPFM.js";
|
|
6
|
+
import "./chunk-UYGCOWRF.js";
|
|
7
|
+
import "./chunk-EFO6AWXN.js";
|
|
8
|
+
import "./chunk-5KAD7W53.js";
|
|
9
|
+
import "./chunk-WL75GQ5M.js";
|
|
10
|
+
import "./chunk-AI2UULNX.js";
|
|
11
|
+
import "./chunk-5J3YUNRY.js";
|
|
12
|
+
import "./chunk-22RSSUNV.js";
|
|
13
|
+
export {
|
|
14
|
+
composeFrameworkSource,
|
|
15
|
+
createIdeSourceArtifacts
|
|
16
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/lib/hosting/framework-paths.ts
|
|
2
|
-
var FRAMEWORK_PREFIX = "/publishos",
|
|
2
|
+
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`, NEXT_IMAGE_OPTIMIZER_PATH = "/_next/image", 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).*)`;
|
|
3
3
|
|
|
4
4
|
// src/create-next-config.ts
|
|
5
5
|
function createNextConfig({
|
|
@@ -7,8 +7,22 @@ function createNextConfig({
|
|
|
7
7
|
}) {
|
|
8
8
|
return {
|
|
9
9
|
distDir: outputDir,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Internal rewrites must retain the server's original loopback hostname.
|
|
11
|
+
skipProxyUrlNormalize: !0,
|
|
12
|
+
assetPrefix: INTERNAL_PREFIX,
|
|
13
|
+
images: {
|
|
14
|
+
path: IMAGE_OPTIMIZER_PATH,
|
|
15
|
+
localPatterns: [{ pathname: `${SOURCE_ASSET_PREFIX}/**` }],
|
|
16
|
+
remotePatterns: []
|
|
17
|
+
},
|
|
18
|
+
turbopack: {
|
|
19
|
+
resolveAlias: {
|
|
20
|
+
"next/image": "@publish.os/nextjs/kernel/components/next-image"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
webpack(config) {
|
|
24
|
+
return config.resolve.alias["next/image"] = "@publish.os/nextjs/kernel/components/next-image", config;
|
|
25
|
+
},
|
|
12
26
|
async rewrites() {
|
|
13
27
|
return [
|
|
14
28
|
{
|