@tdacorp/hyle-sdk 0.21.0 → 0.23.0
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/README.md +141 -18
- package/dist/check-routes-bin.js +174 -42
- package/dist/{chunk-56Y24XBV.js → chunk-JHZJOJDC.js} +4 -3
- package/dist/{chunk-K5VDLROQ.js → chunk-SFFBZFEN.js} +34 -1
- package/dist/{chunk-HJX57NLI.js → chunk-UFMKLCXS.js} +246 -225
- package/dist/{chunk-X2TLYM7Y.js → chunk-VUML2UPD.js} +1 -1
- package/dist/chunk-VXARM37R.js +68 -0
- package/dist/{chunk-75JFLML4.js → chunk-YHXE3TGS.js} +94 -12
- package/dist/{client-41fU6OY2.d.cts → client--ighAWaj.d.ts} +13 -1
- package/dist/{client-LwzHwqpM.d.ts → client-DK-S2580.d.cts} +13 -1
- package/dist/code-copy.cjs +4 -2
- package/dist/code-copy.d.cts +5 -2
- package/dist/code-copy.d.ts +5 -2
- package/dist/code-copy.js +5 -3
- package/dist/comments.cjs +14 -6
- package/dist/comments.js +14 -6
- package/dist/docs-enhance.cjs +7 -4
- package/dist/docs-enhance.d.cts +5 -3
- package/dist/docs-enhance.d.ts +5 -3
- package/dist/docs-enhance.js +8 -5
- package/dist/{embed-BUFRQboD.d.ts → embed-XT0x_Jaa.d.cts} +4 -2
- package/dist/{embed-CYt-q13P.d.cts → embed-g7NT1CyB.d.ts} +4 -2
- package/dist/html.cjs +14 -6
- package/dist/html.d.cts +1 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +2 -2
- package/dist/index.cjs +85 -12
- package/dist/index.d.cts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.js +2 -2
- package/dist/mermaid-diagram.cjs +46 -6
- package/dist/mermaid-diagram.js +15 -6
- package/dist/mermaid-image.cjs +4 -1
- package/dist/mermaid-image.js +1 -1
- package/dist/next.cjs +521 -242
- package/dist/next.d.cts +74 -17
- package/dist/next.d.ts +74 -17
- package/dist/next.js +207 -33
- package/dist/print-coordinator.js +1 -1
- package/dist/react.cjs +233 -197
- package/dist/react.d.cts +17 -6
- package/dist/react.d.ts +17 -6
- package/dist/react.js +5 -3
- package/dist/{resolve-BjAK0k_Y.d.ts → resolve-BqC9l5RH.d.ts} +1 -1
- package/dist/{resolve-eI1muCKL.d.cts → resolve-CiZCPysX.d.cts} +1 -1
- package/dist/{sanitize-ijiWjEm9.d.cts → sanitize-BpY_AdZh.d.cts} +1 -1
- package/dist/{sanitize-ijiWjEm9.d.ts → sanitize-BpY_AdZh.d.ts} +1 -1
- package/dist/styles.css +4 -4
- package/dist/toc-spy.cjs +2 -1
- package/dist/toc-spy.js +2 -1
- package/dist/{types-3F0wqD-o.d.cts → types-b9QbmEDd.d.cts} +44 -1
- package/dist/{types-3F0wqD-o.d.ts → types-b9QbmEDd.d.ts} +44 -1
- package/dist/use-cache.cjs +73 -3
- package/dist/use-cache.d.cts +3 -3
- package/dist/use-cache.d.ts +3 -3
- package/dist/use-cache.js +3 -3
- package/package.json +3 -3
- package/dist/chunk-67IOIAVW.js +0 -35
package/dist/react.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(react_exports, {
|
|
|
29
29
|
HyleBody: () => HyleBody,
|
|
30
30
|
HyleListView: () => HyleListView,
|
|
31
31
|
HyleReactions: () => import_reactions.HyleReactions,
|
|
32
|
+
HyleTheme: () => HyleTheme,
|
|
32
33
|
HyleToc: () => HyleToc,
|
|
33
34
|
ListPage: () => ListPage,
|
|
34
35
|
MermaidDiagram: () => import_mermaid_diagram2.MermaidDiagram,
|
|
@@ -57,12 +58,28 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
|
57
58
|
// src/asset-path.ts
|
|
58
59
|
var ASSET_ROUTE_PREFIX = "/api/hyle/assets";
|
|
59
60
|
var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
60
|
-
var EXTENSIONS = "png|jpg|gif|webp|svg|pdf|mp4|webm|mp3|ogg";
|
|
61
|
+
var EXTENSIONS = "png|jpg|gif|webp|svg|pdf|mp4|webm|mp3|ogg|woff2";
|
|
61
62
|
var ASSET_FILE = new RegExp(`^${UUID}(?:\\.(?:${EXTENSIONS}))?$`);
|
|
62
|
-
var
|
|
63
|
+
var THEME_FILE = /^theme-([0-9a-f]{16})-([0-9a-f]{64})\.css$/;
|
|
64
|
+
var THEME_FONT = new RegExp(`^/assets/${UUID}\\.woff2$`);
|
|
65
|
+
function themeStylesheetHref({ scope, hash }) {
|
|
66
|
+
const file = `theme-${scope}-${hash}.css`;
|
|
67
|
+
return THEME_FILE.test(file) ? `${ASSET_ROUTE_PREFIX}/${file}` : void 0;
|
|
68
|
+
}
|
|
69
|
+
function themeFontHrefs(preload) {
|
|
70
|
+
return preload.flatMap((src) => typeof src === "string" && THEME_FONT.test(src) ? [hostAssetSrc(src)] : []);
|
|
71
|
+
}
|
|
72
|
+
var PREVIEW_TOKEN_SOURCE = "hyle_pv_[A-Za-z0-9_-]{43}";
|
|
73
|
+
var PREVIEW_TOKEN = new RegExp(`^${PREVIEW_TOKEN_SOURCE}$`);
|
|
74
|
+
var PREVIEW_PARAM = "hyle_preview";
|
|
75
|
+
var PREVIEW_QUERY_SOURCE = `\\?${PREVIEW_PARAM}=${PREVIEW_TOKEN_SOURCE}`;
|
|
76
|
+
var PROTECTED_PARAM = "hyle_protected";
|
|
77
|
+
var PROTECTED_ID = new RegExp(`^${UUID}$`);
|
|
78
|
+
var PROTECTED_QUERY_SOURCE = `\\?${PROTECTED_PARAM}=${UUID}`;
|
|
79
|
+
var HYLE_ASSET_URL = new RegExp(`^/assets/(${UUID}(?:\\.(?:${EXTENSIONS}))?)(${PREVIEW_QUERY_SOURCE}|${PROTECTED_QUERY_SOURCE})?$`, "i");
|
|
63
80
|
function hostAssetSrc(src) {
|
|
64
|
-
const file = HYLE_ASSET_URL.exec(src)
|
|
65
|
-
return file ? `${ASSET_ROUTE_PREFIX}/${file.toLowerCase()}` : src;
|
|
81
|
+
const [, file, query = ""] = HYLE_ASSET_URL.exec(src) ?? [];
|
|
82
|
+
return file ? `${ASSET_ROUTE_PREFIX}/${file.toLowerCase()}${query}` : src;
|
|
66
83
|
}
|
|
67
84
|
function hostAssetHtml(html) {
|
|
68
85
|
return html.replace(new RegExp(`(\\ssrc=")(/assets/${UUID}(?:\\.(?:${EXTENSIONS}))?)(")`, "gi"), (_m, open, url, close) => `${open}${hostAssetSrc(url)}${close}`);
|
|
@@ -202,7 +219,7 @@ var ENTITIES = { "<": "<", "&": "&", "<": "<", ">": ">", "&"
|
|
|
202
219
|
function mermaidSource(srcDoc) {
|
|
203
220
|
return MERMAID_SRCDOC.exec(srcDoc)?.[1]?.replace(/&(?:#x3c|#x26|#x27|lt|gt|amp|quot);/gi, (e) => ENTITIES[e.toLowerCase()]);
|
|
204
221
|
}
|
|
205
|
-
var RENDER_REF =
|
|
222
|
+
var RENDER_REF = new RegExp(`^(/assets/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.svg(?:${PREVIEW_QUERY_SOURCE})?) ([1-9]\\d{0,5}) ([1-9]\\d{0,5})$`);
|
|
206
223
|
var isRenderRef = matches(RENDER_REF);
|
|
207
224
|
function diagramRender(value) {
|
|
208
225
|
const m = typeof value === "string" ? RENDER_REF.exec(value) : null;
|
|
@@ -339,7 +356,7 @@ function sanitizeHast(tree, title, description) {
|
|
|
339
356
|
const [first] = elements;
|
|
340
357
|
const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && collapse(textOf(first)) === collapse(title) ? first : void 0;
|
|
341
358
|
const lead = elements[skip ? 1 : 0];
|
|
342
|
-
const repeat = description && isObject(lead) && lead.tagName === "p" && collapse(textOf(lead))
|
|
359
|
+
const repeat = description && isObject(lead) && lead.tagName === "p" && collapse(textOf(lead)) === collapse(description) && !holdsEmbed(lead) ? lead : void 0;
|
|
343
360
|
const budget = { nodes: 0, text: 0 };
|
|
344
361
|
return { type: "root", children: raw.filter((n) => n !== skip && n !== repeat).flatMap((n) => clean(n, 0, { katex: false }, budget)) };
|
|
345
362
|
}
|
|
@@ -1166,47 +1183,62 @@ var import_print_coordinator = require("./print-coordinator.cjs");
|
|
|
1166
1183
|
// src/react/pages.tsx
|
|
1167
1184
|
var import_comments = require("./comments.cjs");
|
|
1168
1185
|
|
|
1169
|
-
// src/react/
|
|
1186
|
+
// src/react/theme.tsx
|
|
1170
1187
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1171
|
-
function
|
|
1188
|
+
function HyleTheme({ theme }) {
|
|
1189
|
+
const href = theme ? themeStylesheetHref(theme) : void 0;
|
|
1190
|
+
if (!href) return null;
|
|
1191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
1192
|
+
themeFontHrefs(Array.isArray(theme?.preload) ? theme.preload : []).map((font) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("link", { rel: "preload", as: "font", type: "font/woff2", href: font, crossOrigin: "anonymous" }, font)),
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("link", { rel: "stylesheet", href, precedence: "hyle-theme" })
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// src/react/embed.tsx
|
|
1198
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1199
|
+
function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, olderHref, theme, ...base }) {
|
|
1172
1200
|
const c = ctx(base, "en");
|
|
1173
1201
|
const { s, Link } = c;
|
|
1174
1202
|
const Row = base.slots?.["list.item"];
|
|
1175
1203
|
const Heading = `h${headingLevel}`;
|
|
1176
1204
|
const safe = items.filter((item) => item.canonical_path.startsWith("/"));
|
|
1177
|
-
if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0,
|
|
1178
|
-
return /* @__PURE__ */ (0,
|
|
1179
|
-
|
|
1180
|
-
/* @__PURE__ */ (0,
|
|
1181
|
-
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1183
|
-
|
|
1184
|
-
|
|
1205
|
+
if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle hyle-embed", "data-layout": layout, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "list.empty", slots: base.slots }) }) : null;
|
|
1206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle hyle-embed", "data-layout": layout, lang: c.locale, children: [
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleTheme, { theme }),
|
|
1208
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Heading, { className: "hyle-title", children: title }) : null,
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "hyle-items", children: safe.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
|
|
1210
|
+
item.published_at ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }) : null,
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "t", children: item.title }),
|
|
1213
|
+
item.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: item.description }) : null
|
|
1185
1214
|
] })
|
|
1186
1215
|
] }) }, item.canonical_path)) }),
|
|
1187
|
-
olderHref ? /* @__PURE__ */ (0,
|
|
1188
|
-
moreHref ? /* @__PURE__ */ (0,
|
|
1216
|
+
olderHref ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OlderNav, { href: olderHref, c }) : null,
|
|
1217
|
+
moreHref ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { className: "hyle-more", href: moreHref, children: s.viewAll }) : null
|
|
1189
1218
|
] });
|
|
1190
1219
|
}
|
|
1191
1220
|
function HyleArticleView({ article, headingLevel = 2, ...base }) {
|
|
1192
1221
|
const { publication: pub } = article;
|
|
1193
1222
|
const c = ctx(base, pub.locale);
|
|
1194
1223
|
const Heading = `h${headingLevel}`;
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle hyle-embed", children: [
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleTheme, { theme: article.theme }),
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { lang: c.locale, children: [
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "hyle-head", children: [
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Heading, { className: "hyle-title", children: pub.title }),
|
|
1229
|
+
pub.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle-meta", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) }) }) })
|
|
1231
|
+
] }),
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Body, { article, components: base.components, locale: c.locale }),
|
|
1233
|
+
pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("a", { className: "hyle-more", href: c.href(pub.canonical_path, pub.locale), rel: "bookmark", children: [
|
|
1234
|
+
c.s.readAtSource,
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "hyle-sr", children: [
|
|
1236
|
+
": ",
|
|
1237
|
+
pub.title
|
|
1238
|
+
] })
|
|
1239
|
+
] }) : null
|
|
1240
|
+
] })
|
|
1241
|
+
] });
|
|
1210
1242
|
}
|
|
1211
1243
|
|
|
1212
1244
|
// src/react/seo.ts
|
|
@@ -1312,13 +1344,16 @@ function listJsonLd({ list, origin, href, path, locale, description, jsonLd, cur
|
|
|
1312
1344
|
|
|
1313
1345
|
// src/react/pages.tsx
|
|
1314
1346
|
var import_toc_spy = require("./toc-spy.cjs");
|
|
1315
|
-
var
|
|
1347
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1316
1348
|
function Slot({ name, slots, tag: Tag = "div", className }) {
|
|
1317
1349
|
const fill = slots?.[name];
|
|
1318
|
-
return fill ? /* @__PURE__ */ (0,
|
|
1350
|
+
return fill ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
|
|
1319
1351
|
}
|
|
1320
|
-
function Shell({ children }) {
|
|
1321
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
function Shell({ children, theme }) {
|
|
1353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleTheme, { theme }),
|
|
1355
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle-page", children }) })
|
|
1356
|
+
] });
|
|
1322
1357
|
}
|
|
1323
1358
|
function ctx(p, fallbackLocale) {
|
|
1324
1359
|
const locale = p.locale ?? fallbackLocale;
|
|
@@ -1327,29 +1362,29 @@ function ctx(p, fallbackLocale) {
|
|
|
1327
1362
|
function Pager({ prev, next, c }) {
|
|
1328
1363
|
if (!prev && !next) return null;
|
|
1329
1364
|
const { Link, s } = c;
|
|
1330
|
-
return /* @__PURE__ */ (0,
|
|
1331
|
-
prev ? /* @__PURE__ */ (0,
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-pager", "aria-label": s.pager, children: [
|
|
1366
|
+
prev ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { href: c.href(prev.canonical_path), rel: "prev", children: [
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "dir", children: [
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev-left" }),
|
|
1334
1369
|
s.prev
|
|
1335
1370
|
] }),
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1337
|
-
] }) : /* @__PURE__ */ (0,
|
|
1338
|
-
next ? /* @__PURE__ */ (0,
|
|
1339
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ttl", children: prev.title })
|
|
1372
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "none", "aria-hidden": "true" }),
|
|
1373
|
+
next ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { href: c.href(next.canonical_path), rel: "next", className: "next", children: [
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "dir", children: [
|
|
1340
1375
|
s.next,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev" })
|
|
1342
1377
|
] }),
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ttl", children: next.title })
|
|
1344
1379
|
] }) : null
|
|
1345
1380
|
] });
|
|
1346
1381
|
}
|
|
1347
1382
|
function OlderNav({ href, c }) {
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-pagination", "aria-label": c.s.pager, children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sp" }),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(c.Link, { className: "hyle-btn sm", href, rel: "next", children: [
|
|
1351
1386
|
c.s.older,
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev" })
|
|
1353
1388
|
] })
|
|
1354
1389
|
] });
|
|
1355
1390
|
}
|
|
@@ -1360,9 +1395,9 @@ function TocList({ toc }) {
|
|
|
1360
1395
|
if (entry.depth === 3 && last) last.subs.push(entry);
|
|
1361
1396
|
else groups.push({ entry, subs: [] });
|
|
1362
1397
|
}
|
|
1363
|
-
return /* @__PURE__ */ (0,
|
|
1364
|
-
/* @__PURE__ */ (0,
|
|
1365
|
-
subs.length > 0 ? /* @__PURE__ */ (0,
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: groups.map(({ entry, subs }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: `#${scopeId(entry.id)}`, children: entry.text }),
|
|
1400
|
+
subs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: subs.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: `#${scopeId(sub.id)}`, children: sub.text }) }, sub.id)) }) : null
|
|
1366
1401
|
] }, entry.id)) });
|
|
1367
1402
|
}
|
|
1368
1403
|
function Toc({ toc, c, aside, spy, className }) {
|
|
@@ -1371,21 +1406,21 @@ function Toc({ toc, c, aside, spy, className }) {
|
|
|
1371
1406
|
const { s } = c;
|
|
1372
1407
|
const classes = (own) => className ? `${className} ${own}` : own;
|
|
1373
1408
|
return {
|
|
1374
|
-
narrow: entries.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1409
|
+
narrow: entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: classes("hyle-toc-m"), children: [
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "file" }),
|
|
1377
1412
|
s.toc,
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
|
|
1379
1414
|
] }),
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-toc-list", "aria-label": s.toc, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TocList, { toc: entries }) })
|
|
1381
1416
|
] }),
|
|
1382
|
-
wide: /* @__PURE__ */ (0,
|
|
1383
|
-
entries.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1417
|
+
wide: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { className: classes("hyle-toc-d"), "aria-label": s.toc, children: [
|
|
1418
|
+
entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-toc-title", children: s.toc }),
|
|
1420
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-toc-list", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TocList, { toc: entries }) })
|
|
1386
1421
|
] }),
|
|
1387
1422
|
aside,
|
|
1388
|
-
spy && entries.length > 0 ? /* @__PURE__ */ (0,
|
|
1423
|
+
spy && entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_toc_spy.TocSpy, { ids: entries.map((t) => scopeId(t.id)) }) : null
|
|
1389
1424
|
] })
|
|
1390
1425
|
};
|
|
1391
1426
|
}
|
|
@@ -1397,27 +1432,27 @@ function Body({ article, components, locale }) {
|
|
|
1397
1432
|
const { content, publication } = article;
|
|
1398
1433
|
const lang = article.fallback ? void 0 : publication.locale;
|
|
1399
1434
|
if (content.format === "hast") {
|
|
1400
|
-
return /* @__PURE__ */ (0,
|
|
1435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProseBody, { className: "hyle-body hyle-prose", lang, tree: content.tree, title: publication.title, description: publication.description, components: components ?? {}, locale });
|
|
1401
1436
|
}
|
|
1402
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle-body hyle-prose", lang, children: content.format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TrustedServerHtml, { html: content.html }) : null });
|
|
1403
1438
|
}
|
|
1404
1439
|
function Languages({ alternates, current, c }) {
|
|
1405
1440
|
if (alternates.length < 2) return null;
|
|
1406
1441
|
const { Link, s } = c;
|
|
1407
|
-
return /* @__PURE__ */ (0,
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1409
|
-
/* @__PURE__ */ (0,
|
|
1442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-langs", "aria-label": s.languages, children: [
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: s.readIn }),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: alternates.map((a) => {
|
|
1410
1445
|
const label = languageName(a.locale, a.locale);
|
|
1411
|
-
return /* @__PURE__ */ (0,
|
|
1446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: a.locale === current ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, "aria-current": "true", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, children: label }) }, a.locale);
|
|
1412
1447
|
}) })
|
|
1413
1448
|
] });
|
|
1414
1449
|
}
|
|
1415
1450
|
function LdScript({ json }) {
|
|
1416
|
-
return /* @__PURE__ */ (0,
|
|
1451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
|
|
1417
1452
|
}
|
|
1418
1453
|
function Crumbs({ items, c }) {
|
|
1419
1454
|
const { Link } = c;
|
|
1420
|
-
return /* @__PURE__ */ (0,
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-crumbs", "aria-label": c.s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ol", { children: items.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { "aria-current": i === items.length - 1 ? "page" : void 0, children: i === items.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: crumbHref(c.href, b.canonical_path, c.locale), children: b.title }) }, b.canonical_path)) }) });
|
|
1421
1456
|
}
|
|
1422
1457
|
function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }) {
|
|
1423
1458
|
const { publication: pub } = article;
|
|
@@ -1427,66 +1462,66 @@ function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth
|
|
|
1427
1462
|
const author = articleAuthor(article, jsonLd)?.name;
|
|
1428
1463
|
const modified = modifiedAt(pub);
|
|
1429
1464
|
const words = wordCountOf(pub);
|
|
1430
|
-
const toc = Toc({ toc: article.toc, c, spy: true, aside: /* @__PURE__ */ (0,
|
|
1465
|
+
const toc = Toc({ toc: article.toc, c, spy: true, aside: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.aside", slots: base.slots, className: "hyle-slot-wrap" }) });
|
|
1431
1466
|
const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
|
|
1432
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
-
/* @__PURE__ */ (0,
|
|
1434
|
-
/* @__PURE__ */ (0,
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1437
|
-
pub.description ? /* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1439
|
-
author ? /* @__PURE__ */ (0,
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { theme: article.theme, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { className: "hyle-article", "data-hyle-page": "article", lang: c.locale, children: [
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "hyle-head", children: [
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.before", slots: base.slots, className: "hyle-eyebrow" }),
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Crumbs, { items: breadcrumbItems(article, jsonLd), c }),
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "hyle-title", children: pub.title }),
|
|
1472
|
+
pub.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-meta", children: [
|
|
1474
|
+
author ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hyle-avatar", "aria-hidden": "true", children: author.slice(0, 2).toUpperCase() }),
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1477
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "hyle-sr", children: [
|
|
1443
1478
|
s.by,
|
|
1444
1479
|
" "
|
|
1445
1480
|
] }),
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "by", children: author })
|
|
1447
1482
|
] })
|
|
1448
1483
|
] }) : null,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "calendar" }),
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) })
|
|
1452
1487
|
] }),
|
|
1453
|
-
modified ? /* @__PURE__ */ (0,
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1488
|
+
modified ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "calendar" }),
|
|
1455
1490
|
s.updated,
|
|
1456
1491
|
" ",
|
|
1457
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: modified, title: modified, children: formatDate(modified, c.locale) })
|
|
1458
1493
|
] }) : null,
|
|
1459
|
-
words ? /* @__PURE__ */ (0,
|
|
1460
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
words ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "clock" }),
|
|
1461
1496
|
s.readingTime.replace("{n}", String(readingMinutes(words)))
|
|
1462
1497
|
] }) : null,
|
|
1463
|
-
/* @__PURE__ */ (0,
|
|
1464
|
-
/* @__PURE__ */ (0,
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "globe" }),
|
|
1500
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { lang: pub.locale, children: languageName(pub.locale, c.locale) })
|
|
1466
1501
|
] }),
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
|
|
1468
1503
|
] }),
|
|
1469
|
-
/* @__PURE__ */ (0,
|
|
1470
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1471
|
-
/* @__PURE__ */ (0,
|
|
1472
|
-
/* @__PURE__ */ (0,
|
|
1473
|
-
/* @__PURE__ */ (0,
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Languages, { alternates: article.alternates, current: pub.locale, c }),
|
|
1505
|
+
notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "alert" }),
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: notTranslated }),
|
|
1474
1509
|
" ",
|
|
1475
1510
|
s.fallbackBody
|
|
1476
1511
|
] })
|
|
1477
1512
|
] }) : null
|
|
1478
1513
|
] }),
|
|
1479
1514
|
toc.narrow,
|
|
1480
|
-
/* @__PURE__ */ (0,
|
|
1481
|
-
engagement ? /* @__PURE__ */ (0,
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1483
|
-
related ? /* @__PURE__ */ (0,
|
|
1484
|
-
related.items.length > 0 ? /* @__PURE__ */ (0,
|
|
1485
|
-
article.children.length > 0 ? /* @__PURE__ */ (0,
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Body, { article, components: base.components, locale: c.locale }),
|
|
1516
|
+
engagement ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_comments.Comments, { path: pub.canonical_path, endpoint: engagement.endpoint ?? "/api/hyle/engage", signInHref: engagement.signInHref, locale: c.locale, labels: s.comments }) : null,
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pager, { prev: article.prev, next: article.next, c }),
|
|
1518
|
+
related ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1519
|
+
related.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleListView, { items: related.items, title: related.title ?? s.moreInSection, ...base, locale: c.locale }) : null,
|
|
1520
|
+
article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleListView, { items: article.children.map((child) => ({ ...child, description: null, published_at: "" })), title: s.subPages, ...base, locale: c.locale }) : null
|
|
1486
1521
|
] }) : null,
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
|
|
1488
1523
|
toc.wide,
|
|
1489
|
-
jsonLdOrigin ? /* @__PURE__ */ (0,
|
|
1524
|
+
jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl, imageWidth, imageHeight }) }) : null
|
|
1490
1525
|
] }) });
|
|
1491
1526
|
}
|
|
1492
1527
|
function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }) {
|
|
@@ -1497,85 +1532,85 @@ function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor,
|
|
|
1497
1532
|
for (const item of list.items) groups.set(item.published_at.slice(0, 7), [...groups.get(item.published_at.slice(0, 7)) ?? [], item]);
|
|
1498
1533
|
const notTranslated = list.fallback ? s.fallbackTitle.replace("{language}", languageName(list.fallback.requested_locale, c.locale)) : void 0;
|
|
1499
1534
|
const jsonLdOrigin = bareOrigin(origin);
|
|
1500
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
-
/* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
description ? /* @__PURE__ */ (0,
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1506
|
-
/* @__PURE__ */ (0,
|
|
1507
|
-
/* @__PURE__ */ (0,
|
|
1508
|
-
/* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { theme: list.theme, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-listpage", "data-hyle-page": "list", lang: c.locale, children: [
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "hyle-head", children: [
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "hyle-title", children: list.section.title }),
|
|
1538
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-desc", children: description }) : null,
|
|
1539
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "list.header", slots: base.slots, className: "hyle-slot-wrap" }),
|
|
1540
|
+
notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "alert" }),
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: notTranslated }),
|
|
1509
1544
|
" ",
|
|
1510
1545
|
s.fallbackBody
|
|
1511
1546
|
] })
|
|
1512
1547
|
] }) : null
|
|
1513
1548
|
] }),
|
|
1514
|
-
list.items.length === 0 ? /* @__PURE__ */ (0,
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1516
|
-
/* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0,
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1521
|
-
/* @__PURE__ */ (0,
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1525
|
-
item.description ? /* @__PURE__ */ (0,
|
|
1549
|
+
list.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-empty", "data-slot-state": "empty", children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "file" }),
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: s.emptyTitle }),
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.emptyBody }),
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "list.empty", slots: base.slots })
|
|
1554
|
+
] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { "aria-label": formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }), children: [
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: "hyle-year", children: formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }) }),
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "hyle-items", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
|
|
1557
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
|
|
1558
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "t", children: item.title }),
|
|
1560
|
+
item.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: item.description }) : null
|
|
1526
1561
|
] })
|
|
1527
1562
|
] }) }, item.canonical_path)) })
|
|
1528
1563
|
] }, month)),
|
|
1529
|
-
olderHref ? /* @__PURE__ */ (0,
|
|
1530
|
-
jsonLdOrigin && path ? /* @__PURE__ */ (0,
|
|
1564
|
+
olderHref ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(OlderNav, { href: olderHref, c }) : null,
|
|
1565
|
+
jsonLdOrigin && path ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LdScript, { json: listJsonLd({ list, origin: jsonLdOrigin, href: c.href, path, locale: c.locale, description, jsonLd, cursor }) }) : null
|
|
1531
1566
|
] }) });
|
|
1532
1567
|
}
|
|
1533
1568
|
function NotFound({ path, homeHref = "/", ...base }) {
|
|
1534
1569
|
const c = ctx(base, "en");
|
|
1535
1570
|
const { Link, s } = c;
|
|
1536
1571
|
const body = base.slots?.["notfound.body"];
|
|
1537
|
-
return /* @__PURE__ */ (0,
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1540
|
-
body ? /* @__PURE__ */ (0,
|
|
1541
|
-
path ? /* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "not-found", lang: c.locale, children: [
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: s.nfKind }),
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: s.nfTitle }),
|
|
1575
|
+
body ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { "data-slot": "notfound.body", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.nfBody }),
|
|
1576
|
+
path ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dl", { className: "hyle-addr", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.path }),
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: path })
|
|
1544
1579
|
] }) }) : null,
|
|
1545
|
-
/* @__PURE__ */ (0,
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-actions", children: [
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { className: "hyle-btn primary", href: crumbHref(c.href, homeHref, c.locale), children: s.home }),
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "notfound.actions", slots: base.slots, tag: "span" })
|
|
1548
1583
|
] })
|
|
1549
1584
|
] }) });
|
|
1550
1585
|
}
|
|
1551
1586
|
function Unavailable(base) {
|
|
1552
1587
|
const c = ctx(base, "en");
|
|
1553
|
-
return /* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1555
|
-
/* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "unavailable", lang: c.locale, role: "status", children: [
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: c.s.unKind }),
|
|
1590
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: c.s.unTitle }),
|
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: c.s.unBody })
|
|
1557
1592
|
] }) });
|
|
1558
1593
|
}
|
|
1559
1594
|
function Redirecting({ from, to, ...base }) {
|
|
1560
1595
|
const c = ctx(base, "en");
|
|
1561
1596
|
const { Link, s } = c;
|
|
1562
1597
|
const extra = base.slots?.["redirecting.body"];
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1565
|
-
/* @__PURE__ */ (0,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1568
|
-
from ? /* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1570
|
-
/* @__PURE__ */ (0,
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "redirecting", role: "status", lang: c.locale, children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: s.rdKind }),
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: s.rdTitle }),
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.rdBody }),
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("dl", { className: "hyle-addr", children: [
|
|
1603
|
+
from ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.from }),
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: from })
|
|
1571
1606
|
] }) : null,
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1573
|
-
/* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1607
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.to }),
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: to })
|
|
1575
1610
|
] })
|
|
1576
1611
|
] }),
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
extra ? /* @__PURE__ */ (0,
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "fine", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(to), children: s.rdFallback }) }),
|
|
1613
|
+
extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
|
|
1579
1614
|
] }) });
|
|
1580
1615
|
}
|
|
1581
1616
|
|
|
@@ -1585,7 +1620,7 @@ var import_reactions = require("./reactions.cjs");
|
|
|
1585
1620
|
|
|
1586
1621
|
// src/react/docs.tsx
|
|
1587
1622
|
var import_docs_enhance = require("./docs-enhance.cjs");
|
|
1588
|
-
var
|
|
1623
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1589
1624
|
var ROOT_ID = "hyle-docs";
|
|
1590
1625
|
var NAV_ID = "hyle-docs-nav";
|
|
1591
1626
|
function navTreeOf(article) {
|
|
@@ -1609,15 +1644,15 @@ function pathTo(nodes, path) {
|
|
|
1609
1644
|
}
|
|
1610
1645
|
function Branch({ nodes, current, onPath, c }) {
|
|
1611
1646
|
const { Link } = c;
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
-
const link = /* @__PURE__ */ (0,
|
|
1614
|
-
if (node.children.length === 0) return /* @__PURE__ */ (0,
|
|
1615
|
-
return /* @__PURE__ */ (0,
|
|
1616
|
-
/* @__PURE__ */ (0,
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { children: nodes.map((node) => {
|
|
1648
|
+
const link = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
|
|
1649
|
+
if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: link }, node.canonical_path);
|
|
1650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chev" }),
|
|
1618
1653
|
link
|
|
1619
1654
|
] }),
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Branch, { nodes: node.children, current, onPath, c })
|
|
1621
1656
|
] }) }, node.canonical_path);
|
|
1622
1657
|
}) });
|
|
1623
1658
|
}
|
|
@@ -1631,47 +1666,47 @@ function DocsPage({ article, ...base }) {
|
|
|
1631
1666
|
const siteName = article.breadcrumbs[0]?.title ?? "";
|
|
1632
1667
|
const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
|
|
1633
1668
|
const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
|
|
1634
|
-
return /* @__PURE__ */ (0,
|
|
1635
|
-
/* @__PURE__ */ (0,
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Shell, { theme: article.theme, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "file" }),
|
|
1638
1673
|
s.menu,
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1640
|
-
/* @__PURE__ */ (0,
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cur", children: pub.title }),
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
|
|
1641
1676
|
] }),
|
|
1642
|
-
/* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1645
|
-
/* @__PURE__ */ (0,
|
|
1646
|
-
/* @__PURE__ */ (0,
|
|
1677
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-side-head", children: [
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: siteName }),
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "x" }) })
|
|
1647
1682
|
] }),
|
|
1648
|
-
/* @__PURE__ */ (0,
|
|
1649
|
-
/* @__PURE__ */ (0,
|
|
1650
|
-
/* @__PURE__ */ (0,
|
|
1683
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
|
|
1685
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
|
|
1651
1686
|
] }),
|
|
1652
|
-
/* @__PURE__ */ (0,
|
|
1653
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1655
|
-
/* @__PURE__ */ (0,
|
|
1656
|
-
/* @__PURE__ */ (0,
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
|
|
1688
|
+
notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "alert" }),
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: notTranslated }),
|
|
1657
1692
|
" ",
|
|
1658
1693
|
s.fallbackBody
|
|
1659
1694
|
] })
|
|
1660
1695
|
] }) : null,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1663
|
-
pub.description ? /* @__PURE__ */ (0,
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { className: "hyle-title", children: pub.title }),
|
|
1698
|
+
pub.description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "hyle-updated", children: [
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "calendar" }),
|
|
1666
1701
|
s.updated,
|
|
1667
1702
|
" ",
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
|
|
1669
1704
|
] }),
|
|
1670
1705
|
toc.narrow,
|
|
1671
|
-
/* @__PURE__ */ (0,
|
|
1672
|
-
/* @__PURE__ */ (0,
|
|
1673
|
-
/* @__PURE__ */ (0,
|
|
1674
|
-
/* @__PURE__ */ (0,
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Body, { article, components: base.components, locale: c.locale }),
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Pager, { prev: article.prev, next: article.next, c }),
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
|
|
1675
1710
|
] }),
|
|
1676
1711
|
toc.wide
|
|
1677
1712
|
] }) });
|
|
@@ -1687,6 +1722,7 @@ function DocsPage({ article, ...base }) {
|
|
|
1687
1722
|
HyleBody,
|
|
1688
1723
|
HyleListView,
|
|
1689
1724
|
HyleReactions,
|
|
1725
|
+
HyleTheme,
|
|
1690
1726
|
HyleToc,
|
|
1691
1727
|
ListPage,
|
|
1692
1728
|
MermaidDiagram,
|