@clarify-labs/renderer 0.11.9 → 0.11.10
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-nV23Fn7m.js → ClarifyShell-DGm_R5Bp.js} +33 -13
- package/output/ClarifyShell-DGm_R5Bp.js.map +1 -0
- package/output/{ClarifyShell-GCXbb_AF.cjs → ClarifyShell-DLOGS18o.cjs} +33 -13
- package/output/ClarifyShell-DLOGS18o.cjs.map +1 -0
- package/output/{MermaidViewer-DEKNDG7K.cjs → MermaidViewer-BRR8SGnK.cjs} +2 -2
- package/output/{MermaidViewer-DEKNDG7K.cjs.map → MermaidViewer-BRR8SGnK.cjs.map} +1 -1
- package/output/{MermaidViewer-Ssxr00dy.js → MermaidViewer-CSbKX396.js} +2 -2
- package/output/{MermaidViewer-Ssxr00dy.js.map → MermaidViewer-CSbKX396.js.map} +1 -1
- package/output/{OpenApiOperation-DIgbzvk5.cjs → OpenApiOperation-416zAKci.cjs} +80 -12
- package/output/OpenApiOperation-416zAKci.cjs.map +1 -0
- package/output/{OpenApiOperation-B26v2y44.js → OpenApiOperation-bY3wbaJC.js} +70 -14
- package/output/OpenApiOperation-bY3wbaJC.js.map +1 -0
- package/output/{PageActions-DxGK-444.cjs → PageActions-CVOTIuxh.cjs} +198 -80
- package/output/PageActions-CVOTIuxh.cjs.map +1 -0
- package/output/{PageActions-BbmyFeSk.js → PageActions-D52u18C8.js} +194 -82
- package/output/PageActions-D52u18C8.js.map +1 -0
- package/output/{SearchDialog-DexOW8E4.cjs → SearchDialog--OLp05za.cjs} +3 -3
- package/output/{SearchDialog-DexOW8E4.cjs.map → SearchDialog--OLp05za.cjs.map} +1 -1
- package/output/{SearchDialog-4oEbmVMR.js → SearchDialog-Cq7w-uc7.js} +3 -3
- package/output/{SearchDialog-4oEbmVMR.js.map → SearchDialog-Cq7w-uc7.js.map} +1 -1
- package/output/app/AppShell.d.ts +2 -1
- package/output/app/PageActions.d.ts +6 -0
- package/output/app/PageUpdatedAt.d.ts +6 -0
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/core/types.d.ts +21 -5
- package/output/{i18n-BuvwT5W9.cjs → i18n-BMNCgF9o.cjs} +2 -2
- package/output/{i18n-BuvwT5W9.cjs.map → i18n-BMNCgF9o.cjs.map} +1 -1
- package/output/{i18n-C6tIP-nl.js → i18n-Zmmhz7FF.js} +2 -2
- package/output/{i18n-C6tIP-nl.js.map → i18n-Zmmhz7FF.js.map} +1 -1
- package/output/index.cjs +7 -5
- package/output/index.d.ts +2 -1
- package/output/index.js +6 -6
- package/output/mdx/components.d.ts +9 -0
- package/output/mdx/primitives.d.ts +11 -0
- package/output/preview.cjs +3 -3
- package/output/preview.js +3 -3
- package/output/{render-CAtVGsQF.js → render-D_QvIv7Z.js} +2 -2
- package/output/{render-CAtVGsQF.js.map → render-D_QvIv7Z.js.map} +1 -1
- package/output/{render-D8h-jcnw.cjs → render-TErh9x_2.cjs} +2 -2
- package/output/{render-D8h-jcnw.cjs.map → render-TErh9x_2.cjs.map} +1 -1
- package/output/renderer.css +86 -0
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/ClarifyShell-GCXbb_AF.cjs.map +0 -1
- package/output/ClarifyShell-nV23Fn7m.js.map +0 -1
- package/output/OpenApiOperation-B26v2y44.js.map +0 -1
- package/output/OpenApiOperation-DIgbzvk5.cjs.map +0 -1
- package/output/PageActions-BbmyFeSk.js.map +0 -1
- package/output/PageActions-DxGK-444.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as useConfig, l as useLocale, t as useBuiltInText } from "./i18n-
|
|
1
|
+
import { a as useConfig, l as useLocale, t as useBuiltInText } from "./i18n-Zmmhz7FF.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
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { CloseButton, Dialog, DialogBackdrop, DialogPanel, Menu, MenuButton, MenuItem, MenuItems, TransitionChild } from "@headlessui/react";
|
|
7
7
|
import * as LucideIcons from "lucide-react";
|
|
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 { CalendarClock, 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";
|
|
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
|
|
@@ -89,7 +89,7 @@ function ContentActions(arg0) {
|
|
|
89
89
|
}, 1600);
|
|
90
90
|
return () => clearTimeout(timeout);
|
|
91
91
|
}, [copyPhase]);
|
|
92
|
-
if (!route?.contentArtifactUrl
|
|
92
|
+
if (!route?.contentArtifactUrl) return null;
|
|
93
93
|
const contentArtifactUrl = route.contentArtifactUrl ? resolveContentArtifactUrl(route.contentArtifactUrl, routePrefix) : void 0;
|
|
94
94
|
const isOpenApi = route.kind === "openapi";
|
|
95
95
|
const replacements = { contentType: isOpenApi ? "OpenAPI" : "Markdown" };
|
|
@@ -189,16 +189,7 @@ function ContentActions(arg0) {
|
|
|
189
189
|
className: "truncate",
|
|
190
190
|
children: primaryPhase === "idle" ? primaryAction.label : feedbackLabel
|
|
191
191
|
})]
|
|
192
|
-
}) : /* @__PURE__ */
|
|
193
|
-
href: route.sourceEditUrl,
|
|
194
|
-
target: "_blank",
|
|
195
|
-
rel: "noreferrer",
|
|
196
|
-
className: "clarify-content-actions-primary clarify-ui-control inline-flex h-9 min-w-0 items-center gap-2 rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) px-3 no-underline shadow-xs shadow-zinc-900/5 transition",
|
|
197
|
-
children: [/* @__PURE__ */ jsx(PrimaryIcon, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ jsx("span", {
|
|
198
|
-
className: "truncate",
|
|
199
|
-
children: t("contentActions.editPage")
|
|
200
|
-
})]
|
|
201
|
-
}), /* @__PURE__ */ jsx(MenuButton, {
|
|
192
|
+
}) : null, /* @__PURE__ */ jsx(MenuButton, {
|
|
202
193
|
className: "clarify-content-actions-trigger clarify-ui-control inline-flex size-9 items-center justify-center rounded-md border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) shadow-xs shadow-zinc-900/5 transition",
|
|
203
194
|
"aria-label": t("contentActions.copyOptions"),
|
|
204
195
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5" })
|
|
@@ -214,29 +205,6 @@ function ContentActions(arg0) {
|
|
|
214
205
|
anchor: "bottom end",
|
|
215
206
|
className: "clarify-content-actions-list clarify-ui-menu z-30 mt-2 w-(--clarify-ui-action-menu-width) origin-top-right rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1.5 shadow-xl shadow-zinc-900/5 transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0",
|
|
216
207
|
children: [
|
|
217
|
-
route.sourceEditUrl ? /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("a", {
|
|
218
|
-
href: route.sourceEditUrl,
|
|
219
|
-
target: "_blank",
|
|
220
|
-
rel: "noreferrer",
|
|
221
|
-
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 no-underline transition",
|
|
222
|
-
children: [
|
|
223
|
-
/* @__PURE__ */ jsx("span", {
|
|
224
|
-
className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
|
|
225
|
-
children: /* @__PURE__ */ jsx(PencilLine, { className: "h-4 w-4" })
|
|
226
|
-
}),
|
|
227
|
-
/* @__PURE__ */ jsxs("span", {
|
|
228
|
-
className: "flex min-w-0 flex-1 flex-col px-1",
|
|
229
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
230
|
-
className: "clarify-ui-menu-title flex items-center gap-1",
|
|
231
|
-
children: [t("contentActions.editPage"), /* @__PURE__ */ jsx(ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
|
|
232
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
233
|
-
className: "clarify-ui-menu-description truncate",
|
|
234
|
-
children: t("contentActions.editPageDescription")
|
|
235
|
-
})]
|
|
236
|
-
}),
|
|
237
|
-
/* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
|
|
238
|
-
]
|
|
239
|
-
}) }) : null,
|
|
240
208
|
actions.slice(0, 1).map((action) => {
|
|
241
209
|
const Icon = action.icon;
|
|
242
210
|
const isCopied = copied === action.key;
|
|
@@ -1181,7 +1149,7 @@ function useSearchProps() {
|
|
|
1181
1149
|
}
|
|
1182
1150
|
//#endregion
|
|
1183
1151
|
//#region source/shell/Search.tsx
|
|
1184
|
-
var SearchDialog = lazy(() => import("./SearchDialog-
|
|
1152
|
+
var SearchDialog = lazy(() => import("./SearchDialog-Cq7w-uc7.js"));
|
|
1185
1153
|
function getModifierKey() {
|
|
1186
1154
|
if (typeof navigator === "undefined") return "Ctrl ";
|
|
1187
1155
|
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
|
|
@@ -1381,10 +1349,127 @@ function NavbarTabs(arg0) {
|
|
|
1381
1349
|
})
|
|
1382
1350
|
});
|
|
1383
1351
|
}
|
|
1352
|
+
function navbarMenuHref(item, config, currentLocale) {
|
|
1353
|
+
if ("page" in item) return localizeHref(item.page, config, currentLocale);
|
|
1354
|
+
if ("href" in item) return localizeHref(item.href, config, currentLocale);
|
|
1355
|
+
}
|
|
1356
|
+
function NavbarMenuItemLink(arg0) {
|
|
1357
|
+
const { item, config, currentLocale, nested = false } = arg0;
|
|
1358
|
+
const href = navbarMenuHref(item, config, currentLocale);
|
|
1359
|
+
if (!href) return null;
|
|
1360
|
+
const label = resolveLocalizedText(item.label, currentLocale, config.locales?.default);
|
|
1361
|
+
const description = item.description ? resolveLocalizedText(item.description, currentLocale, config.locales?.default) : void 0;
|
|
1362
|
+
const linkClassName = clsx("clarify-ui-menu-item block rounded-(--clarify-theme-tokens-radius-lg) px-3 py-2 no-underline transition", nested ? "text-sm" : "min-w-40", arg0.className);
|
|
1363
|
+
if (isExternalHref(href)) return /* @__PURE__ */ jsxs(CloseButton, {
|
|
1364
|
+
as: "a",
|
|
1365
|
+
href,
|
|
1366
|
+
target: "_blank",
|
|
1367
|
+
rel: "noreferrer",
|
|
1368
|
+
className: linkClassName,
|
|
1369
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
1370
|
+
className: "flex items-center gap-2",
|
|
1371
|
+
children: [/* @__PURE__ */ jsx(NavigationIcon, {
|
|
1372
|
+
name: item.icon,
|
|
1373
|
+
className: "h-4 w-4"
|
|
1374
|
+
}), label]
|
|
1375
|
+
}), description ? /* @__PURE__ */ jsx("span", {
|
|
1376
|
+
className: "block pl-6 text-xs opacity-70",
|
|
1377
|
+
children: description
|
|
1378
|
+
}) : null]
|
|
1379
|
+
});
|
|
1380
|
+
return /* @__PURE__ */ jsxs(CloseButton, {
|
|
1381
|
+
as: Link,
|
|
1382
|
+
to: href,
|
|
1383
|
+
className: linkClassName,
|
|
1384
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
1385
|
+
className: "flex items-center gap-2",
|
|
1386
|
+
children: [/* @__PURE__ */ jsx(NavigationIcon, {
|
|
1387
|
+
name: item.icon,
|
|
1388
|
+
className: "h-4 w-4"
|
|
1389
|
+
}), label]
|
|
1390
|
+
}), description ? /* @__PURE__ */ jsx("span", {
|
|
1391
|
+
className: "block pl-6 text-xs opacity-70",
|
|
1392
|
+
children: description
|
|
1393
|
+
}) : null]
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
function NavbarMenuItems(arg0) {
|
|
1397
|
+
const { items, config, currentLocale } = arg0;
|
|
1398
|
+
return items.map((item, index) => {
|
|
1399
|
+
if ("items" in item) return /* @__PURE__ */ jsxs("div", {
|
|
1400
|
+
className: "pl-2",
|
|
1401
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1402
|
+
className: "flex items-center gap-2 px-3 py-2 text-xs font-semibold opacity-60",
|
|
1403
|
+
children: [/* @__PURE__ */ jsx(NavigationIcon, {
|
|
1404
|
+
name: item.icon,
|
|
1405
|
+
className: "h-3.5 w-3.5"
|
|
1406
|
+
}), resolveLocalizedText(item.label, currentLocale, config.locales?.default)]
|
|
1407
|
+
}), /* @__PURE__ */ jsx("div", { children: NavbarMenuItems({
|
|
1408
|
+
items: item.items,
|
|
1409
|
+
config,
|
|
1410
|
+
currentLocale
|
|
1411
|
+
}) })]
|
|
1412
|
+
}, `${resolveLocalizedText(item.label, currentLocale, config.locales?.default)}-${index}`);
|
|
1413
|
+
return /* @__PURE__ */ jsx(MenuItem, { children: ({ focus }) => /* @__PURE__ */ jsx(NavbarMenuItemLink, {
|
|
1414
|
+
item,
|
|
1415
|
+
config,
|
|
1416
|
+
currentLocale,
|
|
1417
|
+
className: focus ? "clarify-ui-menu-item-focus" : void 0
|
|
1418
|
+
}) }, "page" in item ? item.page : item.href);
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
function NavbarMenus(arg0) {
|
|
1422
|
+
const { menus, config, currentLocale } = arg0;
|
|
1423
|
+
const pathname = normalizeRoutePath(useLocation().pathname);
|
|
1424
|
+
if (!menus?.length) return null;
|
|
1425
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
1426
|
+
className: "clarify-top-nav hidden md:block",
|
|
1427
|
+
"aria-label": "Navigation",
|
|
1428
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
1429
|
+
role: "list",
|
|
1430
|
+
className: "flex items-center gap-0.5",
|
|
1431
|
+
children: menus.map((menu, index) => {
|
|
1432
|
+
const label = resolveLocalizedText(menu.label, currentLocale, config.locales?.default);
|
|
1433
|
+
if (!("items" in menu)) {
|
|
1434
|
+
const href = navbarMenuHref(menu, config, currentLocale);
|
|
1435
|
+
if (!href) return null;
|
|
1436
|
+
return /* @__PURE__ */ jsx(TopLevelNavItem, {
|
|
1437
|
+
href,
|
|
1438
|
+
active: !isExternalHref(href) && isSameRoutePath(href, pathname, currentLocale),
|
|
1439
|
+
children: label
|
|
1440
|
+
}, `${label}-${index}`);
|
|
1441
|
+
}
|
|
1442
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Menu, {
|
|
1443
|
+
as: "div",
|
|
1444
|
+
className: "relative",
|
|
1445
|
+
children: [/* @__PURE__ */ jsxs(MenuButton, {
|
|
1446
|
+
className: "clarify-ui-top-link inline-flex h-9 items-center rounded-(--clarify-theme-tokens-radius-md) px-3 no-underline transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--clarify-theme-tokens-colors-primary)",
|
|
1447
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
1448
|
+
className: "flex items-center gap-2",
|
|
1449
|
+
children: [/* @__PURE__ */ jsx(NavigationIcon, {
|
|
1450
|
+
name: menu.icon,
|
|
1451
|
+
className: "h-4 w-4"
|
|
1452
|
+
}), label]
|
|
1453
|
+
}), /* @__PURE__ */ jsx(ChevronRight, { className: "ml-1 h-3.5 w-3.5 rotate-90" })]
|
|
1454
|
+
}), /* @__PURE__ */ jsx(MenuItems, {
|
|
1455
|
+
anchor: "bottom start",
|
|
1456
|
+
transition: true,
|
|
1457
|
+
className: "clarify-ui-menu z-50 mt-2 min-w-48 rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1 shadow-lg transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0 dark:border-white/10 dark:bg-zinc-900",
|
|
1458
|
+
children: /* @__PURE__ */ jsx(NavbarMenuItems, {
|
|
1459
|
+
items: menu.items,
|
|
1460
|
+
config,
|
|
1461
|
+
currentLocale
|
|
1462
|
+
})
|
|
1463
|
+
})]
|
|
1464
|
+
}) }, `${label}-${index}`);
|
|
1465
|
+
})
|
|
1466
|
+
})
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1384
1469
|
function MobileNavbarMenu(arg0) {
|
|
1385
|
-
const {
|
|
1470
|
+
const { menus, config, currentLocale } = arg0;
|
|
1386
1471
|
const t = useBuiltInText();
|
|
1387
|
-
if (!
|
|
1472
|
+
if (!menus?.length) return null;
|
|
1388
1473
|
return /* @__PURE__ */ jsxs(Menu, {
|
|
1389
1474
|
as: "div",
|
|
1390
1475
|
className: "clarify-mobile-navbar-menu relative md:hidden",
|
|
@@ -1396,24 +1481,10 @@ function MobileNavbarMenu(arg0) {
|
|
|
1396
1481
|
transition: true,
|
|
1397
1482
|
anchor: "bottom end",
|
|
1398
1483
|
className: "clarify-mobile-navbar-menu-list clarify-ui-menu z-50 mt-2 w-(--clarify-ui-menu-width) rounded-(--clarify-theme-tokens-radius-xl) border border-(--clarify-theme-tokens-colors-border) bg-(--clarify-theme-tokens-colors-surface) p-1 shadow-lg transition [--anchor-gap:--spacing(2)] focus:outline-none data-closed:scale-95 data-closed:opacity-0 dark:border-white/10 dark:bg-zinc-900",
|
|
1399
|
-
children:
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
return /* @__PURE__ */ jsx(MenuItem, { children: ({ focus }) => {
|
|
1404
|
-
const className = clsx("clarify-mobile-navbar-menu-item clarify-ui-menu-item block rounded-(--clarify-theme-tokens-radius-lg) px-3 py-2 no-underline transition", focus && "clarify-ui-menu-item-focus");
|
|
1405
|
-
return external ? /* @__PURE__ */ jsx("a", {
|
|
1406
|
-
href,
|
|
1407
|
-
target: "_blank",
|
|
1408
|
-
rel: "noreferrer",
|
|
1409
|
-
className,
|
|
1410
|
-
children: label
|
|
1411
|
-
}) : /* @__PURE__ */ jsx(Link, {
|
|
1412
|
-
to: href,
|
|
1413
|
-
className,
|
|
1414
|
-
children: label
|
|
1415
|
-
});
|
|
1416
|
-
} }, link.href);
|
|
1484
|
+
children: /* @__PURE__ */ jsx(NavbarMenuItems, {
|
|
1485
|
+
items: menus,
|
|
1486
|
+
config,
|
|
1487
|
+
currentLocale
|
|
1417
1488
|
})
|
|
1418
1489
|
})]
|
|
1419
1490
|
});
|
|
@@ -1544,7 +1615,6 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1544
1615
|
const { navigation, tabs, routes, currentLocale, currentRoute, banner, topAreaRef, className, ...props } = arg0;
|
|
1545
1616
|
const config = useConfig();
|
|
1546
1617
|
const t = useBuiltInText();
|
|
1547
|
-
const pathname = normalizeRoutePath(useLocation().pathname);
|
|
1548
1618
|
const { isOpen: mobileNavIsOpen } = useMobileNavigationStore();
|
|
1549
1619
|
const isInsideMobileNavigation = useIsInsideMobileNavigation();
|
|
1550
1620
|
const homeHref = resolveHomeHref(config, currentLocale);
|
|
@@ -1552,7 +1622,7 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1552
1622
|
const { scrollY } = useScroll();
|
|
1553
1623
|
const bgOpacityLight = useTransform(scrollY, [0, 72], ["70%", "95%"]);
|
|
1554
1624
|
const bgOpacityDark = useTransform(scrollY, [0, 72], ["60%", "92%"]);
|
|
1555
|
-
const
|
|
1625
|
+
const hasNavbarMenus = Boolean(config.navigation?.menus?.length);
|
|
1556
1626
|
const tabsInNavbar = config.layout?.tabs === "navbar";
|
|
1557
1627
|
function renderBrand() {
|
|
1558
1628
|
if (homeExternal) return /* @__PURE__ */ jsxs(CloseButton, {
|
|
@@ -1583,22 +1653,10 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1583
1653
|
});
|
|
1584
1654
|
}
|
|
1585
1655
|
function renderTopLinks() {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
children: /* @__PURE__ */ jsx("ul", {
|
|
1591
|
-
role: "list",
|
|
1592
|
-
className: "flex items-center gap-0.5",
|
|
1593
|
-
children: config.navigation?.links?.map((link) => {
|
|
1594
|
-
const href = localizeHref(link.href, config, currentLocale);
|
|
1595
|
-
return /* @__PURE__ */ jsx(TopLevelNavItem, {
|
|
1596
|
-
href,
|
|
1597
|
-
active: !isExternalHref(href) && isSameRoutePath(href, pathname, currentLocale),
|
|
1598
|
-
children: resolveLocalizedText(link.label, currentLocale, config.locales?.default)
|
|
1599
|
-
}, link.href);
|
|
1600
|
-
})
|
|
1601
|
-
})
|
|
1656
|
+
return /* @__PURE__ */ jsx(NavbarMenus, {
|
|
1657
|
+
menus: config.navigation?.menus,
|
|
1658
|
+
config,
|
|
1659
|
+
currentLocale
|
|
1602
1660
|
});
|
|
1603
1661
|
}
|
|
1604
1662
|
function renderHeaderActions() {
|
|
@@ -1615,7 +1673,7 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1615
1673
|
currentLocale
|
|
1616
1674
|
}) : null,
|
|
1617
1675
|
renderTopLinks(),
|
|
1618
|
-
|
|
1676
|
+
hasNavbarMenus ? /* @__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,
|
|
1619
1677
|
/* @__PURE__ */ jsx(MobileSearch, {
|
|
1620
1678
|
routes,
|
|
1621
1679
|
navigation
|
|
@@ -1627,7 +1685,7 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1627
1685
|
}),
|
|
1628
1686
|
/* @__PURE__ */ jsx(ThemeToggle, {}),
|
|
1629
1687
|
/* @__PURE__ */ jsx(MobileNavbarMenu, {
|
|
1630
|
-
|
|
1688
|
+
menus: config.navigation?.menus,
|
|
1631
1689
|
config,
|
|
1632
1690
|
currentLocale
|
|
1633
1691
|
})
|
|
@@ -1653,7 +1711,7 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1653
1711
|
}), renderBrand()]
|
|
1654
1712
|
}),
|
|
1655
1713
|
!tabsInNavbar ? /* @__PURE__ */ jsx("div", {
|
|
1656
|
-
className: "clarify-header-center
|
|
1714
|
+
className: "clarify-header-center hidden min-w-0 flex-1 justify-center lg:flex",
|
|
1657
1715
|
children: /* @__PURE__ */ jsx(Search$1, {
|
|
1658
1716
|
routes,
|
|
1659
1717
|
navigation
|
|
@@ -1692,12 +1750,39 @@ var Header = forwardRef(function Header(arg0, ref) {
|
|
|
1692
1750
|
});
|
|
1693
1751
|
});
|
|
1694
1752
|
//#endregion
|
|
1753
|
+
//#region source/app/PageUpdatedAt.tsx
|
|
1754
|
+
function PageUpdatedAt(props) {
|
|
1755
|
+
const { updatedAt, locale } = props;
|
|
1756
|
+
if (!updatedAt) return null;
|
|
1757
|
+
const date = new Date(updatedAt);
|
|
1758
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
1759
|
+
const label = locale?.toLowerCase().startsWith("zh") ? "最后更新" : "Last updated";
|
|
1760
|
+
const formattedDate = new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date);
|
|
1761
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
1762
|
+
className: "clarify-page-updated-at m-0 flex items-center gap-1.5 text-xs text-(--clarify-ui-text-faint)",
|
|
1763
|
+
children: [
|
|
1764
|
+
/* @__PURE__ */ jsx(CalendarClock, {
|
|
1765
|
+
className: "size-3.5",
|
|
1766
|
+
"aria-hidden": "true"
|
|
1767
|
+
}),
|
|
1768
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
1769
|
+
/* @__PURE__ */ jsx("time", {
|
|
1770
|
+
dateTime: updatedAt,
|
|
1771
|
+
children: formattedDate
|
|
1772
|
+
})
|
|
1773
|
+
]
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
//#endregion
|
|
1695
1777
|
//#region source/app/PageActions.tsx
|
|
1696
1778
|
var PageActionsContext = createContext({});
|
|
1697
1779
|
function PageActionsProvider(props) {
|
|
1698
|
-
const { children, route } = props;
|
|
1780
|
+
const { children, route, locale } = props;
|
|
1699
1781
|
return /* @__PURE__ */ jsx(PageActionsContext.Provider, {
|
|
1700
|
-
value: {
|
|
1782
|
+
value: {
|
|
1783
|
+
route,
|
|
1784
|
+
locale
|
|
1785
|
+
},
|
|
1701
1786
|
children
|
|
1702
1787
|
});
|
|
1703
1788
|
}
|
|
@@ -1705,7 +1790,34 @@ function PageActions() {
|
|
|
1705
1790
|
const { route } = useContext(PageActionsContext);
|
|
1706
1791
|
return /* @__PURE__ */ jsx(ContentActions, { route });
|
|
1707
1792
|
}
|
|
1793
|
+
function PageMetadata(props) {
|
|
1794
|
+
const { route, locale: contextLocale } = useContext(PageActionsContext);
|
|
1795
|
+
const { updatedAt = route?.updatedAt, locale = contextLocale } = props;
|
|
1796
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1797
|
+
className: "clarify-page-metadata flex w-full items-center justify-end gap-3",
|
|
1798
|
+
children: [/* @__PURE__ */ jsx(PageUpdatedAt, {
|
|
1799
|
+
updatedAt,
|
|
1800
|
+
locale
|
|
1801
|
+
}), route?.sourceEditUrl ? /* @__PURE__ */ jsxs("a", {
|
|
1802
|
+
href: route.sourceEditUrl,
|
|
1803
|
+
target: "_blank",
|
|
1804
|
+
rel: "noreferrer",
|
|
1805
|
+
className: "clarify-page-edit-link inline-flex items-center gap-1.5 text-xs text-(--clarify-ui-text-faint) no-underline transition hover:text-(--clarify-ui-text)",
|
|
1806
|
+
children: [
|
|
1807
|
+
/* @__PURE__ */ jsx(PencilLine, {
|
|
1808
|
+
className: "size-3.5",
|
|
1809
|
+
"aria-hidden": "true"
|
|
1810
|
+
}),
|
|
1811
|
+
/* @__PURE__ */ jsx("span", { children: locale?.toLowerCase().startsWith("zh") ? "编辑此页面" : "Edit this page" }),
|
|
1812
|
+
/* @__PURE__ */ jsx(ExternalLink, {
|
|
1813
|
+
className: "size-3",
|
|
1814
|
+
"aria-hidden": "true"
|
|
1815
|
+
})
|
|
1816
|
+
]
|
|
1817
|
+
}) : null]
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1708
1820
|
//#endregion
|
|
1709
|
-
export {
|
|
1821
|
+
export { themeCookieName as C, resolveHomeHref as D, prefixHref as E, copyTextToClipboard as O, storeThemePreference as S, localizeHref as T, getStoredLocalePreference as _, Navigation as a, readLocaleCookie as b, remToPx as c, isSameRoutePath as d, normalizeRoutePath as f, useTheme as g, ThemeProvider as h, Header as i, lucideIconRegistry as l, ThemeToggle as m, PageActionsProvider as n, SectionProvider as o, resolveLocalizedText as p, PageMetadata as r, useSectionStore as s, PageActions as t, resolveLucideIconName as u, getStoredThemePreference as v, isExternalHref as w, storeLocalePreference as x, localeCookieName as y };
|
|
1710
1822
|
|
|
1711
|
-
//# sourceMappingURL=PageActions-
|
|
1823
|
+
//# sourceMappingURL=PageActions-D52u18C8.js.map
|