@tdacorp/hyle-sdk 0.14.1 → 0.21.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.
Files changed (86) hide show
  1. package/README.md +171 -32
  2. package/dist/check-routes-bin.js +48 -21
  3. package/dist/chunk-56Y24XBV.js +840 -0
  4. package/dist/{chunk-MGSUQBDW.js → chunk-75JFLML4.js} +176 -14
  5. package/dist/chunk-HJX57NLI.js +1105 -0
  6. package/dist/chunk-K5VDLROQ.js +145 -0
  7. package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
  8. package/dist/chunk-U74B7AUG.js +398 -0
  9. package/dist/{chunk-6VOHFFA5.js → chunk-X2TLYM7Y.js} +2 -2
  10. package/dist/client-41fU6OY2.d.cts +201 -0
  11. package/dist/client-LwzHwqpM.d.ts +201 -0
  12. package/dist/code-copy.cjs +72 -0
  13. package/dist/code-copy.d.cts +15 -0
  14. package/dist/code-copy.d.ts +15 -0
  15. package/dist/code-copy.js +48 -0
  16. package/dist/comments.cjs +733 -278
  17. package/dist/comments.d.cts +66 -3
  18. package/dist/comments.d.ts +66 -3
  19. package/dist/comments.js +414 -330
  20. package/dist/{diagram-viewer-DYX6R63Y.js → diagram-viewer-XY3CG75U.js} +107 -46
  21. package/dist/{embed-B76zRRPa.d.cts → embed-BUFRQboD.d.ts} +10 -5
  22. package/dist/{embed-SqOBGI-E.d.ts → embed-CYt-q13P.d.cts} +10 -5
  23. package/dist/fragment-alias.cjs +51 -0
  24. package/dist/fragment-alias.d.cts +7 -0
  25. package/dist/fragment-alias.d.ts +7 -0
  26. package/dist/fragment-alias.js +27 -0
  27. package/dist/html.cjs +881 -0
  28. package/dist/html.d.cts +20 -0
  29. package/dist/html.d.ts +20 -0
  30. package/dist/html.js +45 -0
  31. package/dist/index.cjs +181 -14
  32. package/dist/index.d.cts +14 -62
  33. package/dist/index.d.ts +14 -62
  34. package/dist/index.js +11 -1
  35. package/dist/labels-CrA-iqTN.d.cts +46 -0
  36. package/dist/labels-CrA-iqTN.d.ts +46 -0
  37. package/dist/mermaid-diagram.cjs +453 -148
  38. package/dist/mermaid-diagram.d.cts +25 -42
  39. package/dist/mermaid-diagram.d.ts +25 -42
  40. package/dist/mermaid-diagram.js +205 -50
  41. package/dist/mermaid-image.cjs +1456 -0
  42. package/dist/mermaid-image.d.cts +30 -0
  43. package/dist/mermaid-image.d.ts +30 -0
  44. package/dist/mermaid-image.js +93 -0
  45. package/dist/next.cjs +1709 -1134
  46. package/dist/next.d.cts +67 -14
  47. package/dist/next.d.ts +67 -14
  48. package/dist/next.js +950 -794
  49. package/dist/print-coordinator.cjs +157 -0
  50. package/dist/print-coordinator.d.cts +27 -0
  51. package/dist/print-coordinator.d.ts +27 -0
  52. package/dist/print-coordinator.js +83 -0
  53. package/dist/react.cjs +677 -264
  54. package/dist/react.d.cts +161 -31
  55. package/dist/react.d.ts +161 -31
  56. package/dist/react.js +23 -3
  57. package/dist/reactions.cjs +653 -0
  58. package/dist/reactions.d.cts +27 -0
  59. package/dist/reactions.d.ts +27 -0
  60. package/dist/reactions.js +364 -0
  61. package/dist/{resolve-DC2ccfwA.d.ts → resolve-BjAK0k_Y.d.ts} +2 -2
  62. package/dist/{resolve-DKLVftk_.d.cts → resolve-eI1muCKL.d.cts} +2 -2
  63. package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
  64. package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
  65. package/dist/sanitize-ijiWjEm9.d.cts +23 -0
  66. package/dist/sanitize-ijiWjEm9.d.ts +23 -0
  67. package/dist/styles.css +107 -47
  68. package/dist/toc-spy.cjs +59 -0
  69. package/dist/toc-spy.d.cts +15 -0
  70. package/dist/toc-spy.d.ts +15 -0
  71. package/dist/toc-spy.js +35 -0
  72. package/dist/{types-ByodIyEv.d.cts → types-3F0wqD-o.d.cts} +44 -4
  73. package/dist/{types-ByodIyEv.d.ts → types-3F0wqD-o.d.ts} +44 -4
  74. package/dist/use-cache.cjs +37 -11
  75. package/dist/use-cache.d.cts +12 -5
  76. package/dist/use-cache.d.ts +12 -5
  77. package/dist/use-cache.js +7 -7
  78. package/dist/youtube-facade.cjs +50 -0
  79. package/dist/youtube-facade.d.cts +17 -0
  80. package/dist/youtube-facade.d.ts +17 -0
  81. package/dist/youtube-facade.js +26 -0
  82. package/package.json +16 -3
  83. package/dist/chunk-4V4VKB3O.js +0 -1471
  84. package/dist/chunk-R5EMI4HQ.js +0 -61
  85. package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
  86. package/dist/revalidation-callback-D7Ms_Puz.d.ts +0 -42
package/dist/react.cjs CHANGED
@@ -26,17 +26,26 @@ __export(react_exports, {
26
26
  HastContent: () => HastContent,
27
27
  HastLimitError: () => HastLimitError,
28
28
  HyleArticleView: () => HyleArticleView,
29
+ HyleBody: () => HyleBody,
29
30
  HyleListView: () => HyleListView,
31
+ HyleReactions: () => import_reactions.HyleReactions,
32
+ HyleToc: () => HyleToc,
30
33
  ListPage: () => ListPage,
31
34
  MermaidDiagram: () => import_mermaid_diagram2.MermaidDiagram,
32
35
  NotFound: () => NotFound,
33
36
  Redirecting: () => Redirecting,
34
37
  TrustedServerHtml: () => TrustedServerHtml,
35
38
  Unavailable: () => Unavailable,
39
+ VIEWER_LABELS_EN: () => VIEWER_LABELS_EN,
40
+ holdPrintUntil: () => import_print_coordinator.holdPrintUntil,
41
+ installPrintShortcut: () => import_print_coordinator.installPrintShortcut,
42
+ isClampedSource: () => isClampedSource,
43
+ isLargeDiagram: () => isLargeDiagram,
36
44
  isSafeUrl: () => isSafeUrl,
37
45
  sanitizeHast: () => sanitizeHast,
38
46
  scopeId: () => scopeId,
39
- stringsFor: () => stringsFor
47
+ stringsFor: () => stringsFor,
48
+ stripMermaidConfig: () => stripMermaidConfig
40
49
  });
41
50
  module.exports = __toCommonJS(react_exports);
42
51
 
@@ -88,9 +97,16 @@ var SHAPES = {
88
97
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 1.8v3h3" })
89
98
  ] }),
90
99
  chev: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 3.5 4.5 4.5L6 12.5" }),
100
+ "chev-up": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 10 4.5-4.5L12.5 10" }),
91
101
  "chev-down": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 6 4.5 4.5L12.5 6" }),
92
102
  "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" }),
93
103
  x: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m4 4 8 8M12 4l-8 8" }),
104
+ important: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 2.5h10a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H8l-3.5 2.8v-2.8H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM8 5v2.8M8 9.5v.1" }),
105
+ copy: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "5.5", y: "5.5", width: "8", height: "8", rx: "1.3" }),
107
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2" })
108
+ ] }),
109
+ check: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3 8.5 3.2 3L13 4.5" }),
94
110
  heart: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 13.5S2.2 10 2.2 6.1A3 3 0 0 1 8 5a3 3 0 0 1 5.8 1.1C13.8 10 8 13.5 8 13.5z" }),
95
111
  reply: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6.5 3.5 2.5 7.5l4 4M2.5 7.5h6a5 5 0 0 1 5 5" }),
96
112
  clock: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
