@publish.os/nextjs 0.0.1-alpha.5 → 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 (214) 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/logo-block.js +1 -1
  6. package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -12
  7. package/dist/kernel/components/mdx/components/image.js +1 -1
  8. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -1
  9. package/dist/kernel/components/ui/breadcrumb-trail.js +1 -0
  10. package/dist/kernel/components/ui/breadcrumb.d.ts +1 -5
  11. package/dist/kernel/components/ui/breadcrumb.js +1 -16
  12. package/dist/kernel/components/ui/menu.js +5 -5
  13. package/dist/kernel/components/ui/navigation-menu.js +2 -2
  14. package/dist/kernel/components/ui/popover.js +5 -11
  15. package/dist/kernel/components/ui/select.js +5 -5
  16. package/dist/kernel/components/ui/text.js +109 -106
  17. package/dist/kernel/components/ui/tooltip.js +2 -2
  18. package/dist/kernel/defaults.registry.d.ts +60 -69
  19. package/dist/kernel/defaults.registry.js +59 -67
  20. package/dist/kernel/routes/agent/markdown.js +2 -2
  21. package/dist/kernel/routes/metadata/feed.js +2 -2
  22. package/dist/kernel/routes/metadata/llms.js +4 -2
  23. package/dist/kernel/routes/metadata/og-image.d.ts +1 -1
  24. package/dist/kernel/routes/metadata/robots.js +2 -2
  25. package/dist/kernel/routes/metadata/sitemap.js +2 -2
  26. package/dist/utils/cn.d.ts +1 -1
  27. package/package.json +2 -6
  28. package/release/package.json +3 -2
  29. package/release/release.json +5 -5
  30. package/release/{pnpm-lock.yaml → runtime-pnpm-lock.yaml} +135 -34
  31. package/dist/cache/tags.cjs +0 -79
  32. package/dist/cache/tags.d.cts +0 -13
  33. package/dist/config/createNextConfig.cjs +0 -52
  34. package/dist/config/createNextConfig.d.cts +0 -8
  35. package/dist/config.cjs +0 -78
  36. package/dist/config.d.cts +0 -101
  37. package/dist/config.d.ts +0 -101
  38. package/dist/config.js +0 -48
  39. package/dist/index.cjs +0 -1266
  40. package/dist/index.d.cts +0 -18
  41. package/dist/kernel/components/blocks/AgentActions.cjs +0 -425
  42. package/dist/kernel/components/blocks/AgentActions.d.cts +0 -52
  43. package/dist/kernel/components/blocks/animated-icon-swap.cjs +0 -101
  44. package/dist/kernel/components/blocks/animated-icon-swap.d.cts +0 -16
  45. package/dist/kernel/components/blocks/color-palette.cjs +0 -413
  46. package/dist/kernel/components/blocks/color-palette.d.cts +0 -7
  47. package/dist/kernel/components/blocks/design-system-preview.cjs +0 -593
  48. package/dist/kernel/components/blocks/design-system-preview.d.cts +0 -29
  49. package/dist/kernel/components/blocks/link-playground.cjs +0 -816
  50. package/dist/kernel/components/blocks/link-playground.d.cts +0 -5
  51. package/dist/kernel/components/blocks/logo-block.cjs +0 -156
  52. package/dist/kernel/components/blocks/logo-block.d.cts +0 -21
  53. package/dist/kernel/components/blocks/nav-breadcrumb.cjs +0 -122
  54. package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +0 -11
  55. package/dist/kernel/components/blocks/navbar.cjs +0 -154
  56. package/dist/kernel/components/blocks/navbar.d.cts +0 -16
  57. package/dist/kernel/components/blocks/navigation-progress-playground.cjs +0 -735
  58. package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +0 -5
  59. package/dist/kernel/components/blocks/navigation-progress.cjs +0 -270
  60. package/dist/kernel/components/blocks/navigation-progress.d.cts +0 -16
  61. package/dist/kernel/components/blocks/next-prev.cjs +0 -142
  62. package/dist/kernel/components/blocks/next-prev.d.cts +0 -11
  63. package/dist/kernel/components/blocks/page-list.cjs +0 -59
  64. package/dist/kernel/components/blocks/page-list.d.cts +0 -11
  65. package/dist/kernel/components/blocks/search.cjs +0 -717
  66. package/dist/kernel/components/blocks/search.d.cts +0 -77
  67. package/dist/kernel/components/blocks/sidebar-node.cjs +0 -309
  68. package/dist/kernel/components/blocks/sidebar-node.d.cts +0 -8
  69. package/dist/kernel/components/blocks/sidebar.cjs +0 -317
  70. package/dist/kernel/components/blocks/sidebar.d.cts +0 -33
  71. package/dist/kernel/components/blocks/theme-toggle.cjs +0 -31
  72. package/dist/kernel/components/blocks/theme-toggle.d.cts +0 -6
  73. package/dist/kernel/components/blocks/toc.cjs +0 -356
  74. package/dist/kernel/components/blocks/toc.d.cts +0 -10
  75. package/dist/kernel/components/mdx/components/blockquote.cjs +0 -66
  76. package/dist/kernel/components/mdx/components/blockquote.d.cts +0 -6
  77. package/dist/kernel/components/mdx/components/callout.cjs +0 -137
  78. package/dist/kernel/components/mdx/components/callout.d.cts +0 -18
  79. package/dist/kernel/components/mdx/components/code-block.cjs +0 -39
  80. package/dist/kernel/components/mdx/components/code-block.d.cts +0 -9
  81. package/dist/kernel/components/mdx/components/figure-caption.cjs +0 -63
  82. package/dist/kernel/components/mdx/components/figure-caption.d.cts +0 -6
  83. package/dist/kernel/components/mdx/components/figure.cjs +0 -78
  84. package/dist/kernel/components/mdx/components/figure.d.cts +0 -10
  85. package/dist/kernel/components/mdx/components/footnotes.cjs +0 -66
  86. package/dist/kernel/components/mdx/components/footnotes.d.cts +0 -6
  87. package/dist/kernel/components/mdx/components/heading-copy-link.cjs +0 -108
  88. package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +0 -23
  89. package/dist/kernel/components/mdx/components/heading.cjs +0 -166
  90. package/dist/kernel/components/mdx/components/heading.d.cts +0 -8
  91. package/dist/kernel/components/mdx/components/hr.cjs +0 -34
  92. package/dist/kernel/components/mdx/components/hr.d.cts +0 -9
  93. package/dist/kernel/components/mdx/components/image-zoom.cjs +0 -49
  94. package/dist/kernel/components/mdx/components/image-zoom.d.cts +0 -10
  95. package/dist/kernel/components/mdx/components/image.cjs +0 -192
  96. package/dist/kernel/components/mdx/components/image.d.cts +0 -21
  97. package/dist/kernel/components/mdx/components/inline-code.cjs +0 -66
  98. package/dist/kernel/components/mdx/components/inline-code.d.cts +0 -6
  99. package/dist/kernel/components/mdx/components/kbd.cjs +0 -34
  100. package/dist/kernel/components/mdx/components/kbd.d.cts +0 -10
  101. package/dist/kernel/components/mdx/components/link.cjs +0 -49
  102. package/dist/kernel/components/mdx/components/link.d.cts +0 -11
  103. package/dist/kernel/components/mdx/components/paragraph.cjs +0 -87
  104. package/dist/kernel/components/mdx/components/paragraph.d.cts +0 -5
  105. package/dist/kernel/components/mdx/components/pre.cjs +0 -66
  106. package/dist/kernel/components/mdx/components/pre.d.cts +0 -6
  107. package/dist/kernel/components/mdx/components/strikethrough.cjs +0 -63
  108. package/dist/kernel/components/mdx/components/strikethrough.d.cts +0 -6
  109. package/dist/kernel/components/mdx/components/table.cjs +0 -59
  110. package/dist/kernel/components/mdx/components/table.d.cts +0 -10
  111. package/dist/kernel/components/mdx/components/task-list.cjs +0 -88
  112. package/dist/kernel/components/mdx/components/task-list.d.cts +0 -8
  113. package/dist/kernel/components/mdx/components/video-player.cjs +0 -173
  114. package/dist/kernel/components/mdx/components/video-player.d.cts +0 -18
  115. package/dist/kernel/components/mdx/components/video.cjs +0 -185
  116. package/dist/kernel/components/mdx/components/video.d.cts +0 -15
  117. package/dist/kernel/components/mdx/error-boundary.cjs +0 -62
  118. package/dist/kernel/components/mdx/error-boundary.d.cts +0 -8
  119. package/dist/kernel/components/mdx/error-fallback.cjs +0 -58
  120. package/dist/kernel/components/mdx/error-fallback.d.cts +0 -9
  121. package/dist/kernel/components/mdx/mdx.cjs +0 -141
  122. package/dist/kernel/components/mdx/mdx.d.cts +0 -22
  123. package/dist/kernel/components/mdx/rehype-heading-ids.cjs +0 -113
  124. package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +0 -10
  125. package/dist/kernel/components/mdx/types.cjs +0 -18
  126. package/dist/kernel/components/mdx/types.d.cts +0 -18
  127. package/dist/kernel/components/ui/accordion.cjs +0 -104
  128. package/dist/kernel/components/ui/accordion.d.cts +0 -16
  129. package/dist/kernel/components/ui/breadcrumb-trail.cjs +0 -238
  130. package/dist/kernel/components/ui/breadcrumb-trail.d.cts +0 -13
  131. package/dist/kernel/components/ui/breadcrumb.cjs +0 -399
  132. package/dist/kernel/components/ui/breadcrumb.d.cts +0 -52
  133. package/dist/kernel/components/ui/button-group.cjs +0 -143
  134. package/dist/kernel/components/ui/button-group.d.cts +0 -19
  135. package/dist/kernel/components/ui/button.cjs +0 -139
  136. package/dist/kernel/components/ui/button.d.cts +0 -22
  137. package/dist/kernel/components/ui/card.cjs +0 -133
  138. package/dist/kernel/components/ui/card.d.cts +0 -17
  139. package/dist/kernel/components/ui/dialog.cjs +0 -149
  140. package/dist/kernel/components/ui/dialog.d.cts +0 -22
  141. package/dist/kernel/components/ui/drawer.cjs +0 -163
  142. package/dist/kernel/components/ui/drawer.d.cts +0 -24
  143. package/dist/kernel/components/ui/input.cjs +0 -96
  144. package/dist/kernel/components/ui/input.d.cts +0 -18
  145. package/dist/kernel/components/ui/kbd.cjs +0 -105
  146. package/dist/kernel/components/ui/kbd.d.cts +0 -13
  147. package/dist/kernel/components/ui/link.cjs +0 -253
  148. package/dist/kernel/components/ui/link.d.cts +0 -31
  149. package/dist/kernel/components/ui/menu.cjs +0 -301
  150. package/dist/kernel/components/ui/menu.d.cts +0 -70
  151. package/dist/kernel/components/ui/meta-key.cjs +0 -34
  152. package/dist/kernel/components/ui/meta-key.d.cts +0 -12
  153. package/dist/kernel/components/ui/navigation-menu.cjs +0 -253
  154. package/dist/kernel/components/ui/navigation-menu.d.cts +0 -47
  155. package/dist/kernel/components/ui/popover.cjs +0 -168
  156. package/dist/kernel/components/ui/popover.d.cts +0 -24
  157. package/dist/kernel/components/ui/progress.cjs +0 -112
  158. package/dist/kernel/components/ui/progress.d.cts +0 -16
  159. package/dist/kernel/components/ui/scroll-area.cjs +0 -413
  160. package/dist/kernel/components/ui/scroll-area.d.cts +0 -58
  161. package/dist/kernel/components/ui/select.cjs +0 -244
  162. package/dist/kernel/components/ui/select.d.cts +0 -40
  163. package/dist/kernel/components/ui/separator.cjs +0 -73
  164. package/dist/kernel/components/ui/separator.d.cts +0 -8
  165. package/dist/kernel/components/ui/table.cjs +0 -131
  166. package/dist/kernel/components/ui/table.d.cts +0 -11
  167. package/dist/kernel/components/ui/tabs.cjs +0 -450
  168. package/dist/kernel/components/ui/tabs.d.cts +0 -82
  169. package/dist/kernel/components/ui/tag.cjs +0 -104
  170. package/dist/kernel/components/ui/tag.d.cts +0 -14
  171. package/dist/kernel/components/ui/text.cjs +0 -184
  172. package/dist/kernel/components/ui/text.d.cts +0 -17
  173. package/dist/kernel/components/ui/theme-toggle.cjs +0 -108
  174. package/dist/kernel/components/ui/theme-toggle.d.cts +0 -10
  175. package/dist/kernel/components/ui/toast.cjs +0 -154
  176. package/dist/kernel/components/ui/toast.d.cts +0 -26
  177. package/dist/kernel/components/ui/tooltip.cjs +0 -127
  178. package/dist/kernel/components/ui/tooltip.d.cts +0 -20
  179. package/dist/kernel/defaults.registry.cjs +0 -541
  180. package/dist/kernel/defaults.registry.d.cts +0 -469
  181. package/dist/kernel/routes/agent/markdown.cjs +0 -202
  182. package/dist/kernel/routes/agent/markdown.d.cts +0 -58
  183. package/dist/kernel/routes/layouts/group.cjs +0 -181
  184. package/dist/kernel/routes/layouts/group.d.cts +0 -20
  185. package/dist/kernel/routes/metadata/feed.cjs +0 -293
  186. package/dist/kernel/routes/metadata/feed.d.cts +0 -20
  187. package/dist/kernel/routes/metadata/llms.cjs +0 -239
  188. package/dist/kernel/routes/metadata/llms.d.cts +0 -26
  189. package/dist/kernel/routes/metadata/og-image.cjs +0 -630
  190. package/dist/kernel/routes/metadata/og-image.d.cts +0 -62
  191. package/dist/kernel/routes/metadata/robots.cjs +0 -148
  192. package/dist/kernel/routes/metadata/robots.d.cts +0 -6
  193. package/dist/kernel/routes/metadata/sitemap.cjs +0 -192
  194. package/dist/kernel/routes/metadata/sitemap.d.cts +0 -8
  195. package/dist/kernel/routes/pages/group.cjs +0 -263
  196. package/dist/kernel/routes/pages/group.d.cts +0 -17
  197. package/dist/kernel/routes/pages/leaf.cjs +0 -421
  198. package/dist/kernel/routes/pages/leaf.d.cts +0 -36
  199. package/dist/kernel/routes/pages/root.cjs +0 -229
  200. package/dist/kernel/routes/pages/root.d.cts +0 -16
  201. package/dist/keyboard-shortcuts.cjs +0 -345
  202. package/dist/keyboard-shortcuts.d.cts +0 -34
  203. package/dist/resolvers/manifest-resolver.cjs +0 -111
  204. package/dist/resolvers/manifest-resolver.d.cts +0 -13
  205. package/dist/search.cjs +0 -411
  206. package/dist/search.d.cts +0 -20
  207. package/dist/types.cjs +0 -30
  208. package/dist/types.d.cts +0 -269
  209. package/dist/utils/cn.cjs +0 -49
  210. package/dist/utils/cn.d.cts +0 -15
  211. package/dist/utils/heading-ids.cjs +0 -119
  212. package/dist/utils/heading-ids.d.cts +0 -15
  213. package/dist/utils/pretty-date.cjs +0 -55
  214. package/dist/utils/pretty-date.d.cts +0 -6
