@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
- package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
- package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
- package/compiler-assets/nextjs/shims/document.tsx +46 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
- package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
- package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
- package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
- package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
- package/compiler-assets/nextjs/shims/proxy.ts +254 -86
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
- package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
- package/dist/{build-operation-2JAYBSKF.js → build-operation-CJDUL4OW.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-3T4HVDSC.js +426 -0
- package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
- package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
- package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
- package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
- package/dist/chunk-DX7PXFCM.js +2519 -0
- package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +111 -23
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +563 -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 +4 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-44GJSMXD.js +16 -0
- package/dist/config/createNextConfig.js +19 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-TG74L4FF.js +16 -0
- package/dist/index.d.ts +151 -95
- package/dist/index.js +25 -0
- 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 +37 -8
- package/dist/kernel/components/blocks/AgentActions.js +384 -174
- package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
- package/dist/kernel/components/blocks/agent-actions.js +563 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +79 -59
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +30 -7
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +32 -9
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +13 -3
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +137 -28
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- package/dist/kernel/components/blocks/theme-toggle.js +5 -5
- package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
- package/dist/kernel/components/blocks/toc-client.js +495 -0
- package/dist/kernel/components/blocks/toc.d.ts +20 -2
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +22 -17
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +6 -6
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -4
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +57 -16
- package/dist/kernel/components/mdx/mdx.js +232 -35
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/next-image.d.ts +12 -0
- package/dist/kernel/components/next-image.js +61 -0
- package/dist/kernel/components/ui/accordion.d.ts +7 -7
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +6 -6
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +59 -7
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- package/dist/kernel/components/ui/drawer.js +1 -1
- package/dist/kernel/components/ui/input.d.ts +2 -2
- package/dist/kernel/components/ui/input.js +1 -1
- package/dist/kernel/components/ui/kbd.d.ts +4 -4
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +11 -5
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
- package/dist/kernel/components/ui/scroll-area.js +1 -1
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +4 -17
- package/dist/kernel/defaults.registry.js +4 -19
- package/dist/kernel/routes/agent/markdown.d.ts +7 -0
- package/dist/kernel/routes/agent/markdown.js +229 -54
- 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 -2
- package/dist/kernel/routes/metadata/feed.js +119 -88
- package/dist/kernel/routes/metadata/llms.d.ts +3 -23
- package/dist/kernel/routes/metadata/llms.js +2 -103
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +5 -3
- package/dist/kernel/routes/metadata/robots.js +4 -25
- package/dist/kernel/routes/metadata/sitemap.d.ts +36 -3
- package/dist/kernel/routes/metadata/sitemap.js +277 -49
- 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 +5 -5
- package/dist/kernel/routes/pages/group.js +11 -5
- package/dist/kernel/routes/pages/leaf.d.ts +38 -6
- package/dist/kernel/routes/pages/leaf.js +21 -12
- package/dist/kernel/routes/pages/root.d.ts +5 -5
- package/dist/kernel/routes/pages/root.js +21 -6
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +65 -35
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +2 -9
- package/dist/search.js +9 -16
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/theme-scope.js +1 -1
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +117 -91
- 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-EN2GW4FR.js +16 -0
- package/dist/validate-publish-os-source-OEWQDB7B.js +14 -0
- package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
- package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
- package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
- package/init/seed/minimal/publish.os/blog/index.tsx +85 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
- package/init/seed/minimal/publish.os/publish.os.config.json +17 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +12 -4
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +48 -23
- package/release/app/phosphor/package.json +4 -4
- package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +153 -183
- package/release/release.json +6 -6
- package/dist/button-CtzUJB8u.d.ts +0 -11
- package/dist/chunk-535TM4A5.js +0 -1455
- package/dist/chunk-B2V22WRT.js +0 -297
- package/dist/chunk-NECL5IBJ.js +0 -318
- package/dist/chunk-SVYGXXYR.js +0 -36
- package/dist/chunk-UF6ATARM.js +0 -1100
- package/dist/compose-NN23UJGC.js +0 -13
- package/dist/ide-support-ZNW7ODFY.js +0 -15
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -667
- package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/link-playground.js +0 -744
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -53
- package/dist/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-BzkZty3r.d.ts +0 -147
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- package/dist/validate-local-source-XRL2Y7XE.js +0 -14
- package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
- package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// src/components/mdx/mdx.tsx
|
|
2
|
-
import { Blockquote } from "@
|
|
3
|
-
import { Callout } from "@
|
|
4
|
-
import { CodeBlock } from "@
|
|
5
|
-
import { Figure } from "@
|
|
6
|
-
import { FigureCaption } from "@
|
|
7
|
-
import { Footnotes } from "@
|
|
8
|
-
import { Heading } from "@
|
|
9
|
-
import { Hr } from "@
|
|
10
|
-
import { Image } from "@
|
|
11
|
-
import { InlineCode } from "@
|
|
12
|
-
import { Kbd } from "@
|
|
13
|
-
import { Link } from "@
|
|
14
|
-
import { Paragraph } from "@
|
|
15
|
-
import { Strikethrough } from "@
|
|
2
|
+
import { Blockquote } from "@components/mdx/components/blockquote";
|
|
3
|
+
import { Callout } from "@components/mdx/components/callout";
|
|
4
|
+
import { CodeBlock } from "@components/mdx/components/code-block";
|
|
5
|
+
import { Figure } from "@components/mdx/components/figure";
|
|
6
|
+
import { FigureCaption } from "@components/mdx/components/figure-caption";
|
|
7
|
+
import { Footnotes } from "@components/mdx/components/footnotes";
|
|
8
|
+
import { Heading } from "@components/mdx/components/heading";
|
|
9
|
+
import { Hr } from "@components/mdx/components/hr";
|
|
10
|
+
import { Image } from "@components/mdx/components/image";
|
|
11
|
+
import { InlineCode } from "@components/mdx/components/inline-code";
|
|
12
|
+
import { Kbd } from "@components/mdx/components/kbd";
|
|
13
|
+
import { Link } from "@components/mdx/components/link";
|
|
14
|
+
import { Paragraph } from "@components/mdx/components/paragraph";
|
|
15
|
+
import { Strikethrough } from "@components/mdx/components/strikethrough";
|
|
16
16
|
import {
|
|
17
17
|
Table,
|
|
18
18
|
TableBodyGroup,
|
|
@@ -20,20 +20,20 @@ import {
|
|
|
20
20
|
TableHeaderCell,
|
|
21
21
|
TableHeadGroup,
|
|
22
22
|
TableRowGroup
|
|
23
|
-
} from "@
|
|
24
|
-
import { TaskList, TaskListInput } from "@
|
|
25
|
-
import { Video } from "@
|
|
26
|
-
import { MDXErrorBoundary } from "@
|
|
27
|
-
import { rehypeHeadingIds } from "@
|
|
23
|
+
} from "@components/mdx/components/table";
|
|
24
|
+
import { TaskList, TaskListInput } from "@components/mdx/components/task-list";
|
|
25
|
+
import { Video } from "@components/mdx/components/video";
|
|
26
|
+
import { MDXErrorBoundary } from "@components/mdx/error-boundary";
|
|
27
|
+
import { rehypeHeadingIds } from "@components/mdx/rehype-heading-ids";
|
|
28
28
|
import { compileMDX } from "next-mdx-remote/rsc";
|
|
29
29
|
import remarkGfm from "remark-gfm";
|
|
30
30
|
|
|
31
31
|
// src/components/mdx/mod-key.tsx
|
|
32
32
|
import {
|
|
33
33
|
ModKey as UiModKey
|
|
34
|
-
} from "@
|
|
34
|
+
} from "@components/ui/mod-key";
|
|
35
35
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
36
|
-
import { jsx } from "
|
|
36
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
37
37
|
function ModKey({ className, ...props }) {
|
|
38
38
|
return /* @__PURE__ */ jsx(
|
|
39
39
|
UiModKey,
|
|
@@ -45,6 +45,19 @@ function ModKey({ className, ...props }) {
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// src/components/mdx/plugins/remark-code-elements.ts
|
|
49
|
+
function remarkCodeElements() {
|
|
50
|
+
return (tree) => {
|
|
51
|
+
function visit(node, insidePre = !1) {
|
|
52
|
+
if ((node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name === "code" && !insidePre && node.data && Reflect.deleteProperty(node.data, "_mdxExplicitJsx"), "children" in node) {
|
|
53
|
+
let childInsidePre = insidePre || (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name === "pre";
|
|
54
|
+
for (let child of node.children) visit(child, childInsidePre);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
visit(tree);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
// src/components/mdx/plugins/remark-code-title.ts
|
|
49
62
|
function remarkCodeTitle() {
|
|
50
63
|
return (tree) => {
|
|
@@ -63,6 +76,29 @@ function remarkCodeTitle() {
|
|
|
63
76
|
};
|
|
64
77
|
}
|
|
65
78
|
|
|
79
|
+
// src/components/mdx/plugins/remark-component-references.ts
|
|
80
|
+
function remarkComponentReferences({
|
|
81
|
+
components,
|
|
82
|
+
pagePath
|
|
83
|
+
}) {
|
|
84
|
+
return () => (tree) => {
|
|
85
|
+
function visit(node) {
|
|
86
|
+
if ((node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name && /^[A-Z]/.test(node.name)) {
|
|
87
|
+
let rootName = node.name.split(".")[0];
|
|
88
|
+
if (rootName && !components[rootName]) {
|
|
89
|
+
let file = rootName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), position = node.position?.start;
|
|
90
|
+
throw new Error(
|
|
91
|
+
`Undefined MDX component "${rootName}" on page "${pagePath}"` + (position ? ` (body line ${position.line}, column ${position.column})` : "") + (rootName.endsWith("Icon") ? `. For a Phosphor icon, use import { ${rootName} } from "@phosphor-icons/react/ssr".` : `. Add publish.os/components/mdx/${file}.tsx with a named ${rootName} export, or supply it through the MDX components prop.`)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if ("children" in node)
|
|
96
|
+
for (let child of node.children) visit(child);
|
|
97
|
+
}
|
|
98
|
+
visit(tree);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
66
102
|
// src/components/mdx/plugins/remark-keyboard-input.ts
|
|
67
103
|
function remarkKeyboardInput() {
|
|
68
104
|
return (tree) => {
|
|
@@ -74,12 +110,160 @@ function remarkKeyboardInput() {
|
|
|
74
110
|
};
|
|
75
111
|
}
|
|
76
112
|
|
|
113
|
+
// src/components/mdx/plugins/remark-media-elements.ts
|
|
114
|
+
var mediaElements = /* @__PURE__ */ new Set(["img", "figure", "figcaption"]);
|
|
115
|
+
function remarkMediaElements() {
|
|
116
|
+
return (tree) => {
|
|
117
|
+
function visit(node) {
|
|
118
|
+
if ((node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") && node.name && mediaElements.has(node.name) && node.data && Reflect.deleteProperty(node.data, "_mdxExplicitJsx"), "children" in node)
|
|
119
|
+
for (let child of node.children) visit(child);
|
|
120
|
+
}
|
|
121
|
+
visit(tree);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/lib/hosting/framework-paths.ts
|
|
126
|
+
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`;
|
|
127
|
+
var 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).*)`;
|
|
128
|
+
|
|
129
|
+
// src/lib/assets/map-source-asset-url.ts
|
|
130
|
+
var SOURCE_ASSET_PATH = "/assets/", URL_PROPS = [
|
|
131
|
+
"action",
|
|
132
|
+
"cite",
|
|
133
|
+
"data",
|
|
134
|
+
"formAction",
|
|
135
|
+
"href",
|
|
136
|
+
"poster",
|
|
137
|
+
"src",
|
|
138
|
+
"xlinkHref"
|
|
139
|
+
];
|
|
140
|
+
function hasUnsafeControlCharacters(value) {
|
|
141
|
+
for (let character of value) {
|
|
142
|
+
let code = character.codePointAt(0) ?? 0;
|
|
143
|
+
if (code <= 31 || code >= 127 && code <= 159) return !0;
|
|
144
|
+
}
|
|
145
|
+
return !1;
|
|
146
|
+
}
|
|
147
|
+
function assertSafeAssetPath(path) {
|
|
148
|
+
if (path.includes("\\") || hasUnsafeControlCharacters(path))
|
|
149
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
150
|
+
for (let segment of path.split("/")) {
|
|
151
|
+
if (!segment)
|
|
152
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
153
|
+
let decoded;
|
|
154
|
+
try {
|
|
155
|
+
decoded = decodeURIComponent(segment);
|
|
156
|
+
} catch {
|
|
157
|
+
throw new TypeError("Local asset URLs must use valid URL encoding.");
|
|
158
|
+
}
|
|
159
|
+
if (decoded === "." || decoded === ".." || decoded.includes("/") || decoded.includes("\\") || hasUnsafeControlCharacters(decoded))
|
|
160
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function mapSourceAssetUrl(value) {
|
|
164
|
+
if (typeof value != "string" || !value.startsWith(SOURCE_ASSET_PATH))
|
|
165
|
+
return value;
|
|
166
|
+
let suffixIndex = value.search(/[?#]/u), pathname = suffixIndex < 0 ? value : value.slice(0, suffixIndex), suffix = suffixIndex < 0 ? "" : value.slice(suffixIndex), path = pathname.slice(SOURCE_ASSET_PATH.length);
|
|
167
|
+
return assertSafeAssetPath(path), `${SOURCE_ASSET_PREFIX}/${path}${suffix}`;
|
|
168
|
+
}
|
|
169
|
+
function mapSourceSet(value) {
|
|
170
|
+
let candidates = [], cursor = 0;
|
|
171
|
+
for (; cursor < value.length; ) {
|
|
172
|
+
for (; cursor < value.length && /[\s,]/u.test(value[cursor] ?? ""); )
|
|
173
|
+
cursor += 1;
|
|
174
|
+
if (cursor >= value.length) break;
|
|
175
|
+
let start = cursor;
|
|
176
|
+
for (; cursor < value.length && !/\s/u.test(value[cursor] ?? ""); )
|
|
177
|
+
cursor += 1;
|
|
178
|
+
let url = value.slice(start, cursor), endsCandidate = url.endsWith(",");
|
|
179
|
+
endsCandidate && (url = url.replace(/,+$/u, ""));
|
|
180
|
+
let mapped = String(mapSourceAssetUrl(url));
|
|
181
|
+
if (endsCandidate) {
|
|
182
|
+
candidates.push(mapped);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
for (; cursor < value.length && /\s/u.test(value[cursor] ?? ""); )
|
|
186
|
+
cursor += 1;
|
|
187
|
+
let descriptorStart = cursor;
|
|
188
|
+
for (; cursor < value.length && value[cursor] !== ","; ) cursor += 1;
|
|
189
|
+
let descriptor = value.slice(descriptorStart, cursor).trim();
|
|
190
|
+
candidates.push(descriptor ? `${mapped} ${descriptor}` : mapped), value[cursor] === "," && (cursor += 1);
|
|
191
|
+
}
|
|
192
|
+
return candidates.join(", ");
|
|
193
|
+
}
|
|
194
|
+
function mapSourceAssetProps(props) {
|
|
195
|
+
if (!props || typeof props != "object") return props;
|
|
196
|
+
let source = props, mapped;
|
|
197
|
+
for (let name of URL_PROPS) {
|
|
198
|
+
let value = source[name], next = mapSourceAssetUrl(value);
|
|
199
|
+
next !== value && (mapped ??= { ...source }, mapped[name] = next);
|
|
200
|
+
}
|
|
201
|
+
if (typeof source.srcSet == "string") {
|
|
202
|
+
let next = mapSourceSet(source.srcSet);
|
|
203
|
+
next !== source.srcSet && (mapped ??= { ...source }, mapped.srcSet = next);
|
|
204
|
+
}
|
|
205
|
+
return mapped ?? props;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/lib/assets/remark-map-source-assets.ts
|
|
209
|
+
var imageBooleanAttributes = /* @__PURE__ */ new Set([
|
|
210
|
+
"decorative",
|
|
211
|
+
"fill",
|
|
212
|
+
"frame",
|
|
213
|
+
"optimized",
|
|
214
|
+
"priority",
|
|
215
|
+
"zoom"
|
|
216
|
+
]);
|
|
217
|
+
function preserveImageControlLiteral(node) {
|
|
218
|
+
if (!(node.name !== "Image" && node.name !== "img" || !node.attributes))
|
|
219
|
+
for (let attribute of node.attributes) {
|
|
220
|
+
if (attribute.type !== "mdxJsxAttribute" || !attribute.value || typeof attribute.value != "object")
|
|
221
|
+
continue;
|
|
222
|
+
let expression = attribute.value.value;
|
|
223
|
+
if (typeof expression != "string") continue;
|
|
224
|
+
let value = expression.trim();
|
|
225
|
+
if (imageBooleanAttributes.has(attribute.name ?? "") && (value === "true" || value === "false")) {
|
|
226
|
+
attribute.value = value;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
let isPositiveNumber = (candidate) => {
|
|
230
|
+
let number = Number(candidate);
|
|
231
|
+
return candidate !== "" && Number.isFinite(number) && number > 0;
|
|
232
|
+
}, unquotedValue = value.replace(/^(?:"(.*)"|'(.*)')$/u, "$1$2"), ratio = unquotedValue.match(
|
|
233
|
+
/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/u
|
|
234
|
+
), isPositiveAspect = isPositiveNumber(unquotedValue) || ratio !== null && Number(ratio[1]) > 0 && Number(ratio[2]) > 0;
|
|
235
|
+
(attribute.name === "width" || attribute.name === "height") && /^\d+$/u.test(value) && isPositiveNumber(value) && Number.isSafeInteger(Number(value)) ? attribute.value = value : attribute.name === "aspect" && isPositiveAspect && (attribute.value = unquotedValue);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function mapAttribute(node) {
|
|
239
|
+
if (preserveImageControlLiteral(node), (node.type === "image" || node.type === "link" || node.type === "definition") && typeof node.url == "string") {
|
|
240
|
+
let prop = node.type === "image" ? "src" : "href", props = mapSourceAssetProps({ [prop]: node.url });
|
|
241
|
+
typeof props[prop] == "string" && (node.url = props[prop]);
|
|
242
|
+
}
|
|
243
|
+
for (let attribute of node.attributes ?? []) {
|
|
244
|
+
if (attribute.type !== "mdxJsxAttribute" || typeof attribute.value != "string")
|
|
245
|
+
continue;
|
|
246
|
+
let mapped = mapSourceAssetProps({
|
|
247
|
+
[attribute.name ?? ""]: attribute.value
|
|
248
|
+
});
|
|
249
|
+
attribute.name && typeof mapped[attribute.name] == "string" && (attribute.value = mapped[attribute.name]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function remarkMapSourceAssets() {
|
|
253
|
+
return (tree) => {
|
|
254
|
+
let visit = (node) => {
|
|
255
|
+
mapAttribute(node), node.children?.forEach(visit);
|
|
256
|
+
};
|
|
257
|
+
visit(tree);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
77
261
|
// src/components/mdx/mdx.tsx
|
|
78
|
-
import { Figure as Figure2 } from "@
|
|
79
|
-
import { Image as Image2 } from "@
|
|
80
|
-
import { Link as Link2 } from "@
|
|
81
|
-
import { Video as Video2 } from "@
|
|
82
|
-
import { jsx as jsx2 } from "
|
|
262
|
+
import { Figure as Figure2 } from "@components/mdx/components/figure";
|
|
263
|
+
import { Image as Image2 } from "@components/mdx/components/image";
|
|
264
|
+
import { Link as Link2 } from "@components/mdx/components/link";
|
|
265
|
+
import { Video as Video2 } from "@components/mdx/components/video";
|
|
266
|
+
import { jsx as jsx2 } from "@publish.os/nextjs/jsx-runtime";
|
|
83
267
|
var defaultMdxComponents = {
|
|
84
268
|
h1: (props) => /* @__PURE__ */ jsx2(Heading, { as: "h1", ...props }),
|
|
85
269
|
h2: (props) => /* @__PURE__ */ jsx2(Heading, { as: "h2", ...props }),
|
|
@@ -138,20 +322,33 @@ function getErrorMessage(error) {
|
|
|
138
322
|
async function renderMdx({
|
|
139
323
|
components,
|
|
140
324
|
page,
|
|
141
|
-
siteComponents
|
|
325
|
+
siteComponents,
|
|
326
|
+
importedComponents
|
|
142
327
|
}) {
|
|
143
|
-
let
|
|
328
|
+
let selectedComponents = {
|
|
329
|
+
...defaultMdxComponents,
|
|
330
|
+
...siteComponents ?? {},
|
|
331
|
+
...components ?? {},
|
|
332
|
+
...importedComponents ?? {}
|
|
333
|
+
}, mdx = await compileMDX({
|
|
144
334
|
source: page.body,
|
|
145
|
-
components:
|
|
146
|
-
...defaultMdxComponents,
|
|
147
|
-
...siteComponents ?? {},
|
|
148
|
-
...components ?? {}
|
|
149
|
-
},
|
|
335
|
+
components: selectedComponents,
|
|
150
336
|
options: {
|
|
151
337
|
parseFrontmatter: !1,
|
|
152
338
|
mdxOptions: {
|
|
153
339
|
rehypePlugins: [rehypeHeadingIds],
|
|
154
|
-
remarkPlugins: [
|
|
340
|
+
remarkPlugins: [
|
|
341
|
+
remarkGfm,
|
|
342
|
+
remarkCodeTitle,
|
|
343
|
+
remarkKeyboardInput,
|
|
344
|
+
remarkCodeElements,
|
|
345
|
+
remarkMediaElements,
|
|
346
|
+
remarkMapSourceAssets,
|
|
347
|
+
remarkComponentReferences({
|
|
348
|
+
components: selectedComponents,
|
|
349
|
+
pagePath: page.path
|
|
350
|
+
})
|
|
351
|
+
]
|
|
155
352
|
}
|
|
156
353
|
}
|
|
157
354
|
}).then(({ content: compiledContent }) => ({
|
|
@@ -166,7 +363,7 @@ async function renderMdx({
|
|
|
166
363
|
{
|
|
167
364
|
errorMessage: mdx.errorMessage,
|
|
168
365
|
pageId: page.fileID,
|
|
169
|
-
slug: page.slug,
|
|
366
|
+
slug: page.frontmatter.slug,
|
|
170
367
|
children: /* @__PURE__ */ jsx2("div", { className: "markdown-prose", children: mdx.compiledContent })
|
|
171
368
|
}
|
|
172
369
|
);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "@publish.os/nextjs/utils/heading-ids";
|
|
6
6
|
var HEADING_TAG_RE = /^h[1-6]$/;
|
|
7
7
|
function textFromNode(node) {
|
|
8
|
-
return node.type === "text" || node.type === "inlineCode" ? typeof node.value == "string" ? node.value : "" : node.children ? node.children.map(textFromNode).join("") : "";
|
|
8
|
+
return node.type === "text" || node.type === "inlineCode" ? typeof node.value == "string" ? node.value : "" : node.tagName === "img" ? typeof node.properties?.alt == "string" ? node.properties.alt : "" : node.tagName === "br" || node.name === "br" ? " " : node.children ? node.children.map(textFromNode).join("") : "";
|
|
9
9
|
}
|
|
10
10
|
function visit(node, callback) {
|
|
11
11
|
callback(node);
|
|
@@ -17,8 +17,10 @@ function rehypeHeadingIds() {
|
|
|
17
17
|
let headingId = createHeadingIdGenerator();
|
|
18
18
|
visit(tree, (node) => {
|
|
19
19
|
if (!node.tagName || !HEADING_TAG_RE.test(node.tagName)) return;
|
|
20
|
-
let text = cleanHeadingText(textFromNode(node))
|
|
21
|
-
!text
|
|
20
|
+
let text = cleanHeadingText(textFromNode(node));
|
|
21
|
+
if (!text) return;
|
|
22
|
+
let id = headingId(text);
|
|
23
|
+
id !== "empty-heading" && (node.properties = {
|
|
22
24
|
...node.properties,
|
|
23
25
|
id
|
|
24
26
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MDXComponents as MDXComponents$1 } from 'mdx/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type MDXComponents = MDXComponents$1;
|
|
5
5
|
type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import NextImage, { getImageProps as getImageProps$1 } from 'next/dist/shared/lib/image-external';
|
|
4
|
+
export { ImageProps } from 'next/image';
|
|
5
|
+
|
|
6
|
+
type NextImageComponentProps = ComponentProps<typeof NextImage>;
|
|
7
|
+
/** Keep the helper callable from server and client components. */
|
|
8
|
+
declare function getImageProps(props: Parameters<typeof getImageProps$1>[0]): ReturnType<typeof getImageProps$1>;
|
|
9
|
+
/** Keep remote image URLs direct while preserving Next.js behavior for local assets. */
|
|
10
|
+
declare function PublishOsNextImage(props: NextImageComponentProps): react.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { PublishOsNextImage as default, getImageProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/components/next-image.tsx
|
|
2
|
+
import NextImage, {
|
|
3
|
+
getImageProps as nextGetImageProps
|
|
4
|
+
} from "next/dist/shared/lib/image-external";
|
|
5
|
+
|
|
6
|
+
// src/lib/hosting/framework-paths.ts
|
|
7
|
+
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`;
|
|
8
|
+
var 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).*)`;
|
|
9
|
+
|
|
10
|
+
// src/lib/assets/map-source-asset-url.ts
|
|
11
|
+
var SOURCE_ASSET_PATH = "/assets/";
|
|
12
|
+
function hasUnsafeControlCharacters(value) {
|
|
13
|
+
for (let character of value) {
|
|
14
|
+
let code = character.codePointAt(0) ?? 0;
|
|
15
|
+
if (code <= 31 || code >= 127 && code <= 159) return !0;
|
|
16
|
+
}
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
function assertSafeAssetPath(path) {
|
|
20
|
+
if (path.includes("\\") || hasUnsafeControlCharacters(path))
|
|
21
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
22
|
+
for (let segment of path.split("/")) {
|
|
23
|
+
if (!segment)
|
|
24
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
25
|
+
let decoded;
|
|
26
|
+
try {
|
|
27
|
+
decoded = decodeURIComponent(segment);
|
|
28
|
+
} catch {
|
|
29
|
+
throw new TypeError("Local asset URLs must use valid URL encoding.");
|
|
30
|
+
}
|
|
31
|
+
if (decoded === "." || decoded === ".." || decoded.includes("/") || decoded.includes("\\") || hasUnsafeControlCharacters(decoded))
|
|
32
|
+
throw new TypeError("Local asset URLs must use safe path segments.");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function mapSourceAssetUrl(value) {
|
|
36
|
+
if (typeof value != "string" || !value.startsWith(SOURCE_ASSET_PATH))
|
|
37
|
+
return value;
|
|
38
|
+
let suffixIndex = value.search(/[?#]/u), pathname = suffixIndex < 0 ? value : value.slice(0, suffixIndex), suffix = suffixIndex < 0 ? "" : value.slice(suffixIndex), path = pathname.slice(SOURCE_ASSET_PATH.length);
|
|
39
|
+
return assertSafeAssetPath(path), `${SOURCE_ASSET_PREFIX}/${path}${suffix}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/components/next-image.tsx
|
|
43
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
44
|
+
function resolveImageProps(props) {
|
|
45
|
+
let remote = typeof props.src == "string" && /^https?:\/\//iu.test(props.src);
|
|
46
|
+
return {
|
|
47
|
+
...props,
|
|
48
|
+
src: mapSourceAssetUrl(props.src),
|
|
49
|
+
unoptimized: remote || props.unoptimized
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function getImageProps(props) {
|
|
53
|
+
return nextGetImageProps(resolveImageProps(props));
|
|
54
|
+
}
|
|
55
|
+
function PublishOsNextImage(props) {
|
|
56
|
+
return /* @__PURE__ */ jsx(NextImage, { ...resolveImageProps(props) });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
PublishOsNextImage as default,
|
|
60
|
+
getImageProps
|
|
61
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
|
|
1
|
+
import * as react from 'react';
|
|
3
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
|
|
4
4
|
|
|
5
5
|
type AccordionProps = ComponentPropsWithoutRef<typeof Accordion$1.Root>;
|
|
6
6
|
type AccordionItemProps = ComponentPropsWithoutRef<typeof Accordion$1.Item>;
|
|
7
7
|
type AccordionHeaderProps = ComponentPropsWithoutRef<typeof Accordion$1.Header>;
|
|
8
8
|
type AccordionTriggerProps = ComponentPropsWithoutRef<typeof Accordion$1.Trigger>;
|
|
9
9
|
type AccordionPanelProps = ComponentPropsWithoutRef<typeof Accordion$1.Panel>;
|
|
10
|
-
declare function Accordion(props: AccordionProps):
|
|
11
|
-
declare function AccordionItem({ className, ...props }: AccordionItemProps):
|
|
12
|
-
declare function AccordionHeader({ className, ...props }: AccordionHeaderProps):
|
|
13
|
-
declare function AccordionTrigger({ className, ...props }: AccordionTriggerProps):
|
|
14
|
-
declare function AccordionPanel({ className, ...props }: AccordionPanelProps):
|
|
10
|
+
declare function Accordion(props: AccordionProps): react.JSX.Element;
|
|
11
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): react.JSX.Element;
|
|
12
|
+
declare function AccordionHeader({ className, ...props }: AccordionHeaderProps): react.JSX.Element;
|
|
13
|
+
declare function AccordionTrigger({ className, ...props }: AccordionTriggerProps): react.JSX.Element;
|
|
14
|
+
declare function AccordionPanel({ className, ...props }: AccordionPanelProps): react.JSX.Element;
|
|
15
15
|
|
|
16
16
|
export { Accordion, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/components/ui/accordion.tsx
|
|
4
4
|
import { Accordion as BaseAccordion } from "@base-ui/react/accordion";
|
|
5
5
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
6
|
-
import { jsx } from "
|
|
6
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
7
7
|
function Accordion(props) {
|
|
8
8
|
return /* @__PURE__ */ jsx(BaseAccordion.Root, { ...props });
|
|
9
9
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { BreadcrumbTrailProps } from './breadcrumb.js';
|
|
3
3
|
import 'class-variance-authority/types';
|
|
4
|
-
import '
|
|
4
|
+
import './button.js';
|
|
5
5
|
import 'class-variance-authority';
|
|
6
6
|
import 'next/link';
|
|
7
|
-
import 'react';
|
|
8
7
|
|
|
9
8
|
type CollapsibleBreadcrumbTrailProps = BreadcrumbTrailProps & {
|
|
10
9
|
menuLabel?: string;
|
|
11
10
|
};
|
|
12
|
-
declare function CollapsibleBreadcrumbTrail({ className, items, menuLabel, size, variant, }: CollapsibleBreadcrumbTrailProps):
|
|
11
|
+
declare function CollapsibleBreadcrumbTrail({ className, items, menuLabel, size, variant, }: CollapsibleBreadcrumbTrailProps): react.JSX.Element;
|
|
13
12
|
|
|
14
13
|
export { CollapsibleBreadcrumbTrail, type CollapsibleBreadcrumbTrailProps };
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
BreadcrumbTrailEntry,
|
|
13
13
|
BreadcrumbTrailMenu,
|
|
14
14
|
breadcrumbVariants
|
|
15
|
-
} from "@
|
|
15
|
+
} from "@components/ui/breadcrumb";
|
|
16
16
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
17
17
|
import { Fragment, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
18
|
-
import { jsx, jsxs } from "
|
|
18
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
19
19
|
function sameIndexes(left, right) {
|
|
20
20
|
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
21
21
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef, HTMLAttributes } from 'react';
|
|
2
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
-
import {
|
|
4
|
+
import { ButtonVariantProps } from './button.js';
|
|
4
5
|
import { VariantProps } from 'class-variance-authority';
|
|
5
6
|
import NextLink from 'next/link';
|
|
6
|
-
import { ReactNode, ComponentPropsWithoutRef, HTMLAttributes } from 'react';
|
|
7
7
|
|
|
8
8
|
declare const linkVariants: (props?: ({
|
|
9
|
-
color?: "
|
|
9
|
+
color?: "default" | "accent" | null | undefined;
|
|
10
10
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
11
11
|
variant?: "inline" | "standalone" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -23,18 +23,18 @@ type BreadcrumbSizeProps = Pick<BreadcrumbVariantProps, "size">;
|
|
|
23
23
|
type BreadcrumbStyleProps = {
|
|
24
24
|
variant?: BreadcrumbStyleVariant;
|
|
25
25
|
};
|
|
26
|
-
declare function Breadcrumb({ className, ...props }: ComponentPropsWithoutRef<"nav">):
|
|
27
|
-
declare function BreadcrumbList({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"ol">):
|
|
28
|
-
declare function BreadcrumbItem({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"li">):
|
|
26
|
+
declare function Breadcrumb({ className, ...props }: ComponentPropsWithoutRef<"nav">): react.JSX.Element;
|
|
27
|
+
declare function BreadcrumbList({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"ol">): react.JSX.Element;
|
|
28
|
+
declare function BreadcrumbItem({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"li">): react.JSX.Element;
|
|
29
29
|
type BreadcrumbLinkProps = {
|
|
30
30
|
active?: boolean;
|
|
31
31
|
children?: ReactNode;
|
|
32
32
|
href: string;
|
|
33
33
|
} & BreadcrumbSizeProps & BreadcrumbStyleProps & Omit<ComponentPropsWithoutRef<typeof NextLink>, "href">;
|
|
34
|
-
declare function BreadcrumbLink({ active, children, className, href, size, variant, ...props }: BreadcrumbLinkProps):
|
|
35
|
-
declare function BreadcrumbPage({ className, size, variant, ...props }: BreadcrumbSizeProps & BreadcrumbStyleProps & ComponentPropsWithoutRef<"span">):
|
|
36
|
-
declare function BreadcrumbSeparator({ children, className, size, ...props }: BreadcrumbSizeProps & HTMLAttributes<HTMLLIElement>):
|
|
37
|
-
declare function BreadcrumbEllipsis({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"span">):
|
|
34
|
+
declare function BreadcrumbLink({ active, children, className, href, size, variant, ...props }: BreadcrumbLinkProps): react.JSX.Element;
|
|
35
|
+
declare function BreadcrumbPage({ className, size, variant, ...props }: BreadcrumbSizeProps & BreadcrumbStyleProps & ComponentPropsWithoutRef<"span">): react.JSX.Element;
|
|
36
|
+
declare function BreadcrumbSeparator({ children, className, size, ...props }: BreadcrumbSizeProps & HTMLAttributes<HTMLLIElement>): react.JSX.Element;
|
|
37
|
+
declare function BreadcrumbEllipsis({ className, size, ...props }: BreadcrumbSizeProps & ComponentPropsWithoutRef<"span">): react.JSX.Element;
|
|
38
38
|
type BreadcrumbTrailItem = {
|
|
39
39
|
current?: boolean;
|
|
40
40
|
href: string;
|
|
@@ -46,11 +46,11 @@ type BreadcrumbTrailProps = {
|
|
|
46
46
|
} & BreadcrumbSizeProps & BreadcrumbStyleProps;
|
|
47
47
|
declare function BreadcrumbTrailEntry({ item, size, variant, }: {
|
|
48
48
|
item: BreadcrumbTrailItem;
|
|
49
|
-
} & BreadcrumbSizeProps & BreadcrumbStyleProps):
|
|
49
|
+
} & BreadcrumbSizeProps & BreadcrumbStyleProps): react.JSX.Element;
|
|
50
50
|
declare function BreadcrumbTrailMenu({ hidden, menuLabel, size, }: {
|
|
51
51
|
hidden: BreadcrumbTrailItem[];
|
|
52
52
|
menuLabel: string;
|
|
53
|
-
} & BreadcrumbSizeProps & BreadcrumbStyleProps):
|
|
54
|
-
declare function BreadcrumbTrail({ className, items, size, variant, }: BreadcrumbTrailProps):
|
|
53
|
+
} & BreadcrumbSizeProps & BreadcrumbStyleProps): react.JSX.Element;
|
|
54
|
+
declare function BreadcrumbTrail({ className, items, size, variant, }: BreadcrumbTrailProps): react.JSX.Element;
|
|
55
55
|
|
|
56
56
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type BreadcrumbStyleVariant, BreadcrumbTrail, BreadcrumbTrailEntry, type BreadcrumbTrailItem, BreadcrumbTrailMenu, type BreadcrumbTrailProps, type BreadcrumbVariantProps, breadcrumbVariants };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/components/ui/breadcrumb.tsx
|
|
2
|
-
import { buttonVariants } from "@
|
|
2
|
+
import { buttonVariants } from "@components/ui/button";
|
|
3
3
|
import {
|
|
4
4
|
linkVariants
|
|
5
|
-
} from "@
|
|
5
|
+
} from "@components/ui/link";
|
|
6
6
|
import {
|
|
7
7
|
Menu,
|
|
8
8
|
MenuLinkItem,
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
MenuPortal,
|
|
11
11
|
MenuPositioner,
|
|
12
12
|
MenuTrigger
|
|
13
|
-
} from "@
|
|
13
|
+
} from "@components/ui/menu";
|
|
14
14
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import NextLink from "next/link";
|
|
17
17
|
import {
|
|
18
18
|
Fragment
|
|
19
19
|
} from "react";
|
|
20
|
-
import { jsx, jsxs } from "
|
|
20
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
21
21
|
var breadcrumbVariants = cva(
|
|
22
22
|
"flex min-w-0 flex-wrap items-center text-foreground-3",
|
|
23
23
|
{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
-
import {
|
|
4
|
+
import { ButtonVariantProps } from './button.js';
|
|
4
5
|
import { Separator } from '@base-ui/react/separator';
|
|
5
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
6
6
|
import { VariantProps } from 'class-variance-authority';
|
|
7
7
|
|
|
8
8
|
type SeparatorProps = ComponentPropsWithoutRef<typeof Separator>;
|
|
@@ -11,10 +11,10 @@ declare const buttonGroupVariants: (props?: ({
|
|
|
11
11
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
13
|
type ButtonGroupProps = ComponentPropsWithoutRef<"div"> & VariantProps<typeof buttonGroupVariants>;
|
|
14
|
-
declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps):
|
|
14
|
+
declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): react.JSX.Element;
|
|
15
15
|
type ButtonGroupTextProps = Omit<ComponentPropsWithoutRef<"div">, "color"> & Pick<ButtonVariantProps, "size" | "variant">;
|
|
16
|
-
declare function ButtonGroupText({ className, size, variant, ...props }: ButtonGroupTextProps):
|
|
16
|
+
declare function ButtonGroupText({ className, size, variant, ...props }: ButtonGroupTextProps): react.JSX.Element;
|
|
17
17
|
type ButtonGroupSeparatorProps = SeparatorProps;
|
|
18
|
-
declare function ButtonGroupSeparator({ className, orientation, ...props }: ButtonGroupSeparatorProps):
|
|
18
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: ButtonGroupSeparatorProps): react.JSX.Element;
|
|
19
19
|
|
|
20
20
|
export { ButtonGroup, type ButtonGroupProps, ButtonGroupSeparator, type ButtonGroupSeparatorProps, ButtonGroupText, type ButtonGroupTextProps, buttonGroupVariants };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/components/ui/button-group.tsx
|
|
2
|
-
import { buttonVariants } from "@
|
|
3
|
-
import { Separator } from "@
|
|
2
|
+
import { buttonVariants } from "@components/ui/button";
|
|
3
|
+
import { Separator } from "@components/ui/separator";
|
|
4
4
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
|
-
import { jsx } from "
|
|
6
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
7
7
|
var buttonGroupVariants = cva(
|
|
8
8
|
[
|
|
9
9
|
"inline-flex w-fit items-stretch",
|