@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.
- package/README.md +1 -1
- package/dist/config/createNextConfig.js +3 -3
- package/dist/index.js +7 -5
- package/dist/kernel/components/blocks/color-palette.js +35 -4
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -12
- package/dist/kernel/components/mdx/components/image.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -1
- package/dist/kernel/components/ui/breadcrumb-trail.js +1 -0
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -5
- package/dist/kernel/components/ui/breadcrumb.js +1 -16
- package/dist/kernel/components/ui/menu.js +5 -5
- package/dist/kernel/components/ui/navigation-menu.js +2 -2
- package/dist/kernel/components/ui/popover.js +5 -11
- package/dist/kernel/components/ui/select.js +5 -5
- package/dist/kernel/components/ui/text.js +109 -106
- package/dist/kernel/components/ui/tooltip.js +2 -2
- package/dist/kernel/defaults.registry.d.ts +60 -69
- package/dist/kernel/defaults.registry.js +59 -67
- package/dist/kernel/routes/agent/markdown.js +2 -2
- package/dist/kernel/routes/metadata/feed.js +2 -2
- package/dist/kernel/routes/metadata/llms.js +4 -2
- package/dist/kernel/routes/metadata/og-image.d.ts +1 -1
- package/dist/kernel/routes/metadata/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.js +2 -2
- package/dist/utils/cn.d.ts +1 -1
- package/package.json +2 -6
- package/release/package.json +3 -2
- package/release/release.json +5 -5
- package/release/{pnpm-lock.yaml → runtime-pnpm-lock.yaml} +135 -34
- package/dist/cache/tags.cjs +0 -79
- package/dist/cache/tags.d.cts +0 -13
- package/dist/config/createNextConfig.cjs +0 -52
- package/dist/config/createNextConfig.d.cts +0 -8
- package/dist/config.cjs +0 -78
- package/dist/config.d.cts +0 -101
- package/dist/config.d.ts +0 -101
- package/dist/config.js +0 -48
- package/dist/index.cjs +0 -1266
- package/dist/index.d.cts +0 -18
- package/dist/kernel/components/blocks/AgentActions.cjs +0 -425
- package/dist/kernel/components/blocks/AgentActions.d.cts +0 -52
- package/dist/kernel/components/blocks/animated-icon-swap.cjs +0 -101
- package/dist/kernel/components/blocks/animated-icon-swap.d.cts +0 -16
- package/dist/kernel/components/blocks/color-palette.cjs +0 -413
- package/dist/kernel/components/blocks/color-palette.d.cts +0 -7
- package/dist/kernel/components/blocks/design-system-preview.cjs +0 -593
- package/dist/kernel/components/blocks/design-system-preview.d.cts +0 -29
- package/dist/kernel/components/blocks/link-playground.cjs +0 -816
- package/dist/kernel/components/blocks/link-playground.d.cts +0 -5
- package/dist/kernel/components/blocks/logo-block.cjs +0 -156
- package/dist/kernel/components/blocks/logo-block.d.cts +0 -21
- package/dist/kernel/components/blocks/nav-breadcrumb.cjs +0 -122
- package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +0 -11
- package/dist/kernel/components/blocks/navbar.cjs +0 -154
- package/dist/kernel/components/blocks/navbar.d.cts +0 -16
- package/dist/kernel/components/blocks/navigation-progress-playground.cjs +0 -735
- package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +0 -5
- package/dist/kernel/components/blocks/navigation-progress.cjs +0 -270
- package/dist/kernel/components/blocks/navigation-progress.d.cts +0 -16
- package/dist/kernel/components/blocks/next-prev.cjs +0 -142
- package/dist/kernel/components/blocks/next-prev.d.cts +0 -11
- package/dist/kernel/components/blocks/page-list.cjs +0 -59
- package/dist/kernel/components/blocks/page-list.d.cts +0 -11
- package/dist/kernel/components/blocks/search.cjs +0 -717
- package/dist/kernel/components/blocks/search.d.cts +0 -77
- package/dist/kernel/components/blocks/sidebar-node.cjs +0 -309
- package/dist/kernel/components/blocks/sidebar-node.d.cts +0 -8
- package/dist/kernel/components/blocks/sidebar.cjs +0 -317
- package/dist/kernel/components/blocks/sidebar.d.cts +0 -33
- package/dist/kernel/components/blocks/theme-toggle.cjs +0 -31
- package/dist/kernel/components/blocks/theme-toggle.d.cts +0 -6
- package/dist/kernel/components/blocks/toc.cjs +0 -356
- package/dist/kernel/components/blocks/toc.d.cts +0 -10
- package/dist/kernel/components/mdx/components/blockquote.cjs +0 -66
- package/dist/kernel/components/mdx/components/blockquote.d.cts +0 -6
- package/dist/kernel/components/mdx/components/callout.cjs +0 -137
- package/dist/kernel/components/mdx/components/callout.d.cts +0 -18
- package/dist/kernel/components/mdx/components/code-block.cjs +0 -39
- package/dist/kernel/components/mdx/components/code-block.d.cts +0 -9
- package/dist/kernel/components/mdx/components/figure-caption.cjs +0 -63
- package/dist/kernel/components/mdx/components/figure-caption.d.cts +0 -6
- package/dist/kernel/components/mdx/components/figure.cjs +0 -78
- package/dist/kernel/components/mdx/components/figure.d.cts +0 -10
- package/dist/kernel/components/mdx/components/footnotes.cjs +0 -66
- package/dist/kernel/components/mdx/components/footnotes.d.cts +0 -6
- package/dist/kernel/components/mdx/components/heading-copy-link.cjs +0 -108
- package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +0 -23
- package/dist/kernel/components/mdx/components/heading.cjs +0 -166
- package/dist/kernel/components/mdx/components/heading.d.cts +0 -8
- package/dist/kernel/components/mdx/components/hr.cjs +0 -34
- package/dist/kernel/components/mdx/components/hr.d.cts +0 -9
- package/dist/kernel/components/mdx/components/image-zoom.cjs +0 -49
- package/dist/kernel/components/mdx/components/image-zoom.d.cts +0 -10
- package/dist/kernel/components/mdx/components/image.cjs +0 -192
- package/dist/kernel/components/mdx/components/image.d.cts +0 -21
- package/dist/kernel/components/mdx/components/inline-code.cjs +0 -66
- package/dist/kernel/components/mdx/components/inline-code.d.cts +0 -6
- package/dist/kernel/components/mdx/components/kbd.cjs +0 -34
- package/dist/kernel/components/mdx/components/kbd.d.cts +0 -10
- package/dist/kernel/components/mdx/components/link.cjs +0 -49
- package/dist/kernel/components/mdx/components/link.d.cts +0 -11
- package/dist/kernel/components/mdx/components/paragraph.cjs +0 -87
- package/dist/kernel/components/mdx/components/paragraph.d.cts +0 -5
- package/dist/kernel/components/mdx/components/pre.cjs +0 -66
- package/dist/kernel/components/mdx/components/pre.d.cts +0 -6
- package/dist/kernel/components/mdx/components/strikethrough.cjs +0 -63
- package/dist/kernel/components/mdx/components/strikethrough.d.cts +0 -6
- package/dist/kernel/components/mdx/components/table.cjs +0 -59
- package/dist/kernel/components/mdx/components/table.d.cts +0 -10
- package/dist/kernel/components/mdx/components/task-list.cjs +0 -88
- package/dist/kernel/components/mdx/components/task-list.d.cts +0 -8
- package/dist/kernel/components/mdx/components/video-player.cjs +0 -173
- package/dist/kernel/components/mdx/components/video-player.d.cts +0 -18
- package/dist/kernel/components/mdx/components/video.cjs +0 -185
- package/dist/kernel/components/mdx/components/video.d.cts +0 -15
- package/dist/kernel/components/mdx/error-boundary.cjs +0 -62
- package/dist/kernel/components/mdx/error-boundary.d.cts +0 -8
- package/dist/kernel/components/mdx/error-fallback.cjs +0 -58
- package/dist/kernel/components/mdx/error-fallback.d.cts +0 -9
- package/dist/kernel/components/mdx/mdx.cjs +0 -141
- package/dist/kernel/components/mdx/mdx.d.cts +0 -22
- package/dist/kernel/components/mdx/rehype-heading-ids.cjs +0 -113
- package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +0 -10
- package/dist/kernel/components/mdx/types.cjs +0 -18
- package/dist/kernel/components/mdx/types.d.cts +0 -18
- package/dist/kernel/components/ui/accordion.cjs +0 -104
- package/dist/kernel/components/ui/accordion.d.cts +0 -16
- package/dist/kernel/components/ui/breadcrumb-trail.cjs +0 -238
- package/dist/kernel/components/ui/breadcrumb-trail.d.cts +0 -13
- package/dist/kernel/components/ui/breadcrumb.cjs +0 -399
- package/dist/kernel/components/ui/breadcrumb.d.cts +0 -52
- package/dist/kernel/components/ui/button-group.cjs +0 -143
- package/dist/kernel/components/ui/button-group.d.cts +0 -19
- package/dist/kernel/components/ui/button.cjs +0 -139
- package/dist/kernel/components/ui/button.d.cts +0 -22
- package/dist/kernel/components/ui/card.cjs +0 -133
- package/dist/kernel/components/ui/card.d.cts +0 -17
- package/dist/kernel/components/ui/dialog.cjs +0 -149
- package/dist/kernel/components/ui/dialog.d.cts +0 -22
- package/dist/kernel/components/ui/drawer.cjs +0 -163
- package/dist/kernel/components/ui/drawer.d.cts +0 -24
- package/dist/kernel/components/ui/input.cjs +0 -96
- package/dist/kernel/components/ui/input.d.cts +0 -18
- package/dist/kernel/components/ui/kbd.cjs +0 -105
- package/dist/kernel/components/ui/kbd.d.cts +0 -13
- package/dist/kernel/components/ui/link.cjs +0 -253
- package/dist/kernel/components/ui/link.d.cts +0 -31
- package/dist/kernel/components/ui/menu.cjs +0 -301
- package/dist/kernel/components/ui/menu.d.cts +0 -70
- package/dist/kernel/components/ui/meta-key.cjs +0 -34
- package/dist/kernel/components/ui/meta-key.d.cts +0 -12
- package/dist/kernel/components/ui/navigation-menu.cjs +0 -253
- package/dist/kernel/components/ui/navigation-menu.d.cts +0 -47
- package/dist/kernel/components/ui/popover.cjs +0 -168
- package/dist/kernel/components/ui/popover.d.cts +0 -24
- package/dist/kernel/components/ui/progress.cjs +0 -112
- package/dist/kernel/components/ui/progress.d.cts +0 -16
- package/dist/kernel/components/ui/scroll-area.cjs +0 -413
- package/dist/kernel/components/ui/scroll-area.d.cts +0 -58
- package/dist/kernel/components/ui/select.cjs +0 -244
- package/dist/kernel/components/ui/select.d.cts +0 -40
- package/dist/kernel/components/ui/separator.cjs +0 -73
- package/dist/kernel/components/ui/separator.d.cts +0 -8
- package/dist/kernel/components/ui/table.cjs +0 -131
- package/dist/kernel/components/ui/table.d.cts +0 -11
- package/dist/kernel/components/ui/tabs.cjs +0 -450
- package/dist/kernel/components/ui/tabs.d.cts +0 -82
- package/dist/kernel/components/ui/tag.cjs +0 -104
- package/dist/kernel/components/ui/tag.d.cts +0 -14
- package/dist/kernel/components/ui/text.cjs +0 -184
- package/dist/kernel/components/ui/text.d.cts +0 -17
- package/dist/kernel/components/ui/theme-toggle.cjs +0 -108
- package/dist/kernel/components/ui/theme-toggle.d.cts +0 -10
- package/dist/kernel/components/ui/toast.cjs +0 -154
- package/dist/kernel/components/ui/toast.d.cts +0 -26
- package/dist/kernel/components/ui/tooltip.cjs +0 -127
- package/dist/kernel/components/ui/tooltip.d.cts +0 -20
- package/dist/kernel/defaults.registry.cjs +0 -541
- package/dist/kernel/defaults.registry.d.cts +0 -469
- package/dist/kernel/routes/agent/markdown.cjs +0 -202
- package/dist/kernel/routes/agent/markdown.d.cts +0 -58
- package/dist/kernel/routes/layouts/group.cjs +0 -181
- package/dist/kernel/routes/layouts/group.d.cts +0 -20
- package/dist/kernel/routes/metadata/feed.cjs +0 -293
- package/dist/kernel/routes/metadata/feed.d.cts +0 -20
- package/dist/kernel/routes/metadata/llms.cjs +0 -239
- package/dist/kernel/routes/metadata/llms.d.cts +0 -26
- package/dist/kernel/routes/metadata/og-image.cjs +0 -630
- package/dist/kernel/routes/metadata/og-image.d.cts +0 -62
- package/dist/kernel/routes/metadata/robots.cjs +0 -148
- package/dist/kernel/routes/metadata/robots.d.cts +0 -6
- package/dist/kernel/routes/metadata/sitemap.cjs +0 -192
- package/dist/kernel/routes/metadata/sitemap.d.cts +0 -8
- package/dist/kernel/routes/pages/group.cjs +0 -263
- package/dist/kernel/routes/pages/group.d.cts +0 -17
- package/dist/kernel/routes/pages/leaf.cjs +0 -421
- package/dist/kernel/routes/pages/leaf.d.cts +0 -36
- package/dist/kernel/routes/pages/root.cjs +0 -229
- package/dist/kernel/routes/pages/root.d.cts +0 -16
- package/dist/keyboard-shortcuts.cjs +0 -345
- package/dist/keyboard-shortcuts.d.cts +0 -34
- package/dist/resolvers/manifest-resolver.cjs +0 -111
- package/dist/resolvers/manifest-resolver.d.cts +0 -13
- package/dist/search.cjs +0 -411
- package/dist/search.d.cts +0 -20
- package/dist/types.cjs +0 -30
- package/dist/types.d.cts +0 -269
- package/dist/utils/cn.cjs +0 -49
- package/dist/utils/cn.d.cts +0 -15
- package/dist/utils/heading-ids.cjs +0 -119
- package/dist/utils/heading-ids.d.cts +0 -15
- package/dist/utils/pretty-date.cjs +0 -55
- package/dist/utils/pretty-date.d.cts +0 -6
|
@@ -1,156 +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/logo-block.tsx
|
|
21
|
-
var logo_block_exports = {};
|
|
22
|
-
__export(logo_block_exports, {
|
|
23
|
-
LogoBlock: () => LogoBlock
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(logo_block_exports);
|
|
26
|
-
|
|
27
|
-
// src/utils/cn.ts
|
|
28
|
-
var import_clsx = require("clsx");
|
|
29
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
30
|
-
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
31
|
-
extend: {
|
|
32
|
-
classGroups: {
|
|
33
|
-
z: [
|
|
34
|
-
"z-content",
|
|
35
|
-
"z-nav",
|
|
36
|
-
"z-overlay",
|
|
37
|
-
"z-modal",
|
|
38
|
-
"z-search",
|
|
39
|
-
"z-toast",
|
|
40
|
-
"z-progress"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
function cn(...inputs) {
|
|
46
|
-
return twMerge((0, import_clsx.clsx)(inputs));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// src/kernel/components/blocks/logo-block.tsx
|
|
50
|
-
var import_jsx_runtime = (
|
|
51
|
-
// biome-ignore lint/performance/noImgElement: Tenant-provided logos are public SVG/raster files and need browser-native intrinsic sizing.
|
|
52
|
-
require("react/jsx-runtime")
|
|
53
|
-
);
|
|
54
|
-
var DEFAULT_LOGO_MAX_HEIGHT = 24;
|
|
55
|
-
var DEFAULT_LOGO_MAX_WIDTH = 160;
|
|
56
|
-
function isValidLogoAsset(asset) {
|
|
57
|
-
return typeof asset?.outputPath === "string" && asset.outputPath.trim() !== "";
|
|
58
|
-
}
|
|
59
|
-
function fitLogoDimensions({
|
|
60
|
-
asset,
|
|
61
|
-
maxHeight,
|
|
62
|
-
maxWidth
|
|
63
|
-
}) {
|
|
64
|
-
if (!asset.width || !asset.height) return void 0;
|
|
65
|
-
const scale = Math.min(maxWidth / asset.width, maxHeight / asset.height, 1);
|
|
66
|
-
return {
|
|
67
|
-
height: Math.max(1, Math.round(asset.height * scale)),
|
|
68
|
-
width: Math.max(1, Math.round(asset.width * scale))
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function getLogoStyle({
|
|
72
|
-
asset,
|
|
73
|
-
maxHeight,
|
|
74
|
-
maxWidth
|
|
75
|
-
}) {
|
|
76
|
-
return {
|
|
77
|
-
"--logo-block-max-height": `${maxHeight}px`,
|
|
78
|
-
"--logo-block-max-width": `${maxWidth}px`,
|
|
79
|
-
...fitLogoDimensions({ asset, maxHeight, maxWidth })
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function LogoBlockImage({
|
|
83
|
-
asset,
|
|
84
|
-
className,
|
|
85
|
-
maxHeight,
|
|
86
|
-
maxWidth,
|
|
87
|
-
siteName
|
|
88
|
-
}) {
|
|
89
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
-
"img",
|
|
91
|
-
{
|
|
92
|
-
alt: "",
|
|
93
|
-
"aria-hidden": "true",
|
|
94
|
-
className: cn(
|
|
95
|
-
"block max-h-(--logo-block-max-height) max-w-(--logo-block-max-width) object-contain",
|
|
96
|
-
className
|
|
97
|
-
),
|
|
98
|
-
height: asset.height,
|
|
99
|
-
src: asset.outputPath,
|
|
100
|
-
style: getLogoStyle({ asset, maxHeight, maxWidth }),
|
|
101
|
-
title: siteName,
|
|
102
|
-
width: asset.width
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
function LogoBlock({
|
|
107
|
-
className,
|
|
108
|
-
logo,
|
|
109
|
-
maxHeight = DEFAULT_LOGO_MAX_HEIGHT,
|
|
110
|
-
maxWidth = DEFAULT_LOGO_MAX_WIDTH,
|
|
111
|
-
siteName
|
|
112
|
-
}) {
|
|
113
|
-
const lightCandidate = logo?.light;
|
|
114
|
-
const darkCandidate = logo?.dark;
|
|
115
|
-
const lightLogo = isValidLogoAsset(lightCandidate) ? lightCandidate : darkCandidate;
|
|
116
|
-
const darkLogo = isValidLogoAsset(darkCandidate) ? darkCandidate : lightLogo;
|
|
117
|
-
if (!isValidLogoAsset(lightLogo)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: siteName });
|
|
118
|
-
if (!isValidLogoAsset(darkLogo) || darkLogo.outputPath === lightLogo.outputPath) {
|
|
119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
-
LogoBlockImage,
|
|
121
|
-
{
|
|
122
|
-
asset: lightLogo,
|
|
123
|
-
className,
|
|
124
|
-
maxHeight,
|
|
125
|
-
maxWidth,
|
|
126
|
-
siteName
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
131
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block dark:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
-
LogoBlockImage,
|
|
133
|
-
{
|
|
134
|
-
asset: lightLogo,
|
|
135
|
-
className: cn(className),
|
|
136
|
-
maxHeight,
|
|
137
|
-
maxWidth,
|
|
138
|
-
siteName
|
|
139
|
-
}
|
|
140
|
-
) }),
|
|
141
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "hidden dark:block", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
-
LogoBlockImage,
|
|
143
|
-
{
|
|
144
|
-
asset: darkLogo,
|
|
145
|
-
className: cn(className),
|
|
146
|
-
maxHeight,
|
|
147
|
-
maxWidth,
|
|
148
|
-
siteName
|
|
149
|
-
}
|
|
150
|
-
) })
|
|
151
|
-
] });
|
|
152
|
-
}
|
|
153
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
154
|
-
0 && (module.exports = {
|
|
155
|
-
LogoBlock
|
|
156
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
type LogoBlockAsset = {
|
|
4
|
-
readonly outputPath: string;
|
|
5
|
-
readonly width?: number;
|
|
6
|
-
readonly height?: number;
|
|
7
|
-
};
|
|
8
|
-
type LogoBlockLogo = {
|
|
9
|
-
readonly light?: LogoBlockAsset;
|
|
10
|
-
readonly dark?: LogoBlockAsset;
|
|
11
|
-
};
|
|
12
|
-
type LogoBlockProps = {
|
|
13
|
-
className?: string;
|
|
14
|
-
logo?: LogoBlockLogo;
|
|
15
|
-
maxHeight?: number;
|
|
16
|
-
maxWidth?: number;
|
|
17
|
-
siteName: string;
|
|
18
|
-
};
|
|
19
|
-
declare function LogoBlock({ className, logo, maxHeight, maxWidth, siteName, }: LogoBlockProps): react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
21
|
-
export { LogoBlock, type LogoBlockAsset, type LogoBlockLogo, type LogoBlockProps };
|
|
@@ -1,122 +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/nav-breadcrumb.tsx
|
|
21
|
-
var nav_breadcrumb_exports = {};
|
|
22
|
-
__export(nav_breadcrumb_exports, {
|
|
23
|
-
NavBreadcrumb: () => NavBreadcrumb
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(nav_breadcrumb_exports);
|
|
26
|
-
var import_breadcrumb = require("../ui/breadcrumb.js");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
function titleFor(node) {
|
|
29
|
-
return node.title;
|
|
30
|
-
}
|
|
31
|
-
function pathFor(node) {
|
|
32
|
-
if (node.type === "page") return node.path;
|
|
33
|
-
if (node.type === "link") return node.href;
|
|
34
|
-
if (node.type === "folder") return node.path;
|
|
35
|
-
if (node.type === "section") return node.path;
|
|
36
|
-
return void 0;
|
|
37
|
-
}
|
|
38
|
-
function rankFor(node) {
|
|
39
|
-
if (node.type === "page" || node.type === "section") return 2;
|
|
40
|
-
if (node.type === "folder") return 1;
|
|
41
|
-
return 0;
|
|
42
|
-
}
|
|
43
|
-
function findCrumbs(nodes, pathname, parents = []) {
|
|
44
|
-
const matches = [];
|
|
45
|
-
for (const node of nodes) {
|
|
46
|
-
const path = pathFor(node);
|
|
47
|
-
const nextParents = path ? [...parents, { title: titleFor(node), path }] : parents;
|
|
48
|
-
if (path === pathname) {
|
|
49
|
-
matches.push({
|
|
50
|
-
crumbs: nextParents.map((crumb, index) => ({
|
|
51
|
-
...crumb,
|
|
52
|
-
current: index === nextParents.length - 1
|
|
53
|
-
})),
|
|
54
|
-
pathLength: path.length,
|
|
55
|
-
rank: rankFor(node)
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (node.type === "section" || node.type === "folder") {
|
|
59
|
-
const childMatch = findCrumbs(node.children, pathname, nextParents);
|
|
60
|
-
if (childMatch) matches.push(childMatch);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return matches.sort(
|
|
64
|
-
(a, b) => b.rank - a.rank || b.pathLength - a.pathLength || b.crumbs.length - a.crumbs.length
|
|
65
|
-
)[0] ?? null;
|
|
66
|
-
}
|
|
67
|
-
function groupFallback(tree, pathname) {
|
|
68
|
-
const groups = tree.map((group) => ({ group, path: pathFor(group) })).filter(
|
|
69
|
-
(entry) => typeof entry.path === "string"
|
|
70
|
-
).sort((a, b) => b.path.length - a.path.length);
|
|
71
|
-
for (const { group, path } of groups) {
|
|
72
|
-
if (pathname.startsWith(`${path}/`)) {
|
|
73
|
-
return [{ title: titleFor(group), path }];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
function buildCrumbs(site, tree, pathname) {
|
|
79
|
-
const root = {
|
|
80
|
-
title: site.name,
|
|
81
|
-
path: "/",
|
|
82
|
-
current: pathname === "/"
|
|
83
|
-
};
|
|
84
|
-
if (pathname === "/") return [root];
|
|
85
|
-
const treeMatch = findCrumbs(tree, pathname);
|
|
86
|
-
if (treeMatch) return [root, ...treeMatch.crumbs];
|
|
87
|
-
return [
|
|
88
|
-
root,
|
|
89
|
-
...groupFallback(tree, pathname).map((crumb) => ({
|
|
90
|
-
...crumb,
|
|
91
|
-
current: false
|
|
92
|
-
}))
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
function NavBreadcrumb({
|
|
96
|
-
currentPath = "/",
|
|
97
|
-
showRoot = true,
|
|
98
|
-
site,
|
|
99
|
-
tree
|
|
100
|
-
}) {
|
|
101
|
-
const crumbs = buildCrumbs(site, tree, currentPath);
|
|
102
|
-
const visibleCrumbs = showRoot ? crumbs : crumbs.slice(1);
|
|
103
|
-
const items = visibleCrumbs.map((crumb) => ({
|
|
104
|
-
current: crumb.current,
|
|
105
|
-
href: crumb.path,
|
|
106
|
-
title: crumb.title
|
|
107
|
-
}));
|
|
108
|
-
if (items.length === 0) return null;
|
|
109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
-
import_breadcrumb.BreadcrumbTrail,
|
|
111
|
-
{
|
|
112
|
-
collapseAfter: 1,
|
|
113
|
-
collapseBefore: 2,
|
|
114
|
-
items,
|
|
115
|
-
size: "sm"
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
-
0 && (module.exports = {
|
|
121
|
-
NavBreadcrumb
|
|
122
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SiteData, TreeNode } from '@publish.os/nextjs/types';
|
|
3
|
-
|
|
4
|
-
declare function NavBreadcrumb({ currentPath, showRoot, site, tree, }: {
|
|
5
|
-
currentPath?: string;
|
|
6
|
-
showRoot?: boolean;
|
|
7
|
-
site: SiteData;
|
|
8
|
-
tree: TreeNode[];
|
|
9
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
10
|
-
|
|
11
|
-
export { NavBreadcrumb };
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/kernel/components/blocks/navbar.tsx
|
|
32
|
-
var navbar_exports = {};
|
|
33
|
-
__export(navbar_exports, {
|
|
34
|
-
Navbar: () => Navbar
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(navbar_exports);
|
|
37
|
-
var import_logo_block = require("./logo-block.js");
|
|
38
|
-
var import_nav_breadcrumb = require("./nav-breadcrumb.js");
|
|
39
|
-
var import_search = require("./search.js");
|
|
40
|
-
var import_theme_toggle = require("./theme-toggle.js");
|
|
41
|
-
var import_link = require("../ui/link.js");
|
|
42
|
-
|
|
43
|
-
// src/utils/cn.ts
|
|
44
|
-
var import_clsx = require("clsx");
|
|
45
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
46
|
-
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
47
|
-
extend: {
|
|
48
|
-
classGroups: {
|
|
49
|
-
z: [
|
|
50
|
-
"z-content",
|
|
51
|
-
"z-nav",
|
|
52
|
-
"z-overlay",
|
|
53
|
-
"z-modal",
|
|
54
|
-
"z-search",
|
|
55
|
-
"z-toast",
|
|
56
|
-
"z-progress"
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
function cn(...inputs) {
|
|
62
|
-
return twMerge((0, import_clsx.clsx)(inputs));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/kernel/components/blocks/navbar.tsx
|
|
66
|
-
var import_lucide_react = require("lucide-react");
|
|
67
|
-
var import_link2 = __toESM(require("next/link"), 1);
|
|
68
|
-
var import_navigation = require("next/navigation");
|
|
69
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
70
|
-
function hasPath(node) {
|
|
71
|
-
return "path" in node && typeof node.path === "string";
|
|
72
|
-
}
|
|
73
|
-
function isTopLevelGroup(node) {
|
|
74
|
-
return node.type === "section" && typeof node.group === "string" && !node.group.includes("/");
|
|
75
|
-
}
|
|
76
|
-
function Navbar({
|
|
77
|
-
logo,
|
|
78
|
-
site,
|
|
79
|
-
siteTitle,
|
|
80
|
-
showThemeToggle = true,
|
|
81
|
-
tree
|
|
82
|
-
}) {
|
|
83
|
-
const pathname = (0, import_navigation.usePathname)() || "/";
|
|
84
|
-
const headerSite = site ?? { name: siteTitle ?? "Site" };
|
|
85
|
-
const groups = tree.filter(hasPath).filter(isTopLevelGroup);
|
|
86
|
-
const activeGroupPath = groups.map((group) => group.path).filter((path) => pathname === path || pathname.startsWith(`${path}/`)).sort((a, b) => b.length - a.length)[0];
|
|
87
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", { className: "sticky top-0 z-nav border-b border-stroke-3 bg-surface-2 [anchor-name:--global-navbar]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto flex min-h-[var(--layout-global-nav-height)] w-full max-w-(--layout-site-max-width) flex-col gap-3 border-x border-stroke-3 px-5 py-3 md:flex-row md:items-center md:gap-4 md:py-2 lg:px-6", children: [
|
|
88
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
-
import_link2.default,
|
|
91
|
-
{
|
|
92
|
-
"aria-label": `${headerSite.name} home`,
|
|
93
|
-
className: "inline-flex h-8 shrink-0 items-center text-sm font-semibold text-foreground-1 transition-colors hover:text-accent-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-1",
|
|
94
|
-
href: "/",
|
|
95
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_logo_block.LogoBlock, { logo, siteName: headerSite.name })
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "hidden h-4 w-px shrink-0 bg-stroke-3 md:block" }),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
-
import_nav_breadcrumb.NavBreadcrumb,
|
|
101
|
-
{
|
|
102
|
-
currentPath: pathname,
|
|
103
|
-
showRoot: false,
|
|
104
|
-
site: headerSite,
|
|
105
|
-
tree
|
|
106
|
-
}
|
|
107
|
-
) })
|
|
108
|
-
] }),
|
|
109
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2", children: [
|
|
110
|
-
groups.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
-
"nav",
|
|
112
|
-
{
|
|
113
|
-
"aria-label": "Groups",
|
|
114
|
-
className: "flex min-w-0 flex-wrap items-center gap-2 text-sm",
|
|
115
|
-
children: groups.map((group) => {
|
|
116
|
-
const path = group.path;
|
|
117
|
-
const active = path === activeGroupPath;
|
|
118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
import_link.Link,
|
|
120
|
-
{
|
|
121
|
-
active,
|
|
122
|
-
className: cn(
|
|
123
|
-
"px-1 text-foreground-2",
|
|
124
|
-
active && "text-foreground-1"
|
|
125
|
-
),
|
|
126
|
-
href: path,
|
|
127
|
-
size: "sm",
|
|
128
|
-
variant: "link.standalone",
|
|
129
|
-
children: group.title
|
|
130
|
-
},
|
|
131
|
-
group.type === "page" ? group.fileID : group.id
|
|
132
|
-
);
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
) : null,
|
|
136
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search.Search.DefaultDesktop, {}),
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
-
import_link.Link,
|
|
139
|
-
{
|
|
140
|
-
href: "/",
|
|
141
|
-
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { "aria-hidden": "true", size: 14 }),
|
|
142
|
-
size: "sm",
|
|
143
|
-
variant: "button.solid",
|
|
144
|
-
children: "Start"
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
showThemeToggle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_toggle.ThemeToggle, {}) : null
|
|
148
|
-
] })
|
|
149
|
-
] }) });
|
|
150
|
-
}
|
|
151
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
-
0 && (module.exports = {
|
|
153
|
-
Navbar
|
|
154
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { LogoBlockLogo, LogoBlockAsset } from './logo-block.cjs';
|
|
3
|
-
import { SiteData, TreeNode } from '@publish.os/nextjs/types';
|
|
4
|
-
|
|
5
|
-
type NavbarProps = {
|
|
6
|
-
logo?: NavbarLogo;
|
|
7
|
-
site?: SiteData;
|
|
8
|
-
siteTitle?: string;
|
|
9
|
-
tree: TreeNode[];
|
|
10
|
-
showThemeToggle?: boolean;
|
|
11
|
-
};
|
|
12
|
-
type NavbarLogoAsset = LogoBlockAsset;
|
|
13
|
-
type NavbarLogo = LogoBlockLogo;
|
|
14
|
-
declare function Navbar({ logo, site, siteTitle, showThemeToggle, tree, }: NavbarProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
export { Navbar, type NavbarLogo, type NavbarLogoAsset };
|