@publish.os/nextjs 0.0.1-alpha.91 → 0.0.1-alpha.92
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.
- package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -2
- package/compiler-assets/nextjs/defaults/group/page.tsx +7 -6
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +2 -1
- package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
- package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
- package/compiler-assets/nextjs/shims/document.tsx +9 -1
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +3 -0
- package/compiler-assets/nextjs/shims/proxy.ts +156 -54
- package/dist/{build-operation-5QMLXF7N.js → build-operation-CJDUL4OW.js} +5 -5
- package/dist/{chunk-GBPLER5H.js → chunk-3T4HVDSC.js} +2 -2
- package/dist/{chunk-UYGCOWRF.js → chunk-DX7PXFCM.js} +860 -50
- package/dist/{chunk-F3AGNDF4.js → chunk-DZ3VWEV5.js} +860 -575
- package/dist/{chunk-OXOFRXEI.js → chunk-NHSLTARU.js} +1284 -1164
- package/dist/{chunk-ORIUWJBQ.js → chunk-SBMDONTV.js} +3 -2
- package/dist/compiler.js +42 -23
- package/dist/components/blocks/agent-actions.d.ts +7 -7
- package/dist/components/blocks/agent-actions.js +1 -32
- package/dist/components/blocks/toc.d.ts +7 -7
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/{compose-CVBJRAF6.js → compose-44GJSMXD.js} +2 -2
- package/dist/config/createNextConfig.js +2 -0
- package/dist/{dev-operation-OSHHWRWK.js → dev-operation-WNECBHZ5.js} +17 -7
- package/dist/{ide-support-CU6Z5PVR.js → ide-support-TG74L4FF.js} +3 -3
- package/dist/index.d.ts +143 -126
- package/dist/index.js +25 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +7 -7
- package/dist/kernel/components/blocks/AgentActions.js +1 -32
- package/dist/kernel/components/blocks/agent-actions.d.ts +1 -2
- package/dist/kernel/components/blocks/agent-actions.js +1 -32
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +19 -13
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +62 -42
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +29 -6
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +30 -7
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +12 -2
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +132 -26
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- package/dist/kernel/components/blocks/toc-client.d.ts +7 -7
- package/dist/kernel/components/blocks/toc.d.ts +3 -3
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +2 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +3 -3
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +3 -2
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +1 -1
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/link.d.ts +3 -3
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/video-player.d.ts +2 -2
- package/dist/kernel/components/mdx/components/video.d.ts +2 -3
- package/dist/kernel/components/mdx/error-boundary.d.ts +2 -3
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/mdx.d.ts +42 -11
- package/dist/kernel/components/mdx/mdx.js +1 -1
- package/dist/kernel/components/next-image.d.ts +3 -3
- package/dist/kernel/components/ui/accordion.d.ts +7 -7
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -3
- package/dist/kernel/components/ui/breadcrumb.d.ts +13 -13
- package/dist/kernel/components/ui/button-group.d.ts +5 -5
- package/dist/kernel/components/ui/button.d.ts +3 -3
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- package/dist/kernel/components/ui/kbd.d.ts +3 -3
- package/dist/kernel/components/ui/link.d.ts +3 -3
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/scroll-area.d.ts +1 -2
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/defaults.registry.d.ts +2 -2
- package/dist/kernel/defaults.registry.js +2 -2
- package/dist/kernel/routes/agent/markdown.d.ts +4 -0
- package/dist/kernel/routes/agent/markdown.js +11 -7
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +34 -29
- package/dist/kernel/routes/metadata/llms.d.ts +3 -31
- package/dist/kernel/routes/metadata/llms.js +2 -200
- package/dist/kernel/routes/metadata/robots.d.ts +5 -3
- package/dist/kernel/routes/metadata/robots.js +4 -25
- package/dist/kernel/routes/metadata/sitemap.d.ts +15 -1
- package/dist/kernel/routes/metadata/sitemap.js +200 -112
- package/dist/kernel/routes/not-found.js +1 -1
- package/dist/kernel/routes/pages/group.d.ts +3 -3
- package/dist/kernel/routes/pages/group.js +10 -4
- package/dist/kernel/routes/pages/leaf.d.ts +9 -4
- package/dist/kernel/routes/pages/leaf.js +16 -8
- package/dist/kernel/routes/pages/root.d.ts +3 -3
- package/dist/kernel/routes/pages/root.js +20 -5
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +65 -35
- package/dist/search.d.ts +2 -9
- package/dist/search.js +2 -7
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types.d.ts +116 -91
- package/dist/{validate-local-source-SV44DBQT.js → validate-local-source-EN2GW4FR.js} +3 -3
- package/dist/{validate-publish-os-source-NZJF3TB2.js → validate-publish-os-source-OEWQDB7B.js} +2 -2
- package/init/seed/minimal/publish.os/blog/index.tsx +25 -22
- package/init/seed/minimal/publish.os/blog/page.tsx +31 -16
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +1 -1
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +13 -2
- package/init/seed/minimal/seed.json +1 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +4 -4
- package/release/app/phosphor/package.json +1 -1
- package/release/app/phosphor/pnpm-lock.yaml.template +53 -127
- package/release/compiler/pnpm-lock.yaml.template +49 -123
- package/release/release.json +4 -4
- package/dist/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- package/dist/types-J2w_puPF.d.ts +0 -128
- package/dist/{button-BdCScEKi.d.ts → button-D6Xp2HBm.d.ts} +1 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { CollapsibleBreadcrumbTrail } from "@components/ui/breadcrumb-trail";
|
|
3
3
|
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function titleFor(node) {
|
|
5
|
-
return node.
|
|
5
|
+
return node.label ?? "";
|
|
6
6
|
}
|
|
7
7
|
function pathFor(node) {
|
|
8
|
-
if (node.type === "page") return node.path;
|
|
8
|
+
if (node.type === "page") return node.page.path;
|
|
9
|
+
if (node.type === "group" && node.presentation === "page") return node.route;
|
|
9
10
|
if (node.type === "link") return node.href;
|
|
10
|
-
if (node.type === "folder" || node.type === "section") return node.path;
|
|
11
11
|
}
|
|
12
12
|
function rankFor(node) {
|
|
13
|
-
return node.type === "page" || node.type === "
|
|
13
|
+
return node.type === "page" || node.type === "group" && node.presentation === "page" ? 2 : node.type === "folder" || node.type === "group" && node.presentation === "folder" ? 1 : 0;
|
|
14
14
|
}
|
|
15
15
|
function findCrumbs(nodes, pathname, parents = []) {
|
|
16
16
|
let matches = [];
|
|
@@ -30,8 +30,12 @@ function findCrumbs(nodes, pathname, parents = []) {
|
|
|
30
30
|
})),
|
|
31
31
|
pathLength: path.length,
|
|
32
32
|
rank: rankFor(node)
|
|
33
|
-
}), node.type === "section" || node.type === "folder") {
|
|
34
|
-
let childMatch = findCrumbs(
|
|
33
|
+
}), node.type === "section" || node.type === "folder" || node.type === "group" || node.type === "view" || node.type === "page" && node.children) {
|
|
34
|
+
let childMatch = findCrumbs(
|
|
35
|
+
node.type === "view" ? node.items : node.type === "page" ? node.children ?? [] : node.children,
|
|
36
|
+
pathname,
|
|
37
|
+
nextParents
|
|
38
|
+
);
|
|
35
39
|
childMatch && matches.push(childMatch);
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -39,8 +43,10 @@ function findCrumbs(nodes, pathname, parents = []) {
|
|
|
39
43
|
(a, b) => b.rank - a.rank || b.pathLength - a.pathLength || b.crumbs.length - a.crumbs.length
|
|
40
44
|
)[0] ?? null;
|
|
41
45
|
}
|
|
42
|
-
function groupFallback(
|
|
43
|
-
let groups =
|
|
46
|
+
function groupFallback(nodes, pathname) {
|
|
47
|
+
let groups = nodes.filter(
|
|
48
|
+
(node) => node.type === "group"
|
|
49
|
+
).map((group) => ({ group, path: group.route })).filter(
|
|
44
50
|
(entry) => typeof entry.path == "string"
|
|
45
51
|
).sort((a, b) => b.path.length - a.path.length);
|
|
46
52
|
for (let { group, path } of groups)
|
|
@@ -54,7 +60,7 @@ function groupFallback(tree, pathname) {
|
|
|
54
60
|
];
|
|
55
61
|
return [];
|
|
56
62
|
}
|
|
57
|
-
function buildCrumbs(site,
|
|
63
|
+
function buildCrumbs(site, navigation, pathname) {
|
|
58
64
|
let root = {
|
|
59
65
|
title: site.name,
|
|
60
66
|
path: "/",
|
|
@@ -62,10 +68,10 @@ function buildCrumbs(site, tree, pathname) {
|
|
|
62
68
|
current: pathname === "/"
|
|
63
69
|
};
|
|
64
70
|
if (pathname === "/") return [root];
|
|
65
|
-
let treeMatch = findCrumbs(
|
|
71
|
+
let treeMatch = findCrumbs(navigation.items, pathname);
|
|
66
72
|
return treeMatch ? [root, ...treeMatch.crumbs] : [
|
|
67
73
|
root,
|
|
68
|
-
...groupFallback(
|
|
74
|
+
...groupFallback(navigation.items, pathname).map((crumb) => ({
|
|
69
75
|
...crumb,
|
|
70
76
|
current: !1
|
|
71
77
|
}))
|
|
@@ -76,9 +82,9 @@ function NavBreadcrumb({
|
|
|
76
82
|
showRoot = !0,
|
|
77
83
|
size = "sm",
|
|
78
84
|
site,
|
|
79
|
-
|
|
85
|
+
navigation
|
|
80
86
|
}) {
|
|
81
|
-
let crumbs = buildCrumbs(site,
|
|
87
|
+
let crumbs = buildCrumbs(site, navigation, currentPath), items = (showRoot ? crumbs : crumbs.slice(1)).map((crumb) => ({
|
|
82
88
|
current: crumb.current,
|
|
83
89
|
href: crumb.href,
|
|
84
90
|
title: crumb.title
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
import { LogoBlockLogo, LogoBlockAsset } from './logo-block.js';
|
|
3
|
-
import { S as SiteData
|
|
3
|
+
import { S as SiteData } from '../../../types-TjH1ek0X.js';
|
|
4
|
+
import { R as ResolvedNavigation } from '../../../manifest-types-CcVPH_jh.js';
|
|
4
5
|
|
|
5
6
|
type NavbarProps = {
|
|
6
7
|
logo?: NavbarLogo;
|
|
7
8
|
site?: SiteData;
|
|
8
9
|
siteTitle?: string;
|
|
9
|
-
|
|
10
|
+
navigation: ResolvedNavigation;
|
|
10
11
|
showThemeToggle?: boolean;
|
|
11
12
|
};
|
|
12
13
|
type NavbarLogoAsset = LogoBlockAsset;
|
|
13
14
|
type NavbarLogo = LogoBlockLogo;
|
|
14
|
-
declare function Navbar({ logo, showThemeToggle, site, siteTitle,
|
|
15
|
+
declare function Navbar({ logo, showThemeToggle, site, siteTitle, navigation, }: NavbarProps): react.JSX.Element;
|
|
15
16
|
|
|
16
17
|
export { Navbar, type NavbarLogo, type NavbarLogoAsset };
|
|
@@ -45,17 +45,24 @@ import {
|
|
|
45
45
|
import { CaretDownIcon } from "@phosphor-icons/react/ssr";
|
|
46
46
|
import NextLink from "next/link";
|
|
47
47
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
48
|
+
|
|
49
|
+
// src/components/block/navbar/navigation-groups.ts
|
|
50
|
+
function navigationGroups(nodes) {
|
|
51
|
+
return nodes.flatMap((node) => node.type === "group" ? [node, ...navigationGroups(node.children)] : node.type === "section" || node.type === "folder" ? navigationGroups(node.children) : node.type === "view" ? navigationGroups(node.items) : node.type === "page" && node.children ? navigationGroups(node.children) : []);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/components/block/navbar/group-navigation.tsx
|
|
48
55
|
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
49
56
|
function GroupNavigation({
|
|
50
57
|
currentPath,
|
|
51
|
-
|
|
58
|
+
navigation
|
|
52
59
|
}) {
|
|
53
|
-
let groups =
|
|
54
|
-
(
|
|
60
|
+
let groups = navigationGroups(navigation.items).filter(
|
|
61
|
+
(group) => group.groupKey !== navigation.rootGroup && group.presentation === "page"
|
|
55
62
|
), activeGroup = groups.filter(
|
|
56
|
-
({
|
|
63
|
+
({ route }) => currentPath === route || currentPath.startsWith(route === "/" ? "/" : `${route}/`)
|
|
57
64
|
).reduce(
|
|
58
|
-
(active, group) => !active || group.
|
|
65
|
+
(active, group) => !active || group.route.length > active.route.length ? group : active,
|
|
59
66
|
void 0
|
|
60
67
|
), navRef = useRef(null), linksRef = useRef(null), [overflow, setOverflow] = useState(!1), hasGroups = groups.length > 1;
|
|
61
68
|
if (useLayoutEffect(() => {
|
|
@@ -67,7 +74,7 @@ function GroupNavigation({
|
|
|
67
74
|
}, observer = new win.ResizeObserver(measure);
|
|
68
75
|
return observer.observe(nav), observer.observe(links), measure(), () => observer.disconnect();
|
|
69
76
|
}, [hasGroups]), !hasGroups) return null;
|
|
70
|
-
let isActive = (path) => activeGroup?.
|
|
77
|
+
let isActive = (path) => activeGroup?.route === path;
|
|
71
78
|
return /* @__PURE__ */ jsxs("div", { className: "hidden min-w-0 flex-1 items-center gap-4 md:flex", children: [
|
|
72
79
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-stroke-3" }),
|
|
73
80
|
/* @__PURE__ */ jsxs(
|
|
@@ -84,19 +91,19 @@ function GroupNavigation({
|
|
|
84
91
|
className: `flex w-max items-center gap-1 ${overflow ? "pointer-events-none invisible absolute top-0" : ""}`,
|
|
85
92
|
inert: overflow || void 0,
|
|
86
93
|
ref: linksRef,
|
|
87
|
-
children: groups.map((group) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
94
|
+
children: groups.map((group) => /* @__PURE__ */ jsx("li", { children: group.href ? /* @__PURE__ */ jsx(
|
|
88
95
|
Link,
|
|
89
96
|
{
|
|
90
|
-
active: isActive(group.
|
|
91
|
-
"aria-current": isActive(group.
|
|
97
|
+
active: isActive(group.route),
|
|
98
|
+
"aria-current": isActive(group.route) ? "location" : void 0,
|
|
92
99
|
className: "pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
93
|
-
href: group.href
|
|
100
|
+
href: group.href,
|
|
94
101
|
size: "xs",
|
|
95
102
|
target: "_self",
|
|
96
103
|
variant: "button.ghost",
|
|
97
|
-
children: group.
|
|
104
|
+
children: group.label
|
|
98
105
|
}
|
|
99
|
-
) }, group.id))
|
|
106
|
+
) : /* @__PURE__ */ jsx("span", { className: "px-2 text-xs text-foreground-3", children: group.label }) }, group.id))
|
|
100
107
|
}
|
|
101
108
|
),
|
|
102
109
|
overflow ? /* @__PURE__ */ jsxs(Menu, { children: [
|
|
@@ -119,10 +126,10 @@ function GroupNavigation({
|
|
|
119
126
|
/* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(MenuPositioner, { align: "start", children: /* @__PURE__ */ jsx(MenuPopup, { className: "max-w-[min(24rem,calc(100vw-2rem))]", children: groups.map((group) => /* @__PURE__ */ jsx(
|
|
120
127
|
MenuLinkItem,
|
|
121
128
|
{
|
|
122
|
-
"aria-current": isActive(group.
|
|
129
|
+
"aria-current": isActive(group.route) ? "location" : void 0,
|
|
123
130
|
className: "whitespace-normal break-words pointer-coarse:min-h-11",
|
|
124
|
-
render: /* @__PURE__ */ jsx(NextLink, { href: group.href ?? group.
|
|
125
|
-
children: group.
|
|
131
|
+
render: /* @__PURE__ */ jsx(NextLink, { href: group.href ?? group.route }),
|
|
132
|
+
children: group.label
|
|
126
133
|
},
|
|
127
134
|
group.id
|
|
128
135
|
)) }) }) })
|
|
@@ -142,7 +149,7 @@ function MobileNavigationTree({
|
|
|
142
149
|
indexCurrentPath,
|
|
143
150
|
indexPath,
|
|
144
151
|
title,
|
|
145
|
-
|
|
152
|
+
navigation
|
|
146
153
|
}) {
|
|
147
154
|
return /* @__PURE__ */ jsx2(
|
|
148
155
|
ScrollArea,
|
|
@@ -151,7 +158,7 @@ function MobileNavigationTree({
|
|
|
151
158
|
viewportClassName: "overscroll-contain",
|
|
152
159
|
children: /* @__PURE__ */ jsxs2("nav", { "aria-label": `${title} pages`, className: "px-4 py-5", children: [
|
|
153
160
|
/* @__PURE__ */ jsx2("p", { className: "mb-3 wrap-break-word px-3 text-base leading-6 text-foreground-3", children: title }),
|
|
154
|
-
|
|
161
|
+
navigation.items.length > 0 ? /* @__PURE__ */ jsx2(PageList, { currentPath, navigation }) : indexPath ? /* @__PURE__ */ jsx2(
|
|
155
162
|
PageLink,
|
|
156
163
|
{
|
|
157
164
|
currentPath,
|
|
@@ -160,34 +167,44 @@ function MobileNavigationTree({
|
|
|
160
167
|
sameTab: !0,
|
|
161
168
|
title: "Overview"
|
|
162
169
|
}
|
|
163
|
-
)
|
|
170
|
+
) : null
|
|
164
171
|
] })
|
|
165
172
|
}
|
|
166
173
|
);
|
|
167
174
|
}
|
|
168
175
|
function PageList({
|
|
169
176
|
currentPath,
|
|
170
|
-
|
|
177
|
+
navigation
|
|
171
178
|
}) {
|
|
179
|
+
let tree = navigation.items;
|
|
172
180
|
return /* @__PURE__ */ jsx2("ul", { className: "space-y-1", children: tree.map((node) => /* @__PURE__ */ jsx2(
|
|
173
181
|
"li",
|
|
174
182
|
{
|
|
175
|
-
className: node.type === "section" || node.type === "folder" ? "pt-5 first:pt-0" : void 0,
|
|
176
|
-
children: node.type === "page" || node.type === "link" ? /* @__PURE__ */ jsx2(
|
|
183
|
+
className: node.type === "section" || node.type === "folder" || node.type === "group" ? "pt-5 first:pt-0" : void 0,
|
|
184
|
+
children: node.type === "page" || node.type === "link" || node.type === "group" && node.presentation === "page" ? /* @__PURE__ */ jsx2(
|
|
177
185
|
PageLink,
|
|
178
186
|
{
|
|
179
187
|
currentPath,
|
|
180
|
-
href: node.type === "
|
|
181
|
-
activePath: node.type === "page" ? node.path : void 0,
|
|
182
|
-
sameTab: node.type
|
|
183
|
-
title: node.
|
|
188
|
+
href: node.type === "group" ? node.href ?? node.route : node.href,
|
|
189
|
+
activePath: node.type === "page" ? node.page.path : node.type === "group" ? node.route : void 0,
|
|
190
|
+
sameTab: node.type !== "link",
|
|
191
|
+
title: node.label
|
|
184
192
|
}
|
|
185
|
-
) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
186
|
-
/* @__PURE__ */ jsx2("p", { className: "mb-2 wrap-break-word px-3 text-base leading-6 text-foreground-3", children: node.
|
|
187
|
-
/* @__PURE__ */ jsx2(
|
|
193
|
+
) : node.type === "switch-view" ? null : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
194
|
+
/* @__PURE__ */ jsx2("p", { className: "mb-2 wrap-break-word px-3 text-base leading-6 text-foreground-3", children: node.label }),
|
|
195
|
+
/* @__PURE__ */ jsx2(
|
|
196
|
+
PageList,
|
|
197
|
+
{
|
|
198
|
+
currentPath,
|
|
199
|
+
navigation: {
|
|
200
|
+
rootGroup: navigation.rootGroup,
|
|
201
|
+
items: "items" in node ? node.items : node.children
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
)
|
|
188
205
|
] })
|
|
189
206
|
},
|
|
190
|
-
node.
|
|
207
|
+
node.id
|
|
191
208
|
)) });
|
|
192
209
|
}
|
|
193
210
|
function PageLink({
|
|
@@ -218,13 +235,13 @@ function Navbar({
|
|
|
218
235
|
showThemeToggle = !0,
|
|
219
236
|
site,
|
|
220
237
|
siteTitle,
|
|
221
|
-
|
|
238
|
+
navigation
|
|
222
239
|
}) {
|
|
223
240
|
let pathname = usePathname() || "/", headerSite = site ?? { name: siteTitle ?? "Site" };
|
|
224
241
|
return /* @__PURE__ */ jsx3("header", { className: "sticky top-0 z-nav border-b border-stroke-3 bg-surface-2 [anchor-name:--global-navbar]", children: /* @__PURE__ */ jsxs3(NavbarFrame, { children: [
|
|
225
242
|
/* @__PURE__ */ jsxs3("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
226
243
|
/* @__PURE__ */ jsx3(HomeLink, { logo, siteName: headerSite.name }),
|
|
227
|
-
/* @__PURE__ */ jsx3(GroupNavigation, { currentPath: pathname,
|
|
244
|
+
/* @__PURE__ */ jsx3(GroupNavigation, { currentPath: pathname, navigation })
|
|
228
245
|
] }),
|
|
229
246
|
/* @__PURE__ */ jsxs3("div", { className: "flex shrink-0 items-center gap-1 md:gap-2", children: [
|
|
230
247
|
/* @__PURE__ */ jsxs3(Search.Root, { children: [
|
|
@@ -265,7 +282,7 @@ function Navbar({
|
|
|
265
282
|
logo,
|
|
266
283
|
showThemeToggle,
|
|
267
284
|
siteName: headerSite.name,
|
|
268
|
-
|
|
285
|
+
navigation
|
|
269
286
|
},
|
|
270
287
|
pathname
|
|
271
288
|
)
|
|
@@ -293,10 +310,10 @@ function MobileNavigation({
|
|
|
293
310
|
logo,
|
|
294
311
|
showThemeToggle,
|
|
295
312
|
siteName,
|
|
296
|
-
|
|
313
|
+
navigation
|
|
297
314
|
}) {
|
|
298
|
-
let [open, setOpen] = useState2(!1), [selectedGroupId, setSelectedGroupId] = useState2(null), triggerRef = useRef2(null), closeRef = useRef2(null), backRef = useRef2(null), returnGroupIdRef = useRef2(null), groupButtonRefs = useRef2(/* @__PURE__ */ new Map()), groups =
|
|
299
|
-
(
|
|
315
|
+
let [open, setOpen] = useState2(!1), [selectedGroupId, setSelectedGroupId] = useState2(null), triggerRef = useRef2(null), closeRef = useRef2(null), backRef = useRef2(null), returnGroupIdRef = useRef2(null), groupButtonRefs = useRef2(/* @__PURE__ */ new Map()), groups = navigationGroups(navigation.items).filter(
|
|
316
|
+
(group) => group.groupKey !== navigation.rootGroup
|
|
300
317
|
), selectedGroup = groups.find((group) => group.id === selectedGroupId), changeOpen = (nextOpen) => {
|
|
301
318
|
setOpen(nextOpen), nextOpen || (setSelectedGroupId(null), returnGroupIdRef.current = null);
|
|
302
319
|
};
|
|
@@ -333,7 +350,7 @@ function MobileNavigation({
|
|
|
333
350
|
},
|
|
334
351
|
children: [
|
|
335
352
|
/* @__PURE__ */ jsxs3(DrawerTitle, { className: "sr-only", children: [
|
|
336
|
-
selectedGroup ? selectedGroup.
|
|
353
|
+
selectedGroup ? selectedGroup.label : siteName,
|
|
337
354
|
" navigation"
|
|
338
355
|
] }),
|
|
339
356
|
/* @__PURE__ */ jsx3(DrawerDescription, { className: "sr-only", children: "Browse pages and site controls." }),
|
|
@@ -373,10 +390,13 @@ function MobileNavigation({
|
|
|
373
390
|
MobileNavigationTree,
|
|
374
391
|
{
|
|
375
392
|
currentPath,
|
|
376
|
-
indexPath: selectedGroup.
|
|
377
|
-
indexCurrentPath: selectedGroup.
|
|
378
|
-
title: selectedGroup.
|
|
379
|
-
|
|
393
|
+
indexPath: selectedGroup.presentation === "page" ? selectedGroup.href : void 0,
|
|
394
|
+
indexCurrentPath: selectedGroup.route,
|
|
395
|
+
title: selectedGroup.label,
|
|
396
|
+
navigation: {
|
|
397
|
+
rootGroup: selectedGroup.groupKey,
|
|
398
|
+
items: selectedGroup.children
|
|
399
|
+
}
|
|
380
400
|
}
|
|
381
401
|
)
|
|
382
402
|
] }) : groups.length > 0 ? /* @__PURE__ */ jsx3(
|
|
@@ -397,7 +417,7 @@ function MobileNavigation({
|
|
|
397
417
|
rightIcon: /* @__PURE__ */ jsx3(CaretRightIcon, { "aria-hidden": "true" }),
|
|
398
418
|
size: "lg",
|
|
399
419
|
variant: "ghost",
|
|
400
|
-
children: /* @__PURE__ */ jsx3("span", { className: "min-w-0 wrap-break-word", children: group.
|
|
420
|
+
children: /* @__PURE__ */ jsx3("span", { className: "min-w-0 wrap-break-word", children: group.label })
|
|
401
421
|
}
|
|
402
422
|
) }, group.id)) }) })
|
|
403
423
|
}
|
|
@@ -406,7 +426,7 @@ function MobileNavigation({
|
|
|
406
426
|
{
|
|
407
427
|
className: "w-full min-w-0 max-w-none",
|
|
408
428
|
currentPath,
|
|
409
|
-
|
|
429
|
+
navigation
|
|
410
430
|
}
|
|
411
431
|
) }),
|
|
412
432
|
selectedGroup ? null : /* @__PURE__ */ jsxs3("div", { className: "flex shrink-0 flex-col gap-4 border-t border-stroke-3 px-4 py-4", children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
declare const navigationProgressConfig: {
|
|
4
4
|
initialProgress: number;
|
|
@@ -11,6 +11,6 @@ declare const navigationProgressConfig: {
|
|
|
11
11
|
settleDelay: number;
|
|
12
12
|
timeout: number;
|
|
13
13
|
};
|
|
14
|
-
declare function NavigationProgressBar():
|
|
14
|
+
declare function NavigationProgressBar(): react.JSX.Element;
|
|
15
15
|
|
|
16
16
|
export { NavigationProgressBar, navigationProgressConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { R as ResolvedNavigation } from '../../../manifest-types-CcVPH_jh.js';
|
|
3
3
|
|
|
4
4
|
type NextPrevProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
currentPath?: string;
|
|
7
|
-
|
|
7
|
+
navigation: ResolvedNavigation;
|
|
8
8
|
};
|
|
9
|
-
declare function NextPrev({ className, currentPath,
|
|
9
|
+
declare function NextPrev({ className, currentPath, navigation, }: NextPrevProps): react.JSX.Element | null;
|
|
10
10
|
|
|
11
11
|
export { NextPrev, type NextPrevProps };
|
|
@@ -4,8 +4,27 @@ import { cn } from "@publish.os/nextjs/utils/cn";
|
|
|
4
4
|
import NextLink from "next/link";
|
|
5
5
|
|
|
6
6
|
// src/components/block/page-navigation/page-nodes.ts
|
|
7
|
-
function
|
|
8
|
-
return nodes.flatMap((node) => node.type === "page" ? [
|
|
7
|
+
function selectNavigationPages(nodes) {
|
|
8
|
+
return nodes.flatMap((node) => node.type === "page" ? [
|
|
9
|
+
{
|
|
10
|
+
id: node.id,
|
|
11
|
+
label: node.label,
|
|
12
|
+
href: node.href,
|
|
13
|
+
path: node.page.path,
|
|
14
|
+
page: node.page
|
|
15
|
+
}
|
|
16
|
+
] : node.type === "group" ? [
|
|
17
|
+
...node.presentation === "page" ? [
|
|
18
|
+
{
|
|
19
|
+
id: node.id,
|
|
20
|
+
label: node.label,
|
|
21
|
+
href: node.href ?? node.route,
|
|
22
|
+
path: node.route,
|
|
23
|
+
group: node
|
|
24
|
+
}
|
|
25
|
+
] : [],
|
|
26
|
+
...selectNavigationPages(node.children)
|
|
27
|
+
] : node.type === "section" || node.type === "folder" ? selectNavigationPages(node.children) : node.type === "view" ? selectNavigationPages(node.items) : []);
|
|
9
28
|
}
|
|
10
29
|
|
|
11
30
|
// src/components/block/page-navigation/next-prev.tsx
|
|
@@ -25,7 +44,7 @@ function NavigationCard({
|
|
|
25
44
|
"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!",
|
|
26
45
|
isNext && "md:text-right"
|
|
27
46
|
),
|
|
28
|
-
href: page.href
|
|
47
|
+
href: page.href,
|
|
29
48
|
children: /* @__PURE__ */ jsxs(
|
|
30
49
|
"span",
|
|
31
50
|
{
|
|
@@ -48,15 +67,19 @@ function NavigationCard({
|
|
|
48
67
|
]
|
|
49
68
|
}
|
|
50
69
|
),
|
|
51
|
-
/* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-sm font-medium leading-6 text-foreground-1 transition-colors duration-200", children: page.
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-sm font-medium leading-6 text-foreground-1 transition-colors duration-200", children: page.label })
|
|
52
71
|
]
|
|
53
72
|
}
|
|
54
73
|
)
|
|
55
74
|
}
|
|
56
75
|
);
|
|
57
76
|
}
|
|
58
|
-
function NextPrev({
|
|
59
|
-
|
|
77
|
+
function NextPrev({
|
|
78
|
+
className,
|
|
79
|
+
currentPath,
|
|
80
|
+
navigation
|
|
81
|
+
}) {
|
|
82
|
+
let pages = selectNavigationPages(navigation.items), index = pages.findIndex((page) => page.path === currentPath), previous = index > 0 ? pages[index - 1] : null, next = index >= 0 ? pages[index + 1] : null, hasBoth = !!(previous && next);
|
|
60
83
|
return !previous && !next ? null : /* @__PURE__ */ jsx("nav", { "aria-label": "Previous and next pages", className, children: /* @__PURE__ */ jsxs("div", { className: cn("grid gap-4 pt-6", hasBoth && "md:grid-cols-2"), children: [
|
|
61
84
|
previous ? /* @__PURE__ */ jsx(NavigationCard, { direction: "previous", page: previous }) : null,
|
|
62
85
|
next ? /* @__PURE__ */ jsx(NavigationCard, { direction: "next", page: next }) : null
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { R as ResolvedNavigation } from '../../../manifest-types-CcVPH_jh.js';
|
|
3
3
|
|
|
4
4
|
type PageListProps = {
|
|
5
|
-
|
|
5
|
+
navigation: ResolvedNavigation;
|
|
6
6
|
currentPath?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
};
|
|
9
|
-
declare function PageList({
|
|
9
|
+
declare function PageList({ navigation, currentPath, className, }: PageListProps): react.JSX.Element | null;
|
|
10
10
|
|
|
11
11
|
export { PageList };
|
|
@@ -2,14 +2,37 @@
|
|
|
2
2
|
import { Link } from "@components/ui/link";
|
|
3
3
|
|
|
4
4
|
// src/components/block/page-navigation/page-nodes.ts
|
|
5
|
-
function
|
|
6
|
-
return nodes.flatMap((node) => node.type === "page" ? [
|
|
5
|
+
function selectNavigationPages(nodes) {
|
|
6
|
+
return nodes.flatMap((node) => node.type === "page" ? [
|
|
7
|
+
{
|
|
8
|
+
id: node.id,
|
|
9
|
+
label: node.label,
|
|
10
|
+
href: node.href,
|
|
11
|
+
path: node.page.path,
|
|
12
|
+
page: node.page
|
|
13
|
+
}
|
|
14
|
+
] : node.type === "group" ? [
|
|
15
|
+
...node.presentation === "page" ? [
|
|
16
|
+
{
|
|
17
|
+
id: node.id,
|
|
18
|
+
label: node.label,
|
|
19
|
+
href: node.href ?? node.route,
|
|
20
|
+
path: node.route,
|
|
21
|
+
group: node
|
|
22
|
+
}
|
|
23
|
+
] : [],
|
|
24
|
+
...selectNavigationPages(node.children)
|
|
25
|
+
] : node.type === "section" || node.type === "folder" ? selectNavigationPages(node.children) : node.type === "view" ? selectNavigationPages(node.items) : []);
|
|
7
26
|
}
|
|
8
27
|
|
|
9
28
|
// src/components/block/page-navigation/page-list.tsx
|
|
10
29
|
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
11
|
-
function PageList({
|
|
12
|
-
|
|
30
|
+
function PageList({
|
|
31
|
+
navigation,
|
|
32
|
+
currentPath,
|
|
33
|
+
className
|
|
34
|
+
}) {
|
|
35
|
+
let pages = selectNavigationPages(navigation.items);
|
|
13
36
|
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
37
|
let active = page.path === currentPath;
|
|
15
38
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
@@ -17,12 +40,12 @@ function PageList({ tree, currentPath, className }) {
|
|
|
17
40
|
{
|
|
18
41
|
active,
|
|
19
42
|
color: active ? "accent" : "default",
|
|
20
|
-
href: page.href
|
|
43
|
+
href: page.href,
|
|
21
44
|
size: "sm",
|
|
22
45
|
target: "_self",
|
|
23
|
-
children: page.
|
|
46
|
+
children: page.label
|
|
24
47
|
}
|
|
25
|
-
) },
|
|
48
|
+
) }, page.id);
|
|
26
49
|
}) }) });
|
|
27
50
|
}
|
|
28
51
|
export {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import { ReactNode, ComponentPropsWithRef, ComponentPropsWithoutRef } from 'react';
|
|
4
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
|
-
import { B as ButtonProps } from '../../../button-
|
|
4
|
+
import { B as ButtonProps } from '../../../button-D6Xp2HBm.js';
|
|
6
5
|
import { Dialog } from '@base-ui/react/dialog';
|
|
7
6
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
7
|
import { Input } from '@base-ui/react/input';
|
|
@@ -18,17 +17,12 @@ type SearchResult = {
|
|
|
18
17
|
excerpt: string;
|
|
19
18
|
id: string;
|
|
20
19
|
meta: {
|
|
21
|
-
author?: string;
|
|
22
20
|
description?: string;
|
|
23
21
|
group?: string;
|
|
24
|
-
image?: string;
|
|
25
22
|
nodeId?: string;
|
|
26
23
|
path?: string;
|
|
27
|
-
publishedAt?: string;
|
|
28
24
|
section?: string;
|
|
29
|
-
tags?: string;
|
|
30
25
|
title?: string;
|
|
31
|
-
updatedAt?: string;
|
|
32
26
|
};
|
|
33
27
|
plainExcerpt: string;
|
|
34
28
|
score?: number;
|
|
@@ -45,7 +39,7 @@ type SearchProviderProps = {
|
|
|
45
39
|
open?: boolean;
|
|
46
40
|
shortcut?: string | false;
|
|
47
41
|
};
|
|
48
|
-
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps):
|
|
42
|
+
declare function SearchProvider({ children, defaultOpen, limit, onOpenChange, open: controlledOpen, shortcut, }: SearchProviderProps): react.JSX.Element;
|
|
49
43
|
|
|
50
44
|
type DialogPortalProps = ComponentPropsWithRef<typeof Dialog.Portal>;
|
|
51
45
|
|
|
@@ -60,13 +54,13 @@ type SearchResultsProps = Omit<ComponentPropsWithRef<"div">, "children"> & {
|
|
|
60
54
|
emptyText?: string;
|
|
61
55
|
itemClassName?: string;
|
|
62
56
|
};
|
|
63
|
-
declare function SearchResults({ children, className, emptyText, itemClassName, ...props }: SearchResultsProps):
|
|
57
|
+
declare function SearchResults({ children, className, emptyText, itemClassName, ...props }: SearchResultsProps): react.JSX.Element | null;
|
|
64
58
|
type SearchFooterProps = ComponentPropsWithRef<"div">;
|
|
65
|
-
declare function SearchFooter({ children, className, ...props }: SearchFooterProps):
|
|
59
|
+
declare function SearchFooter({ children, className, ...props }: SearchFooterProps): react.JSX.Element | null;
|
|
66
60
|
|
|
67
61
|
declare function SearchProgressBar({ className }: {
|
|
68
62
|
className?: string;
|
|
69
|
-
}):
|
|
63
|
+
}): react.JSX.Element;
|
|
70
64
|
|
|
71
65
|
type SearchTriggerProps = ButtonProps & {
|
|
72
66
|
icon?: ReactNode;
|
|
@@ -85,7 +79,7 @@ type SearchDialogProps = {
|
|
|
85
79
|
mobileQuery?: string;
|
|
86
80
|
title?: string;
|
|
87
81
|
};
|
|
88
|
-
declare function DialogContent({ children, className, container, description, mobileQuery, title, }: SearchDialogProps):
|
|
82
|
+
declare function DialogContent({ children, className, container, description, mobileQuery, title, }: SearchDialogProps): react.JSX.Element;
|
|
89
83
|
type SearchInputProps = Omit<InputProps, "value" | "defaultValue" | "onValueChange"> & {
|
|
90
84
|
ref?: ComponentPropsWithRef<"input">["ref"];
|
|
91
85
|
closeClassName?: string;
|
|
@@ -94,11 +88,11 @@ type SearchInputProps = Omit<InputProps, "value" | "defaultValue" | "onValueChan
|
|
|
94
88
|
rootClassName?: string;
|
|
95
89
|
showCloseShortcut?: boolean;
|
|
96
90
|
};
|
|
97
|
-
declare function SearchInputField({ className, closeClassName, closeLabel, icon, onChange, onKeyDown, placeholder, ref, rootClassName, showCloseShortcut, ...props }: SearchInputProps):
|
|
91
|
+
declare function SearchInputField({ className, closeClassName, closeLabel, icon, onChange, onKeyDown, placeholder, ref, rootClassName, showCloseShortcut, ...props }: SearchInputProps): react.JSX.Element;
|
|
98
92
|
type SearchCommandProps = ComponentPropsWithRef<"div">;
|
|
99
|
-
declare function Command({ children, className, ...props }?: SearchCommandProps):
|
|
93
|
+
declare function Command({ children, className, ...props }?: SearchCommandProps): react.JSX.Element;
|
|
100
94
|
type SearchProps = Omit<SearchProviderProps, "children">;
|
|
101
|
-
declare function Search(props: SearchProps):
|
|
95
|
+
declare function Search(props: SearchProps): react.JSX.Element;
|
|
102
96
|
declare namespace Search {
|
|
103
97
|
var Root: typeof SearchProvider;
|
|
104
98
|
var Trigger: typeof Trigger;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../../../types-CJWRG05y.js';
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-CMrMM0Nj.js';
|
|
5
3
|
|
|
6
|
-
declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps):
|
|
4
|
+
declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onSwitchView, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps): react.JSX.Element | null;
|
|
7
5
|
|
|
8
6
|
export { SidebarNode, SidebarNodePrimitiveProps };
|
|
@@ -157,6 +157,7 @@ function SidebarNode({
|
|
|
157
157
|
isExpandable = !1,
|
|
158
158
|
node,
|
|
159
159
|
onLinkClick,
|
|
160
|
+
onSwitchView,
|
|
160
161
|
onToggle,
|
|
161
162
|
parentExpanded,
|
|
162
163
|
title
|
|
@@ -174,7 +175,7 @@ function SidebarNode({
|
|
|
174
175
|
}
|
|
175
176
|
),
|
|
176
177
|
children
|
|
177
|
-
] }) : node.type === "folder" ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
|
|
178
|
+
] }) : node.type === "folder" || node.type === "group" && node.presentation === "folder" ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
|
|
178
179
|
/* @__PURE__ */ jsx(
|
|
179
180
|
"button",
|
|
180
181
|
{
|
|
@@ -200,7 +201,16 @@ function SidebarNode({
|
|
|
200
201
|
}
|
|
201
202
|
),
|
|
202
203
|
children
|
|
203
|
-
] }) :
|
|
204
|
+
] }) : node.type === "switch-view" ? /* @__PURE__ */ jsx("li", { className: "select-none", children: /* @__PURE__ */ jsx(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
className: "block w-full rounded-button text-left focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
|
|
208
|
+
onClick: onSwitchView,
|
|
209
|
+
tabIndex: parentExpanded ? void 0 : -1,
|
|
210
|
+
type: "button",
|
|
211
|
+
children: /* @__PURE__ */ jsx(RowInner, { activeState, depth, interactive: !0, children: /* @__PURE__ */ jsx(RowText, { title }) })
|
|
212
|
+
}
|
|
213
|
+
) }) : href ? /* @__PURE__ */ jsxs("li", { className: "select-none", children: [
|
|
204
214
|
/* @__PURE__ */ jsx(
|
|
205
215
|
SidebarLink,
|
|
206
216
|
{
|