@publish.os/nextjs 0.0.1-alpha.8 → 0.0.1-alpha.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler-assets/nextjs/defaults/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +7 -3
- package/compiler-assets/nextjs/defaults/group/page.tsx +35 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +22 -11
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +1 -4
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
- package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
- package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
- package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
- package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +16 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +11 -43
- package/compiler-assets/nextjs/shims/proxy.ts +21 -9
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
- package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +34 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +100 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +12 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-2JAYBSKF.js +83 -0
- package/dist/button-CtzUJB8u.d.ts +11 -0
- package/dist/{button-CFdx-ohV.d.ts → button-c3WGnxIj.d.ts} +3 -3
- package/dist/chunk-535TM4A5.js +1455 -0
- package/dist/chunk-726GV2NF.js +2344 -0
- package/dist/chunk-7OGTPSKI.js +156 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-B2V22WRT.js +297 -0
- package/dist/chunk-DLDFHU7Y.js +191 -0
- package/dist/chunk-DWA3ZRGW.js +142 -0
- package/dist/chunk-GGKFQ3MA.js +621 -0
- package/dist/chunk-H6XILMZX.js +6154 -0
- package/dist/chunk-NECL5IBJ.js +318 -0
- package/dist/chunk-SVYGXXYR.js +36 -0
- package/dist/chunk-UF6ATARM.js +1100 -0
- package/dist/chunk-VO2I7MTM.js +56 -0
- package/dist/chunk-WDY4IK6Z.js +128 -0
- package/dist/chunk-WKTEO6RS.js +586 -0
- package/dist/chunk-YLTOLYWM.js +92 -0
- package/dist/compiler.d.ts +41 -7
- package/dist/compiler.js +48 -13143
- package/dist/compose-NN23UJGC.js +13 -0
- package/dist/config/createNextConfig.js +13 -0
- package/dist/dev-operation-TZDVJCN7.js +1055 -0
- package/dist/framework-selection-X4U6Y6QC.js +10 -0
- package/dist/ide-support-ZNW7ODFY.js +15 -0
- package/dist/index.d.ts +15 -3
- package/dist/kernel/components/blocks/AgentActions.js +71 -61
- package/dist/kernel/components/blocks/design-system-preview.d.ts +1 -1
- package/dist/kernel/components/blocks/design-system-preview.js +32 -13
- package/dist/kernel/components/blocks/link-playground.js +2 -2
- package/dist/kernel/components/blocks/logo-block.js +2 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +20 -5
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +401 -60
- package/dist/kernel/components/blocks/navigation-progress-playground.js +4 -4
- package/dist/kernel/components/blocks/navigation-progress.js +4 -1
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +11 -23
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +5 -4
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +553 -426
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +11 -9
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +18 -11
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +48 -2
- package/dist/kernel/components/blocks/toc.js +3 -3
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +66 -35
- package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
- package/dist/kernel/components/mdx/components/code-block.js +106 -5
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
- package/dist/kernel/components/mdx/components/copy-code-button.js +60 -0
- package/dist/kernel/components/mdx/components/figure-caption.js +1 -1
- package/dist/kernel/components/mdx/components/figure.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +1 -1
- package/dist/kernel/components/mdx/components/image.js +77 -56
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +3 -2
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +1 -1
- package/dist/kernel/components/mdx/components/paragraph.js +1 -4
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.js +2 -2
- package/dist/kernel/components/mdx/components/video.js +1 -1
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +12 -8
- package/dist/kernel/components/mdx/mdx.js +115 -39
- package/dist/kernel/components/mdx/rehype-heading-ids.js +1 -1
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +6 -23
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +6 -4
- package/dist/kernel/components/ui/button-group.d.ts +1 -1
- package/dist/kernel/components/ui/button-group.js +5 -4
- package/dist/kernel/components/ui/button.d.ts +2 -2
- package/dist/kernel/components/ui/button.js +6 -6
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +5 -1
- package/dist/kernel/components/ui/input.d.ts +4 -4
- package/dist/kernel/components/ui/kbd.d.ts +1 -1
- package/dist/kernel/components/ui/kbd.js +9 -16
- package/dist/kernel/components/ui/link.d.ts +5 -3
- package/dist/kernel/components/ui/link.js +10 -9
- package/dist/kernel/components/ui/menu.js +5 -5
- package/dist/kernel/components/ui/mod-key.d.ts +10 -0
- package/dist/kernel/components/ui/mod-key.js +36 -0
- package/dist/kernel/components/ui/navigation-menu.js +2 -2
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +8 -8
- package/dist/kernel/components/ui/scroll-area.js +4 -4
- package/dist/kernel/components/ui/select.js +7 -10
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/theme-toggle.d.ts +3 -3
- package/dist/kernel/components/ui/theme-toggle.js +4 -9
- package/dist/kernel/defaults.registry.d.ts +9 -9
- package/dist/kernel/defaults.registry.js +9 -9
- package/dist/kernel/routes/agent/markdown.d.ts +0 -1
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.js +13 -9
- package/dist/kernel/routes/metadata/llms.d.ts +2 -1
- package/dist/kernel/routes/metadata/llms.js +4 -4
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +6 -3
- package/dist/kernel/routes/metadata/sitemap.js +48 -20
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +20 -12
- package/dist/kernel/routes/pages/leaf.d.ts +2 -2
- package/dist/kernel/routes/pages/leaf.js +20 -12
- package/dist/kernel/routes/pages/root.d.ts +2 -2
- package/dist/kernel/routes/pages/root.js +18 -12
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +47 -22
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/{types-CIwwieNw.d.ts → types-BzkZty3r.d.ts} +23 -3
- package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
- package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
- package/dist/types.d.ts +14 -6
- package/dist/validate-local-source-XRL2Y7XE.js +14 -0
- package/dist/validate-publish-os-source-DAPZ4QGE.js +12 -0
- package/init/seed/minimal/.gitignore +1 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +6 -10
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +1 -1
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +3 -7
- package/init/seed/minimal/publish.os/theme.css +52 -24
- package/init/seed/minimal/publish.os/tsconfig.json +3 -0
- package/init/seed/minimal/seed.json +4 -1
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
- package/init/seed/scratch/seed.json +5 -0
- package/package.json +12 -26
- package/release/app/phosphor/package.json +3 -3
- package/release/app/phosphor/pnpm-lock.yaml.template +523 -360
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +1 -1
- package/release/compiler/pnpm-lock.yaml.template +439 -286
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +7 -36
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
- package/dist/icons.d.ts +0 -1
- package/dist/icons.js +0 -2
- package/dist/kernel/components/mdx/components/pre.d.ts +0 -6
- package/dist/kernel/components/mdx/components/pre.js +0 -18
- package/dist/kernel/components/ui/meta-key.d.ts +0 -17
- package/dist/kernel/components/ui/meta-key.js +0 -9
- package/dist/kernel/framework-icons.d.ts +0 -1
- package/dist/kernel/framework-icons.js +0 -39
- package/dist/link-CYaCRDb6.d.ts +0 -35
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +0 -58
- package/dist/types-sM2g9nW0.d.ts +0 -12
- package/release/app/lucide/package.json +0 -30
- package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
- package/release/app/lucide/pnpm-workspace.yaml +0 -11
- package/release/app/tabler/package.json +0 -30
- package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
- package/release/app/tabler/pnpm-workspace.yaml +0 -11
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/mdx/code-block/copy-code-button.tsx
|
|
4
|
+
import { AnimatedIconSwap } from "@publish.os/nextjs/kernel/components/blocks/animated-icon-swap";
|
|
5
|
+
import { Button } from "@publish.os/nextjs/kernel/components/ui/button";
|
|
6
|
+
import { CheckIcon, CopyIcon } from "@phosphor-icons/react/ssr";
|
|
7
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function CopyCodeButton({
|
|
11
|
+
className,
|
|
12
|
+
code
|
|
13
|
+
}) {
|
|
14
|
+
let [copied, setCopied] = useState(!1), resetTimer = useRef(null);
|
|
15
|
+
useEffect(
|
|
16
|
+
() => () => {
|
|
17
|
+
resetTimer.current !== null && window.clearTimeout(resetTimer.current);
|
|
18
|
+
},
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
async function copy() {
|
|
22
|
+
try {
|
|
23
|
+
await navigator.clipboard.writeText(code), setCopied(!0), resetTimer.current !== null && window.clearTimeout(resetTimer.current), resetTimer.current = window.setTimeout(() => setCopied(!1), 2e3);
|
|
24
|
+
} catch {
|
|
25
|
+
setCopied(!1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
Button,
|
|
30
|
+
{
|
|
31
|
+
"aria-label": copied ? "Copied code" : "Copy code",
|
|
32
|
+
className: cn(
|
|
33
|
+
"relative z-content touch-manipulation after:absolute after:-inset-2 after:content-[''] motion-reduce:transition-none",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
"data-slot": "copy-code-button",
|
|
37
|
+
iconOnly: !0,
|
|
38
|
+
onClick: copy,
|
|
39
|
+
size: "sm",
|
|
40
|
+
type: "button",
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
AnimatedIconSwap,
|
|
45
|
+
{
|
|
46
|
+
active: copied,
|
|
47
|
+
activeIcon: /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true", size: 16 }),
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
defaultIcon: /* @__PURE__ */ jsx(CopyIcon, { "aria-hidden": "true", size: 16 }),
|
|
50
|
+
size: 16
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
CopyCodeButton
|
|
60
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/components/mdx/figure.tsx
|
|
1
|
+
// src/components/mdx/figure/figure.tsx
|
|
2
2
|
import { FigureCaption } from "@publish.os/nextjs/kernel/components/mdx/components/figure-caption";
|
|
3
3
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
4
|
import { Children, isValidElement } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/mdx/heading-copy-link.tsx
|
|
4
|
-
import {
|
|
4
|
+
import { LinkIcon } from "@phosphor-icons/react/ssr";
|
|
5
5
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
function headingCopyUrl({ href, id }) {
|
|
@@ -35,7 +35,7 @@ function HeadingCopyLink({
|
|
|
35
35
|
className
|
|
36
36
|
),
|
|
37
37
|
children: [
|
|
38
|
-
children ? /* @__PURE__ */ jsx("span", { className: "relative inline no-underline after:pointer-events-none after:absolute after:bottom-
|
|
38
|
+
children ? /* @__PURE__ */ jsx("span", { className: "relative inline no-underline after:pointer-events-none after:absolute after:bottom-(--link-underline-offset) after:left-0 after:h-(--link-underline-thickness) after:w-full after:rounded-inline-code after:bg-transparent after:transition-colors after:duration-100 after:ease-out after:content-[''] group-hover/heading-link:after:bg-[color-mix(in_oklch,currentColor_38%,transparent)] group-focus-visible/heading-link:after:bg-[color-mix(in_oklch,currentColor_38%,transparent)]", children }) : null,
|
|
39
39
|
/* @__PURE__ */ jsx(
|
|
40
40
|
"span",
|
|
41
41
|
{
|
|
@@ -44,7 +44,7 @@ function HeadingCopyLink({
|
|
|
44
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",
|
|
45
45
|
iconOnly ? "opacity-100" : "ml-1.5 opacity-0 group-hover/heading-link:opacity-100 group-focus-visible/heading-link:opacity-100"
|
|
46
46
|
),
|
|
47
|
-
children: /* @__PURE__ */ jsx(
|
|
47
|
+
children: /* @__PURE__ */ jsx(LinkIcon, { "aria-hidden": "true", className: "block size-[0.8em] shrink-0" })
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as react from 'react';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
declare function ImageZoom({ children, enabled, }: {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
enabled: boolean;
|
|
8
|
-
}): string | number | bigint | boolean |
|
|
8
|
+
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
9
9
|
|
|
10
10
|
export { ImageZoom };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/components/mdx/image.tsx
|
|
1
|
+
// src/components/mdx/image/image.tsx
|
|
2
2
|
import { FigureCaption } from "@publish.os/nextjs/kernel/components/mdx/components/figure-caption";
|
|
3
3
|
import { ImageZoom } from "@publish.os/nextjs/kernel/components/mdx/components/image-zoom";
|
|
4
4
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
@@ -12,6 +12,63 @@ function parseAspect(value) {
|
|
|
12
12
|
if (!(!width || !height || !Number.isFinite(width) || !Number.isFinite(height)))
|
|
13
13
|
return width / height;
|
|
14
14
|
}
|
|
15
|
+
function resolveImageLayout({
|
|
16
|
+
aspect,
|
|
17
|
+
fill,
|
|
18
|
+
height,
|
|
19
|
+
intrinsicHeight,
|
|
20
|
+
intrinsicWidth,
|
|
21
|
+
width
|
|
22
|
+
}) {
|
|
23
|
+
let resolvedWidth = width ?? intrinsicWidth, resolvedHeight = height ?? intrinsicHeight, resolvedAspect = parseAspect(aspect) ?? (resolvedWidth && resolvedHeight ? resolvedWidth / resolvedHeight : void 0), style = {
|
|
24
|
+
...resolvedAspect ? { aspectRatio: String(resolvedAspect) } : {},
|
|
25
|
+
width: fill ? "100%" : resolvedWidth ? `min(100%, ${resolvedWidth}px)` : "100%"
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
width: resolvedWidth,
|
|
29
|
+
height: resolvedHeight,
|
|
30
|
+
canOptimizeWithFill: !!(fill && resolvedAspect),
|
|
31
|
+
style
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function renderImage({
|
|
35
|
+
imageProps,
|
|
36
|
+
fill,
|
|
37
|
+
height,
|
|
38
|
+
optimized,
|
|
39
|
+
priority,
|
|
40
|
+
quality,
|
|
41
|
+
sizes,
|
|
42
|
+
width
|
|
43
|
+
}) {
|
|
44
|
+
if (optimized && (fill || width && height)) {
|
|
45
|
+
let maxWidth = fill ? "var(--publish-content-width, 72rem)" : `${width}px`;
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
NextImage,
|
|
48
|
+
{
|
|
49
|
+
...fill ? { fill } : { width, height },
|
|
50
|
+
priority,
|
|
51
|
+
quality,
|
|
52
|
+
sizes: sizes ?? `(max-width: 768px) 100vw, min(${maxWidth}, 100vw)`,
|
|
53
|
+
...imageProps
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
let { alt, ...nativeProps } = imageProps;
|
|
58
|
+
return (
|
|
59
|
+
// biome-ignore lint/performance/noImgElement: remote and dimensionless MDX images do not require Next image optimizer configuration.
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
"img",
|
|
62
|
+
{
|
|
63
|
+
alt,
|
|
64
|
+
height: optimized ? void 0 : height,
|
|
65
|
+
loading: priority ? "eager" : "lazy",
|
|
66
|
+
width: optimized ? void 0 : width,
|
|
67
|
+
...nativeProps
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
15
72
|
function Image({
|
|
16
73
|
alt,
|
|
17
74
|
aspect,
|
|
@@ -33,77 +90,41 @@ function Image({
|
|
|
33
90
|
...props
|
|
34
91
|
}) {
|
|
35
92
|
if (!src) return null;
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
93
|
+
let layout = resolveImageLayout({
|
|
94
|
+
aspect,
|
|
95
|
+
fill,
|
|
96
|
+
height,
|
|
97
|
+
intrinsicHeight,
|
|
98
|
+
intrinsicWidth,
|
|
99
|
+
width
|
|
100
|
+
}), imageAlt = decorative ? "" : alt ?? "", framed = frame !== !1 && frame !== "none", stringSrc = String(src), useNextImage = optimized && stringSrc.startsWith("/"), imageClassName = cn(
|
|
40
101
|
"block h-full w-full transition-opacity duration-200",
|
|
41
102
|
fill ? "object-cover" : "object-contain",
|
|
42
103
|
zoom && "cursor-zoom-in hover:opacity-90",
|
|
43
104
|
className
|
|
44
|
-
), image =
|
|
45
|
-
|
|
46
|
-
|
|
105
|
+
), image = renderImage({
|
|
106
|
+
fill: layout.canOptimizeWithFill,
|
|
107
|
+
height: layout.height,
|
|
108
|
+
optimized: useNextImage,
|
|
109
|
+
priority,
|
|
110
|
+
quality,
|
|
111
|
+
sizes,
|
|
112
|
+
width: layout.width,
|
|
113
|
+
imageProps: {
|
|
47
114
|
alt: imageAlt,
|
|
48
115
|
"aria-hidden": decorative || void 0,
|
|
49
116
|
className: imageClassName,
|
|
50
|
-
fill: !0,
|
|
51
|
-
priority,
|
|
52
|
-
quality,
|
|
53
|
-
sizes: sizes ?? "(max-width: 768px) 100vw, min(var(--publish-content-width, 72rem), 100vw)",
|
|
54
117
|
src: stringSrc,
|
|
55
118
|
...props
|
|
56
119
|
}
|
|
57
|
-
)
|
|
58
|
-
NextImage,
|
|
59
|
-
{
|
|
60
|
-
alt: imageAlt,
|
|
61
|
-
"aria-hidden": decorative || void 0,
|
|
62
|
-
className: imageClassName,
|
|
63
|
-
height: resolvedHeight,
|
|
64
|
-
priority,
|
|
65
|
-
quality,
|
|
66
|
-
sizes: sizes ?? `(max-width: 768px) 100vw, min(${resolvedWidth}px, 100vw)`,
|
|
67
|
-
src: stringSrc,
|
|
68
|
-
width: resolvedWidth,
|
|
69
|
-
...props
|
|
70
|
-
}
|
|
71
|
-
) : (
|
|
72
|
-
// biome-ignore lint/performance/noImgElement: remote and non-manifest images may not have dimensions available at runtime.
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
"img",
|
|
75
|
-
{
|
|
76
|
-
alt: imageAlt,
|
|
77
|
-
"aria-hidden": decorative || void 0,
|
|
78
|
-
className: imageClassName,
|
|
79
|
-
loading: priority ? "eager" : "lazy",
|
|
80
|
-
src: stringSrc,
|
|
81
|
-
...props
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
) : (
|
|
85
|
-
// biome-ignore lint/performance/noImgElement: MDX media supports generated project assets, SVGs, and remote CDN images without requiring Next image optimizer configuration.
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
"img",
|
|
88
|
-
{
|
|
89
|
-
alt: imageAlt,
|
|
90
|
-
"aria-hidden": decorative || void 0,
|
|
91
|
-
className: imageClassName,
|
|
92
|
-
height: resolvedHeight,
|
|
93
|
-
loading: priority ? "eager" : "lazy",
|
|
94
|
-
src: stringSrc,
|
|
95
|
-
width: resolvedWidth,
|
|
96
|
-
...props
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
), content = /* @__PURE__ */ jsx(
|
|
120
|
+
}), content = /* @__PURE__ */ jsx(
|
|
100
121
|
"div",
|
|
101
122
|
{
|
|
102
123
|
className: cn(
|
|
103
124
|
"relative mx-auto max-w-full overflow-hidden",
|
|
104
125
|
framed && "rounded-media border border-stroke-2 bg-surface-2"
|
|
105
126
|
),
|
|
106
|
-
style:
|
|
127
|
+
style: layout.style,
|
|
107
128
|
children: /* @__PURE__ */ jsx(ImageZoom, { enabled: zoom, children: image })
|
|
108
129
|
}
|
|
109
130
|
);
|
|
@@ -6,7 +6,7 @@ function InlineCode({ className, ...props }) {
|
|
|
6
6
|
"code",
|
|
7
7
|
{
|
|
8
8
|
className: cn(
|
|
9
|
-
"not-markdown-prose
|
|
9
|
+
"not-markdown-prose mx-[0.08em] inline-block rounded-inline-code bg-typography-code-surface px-[0.2em] py-[0.05em] font-mono text-[0.875em] font-normal leading-[1.4] text-typography-code-foreground in-[pre]:m-0 in-[pre]:bg-transparent in-[pre]:p-0 in-[pre]:text-[1em] in-[pre]:leading-[inherit] in-[pre]:text-inherit",
|
|
10
10
|
className
|
|
11
11
|
),
|
|
12
12
|
...props
|
|
@@ -9,7 +9,7 @@ declare const kbdVariants: (props?: ({
|
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
type KbdProps$1 = HTMLAttributes<HTMLElement> & VariantProps<typeof kbdVariants>;
|
|
11
11
|
|
|
12
|
-
type KbdProps = KbdProps$1
|
|
13
|
-
declare function Kbd(props: KbdProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
type KbdProps = Omit<KbdProps$1, "size">;
|
|
13
|
+
declare function Kbd({ className, ...props }: KbdProps): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
export { Kbd, type KbdProps };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// src/components/mdx/kbd.tsx
|
|
2
2
|
import { Kbd as UiKbd } from "@publish.os/nextjs/kernel/components/ui/kbd";
|
|
3
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
function Kbd(props) {
|
|
5
|
-
return /* @__PURE__ */ jsx(UiKbd, { ...props });
|
|
5
|
+
function Kbd({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(UiKbd, { ...props, size: null, className: cn("text-[0.75em]", className) });
|
|
6
7
|
}
|
|
7
8
|
export {
|
|
8
9
|
Kbd
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import 'class-variance-authority
|
|
4
|
-
import '
|
|
5
|
-
import 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { LinkProps as LinkProps$1 } from 'next/link';
|
|
5
|
+
import { ReactNode, AnchorHTMLAttributes } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
+
iconOnly?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
13
|
+
|
|
14
|
+
declare const linkVariants: (props?: ({
|
|
15
|
+
color?: "accent" | "default" | null | undefined;
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
17
|
+
variant?: "inline" | "standalone" | null | undefined;
|
|
18
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
19
|
+
type LinkVariantProps = VariantProps<typeof linkVariants>;
|
|
20
|
+
type LinkStyleVariant = NonNullable<LinkVariantProps["variant"]>;
|
|
21
|
+
type LinkButtonVariant = `button.${NonNullable<ButtonVariantProps["variant"]>}`;
|
|
22
|
+
type LinkVariant = `link.${LinkStyleVariant}` | LinkButtonVariant;
|
|
23
|
+
type NamedLinkColor = "accent" | "default";
|
|
24
|
+
type LinkColor = NamedLinkColor | (string & {});
|
|
25
|
+
type LinkProps = {
|
|
26
|
+
active?: boolean;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
color?: LinkColor;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
href?: string;
|
|
31
|
+
iconOnly?: ButtonVariantProps["iconOnly"];
|
|
32
|
+
leftIcon?: ReactNode;
|
|
33
|
+
prefetch?: LinkProps$1["prefetch"];
|
|
34
|
+
rightIcon?: ReactNode;
|
|
35
|
+
variant?: LinkVariant;
|
|
36
|
+
} & Omit<LinkVariantProps, "color" | "variant"> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "href">;
|
|
6
37
|
|
|
7
38
|
type MdxLinkProps = LinkProps;
|
|
8
39
|
declare function Link({ color, href, size, variant, ...props }: MdxLinkProps): react_jsx_runtime.JSX.Element;
|
|
@@ -18,10 +18,7 @@ function Paragraph({
|
|
|
18
18
|
return childArray.length === 1 && isBlockMediaChild(childArray[0]) ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(
|
|
19
19
|
"p",
|
|
20
20
|
{
|
|
21
|
-
className: cn(
|
|
22
|
-
"my-5 text-base leading-7 text-typography-body-foreground",
|
|
23
|
-
className
|
|
24
|
-
),
|
|
21
|
+
className: cn("my-5 text-typography-body-foreground", className),
|
|
25
22
|
...props,
|
|
26
23
|
children
|
|
27
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/components/mdx/video-player.tsx
|
|
3
|
+
// src/components/mdx/video/video-player.tsx
|
|
4
4
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
5
5
|
import { usePathname } from "next/navigation";
|
|
6
6
|
import { useCallback, useEffect, useId, useState } from "react";
|
|
@@ -102,7 +102,7 @@ function VideoPlayer({
|
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": !0, className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ jsx("span", { className: "border-shadow-3 flex size-14 items-center justify-center rounded-full border border-media-control-stroke bg-media-control-surface text-media-control-foreground transition-transform duration-200 group-hover:scale-105", children: /* @__PURE__ */ jsx("span", { className: "ml-1 block h-0 w-0 border-y-[9px] border-y-transparent border-l-
|
|
105
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": !0, className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ jsx("span", { className: "border-shadow-3 flex size-14 items-center justify-center rounded-full border border-media-control-stroke bg-media-control-surface text-media-control-foreground transition-transform duration-200 group-hover:scale-105", children: /* @__PURE__ */ jsx("span", { className: "ml-1 block h-0 w-0 border-y-[9px] border-y-transparent border-l-14 border-l-current" }) }) })
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { MDXComponents } from './types.js';
|
|
3
|
+
import { P as PageData } from '../../../types-CJWRG05y.js';
|
|
3
4
|
import { ReactNode, AnchorHTMLAttributes } from 'react';
|
|
4
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
-
import {
|
|
6
|
+
import { a as ButtonVariantProps } from '../../../button-c3WGnxIj.js';
|
|
6
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
|
+
import { LinkProps as LinkProps$1 } from 'next/link';
|
|
7
9
|
import 'mdx/types.js';
|
|
8
10
|
|
|
9
11
|
type FigureProps = React.ComponentPropsWithoutRef<"figure"> & {
|
|
@@ -31,7 +33,7 @@ type ImageProps = Omit<React.ComponentPropsWithoutRef<"img">, "height" | "sizes"
|
|
|
31
33
|
declare function Image({ alt, aspect, caption, className, decorative, fill, frame, height, intrinsicHeight, intrinsicWidth, optimized, priority, quality, sizes, src, width, zoom, ...props }: ImageProps): react_jsx_runtime.JSX.Element | null;
|
|
32
34
|
|
|
33
35
|
declare const linkVariants: (props?: ({
|
|
34
|
-
color?: "
|
|
36
|
+
color?: "default" | "accent" | null | undefined;
|
|
35
37
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
36
38
|
variant?: "inline" | "standalone" | null | undefined;
|
|
37
39
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -49,6 +51,7 @@ type LinkProps = {
|
|
|
49
51
|
href?: string;
|
|
50
52
|
iconOnly?: ButtonVariantProps["iconOnly"];
|
|
51
53
|
leftIcon?: ReactNode;
|
|
54
|
+
prefetch?: LinkProps$1["prefetch"];
|
|
52
55
|
rightIcon?: ReactNode;
|
|
53
56
|
variant?: LinkVariant;
|
|
54
57
|
} & Omit<LinkVariantProps, "color" | "variant"> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "href">;
|
|
@@ -70,10 +73,11 @@ declare function Video({ caption, className, frame, height, poster, src, title,
|
|
|
70
73
|
|
|
71
74
|
type MDXProps = {
|
|
72
75
|
components?: MDXComponents;
|
|
73
|
-
|
|
74
|
-
pageId?: string;
|
|
75
|
-
slug?: string;
|
|
76
|
+
page: PageData;
|
|
76
77
|
};
|
|
77
|
-
declare function
|
|
78
|
+
declare function renderMdx({ components, page, siteComponents, }: MDXProps & {
|
|
79
|
+
siteComponents?: MDXComponents;
|
|
80
|
+
}): Promise<react_jsx_runtime.JSX.Element>;
|
|
81
|
+
declare function MDX(props: MDXProps): Promise<react_jsx_runtime.JSX.Element>;
|
|
78
82
|
|
|
79
|
-
export { Figure, Image, Link, MDX, MDXComponents, type MDXProps, Video };
|
|
83
|
+
export { Figure, Image, Link, MDX, MDXComponents, type MDXProps, Video, renderMdx };
|