@clarify-labs/renderer 0.11.11 → 0.11.13
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-DLOGS18o.cjs → ClarifyShell-Cv4GYuCM.cjs} +197 -179
- package/output/ClarifyShell-Cv4GYuCM.cjs.map +1 -0
- package/output/{ClarifyShell-DGm_R5Bp.js → ClarifyShell-Dh4TgQkW.js} +198 -180
- package/output/ClarifyShell-Dh4TgQkW.js.map +1 -0
- package/output/{OpenApiOperation-bY3wbaJC.js → OpenApiOperation-B6WpfQ0n.js} +2 -2
- package/output/{OpenApiOperation-bY3wbaJC.js.map → OpenApiOperation-B6WpfQ0n.js.map} +1 -1
- package/output/{OpenApiOperation-416zAKci.cjs → OpenApiOperation-MEemAiXJ.cjs} +2 -2
- package/output/{OpenApiOperation-416zAKci.cjs.map → OpenApiOperation-MEemAiXJ.cjs.map} +1 -1
- package/output/{PageActions-D52u18C8.js → PageActions-B5PYif9Q.js} +2 -2
- package/output/{PageActions-D52u18C8.js.map → PageActions-B5PYif9Q.js.map} +1 -1
- package/output/{PageActions-CVOTIuxh.cjs → PageActions-DEAcLCtt.cjs} +2 -2
- package/output/{PageActions-CVOTIuxh.cjs.map → PageActions-DEAcLCtt.cjs.map} +1 -1
- package/output/{SearchDialog--OLp05za.cjs → SearchDialog-Dz1kUiHe.cjs} +3 -3
- package/output/SearchDialog-Dz1kUiHe.cjs.map +1 -0
- package/output/{SearchDialog-Cq7w-uc7.js → SearchDialog-boUYmwrD.js} +3 -3
- package/output/SearchDialog-boUYmwrD.js.map +1 -0
- package/output/app/AppShell.d.ts +8 -1
- package/output/app/FooterRegion.d.ts +5 -0
- package/output/client.cjs +3 -3
- package/output/client.js +3 -3
- package/output/core/types.d.ts +3 -0
- package/output/index.cjs +4 -4
- package/output/index.js +4 -4
- package/output/preview.cjs +2 -2
- package/output/preview.js +2 -2
- package/output/{render-D_QvIv7Z.js → render-Cn0R4zQQ.js} +2 -2
- package/output/{render-D_QvIv7Z.js.map → render-Cn0R4zQQ.js.map} +1 -1
- package/output/{render-TErh9x_2.cjs → render-WvWfRv-m.cjs} +2 -2
- package/output/{render-TErh9x_2.cjs.map → render-WvWfRv-m.cjs.map} +1 -1
- package/output/server.cjs +2 -2
- package/output/server.js +2 -2
- package/package.json +1 -1
- package/output/ClarifyShell-DGm_R5Bp.js.map +0 -1
- package/output/ClarifyShell-DLOGS18o.cjs.map +0 -1
- package/output/SearchDialog--OLp05za.cjs.map +0 -1
- package/output/SearchDialog-Cq7w-uc7.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as useConfig, c as useConfigUpdaterOptional, i as OpenApiSpecsContext, l as useLocale, n as ConfigProvider, o as useConfigOptional, r as LocaleContext, s as useConfigUpdater, t as useBuiltInText } from "./i18n-Zmmhz7FF.js";
|
|
2
|
-
import { C as themeCookieName, D as resolveHomeHref, O as copyTextToClipboard, T as localizeHref, _ as getStoredLocalePreference, a as Navigation, d as isSameRoutePath, f as normalizeRoutePath, g as useTheme, h as ThemeProvider, i as Header, n as PageActionsProvider, o as SectionProvider, p as resolveLocalizedText, r as PageMetadata, s as useSectionStore, w as isExternalHref, x as storeLocalePreference } from "./PageActions-
|
|
2
|
+
import { C as themeCookieName, D as resolveHomeHref, O as copyTextToClipboard, T as localizeHref, _ as getStoredLocalePreference, a as Navigation, d as isSameRoutePath, f as normalizeRoutePath, g as useTheme, h as ThemeProvider, i as Header, n as PageActionsProvider, o as SectionProvider, p as resolveLocalizedText, r as PageMetadata, s as useSectionStore, w as isExternalHref, x as storeLocalePreference } from "./PageActions-B5PYif9Q.js";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Component, Suspense, createContext, lazy, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { Link, Route, Routes, useLocation, useNavigate } from "react-router-dom";
|
|
@@ -151,100 +151,6 @@ function BuiltInNotFoundPage() {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
//#region source/assets/clarify.svg?url
|
|
155
|
-
var clarify_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='279px'%20height='200px'%20viewBox='0%200%20279%20200'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eclarify%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='clarify'%20transform='translate(-0,%200.0054)'%3e%3cpath%20d='M44.867217,0.0054376148%20C130.715579,1.00591567%20200,70.9091172%20200,156.994562%20L199.986321,155.127494%20C199.384888,180.009127%20179.026368,199.994562%20154,199.994562%20L46,199.994562%20C20.5949015,199.994562%200,179.399661%200,153.994562%20L0,45.9945624%20C0,21.0975659%2019.7793434,0.820282524%2044.4815926,0.0191499894%20Z'%20fill='%2300D492'%3e%3c/path%3e%3cpath%20d='M123.867217,0.0054376148%20C209.715579,1.00591567%20279,70.9091172%20279,156.994562%20L278.986321,155.127494%20C278.384888,180.009127%20258.026368,199.994562%20233,199.994562%20L125,199.994562%20C99.5949015,199.994562%2079,179.399661%2079,153.994562%20L79,45.9945624%20C79,21.0975659%2098.7793434,0.820282524%20123.481593,0.0191499894%20Z'%20id='clarify-right'%20fill-opacity='0.6'%20fill='%2300F6C9'%20transform='translate(179,%20100)%20rotate(-90)%20translate(-179,%20-100)'%3e%3c/path%3e%3cpath%20d='M199.979267,154.416906%20L199.984438,155.157125%20L199.962366,155.872459%20C198.977251,180.406837%20178.776104,199.994562%20154,199.994562%20L124.372438,199.994125%20L124.249053,199.994081%20C99.6939678,199.603921%2079.8122712,179.973634%2079.01915,155.518407%20L79.0054376,155.132783%20C79.5830823,105.566626%20103.129768,61.5221348%20139.498462,33.1463428%20C175.69419,61.3871018%20199.186123,105.143863%20199.979267,154.416906%20Z'%20id='形状结合'%20fill='%2300F692'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region source/app/BuiltWithClarify.tsx
|
|
158
|
-
var CLARIFY_TRACKING_URL = "https://api.clarify.pub/track";
|
|
159
|
-
var CLARIFY_CLIENT_ID_KEY = "clarify.client_id";
|
|
160
|
-
function getClientId() {
|
|
161
|
-
const newClientId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}.${Math.random()}`;
|
|
162
|
-
try {
|
|
163
|
-
const clientId = window.localStorage.getItem(CLARIFY_CLIENT_ID_KEY);
|
|
164
|
-
if (clientId) return clientId;
|
|
165
|
-
window.localStorage.setItem(CLARIFY_CLIENT_ID_KEY, newClientId);
|
|
166
|
-
return newClientId;
|
|
167
|
-
} catch {
|
|
168
|
-
return newClientId;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function getSiteHostname() {
|
|
172
|
-
return window.location.hostname.slice(0, 100);
|
|
173
|
-
}
|
|
174
|
-
function getPageLanguage() {
|
|
175
|
-
return (document.documentElement.lang || (typeof navigator === "undefined" ? "" : navigator.language)).slice(0, 100);
|
|
176
|
-
}
|
|
177
|
-
function getViewportCategory() {
|
|
178
|
-
if (window.innerWidth < 768) return "mobile";
|
|
179
|
-
if (window.innerWidth < 1024) return "tablet";
|
|
180
|
-
return "desktop";
|
|
181
|
-
}
|
|
182
|
-
function getTimezone() {
|
|
183
|
-
try {
|
|
184
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone.slice(0, 100);
|
|
185
|
-
} catch {
|
|
186
|
-
return "";
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function getClarifyVersion(version) {
|
|
190
|
-
return version?.slice(0, 100) ?? "";
|
|
191
|
-
}
|
|
192
|
-
function createClarifySiteViewPayload(version) {
|
|
193
|
-
return JSON.stringify({
|
|
194
|
-
client_id: getClientId(),
|
|
195
|
-
event_name: "clarify_site_view",
|
|
196
|
-
params: {
|
|
197
|
-
timezone: getTimezone(),
|
|
198
|
-
site_hostname: getSiteHostname(),
|
|
199
|
-
page_language: getPageLanguage(),
|
|
200
|
-
clarify_version: getClarifyVersion(version),
|
|
201
|
-
viewport_category: getViewportCategory()
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function registerClarifySiteView(version) {
|
|
206
|
-
if (typeof window === "undefined") return;
|
|
207
|
-
if (typeof document === "undefined") return;
|
|
208
|
-
if (typeof navigator === "undefined" || typeof navigator.sendBeacon !== "function") return;
|
|
209
|
-
let sent = false;
|
|
210
|
-
const send = () => {
|
|
211
|
-
if (sent) return;
|
|
212
|
-
sent = true;
|
|
213
|
-
navigator.sendBeacon(CLARIFY_TRACKING_URL, createClarifySiteViewPayload(version));
|
|
214
|
-
};
|
|
215
|
-
window.addEventListener("pagehide", send);
|
|
216
|
-
return () => window.removeEventListener("pagehide", send);
|
|
217
|
-
}
|
|
218
|
-
function BuiltWithClarify(props) {
|
|
219
|
-
const { version } = props;
|
|
220
|
-
const t = useBuiltInText();
|
|
221
|
-
useEffect(() => {
|
|
222
|
-
return registerClarifySiteView(version);
|
|
223
|
-
}, [version]);
|
|
224
|
-
return /* @__PURE__ */ jsx("div", {
|
|
225
|
-
className: "clarify-built-with inline-flex items-center gap-1.5",
|
|
226
|
-
children: /* @__PURE__ */ jsxs("a", {
|
|
227
|
-
target: "_blank",
|
|
228
|
-
rel: "noreferrer",
|
|
229
|
-
href: "https://clarify.pub",
|
|
230
|
-
"aria-label": t("builtWith.label"),
|
|
231
|
-
className: "clarify-built-with inline-flex items-center gap-1.5 rounded-full px-2 py-1 font-medium no-underline transition",
|
|
232
|
-
children: [
|
|
233
|
-
/* @__PURE__ */ jsx("span", { children: t("builtWith.prefix") }),
|
|
234
|
-
/* @__PURE__ */ jsx("img", {
|
|
235
|
-
src: clarify_default,
|
|
236
|
-
alt: "",
|
|
237
|
-
className: "clarify-built-with-logo h-3.5 w-auto flex-none object-contain"
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ jsx("span", {
|
|
240
|
-
className: "clarify-built-with-brand font-semibold",
|
|
241
|
-
children: "Clarify"
|
|
242
|
-
})
|
|
243
|
-
]
|
|
244
|
-
})
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
154
|
//#region source/app/RenderErrorPanel.tsx
|
|
249
155
|
function RenderErrorPanel(props) {
|
|
250
156
|
const { title, description, eyebrowLabel = "Render error", action, metadata = [], detailsLabel, detailsHeaderAction, detailsContent, titleId = "clarify-render-error-title", refreshLabel, onRefresh } = props;
|
|
@@ -422,6 +328,181 @@ var PageErrorBoundary = class extends Component {
|
|
|
422
328
|
}
|
|
423
329
|
};
|
|
424
330
|
//#endregion
|
|
331
|
+
//#region source/assets/clarify.svg?url
|
|
332
|
+
var clarify_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='279px'%20height='200px'%20viewBox='0%200%20279%20200'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eclarify%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='clarify'%20transform='translate(-0,%200.0054)'%3e%3cpath%20d='M44.867217,0.0054376148%20C130.715579,1.00591567%20200,70.9091172%20200,156.994562%20L199.986321,155.127494%20C199.384888,180.009127%20179.026368,199.994562%20154,199.994562%20L46,199.994562%20C20.5949015,199.994562%200,179.399661%200,153.994562%20L0,45.9945624%20C0,21.0975659%2019.7793434,0.820282524%2044.4815926,0.0191499894%20Z'%20fill='%2300D492'%3e%3c/path%3e%3cpath%20d='M123.867217,0.0054376148%20C209.715579,1.00591567%20279,70.9091172%20279,156.994562%20L278.986321,155.127494%20C278.384888,180.009127%20258.026368,199.994562%20233,199.994562%20L125,199.994562%20C99.5949015,199.994562%2079,179.399661%2079,153.994562%20L79,45.9945624%20C79,21.0975659%2098.7793434,0.820282524%20123.481593,0.0191499894%20Z'%20id='clarify-right'%20fill-opacity='0.6'%20fill='%2300F6C9'%20transform='translate(179,%20100)%20rotate(-90)%20translate(-179,%20-100)'%3e%3c/path%3e%3cpath%20d='M199.979267,154.416906%20L199.984438,155.157125%20L199.962366,155.872459%20C198.977251,180.406837%20178.776104,199.994562%20154,199.994562%20L124.372438,199.994125%20L124.249053,199.994081%20C99.6939678,199.603921%2079.8122712,179.973634%2079.01915,155.518407%20L79.0054376,155.132783%20C79.5830823,105.566626%20103.129768,61.5221348%20139.498462,33.1463428%20C175.69419,61.3871018%20199.186123,105.143863%20199.979267,154.416906%20Z'%20id='形状结合'%20fill='%2300F692'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region source/app/BuiltWithClarify.tsx
|
|
335
|
+
var CLARIFY_TRACKING_URL = "https://api.clarify.pub/track";
|
|
336
|
+
var CLARIFY_CLIENT_ID_KEY = "clarify.client_id";
|
|
337
|
+
function getClientId() {
|
|
338
|
+
const newClientId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}.${Math.random()}`;
|
|
339
|
+
try {
|
|
340
|
+
const clientId = window.localStorage.getItem(CLARIFY_CLIENT_ID_KEY);
|
|
341
|
+
if (clientId) return clientId;
|
|
342
|
+
window.localStorage.setItem(CLARIFY_CLIENT_ID_KEY, newClientId);
|
|
343
|
+
return newClientId;
|
|
344
|
+
} catch {
|
|
345
|
+
return newClientId;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function getSiteHostname() {
|
|
349
|
+
return window.location.hostname.slice(0, 100);
|
|
350
|
+
}
|
|
351
|
+
function getPageLanguage() {
|
|
352
|
+
return (document.documentElement.lang || (typeof navigator === "undefined" ? "" : navigator.language)).slice(0, 100);
|
|
353
|
+
}
|
|
354
|
+
function getViewportCategory() {
|
|
355
|
+
if (window.innerWidth < 768) return "mobile";
|
|
356
|
+
if (window.innerWidth < 1024) return "tablet";
|
|
357
|
+
return "desktop";
|
|
358
|
+
}
|
|
359
|
+
function getTimezone() {
|
|
360
|
+
try {
|
|
361
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone.slice(0, 100);
|
|
362
|
+
} catch {
|
|
363
|
+
return "";
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function getClarifyVersion(version) {
|
|
367
|
+
return version?.slice(0, 100) ?? "";
|
|
368
|
+
}
|
|
369
|
+
function createClarifySiteViewPayload(version) {
|
|
370
|
+
return JSON.stringify({
|
|
371
|
+
client_id: getClientId(),
|
|
372
|
+
event_name: "clarify_site_view",
|
|
373
|
+
params: {
|
|
374
|
+
timezone: getTimezone(),
|
|
375
|
+
site_hostname: getSiteHostname(),
|
|
376
|
+
page_language: getPageLanguage(),
|
|
377
|
+
clarify_version: getClarifyVersion(version),
|
|
378
|
+
viewport_category: getViewportCategory()
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function registerClarifySiteView(version) {
|
|
383
|
+
if (typeof window === "undefined") return;
|
|
384
|
+
if (typeof document === "undefined") return;
|
|
385
|
+
if (typeof navigator === "undefined" || typeof navigator.sendBeacon !== "function") return;
|
|
386
|
+
let sent = false;
|
|
387
|
+
const send = () => {
|
|
388
|
+
if (sent) return;
|
|
389
|
+
sent = true;
|
|
390
|
+
navigator.sendBeacon(CLARIFY_TRACKING_URL, createClarifySiteViewPayload(version));
|
|
391
|
+
};
|
|
392
|
+
window.addEventListener("pagehide", send);
|
|
393
|
+
return () => window.removeEventListener("pagehide", send);
|
|
394
|
+
}
|
|
395
|
+
function BuiltWithClarify(props) {
|
|
396
|
+
const { version } = props;
|
|
397
|
+
const t = useBuiltInText();
|
|
398
|
+
useEffect(() => {
|
|
399
|
+
return registerClarifySiteView(version);
|
|
400
|
+
}, [version]);
|
|
401
|
+
return /* @__PURE__ */ jsx("div", {
|
|
402
|
+
className: "clarify-built-with inline-flex items-center gap-1.5",
|
|
403
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
404
|
+
target: "_blank",
|
|
405
|
+
rel: "noreferrer",
|
|
406
|
+
href: "https://clarify.pub",
|
|
407
|
+
"aria-label": t("builtWith.label"),
|
|
408
|
+
className: "clarify-built-with inline-flex items-center gap-1.5 rounded-full px-2 py-1 font-medium no-underline transition",
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ jsx("span", { children: t("builtWith.prefix") }),
|
|
411
|
+
/* @__PURE__ */ jsx("img", {
|
|
412
|
+
src: clarify_default,
|
|
413
|
+
alt: "",
|
|
414
|
+
className: "clarify-built-with-logo h-3.5 w-auto flex-none object-contain"
|
|
415
|
+
}),
|
|
416
|
+
/* @__PURE__ */ jsx("span", {
|
|
417
|
+
className: "clarify-built-with-brand font-semibold",
|
|
418
|
+
children: "Clarify"
|
|
419
|
+
})
|
|
420
|
+
]
|
|
421
|
+
})
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region source/app/PageFooter.tsx
|
|
426
|
+
function FooterLink(arg0) {
|
|
427
|
+
const { link, locale, config } = arg0;
|
|
428
|
+
const external = isExternalHref(link.href);
|
|
429
|
+
const href = external ? link.href : localizeHref(link.href, config, locale);
|
|
430
|
+
const className = "clarify-footer-link no-underline transition";
|
|
431
|
+
const label = resolveLocalizedText(link.label, locale, config.locales?.default);
|
|
432
|
+
if (external) return /* @__PURE__ */ jsx("a", {
|
|
433
|
+
href,
|
|
434
|
+
target: "_blank",
|
|
435
|
+
rel: "noreferrer",
|
|
436
|
+
className,
|
|
437
|
+
children: label
|
|
438
|
+
});
|
|
439
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
440
|
+
to: href,
|
|
441
|
+
className,
|
|
442
|
+
children: label
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function SocialLink(arg0) {
|
|
446
|
+
const { name, href } = arg0;
|
|
447
|
+
return /* @__PURE__ */ jsx("a", {
|
|
448
|
+
href,
|
|
449
|
+
target: "_blank",
|
|
450
|
+
rel: "noreferrer",
|
|
451
|
+
className: "clarify-footer-social capitalize no-underline transition",
|
|
452
|
+
children: name
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function PageFooter() {
|
|
456
|
+
const config = useConfig();
|
|
457
|
+
const locale = useLocale() ?? config.locales?.default;
|
|
458
|
+
const footer = config.footer;
|
|
459
|
+
const links = footer?.links ?? [];
|
|
460
|
+
const socials = Object.entries(footer?.socials ?? {});
|
|
461
|
+
const copyright = footer?.copyright ? resolveLocalizedText(footer.copyright, locale, config.locales?.default) : void 0;
|
|
462
|
+
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return null;
|
|
463
|
+
return /* @__PURE__ */ jsx("footer", {
|
|
464
|
+
className: "clarify-page-footer w-full",
|
|
465
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
466
|
+
className: clsx("clarify-footer-content flex flex-col items-start gap-2.5 text-left"),
|
|
467
|
+
children: [copyright ? /* @__PURE__ */ jsx("p", {
|
|
468
|
+
className: "clarify-footer-copyright m-0",
|
|
469
|
+
children: copyright
|
|
470
|
+
}) : null, links.length > 0 || socials.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
471
|
+
className: "clarify-footer-links flex flex-wrap justify-start gap-x-4 gap-y-2",
|
|
472
|
+
children: [links.map((link) => /* @__PURE__ */ jsx(FooterLink, {
|
|
473
|
+
link,
|
|
474
|
+
locale,
|
|
475
|
+
config
|
|
476
|
+
}, `${link.href}-${resolveLocalizedText(link.label, locale, config.locales?.default)}`)), socials.map(([name, href]) => /* @__PURE__ */ jsx(SocialLink, {
|
|
477
|
+
name,
|
|
478
|
+
href
|
|
479
|
+
}, name))]
|
|
480
|
+
}) : null]
|
|
481
|
+
})
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region source/app/FooterRegion.tsx
|
|
486
|
+
function DefaultFooterComponent() {
|
|
487
|
+
return /* @__PURE__ */ jsx(PageFooter, {});
|
|
488
|
+
}
|
|
489
|
+
function FooterRegion(props) {
|
|
490
|
+
const { version } = props;
|
|
491
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
492
|
+
className: "clarify-page-footer-region mt-8 grid gap-5 border-t border-(--clarify-theme-tokens-colors-border) pt-6 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",
|
|
493
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
494
|
+
className: "clarify-page-footer-slot min-w-0",
|
|
495
|
+
children: [/* @__PURE__ */ jsx(RuntimeSlot, { name: "page.footer.before" }), /* @__PURE__ */ jsx(RuntimeSlot, {
|
|
496
|
+
name: "page.footer.replace",
|
|
497
|
+
default: DefaultFooterComponent
|
|
498
|
+
})]
|
|
499
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
500
|
+
className: "clarify-page-attribution flex justify-end sm:self-end",
|
|
501
|
+
children: /* @__PURE__ */ jsx(BuiltWithClarify, { version })
|
|
502
|
+
})]
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
//#endregion
|
|
425
506
|
//#region source/app/PageBanner.tsx
|
|
426
507
|
function bannerStorageKey(config, content) {
|
|
427
508
|
return `clarify:banner:dismissed:${config.title}:${content}`;
|
|
@@ -509,66 +590,6 @@ function PageBanner(props) {
|
|
|
509
590
|
});
|
|
510
591
|
}
|
|
511
592
|
//#endregion
|
|
512
|
-
//#region source/app/PageFooter.tsx
|
|
513
|
-
function FooterLink(arg0) {
|
|
514
|
-
const { link, locale, config } = arg0;
|
|
515
|
-
const external = isExternalHref(link.href);
|
|
516
|
-
const href = external ? link.href : localizeHref(link.href, config, locale);
|
|
517
|
-
const className = "clarify-footer-link no-underline transition";
|
|
518
|
-
const label = resolveLocalizedText(link.label, locale, config.locales?.default);
|
|
519
|
-
if (external) return /* @__PURE__ */ jsx("a", {
|
|
520
|
-
href,
|
|
521
|
-
target: "_blank",
|
|
522
|
-
rel: "noreferrer",
|
|
523
|
-
className,
|
|
524
|
-
children: label
|
|
525
|
-
});
|
|
526
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
527
|
-
to: href,
|
|
528
|
-
className,
|
|
529
|
-
children: label
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
function SocialLink(arg0) {
|
|
533
|
-
const { name, href } = arg0;
|
|
534
|
-
return /* @__PURE__ */ jsx("a", {
|
|
535
|
-
href,
|
|
536
|
-
target: "_blank",
|
|
537
|
-
rel: "noreferrer",
|
|
538
|
-
className: "clarify-footer-social capitalize no-underline transition",
|
|
539
|
-
children: name
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
function PageFooter() {
|
|
543
|
-
const config = useConfig();
|
|
544
|
-
const locale = useLocale() ?? config.locales?.default;
|
|
545
|
-
const footer = config.footer;
|
|
546
|
-
const links = footer?.links ?? [];
|
|
547
|
-
const socials = Object.entries(footer?.socials ?? {});
|
|
548
|
-
const copyright = footer?.copyright ? resolveLocalizedText(footer.copyright, locale, config.locales?.default) : void 0;
|
|
549
|
-
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return null;
|
|
550
|
-
return /* @__PURE__ */ jsx("footer", {
|
|
551
|
-
className: "clarify-page-footer w-full",
|
|
552
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
553
|
-
className: clsx("clarify-footer-content flex flex-col items-start gap-2.5 text-left"),
|
|
554
|
-
children: [copyright ? /* @__PURE__ */ jsx("p", {
|
|
555
|
-
className: "clarify-footer-copyright m-0",
|
|
556
|
-
children: copyright
|
|
557
|
-
}) : null, links.length > 0 || socials.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
558
|
-
className: "clarify-footer-links flex flex-wrap justify-start gap-x-4 gap-y-2",
|
|
559
|
-
children: [links.map((link) => /* @__PURE__ */ jsx(FooterLink, {
|
|
560
|
-
link,
|
|
561
|
-
locale,
|
|
562
|
-
config
|
|
563
|
-
}, `${link.href}-${resolveLocalizedText(link.label, locale, config.locales?.default)}`)), socials.map(([name, href]) => /* @__PURE__ */ jsx(SocialLink, {
|
|
564
|
-
name,
|
|
565
|
-
href
|
|
566
|
-
}, name))]
|
|
567
|
-
}) : null]
|
|
568
|
-
})
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
//#endregion
|
|
572
593
|
//#region source/app/PageNavigation.tsx
|
|
573
594
|
function flattenNavigation(nodes) {
|
|
574
595
|
return nodes.flatMap((node) => node.children?.length ? flattenNavigation(node.children) : [node]);
|
|
@@ -810,9 +831,6 @@ function BannerSlot(props) {
|
|
|
810
831
|
default: DefaultBannerComponent
|
|
811
832
|
});
|
|
812
833
|
}
|
|
813
|
-
function DefaultFooterComponent() {
|
|
814
|
-
return /* @__PURE__ */ jsx(PageFooter, {});
|
|
815
|
-
}
|
|
816
834
|
function routeForPath(routes, pathname) {
|
|
817
835
|
return routes.find((route) => isSameRoutePath(route.path, pathname));
|
|
818
836
|
}
|
|
@@ -907,6 +925,16 @@ function isDefaultLocale(config, locale) {
|
|
|
907
925
|
function hasPath(nodes, pathname, locale) {
|
|
908
926
|
return nodes.some((node) => isSameRoutePath(node.path, pathname, locale) || hasPath(node.children ?? [], pathname, locale));
|
|
909
927
|
}
|
|
928
|
+
function visibleNavigation(nodes, pathname, locale) {
|
|
929
|
+
return nodes.flatMap((node) => {
|
|
930
|
+
if (node.visible === "never") return [];
|
|
931
|
+
if (node.visible === "active" && !hasPath([node], pathname, locale)) return [];
|
|
932
|
+
return [{
|
|
933
|
+
...node,
|
|
934
|
+
children: node.visible === "active" ? node.children : visibleNavigation(node.children ?? [], pathname, locale)
|
|
935
|
+
}];
|
|
936
|
+
});
|
|
937
|
+
}
|
|
910
938
|
function layoutForNavigation(nodes, pathname, inherited) {
|
|
911
939
|
for (const node of nodes) {
|
|
912
940
|
const layout = node.layout ?? inherited;
|
|
@@ -919,16 +947,21 @@ function resolvePageLayout(route, navigation, pathname) {
|
|
|
919
947
|
return route?.layout ?? layoutForNavigation(navigation, pathname) ?? "documentation";
|
|
920
948
|
}
|
|
921
949
|
function navigationFromTabs(tabs, pathname, locale) {
|
|
950
|
+
const currentTab = tabs.find((tab) => isSameRoutePath(tab.path, pathname, locale) || hasPath(tab.children, pathname, locale));
|
|
951
|
+
const visibleTabs = tabs.map((tab) => ({
|
|
952
|
+
...tab,
|
|
953
|
+
children: visibleNavigation(tab.children, pathname, locale)
|
|
954
|
+
})).filter((tab) => tab.children.length > 0);
|
|
922
955
|
return {
|
|
923
|
-
items:
|
|
924
|
-
tabs
|
|
956
|
+
items: (currentTab && visibleTabs.find((tab) => tab === currentTab || tab.path === currentTab.path))?.children ?? visibleTabs[0]?.children ?? [],
|
|
957
|
+
tabs: visibleTabs
|
|
925
958
|
};
|
|
926
959
|
}
|
|
927
960
|
function navigationForLocale(navigation, locale, pathname) {
|
|
928
961
|
switch (navigation.kind) {
|
|
929
|
-
case "flat": return { items: navigation.nodes };
|
|
962
|
+
case "flat": return { items: visibleNavigation(navigation.nodes, pathname, locale) };
|
|
930
963
|
case "tabbed": return navigationFromTabs(navigation.tabs, pathname, locale);
|
|
931
|
-
case "localized": return { items: locale ? navigation.locales[locale] ?? [] : [] };
|
|
964
|
+
case "localized": return { items: locale ? visibleNavigation(navigation.locales[locale] ?? [], pathname, locale) : [] };
|
|
932
965
|
case "localized-tabbed": return locale && navigation.locales[locale] ? navigationFromTabs(navigation.locales[locale].tabs, pathname, locale) : { items: [] };
|
|
933
966
|
}
|
|
934
967
|
}
|
|
@@ -1193,21 +1226,6 @@ function AppShell(arg0) {
|
|
|
1193
1226
|
}, pathname)
|
|
1194
1227
|
});
|
|
1195
1228
|
}
|
|
1196
|
-
function renderFooter() {
|
|
1197
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1198
|
-
className: "clarify-page-footer-region mt-8 grid gap-5 border-t border-(--clarify-theme-tokens-colors-border) pt-6 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",
|
|
1199
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
1200
|
-
className: "clarify-page-footer-slot min-w-0",
|
|
1201
|
-
children: [/* @__PURE__ */ jsx(RuntimeSlot, { name: "page.footer.before" }), /* @__PURE__ */ jsx(RuntimeSlot, {
|
|
1202
|
-
name: "page.footer.replace",
|
|
1203
|
-
default: DefaultFooterComponent
|
|
1204
|
-
})]
|
|
1205
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
1206
|
-
className: "clarify-page-attribution flex justify-end sm:self-end",
|
|
1207
|
-
children: /* @__PURE__ */ jsx(BuiltWithClarify, { version: config.version })
|
|
1208
|
-
})]
|
|
1209
|
-
});
|
|
1210
|
-
}
|
|
1211
1229
|
function renderContent() {
|
|
1212
1230
|
return /* @__PURE__ */ jsx("div", {
|
|
1213
1231
|
className: clsx("clarify-content @container relative flex min-h-screen min-w-0 flex-col px-4 pb-12 sm:px-6 lg:px-8 xl:px-10", layoutConfig.contentClassName, layout === "blog" && "clarify-content-blog"),
|
|
@@ -1224,7 +1242,7 @@ function AppShell(arg0) {
|
|
|
1224
1242
|
navigation: currentNavigation.items,
|
|
1225
1243
|
currentRoute
|
|
1226
1244
|
}),
|
|
1227
|
-
|
|
1245
|
+
/* @__PURE__ */ jsx(FooterRegion, { version: config.version })
|
|
1228
1246
|
]
|
|
1229
1247
|
})
|
|
1230
1248
|
});
|
|
@@ -2627,6 +2645,6 @@ function ClarifyShell(props) {
|
|
|
2627
2645
|
});
|
|
2628
2646
|
}
|
|
2629
2647
|
//#endregion
|
|
2630
|
-
export { themeBootstrapScript as a, AppShell as c,
|
|
2648
|
+
export { themeBootstrapScript as a, AppShell as c, BuiltWithClarify as d, RenderErrorPanel as f, useSlot as g, SlotProvider as h, themeEditorPresets as i, PageBanner as l, RuntimeSlotsProvider as m, ThemeEditor as n, themePresets as o, RuntimeSlot as p, applyThemeVariables as r, themeStorageKey as s, ClarifyShell as t, PageFooter as u };
|
|
2631
2649
|
|
|
2632
|
-
//# sourceMappingURL=ClarifyShell-
|
|
2650
|
+
//# sourceMappingURL=ClarifyShell-Dh4TgQkW.js.map
|