@publish.os/nextjs 0.0.1-alpha.81 → 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/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +8 -8
- package/compiler-assets/nextjs/defaults/group/page.tsx +44 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +33 -13
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -3
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -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/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +18 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +19 -85
- 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 +143 -65
- 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 +30 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +112 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +17 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-5QMLXF7N.js +89 -0
- package/dist/{button-CFdx-ohV.d.ts → button-BdCScEKi.d.ts} +6 -6
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-4BC2L2KA.js +620 -0
- package/dist/chunk-5J3YUNRY.js +121 -0
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/chunk-6C65KV7O.js +142 -0
- package/dist/chunk-6D2E6UMD.js +695 -0
- package/dist/chunk-7NY22B5U.js +161 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-F3AGNDF4.js +2377 -0
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/chunk-NNBJZPFM.js +193 -0
- package/dist/chunk-ORIUWJBQ.js +58 -0
- package/dist/chunk-OXOFRXEI.js +7129 -0
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/chunk-WL75GQ5M.js +80 -0
- package/dist/compiler.d.ts +54 -7
- package/dist/compiler.js +121 -13147
- 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 +27 -0
- package/dist/dev-operation-OSHHWRWK.js +1095 -0
- package/dist/framework-selection-ZVO323PK.js +11 -0
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +55 -4
- 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 +401 -150
- 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 +3 -3
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +22 -7
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +406 -65
- package/dist/kernel/components/blocks/navigation-progress.js +6 -3
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +12 -24
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +7 -6
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +554 -428
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +12 -10
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +24 -14
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +47 -1
- 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 +122 -180
- package/dist/kernel/components/mdx/components/blockquote.js +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +67 -36
- 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 +61 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +4 -3
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +24 -14
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +4 -4
- 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 +2 -2
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +94 -68
- package/dist/kernel/components/mdx/components/inline-code.js +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +5 -4
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +3 -3
- package/dist/kernel/components/mdx/components/paragraph.js +2 -5
- 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 +2 -2
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +8 -4
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +8 -6
- 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 +28 -14
- package/dist/kernel/components/mdx/mdx.js +336 -63
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +6 -4
- 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 +6 -23
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +10 -8
- package/dist/kernel/components/ui/button-group.js +8 -7
- package/dist/kernel/components/ui/button.d.ts +58 -6
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +6 -2
- 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.js +10 -17
- package/dist/kernel/components/ui/link.d.ts +11 -3
- package/dist/kernel/components/ui/link.js +12 -11
- package/dist/kernel/components/ui/menu.js +6 -6
- 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 +3 -3
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.js +2 -2
- package/dist/kernel/components/ui/scroll-area.js +5 -5
- package/dist/kernel/components/ui/select.js +8 -11
- 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 +2 -2
- 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 +11 -24
- package/dist/kernel/defaults.registry.js +11 -26
- package/dist/kernel/routes/agent/markdown.d.ts +3 -1
- 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 +111 -81
- package/dist/kernel/routes/metadata/llms.d.ts +12 -3
- package/dist/kernel/routes/metadata/llms.js +156 -59
- 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/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +26 -4
- package/dist/kernel/routes/metadata/sitemap.js +206 -38
- 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 +21 -13
- package/dist/kernel/routes/pages/leaf.d.ts +28 -1
- package/dist/kernel/routes/pages/leaf.js +25 -16
- package/dist/kernel/routes/pages/root.js +19 -13
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +52 -29
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/theme-scope.js +1 -1
- 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-CIwwieNw.d.ts → types-J2w_puPF.d.ts} +11 -10
- package/dist/types.d.ts +15 -6
- 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/.gitignore +1 -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 +6 -11
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +6 -7
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +7 -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 +12 -2
- 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 +55 -44
- package/release/app/phosphor/package.json +5 -5
- package/release/app/phosphor/pnpm-lock.yaml.template +553 -377
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +500 -303
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +8 -37
- 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/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -648
- 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/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/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -58
- 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/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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare function TocDesktop({ children }: {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function TocMobile({ children }: {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function TocMobileHeader({ children }: {
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function TocLinksSlot({ className, listClassName, viewport, }: {
|
|
14
|
+
className?: string;
|
|
15
|
+
listClassName?: string;
|
|
16
|
+
viewport?: "desktop" | "mobile";
|
|
17
|
+
}): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function TocTitle({ children, className, ...props }: React.ComponentPropsWithoutRef<"span">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
type TocProps = {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
content?: string;
|
|
24
|
+
desktopClassName?: string;
|
|
25
|
+
desktopListClassName?: string;
|
|
26
|
+
levels?: [number, number];
|
|
27
|
+
listClassName?: string;
|
|
28
|
+
mobileClassName?: string;
|
|
29
|
+
mobileQuery?: string;
|
|
30
|
+
readingOffset?: number;
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
33
|
+
declare function TocRoot({ className, content, desktopClassName, desktopListClassName, levels, listClassName, mobileClassName, mobileQuery, readingOffset, title, children, }: TocProps): react_jsx_runtime.JSX.Element | null;
|
|
34
|
+
declare const Toc: typeof TocRoot & {
|
|
35
|
+
Desktop: typeof TocDesktop;
|
|
36
|
+
Links: typeof TocLinksSlot;
|
|
37
|
+
Mobile: typeof TocMobile;
|
|
38
|
+
MobileHeader: typeof TocMobileHeader;
|
|
39
|
+
Root: typeof TocRoot;
|
|
40
|
+
Title: typeof TocTitle;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { Toc, type TocProps };
|
|
@@ -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,9 +1,36 @@
|
|
|
1
|
+
// src/lib/hosting/framework-paths.ts
|
|
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
|
+
|
|
1
4
|
// src/create-next-config.ts
|
|
2
5
|
function createNextConfig({
|
|
3
6
|
outputDir
|
|
4
7
|
}) {
|
|
5
8
|
return {
|
|
6
9
|
distDir: outputDir,
|
|
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
|
+
},
|
|
26
|
+
async rewrites() {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
source: IMAGE_OPTIMIZER_PATH,
|
|
30
|
+
destination: NEXT_IMAGE_OPTIMIZER_PATH
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
},
|
|
7
34
|
transpilePackages: ["@publish.os/nextjs"],
|
|
8
35
|
cacheComponents: !0,
|
|
9
36
|
cacheLife: {
|