@@ -109,9 +125,7 @@ function Icon({ name, className }) {
109
125
 
110
126
  // src/react/content.tsx
111
127
  var import_mermaid_diagram = require("./mermaid-diagram.cjs");
112
-
113
- // src/react/mermaid-config.ts
114
- var MAX_MERMAID_SOURCE = 2e4;
128
+ var import_mermaid_image = require("./mermaid-image.cjs");
115
129
 
116
130
  // src/react/sanitize.ts
117
131
  var HastLimitError = class extends Error {
@@ -123,7 +137,7 @@ var HastLimitError = class extends Error {
123
137
  var MAX_NODES = 2e4;
124
138
  var MAX_TEXT = 512 * 1024;
125
139
  var MAX_DEPTH = 128;
126
- var MAX_SRCDOC = 64 * 1024;
140
+ var MAX_SRCDOC = 1024 * 1024;
127
141
  var DROP = /* @__PURE__ */ new Set(["script", "style", "template", "noscript"]);
128
142
  var VOID = /* @__PURE__ */ new Set(["br", "hr", "img", "input", "path"]);
129
143
  var isString = (v) => typeof v === "string";
@@ -131,8 +145,15 @@ var isScalar = (v) => typeof v === "string" || typeof v === "number" || typeof v
131
145
  var matches = (re) => (v) => typeof v === "string" && re.test(v);
132
146
  var ID_PREFIX = "user-content-";
133
147
  var scopeId = (id) => id.startsWith(ID_PREFIX) ? id : ID_PREFIX + id;
134
- var ID_BODY = /^[\p{L}\p{N}_:.-]{1,180}$/u;
135
- var isIdValue = (v) => typeof v === "string" && ID_BODY.test(v.startsWith(ID_PREFIX) ? v.slice(ID_PREFIX.length) : v);
148
+ var ID_BODY = /^[\p{L}\p{M}\p{N}\p{Pc}:.-]{1,180}$/u;
149
+ function isIdValue(v) {
150
+ if (typeof v !== "string") return false;
151
+ try {
152
+ return ID_BODY.test(decodeURIComponent(v.startsWith(ID_PREFIX) ? v.slice(ID_PREFIX.length) : v));
153
+ } catch {
154
+ return false;
155
+ }
156
+ }
136
157
  var CLASS_TOKEN = /^[A-Za-z_][\w:-]*$/;
137
158
  var classTokens = (v) => {
138
159
  const tokens = Array.isArray(v) ? v : typeof v === "string" ? v.split(/\s+/) : [];
@@ -140,10 +161,12 @@ var classTokens = (v) => {
140
161
  };
141
162
  var isClass = (v) => classTokens(v) !== void 0;
142
163
  var isAlign = matches(/^(left|right|center)$/);
164
+ var isPixels = (v) => typeof v === "number" ? Number.isInteger(v) && v > 0 : typeof v === "string" && /^[1-9]\d*$/.test(v);
143
165
  var isLength = matches(/^[\d.]+(em|px|%)?$/);
144
166
  var STYLE_PROPS = /* @__PURE__ */ new Set(["height", "vertical-align", "margin-left", "margin-right", "margin-top", "margin-bottom", "top", "width", "min-width", "border-bottom-width", "padding-left"]);
145
167
  var STYLE_LENGTH = /^(-?\d+(?:\.\d+)?)(em|px|%)?$/;
146
168
  var MAX_STYLE_MAGNITUDE = 100;
169
+ var MAX_MARGIN_MAGNITUDE = 20;
147
170
  function isKatexStyle(v, ctx2) {
148
171
  if (typeof v !== "string" || !ctx2.katex) return false;
149
172
  return v.split(";").filter((d) => d !== "").every((decl) => {
@@ -151,7 +174,8 @@ function isKatexStyle(v, ctx2) {
151
174
  if (extra.length > 0 || prop === void 0 || value === void 0) return false;
152
175
  if (prop === "position") return value === "relative";
153
176
  const m = STYLE_LENGTH.exec(value);
154
- return STYLE_PROPS.has(prop) && m !== null && Math.abs(Number(m[1])) <= MAX_STYLE_MAGNITUDE;
177
+ const max = prop.startsWith("margin-") ? MAX_MARGIN_MAGNITUDE : MAX_STYLE_MAGNITUDE;
178
+ return STYLE_PROPS.has(prop) && m !== null && Math.abs(Number(m[1])) <= max;
155
179
  });
156
180
  }
157
181
  function isSafeUrl(value, kind) {
@@ -176,10 +200,16 @@ var MERMAID_SRCDOC = new RegExp(
176
200
  var isMermaidSrcdoc = (v) => typeof v === "string" && v.length <= MAX_SRCDOC && MERMAID_SRCDOC.test(v);
177
201
  var ENTITIES = { "&#x3c;": "<", "&#x26;": "&", "&lt;": "<", "&gt;": ">", "&amp;": "&", "&quot;": '"', "&#x27;": "'" };
178
202
  function mermaidSource(srcDoc) {
179
- const text = MERMAID_SRCDOC.exec(srcDoc)?.[1]?.replace(/&(?:#x3c|#x26|#x27|lt|gt|amp|quot);/gi, (e) => ENTITIES[e.toLowerCase()]);
180
- return text === void 0 || text.length > MAX_MERMAID_SOURCE ? void 0 : text;
203
+ return MERMAID_SRCDOC.exec(srcDoc)?.[1]?.replace(/&(?:#x3c|#x26|#x27|lt|gt|amp|quot);/gi, (e) => ENTITIES[e.toLowerCase()]);
181
204
  }
182
- var MERMAID_FRAME_CSP = `default-src 'none'; script-src ${MERMAID_SCRIPT_URL} 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:`;
205
+ var RENDER_REF = /^(\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.svg) ([1-9]\d{0,5}) ([1-9]\d{0,5})$/;
206
+ var isRenderRef = matches(RENDER_REF);
207
+ function diagramRender(value) {
208
+ const m = typeof value === "string" ? RENDER_REF.exec(value) : null;
209
+ return m ? { src: hostAssetSrc(m[1]), width: Number(m[2]), height: Number(m[3]) } : void 0;
210
+ }
211
+ var YOUTUBE_WATCH = /^https:\/\/www\.youtube\.com\/watch\?v=([A-Za-z0-9_-]{11})$/;
212
+ var youtubeId = (href) => typeof href === "string" ? YOUTUBE_WATCH.exec(href)?.[1] : void 0;
183
213
  var heading = { id: isIdValue, className: isClass };
184
214
  var ATTRS = new Map(
185
215
  Object.entries({
@@ -195,6 +225,7 @@ var ATTRS = new Map(
195
225
  tbody: {},
196
226
  tr: {},
197
227
  ol: {},
228
+ kbd: {},
198
229
  ul: { className: isClass },
199
230
  li: { id: isIdValue, className: isClass },
200
231
  h1: heading,
@@ -203,8 +234,8 @@ var ATTRS = new Map(
203
234
  h4: heading,
204
235
  h5: heading,
205
236
  h6: heading,
206
- a: { href: isHref, id: isIdValue, ariaDescribedBy: isIdValue, ariaLabel: isString, dataFootnoteRef: isScalar, dataFootnoteBackref: isScalar, className: isClass },
207
- img: { src: isSrc, alt: isString },
237
+ a: { href: isHref, id: isIdValue, ariaDescribedBy: isIdValue, ariaLabel: isString, dataFootnoteRef: isScalar, dataFootnoteBackref: isScalar, dataEmbed: matches(/^youtube$/), className: isClass },
238
+ img: { src: isSrc, alt: isString, title: isString, width: isPixels, height: isPixels },
208
239
  table: {},
209
240
  th: { scope: matches(/^(row|col|rowgroup|colgroup)$/), align: isAlign },
210
241
  td: { align: isAlign },
@@ -218,7 +249,7 @@ var ATTRS = new Map(
218
249
  video: { src: isSrc, controls: isScalar },
219
250
  audio: { src: isSrc, controls: isScalar },
220
251
  // hyle's sandboxed Mermaid frame (ADR 0001). The renderer emits `sandbox` as ["allow-scripts"]; it is normalized below.
221
- iframe: { sandbox: (v) => v === "allow-scripts" || Array.isArray(v) && v.length === 1 && v[0] === "allow-scripts", srcdoc: isMermaidSrcdoc }
252
+ iframe: { sandbox: (v) => v === "allow-scripts" || Array.isArray(v) && v.length === 1 && v[0] === "allow-scripts", srcdoc: isMermaidSrcdoc, dataLight: isRenderRef, dataDark: isRenderRef }
222
253
  })
223
254
  );
224
255
  var isObject = (v) => typeof v === "object" && v !== null;
@@ -227,8 +258,10 @@ function textOf(node, depth = 0) {
227
258
  if (node.type === "text") return typeof node.value === "string" ? node.value : "";
228
259
  return Array.isArray(node.children) ? node.children.map((c) => textOf(c, depth + 1)).join("") : "";
229
260
  }
261
+ var holdsEmbed = (node, depth = 0) => isObject(node) && depth <= MAX_DEPTH && (isObject(node.properties) && "dataEmbed" in node.properties || Array.isArray(node.children) && node.children.some((c) => holdsEmbed(c, depth + 1)));
262
+ var collapse = (text) => text.replace(/\s+/g, " ").trim();
230
263
  var CALLOUT_MARKER = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i;
231
- var CALLOUT_KIND = { note: "note", tip: "tip", important: "warning", warning: "warning", caution: "caution" };
264
+ var CALLOUT_KIND = { note: "note", tip: "tip", important: "important", warning: "warning", caution: "caution" };
232
265
  function toCallout(children) {
233
266
  const first = children.find((c) => c.type === "element");
234
267
  const lead = first?.tagName === "p" ? first.children[0] : void 0;
@@ -240,6 +273,21 @@ function toCallout(children) {
240
273
  const kind = CALLOUT_KIND[(marker[1] ?? "note").toLowerCase()] ?? "note";
241
274
  return { type: "element", tagName: "callout", properties: { kind }, children: [...body, ...children.slice(children.indexOf(first) + 1)] };
242
275
  }
276
+ var isBlank = (node) => node.type === "text" && node.value.trim() === "";
277
+ function soleElement(children) {
278
+ const [only, ...more] = children.filter((c) => !isBlank(c));
279
+ return more.length === 0 && only?.type === "element" ? only : void 0;
280
+ }
281
+ function toFigure(children) {
282
+ const only = soleElement(children);
283
+ const img = only?.tagName === "a" ? soleElement(only.children) : only;
284
+ if (!only || img?.tagName !== "img" || typeof img.properties.src !== "string") return void 0;
285
+ const { title, ...properties } = img.properties;
286
+ const bare = { ...img, properties };
287
+ const media = only === img ? bare : { ...only, children: [bare] };
288
+ const caption = typeof title === "string" && title.trim() ? [{ type: "element", tagName: "figcaption", properties: {}, children: [{ type: "text", value: title }] }] : [];
289
+ return { type: "element", tagName: "figure", properties: { dataSlotComponent: "Image" }, children: [media, ...caption] };
290
+ }
243
291
  function clean(node, depth, ctx2, budget) {
244
292
  if (!isObject(node) || depth > MAX_DEPTH) return [];
245
293
  if (++budget.nodes > MAX_NODES) throw new HastLimitError("content has too many nodes");
@@ -273,6 +321,11 @@ function clean(node, depth, ctx2, budget) {
273
321
  }
274
322
  for (const key of ["id", "ariaDescribedBy"]) if (typeof properties[key] === "string") properties[key] = scopeId(properties[key]);
275
323
  if (tag === "a" && typeof properties.href === "string" && properties.href.trim().startsWith("#")) properties.href = `#${scopeId(properties.href.trim().slice(1))}`;
324
+ if (tag === "a" && properties.dataEmbed !== void 0 && youtubeId(properties.href) === void 0) delete properties.dataEmbed;
325
+ if (tag === "p") {
326
+ const figure = toFigure(children);
327
+ if (figure) return [figure];
328
+ }
276
329
  if (tag === "blockquote") {
277
330
  const callout = toCallout(children);
278
331
  if (callout) return [callout];
@@ -284,9 +337,9 @@ function sanitizeHast(tree, title, description) {
284
337
  const raw = isObject(tree) && tree.type === "root" && Array.isArray(tree.children) ? tree.children : [];
285
338
  const elements = raw.filter((n) => isObject(n) && n.type === "element");
286
339
  const [first] = elements;
287
- const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && textOf(first).trim() === title.trim() ? first : void 0;
340
+ const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && collapse(textOf(first)) === collapse(title) ? first : void 0;
288
341
  const lead = elements[skip ? 1 : 0];
289
- const repeat = description && isObject(lead) && lead.tagName === "p" && textOf(lead).trim().startsWith(description.trim()) ? lead : void 0;
342
+ const repeat = description && isObject(lead) && lead.tagName === "p" && collapse(textOf(lead)).startsWith(collapse(description)) && !holdsEmbed(lead) ? lead : void 0;
290
343
  const budget = { nodes: 0, text: 0 };
291
344
  return { type: "root", children: raw.filter((n) => n !== skip && n !== repeat).flatMap((n) => clean(n, 0, { katex: false }, budget)) };
292
345
  }
@@ -325,6 +378,7 @@ var COMMENT_LABELS_EN = {
325
378
  removed: "This comment was removed.",
326
379
  removedByModerator: "This comment was removed by a moderator.",
327
380
  removedByAuthor: "This comment was deleted by its author.",
381
+ unrenderable: "This comment cannot be displayed.",
328
382
  depthEnd: "Replies end at this depth",
329
383
  held: "Awaiting approval.",
330
384
  heldBanner: "Thanks, your comment is awaiting approval",
@@ -351,8 +405,39 @@ var COMMENT_LABELS_EN = {
351
405
  bannedBody: "Commenting is not available for your account on this site. You can still read every comment. If you think this is a mistake, contact the site team.",
352
406
  expired: "Your session ended. Sign in again to post. Your text is kept.",
353
407
  more: "Load more comments",
354
- truncated: "Showing the first 500 comments.",
355
- justNow: "just now"
408
+ truncated: "Only the first part of this discussion is shown.",
409
+ justNow: "just now",
410
+ react: "React",
411
+ reactions: "Reactions",
412
+ reactionLike: "Like",
413
+ reactionLove: "Love",
414
+ reactionInsightful: "Insightful",
415
+ reactionCelebrate: "Celebrate",
416
+ reactionSignIn: "Sign in to react, ",
417
+ reactionAddedLive: "{kind} reaction added",
418
+ reactionRemovedLive: "{kind} reaction removed",
419
+ reactionsLoading: "Loading reactions",
420
+ reactionsError: "Reactions could not be loaded",
421
+ votesOn: "Votes on the comment by {name}",
422
+ score: "Score {n}",
423
+ upvote: "Upvote",
424
+ downvote: "Downvote",
425
+ upvoteSignIn: "Sign in to upvote",
426
+ downvoteSignIn: "Sign in to downvote",
427
+ upvotedLive: "Upvoted. Score {n}",
428
+ downvotedLive: "Downvoted. Score {n}",
429
+ voteRemovedLive: "Vote removed. Score {n}",
430
+ voteRefused: "That vote was not accepted. You cannot vote on your own comment.",
431
+ slowDown: "Too many actions in a short time. Wait a moment and try again.",
432
+ sort: "Sort comments",
433
+ sortNewest: "Newest",
434
+ sortTop: "Top",
435
+ sortedNewestLive: "Showing newest comments first",
436
+ sortedTopLive: "Showing top comments first",
437
+ sortError: "The comments could not be sorted. Please try again.",
438
+ newerLater: "Newer comments appear after you load more.",
439
+ moreError: "More comments could not be loaded. Please try again.",
440
+ loadedLive: "{n} comments loaded"
356
441
  };
357
442
  var COMMENT_LABELS_FR = {
358
443
  heading: "Commentaires",
@@ -387,6 +472,7 @@ var COMMENT_LABELS_FR = {
387
472
  removed: "Ce commentaire a \xE9t\xE9 retir\xE9.",
388
473
  removedByModerator: "Ce commentaire a \xE9t\xE9 retir\xE9 par un mod\xE9rateur.",
389
474
  removedByAuthor: "Ce commentaire a \xE9t\xE9 supprim\xE9 par son auteur.",
475
+ unrenderable: "Ce commentaire ne peut pas \xEAtre affich\xE9.",
390
476
  depthEnd: "Les r\xE9ponses s'arr\xEAtent \xE0 ce niveau",
391
477
  held: "En attente d'approbation.",
392
478
  heldBanner: "Merci, votre commentaire est en attente d'approbation",
@@ -413,8 +499,39 @@ var COMMENT_LABELS_FR = {
413
499
  bannedBody: "Les commentaires ne sont pas disponibles pour votre compte sur ce site. Vous pouvez toujours tout lire. Si vous pensez \xE0 une erreur, contactez l'\xE9quipe du site.",
414
500
  expired: "Votre session a expir\xE9. Reconnectez-vous pour publier. Votre texte est conserv\xE9.",
415
501
  more: "Charger plus de commentaires",
416
- truncated: "Affichage des 500 premiers commentaires.",
417
- justNow: "\xE0 l'instant"
502
+ truncated: "Seul le d\xE9but de cette discussion est affich\xE9.",
503
+ justNow: "\xE0 l'instant",
504
+ react: "R\xE9agir",
505
+ reactions: "R\xE9actions",
506
+ reactionLike: "J'aime",
507
+ reactionLove: "J'adore",
508
+ reactionInsightful: "Instructif",
509
+ reactionCelebrate: "Bravo",
510
+ reactionSignIn: "Connectez-vous pour r\xE9agir, ",
511
+ reactionAddedLive: "R\xE9action {kind} ajout\xE9e",
512
+ reactionRemovedLive: "R\xE9action {kind} retir\xE9e",
513
+ reactionsLoading: "Chargement des r\xE9actions",
514
+ reactionsError: "Les r\xE9actions n'ont pas pu \xEAtre charg\xE9es",
515
+ votesOn: "Votes sur le commentaire de {name}",
516
+ score: "Score {n}",
517
+ upvote: "Voter pour",
518
+ downvote: "Voter contre",
519
+ upvoteSignIn: "Connectez-vous pour voter pour",
520
+ downvoteSignIn: "Connectez-vous pour voter contre",
521
+ upvotedLive: "Vote pour enregistr\xE9. Score {n}",
522
+ downvotedLive: "Vote contre enregistr\xE9. Score {n}",
523
+ voteRemovedLive: "Vote retir\xE9. Score {n}",
524
+ voteRefused: "Ce vote a \xE9t\xE9 refus\xE9. Vous ne pouvez pas voter pour votre propre commentaire.",
525
+ slowDown: "Trop d'actions en peu de temps. Patientez un instant et r\xE9essayez.",
526
+ sort: "Trier les commentaires",
527
+ sortNewest: "R\xE9cents",
528
+ sortTop: "Meilleurs",
529
+ sortedNewestLive: "Commentaires les plus r\xE9cents en premier",
530
+ sortedTopLive: "Meilleurs commentaires en premier",
531
+ sortError: "Les commentaires n'ont pas pu \xEAtre tri\xE9s. R\xE9essayez.",
532
+ newerLater: "Les commentaires plus r\xE9cents apparaissent apr\xE8s le chargement de la suite.",
533
+ moreError: "La suite des commentaires n'a pas pu \xEAtre charg\xE9e. R\xE9essayez.",
534
+ loadedLive: "{n} commentaires charg\xE9s"
418
535
  };
419
536
  var COMMENT_LABELS_ES = {
420
537
  heading: "Comentarios",
@@ -449,6 +566,7 @@ var COMMENT_LABELS_ES = {
449
566
  removed: "Este comentario fue eliminado.",
450
567
  removedByModerator: "Un moderador elimin\xF3 este comentario.",
451
568
  removedByAuthor: "Su autor elimin\xF3 este comentario.",
569
+ unrenderable: "Este comentario no se puede mostrar.",
452
570
  depthEnd: "Las respuestas terminan en este nivel",
453
571
  held: "Pendiente de aprobaci\xF3n.",
454
572
  heldBanner: "Gracias, tu comentario est\xE1 pendiente de aprobaci\xF3n",
@@ -475,8 +593,39 @@ var COMMENT_LABELS_ES = {
475
593
  bannedBody: "Los comentarios no est\xE1n disponibles para tu cuenta en este sitio. A\xFAn puedes leerlos todos. Si crees que es un error, contacta con el equipo del sitio.",
476
594
  expired: "Tu sesi\xF3n termin\xF3. Inicia sesi\xF3n de nuevo para publicar. Tu texto se conserva.",
477
595
  more: "Cargar m\xE1s comentarios",
478
- truncated: "Se muestran los primeros 500 comentarios.",
479
- justNow: "ahora mismo"
596
+ truncated: "Solo se muestra la primera parte de esta conversaci\xF3n.",
597
+ justNow: "ahora mismo",
598
+ react: "Reaccionar",
599
+ reactions: "Reacciones",
600
+ reactionLike: "Me gusta",
601
+ reactionLove: "Me encanta",
602
+ reactionInsightful: "Interesante",
603
+ reactionCelebrate: "Celebrar",
604
+ reactionSignIn: "Inicia sesi\xF3n para reaccionar, ",
605
+ reactionAddedLive: "Reacci\xF3n {kind} a\xF1adida",
606
+ reactionRemovedLive: "Reacci\xF3n {kind} eliminada",
607
+ reactionsLoading: "Cargando reacciones",
608
+ reactionsError: "No se pudieron cargar las reacciones",
609
+ votesOn: "Votos del comentario de {name}",
610
+ score: "Puntuaci\xF3n {n}",
611
+ upvote: "Votar a favor",
612
+ downvote: "Votar en contra",
613
+ upvoteSignIn: "Inicia sesi\xF3n para votar a favor",
614
+ downvoteSignIn: "Inicia sesi\xF3n para votar en contra",
615
+ upvotedLive: "Voto a favor registrado. Puntuaci\xF3n {n}",
616
+ downvotedLive: "Voto en contra registrado. Puntuaci\xF3n {n}",
617
+ voteRemovedLive: "Voto retirado. Puntuaci\xF3n {n}",
618
+ voteRefused: "No se acept\xF3 el voto. No puedes votar tu propio comentario.",
619
+ slowDown: "Demasiadas acciones en poco tiempo. Espera un momento e int\xE9ntalo de nuevo.",
620
+ sort: "Ordenar comentarios",
621
+ sortNewest: "Recientes",
622
+ sortTop: "Destacados",
623
+ sortedNewestLive: "Comentarios m\xE1s recientes primero",
624
+ sortedTopLive: "Comentarios destacados primero",
625
+ sortError: "No se pudieron ordenar los comentarios. Int\xE9ntalo de nuevo.",
626
+ newerLater: "Los comentarios m\xE1s recientes aparecen al cargar m\xE1s.",
627
+ moreError: "No se pudieron cargar m\xE1s comentarios. Int\xE9ntalo de nuevo.",
628
+ loadedLive: "{n} comentarios cargados"
480
629
  };
481
630
 
482
631
  // src/react/viewer/labels.ts
@@ -488,15 +637,15 @@ var VIEWER_LABELS_EN = {
488
637
  zoomIn: "Zoom in",
489
638
  zoomOut: "Zoom out",
490
639
  fit: "Fit to window",
491
- actual: "Actual size",
640
+ actual: "100%: actual size",
492
641
  search: "Find in diagram",
493
642
  searchPlaceholder: "Find",
494
643
  noMatch: "No match",
495
644
  matchOf: "{n} of {total}",
496
- copySource: "Copy diagram source",
497
- downloadSvg: "Download SVG",
498
- downloadPng: "Download PNG",
499
- copyImage: "Copy as image",
645
+ copySource: "MMD: copy diagram source",
646
+ downloadSvg: "SVG: download",
647
+ downloadPng: "PNG: download",
648
+ copyImage: "IMG: copy as image",
500
649
  pngScale: "PNG scale",
501
650
  fullscreen: "Fullscreen",
502
651
  exitFullscreen: "Exit fullscreen",
@@ -509,7 +658,16 @@ var VIEWER_LABELS_EN = {
509
658
  legendDownstream: "Downstream",
510
659
  outgoing: "outgoing",
511
660
  tracing: "{label}: {up} upstream, {down} downstream",
512
- map: "Overview map"
661
+ map: "Overview map",
662
+ largeTitle: "Large diagram, not drawn automatically",
663
+ largeBody: "Drawing a diagram this size can freeze this page for a few seconds, so it waits until you ask. Press Draw diagram: it takes a couple of seconds (a few more on a phone) and the page may pause while it works.",
664
+ drawLarge: "Draw diagram",
665
+ drawing: "Drawing\u2026",
666
+ drawingBody: "Drawing the diagram\u2026 this takes a couple of seconds.",
667
+ drawAgain: "Draw again",
668
+ showSource: "Show full source",
669
+ hideSource: "Show less",
670
+ printPreparing: "Preparing diagrams for print\u2026 Esc cancels between steps."
513
671
  };
514
672
  var VIEWER_LABELS_FR = {
515
673
  expand: "Agrandir le sch\xE9ma",
@@ -519,15 +677,15 @@ var VIEWER_LABELS_FR = {
519
677
  zoomIn: "Zoom avant",
520
678
  zoomOut: "Zoom arri\xE8re",
521
679
  fit: "Ajuster \xE0 la fen\xEAtre",
522
- actual: "Taille r\xE9elle",
680
+ actual: "100% : taille r\xE9elle",
523
681
  search: "Rechercher dans le sch\xE9ma",
524
682
  searchPlaceholder: "Rechercher",
525
683
  noMatch: "Aucun r\xE9sultat",
526
684
  matchOf: "{n} sur {total}",
527
- copySource: "Copier la source du sch\xE9ma",
528
- downloadSvg: "T\xE9l\xE9charger le SVG",
529
- downloadPng: "T\xE9l\xE9charger le PNG",
530
- copyImage: "Copier comme image",
685
+ copySource: "MMD : copier la source du sch\xE9ma",
686
+ downloadSvg: "SVG : t\xE9l\xE9charger",
687
+ downloadPng: "PNG : t\xE9l\xE9charger",
688
+ copyImage: "IMG : copier comme image",
531
689
  pngScale: "\xC9chelle du PNG",
532
690
  fullscreen: "Plein \xE9cran",
533
691
  exitFullscreen: "Quitter le plein \xE9cran",
@@ -540,7 +698,16 @@ var VIEWER_LABELS_FR = {
540
698
  legendDownstream: "En aval",
541
699
  outgoing: "sortants",
542
700
  tracing: "{label} : {up} en amont, {down} en aval",
543
- map: "Carte d'ensemble"
701
+ map: "Carte d'ensemble",
702
+ largeTitle: "Grand sch\xE9ma, non dessin\xE9 automatiquement",
703
+ largeBody: "Dessiner un sch\xE9ma de cette taille peut figer la page quelques secondes, il attend donc votre demande. Appuyez sur Dessiner le sch\xE9ma : cela prend quelques secondes (un peu plus sur un t\xE9l\xE9phone) et la page peut se figer pendant ce temps.",
704
+ drawLarge: "Dessiner le sch\xE9ma",
705
+ drawing: "Dessin en cours\u2026",
706
+ drawingBody: "Dessin du sch\xE9ma\u2026 cela prend quelques secondes.",
707
+ drawAgain: "Redessiner",
708
+ showSource: "Afficher toute la source",
709
+ hideSource: "R\xE9duire",
710
+ printPreparing: "Pr\xE9paration des sch\xE9mas pour l'impression\u2026 \xC9chap annule entre deux \xE9tapes."
544
711
  };
545
712
  var VIEWER_LABELS_ES = {
546
713
  expand: "Ampliar el diagrama",
@@ -550,15 +717,15 @@ var VIEWER_LABELS_ES = {
550
717
  zoomIn: "Acercar",
551
718
  zoomOut: "Alejar",
552
719
  fit: "Ajustar a la ventana",
553
- actual: "Tama\xF1o real",
720
+ actual: "100%: tama\xF1o real",
554
721
  search: "Buscar en el diagrama",
555
722
  searchPlaceholder: "Buscar",
556
723
  noMatch: "Sin resultados",
557
724
  matchOf: "{n} de {total}",
558
- copySource: "Copiar el c\xF3digo del diagrama",
559
- downloadSvg: "Descargar SVG",
560
- downloadPng: "Descargar PNG",
561
- copyImage: "Copiar como imagen",
725
+ copySource: "MMD: copiar el c\xF3digo del diagrama",
726
+ downloadSvg: "SVG: descargar",
727
+ downloadPng: "PNG: descargar",
728
+ copyImage: "IMG: copiar como imagen",
562
729
  pngScale: "Escala del PNG",
563
730
  fullscreen: "Pantalla completa",
564
731
  exitFullscreen: "Salir de pantalla completa",
@@ -571,7 +738,16 @@ var VIEWER_LABELS_ES = {
571
738
  legendDownstream: "Aguas abajo",
572
739
  outgoing: "salientes",
573
740
  tracing: "{label}: {up} aguas arriba, {down} aguas abajo",
574
- map: "Mapa general"
741
+ map: "Mapa general",
742
+ largeTitle: "Diagrama grande, no se dibuja autom\xE1ticamente",
743
+ largeBody: "Dibujar un diagrama de este tama\xF1o puede bloquear la p\xE1gina unos segundos, as\xED que espera a que lo pidas. Pulsa Dibujar el diagrama: tarda un par de segundos (algo m\xE1s en un tel\xE9fono) y la p\xE1gina puede detenerse mientras tanto.",
744
+ drawLarge: "Dibujar el diagrama",
745
+ drawing: "Dibujando\u2026",
746
+ drawingBody: "Dibujando el diagrama\u2026 tarda un par de segundos.",
747
+ drawAgain: "Dibujar de nuevo",
748
+ showSource: "Mostrar todo el c\xF3digo",
749
+ hideSource: "Mostrar menos",
750
+ printPreparing: "Preparando los diagramas para imprimir\u2026 Esc cancela entre pasos."
575
751
  };
576
752
 
577
753
  // src/react/strings.ts
@@ -590,13 +766,27 @@ var en = {
590
766
  warning: "Heads up",
591
767
  tip: "Tip",
592
768
  caution: "Caution",
769
+ important: "Important",
770
+ copyCode: "Copy code",
771
+ copied: "Copied",
772
+ copyBlocked: "Copy blocked",
773
+ done: "Done",
774
+ notDone: "Not done",
775
+ playVideo: "Play video",
776
+ videoFrame: "YouTube video",
593
777
  diagram: "Diagram",
594
778
  diagramError: "This diagram could not be rendered.",
779
+ diagramLoading: "Loading the diagram",
780
+ diagramSource: "Diagram source",
595
781
  contentError: "This content cannot be displayed.",
596
782
  fallbackTitle: "Not translated into {language} yet.",
597
783
  fallbackBody: "You are reading the original.",
784
+ readingTime: "{n} min read",
785
+ readingTimeLabel: "Reading time",
598
786
  older: "Older posts",
599
787
  viewAll: "View all",
788
+ moreInSection: "More in this section",
789
+ subPages: "In this section",
600
790
  readAtSource: "Read at source",
601
791
  emptyTitle: "Nothing published here yet",
602
792
  emptyBody: "Documents published to this section will appear here, newest first.",
@@ -636,13 +826,27 @@ var fr = {
636
826
  warning: "Attention",
637
827
  tip: "Astuce",
638
828
  caution: "Danger",
829
+ important: "Important",
830
+ copyCode: "Copier le code",
831
+ copied: "Copi\xE9",
832
+ copyBlocked: "Copie bloqu\xE9e",
833
+ done: "Termin\xE9",
834
+ notDone: "\xC0 faire",
835
+ playVideo: "Lire la vid\xE9o",
836
+ videoFrame: "Vid\xE9o YouTube",
639
837
  diagram: "Sch\xE9ma",
640
838
  diagramError: "Ce sch\xE9ma n'a pas pu \xEAtre affich\xE9.",
839
+ diagramLoading: "Chargement du sch\xE9ma",
840
+ diagramSource: "Source du sch\xE9ma",
641
841
  contentError: "Ce contenu ne peut pas \xEAtre affich\xE9.",
642
842
  fallbackTitle: "Pas encore traduit en {language}.",
643
843
  fallbackBody: "Vous lisez l'original.",
844
+ readingTime: "{n} min de lecture",
845
+ readingTimeLabel: "Temps de lecture",
644
846
  older: "Articles plus anciens",
645
847
  viewAll: "Tout voir",
848
+ moreInSection: "Plus dans cette section",
849
+ subPages: "Dans cette section",
646
850
  readAtSource: "Lire \xE0 la source",
647
851
  emptyTitle: "Rien n'est encore publi\xE9 ici",
648
852
  emptyBody: "Les documents publi\xE9s dans cette section appara\xEEtront ici, du plus r\xE9cent au plus ancien.",
@@ -682,13 +886,27 @@ var es = {
682
886
  warning: "Atenci\xF3n",
683
887
  tip: "Consejo",
684
888
  caution: "Peligro",
889
+ important: "Importante",
890
+ copyCode: "Copiar el c\xF3digo",
891
+ copied: "Copiado",
892
+ copyBlocked: "Copia bloqueada",
893
+ done: "Hecho",
894
+ notDone: "Pendiente",
895
+ playVideo: "Reproducir el v\xEDdeo",
896
+ videoFrame: "V\xEDdeo de YouTube",
685
897
  diagram: "Diagrama",
686
898
  diagramError: "No se pudo mostrar este diagrama.",
899
+ diagramLoading: "Cargando el diagrama",
900
+ diagramSource: "C\xF3digo del diagrama",
687
901
  contentError: "No se puede mostrar este contenido.",
688
902
  fallbackTitle: "A\xFAn no est\xE1 traducida al {language}.",
689
903
  fallbackBody: "Est\xE1s leyendo el original.",
904
+ readingTime: "{n} min de lectura",
905
+ readingTimeLabel: "Tiempo de lectura",
690
906
  older: "Entradas anteriores",
691
907
  viewAll: "Ver todo",
908
+ moreInSection: "M\xE1s en esta secci\xF3n",
909
+ subPages: "En esta secci\xF3n",
692
910
  readAtSource: "Leer en la fuente",
693
911
  emptyTitle: "A\xFAn no hay nada publicado aqu\xED",
694
912
  emptyBody: "Los documentos publicados en esta secci\xF3n aparecer\xE1n aqu\xED, del m\xE1s reciente al m\xE1s antiguo.",
@@ -733,14 +951,15 @@ function formatDate(iso, locale, options = { dateStyle: "medium" }) {
733
951
  }
734
952
 
735
953
  // src/react/content.tsx
954
+ var import_youtube_facade = require("./youtube-facade.cjs");
736
955
  var import_jsx_runtime3 = require("react/jsx-runtime");
737
956
  function plainText(node) {
738
957
  if (typeof node === "string" || typeof node === "number") return String(node);
739
958
  if (Array.isArray(node)) return node.map(plainText).join("");
740
959
  return (0, import_react.isValidElement)(node) ? plainText(node.props.children) : "";
741
960
  }
742
- var CALLOUT_ICON = { note: "info", tip: "check-circle", warning: "alert", caution: "x-circle" };
743
- function buildComponents(c, s) {
961
+ var CALLOUT_ICON = { note: "info", tip: "check-circle", important: "important", warning: "alert", caution: "x-circle" };
962
+ function buildComponents(c, s, { opensWithImage, interactive }) {
744
963
  const Link = c.Link ?? "a";
745
964
  const Img = c.Image ?? "img";
746
965
  const A = ({ href, children, ...rest }) => {
@@ -751,20 +970,35 @@ function buildComponents(c, s) {
751
970
  }
752
971
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: url, rel: "noopener noreferrer", ...rest, children });
753
972
  };
754
- const Image = (props) => typeof props.src === "string" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Img, { loading: "lazy", decoding: "async", ...props }) : null;
973
+ let eager = opensWithImage;
974
+ const Image = (props) => {
975
+ if (typeof props.src !== "string") return null;
976
+ const first = eager;
977
+ eager = false;
978
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Img, { loading: first ? "eager" : "lazy", ...first ? { fetchPriority: "high" } : {}, decoding: "async", ...props });
979
+ };
755
980
  const Pre = ({ children, ...rest }) => {
756
981
  const code = import_react.Children.toArray(children).find(import_react.isValidElement);
757
982
  const language = /(?:^|\s)language-([\w-]+)/.exec(code?.props.className ?? "")?.[1];
758
983
  const pre = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { tabIndex: 0, ...rest, children });
759
984
  if (c.CodeBlock) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.CodeBlock, { code: plainText(children), language, children: pre });
760
985
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("figure", { className: "hyle-codeblock", "data-slot-component": "CodeBlock", children: [
761
- language ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "lang", children: language }) }) : null,
986
+ language || interactive ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
987
+ language ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "lang", children: language }) : null,
988
+ interactive ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
989
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", "aria-label": s.copyCode, children: [
990
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { name: "copy" }),
991
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { name: "check" })
992
+ ] }),
993
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "hyle-sr", role: "status" })
994
+ ] }) : null
995
+ ] }) : null,
762
996
  pre
763
997
  ] });
764
998
  };
765
999
  const Table = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "hyle-table", tabIndex: 0, role: "region", "aria-label": s.table, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("table", { ...rest, children }) });
766
1000
  const Callout = ({ kind, children }) => {
767
- const k = ["note", "tip", "warning", "caution"].includes(String(kind)) ? kind : "note";
1001
+ const k = Object.hasOwn(CALLOUT_ICON, String(kind)) ? kind : "note";
768
1002
  const title = s[k];
769
1003
  if (c.Callout) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.Callout, { kind: k, title, children });
770
1004
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("aside", { className: "hyle-callout", "data-kind": k, "data-slot-component": "Callout", role: "note", children: [
@@ -775,26 +1009,45 @@ function buildComponents(c, s) {
775
1009
  ] })
776
1010
  ] });
777
1011
  };
778
- const Frame = ({ srcDoc, sandbox }) => {
1012
+ const Frame = (props) => {
1013
+ const { srcDoc } = props;
779
1014
  if (typeof srcDoc !== "string") return null;
780
1015
  const source = mermaidSource(srcDoc);
781
1016
  if (c.Mermaid) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.Mermaid, { srcDoc, source, title: s.diagram });
782
- if (source !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mermaid_diagram.MermaidDiagram, { source, title: s.diagram, errorText: s.diagramError, labels: s.viewer });
783
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("figure", { className: "hyle-mermaid", "data-slot-component": "Mermaid", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("iframe", { srcDoc, sandbox: String(sandbox), title: s.diagram, loading: "lazy", referrerPolicy: "no-referrer", ...{ csp: MERMAID_FRAME_CSP } }) });
1017
+ if (source === void 0) return null;
1018
+ const light = diagramRender(props["data-light"]);
1019
+ const dark = diagramRender(props["data-dark"]);
1020
+ if (light && dark) {
1021
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mermaid_image.MermaidImage, { source, title: s.diagram, errorText: s.diagramError, loadingText: s.diagramLoading, sourceLabel: s.diagramSource, light, dark, labels: s.viewer });
1022
+ }
1023
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_mermaid_diagram.MermaidDiagram, { source, title: s.diagram, errorText: s.diagramError, loadingText: s.diagramLoading, labels: s.viewer });
784
1024
  };
