@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,35 +1,12 @@
1
1
  "use client";
2
2
 
3
- // src/kernel/components/blocks/navigation-progress.tsx
3
+ // src/components/block/navigation/navigation-progress.tsx
4
4
  import {
5
5
  Progress,
6
6
  ProgressIndicator,
7
7
  ProgressTrack
8
- } from "../ui/progress.js";
9
-
10
- // src/utils/cn.ts
11
- import { clsx } from "clsx";
12
- import { extendTailwindMerge } from "tailwind-merge";
13
- var twMerge = extendTailwindMerge({
14
- extend: {
15
- classGroups: {
16
- z: [
17
- "z-content",
18
- "z-nav",
19
- "z-overlay",
20
- "z-modal",
21
- "z-search",
22
- "z-toast",
23
- "z-progress"
24
- ]
25
- }
26
- }
27
- });
28
- function cn(...inputs) {
29
- return twMerge(clsx(inputs));
30
- }
31
-
32
- // src/kernel/components/blocks/navigation-progress.tsx
8
+ } from "@publish.os/nextjs/kernel/components/ui/progress";
9
+ import { cn } from "@publish.os/nextjs/utils/cn";
33
10
  import { usePathname, useSearchParams } from "next/navigation";
34
11
  import { Suspense, useCallback, useEffect, useRef, useState } from "react";
35
12
  import { jsx } from "react/jsx-runtime";
@@ -45,172 +22,91 @@ var navigationProgressConfig = {
45
22
  timeout: 8e3
46
23
  };
47
24
  function normalizePath(path) {
48
- const normalized = path.replace(/\/+$/, "");
49
- return normalized || "/";
25
+ return path.replace(/\/+$/, "") || "/";
50
26
  }
51
27
  function normalizeHref(href) {
52
- const [pathWithSearch = ""] = href.split("#");
53
- const [path = "", search = ""] = pathWithSearch.split("?");
54
- const normalizedPath = normalizePath(path);
28
+ let [pathWithSearch = ""] = href.split("#"), [path = "", search = ""] = pathWithSearch.split("?"), normalizedPath = normalizePath(path);
55
29
  return search ? `${normalizedPath}?${search}` : normalizedPath;
56
30
  }
57
31
  function shouldShowProgressFor(fromPath, toPath) {
58
- if (!fromPath.trim() || !toPath.trim()) return false;
59
- if (/^(mailto:|tel:|sms:)/i.test(toPath)) return false;
60
- if (toPath.startsWith("#")) return false;
61
- if (toPath.startsWith("/_next/") || toPath.startsWith("/static/")) {
62
- return false;
63
- }
64
- return normalizeHref(fromPath) !== normalizeHref(toPath);
32
+ return !fromPath.trim() || !toPath.trim() || /^(mailto:|tel:|sms:)/i.test(toPath) || toPath.startsWith("#") || toPath.startsWith("/_next/") || toPath.startsWith("/static/") ? !1 : normalizeHref(fromPath) !== normalizeHref(toPath);
65
33
  }
