@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.
Files changed (220) hide show
  1. package/README.md +3 -5
  2. package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
  3. package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
  4. package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
  5. package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
  6. package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
  7. package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
  8. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
  9. package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
  10. package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
  11. package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
  12. package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
  13. package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
  14. package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
  15. package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
  16. package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
  17. package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
  18. package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
  19. package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
  20. package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
  21. package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
  22. package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
  23. package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
  24. package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
  25. package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
  26. package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
  27. package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
  28. package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
  29. package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
  30. package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
  31. package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
  32. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
  33. package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
  34. package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
  35. package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
  36. package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
  37. package/compiler-assets/nextjs/shims/providers.tsx +13 -0
  38. package/compiler-assets/nextjs/shims/proxy.ts +317 -0
  39. package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
  40. package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
  41. package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
  42. package/dist/button-CFdx-ohV.d.ts +20 -0
  43. package/dist/cache/tags.js +6 -14
  44. package/dist/compiler.d.ts +100 -0
  45. package/dist/compiler.js +13379 -0
  46. package/dist/config/createNextConfig.d.ts +2 -1
  47. package/dist/config/createNextConfig.js +16 -12
  48. package/dist/icons.d.ts +1 -0
  49. package/dist/icons.js +2 -0
  50. package/dist/index.d.ts +303 -15
  51. package/dist/index.js +30 -1198
  52. package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
  53. package/dist/kernel/components/blocks/AgentActions.js +114 -200
  54. package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
  55. package/dist/kernel/components/blocks/color-palette.js +88 -169
  56. package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
  57. package/dist/kernel/components/blocks/design-system-preview.js +44 -52
  58. package/dist/kernel/components/blocks/link-playground.js +23 -71
  59. package/dist/kernel/components/blocks/logo-block.js +18 -47
  60. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
  61. package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -42
  62. package/dist/kernel/components/blocks/navbar.d.ts +1 -1
  63. package/dist/kernel/components/blocks/navbar.js +14 -41
  64. package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
  65. package/dist/kernel/components/blocks/navigation-progress.js +53 -157
  66. package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
  67. package/dist/kernel/components/blocks/next-prev.js +16 -42
  68. package/dist/kernel/components/blocks/page-list.d.ts +1 -1
  69. package/dist/kernel/components/blocks/page-list.js +11 -16
  70. package/dist/kernel/components/blocks/search.d.ts +13 -2
  71. package/dist/kernel/components/blocks/search.js +116 -247
  72. package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
  73. package/dist/kernel/components/blocks/sidebar-node.js +56 -95
  74. package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
  75. package/dist/kernel/components/blocks/sidebar.js +35 -103
  76. package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
  77. package/dist/kernel/components/blocks/theme-toggle.js +2 -2
  78. package/dist/kernel/components/blocks/toc.js +42 -178
  79. package/dist/kernel/components/mdx/components/blockquote.js +3 -24
  80. package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
  81. package/dist/kernel/components/mdx/components/callout.js +15 -47
  82. package/dist/kernel/components/mdx/components/code-block.js +2 -2
  83. package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
  84. package/dist/kernel/components/mdx/components/figure.js +9 -36
  85. package/dist/kernel/components/mdx/components/footnotes.js +3 -24
  86. package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
  87. package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
  88. package/dist/kernel/components/mdx/components/heading.js +32 -116
  89. package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
  90. package/dist/kernel/components/mdx/components/hr.js +2 -2
  91. package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
  92. package/dist/kernel/components/mdx/components/image.js +22 -62
  93. package/dist/kernel/components/mdx/components/inline-code.js +3 -24
  94. package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
  95. package/dist/kernel/components/mdx/components/kbd.js +2 -2
  96. package/dist/kernel/components/mdx/components/link.d.ts +1 -2
  97. package/dist/kernel/components/mdx/components/link.js +2 -2
  98. package/dist/kernel/components/mdx/components/paragraph.js +13 -41
  99. package/dist/kernel/components/mdx/components/pre.js +3 -24
  100. package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
  101. package/dist/kernel/components/mdx/components/table.js +2 -2
  102. package/dist/kernel/components/mdx/components/task-list.js +6 -28
  103. package/dist/kernel/components/mdx/components/video-player.js +53 -88
  104. package/dist/kernel/components/mdx/components/video.js +27 -75
  105. package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
  106. package/dist/kernel/components/mdx/error-boundary.js +12 -15
  107. package/dist/kernel/components/mdx/error-fallback.js +4 -4
  108. package/dist/kernel/components/mdx/mdx.d.ts +68 -11
  109. package/dist/kernel/components/mdx/mdx.js +29 -29
  110. package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
  111. package/dist/kernel/components/mdx/types.d.ts +1 -1
  112. package/dist/kernel/components/ui/accordion.js +3 -26
  113. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +23 -7
  114. package/dist/kernel/components/ui/breadcrumb-trail.js +32 -80
  115. package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
  116. package/dist/kernel/components/ui/breadcrumb.js +20 -54
  117. package/dist/kernel/components/ui/button-group.d.ts +4 -3
  118. package/dist/kernel/components/ui/button-group.js +7 -30
  119. package/dist/kernel/components/ui/button.js +13 -36
  120. package/dist/kernel/components/ui/card.d.ts +1 -1
  121. package/dist/kernel/components/ui/card.js +2 -23
  122. package/dist/kernel/components/ui/dialog.d.ts +9 -9
  123. package/dist/kernel/components/ui/dialog.js +15 -33
  124. package/dist/kernel/components/ui/drawer.d.ts +10 -10
  125. package/dist/kernel/components/ui/drawer.js +15 -33
  126. package/dist/kernel/components/ui/input.js +6 -30
  127. package/dist/kernel/components/ui/kbd.js +10 -31
  128. package/dist/kernel/components/ui/link.d.ts +1 -1
  129. package/dist/kernel/components/ui/link.js +53 -104
  130. package/dist/kernel/components/ui/menu.d.ts +21 -21
  131. package/dist/kernel/components/ui/menu.js +10 -32
  132. package/dist/kernel/components/ui/meta-key.d.ts +9 -4
  133. package/dist/kernel/components/ui/meta-key.js +2 -2
  134. package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
  135. package/dist/kernel/components/ui/navigation-menu.js +9 -30
  136. package/dist/kernel/components/ui/popover.d.ts +10 -10
  137. package/dist/kernel/components/ui/popover.js +19 -34
  138. package/dist/kernel/components/ui/progress.js +2 -25
  139. package/dist/kernel/components/ui/scroll-area.js +39 -118
  140. package/dist/kernel/components/ui/select.d.ts +15 -15
  141. package/dist/kernel/components/ui/select.js +19 -35
  142. package/dist/kernel/components/ui/separator.js +2 -25
  143. package/dist/kernel/components/ui/table.js +2 -23
  144. package/dist/kernel/components/ui/tabs.js +39 -99
  145. package/dist/kernel/components/ui/tag.d.ts +2 -2
  146. package/dist/kernel/components/ui/tag.js +4 -25
  147. package/dist/kernel/components/ui/text.d.ts +2 -2
  148. package/dist/kernel/components/ui/text.js +3 -25
  149. package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
  150. package/dist/kernel/components/ui/theme-toggle.js +18 -44
  151. package/dist/kernel/components/ui/toast.d.ts +10 -10
  152. package/dist/kernel/components/ui/toast.js +13 -35
  153. package/dist/kernel/components/ui/tooltip.d.ts +8 -8
  154. package/dist/kernel/components/ui/tooltip.js +8 -29
  155. package/dist/kernel/defaults.registry.d.ts +1 -1
  156. package/dist/kernel/defaults.registry.js +2 -2
  157. package/dist/kernel/framework-icons.d.ts +1 -0
  158. package/dist/kernel/framework-icons.js +39 -0
  159. package/dist/kernel/routes/agent/markdown.js +36 -65
  160. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  161. package/dist/kernel/routes/layouts/group.js +20 -109
  162. package/dist/kernel/routes/metadata/feed.d.ts +1 -2
  163. package/dist/kernel/routes/metadata/feed.js +46 -127
  164. package/dist/kernel/routes/metadata/llms.d.ts +1 -2
  165. package/dist/kernel/routes/metadata/llms.js +40 -120
  166. package/dist/kernel/routes/metadata/og-image.d.ts +10 -0
  167. package/dist/kernel/routes/metadata/og-image.js +264 -198
  168. package/dist/kernel/routes/metadata/robots.d.ts +1 -2
  169. package/dist/kernel/routes/metadata/robots.js +21 -90
  170. package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
  171. package/dist/kernel/routes/metadata/sitemap.js +36 -102
  172. package/dist/kernel/routes/pages/group.d.ts +1 -1
  173. package/dist/kernel/routes/pages/group.js +42 -137
  174. package/dist/kernel/routes/pages/leaf.d.ts +1 -1
  175. package/dist/kernel/routes/pages/leaf.js +74 -213
  176. package/dist/kernel/routes/pages/root.d.ts +1 -1
  177. package/dist/kernel/routes/pages/root.js +37 -108
  178. package/dist/keyboard-shortcuts.js +69 -141
  179. package/dist/link-CYaCRDb6.d.ts +35 -0
  180. package/dist/resolvers/manifest-resolver.d.ts +3 -3
  181. package/dist/resolvers/manifest-resolver.js +15 -21
  182. package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
  183. package/dist/search.d.ts +81 -4
  184. package/dist/search.js +124 -195
  185. package/dist/sidebar-types-Bgchdfd6.d.ts +25 -0
  186. package/dist/theme-scope.d.ts +15 -0
  187. package/dist/theme-scope.js +23 -0
  188. package/dist/types-B_b3C0U6.d.ts +63 -0
  189. package/dist/types-CIwwieNw.d.ts +127 -0
  190. package/dist/types-DHBm7-j6.d.ts +57 -0
  191. package/dist/types-sM2g9nW0.d.ts +12 -0
  192. package/dist/types.d.ts +0 -1
  193. package/dist/types.js +1 -1
  194. package/dist/utils/cn.d.ts +5 -9
  195. package/dist/utils/cn.js +13 -7
  196. package/dist/utils/heading-ids.js +20 -47
  197. package/dist/utils/pretty-date.js +7 -13
  198. package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
  199. package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
  200. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
  201. package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
  202. package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
  203. package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
  204. package/init/seed/minimal/publish.os/theme.css +47 -0
  205. package/init/seed/minimal/seed.json +13 -0
  206. package/package.json +469 -35
  207. package/release/{package.json → app/lucide/package.json} +11 -5
  208. package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
  209. package/release/app/lucide/pnpm-workspace.yaml +11 -0
  210. package/release/app/phosphor/package.json +30 -0
  211. package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
  212. package/release/app/phosphor/pnpm-workspace.yaml +11 -0
  213. package/release/app/tabler/package.json +30 -0
  214. package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
  215. package/release/app/tabler/pnpm-workspace.yaml +11 -0
  216. package/release/compiler/package.json +20 -0
  217. package/release/compiler/pnpm-lock.yaml.template +2432 -0
  218. package/release/compiler/pnpm-workspace.yaml +11 -0
  219. package/release/release.json +29 -5
  220. package/release/runtime-pnpm-lock.yaml +0 -1316