785
1025
  const Heading = (level) => function HyleHeading({ id, children, ...rest }) {
786
1026
  const Tag = `h${level}`;
1027
+ const anchored = typeof id === "string" && !String(rest.className ?? "").split(" ").includes("sr-only");
787
1028
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tag, { id, ...rest, children: [
788
- typeof id === "string" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "hyle-anchor", href: `#${id}`, "aria-label": s.anchor, children: "#" }) : null,
1029
+ anchored ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "hyle-anchor", href: `#${id}`, "aria-label": s.anchor }) : null,
789
1030
  children
790
1031
  ] });
791
1032
  };
792
- const defaults = { a: A, img: Image, pre: Pre, table: Table, callout: Callout, iframe: Frame, h2: Heading(2), h3: Heading(3), h4: Heading(4) };
1033
+ const Checkbox = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...props, "aria-label": props.checked ? s.done : s.notDone });
1034
+ const Paragraph = ({ children, ...rest }) => {
1035
+ const [only, ...more] = import_react.Children.toArray(children).filter((n) => typeof n !== "string" || n.trim() !== "");
1036
+ if (more.length === 0 && (0, import_react.isValidElement)(only) && only.props["data-embed"] === "youtube") {
1037
+ const id = youtubeId(only.props.href);
1038
+ if (id) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_youtube_facade.YouTubeFacade, { videoId: id, playLabel: s.playVideo, frameTitle: s.videoFrame, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: only }) });
1039
+ }
1040
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { ...rest, children });
1041
+ };
1042
+ const defaults = { a: A, img: Image, pre: Pre, table: Table, input: Checkbox, callout: Callout, iframe: Frame, h2: Heading(2), h3: Heading(3), h4: Heading(4), ...interactive ? { p: Paragraph } : {} };
793
1043
  const overrides = ["a", "img", "code", "pre", "table", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6"];
794
1044
  for (const key of overrides) if (c[key]) defaults[key] = c[key];
795
1045
  return defaults;
796
1046
  }