@@ -1,317 +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/sidebar.tsx
22
- var sidebar_exports = {};
23
- __export(sidebar_exports, {
24
- Sidebar: () => Sidebar
25
- });
26
- module.exports = __toCommonJS(sidebar_exports);
27
- var import_sidebar_node = require("./sidebar-node.js");
28
- var import_scroll_area = require("../ui/scroll-area.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/sidebar.tsx
53
- var import_navigation = require("next/navigation");
54
- var import_react = require("react");
55
- var import_jsx_runtime = require("react/jsx-runtime");
56
- function normalizePath(path) {
57
- if (!path) return "";
58
- const [withoutQuery = ""] = path.split(/[?#]/);
59
- if (withoutQuery === "/") return "/";
60
- return withoutQuery.replace(/\/+$/g, "");
61
- }
62
- function isExternalHref(href) {
63
- return /^[a-z][a-z0-9+.-]*:/i.test(href) || href.startsWith("//");
64
- }
65
- function nodeHref(node) {
66
- if (node.type === "link") return node.href;
67
- if ("path" in node && typeof node.path === "string") return node.path;
68
- return void 0;
69
- }
70
- function nodeChildren(node) {
71
- return Array.isArray(node.children) ? node.children : [];
72
- }
73
- function nodeKey(node, parentKey) {
74
- const prefix = parentKey ? `${parentKey}/` : "";
75
- if (node.type === "page") return `${prefix}page:${node.fileID}`;
76
- if (node.type === "link") return `${prefix}link:${node.id}`;
77
- return `${prefix}${node.type}:${node.id}`;
78
- }
79
- function isActivePath(path, currentPath) {
80
- if (!path || isExternalHref(path)) return false;
81
- const normalizedPath = normalizePath(path);
82
- const normalizedCurrentPath = normalizePath(currentPath);
83
- if (!normalizedPath) return false;
84
- return normalizedCurrentPath === normalizedPath || normalizedCurrentPath.startsWith(`${normalizedPath}/`);
85
- }
86
- function isExactActivePath(path, currentPath) {
87
- if (!path || isExternalHref(path)) return false;
88
- return normalizePath(path) === normalizePath(currentPath);
89
- }
90
- function createActiveIndex({
91
- currentPath,
92
- tree
93
- }) {
94
- const activeIndex = /* @__PURE__ */ new Map();
95
- function visit(node) {
96
- const href = nodeHref(node);
97
- const exactActive = isExactActivePath(href, currentPath);
98
- const pathActive = node.type === "page" && isActivePath(href, currentPath);
99
- const childActive = nodeChildren(node).some(visit);
100
- const activeState = exactActive ? "path-active" : childActive || pathActive ? "child-path-active" : void 0;
101
- activeIndex.set(node, {
102
- activeState,
103
- initiallyExpanded: exactActive || pathActive || childActive
104
- });
105
- return exactActive || pathActive || childActive;
106
- }
107
- for (const node of tree) {
108
- visit(node);
109
- }
110
- return activeIndex;
111
- }
112
- function safeIdPart(value) {
113
- return value.replace(/[^a-zA-Z0-9-]/g, "-");
114
- }
115
- function nodeContentId({
116
- instanceId,
117
- node
118
- }) {
119
- const key = "path" in node && node.path ? node.path : node.type === "page" ? node.fileID : node.id;
120
- return `sidebar-${safeIdPart(instanceId)}-${safeIdPart(key)}`;
121
- }
122
- function clampDepth(depth) {
123
- return Math.min(depth, 12);
124
- }
125
- function ExpandableChildren({
126
- activeIndex,
127
- activeItemRef,
128
- contentId,
129
- currentPath,
130
- depth,
131
- expanded,
132
- instanceId,
133
- nodes,
134
- parentExpanded,
135
- renderChildren
136
- }) {
137
- const childFocusable = parentExpanded && expanded;
138
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
139
- "div",
140
- {
141
- "aria-hidden": !expanded,
142
- className: cn(
143
- "grid overflow-hidden transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",
144
- expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
145
- ),
146
- "data-state": expanded ? "open" : "closed",
147
- id: contentId,
148
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px py-0.5", children: renderChildren ? nodes.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
- SidebarTreeItem,
150
- {
151
- activeIndex,
152
- activeItemRef,
153
- currentPath,
154
- depth: clampDepth(depth + 1),
155
- instanceId,
156
- itemKey: nodeKey(child, contentId),
157
- node: child,
158
- parentExpanded: childFocusable
159
- },
160
- nodeKey(child, contentId)
161
- )) : null }) })
162
- }
163
- );
164
- }
165
- var SidebarTreeItem = (0, import_react.memo)(function SidebarTreeItem2({
166
- activeIndex,
167
- activeItemRef,
168
- currentPath,
169
- depth,
170
- instanceId,
171
- itemKey,
172
- node,
173
- parentExpanded
174
- }) {
175
- const nodes = nodeChildren(node);
176
- const href = nodeHref(node);
177
- const activeInfo = activeIndex.get(node);
178
- const activeState = activeInfo?.activeState;
179
- const initiallyExpanded = Boolean(activeInfo?.initiallyExpanded);
180
- const isExpandable = nodes.length > 0 && (node.type === "folder" || node.type === "page");
181
- const [expanded, setExpanded] = (0, import_react.useState)(initiallyExpanded);
182
- const [renderChildren, setRenderChildren] = (0, import_react.useState)(initiallyExpanded);
183
- const interactedRef = (0, import_react.useRef)(false);
184
- const lastPathRef = (0, import_react.useRef)(normalizePath(currentPath));
185
- const contentId = nodeContentId({ instanceId, node });
186
- (0, import_react.useEffect)(() => {
187
- const normalizedCurrentPath = normalizePath(currentPath);
188
- const pathChanged = lastPathRef.current !== normalizedCurrentPath;
189
- if (pathChanged) {
190
- interactedRef.current = false;
191
- lastPathRef.current = normalizedCurrentPath;
192
- }
193
- if (initiallyExpanded && !expanded && !interactedRef.current) {
194
- setRenderChildren(true);
195
- (0, import_react.startTransition)(() => setExpanded(true));
196
- }
197
- }, [currentPath, expanded, initiallyExpanded]);
198
- const toggleExpanded = (0, import_react.useCallback)(() => {
199
- interactedRef.current = true;
200
- setRenderChildren(true);
201
- setExpanded((value) => !value);
202
- }, []);
203
- const expandOnNavigate = (0, import_react.useCallback)(() => {
204
- interactedRef.current = true;
205
- setRenderChildren(true);
206
- setExpanded(true);
207
- }, []);
208
- const pageWithChildrenLinkClick = node.type === "page" && nodes.length > 0 ? expandOnNavigate : void 0;
209
- const children = isExpandable && nodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
- ExpandableChildren,
211
- {
212
- activeIndex,
213
- activeItemRef,
214
- contentId,
215
- currentPath,
216
- depth,
217
- expanded,
218
- instanceId,
219
- nodes,
220
- parentExpanded,
221
- renderChildren
222
- }
223
- ) : node.type === "section" && nodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px", children: nodes.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
224
- SidebarTreeItem2,
225
- {
226
- activeIndex,
227
- activeItemRef,
228
- currentPath,
229
- depth,
230
- instanceId,
231
- itemKey: nodeKey(child, itemKey),
232
- node: child,
233
- parentExpanded
234
- },
235
- nodeKey(child, itemKey)
236
- )) }) : null;
237
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
238
- import_sidebar_node.SidebarNode,
239
- {
240
- activeState,
241
- activeItemRef: activeState === "path-active" ? activeItemRef : void 0,
242
- contentId: isExpandable ? contentId : void 0,
243
- depth,
244
- expanded: isExpandable ? expanded : void 0,
245
- href,
246
- isExpandable,
247
- node,
248
- onLinkClick: pageWithChildrenLinkClick,
249
- onToggle: isExpandable ? toggleExpanded : void 0,
250
- parentExpanded,
251
- title: node.title,
252
- children
253
- }
254
- );
255
- });
256
- function Sidebar({ className, currentPath, title, tree }) {
257
- const pathname = (0, import_navigation.usePathname)();
258
- const resolvedCurrentPath = pathname ?? currentPath ?? "";
259
- const instanceId = (0, import_react.useId)();
260
- const activeItemRef = (0, import_react.useRef)(null);
261
- const activeIndex = (0, import_react.useMemo)(
262
- () => createActiveIndex({ currentPath: resolvedCurrentPath, tree }),
263
- [resolvedCurrentPath, tree]
264
- );
265
- (0, import_react.useEffect)(() => {
266
- const scrollPath = resolvedCurrentPath;
267
- const frame = window.requestAnimationFrame(() => {
268
- if (!scrollPath) return;
269
- activeItemRef.current?.scrollIntoView({
270
- block: "nearest",
271
- inline: "nearest"
272
- });
273
- });
274
- return () => window.cancelAnimationFrame(frame);
275
- }, [resolvedCurrentPath]);
276
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
277
- "nav",
278
- {
279
- "aria-label": "Documentation navigation",
280
- className: cn(
281
- "flex h-full min-h-0 w-(--layout-sidebar-width) min-w-(--layout-sidebar-width) max-w-(--layout-sidebar-width) flex-col overflow-hidden pb-4",
282
- className
283
- ),
284
- children: [
285
- title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 px-5 pb-2 pt-5 text-xs font-semibold uppercase tracking-wide text-foreground-3", children: title }) : null,
286
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
287
- import_scroll_area.ScrollArea,
288
- {
289
- className: "min-h-0 flex-1",
290
- corner: true,
291
- mask: { height: 24 },
292
- scrollbarClassName: "opacity-0 transition-opacity data-[hovering]:opacity-100 data-[scrolling]:opacity-100",
293
- variant: "gradient",
294
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-px px-2 py-3", children: tree.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
295
- SidebarTreeItem,
296
- {
297
- activeIndex,
298
- activeItemRef,
299
- currentPath: resolvedCurrentPath,
300
- depth: 0,
301
- instanceId,
302
- itemKey: nodeKey(node, ""),
303
- node,
304
- parentExpanded: true
305
- },
306
- nodeKey(node, "")
307
- )) })
308
- }
309
- )
310
- ]
311
- }
312
- );
313
- }
314
- // Annotate the CommonJS export names for ESM import in node:
315
- 0 && (module.exports = {
316
- Sidebar
317
- });
@@ -1,33 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TreeNode } from '@publish.os/nextjs/types';
3
- import { Ref, ReactNode, MouseEvent } from 'react';
4
-
5
- type SidebarTreeNode = TreeNode & {
6
- children?: SidebarTreeNode[];
7
- };
8
- type SidebarActiveState = "path-active" | "child-path-active";
9
- type SidebarDepth = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
- type SidebarNodePrimitiveProps = {
11
- activeState?: SidebarActiveState;
12
- activeItemRef?: Ref<HTMLDivElement>;
13
- children?: ReactNode;
14
- contentId?: string;
15
- depth: SidebarDepth;
16
- expanded?: boolean;
17
- href?: string;
18
- isExpandable?: boolean;
19
- node: SidebarTreeNode;
20
- onLinkClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
21
- onToggle?: () => void;
22
- parentExpanded: boolean;
23
- title: string;
24
- };
25
- type SidebarProps = {
26
- className?: string;
27
- currentPath?: string;
28
- title?: ReactNode;
29
- tree: SidebarTreeNode[];
30
- };
31
- declare function Sidebar({ className, currentPath, title, tree }: SidebarProps): react_jsx_runtime.JSX.Element;
32
-
33
- export { Sidebar, type SidebarActiveState, type SidebarDepth, type SidebarNodePrimitiveProps, type SidebarProps, type SidebarTreeNode };
@@ -1,31 +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/theme-toggle.tsx
22
- var theme_toggle_exports = {};
23
- __export(theme_toggle_exports, {
24
- ThemeToggle: () => import_theme_toggle.ThemeToggle
25
- });
26
- module.exports = __toCommonJS(theme_toggle_exports);
27
- var import_theme_toggle = require("../ui/theme-toggle.js");
28
- // Annotate the CommonJS export names for ESM import in node:
29
- 0 && (module.exports = {
30
- ThemeToggle
31
- });
@@ -1,6 +0,0 @@
1
- export { ThemeToggle } from '../ui/theme-toggle.cjs';
2
- import 'react/jsx-runtime';
3
- import '../ui/button.cjs';
4
- import 'class-variance-authority/types';
5
- import 'class-variance-authority';
6
- import 'react';