@clarify-labs/renderer 0.11.6 → 0.11.8
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-CKvXZj0f.js → ClarifyShell-CGoRrkn1.js} +120 -68
- package/output/ClarifyShell-CGoRrkn1.js.map +1 -0
- package/output/{ClarifyShell-CukbPOAd.cjs → ClarifyShell-D8OGIUWq.cjs} +120 -68
- package/output/ClarifyShell-D8OGIUWq.cjs.map +1 -0
- package/output/{MermaidViewer-FOg263MO.cjs → MermaidViewer-CFqy0BnO.cjs} +3 -3
- package/output/{MermaidViewer-FOg263MO.cjs.map → MermaidViewer-CFqy0BnO.cjs.map} +1 -1
- package/output/{MermaidViewer-_tpH0JNn.js → MermaidViewer-TdU3sRfy.js} +3 -3
- package/output/{MermaidViewer-_tpH0JNn.js.map → MermaidViewer-TdU3sRfy.js.map} +1 -1
- package/output/{OpenApiOperation-c-I6Nw9j.cjs → OpenApiOperation-Bd68uxXq.cjs} +9 -8
- package/output/{OpenApiOperation-c-I6Nw9j.cjs.map → OpenApiOperation-Bd68uxXq.cjs.map} +1 -1
- package/output/{OpenApiOperation-Dv9u2GEJ.js → OpenApiOperation-vCuIKI4O.js} +9 -8
- package/output/{OpenApiOperation-Dv9u2GEJ.js.map → OpenApiOperation-vCuIKI4O.js.map} +1 -1
- package/output/{PageActions-DviEypf6.js → PageActions-CqXr0SyW.js} +112 -75
- package/output/PageActions-CqXr0SyW.js.map +1 -0
- package/output/{PageActions-ob2OJusG.cjs → PageActions-DPYXFL6N.cjs} +117 -74
- package/output/PageActions-DPYXFL6N.cjs.map +1 -0
- package/output/{SearchDialog-89JAjQMh.js → SearchDialog-BQcbGNvl.js} +29 -20
- package/output/SearchDialog-BQcbGNvl.js.map +1 -0
- package/output/{SearchDialog-CTiUIKeo.cjs → SearchDialog-CExM6Bxd.cjs} +29 -20
- package/output/SearchDialog-CExM6Bxd.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-Cff810G_.js → i18n-D4O3z-sP.js} +24 -3
- package/output/i18n-D4O3z-sP.js.map +1 -0
- package/output/{i18n-Cjfk1N7i.cjs → i18n-Dw4Jlho-.cjs} +36 -3
- package/output/i18n-Dw4Jlho-.cjs.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/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-BxiVlY6q.cjs → render-CqBz1q82.cjs} +2 -2
- package/output/{render-BxiVlY6q.cjs.map → render-CqBz1q82.cjs.map} +1 -1
- package/output/{render-B41PHjt8.js → render-DQRifjrn.js} +2 -2
- package/output/{render-B41PHjt8.js.map → render-DQRifjrn.js.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,13 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
2
|
+
const require_i18n = require("./i18n-Dw4Jlho-.cjs");
|
|
3
3
|
let clsx = require("clsx");
|
|
4
4
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_router_dom = require("react-router-dom");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
let _headlessui_react = require("@headlessui/react");
|
|
8
9
|
let lucide_react = require("lucide-react");
|
|
9
10
|
lucide_react = require_rolldown_runtime.__toESM(lucide_react, 1);
|
|
10
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
let framer_motion = require("framer-motion");
|
|
12
12
|
let zustand = require("zustand");
|
|
13
13
|
//#region source/utils/clipboard.ts
|
|
@@ -49,6 +49,10 @@ function localizeHref(href, config, locale) {
|
|
|
49
49
|
const cleanHref = href === "/" ? "" : href.replace(/^\/+/, "");
|
|
50
50
|
return `/${locale}${cleanHref ? `/${cleanHref}` : ""}`;
|
|
51
51
|
}
|
|
52
|
+
function resolveHomeHref(config, locale) {
|
|
53
|
+
const homeUrl = config.homeUrl ?? "/";
|
|
54
|
+
return isExternalHref(homeUrl) ? homeUrl : localizeHref(homeUrl, config, locale);
|
|
55
|
+
}
|
|
52
56
|
function prefixHref(href, routePrefix = "/") {
|
|
53
57
|
if (isExternalHref(href) || href.startsWith("#")) return href;
|
|
54
58
|
if (!routePrefix || routePrefix === "/") return href.startsWith("/") ? href : `/${href}`;
|
|
@@ -58,17 +62,24 @@ function prefixHref(href, routePrefix = "/") {
|
|
|
58
62
|
if (path === prefix || path.startsWith(`${prefix}/`)) return `/${path}`;
|
|
59
63
|
return `/${prefix}/${path}`;
|
|
60
64
|
}
|
|
65
|
+
function resolveAbsoluteSiteHref(href, config) {
|
|
66
|
+
const path = prefixHref(href, config.routePrefix);
|
|
67
|
+
if (isExternalHref(path)) return path;
|
|
68
|
+
const base = config.siteUrl;
|
|
69
|
+
if (!base) return void 0;
|
|
70
|
+
return new URL(path, base.endsWith("/") ? base : `${base}/`).href;
|
|
71
|
+
}
|
|
61
72
|
//#endregion
|
|
62
73
|
//#region source/shell/ContentActions.tsx
|
|
63
74
|
function resolveContentArtifactUrl(contentArtifactUrl, routePrefix = "/") {
|
|
64
75
|
return prefixHref(contentArtifactUrl, routePrefix);
|
|
65
76
|
}
|
|
66
|
-
function getAbsoluteUrl(path) {
|
|
67
|
-
if (typeof window === "undefined") return path;
|
|
68
|
-
return new URL(path, window.location.href).href;
|
|
69
|
-
}
|
|
70
77
|
function ContentActions(arg0) {
|
|
71
|
-
const { route
|
|
78
|
+
const { route } = arg0;
|
|
79
|
+
const config = require_i18n.useConfig();
|
|
80
|
+
const routePrefix = config.routePrefix;
|
|
81
|
+
const absoluteLinksEnabled = Boolean(config.siteUrl);
|
|
82
|
+
const mcpEnabled = absoluteLinksEnabled && config.features.search.enabled && config.features.search.mcp;
|
|
72
83
|
const t = require_i18n.useBuiltInText();
|
|
73
84
|
const [copied, setCopied] = (0, react.useState)("idle");
|
|
74
85
|
const [copyPhase, setCopyPhase] = (0, react.useState)("idle");
|
|
@@ -107,22 +118,25 @@ function ContentActions(arg0) {
|
|
|
107
118
|
const llmsArtifactUrl = resolveContentArtifactUrl("/llms.txt", routePrefix);
|
|
108
119
|
async function handleCopyLink() {
|
|
109
120
|
if (!contentArtifactUrl) return;
|
|
110
|
-
await runCopy("link", () =>
|
|
121
|
+
await runCopy("link", () => resolveAbsoluteSiteHref(contentArtifactUrl, config) ?? contentArtifactUrl);
|
|
111
122
|
}
|
|
112
123
|
async function handleCopyLlms() {
|
|
113
|
-
await runCopy("llms", () =>
|
|
124
|
+
await runCopy("llms", () => resolveAbsoluteSiteHref(llmsArtifactUrl, config) ?? llmsArtifactUrl);
|
|
114
125
|
}
|
|
115
126
|
async function handleCopyMcp() {
|
|
116
|
-
await runCopy("mcp", () =>
|
|
127
|
+
await runCopy("mcp", () => {
|
|
128
|
+
const siteUrl = resolveAbsoluteSiteHref("/", config);
|
|
129
|
+
if (!siteUrl) throw new Error("siteUrl is required for MCP configuration");
|
|
130
|
+
return JSON.stringify({ mcpServers: { clarify: {
|
|
131
|
+
command: "npx",
|
|
132
|
+
args: [
|
|
133
|
+
"@clarify-labs/cli",
|
|
134
|
+
"mcp",
|
|
135
|
+
siteUrl
|
|
136
|
+
]
|
|
137
|
+
} } }, null, 2);
|
|
138
|
+
});
|
|
117
139
|
}
|
|
118
|
-
const mcpConfig = JSON.stringify({ mcpServers: { clarify: {
|
|
119
|
-
command: "npx",
|
|
120
|
-
args: [
|
|
121
|
-
"@clarify-labs/cli",
|
|
122
|
-
"mcp",
|
|
123
|
-
window.location.origin
|
|
124
|
-
]
|
|
125
|
-
} } }, null, 2);
|
|
126
140
|
const actions = contentArtifactUrl ? [{
|
|
127
141
|
key: "content",
|
|
128
142
|
label: t("contentActions.copyContent"),
|
|
@@ -130,14 +144,14 @@ function ContentActions(arg0) {
|
|
|
130
144
|
icon: lucide_react.Copy,
|
|
131
145
|
run: handleCopyContent,
|
|
132
146
|
copiedLabel: t("contentActions.copiedContent")
|
|
133
|
-
}, {
|
|
147
|
+
}, ...absoluteLinksEnabled ? [{
|
|
134
148
|
key: "link",
|
|
135
149
|
label: t("contentActions.copyLink", replacements),
|
|
136
150
|
description: t("contentActions.copyLinkDescription", replacements),
|
|
137
151
|
icon: lucide_react.Link2,
|
|
138
152
|
run: handleCopyLink,
|
|
139
153
|
copiedLabel: t("contentActions.copiedLink")
|
|
140
|
-
}] : [];
|
|
154
|
+
}] : []] : [];
|
|
141
155
|
const llmsAction = {
|
|
142
156
|
key: "llms",
|
|
143
157
|
label: t("contentActions.copyLlms"),
|
|
@@ -300,7 +314,7 @@ function ContentActions(arg0) {
|
|
|
300
314
|
]
|
|
301
315
|
}) }, action.key);
|
|
302
316
|
}),
|
|
303
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
317
|
+
absoluteLinksEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
304
318
|
type: "button",
|
|
305
319
|
onClick: llmsAction.run,
|
|
306
320
|
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",
|
|
@@ -321,8 +335,8 @@ function ContentActions(arg0) {
|
|
|
321
335
|
}),
|
|
322
336
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === llmsAction.key ? "opacity-100" : "opacity-0"}` })
|
|
323
337
|
]
|
|
324
|
-
}) }, llmsAction.key),
|
|
325
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
338
|
+
}) }, llmsAction.key) : null,
|
|
339
|
+
mcpEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
326
340
|
type: "button",
|
|
327
341
|
onClick: mcpAction.run,
|
|
328
342
|
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",
|
|
@@ -343,7 +357,7 @@ function ContentActions(arg0) {
|
|
|
343
357
|
}),
|
|
344
358
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: `h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) transition ${copied === mcpAction.key ? "opacity-100" : "opacity-0"}` })
|
|
345
359
|
]
|
|
346
|
-
}) }, mcpAction.key)
|
|
360
|
+
}) }, mcpAction.key) : null
|
|
347
361
|
]
|
|
348
362
|
})
|
|
349
363
|
]
|
|
@@ -1083,7 +1097,7 @@ function MobileTabsSelect(arg0) {
|
|
|
1083
1097
|
});
|
|
1084
1098
|
}
|
|
1085
1099
|
function MobileNavigationDialog(arg0) {
|
|
1086
|
-
const {
|
|
1100
|
+
const { isOpen, navigation, tabs, routes, currentLocale, currentRoute, close } = arg0;
|
|
1087
1101
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.Dialog, {
|
|
1088
1102
|
transition: true,
|
|
1089
1103
|
open: isOpen,
|
|
@@ -1093,7 +1107,6 @@ function MobileNavigationDialog(arg0) {
|
|
|
1093
1107
|
transition: true,
|
|
1094
1108
|
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"
|
|
1095
1109
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.DialogPanel, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.TransitionChild, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {
|
|
1096
|
-
config,
|
|
1097
1110
|
navigation,
|
|
1098
1111
|
tabs,
|
|
1099
1112
|
routes,
|
|
@@ -1123,7 +1136,7 @@ var useMobileNavigationStore = (0, zustand.create)()((set) => ({
|
|
|
1123
1136
|
toggle: () => set((state) => ({ isOpen: !state.isOpen }))
|
|
1124
1137
|
}));
|
|
1125
1138
|
function MobileNavigation(arg0) {
|
|
1126
|
-
const {
|
|
1139
|
+
const { navigation, tabs, routes, currentLocale, currentRoute } = arg0;
|
|
1127
1140
|
const isInsideMobileNavigation = useIsInsideMobileNavigation();
|
|
1128
1141
|
const { isOpen, toggle, close } = useMobileNavigationStore();
|
|
1129
1142
|
const t = require_i18n.useBuiltInText();
|
|
@@ -1139,7 +1152,6 @@ function MobileNavigation(arg0) {
|
|
|
1139
1152
|
}), !isInsideMobileNavigation ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
1140
1153
|
fallback: null,
|
|
1141
1154
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileNavigationDialog, {
|
|
1142
|
-
config,
|
|
1143
1155
|
navigation,
|
|
1144
1156
|
tabs,
|
|
1145
1157
|
routes,
|
|
@@ -1171,43 +1183,44 @@ function useSearchProps() {
|
|
|
1171
1183
|
}
|
|
1172
1184
|
//#endregion
|
|
1173
1185
|
//#region source/shell/Search.tsx
|
|
1174
|
-
var SearchDialog = (0, react.lazy)(() => Promise.resolve().then(() => require("./SearchDialog-
|
|
1186
|
+
var SearchDialog = (0, react.lazy)(() => Promise.resolve().then(() => require("./SearchDialog-CExM6Bxd.cjs")));
|
|
1175
1187
|
function getModifierKey() {
|
|
1176
1188
|
if (typeof navigator === "undefined") return "Ctrl ";
|
|
1177
1189
|
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
|
|
1178
1190
|
}
|
|
1179
1191
|
function Search(arg0) {
|
|
1180
|
-
const { routes, navigation,
|
|
1192
|
+
const { routes, navigation, compact = false } = arg0;
|
|
1193
|
+
const config = require_i18n.useConfig();
|
|
1194
|
+
const currentLocale = require_i18n.useLocale() ?? config.locales?.default;
|
|
1181
1195
|
const t = require_i18n.useBuiltInText();
|
|
1182
1196
|
const modifierKey = getModifierKey();
|
|
1183
1197
|
const { buttonProps, dialogProps } = useSearchProps();
|
|
1198
|
+
if (!config.features.search.enabled) return null;
|
|
1184
1199
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1185
|
-
className: "clarify-search hidden w-80 max-w-(--clarify-search-max-width) lg:block",
|
|
1200
|
+
className: compact ? "clarify-search hidden lg:block" : "clarify-search hidden w-80 max-w-(--clarify-search-max-width) lg:block",
|
|
1186
1201
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1187
1202
|
type: "button",
|
|
1188
|
-
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",
|
|
1203
|
+
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",
|
|
1204
|
+
"aria-label": compact ? t("search.placeholder") : void 0,
|
|
1189
1205
|
...buttonProps,
|
|
1190
|
-
children: [
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
children: "K"
|
|
1201
|
-
})]
|
|
1202
|
-
})
|
|
1203
|
-
]
|
|
1206
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Search, { className: "h-5 w-5 stroke-current" }), !compact ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t("search.button"), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("kbd", {
|
|
1207
|
+
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",
|
|
1208
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
1209
|
+
className: "font-sans",
|
|
1210
|
+
children: modifierKey
|
|
1211
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
1212
|
+
className: "font-sans",
|
|
1213
|
+
children: "K"
|
|
1214
|
+
})]
|
|
1215
|
+
})] }) : null]
|
|
1204
1216
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
1205
1217
|
fallback: null,
|
|
1206
1218
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchDialog, {
|
|
1207
1219
|
className: "hidden lg:block",
|
|
1208
1220
|
routes,
|
|
1209
1221
|
navigation,
|
|
1210
|
-
routePrefix,
|
|
1222
|
+
routePrefix: config.routePrefix,
|
|
1223
|
+
assetPrefix: config.assetPrefix,
|
|
1211
1224
|
currentLocale,
|
|
1212
1225
|
...dialogProps
|
|
1213
1226
|
})
|
|
@@ -1215,9 +1228,12 @@ function Search(arg0) {
|
|
|
1215
1228
|
});
|
|
1216
1229
|
}
|
|
1217
1230
|
function MobileSearch(arg0) {
|
|
1218
|
-
const { routes, navigation,
|
|
1231
|
+
const { routes, navigation, onNavigate } = arg0;
|
|
1232
|
+
const config = require_i18n.useConfig();
|
|
1233
|
+
const currentLocale = require_i18n.useLocale() ?? config.locales?.default;
|
|
1219
1234
|
const t = require_i18n.useBuiltInText();
|
|
1220
1235
|
const { buttonProps, dialogProps } = useSearchProps();
|
|
1236
|
+
if (!config.features.search.enabled) return null;
|
|
1221
1237
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1222
1238
|
className: "clarify-mobile-search contents lg:hidden",
|
|
1223
1239
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1232,7 +1248,8 @@ function MobileSearch(arg0) {
|
|
|
1232
1248
|
className: "lg:hidden",
|
|
1233
1249
|
routes,
|
|
1234
1250
|
navigation,
|
|
1235
|
-
routePrefix,
|
|
1251
|
+
routePrefix: config.routePrefix,
|
|
1252
|
+
assetPrefix: config.assetPrefix,
|
|
1236
1253
|
currentLocale,
|
|
1237
1254
|
onNavigate,
|
|
1238
1255
|
...dialogProps
|
|
@@ -1341,9 +1358,30 @@ function TopLevelNavItem(arg0) {
|
|
|
1341
1358
|
children
|
|
1342
1359
|
}) });
|
|
1343
1360
|
}
|
|
1344
|
-
function
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1361
|
+
function NavbarTabs(arg0) {
|
|
1362
|
+
const { tabs, currentLocale } = arg0;
|
|
1363
|
+
const pathname = normalizeRoutePath((0, react_router_dom.useLocation)().pathname);
|
|
1364
|
+
const t = require_i18n.useBuiltInText();
|
|
1365
|
+
if (!tabs?.length) return null;
|
|
1366
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
1367
|
+
className: "clarify-tabs-navbar hidden md:block",
|
|
1368
|
+
"aria-label": t("navbar.sections"),
|
|
1369
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1370
|
+
role: "list",
|
|
1371
|
+
className: "flex items-center gap-0.5",
|
|
1372
|
+
children: tabs.map((tab) => {
|
|
1373
|
+
const active = isActiveTab(tab, pathname, currentLocale);
|
|
1374
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TopLevelNavItem, {
|
|
1375
|
+
href: tab.path,
|
|
1376
|
+
active,
|
|
1377
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationIcon, {
|
|
1378
|
+
name: tab.icon,
|
|
1379
|
+
className: "mr-1.5 h-4 w-4"
|
|
1380
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tab.title })]
|
|
1381
|
+
}, `${tab.title}-${tab.path}`);
|
|
1382
|
+
})
|
|
1383
|
+
})
|
|
1384
|
+
});
|
|
1347
1385
|
}
|
|
1348
1386
|
function MobileNavbarMenu(arg0) {
|
|
1349
1387
|
const { links, config, currentLocale } = arg0;
|
|
@@ -1505,7 +1543,8 @@ function ProductTabs(arg0) {
|
|
|
1505
1543
|
});
|
|
1506
1544
|
}
|
|
1507
1545
|
var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
1508
|
-
const {
|
|
1546
|
+
const { navigation, tabs, routes, currentLocale, currentRoute, banner, topAreaRef, className, ...props } = arg0;
|
|
1547
|
+
const config = require_i18n.useConfig();
|
|
1509
1548
|
const t = require_i18n.useBuiltInText();
|
|
1510
1549
|
const pathname = normalizeRoutePath((0, react_router_dom.useLocation)().pathname);
|
|
1511
1550
|
const { isOpen: mobileNavIsOpen } = useMobileNavigationStore();
|
|
@@ -1516,6 +1555,7 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1516
1555
|
const bgOpacityLight = (0, framer_motion.useTransform)(scrollY, [0, 72], ["70%", "95%"]);
|
|
1517
1556
|
const bgOpacityDark = (0, framer_motion.useTransform)(scrollY, [0, 72], ["60%", "92%"]);
|
|
1518
1557
|
const hasNavbarLinks = Boolean(config.navigation?.links?.length);
|
|
1558
|
+
const tabsInNavbar = config.layout?.tabs === "navbar";
|
|
1519
1559
|
function renderBrand() {
|
|
1520
1560
|
if (homeExternal) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.CloseButton, {
|
|
1521
1561
|
as: "a",
|
|
@@ -1567,13 +1607,16 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1567
1607
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1568
1608
|
className: "clarify-header-actions flex shrink-0 items-center gap-1",
|
|
1569
1609
|
children: [
|
|
1610
|
+
tabsInNavbar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Search, {
|
|
1611
|
+
compact: true,
|
|
1612
|
+
routes,
|
|
1613
|
+
navigation
|
|
1614
|
+
}) : null,
|
|
1570
1615
|
renderTopLinks(),
|
|
1571
1616
|
hasNavbarLinks ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mx-2 hidden h-5 w-px bg-(--clarify-theme-tokens-colors-border) md:block md:dark:bg-white/15" }) : null,
|
|
1572
1617
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileSearch, {
|
|
1573
1618
|
routes,
|
|
1574
|
-
navigation
|
|
1575
|
-
routePrefix: config.routePrefix,
|
|
1576
|
-
currentLocale
|
|
1619
|
+
navigation
|
|
1577
1620
|
}),
|
|
1578
1621
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageSwitcher, {
|
|
1579
1622
|
config,
|
|
@@ -1599,7 +1642,6 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1599
1642
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1600
1643
|
className: "clarify-mobile-brand flex items-center gap-5 lg:hidden",
|
|
1601
1644
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileNavigation, {
|
|
1602
|
-
config,
|
|
1603
1645
|
navigation,
|
|
1604
1646
|
tabs,
|
|
1605
1647
|
routes,
|
|
@@ -1610,11 +1652,12 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1610
1652
|
}),
|
|
1611
1653
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1612
1654
|
className: "clarify-header-center absolute left-1/2 hidden -translate-x-1/2 lg:block",
|
|
1613
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1614
|
-
|
|
1615
|
-
navigation,
|
|
1616
|
-
routePrefix: config.routePrefix,
|
|
1655
|
+
children: tabsInNavbar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarTabs, {
|
|
1656
|
+
tabs,
|
|
1617
1657
|
currentLocale
|
|
1658
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Search, {
|
|
1659
|
+
routes,
|
|
1660
|
+
navigation
|
|
1618
1661
|
})
|
|
1619
1662
|
}),
|
|
1620
1663
|
renderHeaderActions()
|
|
@@ -1630,10 +1673,10 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1630
1673
|
"data-clarify-header-banner": true,
|
|
1631
1674
|
children: banner
|
|
1632
1675
|
}),
|
|
1633
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProductTabs, {
|
|
1676
|
+
!tabsInNavbar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProductTabs, {
|
|
1634
1677
|
tabs,
|
|
1635
1678
|
currentLocale
|
|
1636
|
-
})
|
|
1679
|
+
}) : null
|
|
1637
1680
|
]
|
|
1638
1681
|
});
|
|
1639
1682
|
}
|
|
@@ -1653,21 +1696,15 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1653
1696
|
//#region source/app/PageActions.tsx
|
|
1654
1697
|
var PageActionsContext = (0, react.createContext)({});
|
|
1655
1698
|
function PageActionsProvider(props) {
|
|
1656
|
-
const { children, route
|
|
1699
|
+
const { children, route } = props;
|
|
1657
1700
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageActionsContext.Provider, {
|
|
1658
|
-
value: {
|
|
1659
|
-
route,
|
|
1660
|
-
routePrefix
|
|
1661
|
-
},
|
|
1701
|
+
value: { route },
|
|
1662
1702
|
children
|
|
1663
1703
|
});
|
|
1664
1704
|
}
|
|
1665
1705
|
function PageActions() {
|
|
1666
|
-
const { route
|
|
1667
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContentActions, {
|
|
1668
|
-
route,
|
|
1669
|
-
routePrefix
|
|
1670
|
-
});
|
|
1706
|
+
const { route } = (0, react.useContext)(PageActionsContext);
|
|
1707
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContentActions, { route });
|
|
1671
1708
|
}
|
|
1672
1709
|
//#endregion
|
|
1673
1710
|
Object.defineProperty(exports, "Header", {
|
|
@@ -1784,6 +1821,12 @@ Object.defineProperty(exports, "remToPx", {
|
|
|
1784
1821
|
return remToPx;
|
|
1785
1822
|
}
|
|
1786
1823
|
});
|
|
1824
|
+
Object.defineProperty(exports, "resolveHomeHref", {
|
|
1825
|
+
enumerable: true,
|
|
1826
|
+
get: function() {
|
|
1827
|
+
return resolveHomeHref;
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1787
1830
|
Object.defineProperty(exports, "resolveLocalizedText", {
|
|
1788
1831
|
enumerable: true,
|
|
1789
1832
|
get: function() {
|
|
@@ -1827,4 +1870,4 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
1827
1870
|
}
|
|
1828
1871
|
});
|
|
1829
1872
|
|
|
1830
|
-
//# sourceMappingURL=PageActions-
|
|
1873
|
+
//# sourceMappingURL=PageActions-DPYXFL6N.cjs.map
|