797
- function HastContent({ tree, title, description, components = {}, locale }) {
1047
+ function HastContent(props) {
1048
+ return renderHast(props, false);
1049
+ }
1050
+ function renderHast({ tree, title, description, components = {}, locale }, interactive) {
798
1051
  let root;
799
1052
  try {
800
1053
  root = sanitizeHast(tree, title, description);
@@ -806,11 +1059,13 @@ function HastContent({ tree, title, description, components = {}, locale }) {
806
1059
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: s.contentError })
807
1060
  ] });
808
1061
  }
1062
+ const lead = root.children.find((n) => n.type !== "text" || n.value.trim() !== "");
1063
+ const opensWithImage = lead?.type === "element" && lead.tagName === "figure";
809
1064
  return (0, import_hast_util_to_jsx_runtime.toJsxRuntime)(root, {
810
1065
  Fragment: import_react.Fragment,
811
1066
  jsx: import_jsx_runtime2.jsx,
812
1067
  jsxs: import_jsx_runtime2.jsxs,
813
- components: buildComponents(components, stringsFor(locale)),
1068
+ components: buildComponents(components, stringsFor(locale), { opensWithImage, interactive }),
814
1069
  elementAttributeNameCase: "react",
815
1070
  stylePropertyNameCase: "dom"
816
1071
  });
