@publish.os/nextjs 0.0.1-alpha.6 → 0.0.1-alpha.7

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 +2 -2
  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,32 +1,14 @@
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/strikethrough.tsx
1
+ // src/components/mdx/strikethrough.tsx
2
+ import { cn } from "@publish.os/nextjs/utils/cn";
24
3
  import { jsx } from "react/jsx-runtime";
25
4
  function Strikethrough({ className, ...props }) {
26
5
  return /* @__PURE__ */ jsx(
27
6
  "del",
28
7
  {
29
- className: cn("text-foreground-3 decoration-stroke-1", className),
8
+ className: cn(
9
+ "text-typography-caption-foreground decoration-typography-rule-stroke",
10
+ className
11
+ ),
30
12
  ...props
31
13
  }
32
14
  );
@@ -1,4 +1,4 @@
1
- // src/kernel/components/mdx/components/table.tsx
1
+ // src/components/mdx/table.tsx
2
2
  import {
3
3
  TableBody,
4
4
  TableCell,
@@ -6,7 +6,7 @@ import {
6
6
  TableHeader,
7
7
  TableRow,
8
8
  Table as UiTable
9
- } from "../../ui/table.js";
9
+ } from "@publish.os/nextjs/kernel/components/ui/table";
10
10
  import { jsx } from "react/jsx-runtime";
11
11
  function Table(props) {
12
12
  return /* @__PURE__ */ jsx(UiTable, { ...props });
@@ -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/task-list.tsx
1
+ // src/components/mdx/task-list.tsx
2
+ import { cn } from "@publish.os/nextjs/utils/cn";
24
3
  import { jsx } from "react/jsx-runtime";
25
4
  function TaskList({ className, ...props }) {
26
5
  return /* @__PURE__ */ jsx(
27
6
  "ul",
28
7
  {
29
8
  className: cn(
30
- "my-5 space-y-2 pl-6 text-base leading-7 text-foreground-2 [&>li]:pl-1",
9
+ "my-5 space-y-2 pl-6 text-base leading-7 text-typography-body-foreground [&>li]:pl-1",
31
10
  className
32
11
  ),
33
12
  ...props
@@ -39,14 +18,13 @@ function TaskListInput({
39
18
  className,
40
19
  type
41
20
  }) {
42
- if (type !== "checkbox") return null;
43
- return /* @__PURE__ */ jsx(
21
+ return type !== "checkbox" ? null : /* @__PURE__ */ jsx(
44
22
  "span",
45
23
  {
46
24
  "aria-hidden": "true",
47
25
  className: cn(
48
- "mr-2 inline-flex size-4 translate-y-0.5 items-center justify-center rounded-checkbox border border-stroke-2 bg-surface-1",
49
- checked && "border-accent-solid bg-accent-solid text-accent-foreground",
26
+ "mr-2 inline-flex size-4 translate-y-0.5 items-center justify-center rounded-checkbox border border-typography-rule-stroke bg-surface-1",
27
+ checked && "border-accent-1 bg-accent-1 text-accent-1-foreground",
50
28
  className
51
29
  ),
52
30
  "data-checked": checked ? "" : void 0,
@@ -1,28 +1,7 @@
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/video-player.tsx
3
+ // src/components/mdx/video-player.tsx
4
+ import { cn } from "@publish.os/nextjs/utils/cn";
26
5
  import { usePathname } from "next/navigation";
27
6
  import { useCallback, useEffect, useId, useState } from "react";
28
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -36,84 +15,70 @@ function VideoPlayer({
36
15
  title,
37
16
  width
38
17
  }) {
39
- const instanceId = useId();
40
- const pathname = usePathname();
41
- const [playing, setPlaying] = useState(false);
42
- const aspectRatio = width && height ? `${width} / ${height}` : "16 / 9";
43
- const mediaKey = embed?.src ?? src;
44
- const shellStyle = poster ? {
45
- aspectRatio,
46
- backgroundImage: `url("${poster}")`,
47
- backgroundPosition: "center",
48
- backgroundSize: "cover"
49
- } : { aspectRatio };
50
- const buttonStyle = {
51
- ...shellStyle,
18
+ let instanceId = useId(), pathname = usePathname(), [playing, setPlaying] = useState(!1), aspectRatio = width && height ? `${width} / ${height}` : "16 / 9", mediaKey = embed?.src ?? src, buttonStyle = {
19
+ ...poster ? {
20
+ aspectRatio,
21
+ backgroundImage: `url("${poster}")`,
22
+ backgroundPosition: "center",
23
+ backgroundSize: "cover"
24
+ } : { aspectRatio },
52
25
  appearance: "none",
53
26
  border: 0,
54
27
  borderRadius: "inherit",
55
28
  padding: 0
56
29
  };
57
30
  useEffect(() => {
58
- if (mediaKey || pathname) {
59
- setPlaying(false);
60
- }
61
- }, [mediaKey, pathname]);
62
- useEffect(() => {
31
+ (mediaKey || pathname) && setPlaying(!1);
32
+ }, [mediaKey, pathname]), useEffect(() => {
63
33
  function handlePlay(event) {
64
- const detail = event.detail;
65
- if (detail?.id !== instanceId) {
66
- setPlaying(false);
67
- }
34
+ event.detail?.id !== instanceId && setPlaying(!1);
68
35
  }
69
- window.addEventListener(VIDEO_PLAY_EVENT, handlePlay);
70
- return () => window.removeEventListener(VIDEO_PLAY_EVENT, handlePlay);
36
+ return window.addEventListener(VIDEO_PLAY_EVENT, handlePlay), () => window.removeEventListener(VIDEO_PLAY_EVENT, handlePlay);
71
37
  }, [instanceId]);
72
- const startPlaying = useCallback(() => {
38
+ let startPlaying = useCallback(() => {
73
39
  window.dispatchEvent(
74
40
  new CustomEvent(VIDEO_PLAY_EVENT, { detail: { id: instanceId } })
75
- );
76
- setPlaying(true);
41
+ ), setPlaying(!0);
77
42
  }, [instanceId]);
78
- if (playing) {
79
- if (embed) {
80
- return /* @__PURE__ */ jsx(
81
- "iframe",
82
- {
83
- allow: embed.allow,
84
- allowFullScreen: true,
85
- className: cn("block h-full w-full border-0 bg-black", className),
86
- referrerPolicy: "strict-origin-when-cross-origin",
87
- sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups",
88
- src: embed.src,
89
- title: embed.title
90
- },
91
- embed.src
92
- );
93
- }
94
- return /* @__PURE__ */ jsx(
95
- "video",
96
- {
97
- autoPlay: true,
98
- className: cn("block h-full w-full border-0 bg-black", className),
99
- controls: true,
100
- playsInline: true,
101
- poster,
102
- preload: "metadata",
103
- src,
104
- title,
105
- children: /* @__PURE__ */ jsx("track", { kind: "captions" })
106
- },
107
- src
108
- );
109
- }
110
- return /* @__PURE__ */ jsxs(
43
+ return playing ? embed ? /* @__PURE__ */ jsx(
44
+ "iframe",
45
+ {
46
+ allow: embed.allow,
47
+ allowFullScreen: !0,
48
+ className: cn(
49
+ "block h-full w-full border-0 bg-media-surface",
50
+ className
51
+ ),
52
+ referrerPolicy: "strict-origin-when-cross-origin",
53
+ sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups",
54
+ src: embed.src,
55
+ title: embed.title
56
+ },
57
+ embed.src
58
+ ) : /* @__PURE__ */ jsx(
59
+ "video",
60
+ {
61
+ autoPlay: !0,
62
+ className: cn(
63
+ "block h-full w-full border-0 bg-media-surface",
64
+ className
65
+ ),
66
+ controls: !0,
67
+ playsInline: !0,
68
+ poster,
69
+ preload: "metadata",
70
+ src,
71
+ title,
72
+ children: /* @__PURE__ */ jsx("track", { kind: "captions" })
73
+ },
74
+ src
75
+ ) : /* @__PURE__ */ jsxs(
111
76
  "button",
112
77
  {
113
78
  "aria-label": `Play video: ${title}`,
114
79
  className: cn(
115
80
  "group relative block h-full w-full appearance-none overflow-hidden border-0 bg-surface-3 p-0 text-foreground-1 outline-none",
116
- "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-8",
81
+ "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke",
117
82
  className
118
83
  ),
119
84
  onClick: startPlaying,
@@ -124,20 +89,20 @@ function VideoPlayer({
124
89
  "span",
125
90
  {
126
91
  className: cn(!poster && "absolute inset-0 bg-surface-3"),
127
- "aria-hidden": true
92
+ "aria-hidden": !0
128
93
  }
129
94
  ),
130
95
  /* @__PURE__ */ jsx(
131
96
  "span",
132
97
  {
133
- "aria-hidden": true,
98
+ "aria-hidden": !0,
134
99
  className: cn(
135
100
  "absolute inset-0 transition-colors duration-200",
136
- poster ? "bg-black/20 group-hover:bg-black/30" : "bg-[radial-gradient(circle_at_center,_rgb(255_255_255_/_8%),_transparent_45%)]"
101
+ poster ? "bg-media-preview-backdrop group-hover:bg-media-preview-backdrop-hover" : "bg-[radial-gradient(circle_at_center,var(--media-ambient-surface),transparent_45%)]"
137
102
  )
138
103
  }
139
104
  ),
140
- /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ jsx("span", { className: "flex size-14 items-center justify-center rounded-full border border-white/40 bg-black/70 text-white shadow-lg 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-[14px] border-l-current" }) }) })
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-[14px] border-l-current" }) }) })
141
106
  ]
142
107
  }
143
108
  );
@@ -1,109 +1,72 @@
1
- // src/kernel/components/mdx/components/video.tsx
2
- import { FigureCaption } from "./figure-caption.js";
1
+ // src/components/mdx/video.tsx
2
+ import { FigureCaption } from "@publish.os/nextjs/kernel/components/mdx/components/figure-caption";
3
3
  import {
4
4
  VideoPlayer
5
- } from "./video-player.js";
6
-
7
- // src/utils/cn.ts
8
- import { clsx } from "clsx";
9
- import { extendTailwindMerge } from "tailwind-merge";
10
- var twMerge = extendTailwindMerge({
11
- extend: {
12
- classGroups: {
13
- z: [
14
- "z-content",
15
- "z-nav",
16
- "z-overlay",
17
- "z-modal",
18
- "z-search",
19
- "z-toast",
20
- "z-progress"
21
- ]
22
- }
23
- }
24
- });
25
- function cn(...inputs) {
26
- return twMerge(clsx(inputs));
27
- }
28
-
29
- // src/kernel/components/mdx/components/video.tsx
5
+ } from "@publish.os/nextjs/kernel/components/mdx/components/video-player";
6
+ import { cn } from "@publish.os/nextjs/utils/cn";
30
7
  import { jsx, jsxs } from "react/jsx-runtime";
31
8
  function toNumber(value) {
32
- if (typeof value === "number" && Number.isFinite(value)) return value;
33
- if (typeof value === "string" && value.trim() !== "") {
34
- const parsed = Number(value);
9
+ if (typeof value == "number" && Number.isFinite(value)) return value;
10
+ if (typeof value == "string" && value.trim() !== "") {
11
+ let parsed = Number(value);
35
12
  if (Number.isFinite(parsed)) return parsed;
36
13
  }
37
- return void 0;
38
14
  }
39
15
  function youtubeId(url) {
40
16
  if (url.hostname === "youtu.be") return url.pathname.replace(/^\/+/, "");
41
- if (url.hostname.endsWith("youtube.com")) {
42
- if (url.pathname.startsWith("/embed/")) {
43
- return url.pathname.split("/")[2];
44
- }
45
- return url.searchParams.get("v") ?? void 0;
46
- }
47
- return void 0;
17
+ if (url.hostname.endsWith("youtube.com"))
18
+ return url.pathname.startsWith("/embed/") ? url.pathname.split("/")[2] : url.searchParams.get("v") ?? void 0;
48
19
  }
49
20
  function resolveEmbed(src, title) {
50
21
  let url;
51
22
  try {
52
23
  url = new URL(src);
53
24
  } catch {
54
- return void 0;
25
+ return;
55
26
  }
56
- const id = youtubeId(url);
57
- if (id) {
27
+ let id = youtubeId(url);
28
+ if (id)
58
29
  return {
59
30
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
60
31
  src: `https://www.youtube-nocookie.com/embed/${encodeURIComponent(id)}?autoplay=1`,
61
32
  title
62
33
  };
63
- }
64
34
  if (url.hostname.endsWith("vimeo.com")) {
65
- const id2 = url.pathname.split("/").filter(Boolean).at(-1);
66
- if (id2) {
35
+ let id2 = url.pathname.split("/").filter(Boolean).at(-1);
36
+ if (id2)
67
37
  return {
68
38
  allow: "autoplay; fullscreen; picture-in-picture",
69
39
  src: `https://player.vimeo.com/video/${encodeURIComponent(id2)}?autoplay=1`,
70
40
  title
71
41
  };
72
- }
73
42
  }
74
43
  if (url.hostname.endsWith("loom.com")) {
75
- const parts = url.pathname.split("/").filter(Boolean);
76
- const id2 = parts.at(-1);
77
- if (id2) {
44
+ let id2 = url.pathname.split("/").filter(Boolean).at(-1);
45
+ if (id2)
78
46
  return {
79
47
  allow: "autoplay; fullscreen",
80
48
  src: `https://www.loom.com/embed/${encodeURIComponent(id2)}?autoplay=1`,
81
49
  title
82
50
  };
83
- }
84
51
  }
85
52
  if (url.hostname.endsWith("wistia.com")) {
86
- const parts = url.pathname.split("/").filter(Boolean);
87
- const id2 = parts.at(-1);
88
- if (id2) {
53
+ let id2 = url.pathname.split("/").filter(Boolean).at(-1);
54
+ if (id2)
89
55
  return {
90
56
  allow: "autoplay; fullscreen",
91
57
  src: `https://fast.wistia.net/embed/iframe/${encodeURIComponent(id2)}?autoPlay=true`,
92
58
  title
93
59
  };
94
- }
95
60
  }
96
61
  if (url.hostname === "watch.cloudflarestream.com" || url.hostname === "iframe.videodelivery.net") {
97
- const id2 = url.pathname.split("/").filter(Boolean).at(-1);
98
- if (id2) {
62
+ let id2 = url.pathname.split("/").filter(Boolean).at(-1);
63
+ if (id2)
99
64
  return {
100
65
  allow: "accelerometer; autoplay; encrypted-media; picture-in-picture",
101
66
  src: `https://iframe.videodelivery.net/${encodeURIComponent(id2)}?autoplay=true`,
102
67
  title
103
68
  };
104
- }
105
69
  }
106
- return void 0;
107
70
  }
108
71
  function Video({
109
72
  caption,
@@ -116,18 +79,10 @@ function Video({
116
79
  width
117
80
  }) {
118
81
  if (!src) return null;
119
- const videoTitle = title?.trim() || "Video";
120
- const numericWidth = toNumber(width);
121
- const numericHeight = toNumber(height);
122
- const framed = frame !== false && frame !== "none";
123
- const embed = resolveEmbed(src, videoTitle);
124
- const reservedWidth = numericWidth ?? 1280;
125
- const reservedHeight = numericHeight ?? 720;
126
- const frameStyle = {
127
- aspectRatio: `${reservedWidth} / ${reservedHeight}`,
82
+ let videoTitle = title?.trim() || "Video", numericWidth = toNumber(width), numericHeight = toNumber(height), framed = frame !== !1 && frame !== "none", embed = resolveEmbed(src, videoTitle), frameStyle = {
83
+ aspectRatio: `${numericWidth ?? 1280} / ${numericHeight ?? 720}`,
128
84
  width: numericWidth ? `min(100%, ${numericWidth}px)` : "100%"
129
- };
130
- const player = /* @__PURE__ */ jsx(
85
+ }, player = /* @__PURE__ */ jsx(
131
86
  "div",
132
87
  {
133
88
  className: cn(
@@ -149,13 +104,10 @@ function Video({
149
104
  )
150
105
  }
151
106
  );
152
- if (caption) {
153
- return /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8", children: [
154
- player,
155
- /* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: caption })
156
- ] });
157
- }
158
- return /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6", children: player });
107
+ return caption ? /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8", children: [
108
+ player,
109
+ /* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: caption })
110
+ ] }) : /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6", children: player });
159
111
  }
160
112
  export {
161
113
  Video
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MdxErrorBoundaryProps } from './types.js';
2
+ import { M as MdxErrorBoundaryProps } from '../../../types-sM2g9nW0.js';
3
3
  import 'mdx/types.js';
4
4
  import 'react';
5
5
 
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
 
3
- // src/kernel/components/mdx/error-boundary.tsx
4
- import { MDXErrorFallback } from "./error-fallback.js";
5
- import { unstable_catchError as catchError } from "next/error";
3
+ // src/components/mdx/error-boundary.tsx
4
+ import { MDXErrorFallback } from "@publish.os/nextjs/kernel/components/mdx/error-fallback";
5
+ import { catchError } from "next/error";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  function MDXRenderErrorFallback(props, { error }) {
8
8
  return /* @__PURE__ */ jsx(
9
9
  MDXErrorFallback,
10
10
  {
11
- errorMessage: props.errorMessage ?? error.message,
11
+ errorMessage: props.errorMessage ?? (error instanceof Error ? error.message : void 0),
12
12
  pageId: props.pageId,
13
13
  slug: props.slug
14
14
  }
@@ -21,17 +21,14 @@ function MDXErrorBoundary({
21
21
  slug,
22
22
  children
23
23
  }) {
24
- if (errorMessage) {
25
- return /* @__PURE__ */ jsx(
26
- MDXErrorFallback,
27
- {
28
- errorMessage,
29
- pageId,
30
- slug
31
- }
32
- );
33
- }
34
- return /* @__PURE__ */ jsx(MDXRenderErrorBoundary, { pageId, slug, children });
24
+ return errorMessage ? /* @__PURE__ */ jsx(
25
+ MDXErrorFallback,
26
+ {
27
+ errorMessage,
28
+ pageId,
29
+ slug
30
+ }
31
+ ) : /* @__PURE__ */ jsx(MDXRenderErrorBoundary, { pageId, slug, children });
35
32
  }
36
33
  export {
37
34
  MDXErrorBoundary
@@ -1,16 +1,16 @@
1
- // src/kernel/components/mdx/error-fallback.tsx
1
+ // src/components/mdx/error-fallback.tsx
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  function MDXErrorFallback({
4
4
  errorMessage = "An error occurred while rendering the content",
5
5
  pageId,
6
6
  slug
7
7
  }) {
8
- const isMdxError = errorMessage.includes("[next-mdx-remote]");
8
+ let isMdxError = errorMessage.includes("[next-mdx-remote]");
9
9
  return /* @__PURE__ */ jsxs("div", { children: [
10
- /* @__PURE__ */ jsxs("div", { className: "rounded-card border border-red-500/25 bg-red-500/10 p-6 text-red-800", children: [
10
+ /* @__PURE__ */ jsxs("div", { className: "rounded-card border border-danger-600 bg-danger-200 p-6 text-danger-1100", children: [
11
11
  /* @__PURE__ */ jsx("p", { className: "font-semibold", children: "Content Error" }),
12
12
  /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm", children: isMdxError ? "There is an issue with the MDX content formatting." : errorMessage }),
13
- isMdxError && /* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-40 overflow-auto rounded-codeblock bg-red-500/10 p-3 text-xs", children: errorMessage }),
13
+ isMdxError && /* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-40 overflow-auto rounded-codeblock bg-danger-300 p-3 text-xs", children: errorMessage }),
14
14
  (pageId || slug) && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-xs opacity-80", children: [
15
15
  "Page: ",
16
16
  pageId ?? "unknown",
@@ -1,15 +1,72 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MDXComponents } from './types.js';
3
- export { Figure } from './components/figure.js';
4
- export { Image } from './components/image.js';
5
- export { Link } from './components/link.js';
6
- export { Video } from './components/video.js';
2
+ import { a as MDXComponents } from '../../../types-sM2g9nW0.js';
3
+ import { ReactNode, AnchorHTMLAttributes } from 'react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import { B as ButtonVariantProps } from '../../../button-CFdx-ohV.js';
6
+ import { VariantProps } from 'class-variance-authority';
7
7
  import 'mdx/types.js';
8
- import 'react';
9
- import '../ui/link.js';
10
- import 'class-variance-authority/types';
11
- import '../ui/button.js';
12
- import 'class-variance-authority';
8
+
9
+ type FigureProps = React.ComponentPropsWithoutRef<"figure"> & {
10
+ caption?: ReactNode;
11
+ frame?: boolean | "default" | "none";
12
+ };
13
+ declare function Figure({ caption, children, className, ...props }: FigureProps): react_jsx_runtime.JSX.Element;
14
+
15
+ type ImageProps = Omit<React.ComponentPropsWithoutRef<"img">, "height" | "sizes" | "width"> & {
16
+ aspect?: number | `${number}/${number}`;
17
+ caption?: React.ReactNode;
18
+ decorative?: boolean;
19
+ fill?: boolean;
20
+ frame?: boolean | "default" | "none";
21
+ height?: number;
22
+ intrinsicHeight?: number;
23
+ intrinsicWidth?: number;
24
+ optimized?: boolean;
25
+ priority?: boolean;
26
+ quality?: 50 | 60 | 75 | 85 | 95 | 100;
27
+ sizes?: string;
28
+ width?: number;
29
+ zoom?: boolean;
30
+ };
31
+ 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
+
33
+ declare const linkVariants: (props?: ({
34
+ color?: "accent" | "default" | null | undefined;
35
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
36
+ variant?: "inline" | "standalone" | null | undefined;
37
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
38
+ type LinkVariantProps = VariantProps<typeof linkVariants>;
39
+ type LinkStyleVariant = NonNullable<LinkVariantProps["variant"]>;
40
+ type LinkButtonVariant = `button.${NonNullable<ButtonVariantProps["variant"]>}`;
41
+ type LinkVariant = `link.${LinkStyleVariant}` | LinkButtonVariant;
42
+ type NamedLinkColor = "accent" | "default";
43
+ type LinkColor = NamedLinkColor | (string & {});
44
+ type LinkProps = {
45
+ active?: boolean;
46
+ children?: ReactNode;
47
+ color?: LinkColor;
48
+ disabled?: boolean;
49
+ href?: string;
50
+ iconOnly?: ButtonVariantProps["iconOnly"];
51
+ leftIcon?: ReactNode;
52
+ rightIcon?: ReactNode;
53
+ variant?: LinkVariant;
54
+ } & Omit<LinkVariantProps, "color" | "variant"> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "href">;
55
+
56
+ type MdxLinkProps = LinkProps;
57
+ declare function Link({ color, href, size, variant, ...props }: MdxLinkProps): react_jsx_runtime.JSX.Element;
58
+
59
+ type VideoProps = Omit<React.ComponentPropsWithoutRef<"video">, "height" | "poster" | "src" | "title" | "width"> & {
60
+ caption?: React.ReactNode;
61
+ frame?: boolean | "default" | "none";
62
+ height?: number | string;
63
+ poster?: string;
64
+ provider?: "self-hosted" | "youtube" | "vimeo" | "loom" | "wistia" | "cloudflare-stream";
65
+ src?: string;
66
+ title?: string;
67
+ width?: number | string;
68
+ };
69
+ declare function Video({ caption, className, frame, height, poster, src, title, width, }: VideoProps): react_jsx_runtime.JSX.Element | null;
13
70
 
14
71
  type MDXProps = {
15
72
  components?: MDXComponents;
@@ -19,4 +76,4 @@ type MDXProps = {
19
76
  };
20
77
  declare function MDX({ components, content, pageId, slug }: MDXProps): Promise<react_jsx_runtime.JSX.Element>;
21
78
 
22
- export { MDX, MDXComponents, type MDXProps };
79
+ export { Figure, Image, Link, MDX, MDXComponents, type MDXProps, Video };