@tdacorp/hyle-sdk 0.17.0 → 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.
- package/README.md +155 -28
- package/dist/check-routes-bin.js +38 -13
- package/dist/chunk-56Y24XBV.js +840 -0
- package/dist/{chunk-MGSUQBDW.js → chunk-75JFLML4.js} +176 -14
- package/dist/chunk-HJX57NLI.js +1105 -0
- package/dist/chunk-K5VDLROQ.js +145 -0
- package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
- package/dist/chunk-U74B7AUG.js +398 -0
- package/dist/{chunk-6VOHFFA5.js → chunk-X2TLYM7Y.js} +2 -2
- package/dist/client-41fU6OY2.d.cts +201 -0
- package/dist/client-LwzHwqpM.d.ts +201 -0
- package/dist/code-copy.cjs +72 -0
- package/dist/code-copy.d.cts +15 -0
- package/dist/code-copy.d.ts +15 -0
- package/dist/code-copy.js +48 -0
- package/dist/comments.cjs +728 -275
- package/dist/comments.d.cts +66 -3
- package/dist/comments.d.ts +66 -3
- package/dist/comments.js +409 -326
- package/dist/{diagram-viewer-FJPED4SN.js → diagram-viewer-XY3CG75U.js} +62 -21
- package/dist/{embed-BmdwA2G9.d.cts → embed-BUFRQboD.d.ts} +2 -2
- package/dist/{embed-DNTZ2UXv.d.ts → embed-CYt-q13P.d.cts} +2 -2
- package/dist/fragment-alias.cjs +51 -0
- package/dist/fragment-alias.d.cts +7 -0
- package/dist/fragment-alias.d.ts +7 -0
- package/dist/fragment-alias.js +27 -0
- package/dist/html.cjs +881 -0
- package/dist/html.d.cts +20 -0
- package/dist/html.d.ts +20 -0
- package/dist/html.js +45 -0
- package/dist/index.cjs +181 -14
- package/dist/index.d.cts +14 -62
- package/dist/index.d.ts +14 -62
- package/dist/index.js +11 -1
- package/dist/{labels-nmukKYgL.d.ts → labels-CrA-iqTN.d.cts} +9 -0
- package/dist/{labels-nmukKYgL.d.cts → labels-CrA-iqTN.d.ts} +9 -0
- package/dist/mermaid-diagram.cjs +401 -125
- package/dist/mermaid-diagram.d.cts +23 -7
- package/dist/mermaid-diagram.d.ts +23 -7
- package/dist/mermaid-diagram.js +204 -51
- package/dist/mermaid-image.cjs +134 -60
- package/dist/mermaid-image.d.cts +4 -3
- package/dist/mermaid-image.d.ts +4 -3
- package/dist/mermaid-image.js +27 -28
- package/dist/next.cjs +627 -264
- package/dist/next.d.cts +11 -8
- package/dist/next.d.ts +11 -8
- package/dist/next.js +39 -12
- package/dist/print-coordinator.cjs +157 -0
- package/dist/print-coordinator.d.cts +27 -0
- package/dist/print-coordinator.d.ts +27 -0
- package/dist/print-coordinator.js +83 -0
- package/dist/react.cjs +556 -226
- package/dist/react.d.cts +136 -29
- package/dist/react.d.ts +136 -29
- package/dist/react.js +23 -3
- package/dist/reactions.cjs +653 -0
- package/dist/reactions.d.cts +27 -0
- package/dist/reactions.d.ts +27 -0
- package/dist/reactions.js +364 -0
- package/dist/{resolve-Ae7UFjsQ.d.ts → resolve-BjAK0k_Y.d.ts} +2 -2
- package/dist/{resolve-euZ4-aC9.d.cts → resolve-eI1muCKL.d.cts} +2 -2
- package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
- package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
- package/dist/sanitize-ijiWjEm9.d.cts +23 -0
- package/dist/sanitize-ijiWjEm9.d.ts +23 -0
- package/dist/styles.css +96 -25
- package/dist/toc-spy.cjs +59 -0
- package/dist/toc-spy.d.cts +15 -0
- package/dist/toc-spy.d.ts +15 -0
- package/dist/toc-spy.js +35 -0
- package/dist/{types-Czt887Iv.d.cts → types-3F0wqD-o.d.cts} +26 -2
- package/dist/{types-Czt887Iv.d.ts → types-3F0wqD-o.d.ts} +26 -2
- package/dist/use-cache.cjs +37 -11
- package/dist/use-cache.d.cts +12 -5
- package/dist/use-cache.d.ts +12 -5
- package/dist/use-cache.js +7 -7
- package/dist/youtube-facade.cjs +50 -0
- package/dist/youtube-facade.d.cts +17 -0
- package/dist/youtube-facade.d.ts +17 -0
- package/dist/youtube-facade.js +26 -0
- package/package.json +16 -3
- package/dist/chunk-DMK4XQLU.js +0 -1556
- package/dist/chunk-PJMJMP66.js +0 -63
- package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
- 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: [
|
|
@@ -129,8 +145,15 @@ var isScalar = (v) => typeof v === "string" || typeof v === "number" || typeof v
|
|
|
129
145
|
var matches = (re) => (v) => typeof v === "string" && re.test(v);
|
|
130
146
|
var ID_PREFIX = "user-content-";
|
|
131
147
|
var scopeId = (id) => id.startsWith(ID_PREFIX) ? id : ID_PREFIX + id;
|
|
132
|
-
var ID_BODY = /^[\p{L}\p{N}
|
|
133
|
-
|
|
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
|
+
}
|
|
134
157
|
var CLASS_TOKEN = /^[A-Za-z_][\w:-]*$/;
|
|
135
158
|
var classTokens = (v) => {
|
|
136
159
|
const tokens = Array.isArray(v) ? v : typeof v === "string" ? v.split(/\s+/) : [];
|
|
@@ -143,6 +166,7 @@ var isLength = matches(/^[\d.]+(em|px|%)?$/);
|
|
|
143
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"]);
|
|
144
167
|
var STYLE_LENGTH = /^(-?\d+(?:\.\d+)?)(em|px|%)?$/;
|
|
145
168
|
var MAX_STYLE_MAGNITUDE = 100;
|
|
169
|
+
var MAX_MARGIN_MAGNITUDE = 20;
|
|
146
170
|
function isKatexStyle(v, ctx2) {
|
|
147
171
|
if (typeof v !== "string" || !ctx2.katex) return false;
|
|
148
172
|
return v.split(";").filter((d) => d !== "").every((decl) => {
|
|
@@ -150,7 +174,8 @@ function isKatexStyle(v, ctx2) {
|
|
|
150
174
|
if (extra.length > 0 || prop === void 0 || value === void 0) return false;
|
|
151
175
|
if (prop === "position") return value === "relative";
|
|
152
176
|
const m = STYLE_LENGTH.exec(value);
|
|
153
|
-
|
|
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;
|
|
154
179
|
});
|
|
155
180
|
}
|
|
156
181
|
function isSafeUrl(value, kind) {
|
|
@@ -183,6 +208,8 @@ function diagramRender(value) {
|
|
|
183
208
|
const m = typeof value === "string" ? RENDER_REF.exec(value) : null;
|
|
184
209
|
return m ? { src: hostAssetSrc(m[1]), width: Number(m[2]), height: Number(m[3]) } : void 0;
|
|
185
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;
|
|
186
213
|
var heading = { id: isIdValue, className: isClass };
|
|
187
214
|
var ATTRS = new Map(
|
|
188
215
|
Object.entries({
|
|
@@ -198,6 +225,7 @@ var ATTRS = new Map(
|
|
|
198
225
|
tbody: {},
|
|
199
226
|
tr: {},
|
|
200
227
|
ol: {},
|
|
228
|
+
kbd: {},
|
|
201
229
|
ul: { className: isClass },
|
|
202
230
|
li: { id: isIdValue, className: isClass },
|
|
203
231
|
h1: heading,
|
|
@@ -206,8 +234,8 @@ var ATTRS = new Map(
|
|
|
206
234
|
h4: heading,
|
|
207
235
|
h5: heading,
|
|
208
236
|
h6: heading,
|
|
209
|
-
a: { href: isHref, id: isIdValue, ariaDescribedBy: isIdValue, ariaLabel: isString, dataFootnoteRef: isScalar, dataFootnoteBackref: isScalar, className: isClass },
|
|
210
|
-
img: { src: isSrc, alt: isString, width: isPixels, height: isPixels },
|
|
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 },
|
|
211
239
|
table: {},
|
|
212
240
|
th: { scope: matches(/^(row|col|rowgroup|colgroup)$/), align: isAlign },
|
|
213
241
|
td: { align: isAlign },
|
|
@@ -230,8 +258,10 @@ function textOf(node, depth = 0) {
|
|
|
230
258
|
if (node.type === "text") return typeof node.value === "string" ? node.value : "";
|
|
231
259
|
return Array.isArray(node.children) ? node.children.map((c) => textOf(c, depth + 1)).join("") : "";
|
|
232
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();
|
|
233
263
|
var CALLOUT_MARKER = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i;
|
|
234
|
-
var CALLOUT_KIND = { note: "note", tip: "tip", important: "
|
|
264
|
+
var CALLOUT_KIND = { note: "note", tip: "tip", important: "important", warning: "warning", caution: "caution" };
|
|
235
265
|
function toCallout(children) {
|
|
236
266
|
const first = children.find((c) => c.type === "element");
|
|
237
267
|
const lead = first?.tagName === "p" ? first.children[0] : void 0;
|
|
@@ -243,6 +273,21 @@ function toCallout(children) {
|
|
|
243
273
|
const kind = CALLOUT_KIND[(marker[1] ?? "note").toLowerCase()] ?? "note";
|
|
244
274
|
return { type: "element", tagName: "callout", properties: { kind }, children: [...body, ...children.slice(children.indexOf(first) + 1)] };
|
|
245
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
|
+
}
|
|
246
291
|
function clean(node, depth, ctx2, budget) {
|
|
247
292
|
if (!isObject(node) || depth > MAX_DEPTH) return [];
|
|
248
293
|
if (++budget.nodes > MAX_NODES) throw new HastLimitError("content has too many nodes");
|
|
@@ -276,6 +321,11 @@ function clean(node, depth, ctx2, budget) {
|
|
|
276
321
|
}
|
|
277
322
|
for (const key of ["id", "ariaDescribedBy"]) if (typeof properties[key] === "string") properties[key] = scopeId(properties[key]);
|
|
278
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
|
+
}
|
|
279
329
|
if (tag === "blockquote") {
|
|
280
330
|
const callout = toCallout(children);
|
|
281
331
|
if (callout) return [callout];
|
|
@@ -287,9 +337,9 @@ function sanitizeHast(tree, title, description) {
|
|
|
287
337
|
const raw = isObject(tree) && tree.type === "root" && Array.isArray(tree.children) ? tree.children : [];
|
|
288
338
|
const elements = raw.filter((n) => isObject(n) && n.type === "element");
|
|
289
339
|
const [first] = elements;
|
|
290
|
-
const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && textOf(first)
|
|
340
|
+
const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && collapse(textOf(first)) === collapse(title) ? first : void 0;
|
|
291
341
|
const lead = elements[skip ? 1 : 0];
|
|
292
|
-
const repeat = description && isObject(lead) && lead.tagName === "p" && textOf(lead)
|
|
342
|
+
const repeat = description && isObject(lead) && lead.tagName === "p" && collapse(textOf(lead)).startsWith(collapse(description)) && !holdsEmbed(lead) ? lead : void 0;
|
|
293
343
|
const budget = { nodes: 0, text: 0 };
|
|
294
344
|
return { type: "root", children: raw.filter((n) => n !== skip && n !== repeat).flatMap((n) => clean(n, 0, { katex: false }, budget)) };
|
|
295
345
|
}
|
|
@@ -328,6 +378,7 @@ var COMMENT_LABELS_EN = {
|
|
|
328
378
|
removed: "This comment was removed.",
|
|
329
379
|
removedByModerator: "This comment was removed by a moderator.",
|
|
330
380
|
removedByAuthor: "This comment was deleted by its author.",
|
|
381
|
+
unrenderable: "This comment cannot be displayed.",
|
|
331
382
|
depthEnd: "Replies end at this depth",
|
|
332
383
|
held: "Awaiting approval.",
|
|
333
384
|
heldBanner: "Thanks, your comment is awaiting approval",
|
|
@@ -354,8 +405,39 @@ var COMMENT_LABELS_EN = {
|
|
|
354
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.",
|
|
355
406
|
expired: "Your session ended. Sign in again to post. Your text is kept.",
|
|
356
407
|
more: "Load more comments",
|
|
357
|
-
truncated: "
|
|
358
|
-
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"
|
|
359
441
|
};
|
|
360
442
|
var COMMENT_LABELS_FR = {
|
|
361
443
|
heading: "Commentaires",
|
|
@@ -390,6 +472,7 @@ var COMMENT_LABELS_FR = {
|
|
|
390
472
|
removed: "Ce commentaire a \xE9t\xE9 retir\xE9.",
|
|
391
473
|
removedByModerator: "Ce commentaire a \xE9t\xE9 retir\xE9 par un mod\xE9rateur.",
|
|
392
474
|
removedByAuthor: "Ce commentaire a \xE9t\xE9 supprim\xE9 par son auteur.",
|
|
475
|
+
unrenderable: "Ce commentaire ne peut pas \xEAtre affich\xE9.",
|
|
393
476
|
depthEnd: "Les r\xE9ponses s'arr\xEAtent \xE0 ce niveau",
|
|
394
477
|
held: "En attente d'approbation.",
|
|
395
478
|
heldBanner: "Merci, votre commentaire est en attente d'approbation",
|
|
@@ -416,8 +499,39 @@ var COMMENT_LABELS_FR = {
|
|
|
416
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.",
|
|
417
500
|
expired: "Votre session a expir\xE9. Reconnectez-vous pour publier. Votre texte est conserv\xE9.",
|
|
418
501
|
more: "Charger plus de commentaires",
|
|
419
|
-
truncated: "
|
|
420
|
-
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"
|
|
421
535
|
};
|
|
422
536
|
var COMMENT_LABELS_ES = {
|
|
423
537
|
heading: "Comentarios",
|
|
@@ -452,6 +566,7 @@ var COMMENT_LABELS_ES = {
|
|
|
452
566
|
removed: "Este comentario fue eliminado.",
|
|
453
567
|
removedByModerator: "Un moderador elimin\xF3 este comentario.",
|
|
454
568
|
removedByAuthor: "Su autor elimin\xF3 este comentario.",
|
|
569
|
+
unrenderable: "Este comentario no se puede mostrar.",
|
|
455
570
|
depthEnd: "Las respuestas terminan en este nivel",
|
|
456
571
|
held: "Pendiente de aprobaci\xF3n.",
|
|
457
572
|
heldBanner: "Gracias, tu comentario est\xE1 pendiente de aprobaci\xF3n",
|
|
@@ -478,8 +593,39 @@ var COMMENT_LABELS_ES = {
|
|
|
478
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.",
|
|
479
594
|
expired: "Tu sesi\xF3n termin\xF3. Inicia sesi\xF3n de nuevo para publicar. Tu texto se conserva.",
|
|
480
595
|
more: "Cargar m\xE1s comentarios",
|
|
481
|
-
truncated: "
|
|
482
|
-
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"
|
|
483
629
|
};
|
|
484
630
|
|
|
485
631
|
// src/react/viewer/labels.ts
|
|
@@ -491,15 +637,15 @@ var VIEWER_LABELS_EN = {
|
|
|
491
637
|
zoomIn: "Zoom in",
|
|
492
638
|
zoomOut: "Zoom out",
|
|
493
639
|
fit: "Fit to window",
|
|
494
|
-
actual: "
|
|
640
|
+
actual: "100%: actual size",
|
|
495
641
|
search: "Find in diagram",
|
|
496
642
|
searchPlaceholder: "Find",
|
|
497
643
|
noMatch: "No match",
|
|
498
644
|
matchOf: "{n} of {total}",
|
|
499
|
-
copySource: "
|
|
500
|
-
downloadSvg: "
|
|
501
|
-
downloadPng: "
|
|
502
|
-
copyImage: "
|
|
645
|
+
copySource: "MMD: copy diagram source",
|
|
646
|
+
downloadSvg: "SVG: download",
|
|
647
|
+
downloadPng: "PNG: download",
|
|
648
|
+
copyImage: "IMG: copy as image",
|
|
503
649
|
pngScale: "PNG scale",
|
|
504
650
|
fullscreen: "Fullscreen",
|
|
505
651
|
exitFullscreen: "Exit fullscreen",
|
|
@@ -512,7 +658,16 @@ var VIEWER_LABELS_EN = {
|
|
|
512
658
|
legendDownstream: "Downstream",
|
|
513
659
|
outgoing: "outgoing",
|
|
514
660
|
tracing: "{label}: {up} upstream, {down} downstream",
|
|
515
|
-
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."
|
|
516
671
|
};
|
|
517
672
|
var VIEWER_LABELS_FR = {
|
|
518
673
|
expand: "Agrandir le sch\xE9ma",
|
|
@@ -522,15 +677,15 @@ var VIEWER_LABELS_FR = {
|
|
|
522
677
|
zoomIn: "Zoom avant",
|
|
523
678
|
zoomOut: "Zoom arri\xE8re",
|
|
524
679
|
fit: "Ajuster \xE0 la fen\xEAtre",
|
|
525
|
-
actual: "
|
|
680
|
+
actual: "100% : taille r\xE9elle",
|
|
526
681
|
search: "Rechercher dans le sch\xE9ma",
|
|
527
682
|
searchPlaceholder: "Rechercher",
|
|
528
683
|
noMatch: "Aucun r\xE9sultat",
|
|
529
684
|
matchOf: "{n} sur {total}",
|
|
530
|
-
copySource: "
|
|
531
|
-
downloadSvg: "
|
|
532
|
-
downloadPng: "
|
|
533
|
-
copyImage: "
|
|
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",
|
|
534
689
|
pngScale: "\xC9chelle du PNG",
|
|
535
690
|
fullscreen: "Plein \xE9cran",
|
|
536
691
|
exitFullscreen: "Quitter le plein \xE9cran",
|
|
@@ -543,7 +698,16 @@ var VIEWER_LABELS_FR = {
|
|
|
543
698
|
legendDownstream: "En aval",
|
|
544
699
|
outgoing: "sortants",
|
|
545
700
|
tracing: "{label} : {up} en amont, {down} en aval",
|
|
546
|
-
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."
|
|
547
711
|
};
|
|
548
712
|
var VIEWER_LABELS_ES = {
|
|
549
713
|
expand: "Ampliar el diagrama",
|
|
@@ -553,15 +717,15 @@ var VIEWER_LABELS_ES = {
|
|
|
553
717
|
zoomIn: "Acercar",
|
|
554
718
|
zoomOut: "Alejar",
|
|
555
719
|
fit: "Ajustar a la ventana",
|
|
556
|
-
actual: "
|
|
720
|
+
actual: "100%: tama\xF1o real",
|
|
557
721
|
search: "Buscar en el diagrama",
|
|
558
722
|
searchPlaceholder: "Buscar",
|
|
559
723
|
noMatch: "Sin resultados",
|
|
560
724
|
matchOf: "{n} de {total}",
|
|
561
|
-
copySource: "
|
|
562
|
-
downloadSvg: "
|
|
563
|
-
downloadPng: "
|
|
564
|
-
copyImage: "
|
|
725
|
+
copySource: "MMD: copiar el c\xF3digo del diagrama",
|
|
726
|
+
downloadSvg: "SVG: descargar",
|
|
727
|
+
downloadPng: "PNG: descargar",
|
|
728
|
+
copyImage: "IMG: copiar como imagen",
|
|
565
729
|
pngScale: "Escala del PNG",
|
|
566
730
|
fullscreen: "Pantalla completa",
|
|
567
731
|
exitFullscreen: "Salir de pantalla completa",
|
|
@@ -574,7 +738,16 @@ var VIEWER_LABELS_ES = {
|
|
|
574
738
|
legendDownstream: "Aguas abajo",
|
|
575
739
|
outgoing: "salientes",
|
|
576
740
|
tracing: "{label}: {up} aguas arriba, {down} aguas abajo",
|
|
577
|
-
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."
|
|
578
751
|
};
|
|
579
752
|
|
|
580
753
|
// src/react/strings.ts
|
|
@@ -593,6 +766,14 @@ var en = {
|
|
|
593
766
|
warning: "Heads up",
|
|
594
767
|
tip: "Tip",
|
|
595
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",
|
|
596
777
|
diagram: "Diagram",
|
|
597
778
|
diagramError: "This diagram could not be rendered.",
|
|
598
779
|
diagramLoading: "Loading the diagram",
|
|
@@ -645,6 +826,14 @@ var fr = {
|
|
|
645
826
|
warning: "Attention",
|
|
646
827
|
tip: "Astuce",
|
|
647
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",
|
|
648
837
|
diagram: "Sch\xE9ma",
|
|
649
838
|
diagramError: "Ce sch\xE9ma n'a pas pu \xEAtre affich\xE9.",
|
|
650
839
|
diagramLoading: "Chargement du sch\xE9ma",
|
|
@@ -697,6 +886,14 @@ var es = {
|
|
|
697
886
|
warning: "Atenci\xF3n",
|
|
698
887
|
tip: "Consejo",
|
|
699
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",
|
|
700
897
|
diagram: "Diagrama",
|
|
701
898
|
diagramError: "No se pudo mostrar este diagrama.",
|
|
702
899
|
diagramLoading: "Cargando el diagrama",
|
|
@@ -754,14 +951,15 @@ function formatDate(iso, locale, options = { dateStyle: "medium" }) {
|
|
|
754
951
|
}
|
|
755
952
|
|
|
756
953
|
// src/react/content.tsx
|
|
954
|
+
var import_youtube_facade = require("./youtube-facade.cjs");
|
|
757
955
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
758
956
|
function plainText(node) {
|
|
759
957
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
760
958
|
if (Array.isArray(node)) return node.map(plainText).join("");
|
|
761
959
|
return (0, import_react.isValidElement)(node) ? plainText(node.props.children) : "";
|
|
762
960
|
}
|
|
763
|
-
var CALLOUT_ICON = { note: "info", tip: "check-circle", warning: "alert", caution: "x-circle" };
|
|
764
|
-
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 }) {
|
|
765
963
|
const Link = c.Link ?? "a";
|
|
766
964
|
const Img = c.Image ?? "img";
|
|
767
965
|
const A = ({ href, children, ...rest }) => {
|
|
@@ -772,10 +970,11 @@ function buildComponents(c, s) {
|
|
|
772
970
|
}
|
|
773
971
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: url, rel: "noopener noreferrer", ...rest, children });
|
|
774
972
|
};
|
|
775
|
-
let
|
|
973
|
+
let eager = opensWithImage;
|
|
776
974
|
const Image = (props) => {
|
|
777
975
|
if (typeof props.src !== "string") return null;
|
|
778
|
-
const first =
|
|
976
|
+
const first = eager;
|
|
977
|
+
eager = false;
|
|
779
978
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Img, { loading: first ? "eager" : "lazy", ...first ? { fetchPriority: "high" } : {}, decoding: "async", ...props });
|
|
780
979
|
};
|
|
781
980
|
const Pre = ({ children, ...rest }) => {
|
|
@@ -784,13 +983,22 @@ function buildComponents(c, s) {
|
|
|
784
983
|
const pre = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { tabIndex: 0, ...rest, children });
|
|
785
984
|
if (c.CodeBlock) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.CodeBlock, { code: plainText(children), language, children: pre });
|
|
786
985
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("figure", { className: "hyle-codeblock", "data-slot-component": "CodeBlock", children: [
|
|
787
|
-
language ? /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
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,
|
|
788
996
|
pre
|
|
789
997
|
] });
|
|
790
998
|
};
|
|
791
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 }) });
|
|
792
1000
|
const Callout = ({ kind, children }) => {
|
|
793
|
-
const k =
|
|
1001
|
+
const k = Object.hasOwn(CALLOUT_ICON, String(kind)) ? kind : "note";
|
|
794
1002
|
const title = s[k];
|
|
795
1003
|
if (c.Callout) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.Callout, { kind: k, title, children });
|
|
796
1004
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("aside", { className: "hyle-callout", "data-kind": k, "data-slot-component": "Callout", role: "note", children: [
|
|
@@ -816,17 +1024,30 @@ function buildComponents(c, s) {
|
|
|
816
1024
|
};
|
|
817
1025
|
const Heading = (level) => function HyleHeading({ id, children, ...rest }) {
|
|
818
1026
|
const Tag = `h${level}`;
|
|
1027
|
+
const anchored = typeof id === "string" && !String(rest.className ?? "").split(" ").includes("sr-only");
|
|
819
1028
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tag, { id, ...rest, children: [
|
|
820
|
-
|
|
1029
|
+
anchored ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "hyle-anchor", href: `#${id}`, "aria-label": s.anchor }) : null,
|
|
821
1030
|
children
|
|
822
1031
|
] });
|
|
823
1032
|
};
|
|
824
|
-
const
|
|
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 } : {} };
|
|
825
1043
|
const overrides = ["a", "img", "code", "pre", "table", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6"];
|
|
826
1044
|
for (const key of overrides) if (c[key]) defaults[key] = c[key];
|
|
827
1045
|
return defaults;
|
|
828
1046
|
}
|
|
829
|
-
function HastContent(
|
|
1047
|
+
function HastContent(props) {
|
|
1048
|
+
return renderHast(props, false);
|
|
1049
|
+
}
|
|
1050
|
+
function renderHast({ tree, title, description, components = {}, locale }, interactive) {
|
|
830
1051
|
let root;
|
|
831
1052
|
try {
|
|
832
1053
|
root = sanitizeHast(tree, title, description);
|
|
@@ -838,11 +1059,13 @@ function HastContent({ tree, title, description, components = {}, locale }) {
|
|
|
838
1059
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: s.contentError })
|
|
839
1060
|
] });
|
|
840
1061
|
}
|
|
1062
|
+
const lead = root.children.find((n) => n.type !== "text" || n.value.trim() !== "");
|
|
1063
|
+
const opensWithImage = lead?.type === "element" && lead.tagName === "figure";
|
|
841
1064
|
return (0, import_hast_util_to_jsx_runtime.toJsxRuntime)(root, {
|
|
842
1065
|
Fragment: import_react.Fragment,
|
|
843
1066
|
jsx: import_jsx_runtime2.jsx,
|
|
844
1067
|
jsxs: import_jsx_runtime2.jsxs,
|
|
845
|
-
components: buildComponents(components, stringsFor(locale)),
|
|
1068
|
+
components: buildComponents(components, stringsFor(locale), { opensWithImage, interactive }),
|
|
846
1069
|
elementAttributeNameCase: "react",
|
|
847
1070
|
stylePropertyNameCase: "dom"
|
|
848
1071
|
});
|
|
@@ -851,48 +1074,134 @@ function TrustedServerHtml({ html }) {
|
|
|
851
1074
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { dangerouslySetInnerHTML: { __html: hostAssetHtml(html) } });
|
|
852
1075
|
}
|
|
853
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
|
+
|
|
854
1096
|
// src/react/index.ts
|
|
855
1097
|
var import_mermaid_diagram2 = require("./mermaid-diagram.cjs");
|
|
856
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
|
+
|
|
857
1166
|
// src/react/pages.tsx
|
|
858
1167
|
var import_comments = require("./comments.cjs");
|
|
859
1168
|
|
|
860
1169
|
// src/react/embed.tsx
|
|
861
|
-
var
|
|
1170
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
862
1171
|
function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, olderHref, ...base }) {
|
|
863
1172
|
const c = ctx(base, "en");
|
|
864
1173
|
const { s, Link } = c;
|
|
865
1174
|
const Row = base.slots?.["list.item"];
|
|
866
1175
|
const Heading = `h${headingLevel}`;
|
|
867
1176
|
const safe = items.filter((item) => item.canonical_path.startsWith("/"));
|
|
868
|
-
if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0,
|
|
869
|
-
return /* @__PURE__ */ (0,
|
|
870
|
-
title ? /* @__PURE__ */ (0,
|
|
871
|
-
/* @__PURE__ */ (0,
|
|
872
|
-
item.published_at ? /* @__PURE__ */ (0,
|
|
873
|
-
/* @__PURE__ */ (0,
|
|
874
|
-
/* @__PURE__ */ (0,
|
|
875
|
-
item.description ? /* @__PURE__ */ (0,
|
|
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
|
|
876
1185
|
] })
|
|
877
1186
|
] }) }, item.canonical_path)) }),
|
|
878
|
-
olderHref ? /* @__PURE__ */ (0,
|
|
879
|
-
moreHref ? /* @__PURE__ */ (0,
|
|
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
|
|
880
1189
|
] });
|
|
881
1190
|
}
|
|
882
1191
|
function HyleArticleView({ article, headingLevel = 2, ...base }) {
|
|
883
1192
|
const { publication: pub } = article;
|
|
884
1193
|
const c = ctx(base, pub.locale);
|
|
885
1194
|
const Heading = `h${headingLevel}`;
|
|
886
|
-
return /* @__PURE__ */ (0,
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
889
|
-
pub.description ? /* @__PURE__ */ (0,
|
|
890
|
-
/* @__PURE__ */ (0,
|
|
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) }) }) })
|
|
891
1200
|
] }),
|
|
892
|
-
/* @__PURE__ */ (0,
|
|
893
|
-
pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0,
|
|
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: [
|
|
894
1203
|
c.s.readAtSource,
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
1204
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "hyle-sr", children: [
|
|
896
1205
|
": ",
|
|
897
1206
|
pub.title
|
|
898
1207
|
] })
|
|
@@ -1002,13 +1311,14 @@ function listJsonLd({ list, origin, href, path, locale, description, jsonLd, cur
|
|
|
1002
1311
|
}
|
|
1003
1312
|
|
|
1004
1313
|
// src/react/pages.tsx
|
|
1005
|
-
var
|
|
1314
|
+
var import_toc_spy = require("./toc-spy.cjs");
|
|
1315
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1006
1316
|
function Slot({ name, slots, tag: Tag = "div", className }) {
|
|
1007
1317
|
const fill = slots?.[name];
|
|
1008
|
-
return fill ? /* @__PURE__ */ (0,
|
|
1318
|
+
return fill ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
|
|
1009
1319
|
}
|
|
1010
1320
|
function Shell({ children }) {
|
|
1011
|
-
return /* @__PURE__ */ (0,
|
|
1321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle-page", children }) });
|
|
1012
1322
|
}
|
|
1013
1323
|
function ctx(p, fallbackLocale) {
|
|
1014
1324
|
const locale = p.locale ?? fallbackLocale;
|
|
@@ -1017,29 +1327,29 @@ function ctx(p, fallbackLocale) {
|
|
|
1017
1327
|
function Pager({ prev, next, c }) {
|
|
1018
1328
|
if (!prev && !next) return null;
|
|
1019
1329
|
const { Link, s } = c;
|
|
1020
|
-
return /* @__PURE__ */ (0,
|
|
1021
|
-
prev ? /* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
1024
1334
|
s.prev
|
|
1025
1335
|
] }),
|
|
1026
|
-
/* @__PURE__ */ (0,
|
|
1027
|
-
] }) : /* @__PURE__ */ (0,
|
|
1028
|
-
next ? /* @__PURE__ */ (0,
|
|
1029
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
1030
1340
|
s.next,
|
|
1031
|
-
/* @__PURE__ */ (0,
|
|
1341
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" })
|
|
1032
1342
|
] }),
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "ttl", children: next.title })
|
|
1034
1344
|
] }) : null
|
|
1035
1345
|
] });
|
|
1036
1346
|
}
|
|
1037
1347
|
function OlderNav({ href, c }) {
|
|
1038
|
-
return /* @__PURE__ */ (0,
|
|
1039
|
-
/* @__PURE__ */ (0,
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
1041
1351
|
c.s.older,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1352
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" })
|
|
1043
1353
|
] })
|
|
1044
1354
|
] });
|
|
1045
1355
|
}
|
|
@@ -1050,54 +1360,64 @@ function TocList({ toc }) {
|
|
|
1050
1360
|
if (entry.depth === 3 && last) last.subs.push(entry);
|
|
1051
1361
|
else groups.push({ entry, subs: [] });
|
|
1052
1362
|
}
|
|
1053
|
-
return /* @__PURE__ */ (0,
|
|
1054
|
-
/* @__PURE__ */ (0,
|
|
1055
|
-
subs.length > 0 ? /* @__PURE__ */ (0,
|
|
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
|
|
1056
1366
|
] }, entry.id)) });
|
|
1057
1367
|
}
|
|
1058
|
-
function Toc({ toc, c, aside }) {
|
|
1368
|
+
function Toc({ toc, c, aside, spy, className }) {
|
|
1059
1369
|
const entries = toc.filter((t) => t.depth === 2 || t.depth === 3);
|
|
1060
1370
|
if (entries.length === 0 && !aside) return { narrow: null, wide: null };
|
|
1061
1371
|
const { s } = c;
|
|
1372
|
+
const classes = (own) => className ? `${className} ${own}` : own;
|
|
1062
1373
|
return {
|
|
1063
|
-
narrow: entries.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1064
|
-
/* @__PURE__ */ (0,
|
|
1065
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
1066
1377
|
s.toc,
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
|
|
1068
1379
|
] }),
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
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 }) })
|
|
1070
1381
|
] }),
|
|
1071
|
-
wide: /* @__PURE__ */ (0,
|
|
1072
|
-
entries.length === 0 ? null : /* @__PURE__ */ (0,
|
|
1073
|
-
/* @__PURE__ */ (0,
|
|
1074
|
-
/* @__PURE__ */ (0,
|
|
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 }) })
|
|
1075
1386
|
] }),
|
|
1076
|
-
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
|
|
1077
1389
|
] })
|
|
1078
1390
|
};
|
|
1079
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
|
+
}
|
|
1080
1396
|
function Body({ article, components, locale }) {
|
|
1081
1397
|
const { content, publication } = article;
|
|
1082
|
-
|
|
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 });
|
|
1083
1403
|
}
|
|
1084
1404
|
function Languages({ alternates, current, c }) {
|
|
1085
1405
|
if (alternates.length < 2) return null;
|
|
1086
1406
|
const { Link, s } = c;
|
|
1087
|
-
return /* @__PURE__ */ (0,
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1089
|
-
/* @__PURE__ */ (0,
|
|
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) => {
|
|
1090
1410
|
const label = languageName(a.locale, a.locale);
|
|
1091
|
-
return /* @__PURE__ */ (0,
|
|
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);
|
|
1092
1412
|
}) })
|
|
1093
1413
|
] });
|
|
1094
1414
|
}
|
|
1095
1415
|
function LdScript({ json }) {
|
|
1096
|
-
return /* @__PURE__ */ (0,
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
|
|
1097
1417
|
}
|
|
1098
1418
|
function Crumbs({ items, c }) {
|
|
1099
1419
|
const { Link } = c;
|
|
1100
|
-
return /* @__PURE__ */ (0,
|
|
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)) }) });
|
|
1101
1421
|
}
|
|
1102
1422
|
function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }) {
|
|
1103
1423
|
const { publication: pub } = article;
|
|
@@ -1107,66 +1427,66 @@ function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth
|
|
|
1107
1427
|
const author = articleAuthor(article, jsonLd)?.name;
|
|
1108
1428
|
const modified = modifiedAt(pub);
|
|
1109
1429
|
const words = wordCountOf(pub);
|
|
1110
|
-
const toc = Toc({ toc: article.toc, c, aside: /* @__PURE__ */ (0,
|
|
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" }) });
|
|
1111
1431
|
const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
|
|
1112
|
-
return /* @__PURE__ */ (0,
|
|
1113
|
-
/* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1117
|
-
pub.description ? /* @__PURE__ */ (0,
|
|
1118
|
-
/* @__PURE__ */ (0,
|
|
1119
|
-
author ? /* @__PURE__ */ (0,
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
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: [
|
|
1123
1443
|
s.by,
|
|
1124
1444
|
" "
|
|
1125
1445
|
] }),
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1446
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "by", children: author })
|
|
1127
1447
|
] })
|
|
1128
1448
|
] }) : null,
|
|
1129
|
-
/* @__PURE__ */ (0,
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
1132
1452
|
] }),
|
|
1133
|
-
modified ? /* @__PURE__ */ (0,
|
|
1134
|
-
/* @__PURE__ */ (0,
|
|
1453
|
+
modified ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar" }),
|
|
1135
1455
|
s.updated,
|
|
1136
1456
|
" ",
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: modified, title: modified, children: formatDate(modified, c.locale) })
|
|
1138
1458
|
] }) : null,
|
|
1139
|
-
words ? /* @__PURE__ */ (0,
|
|
1140
|
-
/* @__PURE__ */ (0,
|
|
1459
|
+
words ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "clock" }),
|
|
1141
1461
|
s.readingTime.replace("{n}", String(readingMinutes(words)))
|
|
1142
1462
|
] }) : null,
|
|
1143
|
-
/* @__PURE__ */ (0,
|
|
1144
|
-
/* @__PURE__ */ (0,
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
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) })
|
|
1146
1466
|
] }),
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
|
|
1148
1468
|
] }),
|
|
1149
|
-
/* @__PURE__ */ (0,
|
|
1150
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
1154
1474
|
" ",
|
|
1155
1475
|
s.fallbackBody
|
|
1156
1476
|
] })
|
|
1157
1477
|
] }) : null
|
|
1158
1478
|
] }),
|
|
1159
1479
|
toc.narrow,
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1161
|
-
engagement ? /* @__PURE__ */ (0,
|
|
1162
|
-
/* @__PURE__ */ (0,
|
|
1163
|
-
related ? /* @__PURE__ */ (0,
|
|
1164
|
-
related.items.length > 0 ? /* @__PURE__ */ (0,
|
|
1165
|
-
article.children.length > 0 ? /* @__PURE__ */ (0,
|
|
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
|
|
1166
1486
|
] }) : null,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
|
|
1168
1488
|
toc.wide,
|
|
1169
|
-
jsonLdOrigin ? /* @__PURE__ */ (0,
|
|
1489
|
+
jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl, imageWidth, imageHeight }) }) : null
|
|
1170
1490
|
] }) });
|
|
1171
1491
|
}
|
|
1172
1492
|
function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }) {
|
|
@@ -1177,94 +1497,95 @@ function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor,
|
|
|
1177
1497
|
for (const item of list.items) groups.set(item.published_at.slice(0, 7), [...groups.get(item.published_at.slice(0, 7)) ?? [], item]);
|
|
1178
1498
|
const notTranslated = list.fallback ? s.fallbackTitle.replace("{language}", languageName(list.fallback.requested_locale, c.locale)) : void 0;
|
|
1179
1499
|
const jsonLdOrigin = bareOrigin(origin);
|
|
1180
|
-
return /* @__PURE__ */ (0,
|
|
1181
|
-
/* @__PURE__ */ (0,
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1183
|
-
description ? /* @__PURE__ */ (0,
|
|
1184
|
-
/* @__PURE__ */ (0,
|
|
1185
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
1189
1509
|
" ",
|
|
1190
1510
|
s.fallbackBody
|
|
1191
1511
|
] })
|
|
1192
1512
|
] }) : null
|
|
1193
1513
|
] }),
|
|
1194
|
-
list.items.length === 0 ? /* @__PURE__ */ (0,
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1197
|
-
/* @__PURE__ */ (0,
|
|
1198
|
-
/* @__PURE__ */ (0,
|
|
1199
|
-
] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0,
|
|
1200
|
-
/* @__PURE__ */ (0,
|
|
1201
|
-
/* @__PURE__ */ (0,
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1203
|
-
/* @__PURE__ */ (0,
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1205
|
-
item.description ? /* @__PURE__ */ (0,
|
|
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
|
|
1206
1526
|
] })
|
|
1207
1527
|
] }) }, item.canonical_path)) })
|
|
1208
1528
|
] }, month)),
|
|
1209
|
-
olderHref ? /* @__PURE__ */ (0,
|
|
1210
|
-
jsonLdOrigin && path ? /* @__PURE__ */ (0,
|
|
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
|
|
1211
1531
|
] }) });
|
|
1212
1532
|
}
|
|
1213
1533
|
function NotFound({ path, homeHref = "/", ...base }) {
|
|
1214
1534
|
const c = ctx(base, "en");
|
|
1215
1535
|
const { Link, s } = c;
|
|
1216
1536
|
const body = base.slots?.["notfound.body"];
|
|
1217
|
-
return /* @__PURE__ */ (0,
|
|
1218
|
-
/* @__PURE__ */ (0,
|
|
1219
|
-
/* @__PURE__ */ (0,
|
|
1220
|
-
body ? /* @__PURE__ */ (0,
|
|
1221
|
-
path ? /* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
1224
1544
|
] }) }) : null,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
1228
1548
|
] })
|
|
1229
1549
|
] }) });
|
|
1230
1550
|
}
|
|
1231
1551
|
function Unavailable(base) {
|
|
1232
1552
|
const c = ctx(base, "en");
|
|
1233
|
-
return /* @__PURE__ */ (0,
|
|
1234
|
-
/* @__PURE__ */ (0,
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1236
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
1237
1557
|
] }) });
|
|
1238
1558
|
}
|
|
1239
1559
|
function Redirecting({ from, to, ...base }) {
|
|
1240
1560
|
const c = ctx(base, "en");
|
|
1241
1561
|
const { Link, s } = c;
|
|
1242
1562
|
const extra = base.slots?.["redirecting.body"];
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1244
|
-
/* @__PURE__ */ (0,
|
|
1245
|
-
/* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1248
|
-
from ? /* @__PURE__ */ (0,
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
1251
1571
|
] }) : null,
|
|
1252
|
-
/* @__PURE__ */ (0,
|
|
1253
|
-
/* @__PURE__ */ (0,
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
1255
1575
|
] })
|
|
1256
1576
|
] }),
|
|
1257
|
-
/* @__PURE__ */ (0,
|
|
1258
|
-
extra ? /* @__PURE__ */ (0,
|
|
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
|
|
1259
1579
|
] }) });
|
|
1260
1580
|
}
|
|
1261
1581
|
|
|
1262
1582
|
// src/react/index.ts
|
|
1263
1583
|
var import_comments2 = require("./comments.cjs");
|
|
1584
|
+
var import_reactions = require("./reactions.cjs");
|
|
1264
1585
|
|
|
1265
1586
|
// src/react/docs.tsx
|
|
1266
1587
|
var import_docs_enhance = require("./docs-enhance.cjs");
|
|
1267
|
-
var
|
|
1588
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1268
1589
|
var ROOT_ID = "hyle-docs";
|
|
1269
1590
|
var NAV_ID = "hyle-docs-nav";
|
|
1270
1591
|
function navTreeOf(article) {
|
|
@@ -1288,15 +1609,15 @@ function pathTo(nodes, path) {
|
|
|
1288
1609
|
}
|
|
1289
1610
|
function Branch({ nodes, current, onPath, c }) {
|
|
1290
1611
|
const { Link } = c;
|
|
1291
|
-
return /* @__PURE__ */ (0,
|
|
1292
|
-
const link = /* @__PURE__ */ (0,
|
|
1293
|
-
if (node.children.length === 0) return /* @__PURE__ */ (0,
|
|
1294
|
-
return /* @__PURE__ */ (0,
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
1297
1618
|
link
|
|
1298
1619
|
] }),
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Branch, { nodes: node.children, current, onPath, c })
|
|
1300
1621
|
] }) }, node.canonical_path);
|
|
1301
1622
|
}) });
|
|
1302
1623
|
}
|
|
@@ -1310,47 +1631,47 @@ function DocsPage({ article, ...base }) {
|
|
|
1310
1631
|
const siteName = article.breadcrumbs[0]?.title ?? "";
|
|
1311
1632
|
const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
|
|
1312
1633
|
const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
-
/* @__PURE__ */ (0,
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
1317
1638
|
s.menu,
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
1320
1641
|
] }),
|
|
1321
|
-
/* @__PURE__ */ (0,
|
|
1322
|
-
/* @__PURE__ */ (0,
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
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" }) })
|
|
1326
1647
|
] }),
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
1330
1651
|
] }),
|
|
1331
|
-
/* @__PURE__ */ (0,
|
|
1332
|
-
notTranslated ? /* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1334
|
-
/* @__PURE__ */ (0,
|
|
1335
|
-
/* @__PURE__ */ (0,
|
|
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 }),
|
|
1336
1657
|
" ",
|
|
1337
1658
|
s.fallbackBody
|
|
1338
1659
|
] })
|
|
1339
1660
|
] }) : null,
|
|
1340
|
-
/* @__PURE__ */ (0,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1342
|
-
pub.description ? /* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
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" }),
|
|
1345
1666
|
s.updated,
|
|
1346
1667
|
" ",
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1668
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
|
|
1348
1669
|
] }),
|
|
1349
1670
|
toc.narrow,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1351
|
-
/* @__PURE__ */ (0,
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
1354
1675
|
] }),
|
|
1355
1676
|
toc.wide
|
|
1356
1677
|
] }) });
|
|
@@ -1363,15 +1684,24 @@ function DocsPage({ article, ...base }) {
|
|
|
1363
1684
|
HastContent,
|
|
1364
1685
|
HastLimitError,
|
|
1365
1686
|
HyleArticleView,
|
|
1687
|
+
HyleBody,
|
|
1366
1688
|
HyleListView,
|
|
1689
|
+
HyleReactions,
|
|
1690
|
+
HyleToc,
|
|
1367
1691
|
ListPage,
|
|
1368
1692
|
MermaidDiagram,
|
|
1369
1693
|
NotFound,
|
|
1370
1694
|
Redirecting,
|
|
1371
1695
|
TrustedServerHtml,
|
|
1372
1696
|
Unavailable,
|
|
1697
|
+
VIEWER_LABELS_EN,
|
|
1698
|
+
holdPrintUntil,
|
|
1699
|
+
installPrintShortcut,
|
|
1700
|
+
isClampedSource,
|
|
1701
|
+
isLargeDiagram,
|
|
1373
1702
|
isSafeUrl,
|
|
1374
1703
|
sanitizeHast,
|
|
1375
1704
|
scopeId,
|
|
1376
|
-
stringsFor
|
|
1705
|
+
stringsFor,
|
|
1706
|
+
stripMermaidConfig
|
|
1377
1707
|
});
|