@publish.os/nextjs 0.0.1-alpha.6 → 0.0.1-alpha.8
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/README.md +3 -5
- package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
- package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
- package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
- package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
- package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
- package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
- package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
- package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
- package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
- package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
- package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
- package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
- package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
- package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
- package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
- package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
- package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
- package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
- package/compiler-assets/nextjs/shims/providers.tsx +13 -0
- package/compiler-assets/nextjs/shims/proxy.ts +317 -0
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
- package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
- package/dist/button-CFdx-ohV.d.ts +20 -0
- package/dist/cache/tags.js +6 -14
- package/dist/compiler.d.ts +100 -0
- package/dist/compiler.js +13379 -0
- package/dist/config/createNextConfig.d.ts +2 -1
- package/dist/config/createNextConfig.js +16 -12
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +303 -15
- package/dist/index.js +30 -1198
- package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
- package/dist/kernel/components/blocks/AgentActions.js +114 -200
- package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
- package/dist/kernel/components/blocks/color-palette.js +88 -169
- package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
- package/dist/kernel/components/blocks/design-system-preview.js +44 -52
- package/dist/kernel/components/blocks/link-playground.js +23 -71
- package/dist/kernel/components/blocks/logo-block.js +18 -47
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -42
- package/dist/kernel/components/blocks/navbar.d.ts +1 -1
- package/dist/kernel/components/blocks/navbar.js +14 -41
- package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
- package/dist/kernel/components/blocks/navigation-progress.js +53 -157
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +16 -42
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +11 -16
- package/dist/kernel/components/blocks/search.d.ts +13 -2
- package/dist/kernel/components/blocks/search.js +116 -247
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +56 -95
- package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
- package/dist/kernel/components/blocks/sidebar.js +35 -103
- package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
- package/dist/kernel/components/blocks/theme-toggle.js +2 -2
- package/dist/kernel/components/blocks/toc.js +42 -178
- package/dist/kernel/components/mdx/components/blockquote.js +3 -24
- package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
- package/dist/kernel/components/mdx/components/callout.js +15 -47
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
- package/dist/kernel/components/mdx/components/figure.js +9 -36
- package/dist/kernel/components/mdx/components/footnotes.js +3 -24
- package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
- package/dist/kernel/components/mdx/components/heading.js +32 -116
- package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
- package/dist/kernel/components/mdx/components/image.js +22 -62
- package/dist/kernel/components/mdx/components/inline-code.js +3 -24
- package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +1 -2
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +13 -41
- package/dist/kernel/components/mdx/components/pre.js +3 -24
- package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +6 -28
- package/dist/kernel/components/mdx/components/video-player.js +53 -88
- package/dist/kernel/components/mdx/components/video.js +27 -75
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +12 -15
- package/dist/kernel/components/mdx/error-fallback.js +4 -4
- package/dist/kernel/components/mdx/mdx.d.ts +68 -11
- package/dist/kernel/components/mdx/mdx.js +29 -29
- package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/accordion.js +3 -26
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +23 -7
- package/dist/kernel/components/ui/breadcrumb-trail.js +32 -80
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb.js +20 -54
- package/dist/kernel/components/ui/button-group.d.ts +4 -3
- package/dist/kernel/components/ui/button-group.js +7 -30
- package/dist/kernel/components/ui/button.js +13 -36
- package/dist/kernel/components/ui/card.d.ts +1 -1
- package/dist/kernel/components/ui/card.js +2 -23
- package/dist/kernel/components/ui/dialog.d.ts +9 -9
- package/dist/kernel/components/ui/dialog.js +15 -33
- package/dist/kernel/components/ui/drawer.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.js +15 -33
- package/dist/kernel/components/ui/input.js +6 -30
- package/dist/kernel/components/ui/kbd.js +10 -31
- package/dist/kernel/components/ui/link.d.ts +1 -1
- package/dist/kernel/components/ui/link.js +53 -104
- package/dist/kernel/components/ui/menu.d.ts +21 -21
- package/dist/kernel/components/ui/menu.js +10 -32
- package/dist/kernel/components/ui/meta-key.d.ts +9 -4
- package/dist/kernel/components/ui/meta-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
- package/dist/kernel/components/ui/navigation-menu.js +9 -30
- package/dist/kernel/components/ui/popover.d.ts +10 -10
- package/dist/kernel/components/ui/popover.js +19 -34
- package/dist/kernel/components/ui/progress.js +2 -25
- package/dist/kernel/components/ui/scroll-area.js +39 -118
- package/dist/kernel/components/ui/select.d.ts +15 -15
- package/dist/kernel/components/ui/select.js +19 -35
- package/dist/kernel/components/ui/separator.js +2 -25
- package/dist/kernel/components/ui/table.js +2 -23
- package/dist/kernel/components/ui/tabs.js +39 -99
- package/dist/kernel/components/ui/tag.d.ts +2 -2
- package/dist/kernel/components/ui/tag.js +4 -25
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +3 -25
- package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
- package/dist/kernel/components/ui/theme-toggle.js +18 -44
- package/dist/kernel/components/ui/toast.d.ts +10 -10
- package/dist/kernel/components/ui/toast.js +13 -35
- package/dist/kernel/components/ui/tooltip.d.ts +8 -8
- package/dist/kernel/components/ui/tooltip.js +8 -29
- package/dist/kernel/defaults.registry.d.ts +1 -1
- package/dist/kernel/defaults.registry.js +2 -2
- package/dist/kernel/framework-icons.d.ts +1 -0
- package/dist/kernel/framework-icons.js +39 -0
- package/dist/kernel/routes/agent/markdown.js +36 -65
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +20 -109
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +46 -127
- package/dist/kernel/routes/metadata/llms.d.ts +1 -2
- package/dist/kernel/routes/metadata/llms.js +40 -120
- package/dist/kernel/routes/metadata/og-image.d.ts +10 -0
- package/dist/kernel/routes/metadata/og-image.js +264 -198
- package/dist/kernel/routes/metadata/robots.d.ts +1 -2
- package/dist/kernel/routes/metadata/robots.js +21 -90
- package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
- package/dist/kernel/routes/metadata/sitemap.js +36 -102
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +42 -137
- package/dist/kernel/routes/pages/leaf.d.ts +1 -1
- package/dist/kernel/routes/pages/leaf.js +74 -213
- package/dist/kernel/routes/pages/root.d.ts +1 -1
- package/dist/kernel/routes/pages/root.js +37 -108
- package/dist/keyboard-shortcuts.js +69 -141
- package/dist/link-CYaCRDb6.d.ts +35 -0
- package/dist/resolvers/manifest-resolver.d.ts +3 -3
- package/dist/resolvers/manifest-resolver.js +15 -21
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +81 -4
- package/dist/search.js +124 -195
- package/dist/sidebar-types-Bgchdfd6.d.ts +25 -0
- package/dist/theme-scope.d.ts +15 -0
- package/dist/theme-scope.js +23 -0
- package/dist/types-B_b3C0U6.d.ts +63 -0
- package/dist/types-CIwwieNw.d.ts +127 -0
- package/dist/types-DHBm7-j6.d.ts +57 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +1 -1
- package/dist/utils/cn.d.ts +5 -9
- package/dist/utils/cn.js +13 -7
- package/dist/utils/heading-ids.js +20 -47
- package/dist/utils/pretty-date.js +7 -13
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
- package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
- package/init/seed/minimal/publish.os/theme.css +47 -0
- package/init/seed/minimal/seed.json +13 -0
- package/package.json +469 -35
- package/release/{package.json → app/lucide/package.json} +11 -5
- package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
- package/release/app/lucide/pnpm-workspace.yaml +11 -0
- package/release/app/phosphor/package.json +30 -0
- package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
- package/release/app/phosphor/pnpm-workspace.yaml +11 -0
- package/release/app/tabler/package.json +30 -0
- package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
- package/release/app/tabler/pnpm-workspace.yaml +11 -0
- package/release/compiler/package.json +20 -0
- package/release/compiler/pnpm-lock.yaml.template +2432 -0
- package/release/compiler/pnpm-workspace.yaml +11 -0
- package/release/release.json +29 -5
- package/release/runtime-pnpm-lock.yaml +0 -1316
|
@@ -1,49 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var twMerge = extendTailwindMerge({
|
|
7
|
-
extend: {
|
|
8
|
-
classGroups: {
|
|
9
|
-
z: [
|
|
10
|
-
"z-content",
|
|
11
|
-
"z-nav",
|
|
12
|
-
"z-overlay",
|
|
13
|
-
"z-modal",
|
|
14
|
-
"z-search",
|
|
15
|
-
"z-toast",
|
|
16
|
-
"z-progress"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function cn(...inputs) {
|
|
22
|
-
return twMerge(clsx(inputs));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// src/kernel/components/mdx/components/heading-copy-link.tsx
|
|
26
|
-
import { Link as LinkIcon } from "lucide-react";
|
|
3
|
+
// src/components/mdx/heading-copy-link.tsx
|
|
4
|
+
import { FrameworkLinkIcon as Link } from "@publish.os/nextjs/kernel/framework-icons";
|
|
5
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
27
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
7
|
function headingCopyUrl({ href, id }) {
|
|
29
|
-
|
|
30
|
-
url.hash = id;
|
|
31
|
-
return url.toString();
|
|
8
|
+
let url = new URL(href);
|
|
9
|
+
return url.hash = id, url.toString();
|
|
32
10
|
}
|
|
33
11
|
function HeadingCopyLink({
|
|
34
12
|
className,
|
|
35
13
|
id,
|
|
36
14
|
children,
|
|
37
|
-
iconOnly =
|
|
15
|
+
iconOnly = !1
|
|
38
16
|
}) {
|
|
39
|
-
|
|
40
|
-
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)
|
|
17
|
+
let handleClick = (e) => {
|
|
18
|
+
if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)
|
|
41
19
|
return;
|
|
42
|
-
}
|
|
43
|
-
const url = headingCopyUrl({ href: window.location.href, id });
|
|
20
|
+
let url = headingCopyUrl({ href: window.location.href, id });
|
|
44
21
|
navigator.clipboard?.writeText(url).catch(() => {
|
|
45
|
-
})
|
|
46
|
-
window.setTimeout(() => {
|
|
22
|
+
}), window.setTimeout(() => {
|
|
47
23
|
document.getElementById(id)?.scrollIntoView({ block: "start" });
|
|
48
24
|
}, 0);
|
|
49
25
|
};
|
|
@@ -54,7 +30,7 @@ function HeadingCopyLink({
|
|
|
54
30
|
href: `#${id}`,
|
|
55
31
|
onClick: handleClick,
|
|
56
32
|
className: cn(
|
|
57
|
-
"not-markdown-prose group/heading-link rounded-button border-0 p-0 text-inherit no-underline decoration-transparent transition-colors duration-150 [--link-underline-offset:-0.08em] [--link-underline-thickness:1px] hover:text-inherit hover:no-underline active:text-inherit active:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-
|
|
33
|
+
"not-markdown-prose group/heading-link rounded-button border-0 p-0 text-inherit no-underline decoration-transparent transition-colors duration-150 [--link-underline-offset:-0.08em] [--link-underline-thickness:1px] hover:text-inherit hover:no-underline active:text-inherit active:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke",
|
|
58
34
|
iconOnly ? "inline-flex items-center align-[-0.05em]" : "inline",
|
|
59
35
|
className
|
|
60
36
|
),
|
|
@@ -65,10 +41,10 @@ function HeadingCopyLink({
|
|
|
65
41
|
{
|
|
66
42
|
"aria-hidden": "true",
|
|
67
43
|
className: cn(
|
|
68
|
-
"inline-flex h-[1em] items-center align-[-0.06em] text-foreground
|
|
44
|
+
"inline-flex h-[1em] items-center align-[-0.06em] text-typography-caption-foreground transition-[color,opacity] duration-150 group-hover/heading-link:text-typography-body-foreground group-focus-visible/heading-link:text-typography-body-foreground",
|
|
69
45
|
iconOnly ? "opacity-100" : "ml-1.5 opacity-0 group-hover/heading-link:opacity-100 group-focus-visible/heading-link:opacity-100"
|
|
70
46
|
),
|
|
71
|
-
children: /* @__PURE__ */ jsx(
|
|
47
|
+
children: /* @__PURE__ */ jsx(Link, { "aria-hidden": "true", className: "block size-[0.8em] shrink-0" })
|
|
72
48
|
}
|
|
73
49
|
)
|
|
74
50
|
]
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
+
type HeadingProps<T extends HeadingElement> = {
|
|
6
|
+
as: T;
|
|
7
|
+
} & Omit<ComponentPropsWithoutRef<T>, "className"> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
5
10
|
|
|
6
11
|
declare function Heading<T extends HeadingElement>({ as: Tag, children, className, id, ...props }: HeadingProps<T>): react_jsx_runtime.JSX.Element;
|
|
7
12
|
|
|
@@ -1,105 +1,30 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { HeadingCopyLink } from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { clsx } from "clsx";
|
|
6
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
7
|
-
var twMerge = extendTailwindMerge({
|
|
8
|
-
extend: {
|
|
9
|
-
classGroups: {
|
|
10
|
-
z: [
|
|
11
|
-
"z-content",
|
|
12
|
-
"z-nav",
|
|
13
|
-
"z-overlay",
|
|
14
|
-
"z-modal",
|
|
15
|
-
"z-search",
|
|
16
|
-
"z-toast",
|
|
17
|
-
"z-progress"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function cn(...inputs) {
|
|
23
|
-
return twMerge(clsx(inputs));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// src/utils/heading-ids.ts
|
|
27
|
-
import { isValidElement } from "react";
|
|
28
|
-
var SELF_CLOSING_TAG_RE = new RegExp("<[^>]+/>", "g");
|
|
29
|
-
var PAIRED_TAG_RE = /<\/?\w[^>]*>/g;
|
|
30
|
-
var MDX_BOLD_RE = /\*\*(.*?)\*\*/g;
|
|
31
|
-
var MDX_ITALIC_RE = /\*(.*?)\*/g;
|
|
32
|
-
var MDX_UNDERLINE_BOLD_RE = /__(.*?)__/g;
|
|
33
|
-
var MDX_UNDERLINE_ITALIC_RE = /_(.*?)_/g;
|
|
34
|
-
var MDX_STRIKETHROUGH_RE = /~~(.*?)~~/g;
|
|
35
|
-
var MDX_INLINE_CODE_RE = /`(.*?)`/g;
|
|
36
|
-
var MDX_LINK_RE = /\[(.*?)\]\(.*?\)/g;
|
|
37
|
-
var NON_ALPHANUMERIC_RE = /[^a-z0-9]+/g;
|
|
38
|
-
var LEADING_TRAILING_HYPHEN_RE = /^-+|-+$/g;
|
|
39
|
-
var LEADING_DIGIT_RE = /^(\d)/;
|
|
40
|
-
function extractText(node) {
|
|
41
|
-
if (typeof node === "string") return node;
|
|
42
|
-
if (typeof node === "number") return String(node);
|
|
43
|
-
if (node == null || typeof node === "boolean") return "";
|
|
44
|
-
if (Array.isArray(node)) {
|
|
45
|
-
return node.map(extractText).join("");
|
|
46
|
-
}
|
|
47
|
-
if (isValidElement(node)) {
|
|
48
|
-
const element = node;
|
|
49
|
-
return element.props.children === void 0 ? "" : extractText(element.props.children);
|
|
50
|
-
}
|
|
51
|
-
return "";
|
|
52
|
-
}
|
|
53
|
-
function cleanHeadingText(input) {
|
|
54
|
-
const text = typeof input === "string" ? input : extractText(input);
|
|
55
|
-
return text.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();
|
|
56
|
-
}
|
|
57
|
-
function slugify(text) {
|
|
58
|
-
return text.toLowerCase().replace(NON_ALPHANUMERIC_RE, "-").replace(LEADING_TRAILING_HYPHEN_RE, "").replace(LEADING_DIGIT_RE, "id-$1");
|
|
59
|
-
}
|
|
60
|
-
function headingToHTMLId(input) {
|
|
61
|
-
try {
|
|
62
|
-
const id = slugify(cleanHeadingText(input));
|
|
63
|
-
return id || "empty-heading";
|
|
64
|
-
} catch {
|
|
65
|
-
return "empty-heading";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/kernel/components/mdx/components/heading.tsx
|
|
1
|
+
// src/components/mdx/heading.tsx
|
|
2
|
+
import { HeadingCopyLink } from "@publish.os/nextjs/kernel/components/mdx/components/heading-copy-link";
|
|
3
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
|
+
import { headingToHTMLId } from "@publish.os/nextjs/utils/heading-ids";
|
|
70
5
|
import {
|
|
71
6
|
Children,
|
|
72
|
-
isValidElement
|
|
7
|
+
isValidElement
|
|
73
8
|
} from "react";
|
|
74
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
75
10
|
function isBrElement(node) {
|
|
76
|
-
return
|
|
11
|
+
return isValidElement(node) && node.type === "br";
|
|
77
12
|
}
|
|
78
13
|
function cleanHeadingChildren(children) {
|
|
79
|
-
|
|
14
|
+
let childArray = Children.toArray(children).filter(
|
|
80
15
|
(child) => !isBrElement(child)
|
|
81
16
|
);
|
|
82
|
-
|
|
17
|
+
for (; childArray.length > 0 && typeof childArray[0] == "string" && childArray[0].trim() === ""; )
|
|
83
18
|
childArray.shift();
|
|
84
|
-
|
|
85
|
-
while (childArray.length > 0 && typeof childArray[childArray.length - 1] === "string" && childArray[childArray.length - 1].trim() === "") {
|
|
19
|
+
for (; childArray.length > 0 && typeof childArray[childArray.length - 1] == "string" && childArray[childArray.length - 1].trim() === ""; )
|
|
86
20
|
childArray.pop();
|
|
87
|
-
|
|
88
|
-
if (childArray.length === 0) return null;
|
|
89
|
-
if (childArray.length === 1) return childArray[0];
|
|
90
|
-
return childArray;
|
|
21
|
+
return childArray.length === 0 ? null : childArray.length === 1 ? childArray[0] : childArray;
|
|
91
22
|
}
|
|
92
23
|
function hasNestedLink(children) {
|
|
93
|
-
for (
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
if (typeof child.props === "object" && child.props !== null && "children" in child.props && hasNestedLink(child.props.children)) {
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
24
|
+
for (let child of Children.toArray(children))
|
|
25
|
+
if (isValidElement(child) && (typeof child.props == "object" && child.props !== null && "href" in child.props || typeof child.props == "object" && child.props !== null && "children" in child.props && hasNestedLink(child.props.children)))
|
|
26
|
+
return !0;
|
|
27
|
+
return !1;
|
|
103
28
|
}
|
|
104
29
|
function Heading({
|
|
105
30
|
as: Tag,
|
|
@@ -108,33 +33,24 @@ function Heading({
|
|
|
108
33
|
id,
|
|
109
34
|
...props
|
|
110
35
|
}) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
id: headingId,
|
|
130
|
-
iconOnly: true,
|
|
131
|
-
className: "ml-1.5 opacity-0 group-hover/heading:opacity-100 focus-visible:opacity-100 hover:opacity-100"
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
] })
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return (
|
|
36
|
+
let cleaned = cleanHeadingChildren(children), headingId = id ?? headingToHTMLId(cleaned), isEmpty = !headingId || headingId === "empty-heading", classes = cn("scroll-mt-20", className);
|
|
37
|
+
return isEmpty ? (
|
|
38
|
+
// @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
|
|
39
|
+
/* @__PURE__ */ jsx(Tag, { className, ...props, children: cleaned })
|
|
40
|
+
) : hasNestedLink(cleaned) ? (
|
|
41
|
+
// @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
|
|
42
|
+
/* @__PURE__ */ jsxs(Tag, { id: headingId, className: cn("group/heading", classes), ...props, children: [
|
|
43
|
+
cleaned,
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
HeadingCopyLink,
|
|
46
|
+
{
|
|
47
|
+
id: headingId,
|
|
48
|
+
iconOnly: !0,
|
|
49
|
+
className: "ml-1.5 opacity-0 group-hover/heading:opacity-100 focus-visible:opacity-100 hover:opacity-100"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] })
|
|
53
|
+
) : (
|
|
138
54
|
// @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
|
|
139
55
|
/* @__PURE__ */ jsx(Tag, { id: headingId, className: classes, ...props, children: /* @__PURE__ */ jsx(HeadingCopyLink, { id: headingId, children: cleaned }) })
|
|
140
56
|
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Separator } from '
|
|
3
|
-
import '
|
|
4
|
-
|
|
2
|
+
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
3
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
|
|
5
|
+
type SeparatorProps = ComponentPropsWithoutRef<typeof Separator$1>;
|
|
6
|
+
declare function Separator({ className, orientation, ...props }: SeparatorProps): react_jsx_runtime.JSX.Element;
|
|
5
7
|
|
|
6
8
|
type HrProps = React.ComponentPropsWithoutRef<typeof Separator>;
|
|
7
9
|
declare function Hr({ className, ...props }: HrProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { Separator } from "
|
|
1
|
+
// src/components/mdx/hr.tsx
|
|
2
|
+
import { Separator } from "@publish.os/nextjs/kernel/components/ui/separator";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function Hr({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(Separator, { className, ...props });
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
3
|
+
// src/components/mdx/image-zoom.tsx
|
|
4
4
|
import Zoom from "react-medium-image-zoom";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function ImageZoom({
|
|
7
7
|
children,
|
|
8
8
|
enabled
|
|
9
9
|
}) {
|
|
10
|
-
|
|
11
|
-
return /* @__PURE__ */ jsx(Zoom, { zoomMargin: 40, children });
|
|
10
|
+
return enabled ? /* @__PURE__ */ jsx(Zoom, { zoomMargin: 40, children }) : children;
|
|
12
11
|
}
|
|
13
12
|
export {
|
|
14
13
|
ImageZoom
|
|
@@ -1,89 +1,53 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { FigureCaption } from "
|
|
3
|
-
import { ImageZoom } from "
|
|
4
|
-
|
|
5
|
-
// src/utils/cn.ts
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
8
|
-
var twMerge = extendTailwindMerge({
|
|
9
|
-
extend: {
|
|
10
|
-
classGroups: {
|
|
11
|
-
z: [
|
|
12
|
-
"z-content",
|
|
13
|
-
"z-nav",
|
|
14
|
-
"z-overlay",
|
|
15
|
-
"z-modal",
|
|
16
|
-
"z-search",
|
|
17
|
-
"z-toast",
|
|
18
|
-
"z-progress"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function cn(...inputs) {
|
|
24
|
-
return twMerge(clsx(inputs));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// src/kernel/components/mdx/components/image.tsx
|
|
1
|
+
// src/components/mdx/image.tsx
|
|
2
|
+
import { FigureCaption } from "@publish.os/nextjs/kernel/components/mdx/components/figure-caption";
|
|
3
|
+
import { ImageZoom } from "@publish.os/nextjs/kernel/components/mdx/components/image-zoom";
|
|
4
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
28
5
|
import NextImage from "next/image";
|
|
29
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
7
|
function parseAspect(value) {
|
|
31
|
-
if (typeof value
|
|
8
|
+
if (typeof value == "number" && Number.isFinite(value) && value > 0)
|
|
32
9
|
return value;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
return width / height;
|
|
10
|
+
if (typeof value != "string") return;
|
|
11
|
+
let [width, height] = value.split("/").map((part) => Number(part.trim()));
|
|
12
|
+
if (!(!width || !height || !Number.isFinite(width) || !Number.isFinite(height)))
|
|
13
|
+
return width / height;
|
|
40
14
|
}
|
|
41
15
|
function Image({
|
|
42
16
|
alt,
|
|
43
17
|
aspect,
|
|
44
18
|
caption,
|
|
45
19
|
className,
|
|
46
|
-
decorative =
|
|
47
|
-
fill =
|
|
20
|
+
decorative = !1,
|
|
21
|
+
fill = !1,
|
|
48
22
|
frame = "default",
|
|
49
23
|
height,
|
|
50
24
|
intrinsicHeight,
|
|
51
25
|
intrinsicWidth,
|
|
52
|
-
optimized =
|
|
26
|
+
optimized = !1,
|
|
53
27
|
priority,
|
|
54
28
|
quality,
|
|
55
29
|
sizes,
|
|
56
30
|
src,
|
|
57
31
|
width,
|
|
58
|
-
zoom =
|
|
32
|
+
zoom = !0,
|
|
59
33
|
...props
|
|
60
34
|
}) {
|
|
61
35
|
if (!src) return null;
|
|
62
|
-
|
|
63
|
-
const resolvedHeight = height ?? intrinsicHeight;
|
|
64
|
-
const resolvedAspect = parseAspect(aspect) ?? (resolvedWidth && resolvedHeight ? resolvedWidth / resolvedHeight : void 0);
|
|
65
|
-
const imageAlt = decorative ? "" : alt ?? "";
|
|
66
|
-
const framed = frame !== false && frame !== "none";
|
|
67
|
-
const stringSrc = String(src);
|
|
68
|
-
const useNextImage = optimized && stringSrc.startsWith("/");
|
|
69
|
-
const shouldFill = fill && resolvedAspect;
|
|
70
|
-
const frameStyle = {
|
|
36
|
+
let resolvedWidth = width ?? intrinsicWidth, resolvedHeight = height ?? intrinsicHeight, resolvedAspect = parseAspect(aspect) ?? (resolvedWidth && resolvedHeight ? resolvedWidth / resolvedHeight : void 0), imageAlt = decorative ? "" : alt ?? "", framed = frame !== !1 && frame !== "none", stringSrc = String(src), useNextImage = optimized && stringSrc.startsWith("/"), shouldFill = fill && resolvedAspect, frameStyle = {
|
|
71
37
|
...resolvedAspect ? { aspectRatio: String(resolvedAspect) } : {},
|
|
72
38
|
width: fill ? "100%" : resolvedWidth ? `min(100%, ${resolvedWidth}px)` : "100%"
|
|
73
|
-
}
|
|
74
|
-
const imageClassName = cn(
|
|
39
|
+
}, imageClassName = cn(
|
|
75
40
|
"block h-full w-full transition-opacity duration-200",
|
|
76
41
|
fill ? "object-cover" : "object-contain",
|
|
77
42
|
zoom && "cursor-zoom-in hover:opacity-90",
|
|
78
43
|
className
|
|
79
|
-
)
|
|
80
|
-
const image = useNextImage ? shouldFill ? /* @__PURE__ */ jsx(
|
|
44
|
+
), image = useNextImage ? shouldFill ? /* @__PURE__ */ jsx(
|
|
81
45
|
NextImage,
|
|
82
46
|
{
|
|
83
47
|
alt: imageAlt,
|
|
84
48
|
"aria-hidden": decorative || void 0,
|
|
85
49
|
className: imageClassName,
|
|
86
|
-
fill:
|
|
50
|
+
fill: !0,
|
|
87
51
|
priority,
|
|
88
52
|
quality,
|
|
89
53
|
sizes: sizes ?? "(max-width: 768px) 100vw, min(var(--publish-content-width, 72rem), 100vw)",
|
|
@@ -132,8 +96,7 @@ function Image({
|
|
|
132
96
|
...props
|
|
133
97
|
}
|
|
134
98
|
)
|
|
135
|
-
)
|
|
136
|
-
const content = /* @__PURE__ */ jsx(
|
|
99
|
+
), content = /* @__PURE__ */ jsx(
|
|
137
100
|
"div",
|
|
138
101
|
{
|
|
139
102
|
className: cn(
|
|
@@ -144,13 +107,10 @@ function Image({
|
|
|
144
107
|
children: /* @__PURE__ */ jsx(ImageZoom, { enabled: zoom, children: image })
|
|
145
108
|
}
|
|
146
109
|
);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
] });
|
|
152
|
-
}
|
|
153
|
-
return /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6 flex justify-center", children: content });
|
|
110
|
+
return caption ? /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8", children: [
|
|
111
|
+
content,
|
|
112
|
+
/* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: caption })
|
|
113
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6 flex justify-center", children: content });
|
|
154
114
|
}
|
|
155
115
|
export {
|
|
156
116
|
Image
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/inline-code.tsx
|
|
1
|
+
// src/components/mdx/inline-code.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { jsx } from "react/jsx-runtime";
|
|
25
4
|
function InlineCode({ className, ...props }) {
|
|
26
5
|
return /* @__PURE__ */ jsx(
|
|
27
6
|
"code",
|
|
28
7
|
{
|
|
29
8
|
className: cn(
|
|
30
|
-
"not-markdown-prose h-fit rounded-inline-code border border-stroke
|
|
9
|
+
"not-markdown-prose h-fit rounded-inline-code border border-typography-code-stroke bg-typography-code-surface px-[0.35em] py-[0.15em] font-mono text-[0.95em] font-normal leading-[1.25] text-typography-code-foreground [a_&]:text-typography-link-foreground [pre_&]:border-0 [pre_&]:bg-transparent [pre_&]:p-0 [pre_&]:text-inherit",
|
|
31
10
|
className
|
|
32
11
|
),
|
|
33
12
|
...props
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import 'class-variance-authority
|
|
4
|
-
import '
|
|
5
|
-
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { HTMLAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
declare const kbdVariants: (props?: ({
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
|
+
square?: boolean | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
type KbdProps$1 = HTMLAttributes<HTMLElement> & VariantProps<typeof kbdVariants>;
|
|
6
11
|
|
|
7
12
|
type KbdProps = KbdProps$1;
|
|
8
13
|
declare function Kbd(props: KbdProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { Kbd as UiKbd } from "
|
|
1
|
+
// src/components/mdx/kbd.tsx
|
|
2
|
+
import { Kbd as UiKbd } from "@publish.os/nextjs/kernel/components/ui/kbd";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function Kbd(props) {
|
|
5
5
|
return /* @__PURE__ */ jsx(UiKbd, { ...props });
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { LinkProps } from '
|
|
2
|
+
import { L as LinkProps } from '../../../../link-CYaCRDb6.js';
|
|
3
3
|
import 'class-variance-authority/types';
|
|
4
|
-
import '../../ui/button.js';
|
|
5
4
|
import 'class-variance-authority';
|
|
6
5
|
import 'react';
|
|
7
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/components/mdx/link.tsx
|
|
2
2
|
import {
|
|
3
3
|
Link as UiLink
|
|
4
|
-
} from "
|
|
4
|
+
} from "@publish.os/nextjs/kernel/components/ui/link";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function Link({
|
|
7
7
|
color = "accent",
|
|
@@ -1,55 +1,27 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/paragraph.tsx
|
|
1
|
+
// src/components/mdx/paragraph.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { Children, isValidElement } from "react";
|
|
25
4
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
26
5
|
function isBlockMediaChild(child) {
|
|
27
|
-
if (!isValidElement(child)) return
|
|
28
|
-
|
|
29
|
-
if (typeof props.src
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (typeof type === "string") {
|
|
33
|
-
return type === "figure" || type === "img" || type === "video";
|
|
34
|
-
}
|
|
35
|
-
if (typeof type === "function") {
|
|
36
|
-
return ["Figure", "Image", "Video"].includes(type.name);
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
6
|
+
if (!isValidElement(child)) return !1;
|
|
7
|
+
let props = child.props;
|
|
8
|
+
if (typeof props.src == "string" && "alt" in props || typeof props.src == "string" && "title" in props) return !0;
|
|
9
|
+
let type = child.type;
|
|
10
|
+
return typeof type == "string" ? type === "figure" || type === "img" || type === "video" : typeof type == "function" ? ["Figure", "Image", "Video"].includes(type.name) : !1;
|
|
39
11
|
}
|
|
40
12
|
function Paragraph({
|
|
41
13
|
children,
|
|
42
14
|
className,
|
|
43
15
|
...props
|
|
44
16
|
}) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
+
let childArray = Children.toArray(children);
|
|
18
|
+
return childArray.length === 1 && isBlockMediaChild(childArray[0]) ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(
|
|
50
19
|
"p",
|
|
51
20
|
{
|
|
52
|
-
className: cn(
|
|
21
|
+
className: cn(
|
|
22
|
+
"my-5 text-base leading-7 text-typography-body-foreground",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
53
25
|
...props,
|
|
54
26
|
children
|
|
55
27
|
}
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/pre.tsx
|
|
1
|
+
// src/components/mdx/pre.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { jsx } from "react/jsx-runtime";
|
|
25
4
|
function Pre({ className, ...props }) {
|
|
26
5
|
return /* @__PURE__ */ jsx(
|
|
27
6
|
"pre",
|
|
28
7
|
{
|
|
29
8
|
className: cn(
|
|
30
|
-
"my-6 overflow-x-auto rounded-codeblock border border-stroke
|
|
9
|
+
"my-6 overflow-x-auto rounded-codeblock border border-typography-pre-stroke bg-typography-pre-surface p-4 text-sm leading-6 text-typography-pre-foreground",
|
|
31
10
|
className
|
|
32
11
|
),
|
|
33
12
|
...props
|