@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,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
|
-
const require_i18n = require("./i18n-
|
|
2
|
+
const require_i18n = require("./i18n-BMNCgF9o.cjs");
|
|
3
3
|
let clsx = require("clsx");
|
|
4
4
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
5
5
|
let react = require("react");
|
|
@@ -91,7 +91,7 @@ function ContentActions(arg0) {
|
|
|
91
91
|
}, 1600);
|
|
92
92
|
return () => clearTimeout(timeout);
|
|
93
93
|
}, [copyPhase]);
|
|
94
|
-
if (!route?.contentArtifactUrl
|
|
94
|
+
if (!route?.contentArtifactUrl) return null;
|
|
95
95
|
const contentArtifactUrl = route.contentArtifactUrl ? resolveContentArtifactUrl(route.contentArtifactUrl, routePrefix) : void 0;
|
|
96
96
|
const isOpenApi = route.kind === "openapi";
|
|
97
97
|
const replacements = { contentType: isOpenApi ? "OpenAPI" : "Markdown" };
|
|
@@ -191,16 +191,7 @@ function ContentActions(arg0) {
|
|
|
191
191
|
className: "truncate",
|
|
192
192
|
children: primaryPhase === "idle" ? primaryAction.label : feedbackLabel
|
|
193
193
|
})]
|
|
194
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.
|
|
195
|
-
href: route.sourceEditUrl,
|
|
196
|
-
target: "_blank",
|
|
197
|
-
rel: "noreferrer",
|
|
198
|
-
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",
|
|
199
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PrimaryIcon, { className: "h-4 w-4 shrink-0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
200
|
-
className: "truncate",
|
|
201
|
-
children: t("contentActions.editPage")
|
|
202
|
-
})]
|
|
203
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuButton, {
|
|
194
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuButton, {
|
|
204
195
|
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",
|
|
205
196
|
"aria-label": t("contentActions.copyOptions"),
|
|
206
197
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "h-3.5 w-3.5" })
|
|
@@ -216,29 +207,6 @@ function ContentActions(arg0) {
|
|
|
216
207
|
anchor: "bottom end",
|
|
217
208
|
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",
|
|
218
209
|
children: [
|
|
219
|
-
route.sourceEditUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
220
|
-
href: route.sourceEditUrl,
|
|
221
|
-
target: "_blank",
|
|
222
|
-
rel: "noreferrer",
|
|
223
|
-
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",
|
|
224
|
-
children: [
|
|
225
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
226
|
-
className: "clarify-ui-menu-icon flex shrink-0 rounded-(--clarify-theme-tokens-radius-md) border border-(--clarify-theme-tokens-colors-border) p-1.5",
|
|
227
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.PencilLine, { className: "h-4 w-4" })
|
|
228
|
-
}),
|
|
229
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
230
|
-
className: "flex min-w-0 flex-1 flex-col px-1",
|
|
231
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
232
|
-
className: "clarify-ui-menu-title flex items-center gap-1",
|
|
233
|
-
children: [t("contentActions.editPage"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, { className: "clarify-ui-menu-icon h-3 w-3" })]
|
|
234
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
235
|
-
className: "clarify-ui-menu-description truncate",
|
|
236
|
-
children: t("contentActions.editPageDescription")
|
|
237
|
-
})]
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-3.5 w-3.5 shrink-0 text-(--clarify-theme-tokens-colors-primary) opacity-0" })
|
|
240
|
-
]
|
|
241
|
-
}) }) : null,
|
|
242
210
|
actions.slice(0, 1).map((action) => {
|
|
243
211
|
const Icon = action.icon;
|
|
244
212
|
const isCopied = copied === action.key;
|
|
@@ -1183,7 +1151,7 @@ function useSearchProps() {
|
|
|
1183
1151
|
}
|
|
1184
1152
|
//#endregion
|
|
1185
1153
|
//#region source/shell/Search.tsx
|
|
1186
|
-
var SearchDialog = (0, react.lazy)(() => Promise.resolve().then(() => require("./SearchDialog
|
|
1154
|
+
var SearchDialog = (0, react.lazy)(() => Promise.resolve().then(() => require("./SearchDialog--OLp05za.cjs")));
|
|
1187
1155
|
function getModifierKey() {
|
|
1188
1156
|
if (typeof navigator === "undefined") return "Ctrl ";
|
|
1189
1157
|
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl ";
|
|
@@ -1383,10 +1351,127 @@ function NavbarTabs(arg0) {
|
|
|
1383
1351
|
})
|
|
1384
1352
|
});
|
|
1385
1353
|
}
|
|
1354
|
+
function navbarMenuHref(item, config, currentLocale) {
|
|
1355
|
+
if ("page" in item) return localizeHref(item.page, config, currentLocale);
|
|
1356
|
+
if ("href" in item) return localizeHref(item.href, config, currentLocale);
|
|
1357
|
+
}
|
|
1358
|
+
function NavbarMenuItemLink(arg0) {
|
|
1359
|
+
const { item, config, currentLocale, nested = false } = arg0;
|
|
1360
|
+
const href = navbarMenuHref(item, config, currentLocale);
|
|
1361
|
+
if (!href) return null;
|
|
1362
|
+
const label = resolveLocalizedText(item.label, currentLocale, config.locales?.default);
|
|
1363
|
+
const description = item.description ? resolveLocalizedText(item.description, currentLocale, config.locales?.default) : void 0;
|
|
1364
|
+
const linkClassName = (0, clsx.default)("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);
|
|
1365
|
+
if (isExternalHref(href)) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.CloseButton, {
|
|
1366
|
+
as: "a",
|
|
1367
|
+
href,
|
|
1368
|
+
target: "_blank",
|
|
1369
|
+
rel: "noreferrer",
|
|
1370
|
+
className: linkClassName,
|
|
1371
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1372
|
+
className: "flex items-center gap-2",
|
|
1373
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationIcon, {
|
|
1374
|
+
name: item.icon,
|
|
1375
|
+
className: "h-4 w-4"
|
|
1376
|
+
}), label]
|
|
1377
|
+
}), description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1378
|
+
className: "block pl-6 text-xs opacity-70",
|
|
1379
|
+
children: description
|
|
1380
|
+
}) : null]
|
|
1381
|
+
});
|
|
1382
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.CloseButton, {
|
|
1383
|
+
as: react_router_dom.Link,
|
|
1384
|
+
to: href,
|
|
1385
|
+
className: linkClassName,
|
|
1386
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1387
|
+
className: "flex items-center gap-2",
|
|
1388
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationIcon, {
|
|
1389
|
+
name: item.icon,
|
|
1390
|
+
className: "h-4 w-4"
|
|
1391
|
+
}), label]
|
|
1392
|
+
}), description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1393
|
+
className: "block pl-6 text-xs opacity-70",
|
|
1394
|
+
children: description
|
|
1395
|
+
}) : null]
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
function NavbarMenuItems(arg0) {
|
|
1399
|
+
const { items, config, currentLocale } = arg0;
|
|
1400
|
+
return items.map((item, index) => {
|
|
1401
|
+
if ("items" in item) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1402
|
+
className: "pl-2",
|
|
1403
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1404
|
+
className: "flex items-center gap-2 px-3 py-2 text-xs font-semibold opacity-60",
|
|
1405
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationIcon, {
|
|
1406
|
+
name: item.icon,
|
|
1407
|
+
className: "h-3.5 w-3.5"
|
|
1408
|
+
}), resolveLocalizedText(item.label, currentLocale, config.locales?.default)]
|
|
1409
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: NavbarMenuItems({
|
|
1410
|
+
items: item.items,
|
|
1411
|
+
config,
|
|
1412
|
+
currentLocale
|
|
1413
|
+
}) })]
|
|
1414
|
+
}, `${resolveLocalizedText(item.label, currentLocale, config.locales?.default)}-${index}`);
|
|
1415
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: ({ focus }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMenuItemLink, {
|
|
1416
|
+
item,
|
|
1417
|
+
config,
|
|
1418
|
+
currentLocale,
|
|
1419
|
+
className: focus ? "clarify-ui-menu-item-focus" : void 0
|
|
1420
|
+
}) }, "page" in item ? item.page : item.href);
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
function NavbarMenus(arg0) {
|
|
1424
|
+
const { menus, config, currentLocale } = arg0;
|
|
1425
|
+
const pathname = normalizeRoutePath((0, react_router_dom.useLocation)().pathname);
|
|
1426
|
+
if (!menus?.length) return null;
|
|
1427
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
1428
|
+
className: "clarify-top-nav hidden md:block",
|
|
1429
|
+
"aria-label": "Navigation",
|
|
1430
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1431
|
+
role: "list",
|
|
1432
|
+
className: "flex items-center gap-0.5",
|
|
1433
|
+
children: menus.map((menu, index) => {
|
|
1434
|
+
const label = resolveLocalizedText(menu.label, currentLocale, config.locales?.default);
|
|
1435
|
+
if (!("items" in menu)) {
|
|
1436
|
+
const href = navbarMenuHref(menu, config, currentLocale);
|
|
1437
|
+
if (!href) return null;
|
|
1438
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopLevelNavItem, {
|
|
1439
|
+
href,
|
|
1440
|
+
active: !isExternalHref(href) && isSameRoutePath(href, pathname, currentLocale),
|
|
1441
|
+
children: label
|
|
1442
|
+
}, `${label}-${index}`);
|
|
1443
|
+
}
|
|
1444
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.Menu, {
|
|
1445
|
+
as: "div",
|
|
1446
|
+
className: "relative",
|
|
1447
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.MenuButton, {
|
|
1448
|
+
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)",
|
|
1449
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1450
|
+
className: "flex items-center gap-2",
|
|
1451
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationIcon, {
|
|
1452
|
+
name: menu.icon,
|
|
1453
|
+
className: "h-4 w-4"
|
|
1454
|
+
}), label]
|
|
1455
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "ml-1 h-3.5 w-3.5 rotate-90" })]
|
|
1456
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItems, {
|
|
1457
|
+
anchor: "bottom start",
|
|
1458
|
+
transition: true,
|
|
1459
|
+
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",
|
|
1460
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMenuItems, {
|
|
1461
|
+
items: menu.items,
|
|
1462
|
+
config,
|
|
1463
|
+
currentLocale
|
|
1464
|
+
})
|
|
1465
|
+
})]
|
|
1466
|
+
}) }, `${label}-${index}`);
|
|
1467
|
+
})
|
|
1468
|
+
})
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1386
1471
|
function MobileNavbarMenu(arg0) {
|
|
1387
|
-
const {
|
|
1472
|
+
const { menus, config, currentLocale } = arg0;
|
|
1388
1473
|
const t = require_i18n.useBuiltInText();
|
|
1389
|
-
if (!
|
|
1474
|
+
if (!menus?.length) return null;
|
|
1390
1475
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.Menu, {
|
|
1391
1476
|
as: "div",
|
|
1392
1477
|
className: "clarify-mobile-navbar-menu relative md:hidden",
|
|
@@ -1398,24 +1483,10 @@ function MobileNavbarMenu(arg0) {
|
|
|
1398
1483
|
transition: true,
|
|
1399
1484
|
anchor: "bottom end",
|
|
1400
1485
|
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",
|
|
1401
|
-
children:
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_headlessui_react.MenuItem, { children: ({ focus }) => {
|
|
1406
|
-
const className = (0, clsx.default)("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");
|
|
1407
|
-
return external ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
1408
|
-
href,
|
|
1409
|
-
target: "_blank",
|
|
1410
|
-
rel: "noreferrer",
|
|
1411
|
-
className,
|
|
1412
|
-
children: label
|
|
1413
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
|
|
1414
|
-
to: href,
|
|
1415
|
-
className,
|
|
1416
|
-
children: label
|
|
1417
|
-
});
|
|
1418
|
-
} }, link.href);
|
|
1486
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMenuItems, {
|
|
1487
|
+
items: menus,
|
|
1488
|
+
config,
|
|
1489
|
+
currentLocale
|
|
1419
1490
|
})
|
|
1420
1491
|
})]
|
|
1421
1492
|
});
|
|
@@ -1546,7 +1617,6 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1546
1617
|
const { navigation, tabs, routes, currentLocale, currentRoute, banner, topAreaRef, className, ...props } = arg0;
|
|
1547
1618
|
const config = require_i18n.useConfig();
|
|
1548
1619
|
const t = require_i18n.useBuiltInText();
|
|
1549
|
-
const pathname = normalizeRoutePath((0, react_router_dom.useLocation)().pathname);
|
|
1550
1620
|
const { isOpen: mobileNavIsOpen } = useMobileNavigationStore();
|
|
1551
1621
|
const isInsideMobileNavigation = useIsInsideMobileNavigation();
|
|
1552
1622
|
const homeHref = resolveHomeHref(config, currentLocale);
|
|
@@ -1554,7 +1624,7 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1554
1624
|
const { scrollY } = (0, framer_motion.useScroll)();
|
|
1555
1625
|
const bgOpacityLight = (0, framer_motion.useTransform)(scrollY, [0, 72], ["70%", "95%"]);
|
|
1556
1626
|
const bgOpacityDark = (0, framer_motion.useTransform)(scrollY, [0, 72], ["60%", "92%"]);
|
|
1557
|
-
const
|
|
1627
|
+
const hasNavbarMenus = Boolean(config.navigation?.menus?.length);
|
|
1558
1628
|
const tabsInNavbar = config.layout?.tabs === "navbar";
|
|
1559
1629
|
function renderBrand() {
|
|
1560
1630
|
if (homeExternal) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_headlessui_react.CloseButton, {
|
|
@@ -1585,22 +1655,10 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1585
1655
|
});
|
|
1586
1656
|
}
|
|
1587
1657
|
function renderTopLinks() {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1593
|
-
role: "list",
|
|
1594
|
-
className: "flex items-center gap-0.5",
|
|
1595
|
-
children: config.navigation?.links?.map((link) => {
|
|
1596
|
-
const href = localizeHref(link.href, config, currentLocale);
|
|
1597
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopLevelNavItem, {
|
|
1598
|
-
href,
|
|
1599
|
-
active: !isExternalHref(href) && isSameRoutePath(href, pathname, currentLocale),
|
|
1600
|
-
children: resolveLocalizedText(link.label, currentLocale, config.locales?.default)
|
|
1601
|
-
}, link.href);
|
|
1602
|
-
})
|
|
1603
|
-
})
|
|
1658
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMenus, {
|
|
1659
|
+
menus: config.navigation?.menus,
|
|
1660
|
+
config,
|
|
1661
|
+
currentLocale
|
|
1604
1662
|
});
|
|
1605
1663
|
}
|
|
1606
1664
|
function renderHeaderActions() {
|
|
@@ -1617,7 +1675,7 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1617
1675
|
currentLocale
|
|
1618
1676
|
}) : null,
|
|
1619
1677
|
renderTopLinks(),
|
|
1620
|
-
|
|
1678
|
+
hasNavbarMenus ? /* @__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,
|
|
1621
1679
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileSearch, {
|
|
1622
1680
|
routes,
|
|
1623
1681
|
navigation
|
|
@@ -1629,7 +1687,7 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1629
1687
|
}),
|
|
1630
1688
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggle, {}),
|
|
1631
1689
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileNavbarMenu, {
|
|
1632
|
-
|
|
1690
|
+
menus: config.navigation?.menus,
|
|
1633
1691
|
config,
|
|
1634
1692
|
currentLocale
|
|
1635
1693
|
})
|
|
@@ -1655,7 +1713,7 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1655
1713
|
}), renderBrand()]
|
|
1656
1714
|
}),
|
|
1657
1715
|
!tabsInNavbar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1658
|
-
className: "clarify-header-center
|
|
1716
|
+
className: "clarify-header-center hidden min-w-0 flex-1 justify-center lg:flex",
|
|
1659
1717
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Search, {
|
|
1660
1718
|
routes,
|
|
1661
1719
|
navigation
|
|
@@ -1694,12 +1752,39 @@ var Header = (0, react.forwardRef)(function Header(arg0, ref) {
|
|
|
1694
1752
|
});
|
|
1695
1753
|
});
|
|
1696
1754
|
//#endregion
|
|
1755
|
+
//#region source/app/PageUpdatedAt.tsx
|
|
1756
|
+
function PageUpdatedAt(props) {
|
|
1757
|
+
const { updatedAt, locale } = props;
|
|
1758
|
+
if (!updatedAt) return null;
|
|
1759
|
+
const date = new Date(updatedAt);
|
|
1760
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
1761
|
+
const label = locale?.toLowerCase().startsWith("zh") ? "最后更新" : "Last updated";
|
|
1762
|
+
const formattedDate = new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date);
|
|
1763
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1764
|
+
className: "clarify-page-updated-at m-0 flex items-center gap-1.5 text-xs text-(--clarify-ui-text-faint)",
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CalendarClock, {
|
|
1767
|
+
className: "size-3.5",
|
|
1768
|
+
"aria-hidden": "true"
|
|
1769
|
+
}),
|
|
1770
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }),
|
|
1771
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
1772
|
+
dateTime: updatedAt,
|
|
1773
|
+
children: formattedDate
|
|
1774
|
+
})
|
|
1775
|
+
]
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
//#endregion
|
|
1697
1779
|
//#region source/app/PageActions.tsx
|
|
1698
1780
|
var PageActionsContext = (0, react.createContext)({});
|
|
1699
1781
|
function PageActionsProvider(props) {
|
|
1700
|
-
const { children, route } = props;
|
|
1782
|
+
const { children, route, locale } = props;
|
|
1701
1783
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageActionsContext.Provider, {
|
|
1702
|
-
value: {
|
|
1784
|
+
value: {
|
|
1785
|
+
route,
|
|
1786
|
+
locale
|
|
1787
|
+
},
|
|
1703
1788
|
children
|
|
1704
1789
|
});
|
|
1705
1790
|
}
|
|
@@ -1707,6 +1792,33 @@ function PageActions() {
|
|
|
1707
1792
|
const { route } = (0, react.useContext)(PageActionsContext);
|
|
1708
1793
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContentActions, { route });
|
|
1709
1794
|
}
|
|
1795
|
+
function PageMetadata(props) {
|
|
1796
|
+
const { route, locale: contextLocale } = (0, react.useContext)(PageActionsContext);
|
|
1797
|
+
const { updatedAt = route?.updatedAt, locale = contextLocale } = props;
|
|
1798
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1799
|
+
className: "clarify-page-metadata flex w-full items-center justify-end gap-3",
|
|
1800
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageUpdatedAt, {
|
|
1801
|
+
updatedAt,
|
|
1802
|
+
locale
|
|
1803
|
+
}), route?.sourceEditUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
1804
|
+
href: route.sourceEditUrl,
|
|
1805
|
+
target: "_blank",
|
|
1806
|
+
rel: "noreferrer",
|
|
1807
|
+
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)",
|
|
1808
|
+
children: [
|
|
1809
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.PencilLine, {
|
|
1810
|
+
className: "size-3.5",
|
|
1811
|
+
"aria-hidden": "true"
|
|
1812
|
+
}),
|
|
1813
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: locale?.toLowerCase().startsWith("zh") ? "编辑此页面" : "Edit this page" }),
|
|
1814
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, {
|
|
1815
|
+
className: "size-3",
|
|
1816
|
+
"aria-hidden": "true"
|
|
1817
|
+
})
|
|
1818
|
+
]
|
|
1819
|
+
}) : null]
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1710
1822
|
//#endregion
|
|
1711
1823
|
Object.defineProperty(exports, "Header", {
|
|
1712
1824
|
enumerable: true,
|
|
@@ -1732,6 +1844,12 @@ Object.defineProperty(exports, "PageActionsProvider", {
|
|
|
1732
1844
|
return PageActionsProvider;
|
|
1733
1845
|
}
|
|
1734
1846
|
});
|
|
1847
|
+
Object.defineProperty(exports, "PageMetadata", {
|
|
1848
|
+
enumerable: true,
|
|
1849
|
+
get: function() {
|
|
1850
|
+
return PageMetadata;
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1735
1853
|
Object.defineProperty(exports, "SectionProvider", {
|
|
1736
1854
|
enumerable: true,
|
|
1737
1855
|
get: function() {
|
|
@@ -1871,4 +1989,4 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
1871
1989
|
}
|
|
1872
1990
|
});
|
|
1873
1991
|
|
|
1874
|
-
//# sourceMappingURL=PageActions-
|
|
1992
|
+
//# sourceMappingURL=PageActions-CVOTIuxh.cjs.map
|