@clarify-labs/renderer 0.11.8 → 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.
Files changed (54) hide show
  1. package/output/{ClarifyShell-CGoRrkn1.js → ClarifyShell-DGm_R5Bp.js} +33 -13
  2. package/output/ClarifyShell-DGm_R5Bp.js.map +1 -0
  3. package/output/{ClarifyShell-D8OGIUWq.cjs → ClarifyShell-DLOGS18o.cjs} +33 -13
  4. package/output/ClarifyShell-DLOGS18o.cjs.map +1 -0
  5. package/output/{MermaidViewer-CFqy0BnO.cjs → MermaidViewer-BRR8SGnK.cjs} +2 -2
  6. package/output/{MermaidViewer-CFqy0BnO.cjs.map → MermaidViewer-BRR8SGnK.cjs.map} +1 -1
  7. package/output/{MermaidViewer-TdU3sRfy.js → MermaidViewer-CSbKX396.js} +2 -2
  8. package/output/{MermaidViewer-TdU3sRfy.js.map → MermaidViewer-CSbKX396.js.map} +1 -1
  9. package/output/{OpenApiOperation-Bd68uxXq.cjs → OpenApiOperation-416zAKci.cjs} +148 -16
  10. package/output/OpenApiOperation-416zAKci.cjs.map +1 -0
  11. package/output/{OpenApiOperation-vCuIKI4O.js → OpenApiOperation-bY3wbaJC.js} +138 -18
  12. package/output/OpenApiOperation-bY3wbaJC.js.map +1 -0
  13. package/output/{PageActions-DPYXFL6N.cjs → PageActions-CVOTIuxh.cjs} +205 -86
  14. package/output/PageActions-CVOTIuxh.cjs.map +1 -0
  15. package/output/{PageActions-CqXr0SyW.js → PageActions-D52u18C8.js} +201 -88
  16. package/output/PageActions-D52u18C8.js.map +1 -0
  17. package/output/{SearchDialog-CExM6Bxd.cjs → SearchDialog--OLp05za.cjs} +3 -3
  18. package/output/{SearchDialog-CExM6Bxd.cjs.map → SearchDialog--OLp05za.cjs.map} +1 -1
  19. package/output/{SearchDialog-BQcbGNvl.js → SearchDialog-Cq7w-uc7.js} +3 -3
  20. package/output/{SearchDialog-BQcbGNvl.js.map → SearchDialog-Cq7w-uc7.js.map} +1 -1
  21. package/output/app/AppShell.d.ts +2 -1
  22. package/output/app/PageActions.d.ts +6 -0
  23. package/output/app/PageUpdatedAt.d.ts +6 -0
  24. package/output/client.cjs +3 -3
  25. package/output/client.js +3 -3
  26. package/output/core/types.d.ts +21 -5
  27. package/output/{i18n-Dw4Jlho-.cjs → i18n-BMNCgF9o.cjs} +4 -2
  28. package/output/i18n-BMNCgF9o.cjs.map +1 -0
  29. package/output/{i18n-D4O3z-sP.js → i18n-Zmmhz7FF.js} +4 -2
  30. package/output/i18n-Zmmhz7FF.js.map +1 -0
  31. package/output/index.cjs +7 -5
  32. package/output/index.d.ts +2 -1
  33. package/output/index.js +6 -6
  34. package/output/mdx/components.d.ts +9 -0
  35. package/output/mdx/primitives.d.ts +11 -0
  36. package/output/openapi/lib/api-exchange.d.ts +2 -0
  37. package/output/preview.cjs +3 -3
  38. package/output/preview.js +3 -3
  39. package/output/{render-DQRifjrn.js → render-D_QvIv7Z.js} +2 -2
  40. package/output/{render-DQRifjrn.js.map → render-D_QvIv7Z.js.map} +1 -1
  41. package/output/{render-CqBz1q82.cjs → render-TErh9x_2.cjs} +2 -2
  42. package/output/{render-CqBz1q82.cjs.map → render-TErh9x_2.cjs.map} +1 -1
  43. package/output/renderer.css +86 -0
  44. package/output/server.cjs +2 -2
  45. package/output/server.js +2 -2
  46. package/package.json +1 -1
  47. package/output/ClarifyShell-CGoRrkn1.js.map +0 -1
  48. package/output/ClarifyShell-D8OGIUWq.cjs.map +0 -1
  49. package/output/OpenApiOperation-Bd68uxXq.cjs.map +0 -1
  50. package/output/OpenApiOperation-vCuIKI4O.js.map +0 -1
  51. package/output/PageActions-CqXr0SyW.js.map +0 -1
  52. package/output/PageActions-DPYXFL6N.cjs.map +0 -1
  53. package/output/i18n-D4O3z-sP.js.map +0 -1
  54. package/output/i18n-Dw4Jlho-.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