@@ -819,18 +1074,157 @@ function TrustedServerHtml({ html }) {
819
1074
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { dangerouslySetInnerHTML: { __html: hostAssetHtml(html) } });
820
1075
  }
821
1076
 
1077
+ // src/react/body.tsx
1078
+ var import_react2 = require("react");
1079
+ var import_code_copy = require("./code-copy.cjs");
1080
+ var import_fragment_alias = require("./fragment-alias.cjs");
1081
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1082
+ function ProseBody({ id, className, lang, ...content }) {
1083
+ const generated = (0, import_react2.useId)();
1084
+ const rootId = id ?? `hyle-body${generated}`;
1085
+ const s = stringsFor(content.locale);
1086
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1087
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { id: rootId, className, lang, children: renderHast(content, true) }),
1088
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_code_copy.CodeCopy, { rootId, copyLabel: s.copyCode, copiedLabel: s.copied, blockedLabel: s.copyBlocked }),
1089
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fragment_alias.FragmentAlias, {})
1090
+ ] });
1091
+ }
1092
+ function HyleBody(props) {
1093
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProseBody, { ...props, className: "hyle hyle-body hyle-prose" });
1094
+ }
1095
+
822
1096
  // src/react/index.ts
823
1097
  var import_mermaid_diagram2 = require("./mermaid-diagram.cjs");
824
1098
 
1099
+ // src/react/mermaid-config.ts
1100
+ var MAX_MERMAID_SOURCE = 1024 * 1024;
1101
+ var AUTO_RENDER_EDGES = 100;
1102
+ var AUTO_RENDER_CHARS = 6e3;
1103
+ var AUTO_RENDER_STATEMENTS = 250;
1104
+ var AUTO_RENDER_WORDS = 800;
1105
+ var AUTO_RENDER_GROUPS = 25;
1106
+ var CLAMP_LINES = 12;
1107
+ var isClampedSource = (source) => source.trimEnd().split("\n").length > CLAMP_LINES;
1108
+ var FRONTMATTER = /\s*-{3}[^\S\n]*\n[\s\S]*?\n[^\S\n]*-{3}[^\S\n]*(?:\n|$)/y;
1109
+ var DIRECTIVE = /%%\{(?:(?!\}%%)[\s\S])*(?:\}%%)?/g;
1110
+ var MAX_STRIP_ROUNDS = 16;
1111
+ function dropFrontmatter(text) {
1112
+ let end = 0;
1113
+ for (; ; ) {
1114
+ FRONTMATTER.lastIndex = end;
1115
+ const block = FRONTMATTER.exec(text);
1116
+ if (!block) return text.slice(end);
1117
+ end += block[0].length;
1118
+ }
1119
+ }
1120
+ function stripMermaidConfig(source) {
1121
+ let text = source.replace(/\r\n?/g, "\n");
1122
+ for (let round = 0; round < MAX_STRIP_ROUNDS; round++) {
1123
+ const next = dropFrontmatter(text).replace(DIRECTIVE, "");
1124
+ if (next === text) return text;
1125
+ text = next;
1126
+ }
1127
+ return "";
1128
+ }
1129
+ var EDGE_TOKEN = /-{2,}|={2,}|~{3}|\.{2,}|\.-|-[>x)]/;
1130
+ var ER_TOKEN = /-{2,}|={2,}|~{3}|\.{2,}|\.-|-[>x)]|-\.|to\b/i;
1131
+ var AMPERSAND = /\s&(?=\s)/g;
1132
+ var GROUP_OPENER = /^(?:subgraph\b|state\b.*\{)/;
1133
+ var BLOCK_OPENER = /\bblock\b(?!-)/g;
1134
+ var DEFAULT_LIMITS = { statements: AUTO_RENDER_STATEMENTS, words: AUTO_RENDER_WORDS, groups: AUTO_RENDER_GROUPS, edges: AUTO_RENDER_EDGES, blocks: Infinity, token: EDGE_TOKEN };
1135
+ var TYPE_LIMITS = {
1136
+ mindmap: { statements: 40 },
1137
+ kanban: { statements: 100 },
1138
+ block: { words: 100, blocks: 8 },
1139
+ erDiagram: { statements: 120, edges: 50, token: ER_TOKEN },
1140
+ "venn-beta": { statements: 180 },
1141
+ classDiagram: { statements: 70, edges: 30 },
1142
+ stateDiagram: { statements: 80 }
1143
+ };
1144
+ var COMMENT_LINE = /^[^\S\n\u2028\u2029]*%%[^\n]+\n?/gm;
1145
+ var statementsOf = (code) => code.split(/[\n;]/).map((s) => s.trim()).filter((s) => s && s !== "end");
1146
+ var edgeBound = (code, token) => {
1147
+ const amps = code.match(AMPERSAND)?.length ?? 0;
1148
+ return code.split(token).length - 1 + 2 * amps + Math.floor(amps ** 2 / 4);
1149
+ };
1150
+ function isLargeDiagram(source) {
1151
+ if (source.length > AUTO_RENDER_CHARS) return true;
1152
+ const code = stripMermaidConfig(source).replace(COMMENT_LINE, "");
1153
+ const statements = statementsOf(code);
1154
+ const first = statements.find((line) => !line.startsWith("%%")) ?? "";
1155
+ const type = Object.keys(TYPE_LIMITS).find((keyword) => first.startsWith(keyword));
1156
+ const limit = { ...DEFAULT_LIMITS, ...type ? TYPE_LIMITS[type] : void 0 };
1157
+ const words = statements.reduce((n, line) => n + line.split(/\s+/).length, 0);
1158
+ const groups = statements.filter((line) => GROUP_OPENER.test(line)).length;
1159
+ const blocks = code.match(BLOCK_OPENER)?.length ?? 0;
1160
+ return statements.length > limit.statements || words > limit.words || groups > limit.groups || blocks > limit.blocks || edgeBound(code, limit.token) > limit.edges;
1161
+ }
1162
+
1163
+ // src/react/index.ts
1164
+ var import_print_coordinator = require("./print-coordinator.cjs");
1165
+
825
1166
  // src/react/pages.tsx
826
1167
  var import_comments = require("./comments.cjs");
827
1168
 
1169
+ // src/react/embed.tsx
1170
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1171
+ function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, olderHref, ...base }) {
1172
+ const c = ctx(base, "en");
1173
+ const { s, Link } = c;
1174
+ const Row = base.slots?.["list.item"];
1175
+ const Heading = `h${headingLevel}`;
1176
+ const safe = items.filter((item) => item.canonical_path.startsWith("/"));
1177
+ if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle hyle-embed", "data-layout": layout, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "list.empty", slots: base.slots }) }) : null;
1178
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle hyle-embed", "data-layout": layout, lang: c.locale, children: [
1179
+ title ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading, { className: "hyle-title", children: title }) : null,
1180
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "hyle-items", children: safe.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1181
+ item.published_at ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }) : null,
1182
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1183
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "t", children: item.title }),
1184
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: item.description }) : null
1185
+ ] })
1186
+ ] }) }, item.canonical_path)) }),
1187
+ olderHref ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OlderNav, { href: olderHref, c }) : null,
1188
+ moreHref ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { className: "hyle-more", href: moreHref, children: s.viewAll }) : null
1189
+ ] });
1190
+ }
1191
+ function HyleArticleView({ article, headingLevel = 2, ...base }) {
1192
+ const { publication: pub } = article;
1193
+ const c = ctx(base, pub.locale);
1194
+ const Heading = `h${headingLevel}`;
1195
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle hyle-embed", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { lang: c.locale, children: [
1196
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "hyle-head", children: [
1197
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading, { className: "hyle-title", children: pub.title }),
1198
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1199
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle-meta", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) }) }) })
1200
+ ] }),
1201
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Body, { article, components: base.components, locale: c.locale }),
1202
+ pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("a", { className: "hyle-more", href: c.href(pub.canonical_path, pub.locale), rel: "bookmark", children: [
1203
+ c.s.readAtSource,
1204
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "hyle-sr", children: [
1205
+ ": ",
1206
+ pub.title
1207
+ ] })
1208
+ ] }) : null
1209
+ ] }) });
1210
+ }
1211
+
828
1212
  // src/react/seo.ts
