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

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 (229) hide show
  1. package/README.md +1 -1
  2. package/dist/config/createNextConfig.js +3 -3
  3. package/dist/index.js +7 -5
  4. package/dist/kernel/components/blocks/color-palette.js +35 -4
  5. package/dist/kernel/components/blocks/design-system-preview.js +18 -17
  6. package/dist/kernel/components/blocks/link-playground.js +3 -3
  7. package/dist/kernel/components/blocks/logo-block.js +1 -1
  8. package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -12
  9. package/dist/kernel/components/blocks/navbar.js +1 -1
  10. package/dist/kernel/components/blocks/navigation-progress-playground.js +2 -2
  11. package/dist/kernel/components/mdx/components/image.js +1 -1
  12. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -1
  13. package/dist/kernel/components/ui/breadcrumb-trail.js +1 -0
  14. package/dist/kernel/components/ui/breadcrumb.d.ts +1 -5
  15. package/dist/kernel/components/ui/breadcrumb.js +1 -16
  16. package/dist/kernel/components/ui/button-group.d.ts +2 -2
  17. package/dist/kernel/components/ui/button-group.js +2 -3
  18. package/dist/kernel/components/ui/button.d.ts +3 -4
  19. package/dist/kernel/components/ui/button.js +4 -12
  20. package/dist/kernel/components/ui/card.d.ts +1 -1
  21. package/dist/kernel/components/ui/menu.js +5 -5
  22. package/dist/kernel/components/ui/navigation-menu.js +2 -2
  23. package/dist/kernel/components/ui/popover.js +5 -11
  24. package/dist/kernel/components/ui/select.js +5 -5
  25. package/dist/kernel/components/ui/tag.d.ts +14 -0
  26. package/dist/kernel/components/ui/tag.js +76 -0
  27. package/dist/kernel/components/ui/text.d.ts +1 -1
  28. package/dist/kernel/components/ui/text.js +109 -106
  29. package/dist/kernel/components/ui/theme-toggle.js +1 -1
  30. package/dist/kernel/components/ui/tooltip.js +2 -2
  31. package/dist/kernel/defaults.registry.d.ts +63 -72
  32. package/dist/kernel/defaults.registry.js +62 -70
  33. package/dist/kernel/routes/agent/markdown.js +2 -2
  34. package/dist/kernel/routes/metadata/feed.js +2 -2
  35. package/dist/kernel/routes/metadata/llms.js +4 -2
  36. package/dist/kernel/routes/metadata/og-image.d.ts +1 -1
  37. package/dist/kernel/routes/metadata/robots.js +2 -2
  38. package/dist/kernel/routes/metadata/sitemap.js +2 -2
  39. package/dist/utils/cn.d.ts +1 -1
  40. package/package.json +4 -9
  41. package/release/package.json +4 -3
  42. package/release/release.json +5 -5
  43. package/release/{pnpm-lock.yaml → runtime-pnpm-lock.yaml} +348 -224
  44. package/dist/cache/tags.cjs +0 -79
  45. package/dist/cache/tags.d.cts +0 -13
  46. package/dist/config/createNextConfig.cjs +0 -52
  47. package/dist/config/createNextConfig.d.cts +0 -8
  48. package/dist/config.cjs +0 -78
  49. package/dist/config.d.cts +0 -101
  50. package/dist/config.d.ts +0 -101
  51. package/dist/config.js +0 -48
  52. package/dist/index.cjs +0 -1266
  53. package/dist/index.d.cts +0 -18
  54. package/dist/kernel/components/blocks/AgentActions.cjs +0 -425
  55. package/dist/kernel/components/blocks/AgentActions.d.cts +0 -52
  56. package/dist/kernel/components/blocks/animated-icon-swap.cjs +0 -101
  57. package/dist/kernel/components/blocks/animated-icon-swap.d.cts +0 -16
  58. package/dist/kernel/components/blocks/color-palette.cjs +0 -413
  59. package/dist/kernel/components/blocks/color-palette.d.cts +0 -7
  60. package/dist/kernel/components/blocks/design-system-preview.cjs +0 -592
  61. package/dist/kernel/components/blocks/design-system-preview.d.cts +0 -29
  62. package/dist/kernel/components/blocks/link-playground.cjs +0 -816
  63. package/dist/kernel/components/blocks/link-playground.d.cts +0 -5
  64. package/dist/kernel/components/blocks/logo-block.cjs +0 -156
  65. package/dist/kernel/components/blocks/logo-block.d.cts +0 -21
  66. package/dist/kernel/components/blocks/nav-breadcrumb.cjs +0 -122
  67. package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +0 -11
  68. package/dist/kernel/components/blocks/navbar.cjs +0 -154
  69. package/dist/kernel/components/blocks/navbar.d.cts +0 -16
  70. package/dist/kernel/components/blocks/navigation-progress-playground.cjs +0 -735
  71. package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +0 -5
  72. package/dist/kernel/components/blocks/navigation-progress.cjs +0 -270
  73. package/dist/kernel/components/blocks/navigation-progress.d.cts +0 -16
  74. package/dist/kernel/components/blocks/next-prev.cjs +0 -142
  75. package/dist/kernel/components/blocks/next-prev.d.cts +0 -11
  76. package/dist/kernel/components/blocks/page-list.cjs +0 -59
  77. package/dist/kernel/components/blocks/page-list.d.cts +0 -11
  78. package/dist/kernel/components/blocks/search.cjs +0 -717
  79. package/dist/kernel/components/blocks/search.d.cts +0 -77
  80. package/dist/kernel/components/blocks/sidebar-node.cjs +0 -309
  81. package/dist/kernel/components/blocks/sidebar-node.d.cts +0 -8
  82. package/dist/kernel/components/blocks/sidebar.cjs +0 -317
  83. package/dist/kernel/components/blocks/sidebar.d.cts +0 -33
  84. package/dist/kernel/components/blocks/theme-toggle.cjs +0 -31
  85. package/dist/kernel/components/blocks/theme-toggle.d.cts +0 -6
  86. package/dist/kernel/components/blocks/toc.cjs +0 -356
  87. package/dist/kernel/components/blocks/toc.d.cts +0 -10
  88. package/dist/kernel/components/mdx/components/blockquote.cjs +0 -66
  89. package/dist/kernel/components/mdx/components/blockquote.d.cts +0 -6
  90. package/dist/kernel/components/mdx/components/callout.cjs +0 -137
  91. package/dist/kernel/components/mdx/components/callout.d.cts +0 -18
  92. package/dist/kernel/components/mdx/components/code-block.cjs +0 -39
  93. package/dist/kernel/components/mdx/components/code-block.d.cts +0 -9
  94. package/dist/kernel/components/mdx/components/figure-caption.cjs +0 -63
  95. package/dist/kernel/components/mdx/components/figure-caption.d.cts +0 -6
  96. package/dist/kernel/components/mdx/components/figure.cjs +0 -78
  97. package/dist/kernel/components/mdx/components/figure.d.cts +0 -10
  98. package/dist/kernel/components/mdx/components/footnotes.cjs +0 -66
  99. package/dist/kernel/components/mdx/components/footnotes.d.cts +0 -6
  100. package/dist/kernel/components/mdx/components/heading-copy-link.cjs +0 -108
  101. package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +0 -23
  102. package/dist/kernel/components/mdx/components/heading.cjs +0 -166
  103. package/dist/kernel/components/mdx/components/heading.d.cts +0 -8
  104. package/dist/kernel/components/mdx/components/hr.cjs +0 -34
  105. package/dist/kernel/components/mdx/components/hr.d.cts +0 -9
  106. package/dist/kernel/components/mdx/components/image-zoom.cjs +0 -49
  107. package/dist/kernel/components/mdx/components/image-zoom.d.cts +0 -10
  108. package/dist/kernel/components/mdx/components/image.cjs +0 -192
  109. package/dist/kernel/components/mdx/components/image.d.cts +0 -21
  110. package/dist/kernel/components/mdx/components/inline-code.cjs +0 -66
  111. package/dist/kernel/components/mdx/components/inline-code.d.cts +0 -6
  112. package/dist/kernel/components/mdx/components/kbd.cjs +0 -34
  113. package/dist/kernel/components/mdx/components/kbd.d.cts +0 -10
  114. package/dist/kernel/components/mdx/components/link.cjs +0 -49
  115. package/dist/kernel/components/mdx/components/link.d.cts +0 -11
  116. package/dist/kernel/components/mdx/components/paragraph.cjs +0 -87
  117. package/dist/kernel/components/mdx/components/paragraph.d.cts +0 -5
  118. package/dist/kernel/components/mdx/components/pre.cjs +0 -66
  119. package/dist/kernel/components/mdx/components/pre.d.cts +0 -6
  120. package/dist/kernel/components/mdx/components/strikethrough.cjs +0 -63
  121. package/dist/kernel/components/mdx/components/strikethrough.d.cts +0 -6
  122. package/dist/kernel/components/mdx/components/table.cjs +0 -59
  123. package/dist/kernel/components/mdx/components/table.d.cts +0 -10
  124. package/dist/kernel/components/mdx/components/task-list.cjs +0 -88
  125. package/dist/kernel/components/mdx/components/task-list.d.cts +0 -8
  126. package/dist/kernel/components/mdx/components/video-player.cjs +0 -173
  127. package/dist/kernel/components/mdx/components/video-player.d.cts +0 -18
  128. package/dist/kernel/components/mdx/components/video.cjs +0 -185
  129. package/dist/kernel/components/mdx/components/video.d.cts +0 -15
  130. package/dist/kernel/components/mdx/error-boundary.cjs +0 -62
  131. package/dist/kernel/components/mdx/error-boundary.d.cts +0 -8
  132. package/dist/kernel/components/mdx/error-fallback.cjs +0 -58
  133. package/dist/kernel/components/mdx/error-fallback.d.cts +0 -9
  134. package/dist/kernel/components/mdx/mdx.cjs +0 -141
  135. package/dist/kernel/components/mdx/mdx.d.cts +0 -22
  136. package/dist/kernel/components/mdx/rehype-heading-ids.cjs +0 -113
  137. package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +0 -10
  138. package/dist/kernel/components/mdx/types.cjs +0 -18
  139. package/dist/kernel/components/mdx/types.d.cts +0 -18
  140. package/dist/kernel/components/ui/accordion.cjs +0 -104
  141. package/dist/kernel/components/ui/accordion.d.cts +0 -16
  142. package/dist/kernel/components/ui/badge.cjs +0 -75
  143. package/dist/kernel/components/ui/badge.d.cts +0 -12
  144. package/dist/kernel/components/ui/badge.d.ts +0 -12
  145. package/dist/kernel/components/ui/badge.js +0 -47
  146. package/dist/kernel/components/ui/breadcrumb-trail.cjs +0 -238
  147. package/dist/kernel/components/ui/breadcrumb-trail.d.cts +0 -13
  148. package/dist/kernel/components/ui/breadcrumb.cjs +0 -399
  149. package/dist/kernel/components/ui/breadcrumb.d.cts +0 -52
  150. package/dist/kernel/components/ui/button-group.cjs +0 -144
  151. package/dist/kernel/components/ui/button-group.d.cts +0 -19
  152. package/dist/kernel/components/ui/button.cjs +0 -147
  153. package/dist/kernel/components/ui/button.d.cts +0 -23
  154. package/dist/kernel/components/ui/card.cjs +0 -133
  155. package/dist/kernel/components/ui/card.d.cts +0 -17
  156. package/dist/kernel/components/ui/dialog.cjs +0 -149
  157. package/dist/kernel/components/ui/dialog.d.cts +0 -22
  158. package/dist/kernel/components/ui/drawer.cjs +0 -163
  159. package/dist/kernel/components/ui/drawer.d.cts +0 -24
  160. package/dist/kernel/components/ui/input.cjs +0 -96
  161. package/dist/kernel/components/ui/input.d.cts +0 -18
  162. package/dist/kernel/components/ui/kbd.cjs +0 -105
  163. package/dist/kernel/components/ui/kbd.d.cts +0 -13
  164. package/dist/kernel/components/ui/link.cjs +0 -253
  165. package/dist/kernel/components/ui/link.d.cts +0 -31
  166. package/dist/kernel/components/ui/menu.cjs +0 -301
  167. package/dist/kernel/components/ui/menu.d.cts +0 -70
  168. package/dist/kernel/components/ui/meta-key.cjs +0 -34
  169. package/dist/kernel/components/ui/meta-key.d.cts +0 -12
  170. package/dist/kernel/components/ui/navigation-menu.cjs +0 -253
  171. package/dist/kernel/components/ui/navigation-menu.d.cts +0 -47
  172. package/dist/kernel/components/ui/popover.cjs +0 -168
  173. package/dist/kernel/components/ui/popover.d.cts +0 -24
  174. package/dist/kernel/components/ui/progress.cjs +0 -112
  175. package/dist/kernel/components/ui/progress.d.cts +0 -16
  176. package/dist/kernel/components/ui/scroll-area.cjs +0 -413
  177. package/dist/kernel/components/ui/scroll-area.d.cts +0 -58
  178. package/dist/kernel/components/ui/select.cjs +0 -244
  179. package/dist/kernel/components/ui/select.d.cts +0 -40
  180. package/dist/kernel/components/ui/separator.cjs +0 -73
  181. package/dist/kernel/components/ui/separator.d.cts +0 -8
  182. package/dist/kernel/components/ui/table.cjs +0 -131
  183. package/dist/kernel/components/ui/table.d.cts +0 -11
  184. package/dist/kernel/components/ui/tabs.cjs +0 -450
  185. package/dist/kernel/components/ui/tabs.d.cts +0 -82
  186. package/dist/kernel/components/ui/text.cjs +0 -184
  187. package/dist/kernel/components/ui/text.d.cts +0 -17
  188. package/dist/kernel/components/ui/theme-toggle.cjs +0 -108
  189. package/dist/kernel/components/ui/theme-toggle.d.cts +0 -10
  190. package/dist/kernel/components/ui/toast.cjs +0 -154
  191. package/dist/kernel/components/ui/toast.d.cts +0 -26
  192. package/dist/kernel/components/ui/tooltip.cjs +0 -127
  193. package/dist/kernel/components/ui/tooltip.d.cts +0 -20
  194. package/dist/kernel/defaults.registry.cjs +0 -541
  195. package/dist/kernel/defaults.registry.d.cts +0 -469
  196. package/dist/kernel/routes/agent/markdown.cjs +0 -202
  197. package/dist/kernel/routes/agent/markdown.d.cts +0 -58
  198. package/dist/kernel/routes/layouts/group.cjs +0 -181
  199. package/dist/kernel/routes/layouts/group.d.cts +0 -20
  200. package/dist/kernel/routes/metadata/feed.cjs +0 -293
  201. package/dist/kernel/routes/metadata/feed.d.cts +0 -20
  202. package/dist/kernel/routes/metadata/llms.cjs +0 -239
  203. package/dist/kernel/routes/metadata/llms.d.cts +0 -26
  204. package/dist/kernel/routes/metadata/og-image.cjs +0 -630
  205. package/dist/kernel/routes/metadata/og-image.d.cts +0 -62
  206. package/dist/kernel/routes/metadata/robots.cjs +0 -148
  207. package/dist/kernel/routes/metadata/robots.d.cts +0 -6
  208. package/dist/kernel/routes/metadata/sitemap.cjs +0 -192
  209. package/dist/kernel/routes/metadata/sitemap.d.cts +0 -8
  210. package/dist/kernel/routes/pages/group.cjs +0 -263
  211. package/dist/kernel/routes/pages/group.d.cts +0 -17
  212. package/dist/kernel/routes/pages/leaf.cjs +0 -421
  213. package/dist/kernel/routes/pages/leaf.d.cts +0 -36
  214. package/dist/kernel/routes/pages/root.cjs +0 -229
  215. package/dist/kernel/routes/pages/root.d.cts +0 -16
  216. package/dist/keyboard-shortcuts.cjs +0 -345
  217. package/dist/keyboard-shortcuts.d.cts +0 -34
  218. package/dist/resolvers/manifest-resolver.cjs +0 -111
  219. package/dist/resolvers/manifest-resolver.d.cts +0 -13
  220. package/dist/search.cjs +0 -411
  221. package/dist/search.d.cts +0 -20
  222. package/dist/types.cjs +0 -30
  223. package/dist/types.d.cts +0 -269
  224. package/dist/utils/cn.cjs +0 -49
  225. package/dist/utils/cn.d.cts +0 -15
  226. package/dist/utils/heading-ids.cjs +0 -119
  227. package/dist/utils/heading-ids.d.cts +0 -15
  228. package/dist/utils/pretty-date.cjs +0 -55
  229. package/dist/utils/pretty-date.d.cts +0 -6
