@clarify-labs/renderer 0.11.7 → 0.11.9
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/output/{ClarifyShell-CukbPOAd.cjs → ClarifyShell-GCXbb_AF.cjs} +120 -68
- package/output/ClarifyShell-GCXbb_AF.cjs.map +1 -0
- package/output/{ClarifyShell-CKvXZj0f.js → ClarifyShell-nV23Fn7m.js} +120 -68
- package/output/ClarifyShell-nV23Fn7m.js.map +1 -0
- package/output/{MermaidViewer-FOg263MO.cjs → MermaidViewer-DEKNDG7K.cjs} +3 -3
- package/output/{MermaidViewer-FOg263MO.cjs.map → MermaidViewer-DEKNDG7K.cjs.map} +1 -1
- package/output/{MermaidViewer-_tpH0JNn.js → MermaidViewer-Ssxr00dy.js} +3 -3
- package/output/{MermaidViewer-_tpH0JNn.js.map → MermaidViewer-Ssxr00dy.js.map} +1 -1
- package/output/{OpenApiOperation-Dv9u2GEJ.js → OpenApiOperation-B26v2y44.js} +77 -12
- package/output/{OpenApiOperation-Dv9u2GEJ.js.map → OpenApiOperation-B26v2y44.js.map} +1 -1
- package/output/{OpenApiOperation-c-I6Nw9j.cjs → OpenApiOperation-DIgbzvk5.cjs} +77 -12
- package/output/{OpenApiOperation-c-I6Nw9j.cjs.map → OpenApiOperation-DIgbzvk5.cjs.map} +1 -1
- package/output/{PageActions-DviEypf6.js → PageActions-BbmyFeSk.js} +114 -76
- package/output/PageActions-BbmyFeSk.js.map +1 -0
- package/output/{PageActions-ob2OJusG.cjs → PageActions-DxGK-444.cjs} +119 -75
- package/output/PageActions-DxGK-444.cjs.map +1 -0
- package/output/{SearchDialog-89JAjQMh.js → SearchDialog-4oEbmVMR.js} +29 -20
- package/output/SearchDialog-4oEbmVMR.js.map +1 -0
- package/output/{SearchDialog-CTiUIKeo.cjs → SearchDialog-DexOW8E4.cjs} +29 -20
- package/output/SearchDialog-DexOW8E4.cjs.map +1 -0
- package/output/app/AppShell.d.ts +1 -2
- package/output/app/BuiltInNotFoundPage.d.ts +1 -0
- package/output/app/PageActions.d.ts +0 -1
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/context.d.ts +2 -1
- package/output/core/context.d.ts +9 -0
- package/output/core/types.d.ts +4 -0
- package/output/{i18n-Cjfk1N7i.cjs → i18n-BuvwT5W9.cjs} +38 -3
- package/output/i18n-BuvwT5W9.cjs.map +1 -0
- package/output/{i18n-Cff810G_.js → i18n-C6tIP-nl.js} +26 -3
- package/output/i18n-C6tIP-nl.js.map +1 -0
- package/output/index.cjs +11 -7
- package/output/index.cjs.map +1 -1
- package/output/index.d.ts +3 -2
- package/output/index.js +8 -8
- package/output/index.js.map +1 -1
- package/output/openapi/lib/api-exchange.d.ts +2 -0
- package/output/preview.cjs +6 -6
- package/output/preview.cjs.map +1 -1
- package/output/preview.js +6 -6
- package/output/preview.js.map +1 -1
- package/output/{render-B41PHjt8.js → render-CAtVGsQF.js} +2 -2
- package/output/{render-B41PHjt8.js.map → render-CAtVGsQF.js.map} +1 -1
- package/output/{render-BxiVlY6q.cjs → render-D8h-jcnw.cjs} +2 -2
- package/output/{render-BxiVlY6q.cjs.map → render-D8h-jcnw.cjs.map} +1 -1
- package/output/renderer.css +4 -0
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/output/shell/ContentActions.d.ts +0 -1
- package/output/shell/Header.d.ts +1 -2
- package/output/shell/Search.d.ts +3 -6
- package/output/shell/mobile.d.ts +1 -2
- package/output/shell/search/SearchDialog.d.ts +2 -1
- package/output/shell/search/pagefind.d.ts +3 -2
- package/output/theme/ThemeRoot.d.ts +0 -2
- package/output/theme/randomTheme.d.ts +2 -1
- package/output/utils/href.d.ts +2 -0
- package/package.json +1 -1
- package/output/ClarifyShell-CKvXZj0f.js.map +0 -1
- package/output/ClarifyShell-CukbPOAd.cjs.map +0 -1
- package/output/PageActions-DviEypf6.js.map +0 -1
- package/output/PageActions-ob2OJusG.cjs.map +0 -1
- package/output/SearchDialog-89JAjQMh.js.map +0 -1
- package/output/SearchDialog-CTiUIKeo.cjs.map +0 -1
- package/output/i18n-Cff810G_.js.map +0 -1
- package/output/i18n-Cjfk1N7i.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as useBuiltInText } from "./i18n-
|
|
1
|
+
import { a as useConfig, l as useLocale, t as useBuiltInText } from "./i18n-C6tIP-nl.js";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { Suspense, createContext, forwardRef, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Link, useLocation } from "react-router-dom";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { CloseButton, Dialog, DialogBackdrop, DialogPanel, Menu, MenuButton, MenuItem, MenuItems, TransitionChild } from "@headlessui/react";
|
|
6
7
|
import * as LucideIcons from "lucide-react";
|
|
7
8
|
import { Check, ChevronDown, ChevronLeft, ChevronRight, Copy, ExternalLink, FileText, Globe2, Link2, LoaderCircle, Menu as Menu$1, Monitor, Moon, MoreHorizontal, PencilLine, Search, Sun, Terminal, X } from "lucide-react";
|
|
8
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { AnimatePresence, LayoutGroup, motion, useReducedMotion, useScroll, useTransform } from "framer-motion";
|
|
10
10
|
import { create, createStore, useStore } from "zustand";
|
|
11
11
|
//#region source/utils/clipboard.ts
|
|
@@ -47,6 +47,10 @@ function localizeHref(href, config, locale) {
|
|
|
47
47
|
const cleanHref = href === "/" ? "" : href.replace(/^\/+/, "");
|
|
48
48
|
return `/${locale}${cleanHref ? `/${cleanHref}` : ""}`;
|
|
49
49
|
}
|
|
50
|
+
function resolveHomeHref(config, locale) {
|
|
51
|
+
const homeUrl = config.homeUrl ?? "/";
|
|
52
|
+
return isExternalHref(homeUrl) ? homeUrl : localizeHref(homeUrl, config, locale);
|
|
53
|
+
}
|
|
50
54
|
function prefixHref(href, routePrefix = "/") {
|
|
51
55
|
if (isExternalHref(href) || href.startsWith("#")) return href;
|
|
52
56
|
if (!routePrefix || routePrefix === "/") return href.startsWith("/") ? href : `/${href}`;
|
|
@@ -56,17 +60,24 @@ function prefixHref(href, routePrefix = "/") {
|
|
|
56
60
|
if (path === prefix || path.startsWith(`${prefix}/`)) return `/${path}`;
|
|
57
61
|
return `/${prefix}/${path}`;
|
|
58
62
|
}
|
|
63
|
+
function resolveAbsoluteSiteHref(href, config) {
|
|
64
|
+
const path = prefixHref(href, config.routePrefix);
|
|
65
|
+
if (isExternalHref(path)) return path;
|
|
66
|
+
const base = config.siteUrl;
|
|
67
|
+
if (!base) return void 0;
|
|
68
|
+
return new URL(path, base.endsWith("/") ? base : `${base}/`).href;
|
|
69
|
+
}
|
|
59
70
|
//#endregion
|
|
60
71
|
//#region source/shell/ContentActions.tsx
|
|
61
72
|
function resolveContentArtifactUrl(contentArtifactUrl, routePrefix = "/") {
|
|
62
73
|
return prefixHref(contentArtifactUrl, routePrefix);
|
|
63
74
|
}
|
|
64
|
-
function getAbsoluteUrl(path) {
|
|
65
|
-
if (typeof window === "undefined") return path;
|
|
66
|
-
return new URL(path, window.location.href).href;
|
|
67
|
-
}
|
|
68
75
|
function ContentActions(arg0) {
|
|
69
|
-
const { route
|
|
76
|
+
const { route } = arg0;
|
|
77
|
+
const config = useConfig();
|
|
78
|
+
const routePrefix = config.routePrefix;
|
|
79
|
+
const absoluteLinksEnabled = Boolean(config.siteUrl);
|
|
80
|
+
const mcpEnabled = absoluteLinksEnabled && config.features.search.enabled && config.features.search.mcp;
|
|
70
81
|
const t = useBuiltInText();
|
|
71
82
|
const [copied, setCopied] = useState("idle");
|
|
72
83
|
const [copyPhase, setCopyPhase] = useState("idle");
|
|
@@ -105,22 +116,25 @@ function ContentActions(arg0) {
|
|
|
105
116
|
const llmsArtifactUrl = resolveContentArtifactUrl("/llms.txt", routePrefix);
|
|
106
117
|
async function handleCopyLink() {
|
|
107
118
|
if (!contentArtifactUrl) return;
|
|
108
|
-
await runCopy("link", () =>
|
|
119
|
+
await runCopy("link", () => resolveAbsoluteSiteHref(contentArtifactUrl, config) ?? contentArtifactUrl);
|
|
109
120
|
}
|
|
110
121
|
async function handleCopyLlms() {
|
|
111
|
-
await runCopy("llms", () =>
|
|
122
|
+
await runCopy("llms", () => resolveAbsoluteSiteHref(llmsArtifactUrl, config) ?? llmsArtifactUrl);
|
|
112
123
|
}
|
|
113
124
|
async function handleCopyMcp() {
|
|
114
|
-
await runCopy("mcp", () =>
|
|
125
|
+
await runCopy("mcp", () => {
|
|
126
|
+
const siteUrl = resolveAbsoluteSiteHref("/", config);
|
|
127
|
+
if (!siteUrl) throw new Error("siteUrl is required for MCP configuration");
|
|
128
|
+
return JSON.stringify({ mcpServers: { clarify: {
|
|
129
|
+
command: "npx",
|
|
130
|
+
args: [
|
|
131
|
+
"@clarify-labs/cli",
|
|
132
|
+
"mcp",
|
|
133
|
+
siteUrl
|
|
134
|
+
]
|
|
135
|
+
} } }, null, 2);
|
|
136
|
+
});
|
|
115
137
|
}
|
|
116
|
-
const mcpConfig = JSON.stringify({ mcpServers: { clarify: {
|
|
117
|
-
command: "npx",
|
|
118
|
-
args: [
|
|
119
|
-
"@clarify-labs/cli",
|
|
120
|
-
"mcp",
|
|
121
|
-
window.location.origin
|
|
122
|
-
]
|
|
123
|
-
} } }, null, 2);
|
|
124
138
|
const actions = contentArtifactUrl ? [{
|
|
125
139
|
key: "content",
|
|
126
140
|
label: t("contentActions.copyContent"),
|
|
@@ -128,14 +142,14 @@ function ContentActions(arg0) {
|
|
|
128
142
|
icon: Copy,
|
|
129
143
|
run: handleCopyContent,
|
|
130
144
|
copiedLabel: t("contentActions.copiedContent")
|
|
131
|
-
}, {
|
|
145
|
+
}, ...absoluteLinksEnabled ? [{
|
|
132
146
|
key: "link",
|
|
133
147
|
label: t("contentActions.copyLink", replacements),
|
|
134
148
|
description: t("contentActions.copyLinkDescription", replacements),
|
|
135
149
|
icon: Link2,
|
|
136
150
|
run: handleCopyLink,
|
|
137
151
|
copiedLabel: t("contentActions.copiedLink")
|
|
138
|
-
}] : [];
|
|
152
|
+
}] : []] : [];
|
|
139
153
|
const llmsAction = {
|
|
140
154
|
key: "llms",
|
|
141
155
|
label: t("contentActions.copyLlms"),
|
|
@@ -298,7 +312,7 @@ function ContentActions(arg0) {
|
|
|
298
312
|
]
|
|
299
313
|
}) }, action.key);
|
|
300
314
|
}),
|
|
301
|
-
/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
|
|
315
|
+
absoluteLinksEnabled ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
|
|
302
316
|
type: "button",
|
|
303
317
|
onClick: llmsAction.run,
|
|
304
318
|
className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left transition",
|
|
@@ -319,8 +333,8 @@ function ContentActions(arg0) {
|
|
|
319
333
|
}),
|
|
320
334
|
/* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === llmsAction.key ? "opacity-100" : "opacity-0"}` })
|
|
321
335
|
]
|
|
322
|
-
}) }, llmsAction.key),
|
|
323
|
-
/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
|
|
336
|
+
}) }, llmsAction.key) : null,
|
|
337
|
+
mcpEnabled ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("button", {
|
|
324
338
|
type: "button",
|
|
325
339
|
onClick: mcpAction.run,
|
|
326
340
|
className: "clarify-content-actions-item clarify-ui-menu-item group flex w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) px-1.5 py-1.5 text-left transition",
|
|
@@ -341,7 +355,7 @@ function ContentActions(arg0) {
|
|
|
341
355
|
}),
|
|
342
356
|
/* @__PURE__ */ jsx(Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === mcpAction.key ? "opacity-100" : "opacity-0"}` })
|
|
343
357
|
]
|
|
344
|
-
}) }, mcpAction.key)
|
|
358
|
+
}) }, mcpAction.key) : null
|
|
345
359
|
]
|
|
346
360
|
})
|
|
347
361
|
]
|
|
@@ -1081,7 +1095,7 @@ function MobileTabsSelect(arg0) {
|
|
|
1081
1095
|
});
|
|
1082
1096
|
}
|
|
1083
1097
|
function MobileNavigationDialog(arg0) {
|
|
1084
|
-
const {
|
|
1098
|
+
const { isOpen, navigation, tabs, routes, currentLocale, currentRoute, close } = arg0;
|
|
1085
1099
|
return /* @__PURE__ */ jsxs(Dialog, {
|
|
1086
1100
|
transition: true,
|
|
1087
1101
|
open: isOpen,
|
|
@@ -1091,7 +1105,6 @@ function MobileNavigationDialog(arg0) {
|
|
|
1091
1105
|
transition: true,
|
|
1092
1106
|
className: "clarify-mobile-navigation-backdrop clarify-ui-backdrop fixed inset-0 top-14 backdrop-blur-xs data-closed:opacity-0 data-enter:duration-300 data-enter:ease-out data-leave:duration-200 data-leave:ease-in"
|
|
1093
1107
|
}), /* @__PURE__ */ jsxs(DialogPanel, { children: [/* @__PURE__ */ jsx(TransitionChild, { children: /* @__PURE__ */ jsx(Header, {
|
|
1094
|
-
config,
|
|
1095
1108
|
navigation,
|
|
1096
1109
|
tabs,
|
|
1097
1110
|
routes,
|
|
@@ -1121,7 +1134,7 @@ var useMobileNavigationStore = create()((set) => ({
|
|
|
1121
1134
|
toggle: () => set((state) => ({ isOpen: !state.isOpen }))
|
|
1122
1135
|
}));
|
|
1123
1136
|
function MobileNavigation(arg0) {
|
|
1124
|
-
const {
|
|
1137
|
+
const { navigation, tabs, routes, currentLocale, currentRoute } = arg0;
|
|
1125
1138
|
const isInsideMobileNavigation = useIsInsideMobileNavigation();
|
|
1126
1139
|
const { isOpen, toggle, close } = useMobileNavigationStore();
|
|
1127
1140
|
const t = useBuiltInText();
|
|
@@ -1137,7 +1150,6 @@ function MobileNavigation(arg0) {
|
|
|
1137
1150
|
}), !isInsideMobileNavigation ? /* @__PURE__ */ jsx(Suspense, {
|
|
1138
1151
|
fallback: null,
|
|
1139
1152
|
children: /* @__PURE__ */ jsx(MobileNavigationDialog, {
|
|
1140
|
-
config,
|
|
1141
1153
|
navigation,
|
|
1142
1154
|
tabs,
|
|
1143
1155
|
routes,
|
|
@@ -1169,43 +1181,44 @@ function useSearchProps() {
|
|
|
1169
1181
|
}
|
|
1170
1182
|
//#endregion
|
|
1171
1183
|
//#region source/shell/Search.tsx
|
|
1172
|
-
var SearchDialog = lazy(() => import("./SearchDialog-
|
|
1184
|
+
var SearchDialog = lazy(() => import("./SearchDialog-4oEbmVMR.js"));
|
|
1173
1185
|
function getModifierKey() {
|
|
1174
1186
|
if (typeof navigator === "undefined") return "Ctrl ";
|
|
1175
1187
|
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
|
|
1176
1188
|
}
|
|
1177
1189
|
function Search$1(arg0) {
|
|
1178
|
-
const { routes, navigation,
|
|
1190
|
+
const { routes, navigation, compact = false } = arg0;
|
|
1191
|
+
const config = useConfig();
|
|
1192
|
+
const currentLocale = useLocale() ?? config.locales?.default;
|
|
1179
1193
|
const t = useBuiltInText();
|
|
1180
1194
|
const modifierKey = getModifierKey();
|
|
1181
1195
|
const { buttonProps, dialogProps } = useSearchProps();
|
|
1196
|
+
if (!config.features.search.enabled) return null;
|
|
1182
1197
|
return /* @__PURE__ */ jsxs("div", {
|
|
1183
|
-
className: "clarify-search hidden w-80 max-w-(--clarify-search-max-width) lg:block",
|
|
1198
|
+
className: compact ? "clarify-search hidden lg:block" : "clarify-search hidden w-80 max-w-(--clarify-search-max-width) lg:block",
|
|
1184
1199
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
1185
1200
|
type: "button",
|
|
1186
|
-
className: "clarify-search-button hidden h-9 w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) pr-3 pl-2.5 font-medium ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-theme-tokens-colors-background) lg:flex dark:bg-white/5 dark:ring-white/10 dark:ring-inset dark:hover:bg-white/10",
|
|
1201
|
+
className: compact ? "clarify-search-button clarify-ui-control hidden size-9 items-center justify-center rounded-(--clarify-theme-tokens-radius-md) transition lg:flex" : "clarify-search-button hidden h-9 w-full items-center gap-2 rounded-(--clarify-theme-tokens-radius-lg) bg-(--clarify-theme-tokens-colors-surface) pr-3 pl-2.5 font-medium ring-1 ring-(--clarify-theme-tokens-colors-border) transition hover:bg-(--clarify-theme-tokens-colors-background) lg:flex dark:bg-white/5 dark:ring-white/10 dark:ring-inset dark:hover:bg-white/10",
|
|
1202
|
+
"aria-label": compact ? t("search.placeholder") : void 0,
|
|
1187
1203
|
...buttonProps,
|
|
1188
|
-
children: [
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
children: "K"
|
|
1199
|
-
})]
|
|
1200
|
-
})
|
|
1201
|
-
]
|
|
1204
|
+
children: [/* @__PURE__ */ jsx(Search, { className: "h-5 w-5 stroke-current" }), !compact ? /* @__PURE__ */ jsxs(Fragment$1, { children: [t("search.button"), /* @__PURE__ */ jsxs("kbd", {
|
|
1205
|
+
className: "clarify-search-shortcut ml-auto rounded-(--clarify-theme-tokens-radius-sm) bg-(--clarify-theme-tokens-colors-background) px-1.5 py-0.5 ring-1 ring-(--clarify-theme-tokens-colors-border) dark:bg-white/5 dark:ring-white/10",
|
|
1206
|
+
children: [/* @__PURE__ */ jsx("kbd", {
|
|
1207
|
+
className: "font-sans",
|
|
1208
|
+
children: modifierKey
|
|
1209
|
+
}), /* @__PURE__ */ jsx("kbd", {
|
|
1210
|
+
className: "font-sans",
|
|
1211
|
+
children: "K"
|
|
1212
|
+
})]
|
|
1213
|
+
})] }) : null]
|
|
1202
1214
|
}), /* @__PURE__ */ jsx(Suspense, {
|
|
1203
1215
|
fallback: null,
|
|
1204
1216
|
children: /* @__PURE__ */ jsx(SearchDialog, {
|
|
1205
1217
|
className: "hidden lg:block",
|
|
1206
1218
|
routes,
|
|
1207
1219
|
navigation,
|
|
1208
|
-
routePrefix,
|
|
1220
|
+
routePrefix: config.routePrefix,
|
|
1221
|
+
assetPrefix: config.assetPrefix,
|
|
1209
1222
|
currentLocale,
|
|
1210
1223
|
...dialogProps
|
|
1211
1224
|
})
|
|
@@ -1213,9 +1226,12 @@ function Search$1(arg0) {
|
|
|
1213
1226
|
});
|
|
1214
1227
|
}
|
|
1215
1228
|
function MobileSearch(arg0) {
|
|
1216
|
-
const { routes, navigation,
|
|
1229
|
+
const { routes, navigation, onNavigate } = arg0;
|
|
1230
|
+
const config = useConfig();
|
|
1231
|
+
const currentLocale = useLocale() ?? config.locales?.default;
|
|
1217
1232
|
const t = useBuiltInText();
|
|
1218
1233
|
const { buttonProps, dialogProps } = useSearchProps();
|
|
1234
|
+
if (!config.features.search.enabled) return null;
|
|
1219
1235
|
return /* @__PURE__ */ jsxs("div", {
|
|
1220
1236
|
className: "clarify-mobile-search contents lg:hidden",
|
|
1221
1237
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
@@ -1230,7 +1246,8 @@ function MobileSearch(arg0) {
|
|
|
1230
1246
|
className: "lg:hidden",
|
|
1231
1247
|
routes,
|
|
1232
1248
|
navigation,
|
|
1233
|
-
routePrefix,
|
|
1249
|
+
routePrefix: config.routePrefix,
|
|
1250
|
+
assetPrefix: config.assetPrefix,
|
|
1234
1251
|
currentLocale,
|
|
1235
1252
|
onNavigate,
|
|
1236
1253
|
...dialogProps
|
|
@@ -1339,9 +1356,30 @@ function TopLevelNavItem(arg0) {
|
|
|
1339
1356
|
children
|
|
1340
1357
|
}) });
|
|
1341
1358
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1359
|
+
function NavbarTabs(arg0) {
|
|
1360
|
+
const { tabs, currentLocale } = arg0;
|
|
1361
|
+
const pathname = normalizeRoutePath(useLocation().pathname);
|
|
1362
|
+
const t = useBuiltInText();
|
|
1363
|
+
if (!tabs?.length) return null;
|
|
1364
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
1365
|
+
className: "clarify-tabs-navbar hidden md:block",
|
|
1366
|
+
"aria-label": t("navbar.sections"),
|
|
1367
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
1368
|
+
role: "list",
|
|
1369
|
+
className: "flex items-center gap-0.5",
|
|
1370
|
+
children: tabs.map((tab) => {
|
|
1371
|
+
const active = isActiveTab(tab, pathname, currentLocale);
|
|
1372
|
+
return /* @__PURE__ */ jsxs(TopLevelNavItem, {
|
|
1373
|
+
href: tab.path,
|
|
1374
|
+
active,
|
|
1375
|
+
children: [/* @__PURE__ */ jsx(NavigationIcon, {
|
|
1376
|
+
name: tab.icon,
|
|
1377
|
+
className: "mr-1.5 h-4 w-4"
|
|
1378
|
+
}), /* @__PURE__ */ jsx("span", { children: tab.title })]
|
|
1379
|
+
}, `${tab.title}-${tab.path}`);
|
|
1380
|
+
})
|
|
1381
|
+
})
|
|
1382
|
+
});
|
|
1345
1383
|
}
|
|
1346
1384
|
function MobileNavbarMenu(arg0) {
|
|
1347
1385
|
const { links, config, currentLocale } = arg0;
|
|
@@ -1503,7 +1541,8 @@ function ProductTabs(arg0) {
|
|
|
1503
1541
|
});
|
|
1504
1542
|
}
|
|
1505
1543
|
var Header = forwardRef(function Header(arg0, ref) {
|
|
1506
|
-
const {
|
|
1544
|
+
const { navigation, tabs, routes, currentLocale, currentRoute, banner, topAreaRef, className, ...props } = arg0;
|
|
1545
|
+
const config = useConfig();
|
|
1507
1546
|
const t = useBuiltInText();
|
|
1508
1547
|
const pathname = normalizeRoutePath(useLocation().pathname);
|
|
1509
1548
|
const { isOpen: mobileNavIsOpen } = useMobileNavigationStore();
|
|
@@ -1514,6 +1553,7 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1514
1553
|
const bgOpacityLight = useTransform(scrollY, [0, 72], ["70%", "95%"]);
|
|
1515
1554
|
const bgOpacityDark = useTransform(scrollY, [0, 72], ["60%", "92%"]);
|
|
1516
1555
|
const hasNavbarLinks = Boolean(config.navigation?.links?.length);
|
|
1556
|
+
const tabsInNavbar = config.layout?.tabs === "navbar";
|
|
1517
1557
|
function renderBrand() {
|
|
1518
1558
|
if (homeExternal) return /* @__PURE__ */ jsxs(CloseButton, {
|
|
1519
1559
|
as: "a",
|
|
@@ -1565,13 +1605,20 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1565
1605
|
return /* @__PURE__ */ jsxs("div", {
|
|
1566
1606
|
className: "clarify-header-actions flex shrink-0 items-center gap-1",
|
|
1567
1607
|
children: [
|
|
1608
|
+
tabsInNavbar ? /* @__PURE__ */ jsx(Search$1, {
|
|
1609
|
+
compact: true,
|
|
1610
|
+
routes,
|
|
1611
|
+
navigation
|
|
1612
|
+
}) : null,
|
|
1613
|
+
tabsInNavbar ? /* @__PURE__ */ jsx(NavbarTabs, {
|
|
1614
|
+
tabs,
|
|
1615
|
+
currentLocale
|
|
1616
|
+
}) : null,
|
|
1568
1617
|
renderTopLinks(),
|
|
1569
1618
|
hasNavbarLinks ? /* @__PURE__ */ jsx("div", { className: "mx-2 hidden h-5 w-px bg-(--clarify-theme-tokens-colors-border) md:block md:dark:bg-white/15" }) : null,
|
|
1570
1619
|
/* @__PURE__ */ jsx(MobileSearch, {
|
|
1571
1620
|
routes,
|
|
1572
|
-
navigation
|
|
1573
|
-
routePrefix: config.routePrefix,
|
|
1574
|
-
currentLocale
|
|
1621
|
+
navigation
|
|
1575
1622
|
}),
|
|
1576
1623
|
/* @__PURE__ */ jsx(LanguageSwitcher, {
|
|
1577
1624
|
config,
|
|
@@ -1597,7 +1644,6 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1597
1644
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1598
1645
|
className: "clarify-mobile-brand flex items-center gap-5 lg:hidden",
|
|
1599
1646
|
children: /* @__PURE__ */ jsx(MobileNavigation, {
|
|
1600
|
-
config,
|
|
1601
1647
|
navigation,
|
|
1602
1648
|
tabs,
|
|
1603
1649
|
routes,
|
|
@@ -1606,15 +1652,13 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1606
1652
|
})
|
|
1607
1653
|
}), renderBrand()]
|
|
1608
1654
|
}),
|
|
1609
|
-
/* @__PURE__ */ jsx("div", {
|
|
1655
|
+
!tabsInNavbar ? /* @__PURE__ */ jsx("div", {
|
|
1610
1656
|
className: "clarify-header-center absolute left-1/2 hidden -translate-x-1/2 lg:block",
|
|
1611
1657
|
children: /* @__PURE__ */ jsx(Search$1, {
|
|
1612
1658
|
routes,
|
|
1613
|
-
navigation
|
|
1614
|
-
routePrefix: config.routePrefix,
|
|
1615
|
-
currentLocale
|
|
1659
|
+
navigation
|
|
1616
1660
|
})
|
|
1617
|
-
}),
|
|
1661
|
+
}) : null,
|
|
1618
1662
|
renderHeaderActions()
|
|
1619
1663
|
]
|
|
1620
1664
|
});
|
|
@@ -1628,10 +1672,10 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1628
1672
|
"data-clarify-header-banner": true,
|
|
1629
1673
|
children: banner
|
|
1630
1674
|
}),
|
|
1631
|
-
/* @__PURE__ */ jsx(ProductTabs, {
|
|
1675
|
+
!tabsInNavbar ? /* @__PURE__ */ jsx(ProductTabs, {
|
|
1632
1676
|
tabs,
|
|
1633
1677
|
currentLocale
|
|
1634
|
-
})
|
|
1678
|
+
}) : null
|
|
1635
1679
|
]
|
|
1636
1680
|
});
|
|
1637
1681
|
}
|
|
@@ -1651,23 +1695,17 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1651
1695
|
//#region source/app/PageActions.tsx
|
|
1652
1696
|
var PageActionsContext = createContext({});
|
|
1653
1697
|
function PageActionsProvider(props) {
|
|
1654
|
-
const { children, route
|
|
1698
|
+
const { children, route } = props;
|
|
1655
1699
|
return /* @__PURE__ */ jsx(PageActionsContext.Provider, {
|
|
1656
|
-
value: {
|
|
1657
|
-
route,
|
|
1658
|
-
routePrefix
|
|
1659
|
-
},
|
|
1700
|
+
value: { route },
|
|
1660
1701
|
children
|
|
1661
1702
|
});
|
|
1662
1703
|
}
|
|
1663
1704
|
function PageActions() {
|
|
1664
|
-
const { route
|
|
1665
|
-
return /* @__PURE__ */ jsx(ContentActions, {
|
|
1666
|
-
route,
|
|
1667
|
-
routePrefix
|
|
1668
|
-
});
|
|
1705
|
+
const { route } = useContext(PageActionsContext);
|
|
1706
|
+
return /* @__PURE__ */ jsx(ContentActions, { route });
|
|
1669
1707
|
}
|
|
1670
1708
|
//#endregion
|
|
1671
|
-
export { isExternalHref as C, copyTextToClipboard as E, themeCookieName as S, prefixHref as T, getStoredThemePreference as _, SectionProvider as a, storeLocalePreference as b, lucideIconRegistry as c, normalizeRoutePath as d, resolveLocalizedText as f, getStoredLocalePreference as g, useTheme as h, Navigation as i, resolveLucideIconName as l, ThemeProvider as m, PageActionsProvider as n, useSectionStore as o, ThemeToggle as p, Header as r, remToPx as s, PageActions as t, isSameRoutePath as u, localeCookieName as v, localizeHref as w, storeThemePreference as x, readLocaleCookie as y };
|
|
1709
|
+
export { isExternalHref as C, copyTextToClipboard as D, resolveHomeHref as E, themeCookieName as S, prefixHref as T, getStoredThemePreference as _, SectionProvider as a, storeLocalePreference as b, lucideIconRegistry as c, normalizeRoutePath as d, resolveLocalizedText as f, getStoredLocalePreference as g, useTheme as h, Navigation as i, resolveLucideIconName as l, ThemeProvider as m, PageActionsProvider as n, useSectionStore as o, ThemeToggle as p, Header as r, remToPx as s, PageActions as t, isSameRoutePath as u, localeCookieName as v, localizeHref as w, storeThemePreference as x, readLocaleCookie as y };
|
|
1672
1710
|
|
|
1673
|
-
//# sourceMappingURL=PageActions-
|
|
1711
|
+
//# sourceMappingURL=PageActions-BbmyFeSk.js.map
|