829
1213
  var BARE_HTTPS_ORIGIN = /^https:\/\/[^/]+$/;
830
1214
  var bareOrigin = (origin) => origin && BARE_HTTPS_ORIGIN.test(origin) ? origin : void 0;
831
1215
  var absoluteUrl = (origin, href) => origin + encodeURI(href);
832
1216
  var modifiedAt = (pub) => pub.updated_at && Date.parse(pub.updated_at) > Date.parse(pub.published_at) ? pub.updated_at : void 0;
1217
+ var wordCountOf = (pub) => Number.isInteger(pub.word_count) && pub.word_count > 0 ? pub.word_count : void 0;
1218
+ var WORDS_PER_MINUTE = 275;
1219
+ var readingMinutes = (wordCount) => Math.max(1, Math.ceil(wordCount / WORDS_PER_MINUTE));
1220
+ var breadcrumbItems = (article, jsonLd) => [
1221
+ ...jsonLd?.breadcrumbRoot ? [{ title: jsonLd.breadcrumbRoot.name, canonical_path: "/" }] : [],
1222
+ ...article.breadcrumbs
1223
+ ];
1224
+ var crumbHref = (href, path, locale) => path === "/" ? href("/", locale).replace(/(.)\/$/, "$1") : href(path, locale);
833
1225
  function articleAuthor(article, jsonLd) {
1226
+ const authored = article.publication.author;
1227
+ if (authored?.name) return { name: authored.name, ...authored.url ? { url: authored.url } : {} };
834
1228
  const given = jsonLd?.author?.(article);
835
1229
  if (given && typeof given.name === "string" && given.name) return given;
836
1230
  const fromFrontmatter = article.frontmatter.author;
@@ -839,7 +1233,9 @@ function articleAuthor(article, jsonLd) {
839
1233
 
840
1234
  // src/react/jsonld.ts
841
1235
  var script = (value) => JSON.stringify(value).replace(/</g, "\\u003c");
842
- function articleJsonLd({ article, origin, href, jsonLd, imageUrl }) {
1236
+ var organization = (publisher) => ({ "@type": "Organization", "@id": publisher.id, name: publisher.name, ...publisher.logo ? { logo: publisher.logo } : {} });
1237
+ var webSite = (website) => ({ "@type": "WebSite", "@id": website.id, name: website.name });
1238
+ function articleJsonLd({ article, origin, href, jsonLd, imageUrl, imageWidth, imageHeight }) {
843
1239
  const { publication: pub } = article;
844
1240
  const url = (path) => absoluteUrl(origin, href(path, pub.locale));
845
1241
  const canonical = url(pub.canonical_path);
@@ -849,7 +1245,9 @@ function articleJsonLd({ article, origin, href, jsonLd, imageUrl }) {
849
1245
  const publisher = jsonLd?.publisher;
850
1246
  const website = jsonLd?.website?.(pub.locale);
851
1247
  const modified = modifiedAt(pub);
852
- const root = jsonLd?.breadcrumbRoot;
1248
+ const words = wordCountOf(pub);
1249
+ const publisherNode = publisher ? organization(publisher) : void 0;
1250
+ const section = article.breadcrumbs[0]?.title;
853
1251
  const graph = [
854
1252
  ...full ? [{
855
1253
  "@type": "WebPage",
@@ -858,8 +1256,8 @@ function articleJsonLd({ article, origin, href, jsonLd, imageUrl }) {
858
1256
  name: pub.title,
859
1257
  ...pub.description ? { description: pub.description } : {},
860
1258
  inLanguage: pub.locale,
861
- ...website ? { isPartOf: { "@id": website.id } } : {},
862
- ...publisher ? { publisher: { "@id": publisher.id } } : {},
1259
+ ...website ? { isPartOf: webSite(website) } : {},
1260
+ ...publisherNode ? { publisher: publisherNode } : {},
863
1261
  breadcrumb: id("breadcrumb"),
864
1262
  mainEntity: id("article")
865
1263
  }] : [],
@@ -868,28 +1266,40 @@ function articleJsonLd({ article, origin, href, jsonLd, imageUrl }) {
868
1266
  ...id("article"),
869
1267
  headline: pub.title,
870
1268
  ...pub.description ? { description: pub.description } : {},
871
- datePublished: pub.published_at.slice(0, 10),
1269
+ datePublished: pub.published_at,
1270
+ ...section ? { articleSection: section } : {},
872
1271
  ...modified ? { dateModified: modified } : {},
1272
+ ...words ? { wordCount: words } : {},
873
1273
  url: canonical,
874
1274
  mainEntityOfPage: full ? id("webpage") : canonical,
875
- ...author ? { author: author.id ? { "@id": author.id } : { "@type": "Person", name: author.name, ...author.url ? { url: author.url } : {} } } : {},
876
- ...publisher ? { publisher: { "@id": publisher.id } } : {},
1275
+ ...author ? { author: { "@type": "Person", ...author.id ? { "@id": author.id } : {}, name: author.name, ...author.url ? { url: author.url } : {} } } : {},
1276
+ ...publisherNode ? { publisher: publisherNode } : {},
877
1277
  inLanguage: pub.locale,
878
- ...imageUrl ? { image: [imageUrl] } : {}
1278
+ ...imageUrl ? { image: imageWidth && imageHeight ? { "@type": "ImageObject", url: imageUrl, width: imageWidth, height: imageHeight } : [imageUrl] } : {}
879
1279
  },
880
1280
  {
881
1281
  "@type": "BreadcrumbList",
882
1282
  ...id("breadcrumb"),
883
- itemListElement: [...root ? [{ name: root.name, item: absoluteUrl(origin, href("/", pub.locale).replace(/(.)\/$/, "$1").replace(/^\/$/, "")) }] : [], ...article.breadcrumbs.map((b) => ({ name: b.title, item: url(b.canonical_path) }))].map((b, i) => ({ "@type": "ListItem", position: i + 1, ...b }))
1283
+ itemListElement: breadcrumbItems(article, jsonLd).map((b, i) => ({
1284
+ "@type": "ListItem",
1285
+ position: i + 1,
1286
+ name: b.title,
1287
+ item: absoluteUrl(origin, crumbHref(href, b.canonical_path, pub.locale).replace(/^\/$/, ""))
1288
+ }))
884
1289
  }
885
1290
  ];
886
1291
  return script({ "@context": "https://schema.org", "@graph": graph });
887
1292
  }
888
- function listJsonLd({ list, origin, href, path, locale, description }) {
1293
+ function listJsonLd({ list, origin, href, path, locale, description, jsonLd, cursor }) {
1294
+ const url = absoluteUrl(origin, href(path)) + (cursor ? `?cursor=${cursor}` : "");
1295
+ const website = jsonLd?.website?.(locale);
889
1296
  return script({
890
1297
  "@context": "https://schema.org",
891
1298
  "@type": "CollectionPage",
892
- url: absoluteUrl(origin, href(path)),
1299
+ ...jsonLd ? { "@id": `${url}#webpage` } : {},
1300
+ url,
1301
+ ...website ? { isPartOf: webSite(website) } : {},
1302
+ ...jsonLd?.publisher ? { publisher: organization(jsonLd.publisher) } : {},
893
1303
  name: list.section.title,
894
1304
  ...description ? { description } : {},
895
1305
  inLanguage: locale,
@@ -901,13 +1311,14 @@ function listJsonLd({ list, origin, href, path, locale, description }) {
901
1311
  }
902
1312
 
903
1313
  // src/react/pages.tsx
904
- var import_jsx_runtime4 = require("react/jsx-runtime");
1314
+ var import_toc_spy = require("./toc-spy.cjs");
1315
+ var import_jsx_runtime6 = require("react/jsx-runtime");
905
1316
  function Slot({ name, slots, tag: Tag = "div", className }) {
906
1317
  const fill = slots?.[name];
907
- return fill ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
1318
+ return fill ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
908
1319
  }
909
1320
  function Shell({ children }) {
910
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle-page", children }) });
1321
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle-page", children }) });
911
1322
  }
912
1323
  function ctx(p, fallbackLocale) {
913
1324
  const locale = p.locale ?? fallbackLocale;
@@ -916,23 +1327,32 @@ function ctx(p, fallbackLocale) {
916
1327
  function Pager({ prev, next, c }) {
917
1328
  if (!prev && !next) return null;
918
1329
  const { Link, s } = c;
919
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { className: "hyle-pager", "aria-label": s.pager, children: [
920
- prev ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Link, { href: c.href(prev.canonical_path), rel: "prev", children: [
921
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "dir", children: [
922
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev-left" }),
1330
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("nav", { className: "hyle-pager", "aria-label": s.pager, children: [
1331
+ prev ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Link, { href: c.href(prev.canonical_path), rel: "prev", children: [
1332
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dir", children: [
1333
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev-left" }),
923
1334
  s.prev
924
1335
  ] }),
925
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "ttl", children: prev.title })
926
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "none", "aria-hidden": "true" }),
927
- next ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Link, { href: c.href(next.canonical_path), rel: "next", className: "next", children: [
928
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "dir", children: [
1336
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ttl", children: prev.title })
1337
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "none", "aria-hidden": "true" }),
1338
+ next ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Link, { href: c.href(next.canonical_path), rel: "next", className: "next", children: [
1339
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dir", children: [
929
1340
  s.next,
930
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev" })
1341
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" })
931
1342
  ] }),
932
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "ttl", children: next.title })
1343
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ttl", children: next.title })
933
1344
  ] }) : null
934
1345
  ] });
935
1346
  }
1347
+ function OlderNav({ href, c }) {
1348
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("nav", { className: "hyle-pagination", "aria-label": c.s.pager, children: [
1349
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sp" }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(c.Link, { className: "hyle-btn sm", href, rel: "next", children: [
1351
+ c.s.older,
1352
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" })
1353
+ ] })
1354
+ ] });
1355
+ }
936
1356
  function TocList({ toc }) {
937
1357
  const groups = [];
938
1358
  for (const entry of toc) {
@@ -940,105 +1360,136 @@ function TocList({ toc }) {
940
1360
  if (entry.depth === 3 && last) last.subs.push(entry);
941
1361
  else groups.push({ entry, subs: [] });
942
1362
  }
943
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: groups.map(({ entry, subs }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
944
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: `#${scopeId(entry.id)}`, children: entry.text }),
945
- subs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: subs.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: `#${scopeId(sub.id)}`, children: sub.text }) }, sub.id)) }) : null
1363
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: groups.map(({ entry, subs }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
1364
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: `#${scopeId(entry.id)}`, children: entry.text }),
1365
+ subs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: subs.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: `#${scopeId(sub.id)}`, children: sub.text }) }, sub.id)) }) : null
946
1366
  ] }, entry.id)) });