66
34
  function useNavigationProgress() {
67
- const [progress, setProgress] = useState(0);
68
- const [isExiting, setIsExiting] = useState(false);
69
- const pathname = usePathname() || "/";
70
- const searchParams = useSearchParams();
71
- const currentUrl = `${pathname}${searchParams.size ? `?${searchParams}` : ""}`;
72
- const navigation = useRef(null);
73
- const animationFrame = useRef(null);
74
- const completionTimer = useRef(null);
75
- const cleanupTimer = useRef(null);
76
- const previousUrl = useRef("");
77
- const cleanup = useCallback(() => {
78
- if (animationFrame.current !== null) {
79
- cancelAnimationFrame(animationFrame.current);
80
- }
81
- if (completionTimer.current) clearTimeout(completionTimer.current);
82
- if (cleanupTimer.current) clearTimeout(cleanupTimer.current);
83
- if (navigation.current?.timeoutId) {
84
- clearTimeout(navigation.current.timeoutId);
85
- }
86
- animationFrame.current = null;
87
- completionTimer.current = null;
88
- cleanupTimer.current = null;
89
- navigation.current = null;
90
- }, []);
91
- const completeNavigation = useCallback(() => {
92
- if (!navigation.current) return;
93
- if (animationFrame.current !== null) {
94
- cancelAnimationFrame(animationFrame.current);
95
- animationFrame.current = null;
96
- }
97
- if (completionTimer.current) {
98
- clearTimeout(completionTimer.current);
99
- completionTimer.current = null;
100
- }
101
- if (cleanupTimer.current) {
102
- clearTimeout(cleanupTimer.current);
103
- cleanupTimer.current = null;
104
- }
105
- if (navigation.current.timeoutId) {
106
- clearTimeout(navigation.current.timeoutId);
107
- navigation.current.timeoutId = null;
108
- }
109
- setProgress(100);
110
- cleanupTimer.current = setTimeout(() => {
111
- if (!navigation.current) return;
112
- setIsExiting(true);
113
- cleanupTimer.current = setTimeout(() => {
114
- setProgress(0);
115
- setIsExiting(false);
116
- navigation.current = null;
117
- cleanupTimer.current = null;
118
- }, navigationProgressConfig.exitDuration);
119
- }, navigationProgressConfig.completeDuration);
120
- }, []);
121
- const reset = useCallback(() => {
122
- cleanup();
123
- setProgress(0);
124
- setIsExiting(false);
125
- }, [cleanup]);
126
- const startNavigation = useCallback(
35
+ let [progress, setProgress] = useState(0), [isExiting, setIsExiting] = useState(!1), pathname = usePathname() || "/", searchParams = useSearchParams(), currentUrl = `${pathname}${searchParams.size ? `?${searchParams}` : ""}`, navigation = useRef(null), animationFrame = useRef(null), completionTimer = useRef(null), cleanupTimer = useRef(null), previousUrl = useRef(""), cleanup = useCallback(() => {
36
+ animationFrame.current !== null && cancelAnimationFrame(animationFrame.current), completionTimer.current && clearTimeout(completionTimer.current), cleanupTimer.current && clearTimeout(cleanupTimer.current), navigation.current?.timeoutId && clearTimeout(navigation.current.timeoutId), animationFrame.current = null, completionTimer.current = null, cleanupTimer.current = null, navigation.current = null;
37
+ }, []), completeNavigation = useCallback(() => {
38
+ navigation.current && (animationFrame.current !== null && (cancelAnimationFrame(animationFrame.current), animationFrame.current = null), completionTimer.current && (clearTimeout(completionTimer.current), completionTimer.current = null), cleanupTimer.current && (clearTimeout(cleanupTimer.current), cleanupTimer.current = null), navigation.current.timeoutId && (clearTimeout(navigation.current.timeoutId), navigation.current.timeoutId = null), setProgress(100), cleanupTimer.current = setTimeout(() => {
39
+ navigation.current && (setIsExiting(!0), cleanupTimer.current = setTimeout(() => {
40
+ setProgress(0), setIsExiting(!1), navigation.current = null, cleanupTimer.current = null;
41
+ }, navigationProgressConfig.exitDuration));
42
+ }, navigationProgressConfig.completeDuration));
43
+ }, []), reset = useCallback(() => {
44
+ cleanup(), setProgress(0), setIsExiting(!1);
45
+ }, [cleanup]), startNavigation = useCallback(
127
46
  (fromPath, toPath) => {
128
47
  if (!shouldShowProgressFor(fromPath, toPath)) return;
129
- const normalizedTarget = normalizeHref(toPath);
48
+ let normalizedTarget = normalizeHref(toPath);
130
49
  if (navigation.current?.targetPath === normalizedTarget) return;
131
- cleanup();
132
- setIsExiting(false);
133
- setProgress(navigationProgressConfig.initialProgress);
134
- const timeoutId = setTimeout(() => {
50
+ cleanup(), setIsExiting(!1), setProgress(navigationProgressConfig.initialProgress);
51
+ let timeoutId = setTimeout(() => {
135
52
  completeNavigation();
136
- }, navigationProgressConfig.timeout);
137
- const startTime = Date.now();
53
+ }, navigationProgressConfig.timeout), startTime = Date.now();
138
54
  navigation.current = {
139
55
  startTime,
140
56
  targetPath: normalizedTarget,
141
57
  timeoutId
142
58
  };
143
- const animate = () => {
59
+ let animate = () => {
144
60
  if (!navigation.current) return;
145
- const elapsed = Date.now() - startTime;
146
- let progressValue;
147
- if (elapsed < navigationProgressConfig.minDuration) {
61
+ let elapsed = Date.now() - startTime, progressValue;
62
+ if (elapsed < navigationProgressConfig.minDuration)
148
63
  progressValue = navigationProgressConfig.initialProgress + elapsed / navigationProgressConfig.minDuration * (navigationProgressConfig.fastPhaseEnd - navigationProgressConfig.initialProgress);
149
- } else {
150
- const remainingProgress = navigationProgressConfig.targetProgress - navigationProgressConfig.fastPhaseEnd;
151
- const normalizedTime = Math.min(
64
+ else {
65
+ let remainingProgress = navigationProgressConfig.targetProgress - navigationProgressConfig.fastPhaseEnd, easedTime = 1 - (1 - Math.min(
152
66
  1,
153
67
  (elapsed - navigationProgressConfig.minDuration) / (navigationProgressConfig.maxDuration - navigationProgressConfig.minDuration)
154
- );
155
- const easedTime = 1 - (1 - normalizedTime) ** 3;
68
+ )) ** 3;
156
69
  progressValue = navigationProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
157
70
  }
158
71
  setProgress(
159
72
  Math.min(navigationProgressConfig.targetProgress, progressValue)
160
- );
161
- animationFrame.current = requestAnimationFrame(animate);
73
+ ), animationFrame.current = requestAnimationFrame(animate);
162
74
  };
163
75
  animationFrame.current = requestAnimationFrame(animate);
164
76
  },
165
77
  [cleanup, completeNavigation]
166
78
  );
167
- useEffect(() => {
79
+ return useEffect(() => {
168
80
  if (!previousUrl.current) {
169
81
  previousUrl.current = currentUrl;
170
82
  return;
171
83
  }
172
- if (navigation.current && currentUrl !== previousUrl.current) {
173
- if (completionTimer.current) clearTimeout(completionTimer.current);
174
- completionTimer.current = setTimeout(() => {
175
- completionTimer.current = null;
176
- completeNavigation();
177
- }, navigationProgressConfig.settleDelay);
178
- }
179
- previousUrl.current = currentUrl;
180
- }, [completeNavigation, currentUrl]);
181
- useEffect(() => {
182
- const handleClick = (event) => {
183
- if (event.button !== 0) return;
184
- if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
185
- return;
186
- }
187
- const target = event.target;
188
- if (!(target instanceof Element)) return;
189
- if (target.closest("button, input, select, textarea, [role='button']")) {
84
+ navigation.current && currentUrl !== previousUrl.current && (completionTimer.current && clearTimeout(completionTimer.current), completionTimer.current = setTimeout(() => {
85
+ completionTimer.current = null, completeNavigation();
86
+ }, navigationProgressConfig.settleDelay)), previousUrl.current = currentUrl;
87
+ }, [completeNavigation, currentUrl]), useEffect(() => {
88
+ let handleClick = (event) => {
89
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
190
90
  return;
191
- }
192
- const anchor = target.closest("a");
193
- if (!anchor?.href) return;
194
- if (anchor.target && anchor.target !== "_self") return;
195
- if (anchor.hasAttribute("download")) return;
196
- try {
197
- const url = new URL(anchor.href, window.location.origin);
198
- if (url.origin !== window.location.origin) return;
199
- const targetPath = `${url.pathname}${url.search}`;
200
- startNavigation(currentUrl, targetPath);
201
- } catch {
91
+ let target = event.target;
92
+ if (!(target instanceof Element) || target.closest("button, input, select, textarea, [role='button']"))
202
93
  return;
203
- }
94
+ let anchor = target.closest("a");
95
+ if (anchor?.href && !(anchor.target && anchor.target !== "_self") && !anchor.hasAttribute("download"))
96
+ try {
97
+ let url = new URL(anchor.href, window.location.origin);
98
+ if (url.origin !== window.location.origin) return;
99
+ let targetPath = `${url.pathname}${url.search}`;
100
+ startNavigation(currentUrl, targetPath);
101
+ } catch {
102
+ return;
103
+ }
204
104
  };
205
- document.addEventListener("click", handleClick);
206
- return () => document.removeEventListener("click", handleClick);
207
- }, [currentUrl, startNavigation]);
208
- useEffect(() => reset, [reset]);
209
- return { isExiting, progress };
105
+ return document.addEventListener("click", handleClick), () => document.removeEventListener("click", handleClick);
106
+ }, [currentUrl, startNavigation]), useEffect(() => reset, [reset]), { isExiting, progress };
210
107
  }
211
108
  function NavigationProgressContent() {
212
- const { isExiting, progress } = useNavigationProgress();
213
- const isVisible = progress > 0;
109
+ let { isExiting, progress } = useNavigationProgress(), isVisible = progress > 0;
214
110
  return /* @__PURE__ */ jsx(
215
111
  Progress,
216
112
  {
@@ -220,14 +116,14 @@ function NavigationProgressContent() {
220
116
  isVisible ? "opacity-100" : "opacity-0"
221
117
  ),
222
118
  style: {
223
- height: "var(--progress-bar-height, 2px)"
119
+ height: "var(--progress-height, 2px)"
224
120
  },
225
121
  value: isVisible ? progress : null,
226
- children: /* @__PURE__ */ jsx(ProgressTrack, { className: "h-full rounded-none bg-progress-bar-background", children: /* @__PURE__ */ jsx(
122
+ children: /* @__PURE__ */ jsx(ProgressTrack, { className: "h-full rounded-none bg-progress-track-surface", children: /* @__PURE__ */ jsx(
227
123
  ProgressIndicator,
228
124
  {
229
125
  className: cn(
230
- "h-full w-full rounded-none bg-progress-bar-fill",
126
+ "h-full w-full rounded-none bg-progress-indicator-surface",
231
127
  progress === 0 && "scale-x-0"
232
128
  ),
233
129
  style: {
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TreeNode } from '@publish.os/nextjs/types';
2
+ import { T as TreeNode } from '../../../types-DHBm7-j6.js';
3
3
 
4
4
  type NextPrevProps = {
5
5
  className?: string;
@@ -1,38 +1,18 @@
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/blocks/next-prev.tsx
24
- import { ChevronLeft, ChevronRight } from "lucide-react";
1
+ // src/components/block/navigation/next-prev.tsx
2
+ import {
3
+ FrameworkChevronLeftIcon as ChevronLeft,
4
+ FrameworkChevronRightIcon as ChevronRight
5
+ } from "@publish.os/nextjs/kernel/framework-icons";
6
+ import { cn } from "@publish.os/nextjs/utils/cn";
25
7
  import NextLink from "next/link";
26
- import { jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ // src/components/block/navigation/page-nodes.ts
27
10
  function pageNodes(nodes) {
28
- return nodes.flatMap((node) => {
29
- if (node.type === "page") return [node];
30
- if (node.type === "section" || node.type === "folder") {
31
- return pageNodes(node.children);
32
- }
33
- return [];
34
- });
11
+ return nodes.flatMap((node) => node.type === "page" ? [node] : node.type === "section" || node.type === "folder" ? pageNodes(node.children) : []);
35
12
  }
13
+
14
+ // src/components/block/navigation/next-prev.tsx
15
+ import { jsx, jsxs } from "react/jsx-runtime";
36
16
  function DirectionIcon({ direction }) {
37
17
  return /* @__PURE__ */ jsx("span", { className: "shrink-0 text-foreground-3 transition-colors duration-200 group-hover/next-prev:text-foreground-2", children: direction === "previous" ? /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true", size: 14 }) : /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", size: 14 }) });
38
18
  }
@@ -40,13 +20,12 @@ function NavigationCard({
40
20
  direction,
41
21
  page
42
22
  }) {
43
- const isNext = direction === "next";
44
- const label = isNext ? "Next" : "Previous";
23
+ let isNext = direction === "next", label = isNext ? "Next" : "Previous";
45
24
  return /* @__PURE__ */ jsx(
46
25
  NextLink,
47
26
  {
48
27
  className: cn(
49
- "group/next-prev grid min-h-24 w-full min-w-0 overflow-hidden rounded-card border border-stroke-3 bg-surface-1 p-px text-left text-foreground-1 no-underline shadow-xs transition-[border-color,box-shadow] duration-200 hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring [&_*]:!no-underline",
28
+ "group/next-prev grid min-h-24 w-full min-w-0 overflow-hidden rounded-card border border-stroke-3 bg-surface-1 p-px text-left text-foreground-1 no-underline shadow-xs transition-[border-color,box-shadow] duration-200 hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke [&_*]:!no-underline",
50
29
  isNext && "md:text-right"
51
30
  ),
52
31
  href: page.path,
@@ -80,13 +59,8 @@ function NavigationCard({
80
59
  );
81
60
  }
82
61
  function NextPrev({ className, currentPath, tree }) {
83
- const pages = pageNodes(tree);
84
- const index = pages.findIndex((page) => page.path === currentPath);
85
- const previous = index > 0 ? pages[index - 1] : null;
86
- const next = index >= 0 ? pages[index + 1] : null;
87
- const hasBoth = Boolean(previous && next);
88
- if (!previous && !next) return null;
89
- return /* @__PURE__ */ jsx("nav", { "aria-label": "Previous and next pages", className, children: /* @__PURE__ */ jsxs(
62
+ let pages = pageNodes(tree), index = pages.findIndex((page) => page.path === currentPath), previous = index > 0 ? pages[index - 1] : null, next = index >= 0 ? pages[index + 1] : null, hasBoth = !!(previous && next);
63
+ return !previous && !next ? null : /* @__PURE__ */ jsx("nav", { "aria-label": "Previous and next pages", className, children: /* @__PURE__ */ jsxs(
90
64
  "div",
91
65
  {
92
66
  className: cn(
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TreeNode } from '@publish.os/nextjs/types';
2
+ import { T as TreeNode } from '../../../types-DHBm7-j6.js';
3
3
 
4
4
  type PageListProps = {
5
5
  tree: TreeNode[];
@@ -1,22 +1,17 @@
1
- // src/kernel/components/blocks/page-list.tsx
2
- import { Link } from "../ui/link.js";
3
- import { jsx } from "react/jsx-runtime";
1
+ // src/components/block/navigation/page-list.tsx
2
+ import { Link } from "@publish.os/nextjs/kernel/components/ui/link";
3
+
4
+ // src/components/block/navigation/page-nodes.ts
4
5
  function pageNodes(nodes) {
5
- return nodes.flatMap((node) => {
6
- if (node.type === "page") return [node];
7
- if (node.type === "section" || node.type === "folder") {
8
- return pageNodes(node.children);
9
- }
10
- return [];
11
- });
6
+ return nodes.flatMap((node) => node.type === "page" ? [node] : node.type === "section" || node.type === "folder" ? pageNodes(node.children) : []);
12
7
  }
8
+
9
+ // src/components/block/navigation/page-list.tsx
10
+ import { jsx } from "react/jsx-runtime";
13
11
  function PageList({ tree, currentPath, className }) {
14
- const pages = pageNodes(tree);
15
- if (pages.length === 0) {
16
- return null;
17
- }
18
- return /* @__PURE__ */ jsx("nav", { "aria-label": "Pages in this group", className, children: /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: pages.map((page) => {
19
- const active = page.path === currentPath;
12
+ let pages = pageNodes(tree);
13
+ return pages.length === 0 ? null : /* @__PURE__ */ jsx("nav", { "aria-label": "Pages in this group", className, children: /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: pages.map((page) => {
14
+ let active = page.path === currentPath;
20
15
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
21
16
  Link,
22
17
  {
@@ -1,10 +1,21 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonVariantProps } from '../ui/button.js';
3
- import { SearchProviderProps } from '@publish.os/nextjs/search';
2
+ import { B as ButtonVariantProps } from '../../../button-CFdx-ohV.js';
4
3
  import { ReactNode, ReactElement } from 'react';
5
4
  import 'class-variance-authority/types';
6
5
  import 'class-variance-authority';
7
6
 
7
+ type SearchBlockVariant = "desktop" | "mobile";
8
+
9
+ type SearchProviderProps = {
10
+ children?: ReactNode;
11
+ defaultOpen?: boolean;
12
+ limit?: number;
13
+ onOpenChange?: (open: boolean) => void;
14
+ open?: boolean;
15
+ shortcut?: string;
16
+ variant?: SearchBlockVariant;
17
+ };
18
+
8
19
  declare function SearchProgressBar({ className }: {
9
20
  className?: string;
10
21
  }): react_jsx_runtime.JSX.Element;