- import { a as useConfig, l as useLocale, t as useBuiltInText } from "./i18n-D4O3z-sP.js";
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 && !route?.sourceEditUrl) return null;
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__ */ jsxs("a", {
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-BQcbGNvl.js"));
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 { links, config, currentLocale } = arg0;
1470
+ const { menus, config, currentLocale } = arg0;
1386
1471
  const t = useBuiltInText();
1387
- if (!links?.length) return null;
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: links.map((link) => {
1400
- const label = resolveLocalizedText(link.label, currentLocale, config.locales?.default);
1401
- const href = localizeHref(link.href, config, currentLocale);
1402
- const external = isExternalHref(href);
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 hasNavbarLinks = Boolean(config.navigation?.links?.length);
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
- if (!hasNavbarLinks) return null;
1587
- return /* @__PURE__ */ jsx("nav", {
1588
- className: "clarify-top-nav hidden md:block",
1589
- "aria-label": t("navbar.sections"),
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() {
@@ -1610,8 +1668,12 @@ var Header = forwardRef(function Header(arg0, ref) {
1610
1668
  routes,
1611
1669
  navigation
1612
1670
  }) : null,
1671
+ tabsInNavbar ? /* @__PURE__ */ jsx(NavbarTabs, {
1672
+ tabs,
1673
+ currentLocale
1674
+ }) : null,
1613
1675
  renderTopLinks(),
1614
- 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,
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,
1615
1677
  /* @__PURE__ */ jsx(MobileSearch, {
1616
1678
  routes,
1617
1679
  navigation
@@ -1623,7 +1685,7 @@ var Header = forwardRef(function Header(arg0, ref) {
1623
1685
  }),
1624
1686
  /* @__PURE__ */ jsx(ThemeToggle, {}),
1625
1687
  /* @__PURE__ */ jsx(MobileNavbarMenu, {
1626
- links: config.navigation?.links,
1688
+ menus: config.navigation?.menus,
1627
1689
  config,
1628
1690
  currentLocale
1629
1691
  })
@@ -1648,16 +1710,13 @@ var Header = forwardRef(function Header(arg0, ref) {
1648
1710
  })
1649
1711
  }), renderBrand()]
1650
1712
  }),
1651
- /* @__PURE__ */ jsx("div", {
1652
- className: "clarify-header-center absolute left-1/2 hidden -translate-x-1/2 lg:block",
1653
- children: tabsInNavbar ? /* @__PURE__ */ jsx(NavbarTabs, {
1654
- tabs,
1655
- currentLocale
1656
- }) : /* @__PURE__ */ jsx(Search$1, {
1713
+ !tabsInNavbar ? /* @__PURE__ */ jsx("div", {
1714
+ className: "clarify-header-center hidden min-w-0 flex-1 justify-center lg:flex",
1715
+ children: /* @__PURE__ */ jsx(Search$1, {
1657
1716
  routes,
1658
1717
  navigation
1659
1718
  })
1660
- }),
1719
+ }) : null,
1661
1720
  renderHeaderActions()
1662
1721
  ]
1663
1722
  });
@@ -1691,12 +1750,39 @@ var Header = forwardRef(function Header(arg0, ref) {
1691
1750
  });
1692
1751
  });
1693
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
1694
1777
  //#region source/app/PageActions.tsx
1695
1778
  var PageActionsContext = createContext({});
1696
1779
  function PageActionsProvider(props) {
1697
- const { children, route } = props;
1780
+ const { children, route, locale } = props;
1698
1781
  return /* @__PURE__ */ jsx(PageActionsContext.Provider, {
1699
- value: { route },
1782
+ value: {
1783
+ route,
1784
+ locale
1785
+ },
1700
1786
  children
1701
1787
  });
1702
1788
  }
@@ -1704,7 +1790,34 @@ function PageActions() {
1704
1790
  const { route } = useContext(PageActionsContext);
1705
1791
  return /* @__PURE__ */ jsx(ContentActions, { route });
1706
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
+ }
1707
1820
  //#endregion
1708
- 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 };
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 };
1709
1822
 
1710
- //# sourceMappingURL=PageActions-CqXr0SyW.js.map
1823
+ //# sourceMappingURL=PageActions-D52u18C8.js.map