@@ -1,5 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare function NavigationProgressPlayground(): react_jsx_runtime.JSX.Element;
4
-
5
- export { NavigationProgressPlayground };
@@ -1,270 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/kernel/components/blocks/navigation-progress.tsx
22
- var navigation_progress_exports = {};
23
- __export(navigation_progress_exports, {
24
- NavigationProgressBar: () => NavigationProgressBar,
25
- navigationProgressConfig: () => navigationProgressConfig
26
- });
27
- module.exports = __toCommonJS(navigation_progress_exports);
28
- var import_progress = require("../ui/progress.js");
29
-
30
- // src/utils/cn.ts
31
- var import_clsx = require("clsx");
32
- var import_tailwind_merge = require("tailwind-merge");
33
- var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
34
- extend: {
35
- classGroups: {
36
- z: [
37
- "z-content",
38
- "z-nav",
39
- "z-overlay",
40
- "z-modal",
41
- "z-search",
42
- "z-toast",
43
- "z-progress"
44
- ]
45
- }
46
- }
47
- });
48
- function cn(...inputs) {
49
- return twMerge((0, import_clsx.clsx)(inputs));
50
- }
51
-
52
- // src/kernel/components/blocks/navigation-progress.tsx
53
- var import_navigation = require("next/navigation");
54
- var import_react = require("react");
55
- var import_jsx_runtime = require("react/jsx-runtime");
56
- var navigationProgressConfig = {
57
- initialProgress: 0,
58
- targetProgress: 98,
59
- fastPhaseEnd: 38,
60
- minDuration: 48,
61
- maxDuration: 1800,
62
- completeDuration: 320,
63
- exitDuration: 188,
64
- settleDelay: 80,
65
- timeout: 8e3
66
- };
67
- function normalizePath(path) {
68
- const normalized = path.replace(/\/+$/, "");
69
- return normalized || "/";
70
- }
71
- function normalizeHref(href) {
72
- const [pathWithSearch = ""] = href.split("#");
73
- const [path = "", search = ""] = pathWithSearch.split("?");
74
- const normalizedPath = normalizePath(path);
75
- return search ? `${normalizedPath}?${search}` : normalizedPath;
76
- }
77
- function shouldShowProgressFor(fromPath, toPath) {
78
- if (!fromPath.trim() || !toPath.trim()) return false;
79
- if (/^(mailto:|tel:|sms:)/i.test(toPath)) return false;
80
- if (toPath.startsWith("#")) return false;
81
- if (toPath.startsWith("/_next/") || toPath.startsWith("/static/")) {
82
- return false;
83
- }
84
- return normalizeHref(fromPath) !== normalizeHref(toPath);
85
- }
86
- function useNavigationProgress() {
87
- const [progress, setProgress] = (0, import_react.useState)(0);
88
- const [isExiting, setIsExiting] = (0, import_react.useState)(false);
89
- const pathname = (0, import_navigation.usePathname)() || "/";
90
- const searchParams = (0, import_navigation.useSearchParams)();
91
- const currentUrl = `${pathname}${searchParams.size ? `?${searchParams}` : ""}`;
92
- const navigation = (0, import_react.useRef)(null);
93
- const animationFrame = (0, import_react.useRef)(null);
94
- const completionTimer = (0, import_react.useRef)(null);
95
- const cleanupTimer = (0, import_react.useRef)(null);
96
- const previousUrl = (0, import_react.useRef)("");
97
- const cleanup = (0, import_react.useCallback)(() => {
98
- if (animationFrame.current !== null) {
99
- cancelAnimationFrame(animationFrame.current);
100
- }
101
- if (completionTimer.current) clearTimeout(completionTimer.current);
102
- if (cleanupTimer.current) clearTimeout(cleanupTimer.current);
103
- if (navigation.current?.timeoutId) {
104
- clearTimeout(navigation.current.timeoutId);
105
- }
106
- animationFrame.current = null;
107
- completionTimer.current = null;
108
- cleanupTimer.current = null;
109
- navigation.current = null;
110
- }, []);
111
- const completeNavigation = (0, import_react.useCallback)(() => {
112
- if (!navigation.current) return;
113
- if (animationFrame.current !== null) {
114
- cancelAnimationFrame(animationFrame.current);
115
- animationFrame.current = null;
116
- }
117
- if (completionTimer.current) {
118
- clearTimeout(completionTimer.current);
119
- completionTimer.current = null;
120
- }
121
- if (cleanupTimer.current) {
122
- clearTimeout(cleanupTimer.current);
123
- cleanupTimer.current = null;
124
- }
125
- if (navigation.current.timeoutId) {
126
- clearTimeout(navigation.current.timeoutId);
127
- navigation.current.timeoutId = null;
128
- }
129
- setProgress(100);
130
- cleanupTimer.current = setTimeout(() => {
131
- if (!navigation.current) return;
132
- setIsExiting(true);
133
- cleanupTimer.current = setTimeout(() => {
134
- setProgress(0);
135
- setIsExiting(false);
136
- navigation.current = null;
137
- cleanupTimer.current = null;
138
- }, navigationProgressConfig.exitDuration);
139
- }, navigationProgressConfig.completeDuration);
140
- }, []);
141
- const reset = (0, import_react.useCallback)(() => {
142
- cleanup();
143
- setProgress(0);
144
- setIsExiting(false);
145
- }, [cleanup]);
146
- const startNavigation = (0, import_react.useCallback)(
147
- (fromPath, toPath) => {
148
- if (!shouldShowProgressFor(fromPath, toPath)) return;
149
- const normalizedTarget = normalizeHref(toPath);
150
- if (navigation.current?.targetPath === normalizedTarget) return;
151
- cleanup();
152
- setIsExiting(false);
153
- setProgress(navigationProgressConfig.initialProgress);
154
- const timeoutId = setTimeout(() => {
155
- completeNavigation();
156
- }, navigationProgressConfig.timeout);
157
- const startTime = Date.now();
158
- navigation.current = {
159
- startTime,
160
- targetPath: normalizedTarget,
161
- timeoutId
162
- };
163
- const animate = () => {
164
- if (!navigation.current) return;
165
- const elapsed = Date.now() - startTime;
166
- let progressValue;
167
- if (elapsed < navigationProgressConfig.minDuration) {
168
- progressValue = navigationProgressConfig.initialProgress + elapsed / navigationProgressConfig.minDuration * (navigationProgressConfig.fastPhaseEnd - navigationProgressConfig.initialProgress);
169
- } else {
170
- const remainingProgress = navigationProgressConfig.targetProgress - navigationProgressConfig.fastPhaseEnd;
171
- const normalizedTime = Math.min(
172
- 1,
173
- (elapsed - navigationProgressConfig.minDuration) / (navigationProgressConfig.maxDuration - navigationProgressConfig.minDuration)
174
- );
175
- const easedTime = 1 - (1 - normalizedTime) ** 3;
176
- progressValue = navigationProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
177
- }
178
- setProgress(
179
- Math.min(navigationProgressConfig.targetProgress, progressValue)
180
- );
181
- animationFrame.current = requestAnimationFrame(animate);
182
- };
183
- animationFrame.current = requestAnimationFrame(animate);
184
- },
185
- [cleanup, completeNavigation]
186
- );
187
- (0, import_react.useEffect)(() => {
188
- if (!previousUrl.current) {
189
- previousUrl.current = currentUrl;
190
- return;
191
- }
192
- if (navigation.current && currentUrl !== previousUrl.current) {
193
- if (completionTimer.current) clearTimeout(completionTimer.current);
194
- completionTimer.current = setTimeout(() => {
195
- completionTimer.current = null;
196
- completeNavigation();
197
- }, navigationProgressConfig.settleDelay);
198
- }
199
- previousUrl.current = currentUrl;
200
- }, [completeNavigation, currentUrl]);
201
- (0, import_react.useEffect)(() => {
202
- const handleClick = (event) => {
203
- if (event.button !== 0) return;
204
- if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
205
- return;
206
- }
207
- const target = event.target;
208
- if (!(target instanceof Element)) return;
209
- if (target.closest("button, input, select, textarea, [role='button']")) {
210
- return;
211
- }
212
- const anchor = target.closest("a");
213
- if (!anchor?.href) return;
214
- if (anchor.target && anchor.target !== "_self") return;
215
- if (anchor.hasAttribute("download")) return;
216
- try {
217
- const url = new URL(anchor.href, window.location.origin);
218
- if (url.origin !== window.location.origin) return;
219
- const targetPath = `${url.pathname}${url.search}`;
220
- startNavigation(currentUrl, targetPath);
221
- } catch {
222
- return;
223
- }
224
- };
225
- document.addEventListener("click", handleClick);
226
- return () => document.removeEventListener("click", handleClick);
227
- }, [currentUrl, startNavigation]);
228
- (0, import_react.useEffect)(() => reset, [reset]);
229
- return { isExiting, progress };
230
- }
231
- function NavigationProgressContent() {
232
- const { isExiting, progress } = useNavigationProgress();
233
- const isVisible = progress > 0;
234
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
235
- import_progress.Progress,
236
- {
237
- "aria-label": "Page navigation",
238
- className: cn(
239
- "pointer-events-none fixed left-0 right-0 top-0 z-progress overflow-hidden transition-opacity duration-300",
240
- isVisible ? "opacity-100" : "opacity-0"
241
- ),
242
- style: {
243
- height: "var(--progress-bar-height, 2px)"
244
- },
245
- value: isVisible ? progress : null,
246
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_progress.ProgressTrack, { className: "h-full rounded-none bg-progress-bar-background", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
247
- import_progress.ProgressIndicator,
248
- {
249
- className: cn(
250
- "h-full w-full rounded-none bg-progress-bar-fill",
251
- progress === 0 && "scale-x-0"
252
- ),
253
- style: {
254
- transform: isExiting ? "scaleX(0)" : `scaleX(${Math.max(0, Math.min(100, progress)) / 100})`,
255
- transformOrigin: isExiting ? "right" : "left",
256
- transition: isExiting ? `transform ${navigationProgressConfig.exitDuration}ms var(--animation-ease-progress-exit)` : `transform ${navigationProgressConfig.completeDuration}ms var(--animation-ease-progress)`
257
- }
258
- }
259
- ) })
260
- }
261
- );
262
- }
263
- function NavigationProgressBar() {
264
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationProgressContent, {}) });
265
- }
266
- // Annotate the CommonJS export names for ESM import in node:
267
- 0 && (module.exports = {
268
- NavigationProgressBar,
269
- navigationProgressConfig
270
- });
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare const navigationProgressConfig: {
4
- initialProgress: number;
5
- targetProgress: number;
6
- fastPhaseEnd: number;
7
- minDuration: number;
8
- maxDuration: number;
9
- completeDuration: number;
10
- exitDuration: number;
11
- settleDelay: number;
12
- timeout: number;
13
- };
14
- declare function NavigationProgressBar(): react_jsx_runtime.JSX.Element;
15
-
16
- export { NavigationProgressBar, navigationProgressConfig };
@@ -1,142 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/kernel/components/blocks/next-prev.tsx
31
- var next_prev_exports = {};
32
- __export(next_prev_exports, {
33
- NextPrev: () => NextPrev
34
- });
35
- module.exports = __toCommonJS(next_prev_exports);
36
-
37
- // src/utils/cn.ts
38
- var import_clsx = require("clsx");
39
- var import_tailwind_merge = require("tailwind-merge");
40
- var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
41
- extend: {
42
- classGroups: {
43
- z: [
44
- "z-content",
45
- "z-nav",
46
- "z-overlay",
47
- "z-modal",
48
- "z-search",
49
- "z-toast",
50
- "z-progress"
51
- ]
52
- }
53
- }
54
- });
55
- function cn(...inputs) {
56
- return twMerge((0, import_clsx.clsx)(inputs));
57
- }
58
-
59
- // src/kernel/components/blocks/next-prev.tsx
60
- var import_lucide_react = require("lucide-react");
61
- var import_link = __toESM(require("next/link"), 1);
62
- var import_jsx_runtime = require("react/jsx-runtime");
63
- function pageNodes(nodes) {
64
- return nodes.flatMap((node) => {
65
- if (node.type === "page") return [node];
66
- if (node.type === "section" || node.type === "folder") {
67
- return pageNodes(node.children);
68
- }
69
- return [];
70
- });
71
- }
72
- function DirectionIcon({ direction }) {
73
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 text-foreground-3 transition-colors duration-200 group-hover/next-prev:text-foreground-2", children: direction === "previous" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeft, { "aria-hidden": "true", size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRight, { "aria-hidden": "true", size: 14 }) });
74
- }
75
- function NavigationCard({
76
- direction,
77
- page
78
- }) {
79
- const isNext = direction === "next";
80
- const label = isNext ? "Next" : "Previous";
81
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
- import_link.default,
83
- {
84
- className: cn(
85
- "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",
86
- isNext && "md:text-right"
87
- ),
88
- href: page.path,
89
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
90
- "span",
91
- {
92
- className: cn(
93
- "flex h-full w-full flex-col gap-2 rounded-[max(calc(var(--radius-card)-1px),0px)] p-4 transition-colors duration-300 group-hover/next-prev:bg-surface-hover group-active/next-prev:bg-surface-active",
94
- isNext ? "items-start md:items-end" : "items-start"
95
- ),
96
- children: [
97
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
98
- "span",
99
- {
100
- className: cn(
101
- "flex w-full items-center gap-1.5",
102
- isNext && "md:justify-end"
103
- ),
104
- children: [
105
- !isNext && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionIcon, { direction }),
106
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs font-medium leading-none text-foreground-3 transition-colors duration-200", children: label }),
107
- isNext && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionIcon, { direction })
108
- ]
109
- }
110
- ),
111
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "line-clamp-2 text-sm font-medium leading-6 text-foreground-1 transition-colors duration-200", children: page.title })
112
- ]
113
- }
114
- )
115
- }
116
- );
117
- }
118
- function NextPrev({ className, currentPath, tree }) {
119
- const pages = pageNodes(tree);
120
- const index = pages.findIndex((page) => page.path === currentPath);
121
- const previous = index > 0 ? pages[index - 1] : null;
122
- const next = index >= 0 ? pages[index + 1] : null;
123
- const hasBoth = Boolean(previous && next);
124
- if (!previous && !next) return null;
125
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": "Previous and next pages", className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
126
- "div",
127
- {
128
- className: cn(
129
- "grid gap-4 border-t border-stroke-3 pt-6",
130
- hasBoth && "md:grid-cols-2"
131
- ),
132
- children: [
133
- previous ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationCard, { direction: "previous", page: previous }) : null,
134
- next ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationCard, { direction: "next", page: next }) : null
135
- ]
136
- }
137
- ) });
138
- }
139
- // Annotate the CommonJS export names for ESM import in node:
140
- 0 && (module.exports = {
141
- NextPrev
142
- });
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TreeNode } from '@publish.os/nextjs/types';
3
-
4
- type NextPrevProps = {
5
- className?: string;
6
- currentPath?: string;
7
- tree: TreeNode[];
8
- };
9
- declare function NextPrev({ className, currentPath, tree }: NextPrevProps): react_jsx_runtime.JSX.Element | null;
10
-
11
- export { NextPrev, type NextPrevProps };
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/kernel/components/blocks/page-list.tsx
21
- var page_list_exports = {};
22
- __export(page_list_exports, {
23
- PageList: () => PageList
24
- });
25
- module.exports = __toCommonJS(page_list_exports);
26
- var import_link = require("../ui/link.js");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- function pageNodes(nodes) {
29
- return nodes.flatMap((node) => {
30
- if (node.type === "page") return [node];
31
- if (node.type === "section" || node.type === "folder") {
32
- return pageNodes(node.children);
33
- }
34
- return [];
35
- });
36
- }
37
- function PageList({ tree, currentPath, className }) {
38
- const pages = pageNodes(tree);
39
- if (pages.length === 0) {
40
- return null;
41
- }
42
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": "Pages in this group", className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "space-y-2 text-sm", children: pages.map((page) => {
43
- const active = page.path === currentPath;
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- import_link.Link,
46
- {
47
- active,
48
- color: active ? "accent" : "default",
49
- href: page.path,
50
- size: "sm",
51
- children: page.title
52
- }
53
- ) }, `${page.group}:${page.fileID}`);
54
- }) }) });
55
- }
56
- // Annotate the CommonJS export names for ESM import in node:
57
- 0 && (module.exports = {
58
- PageList
59
- });
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TreeNode } from '@publish.os/nextjs/types';
3
-
4
- type PageListProps = {
5
- tree: TreeNode[];
6
- currentPath?: string;
7
- className?: string;
8
- };
9
- declare function PageList({ tree, currentPath, className }: PageListProps): react_jsx_runtime.JSX.Element | null;
10
-
11
- export { PageList };