947
1367
  }
948
- function Toc({ toc, c, aside }) {
1368
+ function Toc({ toc, c, aside, spy, className }) {
949
1369
  const entries = toc.filter((t) => t.depth === 2 || t.depth === 3);
950
1370
  if (entries.length === 0 && !aside) return { narrow: null, wide: null };
951
1371
  const { s } = c;
1372
+ const classes = (own) => className ? `${className} ${own}` : own;
952
1373
  return {
953
- narrow: entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { className: "hyle-toc-m", children: [
954
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("summary", { children: [
955
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "file" }),
1374
+ narrow: entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: classes("hyle-toc-m"), children: [
1375
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
1376
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "file" }),
956
1377
  s.toc,
957
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1378
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
958
1379
  ] }),
959
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-toc-list", "aria-label": s.toc, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TocList, { toc: entries }) })
1380
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-toc-list", "aria-label": s.toc, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TocList, { toc: entries }) })
960
1381
  ] }),
961
- wide: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("aside", { className: "hyle-toc-d", "aria-label": s.toc, children: [
962
- entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
963
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-toc-title", children: s.toc }),
964
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-toc-list", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TocList, { toc: entries }) })
1382
+ wide: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("aside", { className: classes("hyle-toc-d"), "aria-label": s.toc, children: [
1383
+ entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1384
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-toc-title", children: s.toc }),
1385
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-toc-list", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TocList, { toc: entries }) })
965
1386
  ] }),
966
- aside
1387
+ aside,
1388
+ spy && entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_toc_spy.TocSpy, { ids: entries.map((t) => scopeId(t.id)) }) : null
967
1389
  ] })
968
1390
  };
969
1391
  }
1392
+ function HyleToc({ toc, variant, aside, locale }) {
1393
+ const both = Toc({ toc, c: { s: stringsFor(locale) }, aside, spy: true, className: "hyle hyle-toc-solo" });
1394
+ return variant === "rail" ? both.wide : both.narrow;
1395
+ }
970
1396
  function Body({ article, components, locale }) {
971
1397
  const { content, publication } = article;
972
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle-body hyle-prose", lang: article.fallback ? void 0 : publication.locale, children: content.format === "hast" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HastContent, { tree: content.tree, title: publication.title, description: publication.description, components: components ?? {}, locale }) : content.format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TrustedServerHtml, { html: content.html }) : null });
1398
+ const lang = article.fallback ? void 0 : publication.locale;
1399
+ if (content.format === "hast") {
1400
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProseBody, { className: "hyle-body hyle-prose", lang, tree: content.tree, title: publication.title, description: publication.description, components: components ?? {}, locale });
1401
+ }
1402
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle-body hyle-prose", lang, children: content.format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TrustedServerHtml, { html: content.html }) : null });
973
1403
  }
974
1404
  function Languages({ alternates, current, c }) {
975
1405
  if (alternates.length < 2) return null;
976
1406
  const { Link, s } = c;
977
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { className: "hyle-langs", "aria-label": s.languages, children: [
978
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: s.readIn }),
979
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: alternates.map((a) => {
1407
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("nav", { className: "hyle-langs", "aria-label": s.languages, children: [
1408
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: s.readIn }),
1409
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: alternates.map((a) => {
980
1410
  const label = languageName(a.locale, a.locale);
981
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: a.locale === current ? /* @__PURE__ */ (0, import_jsx_runtime4.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_runtime4.jsx)(Link, { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, children: label }) }, a.locale);
1411
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: a.locale === current ? /* @__PURE__ */ (0, import_jsx_runtime6.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_runtime6.jsx)(Link, { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, children: label }) }, a.locale);
982
1412
  }) })
983
1413
  ] });
984
1414
  }
985
1415
  function LdScript({ json }) {
986
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
1416
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
987
1417
  }
988
- function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, ...base }) {
1418
+ function Crumbs({ items, c }) {
1419
+ const { Link } = c;
1420
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-crumbs", "aria-label": c.s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ol", { children: items.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { "aria-current": i === items.length - 1 ? "page" : void 0, children: i === items.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: crumbHref(c.href, b.canonical_path, c.locale), children: b.title }) }, b.canonical_path)) }) });
1421
+ }
1422
+ function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }) {
989
1423
  const { publication: pub } = article;
990
1424
  const c = ctx(base, pub.locale);
991
1425
  const { s } = c;
992
1426
  const jsonLdOrigin = bareOrigin(origin);
993
1427
  const author = articleAuthor(article, jsonLd)?.name;
994
- const toc = Toc({ toc: article.toc, c, aside: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "article.aside", slots: base.slots, className: "hyle-slot-wrap" }) });
1428
+ const modified = modifiedAt(pub);
1429
+ const words = wordCountOf(pub);
1430
+ const toc = Toc({ toc: article.toc, c, spy: true, aside: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.aside", slots: base.slots, className: "hyle-slot-wrap" }) });
995
1431
  const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
996
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "hyle-article", "data-hyle-page": "article", lang: c.locale, children: [
997
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "hyle-head", children: [
998
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "article.before", slots: base.slots, className: "hyle-eyebrow" }),
999
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: "hyle-title", children: pub.title }),
1000
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1001
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-meta", children: [
1002
- author ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1003
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "hyle-avatar", "aria-hidden": "true", children: author.slice(0, 2).toUpperCase() }),
1004
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1005
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "hyle-sr", children: [
1432
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { className: "hyle-article", "data-hyle-page": "article", lang: c.locale, children: [
1433
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "hyle-head", children: [
1434
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.before", slots: base.slots, className: "hyle-eyebrow" }),
1435
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Crumbs, { items: breadcrumbItems(article, jsonLd), c }),
1436
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "hyle-title", children: pub.title }),
1437
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1438
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-meta", children: [
1439
+ author ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1440
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hyle-avatar", "aria-hidden": "true", children: author.slice(0, 2).toUpperCase() }),
1441
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1442
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "hyle-sr", children: [
1006
1443
  s.by,
1007
1444
  " "
1008
1445
  ] }),
1009
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "by", children: author })
1446
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "by", children: author })
1010
1447
  ] })
1011
1448
  ] }) : null,
1012
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1013
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "calendar" }),
1014
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) })
1449
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1450
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar" }),
1451
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) })
1015
1452
  ] }),
1016
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1017
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "globe" }),
1018
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { lang: pub.locale, children: languageName(pub.locale, c.locale) })
1453
+ modified ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1454
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar" }),
1455
+ s.updated,
1456
+ " ",
1457
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: modified, title: modified, children: formatDate(modified, c.locale) })
1458
+ ] }) : null,
1459
+ words ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1460
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "clock" }),
1461
+ s.readingTime.replace("{n}", String(readingMinutes(words)))
1462
+ ] }) : null,
1463
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1464
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "globe" }),
1465
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { lang: pub.locale, children: languageName(pub.locale, c.locale) })
1019
1466
  ] }),
1020
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
1467
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
1021
1468
  ] }),
1022
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Languages, { alternates: article.alternates, current: pub.locale, c }),
1023
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1024
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "alert" }),
1025
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1026
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: notTranslated }),
1469
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Languages, { alternates: article.alternates, current: pub.locale, c }),
1470
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1471
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "alert" }),
1472
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1473
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: notTranslated }),
1027
1474
  " ",
1028
1475
  s.fallbackBody
1029
1476
  ] })
1030
1477
  ] }) : null
1031
1478
  ] }),
1032
1479
  toc.narrow,
1033
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Body, { article, components: base.components, locale: c.locale }),
1034
- engagement ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_comments.Comments, { path: pub.canonical_path, endpoint: engagement.endpoint ?? "/api/hyle/engage", signInHref: engagement.signInHref, locale: c.locale, labels: s.comments }) : null,
1035
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1036
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
1480
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Body, { article, components: base.components, locale: c.locale }),
1481
+ engagement ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_comments.Comments, { path: pub.canonical_path, endpoint: engagement.endpoint ?? "/api/hyle/engage", signInHref: engagement.signInHref, locale: c.locale, labels: s.comments }) : null,
1482
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1483
+ related ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1484
+ related.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleListView, { items: related.items, title: related.title ?? s.moreInSection, ...base, locale: c.locale }) : null,
1485
+ article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleListView, { items: article.children.map((child) => ({ ...child, description: null, published_at: "" })), title: s.subPages, ...base, locale: c.locale }) : null
1486
+ ] }) : null,
1487
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
1037
1488
  toc.wide,
1038
- jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl }) }) : null
1489
+ jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl, imageWidth, imageHeight }) }) : null
1039
1490
  ] }) });
1040
1491
  }
1041
- function ListPage({ list, olderHref, description, origin, path, ...base }) {
1492
+ function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }) {
1042
1493
  const c = ctx(base, "en");
1043
1494
  const { s, Link } = c;
1044
1495
  const Row = base.slots?.["list.item"];
@@ -1046,142 +1497,95 @@ function ListPage({ list, olderHref, description, origin, path, ...base }) {
1046
1497
  for (const item of list.items) groups.set(item.published_at.slice(0, 7), [...groups.get(item.published_at.slice(0, 7)) ?? [], item]);
1047
1498
  const notTranslated = list.fallback ? s.fallbackTitle.replace("{language}", languageName(list.fallback.requested_locale, c.locale)) : void 0;
1048
1499
  const jsonLdOrigin = bareOrigin(origin);
1049
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-listpage", "data-hyle-page": "list", lang: c.locale, children: [
1050
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "hyle-head", children: [
1051
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: "hyle-title", children: list.section.title }),
1052
- description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-desc", children: description }) : null,
1053
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "list.header", slots: base.slots, className: "hyle-slot-wrap" }),
1054
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1055
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "alert" }),
1056
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1057
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: notTranslated }),
1500
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-listpage", "data-hyle-page": "list", lang: c.locale, children: [
1501
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "hyle-head", children: [
1502
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "hyle-title", children: list.section.title }),
1503
+ description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: description }) : null,
1504
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "list.header", slots: base.slots, className: "hyle-slot-wrap" }),
1505
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1506
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "alert" }),
1507
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1508
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: notTranslated }),
1058
1509
  " ",
1059
1510
  s.fallbackBody
1060
1511
  ] })
