@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,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
2
2
|
const require_i18n = require("./i18n-BMNCgF9o.cjs");
|
|
3
|
-
const require_PageActions = require("./PageActions-
|
|
3
|
+
const require_PageActions = require("./PageActions-DEAcLCtt.cjs");
|
|
4
4
|
let clsx = require("clsx");
|
|
5
5
|
clsx = require_rolldown_runtime.__toESM(clsx, 1);
|
|
6
6
|
let react = require("react");
|
|
@@ -153,100 +153,6 @@ function BuiltInNotFoundPage() {
|
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
|
-
//#region source/assets/clarify.svg?url
|
|
157
|
-
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";
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region source/app/BuiltWithClarify.tsx
|
|
160
|
-
var CLARIFY_TRACKING_URL = "https://api.clarify.pub/track";
|
|
161
|
-
var CLARIFY_CLIENT_ID_KEY = "clarify.client_id";
|
|
162
|
-
function getClientId() {
|
|
163
|
-
const newClientId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}.${Math.random()}`;
|
|
164
|
-
try {
|
|
165
|
-
const clientId = window.localStorage.getItem(CLARIFY_CLIENT_ID_KEY);
|
|
166
|
-
if (clientId) return clientId;
|
|
167
|
-
window.localStorage.setItem(CLARIFY_CLIENT_ID_KEY, newClientId);
|
|
168
|
-
return newClientId;
|
|
169
|
-
} catch {
|
|
170
|
-
return newClientId;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function getSiteHostname() {
|
|
174
|
-
return window.location.hostname.slice(0, 100);
|
|
175
|
-
}
|
|
176
|
-
function getPageLanguage() {
|
|
177
|
-
return (document.documentElement.lang || (typeof navigator === "undefined" ? "" : navigator.language)).slice(0, 100);
|
|
178
|
-
}
|
|
179
|
-
function getViewportCategory() {
|
|
180
|
-
if (window.innerWidth < 768) return "mobile";
|
|
181
|
-
if (window.innerWidth < 1024) return "tablet";
|
|
182
|
-
return "desktop";
|
|
183
|
-
}
|
|
184
|
-
function getTimezone() {
|
|
185
|
-
try {
|
|
186
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone.slice(0, 100);
|
|
187
|
-
} catch {
|
|
188
|
-
return "";
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function getClarifyVersion(version) {
|
|
192
|
-
return version?.slice(0, 100) ?? "";
|
|
193
|
-
}
|
|
194
|
-
function createClarifySiteViewPayload(version) {
|
|
195
|
-
return JSON.stringify({
|
|
196
|
-
client_id: getClientId(),
|
|
197
|
-
event_name: "clarify_site_view",
|
|
198
|
-
params: {
|
|
199
|
-
timezone: getTimezone(),
|
|
200
|
-
site_hostname: getSiteHostname(),
|
|
201
|
-
page_language: getPageLanguage(),
|
|
202
|
-
clarify_version: getClarifyVersion(version),
|
|
203
|
-
viewport_category: getViewportCategory()
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
function registerClarifySiteView(version) {
|
|
208
|
-
if (typeof window === "undefined") return;
|
|
209
|
-
if (typeof document === "undefined") return;
|
|
210
|
-
if (typeof navigator === "undefined" || typeof navigator.sendBeacon !== "function") return;
|
|
211
|
-
let sent = false;
|
|
212
|
-
const send = () => {
|
|
213
|
-
if (sent) return;
|
|
214
|
-
sent = true;
|
|
215
|
-
navigator.sendBeacon(CLARIFY_TRACKING_URL, createClarifySiteViewPayload(version));
|
|
216
|
-
};
|
|
217
|
-
window.addEventListener("pagehide", send);
|
|
218
|
-
return () => window.removeEventListener("pagehide", send);
|
|
219
|
-
}
|
|
220
|
-
function BuiltWithClarify(props) {
|
|
221
|
-
const { version } = props;
|
|
222
|
-
const t = require_i18n.useBuiltInText();
|
|
223
|
-
(0, react.useEffect)(() => {
|
|
224
|
-
return registerClarifySiteView(version);
|
|
225
|
-
}, [version]);
|
|
226
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
227
|
-
className: "clarify-built-with inline-flex items-center gap-1.5",
|
|
228
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
229
|
-
target: "_blank",
|
|
230
|
-
rel: "noreferrer",
|
|
231
|
-
href: "https://clarify.pub",
|
|
232
|
-
"aria-label": t("builtWith.label"),
|
|
233
|
-
className: "clarify-built-with inline-flex items-center gap-1.5 rounded-full px-2 py-1 font-medium no-underline transition",
|
|
234
|
-
children: [
|
|
235
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("builtWith.prefix") }),
|
|
236
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
237
|
-
src: clarify_default,
|
|
238
|
-
alt: "",
|
|
239
|
-
className: "clarify-built-with-logo h-3.5 w-auto flex-none object-contain"
|
|
240
|
-
}),
|
|
241
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
242
|
-
className: "clarify-built-with-brand font-semibold",
|
|
243
|
-
children: "Clarify"
|
|
244
|
-
})
|
|
245
|
-
]
|
|
246
|
-
})
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
//#endregion
|
|
250
156
|
//#region source/app/RenderErrorPanel.tsx
|
|
251
157
|
function RenderErrorPanel(props) {
|
|
252
158
|
const { title, description, eyebrowLabel = "Render error", action, metadata = [], detailsLabel, detailsHeaderAction, detailsContent, titleId = "clarify-render-error-title", refreshLabel, onRefresh } = props;
|
|
@@ -424,6 +330,181 @@ var PageErrorBoundary = class extends react.Component {
|
|
|
424
330
|
}
|
|
425
331
|
};
|
|
426
332
|
//#endregion
|
|
333
|
+
//#region source/assets/clarify.svg?url
|
|
334
|
+
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";
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region source/app/BuiltWithClarify.tsx
|
|
337
|
+
var CLARIFY_TRACKING_URL = "https://api.clarify.pub/track";
|
|
338
|
+
var CLARIFY_CLIENT_ID_KEY = "clarify.client_id";
|
|
339
|
+
function getClientId() {
|
|
340
|
+
const newClientId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}.${Math.random()}`;
|
|
341
|
+
try {
|
|
342
|
+
const clientId = window.localStorage.getItem(CLARIFY_CLIENT_ID_KEY);
|
|
343
|
+
if (clientId) return clientId;
|
|
344
|
+
window.localStorage.setItem(CLARIFY_CLIENT_ID_KEY, newClientId);
|
|
345
|
+
return newClientId;
|
|
346
|
+
} catch {
|
|
347
|
+
return newClientId;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function getSiteHostname() {
|
|
351
|
+
return window.location.hostname.slice(0, 100);
|
|
352
|
+
}
|
|
353
|
+
function getPageLanguage() {
|
|
354
|
+
return (document.documentElement.lang || (typeof navigator === "undefined" ? "" : navigator.language)).slice(0, 100);
|
|
355
|
+
}
|
|
356
|
+
function getViewportCategory() {
|
|
357
|
+
if (window.innerWidth < 768) return "mobile";
|
|
358
|
+
if (window.innerWidth < 1024) return "tablet";
|
|
359
|
+
return "desktop";
|
|
360
|
+
}
|
|
361
|
+
function getTimezone() {
|
|
362
|
+
try {
|
|
363
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone.slice(0, 100);
|
|
364
|
+
} catch {
|
|
365
|
+
return "";
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
function getClarifyVersion(version) {
|
|
369
|
+
return version?.slice(0, 100) ?? "";
|
|
370
|
+
}
|
|
371
|
+
function createClarifySiteViewPayload(version) {
|
|
372
|
+
return JSON.stringify({
|
|
373
|
+
client_id: getClientId(),
|
|
374
|
+
event_name: "clarify_site_view",
|
|
375
|
+
params: {
|
|
376
|
+
timezone: getTimezone(),
|
|
377
|
+
site_hostname: getSiteHostname(),
|
|
378
|
+
page_language: getPageLanguage(),
|
|
379
|
+
clarify_version: getClarifyVersion(version),
|
|
380
|
+
viewport_category: getViewportCategory()
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function registerClarifySiteView(version) {
|
|
385
|
+
if (typeof window === "undefined") return;
|
|
386
|
+
if (typeof document === "undefined") return;
|
|
387
|
+
if (typeof navigator === "undefined" || typeof navigator.sendBeacon !== "function") return;
|
|
388
|
+
let sent = false;
|
|
389
|
+
const send = () => {
|
|
390
|
+
if (sent) return;
|
|
391
|
+
sent = true;
|
|
392
|
+
navigator.sendBeacon(CLARIFY_TRACKING_URL, createClarifySiteViewPayload(version));
|
|
393
|
+
};
|
|
394
|
+
window.addEventListener("pagehide", send);
|
|
395
|
+
return () => window.removeEventListener("pagehide", send);
|
|
396
|
+
}
|
|
397
|
+
function BuiltWithClarify(props) {
|
|
398
|
+
const { version } = props;
|
|
399
|
+
const t = require_i18n.useBuiltInText();
|
|
400
|
+
(0, react.useEffect)(() => {
|
|
401
|
+
return registerClarifySiteView(version);
|
|
402
|
+
}, [version]);
|
|
403
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
404
|
+
className: "clarify-built-with inline-flex items-center gap-1.5",
|
|
405
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
406
|
+
target: "_blank",
|
|
407
|
+
rel: "noreferrer",
|
|
408
|
+
href: "https://clarify.pub",
|
|
409
|
+
"aria-label": t("builtWith.label"),
|
|
410
|
+
className: "clarify-built-with inline-flex items-center gap-1.5 rounded-full px-2 py-1 font-medium no-underline transition",
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("builtWith.prefix") }),
|
|
413
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
414
|
+
src: clarify_default,
|
|
415
|
+
alt: "",
|
|
416
|
+
className: "clarify-built-with-logo h-3.5 w-auto flex-none object-contain"
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
419
|
+
className: "clarify-built-with-brand font-semibold",
|
|
420
|
+
children: "Clarify"
|
|
421
|
+
})
|
|
422
|
+
]
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region source/app/PageFooter.tsx
|
|
428
|
+
function FooterLink(arg0) {
|
|
429
|
+
const { link, locale, config } = arg0;
|
|
430
|
+
const external = require_PageActions.isExternalHref(link.href);
|
|
431
|
+
const href = external ? link.href : require_PageActions.localizeHref(link.href, config, locale);
|
|
432
|
+
const className = "clarify-footer-link no-underline transition";
|
|
433
|
+
const label = require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default);
|
|
434
|
+
if (external) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
435
|
+
href,
|
|
436
|
+
target: "_blank",
|
|
437
|
+
rel: "noreferrer",
|
|
438
|
+
className,
|
|
439
|
+
children: label
|
|
440
|
+
});
|
|
441
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
|
|
442
|
+
to: href,
|
|
443
|
+
className,
|
|
444
|
+
children: label
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
function SocialLink(arg0) {
|
|
448
|
+
const { name, href } = arg0;
|
|
449
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
450
|
+
href,
|
|
451
|
+
target: "_blank",
|
|
452
|
+
rel: "noreferrer",
|
|
453
|
+
className: "clarify-footer-social capitalize no-underline transition",
|
|
454
|
+
children: name
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
function PageFooter() {
|
|
458
|
+
const config = require_i18n.useConfig();
|
|
459
|
+
const locale = require_i18n.useLocale() ?? config.locales?.default;
|
|
460
|
+
const footer = config.footer;
|
|
461
|
+
const links = footer?.links ?? [];
|
|
462
|
+
const socials = Object.entries(footer?.socials ?? {});
|
|
463
|
+
const copyright = footer?.copyright ? require_PageActions.resolveLocalizedText(footer.copyright, locale, config.locales?.default) : void 0;
|
|
464
|
+
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return null;
|
|
465
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
|
|
466
|
+
className: "clarify-page-footer w-full",
|
|
467
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
468
|
+
className: (0, clsx.default)("clarify-footer-content flex flex-col items-start gap-2.5 text-left"),
|
|
469
|
+
children: [copyright ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
470
|
+
className: "clarify-footer-copyright m-0",
|
|
471
|
+
children: copyright
|
|
472
|
+
}) : null, links.length > 0 || socials.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
473
|
+
className: "clarify-footer-links flex flex-wrap justify-start gap-x-4 gap-y-2",
|
|
474
|
+
children: [links.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FooterLink, {
|
|
475
|
+
link,
|
|
476
|
+
locale,
|
|
477
|
+
config
|
|
478
|
+
}, `${link.href}-${require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default)}`)), socials.map(([name, href]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SocialLink, {
|
|
479
|
+
name,
|
|
480
|
+
href
|
|
481
|
+
}, name))]
|
|
482
|
+
}) : null]
|
|
483
|
+
})
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region source/app/FooterRegion.tsx
|
|
488
|
+
function DefaultFooterComponent() {
|
|
489
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageFooter, {});
|
|
490
|
+
}
|
|
491
|
+
function FooterRegion(props) {
|
|
492
|
+
const { version } = props;
|
|
493
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
494
|
+
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",
|
|
495
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
496
|
+
className: "clarify-page-footer-slot min-w-0",
|
|
497
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, { name: "page.footer.before" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, {
|
|
498
|
+
name: "page.footer.replace",
|
|
499
|
+
default: DefaultFooterComponent
|
|
500
|
+
})]
|
|
501
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
502
|
+
className: "clarify-page-attribution flex justify-end sm:self-end",
|
|
503
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BuiltWithClarify, { version })
|
|
504
|
+
})]
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
//#endregion
|
|
427
508
|
//#region source/app/PageBanner.tsx
|
|
428
509
|
function bannerStorageKey(config, content) {
|
|
429
510
|
return `clarify:banner:dismissed:${config.title}:${content}`;
|
|
@@ -511,66 +592,6 @@ function PageBanner(props) {
|
|
|
511
592
|
});
|
|
512
593
|
}
|
|
513
594
|
//#endregion
|
|
514
|
-
//#region source/app/PageFooter.tsx
|
|
515
|
-
function FooterLink(arg0) {
|
|
516
|
-
const { link, locale, config } = arg0;
|
|
517
|
-
const external = require_PageActions.isExternalHref(link.href);
|
|
518
|
-
const href = external ? link.href : require_PageActions.localizeHref(link.href, config, locale);
|
|
519
|
-
const className = "clarify-footer-link no-underline transition";
|
|
520
|
-
const label = require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default);
|
|
521
|
-
if (external) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
522
|
-
href,
|
|
523
|
-
target: "_blank",
|
|
524
|
-
rel: "noreferrer",
|
|
525
|
-
className,
|
|
526
|
-
children: label
|
|
527
|
-
});
|
|
528
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
|
|
529
|
-
to: href,
|
|
530
|
-
className,
|
|
531
|
-
children: label
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
function SocialLink(arg0) {
|
|
535
|
-
const { name, href } = arg0;
|
|
536
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
537
|
-
href,
|
|
538
|
-
target: "_blank",
|
|
539
|
-
rel: "noreferrer",
|
|
540
|
-
className: "clarify-footer-social capitalize no-underline transition",
|
|
541
|
-
children: name
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
function PageFooter() {
|
|
545
|
-
const config = require_i18n.useConfig();
|
|
546
|
-
const locale = require_i18n.useLocale() ?? config.locales?.default;
|
|
547
|
-
const footer = config.footer;
|
|
548
|
-
const links = footer?.links ?? [];
|
|
549
|
-
const socials = Object.entries(footer?.socials ?? {});
|
|
550
|
-
const copyright = footer?.copyright ? require_PageActions.resolveLocalizedText(footer.copyright, locale, config.locales?.default) : void 0;
|
|
551
|
-
if (!Boolean(copyright || links.length > 0 || socials.length > 0)) return null;
|
|
552
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
|
|
553
|
-
className: "clarify-page-footer w-full",
|
|
554
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
555
|
-
className: (0, clsx.default)("clarify-footer-content flex flex-col items-start gap-2.5 text-left"),
|
|
556
|
-
children: [copyright ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
557
|
-
className: "clarify-footer-copyright m-0",
|
|
558
|
-
children: copyright
|
|
559
|
-
}) : null, links.length > 0 || socials.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
560
|
-
className: "clarify-footer-links flex flex-wrap justify-start gap-x-4 gap-y-2",
|
|
561
|
-
children: [links.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FooterLink, {
|
|
562
|
-
link,
|
|
563
|
-
locale,
|
|
564
|
-
config
|
|
565
|
-
}, `${link.href}-${require_PageActions.resolveLocalizedText(link.label, locale, config.locales?.default)}`)), socials.map(([name, href]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SocialLink, {
|
|
566
|
-
name,
|
|
567
|
-
href
|
|
568
|
-
}, name))]
|
|
569
|
-
}) : null]
|
|
570
|
-
})
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
//#endregion
|
|
574
595
|
//#region source/app/PageNavigation.tsx
|
|
575
596
|
function flattenNavigation(nodes) {
|
|
576
597
|
return nodes.flatMap((node) => node.children?.length ? flattenNavigation(node.children) : [node]);
|
|
@@ -812,9 +833,6 @@ function BannerSlot(props) {
|
|
|
812
833
|
default: DefaultBannerComponent
|
|
813
834
|
});
|
|
814
835
|
}
|
|
815
|
-
function DefaultFooterComponent() {
|
|
816
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageFooter, {});
|
|
817
|
-
}
|
|
818
836
|
function routeForPath(routes, pathname) {
|
|
819
837
|
return routes.find((route) => require_PageActions.isSameRoutePath(route.path, pathname));
|
|
820
838
|
}
|
|
@@ -909,6 +927,16 @@ function isDefaultLocale(config, locale) {
|
|
|
909
927
|
function hasPath(nodes, pathname, locale) {
|
|
910
928
|
return nodes.some((node) => require_PageActions.isSameRoutePath(node.path, pathname, locale) || hasPath(node.children ?? [], pathname, locale));
|
|
911
929
|
}
|
|
930
|
+
function visibleNavigation(nodes, pathname, locale) {
|
|
931
|
+
return nodes.flatMap((node) => {
|
|
932
|
+
if (node.visible === "never") return [];
|
|
933
|
+
if (node.visible === "active" && !hasPath([node], pathname, locale)) return [];
|
|
934
|
+
return [{
|
|
935
|
+
...node,
|
|
936
|
+
children: node.visible === "active" ? node.children : visibleNavigation(node.children ?? [], pathname, locale)
|
|
937
|
+
}];
|
|
938
|
+
});
|
|
939
|
+
}
|
|
912
940
|
function layoutForNavigation(nodes, pathname, inherited) {
|
|
913
941
|
for (const node of nodes) {
|
|
914
942
|
const layout = node.layout ?? inherited;
|
|
@@ -921,16 +949,21 @@ function resolvePageLayout(route, navigation, pathname) {
|
|
|
921
949
|
return route?.layout ?? layoutForNavigation(navigation, pathname) ?? "documentation";
|
|
922
950
|
}
|
|
923
951
|
function navigationFromTabs(tabs, pathname, locale) {
|
|
952
|
+
const currentTab = tabs.find((tab) => require_PageActions.isSameRoutePath(tab.path, pathname, locale) || hasPath(tab.children, pathname, locale));
|
|
953
|
+
const visibleTabs = tabs.map((tab) => ({
|
|
954
|
+
...tab,
|
|
955
|
+
children: visibleNavigation(tab.children, pathname, locale)
|
|
956
|
+
})).filter((tab) => tab.children.length > 0);
|
|
924
957
|
return {
|
|
925
|
-
items:
|
|
926
|
-
tabs
|
|
958
|
+
items: (currentTab && visibleTabs.find((tab) => tab === currentTab || tab.path === currentTab.path))?.children ?? visibleTabs[0]?.children ?? [],
|
|
959
|
+
tabs: visibleTabs
|
|
927
960
|
};
|
|
928
961
|
}
|
|
929
962
|
function navigationForLocale(navigation, locale, pathname) {
|
|
930
963
|
switch (navigation.kind) {
|
|
931
|
-
case "flat": return { items: navigation.nodes };
|
|
964
|
+
case "flat": return { items: visibleNavigation(navigation.nodes, pathname, locale) };
|
|
932
965
|
case "tabbed": return navigationFromTabs(navigation.tabs, pathname, locale);
|
|
933
|
-
case "localized": return { items: locale ? navigation.locales[locale] ?? [] : [] };
|
|
966
|
+
case "localized": return { items: locale ? visibleNavigation(navigation.locales[locale] ?? [], pathname, locale) : [] };
|
|
934
967
|
case "localized-tabbed": return locale && navigation.locales[locale] ? navigationFromTabs(navigation.locales[locale].tabs, pathname, locale) : { items: [] };
|
|
935
968
|
}
|
|
936
969
|
}
|
|
@@ -1195,21 +1228,6 @@ function AppShell(arg0) {
|
|
|
1195
1228
|
}, pathname)
|
|
1196
1229
|
});
|
|
1197
1230
|
}
|
|
1198
|
-
function renderFooter() {
|
|
1199
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1200
|
-
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",
|
|
1201
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1202
|
-
className: "clarify-page-footer-slot min-w-0",
|
|
1203
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, { name: "page.footer.before" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuntimeSlot, {
|
|
1204
|
-
name: "page.footer.replace",
|
|
1205
|
-
default: DefaultFooterComponent
|
|
1206
|
-
})]
|
|
1207
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1208
|
-
className: "clarify-page-attribution flex justify-end sm:self-end",
|
|
1209
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BuiltWithClarify, { version: config.version })
|
|
1210
|
-
})]
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
1231
|
function renderContent() {
|
|
1214
1232
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1215
1233
|
className: (0, clsx.default)("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"),
|
|
@@ -1226,7 +1244,7 @@ function AppShell(arg0) {
|
|
|
1226
1244
|
navigation: currentNavigation.items,
|
|
1227
1245
|
currentRoute
|
|
1228
1246
|
}),
|
|
1229
|
-
|
|
1247
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FooterRegion, { version: config.version })
|
|
1230
1248
|
]
|
|
1231
1249
|
})
|
|
1232
1250
|
});
|
|
@@ -2726,4 +2744,4 @@ Object.defineProperty(exports, "useSlot", {
|
|
|
2726
2744
|
}
|
|
2727
2745
|
});
|
|
2728
2746
|
|
|
2729
|
-
//# sourceMappingURL=ClarifyShell-
|
|
2747
|
+
//# sourceMappingURL=ClarifyShell-Cv4GYuCM.cjs.map
|