@@ -1,49 +1,25 @@
1
1
  "use client";
2
2
 
3
- // src/utils/cn.ts
4
- import { clsx } from "clsx";
5
- import { extendTailwindMerge } from "tailwind-merge";
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
- const url = new URL(href);
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 = false
15
+ iconOnly = !1
38
16
  }) {
39
- const handleClick = (e) => {
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-ring",
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-3 transition-[color,opacity] duration-150 group-hover/heading-link:text-foreground-2 group-focus-visible/heading-link:text-foreground-2",
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(LinkIcon, { "aria-hidden": "true", className: "block size-[0.8em] shrink-0" })
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 { HeadingElement, HeadingProps } from '../types.js';
3
- import 'mdx/types.js';
4
- import 'react';
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/kernel/components/mdx/components/heading.tsx
2
- import { HeadingCopyLink } from "./heading-copy-link.js";
3
-
4
- // src/utils/cn.ts
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 as isValidElement2
7
+ isValidElement
73
8
  } from "react";
74
9
  import { jsx, jsxs } from "react/jsx-runtime";
75
10
  function isBrElement(node) {
76
- return isValidElement2(node) && node.type === "br";
11
+ return isValidElement(node) && node.type === "br";
77
12
  }
78
13
  function cleanHeadingChildren(children) {
79
- const childArray = Children.toArray(children).filter(
14
+ let childArray = Children.toArray(children).filter(
80
15
  (child) => !isBrElement(child)
81
16
  );
82
- while (childArray.length > 0 && typeof childArray[0] === "string" && childArray[0].trim() === "") {
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 (const child of Children.toArray(children)) {
94
- if (!isValidElement2(child)) continue;
95
- if (typeof child.props === "object" && child.props !== null && "href" in child.props) {
96
- return true;
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
- const cleaned = cleanHeadingChildren(children);
112
- const headingId = id ?? headingToHTMLId(cleaned);
113
- const isEmpty = !headingId || headingId === "empty-heading";
114
- const classes = cn("scroll-mt-20", className);
115
- if (isEmpty) {
116
- return (
117
- // @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
118
- /* @__PURE__ */ jsx(Tag, { className, ...props, children: cleaned })
119
- );
120
- }
121
- if (hasNestedLink(cleaned)) {
122
- return (
123
- // @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
124
- /* @__PURE__ */ jsxs(Tag, { id: headingId, className: cn("group/heading", classes), ...props, children: [
125
- cleaned,
126
- /* @__PURE__ */ jsx(
127
- HeadingCopyLink,
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 '../../ui/separator.js';
3
- import '@base-ui/react/separator';
4
- import 'react';
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/kernel/components/mdx/components/hr.tsx
2
- import { Separator } from "../../ui/separator.js";
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/kernel/components/mdx/components/image-zoom.tsx
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
- if (!enabled) return children;
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/kernel/components/mdx/components/image.tsx
2
- import { FigureCaption } from "./figure-caption.js";
3
- import { ImageZoom } from "./image-zoom.js";
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 === "number" && Number.isFinite(value) && value > 0) {
8
+ if (typeof value == "number" && Number.isFinite(value) && value > 0)
32
9
  return value;
33
- }
34
- if (typeof value !== "string") return void 0;
35
- const [width, height] = value.split("/").map((part) => Number(part.trim()));
36
- if (!width || !height || !Number.isFinite(width) || !Number.isFinite(height)) {
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 = false,
47
- fill = false,
20
+ decorative = !1,
21
+ fill = !1,
48
22
  frame = "default",
49
23
  height,
50
24
  intrinsicHeight,
51
25
  intrinsicWidth,
52
- optimized = false,
26
+ optimized = !1,
53
27
  priority,
54
28
  quality,
55
29
  sizes,
56
30
  src,
57
31
  width,
58
- zoom = true,
32
+ zoom = !0,
59
33
  ...props
60
34
  }) {
61
35
  if (!src) return null;
62
- const resolvedWidth = width ?? intrinsicWidth;
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: true,
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
- if (caption) {
148
- return /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8", children: [
149
- content,
150
- /* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: caption })
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/utils/cn.ts
2
- import { clsx } from "clsx";
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-2 bg-surface-2 px-[0.35em] py-[0.15em] font-mono text-[0.95em] font-normal leading-[1.25] text-foreground-1 [a_&]:text-accent-1 [pre_&]:border-0 [pre_&]:bg-transparent [pre_&]:p-0 [pre_&]:text-inherit",
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 { KbdProps as KbdProps$1 } from '../../ui/kbd.js';
3
- import 'class-variance-authority/types';
4
- import 'class-variance-authority';
5
- import 'react';
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/kernel/components/mdx/components/kbd.tsx
2
- import { Kbd as UiKbd } from "../../ui/kbd.js";
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 '../../ui/link.js';
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/kernel/components/mdx/components/link.tsx
1
+ // src/components/mdx/link.tsx
2
2
  import {
3
3
  Link as UiLink
4
- } from "../../ui/link.js";
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/utils/cn.ts
2
- import { clsx } from "clsx";
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 false;
28
- const props = child.props;
29
- if (typeof props.src === "string" && "alt" in props) return true;
30
- if (typeof props.src === "string" && "title" in props) return true;
31
- const type = child.type;
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
- const childArray = Children.toArray(children);
46
- if (childArray.length === 1 && isBlockMediaChild(childArray[0])) {
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("my-5 text-base leading-7 text-foreground-2", className),
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/utils/cn.ts
2
- import { clsx } from "clsx";
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-2 bg-surface-3 p-4 text-sm leading-6 text-foreground-1",
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