1061
1512
  ] }) : null
1062
1513
  ] }),
1063
- list.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-empty", "data-slot-state": "empty", children: [
1064
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "file" }),
1065
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: s.emptyTitle }),
1066
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: s.emptyBody }),
1067
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "list.empty", slots: base.slots })
1068
- ] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { "aria-label": formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }), children: [
1069
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "hyle-year", children: formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }) }),
1070
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "hyle-items", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1071
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
1072
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1073
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "t", children: item.title }),
1074
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: item.description }) : null
1514
+ list.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-empty", "data-slot-state": "empty", children: [
1515
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "file" }),
1516
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { children: s.emptyTitle }),
1517
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: s.emptyBody }),
1518
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "list.empty", slots: base.slots })
1519
+ ] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { "aria-label": formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }), children: [
1520
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { className: "hyle-year", children: formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }) }),
1521
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "hyle-items", children: items.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: [
1522
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
1523
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1524
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "t", children: item.title }),
1525
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: item.description }) : null
1075
1526
  ] })
1076
1527
  ] }) }, item.canonical_path)) })
1077
1528
  ] }, month)),
1078
- olderHref ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { className: "hyle-pagination", "aria-label": s.pager, children: [
1079
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sp" }),
1080
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Link, { className: "hyle-btn sm", href: olderHref, rel: "next", children: [
1081
- s.older,
1082
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev" })
1083
- ] })
1084
- ] }) : null,
1085
- jsonLdOrigin && path ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LdScript, { json: listJsonLd({ list, origin: jsonLdOrigin, href: c.href, path, locale: c.locale, description }) }) : null
1529
+ olderHref ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OlderNav, { href: olderHref, c }) : null,
1530
+ jsonLdOrigin && path ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LdScript, { json: listJsonLd({ list, origin: jsonLdOrigin, href: c.href, path, locale: c.locale, description, jsonLd, cursor }) }) : null
1086
1531
  ] }) });
1087
1532
  }
1088
1533
  function NotFound({ path, homeHref = "/", ...base }) {
1089
1534
  const c = ctx(base, "en");
1090
1535
  const { Link, s } = c;
1091
1536
  const body = base.slots?.["notfound.body"];
1092
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "hyle-state", "data-hyle-page": "not-found", lang: c.locale, children: [
1093
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kind", children: s.nfKind }),
1094
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: s.nfTitle }),
1095
- body ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "notfound.body", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: s.nfBody }),
1096
- path ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dl", { className: "hyle-addr", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1097
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: s.path }),
1098
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: path })
1537
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "hyle-state", "data-hyle-page": "not-found", lang: c.locale, children: [
1538
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kind", children: s.nfKind }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { children: s.nfTitle }),
1540
+ body ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-slot": "notfound.body", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: s.nfBody }),
1541
+ path ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dl", { className: "hyle-addr", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { children: s.path }),
1543
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { children: path })
1099
1544
  ] }) }) : null,
1100
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-actions", children: [
1101
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { className: "hyle-btn primary", href: c.href(homeHref), children: s.home }),
1102
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "notfound.actions", slots: base.slots, tag: "span" })
1545
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-actions", children: [
1546
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { className: "hyle-btn primary", href: crumbHref(c.href, homeHref, c.locale), children: s.home }),
1547
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "notfound.actions", slots: base.slots, tag: "span" })
1103
1548
  ] })
1104
1549
  ] }) });
1105
1550
  }
1106
1551
  function Unavailable(base) {
1107
1552
  const c = ctx(base, "en");
1108
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "hyle-state", "data-hyle-page": "unavailable", lang: c.locale, role: "status", children: [
1109
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kind", children: c.s.unKind }),
1110
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: c.s.unTitle }),
1111
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: c.s.unBody })
1553
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "hyle-state", "data-hyle-page": "unavailable", lang: c.locale, role: "status", children: [
1554
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kind", children: c.s.unKind }),
1555
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { children: c.s.unTitle }),
1556
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: c.s.unBody })
1112
1557
  ] }) });
1113
1558
  }
1114
1559
  function Redirecting({ from, to, ...base }) {
1115
1560
  const c = ctx(base, "en");
1116
1561
  const { Link, s } = c;
1117
1562
  const extra = base.slots?.["redirecting.body"];
1118
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "hyle-state", "data-hyle-page": "redirecting", role: "status", lang: c.locale, children: [
1119
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kind", children: s.rdKind }),
1120
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: s.rdTitle }),
1121
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: s.rdBody }),
1122
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("dl", { className: "hyle-addr", children: [
1123
- from ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1124
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: s.from }),
1125
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: from })
1563
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "hyle-state", "data-hyle-page": "redirecting", role: "status", lang: c.locale, children: [
1564
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kind", children: s.rdKind }),
1565
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { children: s.rdTitle }),
1566
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: s.rdBody }),
1567
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("dl", { className: "hyle-addr", children: [
1568
+ from ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1569
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { children: s.from }),
1570
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { children: from })
1126
1571
  ] }) : null,
1127
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1128
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: s.to }),
1129
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: to })
1572
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1573
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { children: s.to }),
1574
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { children: to })
1130
1575
  ] })
1131
1576
  ] }),
1132
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fine", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(to), children: s.rdFallback }) }),
1133
- extra ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
1577
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "fine", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: c.href(to), children: s.rdFallback }) }),
1578
+ extra ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
1134
1579
  ] }) });
1135
1580
  }
1136
1581
 
1137
1582
  // src/react/index.ts
1138
1583
  var import_comments2 = require("./comments.cjs");
1139
-
1140
- // src/react/embed.tsx
1141
- var import_jsx_runtime5 = require("react/jsx-runtime");
1142
- function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, ...base }) {
1143
- const c = ctx(base, "en");
1144
- const { s, Link } = c;
1145
- const Row = base.slots?.["list.item"];
1146
- const Heading = `h${headingLevel}`;
1147
- const safe = items.filter((item) => item.canonical_path.startsWith("/"));
1148
- if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle hyle-embed", "data-layout": layout, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "list.empty", slots: base.slots }) }) : null;
1149
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle hyle-embed", "data-layout": layout, lang: c.locale, children: [
1150
- title ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading, { className: "hyle-title", children: title }) : null,
1151
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "hyle-items", children: safe.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1152
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
1153
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1154
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "t", children: item.title }),
1155
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: item.description }) : null
1156
- ] })
1157
- ] }) }, item.canonical_path)) }),
1158
- moreHref ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { className: "hyle-more", href: moreHref, children: s.viewAll }) : null
1159
- ] });
1160
- }
1161
- function HyleArticleView({ article, headingLevel = 2, ...base }) {
1162
- const { publication: pub } = article;
1163
- const c = ctx(base, pub.locale);
1164
- const Heading = `h${headingLevel}`;
1165
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle hyle-embed", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { lang: c.locale, children: [
1166
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "hyle-head", children: [
1167
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading, { className: "hyle-title", children: pub.title }),
1168
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1169
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle-meta", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) }) }) })
1170
- ] }),
1171
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Body, { article, components: base.components, locale: c.locale }),
1172
- pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("a", { className: "hyle-more", href: c.href(pub.canonical_path, pub.locale), rel: "bookmark", children: [
1173
- c.s.readAtSource,
1174
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "hyle-sr", children: [
1175
- ": ",
1176
- pub.title
1177
- ] })
1178
- ] }) : null
1179
- ] }) });
1180
- }
1584
+ var import_reactions = require("./reactions.cjs");
1181
1585
 
1182
1586
  // src/react/docs.tsx
1183
1587
  var import_docs_enhance = require("./docs-enhance.cjs");
1184
- var import_jsx_runtime6 = require("react/jsx-runtime");
1588
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1185
1589
  var ROOT_ID = "hyle-docs";
1186
1590
  var NAV_ID = "hyle-docs-nav";
1187
1591
  function navTreeOf(article) {
@@ -1205,15 +1609,15 @@ function pathTo(nodes, path) {
1205
1609
  }
1206
1610
  function Branch({ nodes, current, onPath, c }) {
1207
1611
  const { Link } = c;
1208
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: nodes.map((node) => {
1209
- const link = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
1210
- if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: link }, node.canonical_path);
1211
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
1212
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
1213
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" }),
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: nodes.map((node) => {
1613
+ const link = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
1614
+ if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: link }, node.canonical_path);
1615
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
1616
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1617
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev" }),
1214
1618
  link
1215
1619
  ] }),
1216
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Branch, { nodes: node.children, current, onPath, c })
1620
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Branch, { nodes: node.children, current, onPath, c })
1217
1621
  ] }) }, node.canonical_path);
1218
1622
  }) });
1219
1623
  }
@@ -1227,47 +1631,47 @@ function DocsPage({ article, ...base }) {
1227
1631
  const siteName = article.breadcrumbs[0]?.title ?? "";
1228
1632
  const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
1229
1633
  const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
1230
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
1231
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
1232
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
1233
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "file" }),
1634
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
1635
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
1636
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
1637
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "file" }),
1234
1638
  s.menu,
1235
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cur", children: pub.title }),
1236
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1639
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "cur", children: pub.title }),
1640
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1237
1641
  ] }),
1238
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
1239
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-side-head", children: [
1240
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: siteName }),
1241
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
1242
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "x" }) })
1642
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
1643
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-side-head", children: [
1644
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: siteName }),
1645
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
1646
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "x" }) })
1243
1647
  ] }),
1244
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1245
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
1246
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1648
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1649
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
1650
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1247
1651
  ] }),
1248
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1249
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1250
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "alert" }),
1251
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1252
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: notTranslated }),
1652
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1653
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1654
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "alert" }),
1655
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1656
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: notTranslated }),
1253
1657
  " ",
1254
1658
  s.fallbackBody
1255
1659
  ] })
1256
1660
  ] }) : null,
1257
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1258
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "hyle-title", children: pub.title }),
1259
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1260
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "hyle-updated", children: [
1261
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar" }),
1661
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1662
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "hyle-title", children: pub.title }),
1663
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1664
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { className: "hyle-updated", children: [
1665
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "calendar" }),
1262
1666
  s.updated,
1263
1667
  " ",
1264
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
1668
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
1265
1669
  ] }),
1266
1670
  toc.narrow,
1267
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Body, { article, components: base.components, locale: c.locale }),
1268
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1269
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
1270
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
1671
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Body, { article, components: base.components, locale: c.locale }),
1672
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1673
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
1674
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
1271
1675
  ] }),
1272
1676
  toc.wide
1273
1677
  ] }) });
@@ -1280,15 +1684,24 @@ function DocsPage({ article, ...base }) {
1280
1684
  HastContent,
1281
1685
  HastLimitError,
1282
1686
  HyleArticleView,
1687
+ HyleBody,
1283
1688
  HyleListView,
1689
+ HyleReactions,
1690
+ HyleToc,
1284
1691
  ListPage,
1285
1692
  MermaidDiagram,
1286
1693
  NotFound,
1287
1694
  Redirecting,
1288
1695
  TrustedServerHtml,
1289
1696
  Unavailable,
1697
+ VIEWER_LABELS_EN,
1698
+ holdPrintUntil,
1699
+ installPrintShortcut,
1700
+ isClampedSource,
1701
+ isLargeDiagram,
1290
1702
  isSafeUrl,
1291
1703
  sanitizeHast,
1292
1704
  scopeId,
1293
- stringsFor
1705
+ stringsFor,
1706
+ stripMermaidConfig
1294
1707
  });