@oxide/design-system 6.6.0 → 6.6.1-canary.e8f0814
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/dist/asciidoc.css
CHANGED
|
@@ -419,7 +419,6 @@
|
|
|
419
419
|
border: 1px solid var(--stroke-secondary);
|
|
420
420
|
border-radius: var(--radius-md);
|
|
421
421
|
padding: 1rem 1.25rem;
|
|
422
|
-
position: relative;
|
|
423
422
|
|
|
424
423
|
@media (min-width: 800px) {
|
|
425
424
|
padding: 1.5rem 1.75rem;
|
|
@@ -440,9 +439,19 @@
|
|
|
440
439
|
content: attr(data-lang);
|
|
441
440
|
position: absolute;
|
|
442
441
|
top: 0.5rem;
|
|
443
|
-
right: 0.
|
|
442
|
+
right: 0.75rem;
|
|
444
443
|
display: block;
|
|
445
444
|
color: var(--content-secondary);
|
|
445
|
+
z-index: 1;
|
|
446
|
+
padding: 0 0.25rem;
|
|
447
|
+
background-color: var(--surface-default);
|
|
448
|
+
border-radius: var(--radius-sm);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* Optional role that caps the height for extra long snippets */
|
|
452
|
+
&.scrollable pre {
|
|
453
|
+
max-height: 32rem;
|
|
454
|
+
overflow: auto;
|
|
446
455
|
}
|
|
447
456
|
}
|
|
448
457
|
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
oxide_syntax_default,
|
|
3
|
-
oxql_tmLanguage_default,
|
|
4
|
-
p4_tmLanguage_default
|
|
5
|
-
} from "../../../chunk-BCMM44R6.js";
|
|
6
1
|
import {
|
|
7
2
|
titleCase
|
|
8
3
|
} from "../../../chunk-7VKKHVZC.js";
|
|
9
4
|
import {
|
|
10
5
|
DirectionRightIcon_default,
|
|
11
|
-
|
|
6
|
+
Error12Icon_default,
|
|
7
|
+
Info12Icon_default,
|
|
8
|
+
Link16Icon_default,
|
|
9
|
+
Warning12Icon_default
|
|
12
10
|
} from "../../../chunk-H5ZEQGTH.js";
|
|
11
|
+
import {
|
|
12
|
+
oxide_syntax_default,
|
|
13
|
+
oxql_tmLanguage_default,
|
|
14
|
+
p4_tmLanguage_default
|
|
15
|
+
} from "../../../chunk-BCMM44R6.js";
|
|
13
16
|
|
|
14
17
|
// components/src/asciidoc/index.tsx
|
|
15
18
|
import {
|
|
@@ -20,6 +23,7 @@ import {
|
|
|
20
23
|
|
|
21
24
|
// components/src/asciidoc/Admonition.tsx
|
|
22
25
|
import { Content, RenderInline } from "@oxide/react-asciidoc";
|
|
26
|
+
import cn from "classnames";
|
|
23
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
28
|
var themeForAdmonition = {
|
|
25
29
|
note: "green-theme",
|
|
@@ -33,62 +37,32 @@ var Admonition = ({ node }) => {
|
|
|
33
37
|
const theme = themeForAdmonition[attrs2.name] || "";
|
|
34
38
|
let icon;
|
|
35
39
|
if (attrs2.name === "caution") {
|
|
36
|
-
icon = /* @__PURE__ */ jsx(
|
|
40
|
+
icon = /* @__PURE__ */ jsx(Error12Icon_default, {});
|
|
37
41
|
} else if (attrs2.name === "warning") {
|
|
38
|
-
icon = /* @__PURE__ */ jsx(
|
|
42
|
+
icon = /* @__PURE__ */ jsx(Warning12Icon_default, {});
|
|
39
43
|
} else {
|
|
40
|
-
icon = /* @__PURE__ */ jsx(
|
|
44
|
+
icon = /* @__PURE__ */ jsx(Info12Icon_default, {});
|
|
41
45
|
}
|
|
42
|
-
return /* @__PURE__ */ jsxs(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
id: node.id || void 0,
|
|
50
|
+
className: cn("admonitionblock", attrs2.name, theme, node.role),
|
|
51
|
+
...node.lineNumber ? { "data-lineno": node.lineNumber } : {},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "admonition-icon", children: icon }),
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "admonition-content content", children: [
|
|
55
|
+
/* @__PURE__ */ jsx("div", { children: titleCase(attrs2.name.toString()) }),
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
57
|
+
node.titleInlines && /* @__PURE__ */ jsx("div", { className: "admonition-title", children: /* @__PURE__ */ jsx(RenderInline, { nodes: node.titleInlines }) }),
|
|
58
|
+
node.inlines && /* @__PURE__ */ jsx(RenderInline, { nodes: node.inlines }),
|
|
59
|
+
/* @__PURE__ */ jsx(Content, { blocks: node.blocks })
|
|
60
|
+
] })
|
|
61
|
+
] })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
53
65
|
};
|
|
54
|
-
var Error12 = ({ className }) => /* @__PURE__ */ jsx(
|
|
55
|
-
"svg",
|
|
56
|
-
{
|
|
57
|
-
width: "12",
|
|
58
|
-
height: "12",
|
|
59
|
-
viewBox: "0 0 12 12",
|
|
60
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
-
className,
|
|
62
|
-
children: /* @__PURE__ */ jsx(
|
|
63
|
-
"path",
|
|
64
|
-
{
|
|
65
|
-
fillRule: "evenodd",
|
|
66
|
-
clipRule: "evenodd",
|
|
67
|
-
d: "M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Zm.083-9c.368 0 .667.299.667.667v2.666A.667.667 0 0 1 6.083 7h-.166a.667.667 0 0 1-.667-.667V3.667c0-.368.299-.667.667-.667h.166Zm0 5c.368 0 .667.299.667.667v.166a.667.667 0 0 1-.667.667h-.166a.667.667 0 0 1-.667-.667v-.166c0-.368.299-.667.667-.667h.166Z",
|
|
68
|
-
fill: "currentColor"
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
var Warning12 = ({ className }) => /* @__PURE__ */ jsx(
|
|
74
|
-
"svg",
|
|
75
|
-
{
|
|
76
|
-
width: "12",
|
|
77
|
-
height: "12",
|
|
78
|
-
viewBox: "0 0 12 12",
|
|
79
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
80
|
-
className,
|
|
81
|
-
children: /* @__PURE__ */ jsx(
|
|
82
|
-
"path",
|
|
83
|
-
{
|
|
84
|
-
fillRule: "evenodd",
|
|
85
|
-
clipRule: "evenodd",
|
|
86
|
-
d: "M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Zm.083-9c.368 0 .667.299.667.667v2.666A.667.667 0 0 1 6.083 7h-.166a.667.667 0 0 1-.667-.667V3.667c0-.368.299-.667.667-.667h.166Zm0 5c.368 0 .667.299.667.667v.166a.667.667 0 0 1-.667.667h-.166a.667.667 0 0 1-.667-.667v-.166c0-.368.299-.667.667-.667h.166Z",
|
|
87
|
-
fill: "currentColor"
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
66
|
var Admonition_default = Admonition;
|
|
93
67
|
|
|
94
68
|
// components/src/asciidoc/Section.tsx
|
|
@@ -98,7 +72,7 @@ import {
|
|
|
98
72
|
parse,
|
|
99
73
|
RenderInline as RenderInline2
|
|
100
74
|
} from "@oxide/react-asciidoc";
|
|
101
|
-
import
|
|
75
|
+
import cn2 from "classnames";
|
|
102
76
|
import { createElement } from "react";
|
|
103
77
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
104
78
|
var dropAnchorTags = (html) => html?.includes("<a") ? html.replace(/<(?:a\b[^>]*|\/a)>/g, "") : html;
|
|
@@ -123,16 +97,16 @@ var Section = ({ node }) => {
|
|
|
123
97
|
] });
|
|
124
98
|
if (level === 0) {
|
|
125
99
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
126
|
-
/* @__PURE__ */ jsx2("h1", { className:
|
|
100
|
+
/* @__PURE__ */ jsx2("h1", { className: cn2("sect0", node.role), "data-sectnum": sectNum, children: title }),
|
|
127
101
|
/* @__PURE__ */ jsx2(Content2, { blocks: node.blocks })
|
|
128
102
|
] });
|
|
129
103
|
} else if (level === 1) {
|
|
130
|
-
return /* @__PURE__ */ jsxs2("div", { className:
|
|
104
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn2("sect1", node.role), children: [
|
|
131
105
|
createElement("h2", { "data-sectnum": sectNum }, title),
|
|
132
106
|
/* @__PURE__ */ jsx2("div", { className: "sectionbody", children: /* @__PURE__ */ jsx2(Content2, { blocks: node.blocks }) })
|
|
133
107
|
] });
|
|
134
108
|
} else {
|
|
135
|
-
return /* @__PURE__ */ jsxs2("div", { className:
|
|
109
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn2(`sect${level}`, node.role), children: [
|
|
136
110
|
createElement(`h${level + 1}`, { "data-sectnum": sectNum }, title),
|
|
137
111
|
/* @__PURE__ */ jsx2(Content2, { blocks: node.blocks })
|
|
138
112
|
] });
|
|
@@ -149,7 +123,7 @@ var Table_default = Table;
|
|
|
149
123
|
// components/src/asciidoc/TableOfContents.tsx
|
|
150
124
|
import { parse as parse2 } from "@oxide/react-asciidoc";
|
|
151
125
|
import * as Accordion from "@radix-ui/react-accordion";
|
|
152
|
-
import
|
|
126
|
+
import cn3 from "classnames";
|
|
153
127
|
import { Fragment as Fragment2, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
154
128
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
155
129
|
var dropAnchors = (html) => html.includes("<a") ? html.replace(/<(?:a\b[^>]*|\/a)>/g, "") : html;
|
|
@@ -314,12 +288,12 @@ var DesktopOutline = ({
|
|
|
314
288
|
"li",
|
|
315
289
|
{
|
|
316
290
|
"data-level": item.level,
|
|
317
|
-
className:
|
|
291
|
+
className: cn3("text-sans-sm mb-0 list-none", item.level > 2 && "hidden"),
|
|
318
292
|
children: /* @__PURE__ */ jsx4(
|
|
319
293
|
"a",
|
|
320
294
|
{
|
|
321
295
|
href: `#${item.id}`,
|
|
322
|
-
className:
|
|
296
|
+
className: cn3(
|
|
323
297
|
"block border-l py-[4px] pr-4",
|
|
324
298
|
activeItem === item.id ? "active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent hover:light:text-raise" : "text-tertiary border-secondary hover:text-secondary"
|
|
325
299
|
),
|
|
@@ -335,7 +309,7 @@ var DesktopOutline = ({
|
|
|
335
309
|
] }, item.id));
|
|
336
310
|
};
|
|
337
311
|
if (toc && toc.length > 0) {
|
|
338
|
-
return /* @__PURE__ */ jsx4("ul", { className:
|
|
312
|
+
return /* @__PURE__ */ jsx4("ul", { className: cn3("toc w-(--toc-width)", className), children: renderToc(toc) });
|
|
339
313
|
}
|
|
340
314
|
return null;
|
|
341
315
|
};
|
|
@@ -351,13 +325,13 @@ var SmallScreenOutline = ({
|
|
|
351
325
|
"li",
|
|
352
326
|
{
|
|
353
327
|
"data-level": item.level,
|
|
354
|
-
className:
|
|
328
|
+
className: cn3("text-sans-sm list-none", item.level > 2 && "hidden"),
|
|
355
329
|
children: /* @__PURE__ */ jsx4(
|
|
356
330
|
"a",
|
|
357
331
|
{
|
|
358
332
|
href: `#${item.id}`,
|
|
359
333
|
onClick: () => setValue(""),
|
|
360
|
-
className:
|
|
334
|
+
className: cn3(
|
|
361
335
|
"block border-l py-[4px]",
|
|
362
336
|
activeItem === item.id ? "active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent" : "text-tertiary border-secondary hover:text-secondary"
|
|
363
337
|
),
|
|
@@ -377,7 +351,7 @@ var SmallScreenOutline = ({
|
|
|
377
351
|
Accordion.Root,
|
|
378
352
|
{
|
|
379
353
|
type: "single",
|
|
380
|
-
className:
|
|
354
|
+
className: cn3(
|
|
381
355
|
"toc bg-default border-secondary sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-t border-b print:hidden",
|
|
382
356
|
className
|
|
383
357
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../components/src/asciidoc/index.tsx","../../../../components/src/asciidoc/Admonition.tsx","../../../../components/src/asciidoc/Section.tsx","../../../../components/src/asciidoc/Table.tsx","../../../../components/src/asciidoc/TableOfContents.tsx","../../../../components/src/asciidoc/use-delegated-links.ts","../../../../components/src/asciidoc/util.ts"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport {\n Content,\n inlineHtml,\n parse,\n type DocumentBlock,\n type InlineOverrides,\n} from '@oxide/react-asciidoc'\n\nimport Admonition from './Admonition'\nimport Section from './Section'\nimport Table from './Table'\nimport {\n DesktopOutline,\n SmallScreenOutline,\n useActiveSectionTracking,\n useIntersectionObserver,\n} from './TableOfContents'\nimport { useDelegatedReactRouterLinks } from './use-delegated-links'\nimport { attrs, handleDocument, highlight, loadAsciidoctor } from './util'\n\nconst MinimalDocument = ({ document }: { document: DocumentBlock }) => (\n <div id=\"content\" className=\"asciidoc-body w-full\">\n <Content blocks={document.blocks} />\n </div>\n)\n\nconst AsciiDocBlocks = {\n Admonition,\n Table,\n Section,\n MinimalDocument,\n}\n\n/**\n * Adds word break opportunities (<wbr/>) after slashes in text, except within HTML tags.\n * This function is used to improve line breaks for long paths or URLs in rendered content.\n * *\n * renderWithBreaks('/path/to/long/file.txt')\n * '/<wbr/>path/<wbr/>to/<wbr/>long/<wbr/>file.txt'\n */\nexport const renderWithBreaks = (text: string): string => {\n return text\n .split(/(<[^>]*>)/g)\n .map((segment) => {\n // if the segment is an HTML tag, leave it unchanged\n if (segment.startsWith('<') && segment.endsWith('>')) {\n return segment\n }\n // replace slashes that are not surrounded by spaces\n return segment.replace(/(?:^|(?<=\\S))\\/(?=\\S)/g, '/<wbr/>')\n })\n .join('')\n}\n\n/**\n * Inline-level overrides for the renderer. Pass these to `<Asciidoc>` as\n * `options.inlineOverrides` to apply our customisations to inline content:\n *\n * <Asciidoc document={doc} options={{ overrides: AsciiDocBlocks, inlineOverrides }} />\n *\n * The only customisation today is inserting `<wbr/>` break opportunities into\n * inline monospaced (`code`) spans so long paths and URLs wrap nicely. Every\n * other quoted subtype is rendered exactly as the renderer would by default —\n * we round-trip the node through `inlineHtml` (the renderer's own serialiser)\n * and `parse` it back into React elements, so there's no risk of drifting from\n * the stock output.\n */\nexport const inlineOverrides: InlineOverrides = {\n quoted: ({ node }) => {\n let { __html } = inlineHtml([node])\n if (node.subtype === 'monospaced') {\n __html = renderWithBreaks(__html)\n }\n return <>{parse(__html)}</>\n },\n}\n\nexport {\n AsciiDocBlocks,\n handleDocument,\n highlight,\n loadAsciidoctor,\n attrs,\n DesktopOutline,\n SmallScreenOutline,\n useActiveSectionTracking,\n useIntersectionObserver,\n useDelegatedReactRouterLinks,\n}\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Content, RenderInline, type AdmonitionBlock } from '@oxide/react-asciidoc'\n\nimport { titleCase } from '../utils'\n\nconst themeForAdmonition: Record<string, string> = {\n note: 'green-theme',\n caution: 'yellow-theme',\n important: 'yellow-theme',\n warning: 'red-theme',\n tip: 'purple-theme',\n}\n\nconst Admonition = ({ node }: { node: AdmonitionBlock }) => {\n const attrs = node.attributes\n const theme = themeForAdmonition[attrs.name] || ''\n\n let icon\n if (attrs.name === 'caution') {\n icon = <Error12 />\n } else if (attrs.name === 'warning') {\n icon = <Warning12 />\n } else {\n icon = <Error12 className=\"rotate-180\" />\n }\n\n return (\n <div className={`admonitionblock ${attrs.name} ${theme}`}>\n <div className=\"admonition-icon\">{icon}</div>\n <div className=\"admonition-content content\">\n <div>{titleCase(attrs.name.toString())}</div>\n <div>\n {node.titleInlines && (\n <div className=\"admonition-title\">\n <RenderInline nodes={node.titleInlines} />\n </div>\n )}\n {/* Simple (single-paragraph) admonitions carry their content as an\n inline AST; multi-block admonitions render their child blocks. */}\n {node.inlines && <RenderInline nodes={node.inlines} />}\n <Content blocks={node.blocks} />\n </div>\n </div>\n </div>\n )\n}\n\nconst Error12 = ({ className }: { className?: string }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Zm.083-9c.368 0 .667.299.667.667v2.666A.667.667 0 0 1 6.083 7h-.166a.667.667 0 0 1-.667-.667V3.667c0-.368.299-.667.667-.667h.166Zm0 5c.368 0 .667.299.667.667v.166a.667.667 0 0 1-.667.667h-.166a.667.667 0 0 1-.667-.667v-.166c0-.368.299-.667.667-.667h.166Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst Warning12 = ({ className }: { className?: string }) => (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Zm.083-9c.368 0 .667.299.667.667v2.666A.667.667 0 0 1 6.083 7h-.166a.667.667 0 0 1-.667-.667V3.667c0-.368.299-.667.667-.667h.166Zm0 5c.368 0 .667.299.667.667v.166a.667.667 0 0 1-.667.667h-.166a.667.667 0 0 1-.667-.667v-.166c0-.368.299-.667.667-.667h.166Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport default Admonition\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Link16Icon } from '@/icons/react'\nimport {\n Content,\n inlineHtml,\n parse,\n RenderInline,\n type Inline,\n type SectionBlock,\n} from '@oxide/react-asciidoc'\nimport cn from 'classnames'\nimport { createElement, type JSX } from 'react'\n\n/** Remove `<a>` open/close tags from an HTML string, keeping their contents. */\nconst dropAnchorTags = <T extends string | undefined>(html: T): T =>\n (html?.includes('<a') ? html.replace(/<(?:a\\b[^>]*|\\/a)>/g, '') : html) as T\n\n/**\n * Strip links out of inline title content. The heading is wrapped in a self-link\n * `<a>` below, so any anchor in the title — an inline link, a cross-reference, a\n * footnote marker — would nest an `<a>` inside an `<a>`: invalid HTML that breaks\n * hydration. Unwrap inline links to their text, and render the stock footnote\n * marker with its `<a>` removed (which also drops any hover a footnote override\n * would otherwise add).\n */\nconst stripLinks = (nodes: Inline.InlineNode[]): Inline.InlineNode[] =>\n nodes.flatMap((node): Inline.InlineNode[] => {\n if (node.type === 'anchor') return stripLinks(node.text)\n if (node.type === 'footnote')\n return [{ type: 'text', text: dropAnchorTags(inlineHtml([node]).__html), raw: true }]\n return [node]\n })\n\nconst Section = ({ node }: { node: SectionBlock }) => {\n const level = node.level\n let title: JSX.Element | string = ''\n\n let sectNum = node.num\n sectNum = sectNum && sectNum[0] === '.' ? '' : sectNum\n\n // Captioned titles (appendices, etc.) arrive as an HTML string; everything\n // else comes from the inline AST. Either way, strip any links from the title\n // so they don't nest inside the self-link `<a>` we wrap it in below.\n const titleContent = node.hasCaption ? (\n parse(dropAnchorTags(node.title))\n ) : (\n <RenderInline nodes={node.titleInlines && stripLinks(node.titleInlines)} />\n )\n\n title = (\n <>\n <span className=\"anchor\" id={node.id || ''} aria-hidden=\"true\" />\n <a className=\"link group\" href={`#${node.id}`}>\n {titleContent}\n <Link16Icon className=\"text-accent-secondary ml-2 hidden group-hover:inline-block\" />\n </a>\n </>\n )\n\n if (level === 0) {\n return (\n <>\n <h1 className={cn('sect0', node.role)} data-sectnum={sectNum}>\n {title}\n </h1>\n <Content blocks={node.blocks} />\n </>\n )\n } else if (level === 1) {\n return (\n <div className={cn('sect1', node.role)}>\n {createElement('h2', { 'data-sectnum': sectNum }, title)}\n <div className=\"sectionbody\">\n <Content blocks={node.blocks} />\n </div>\n </div>\n )\n } else {\n return (\n <div className={cn(`sect${level}`, node.role)}>\n {createElement(`h${level + 1}`, { 'data-sectnum': sectNum }, title)}\n <Content blocks={node.blocks} />\n </div>\n )\n }\n}\n\nexport default Section\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Table as InnerTable, type TableBlock } from '@oxide/react-asciidoc'\n\nconst Table = ({ node }: { node: TableBlock }) => (\n <div className=\"table-wrapper\">\n <InnerTable node={node} />\n </div>\n)\n\nexport default Table\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { DirectionRightIcon } from '@/icons/react'\nimport { parse, type DocumentSection } from '@oxide/react-asciidoc'\nimport * as Accordion from '@radix-ui/react-accordion'\nimport cn from 'classnames'\nimport { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\n// A TOC entry is itself an `<a>`, so any anchors inside the title text would\n// nest (invalid HTML + a client/server hydration mismatch). Strip the anchor\n// tags but keep their inner content — mirrors asciidoctor's `DropAnchorRx`\n// (and the renderer's own `convert_outline`).\nconst dropAnchors = (html: string): string =>\n html.includes('<a') ? html.replace(/<(?:a\\b[^>]*|\\/a)>/g, '') : html\n\nexport function useIntersectionObserver(\n elements: Element[],\n callback: IntersectionObserverCallback,\n options: IntersectionObserverInit,\n) {\n const [observer, setObserver] = useState<IntersectionObserver | null>(null)\n\n // Create the observer in an effect so we can tear it down when this unmounts\n useEffect(() => {\n const observer = new IntersectionObserver(callback, options)\n setObserver(observer)\n\n return () => {\n observer.disconnect()\n }\n }, [callback, options])\n\n // Bind the elements that should be listened for\n useEffect(() => {\n if (observer) {\n for (const element of elements) {\n observer.observe(element)\n }\n }\n\n return () => {\n if (observer) {\n for (const element of elements) {\n observer.unobserve(element)\n }\n }\n }\n }, [elements, observer])\n\n return observer\n}\n\n// Create threshold steps that trigger intersection events every 0.05%. This is needed to provide\n// decent measurements on very tall elements. In the future we could instead compute the needed\n// thresholds on a per element basis so that we are measuring per pixel instead of per percent.\nconst THRESHOLD = [...Array(2000).keys()].map((n) => n / 2000)\n\nfunction isTopLevelSection(element: Element): boolean {\n return element.classList.contains('sect1')\n}\n\n// Uses the asciidoc generated classes to find the closest section wrapping parent element\nfunction findParentSection(element: Element): Element | null {\n const sect2Wrapper = element.closest('.sect2')\n return sect2Wrapper ? sect2Wrapper : element.closest('.sect1')\n}\n\nfunction newSection(\n node: number,\n element: Element,\n wrapper: Element,\n parent: number | null,\n): Section {\n return {\n node,\n element,\n wrapper,\n parent,\n children: [],\n }\n}\n\nfunction buildSectionTree(elements: Element[]): Section[] {\n const sections = []\n let parent = null\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n const parentWrapper = findParentSection(element)\n\n if (parentWrapper) {\n if (parentWrapper && isTopLevelSection(parentWrapper)) {\n const section = newSection(i, element, parentWrapper, null)\n sections.push(section)\n parent = section\n } else {\n if (parent === null) {\n // Fail to construct a tree if the provided elements are invalid\n return []\n } else {\n const section = newSection(i, element, parentWrapper, parent.node)\n parent.children.push(i)\n sections.push(section)\n }\n }\n } else {\n // Fail to construct a tree if the provided elements are invalid\n return []\n }\n }\n\n return sections\n}\n\nfunction maxIndex(nums: number[]): number | undefined {\n return nums.reduce<number | undefined>((maxIndex, current, currentIndex) => {\n const currentMax = maxIndex !== undefined ? nums[maxIndex] : 0\n return current > currentMax ? currentIndex : maxIndex\n }, undefined)\n}\n\ntype Section = {\n node: number\n element: Element\n wrapper: Element\n parent: number | null\n children: number[]\n}\n// This hook will call the provided callback whenever a section that is identified by a heading is\n// determined to be \"active\". A section is considered to be the \"active\" section when covers more\n// space of the specified measuring area than any other section.\nexport function useActiveSectionTracking(\n initialSections: Element[],\n onSectionChange: (element: Element) => void,\n debug = false,\n) {\n // Construct a tree in the form of a basic array that will allow for traversing between parent\n // an child nodes quickly\n const [sectionWrappers, setSectionWrappers] = useState<Section[]>(\n buildSectionTree(initialSections),\n )\n\n // Internally we need to track the coverage percentage for each element without triggering\n // renders\n const sectionMeasurements = useRef<number[]>([])\n\n // The caller only provides the hook with section headers and so we need to map those to their\n // relevant containing sections\n const setSections = useCallback(\n (sections: Element[]) => {\n setSectionWrappers(buildSectionTree(sections))\n\n // When sections change we need to also zero out our section visibility measurements\n sectionMeasurements.current = []\n },\n [setSectionWrappers],\n )\n\n // Create the section tracker\n const wrapperActivator = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n // For each observed element that has interacted with our intersection window we want to\n // compute and record the percentage of space that is covered by the element. This work is all\n // performed off of the main thread\n for (const entry of entries) {\n // Find where in our list of section wrapper elements the entry that changed is\n const index = sectionWrappers.findIndex((node) => node.wrapper === entry.target)\n\n // We are only trying to detect vertical scroll changes and therefore only need to use the\n // heigh to compute the coverage percentage\n const covered = entry.intersectionRect.height / (entry.rootBounds?.height || 1)\n sectionMeasurements.current[index] = covered\n }\n\n // For each section element, compute the amount of space that is \"owned\" by that element. In\n // this check, space is considered \"owned\" by the element furthest down the tree.\n //\n // Example:\n // A parent element covers 70% of the measured space. This element has two child elements,\n // one that covers 30%, and another that covers 25%. In this case both of the child elements\n // own their respective spaces, and the parent owns 15% (70 - (30 + 25)) of the space.\n //\n // Because we are only trying to determine the space owned by a single element, we do not need\n // to traverse further than that elements direct descendants\n const ownedSectionSizes = sectionWrappers.map((section) => {\n const childSizes = section.children\n .map((c) => sectionMeasurements.current[c])\n .reduce((c, a) => c + a, 0)\n return sectionMeasurements.current[section.node] - childSizes\n })\n\n // Now that we have a list of how much of the measured space each element takes up, we simply\n // find the element that is taking up the most space, and assign it to be the current section\n const activeSectionIndex = maxIndex(ownedSectionSizes)\n\n if (activeSectionIndex !== undefined) {\n onSectionChange(sectionWrappers[activeSectionIndex].element)\n }\n },\n [sectionWrappers, onSectionChange],\n )\n\n // Define our measurement area. This space is relative to the root element (i.e. the screen). It\n // is a band that starts at 5% down from the top, and ends at 80% up from the bottom of the\n // screen.\n const wrapperSettings = useMemo(\n () => ({ threshold: THRESHOLD, rootMargin: `-15% 0px -70% 0px` }),\n [],\n )\n\n // We need to ensure that we are only sending valid sections to be observed\n const bindableWrappers = useMemo(\n () => sectionWrappers.map((s) => s.wrapper),\n [sectionWrappers],\n )\n\n // Generate the intersection observer based on the above configuration\n const sectionObserver = useIntersectionObserver(\n bindableWrappers,\n wrapperActivator,\n wrapperSettings,\n )\n\n let debugNode = null\n if (debug && sectionObserver?.root === null) {\n // Parse and invert the margins\n const edges = sectionObserver.rootMargin.split(' ').map((margin) => {\n if (margin.endsWith('%')) {\n return parseInt(margin) * -1 + '%'\n } else if (margin.endsWith('px')) {\n return parseInt(margin) * -1 + 'px'\n } else {\n return '0px'\n }\n })\n\n debugNode = (\n <div\n style={{\n position: 'fixed',\n top: edges[0],\n right: edges[1],\n bottom: edges[2],\n left: edges[3],\n background: 'rgba(255, 92, 170, 0.2)',\n border: '1px solid rgba(255, 92, 170)',\n pointerEvents: 'none',\n zIndex: 500,\n }}\n />\n )\n }\n\n return {\n setSections,\n debugNode,\n }\n}\n\nexport const DesktopOutline = ({\n toc,\n activeItem,\n className,\n}: {\n toc: DocumentSection[]\n activeItem: string\n className?: string\n}) => {\n const renderToc = (sections: DocumentSection[]) => {\n return sections.map((item) => (\n <Fragment key={item.id}>\n <li\n data-level={item.level}\n className={cn('text-sans-sm mb-0 list-none', item.level > 2 && 'hidden')}\n >\n <a\n href={`#${item.id}`}\n className={cn(\n 'block border-l py-[4px] pr-4',\n activeItem === item.id\n ? 'active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent hover:light:text-raise'\n : 'text-tertiary border-secondary hover:text-secondary',\n )}\n style={{\n paddingLeft: `${0.5 + item.level * 0.5}rem`,\n }}\n >\n {parse(dropAnchors(item.title))}\n </a>\n </li>\n {item.sections && renderToc(item.sections)}\n </Fragment>\n ))\n }\n\n if (toc && toc.length > 0) {\n return <ul className={cn('toc w-(--toc-width)', className)}>{renderToc(toc)}</ul>\n }\n\n return null\n}\nexport const SmallScreenOutline = ({\n toc,\n activeItem,\n className,\n}: {\n toc: DocumentSection[]\n activeItem: string\n className?: string\n}) => {\n const [value, setValue] = useState('')\n\n const renderToc = (sections: DocumentSection[]) => {\n return sections.map((item) => (\n <Fragment key={item.id}>\n <li\n data-level={item.level}\n className={cn('text-sans-sm list-none', item.level > 2 && 'hidden')}\n >\n <a\n href={`#${item.id}`}\n onClick={() => setValue('')}\n className={cn(\n 'block border-l py-[4px]',\n activeItem === item.id\n ? 'active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent'\n : 'text-tertiary border-secondary hover:text-secondary',\n )}\n style={{\n paddingLeft: `${0.5 + item.level * 0.5}rem`,\n }}\n >\n {parse(dropAnchors(item.title))}\n </a>\n </li>\n {item.sections && renderToc(item.sections)}\n </Fragment>\n ))\n }\n\n if (toc && toc.length > 0) {\n return (\n <Accordion.Root\n type=\"single\"\n className={cn(\n 'toc bg-default border-secondary sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-t border-b print:hidden',\n className,\n )}\n collapsible\n value={value}\n onValueChange={setValue}\n >\n <Accordion.Item value=\"toc\">\n <Accordion.Header>\n <Accordion.Trigger className=\"text-sans-md text-default hover:bg-hover flex h-12 w-full items-center justify-between px-(--container-px) [&>svg]:data-[state=open]:rotate-90\">\n Table of Contents{' '}\n <DirectionRightIcon className=\"text-tertiary transition-all\" />\n </Accordion.Trigger>\n </Accordion.Header>\n\n <Accordion.Content className=\"animated-accordion hydrated border-secondary max-h-[60vh] w-full overflow-y-scroll border-t px-(--container-px)\">\n <div className=\"py-4\">{renderToc(toc)}</div>\n </Accordion.Content>\n </Accordion.Item>\n </Accordion.Root>\n )\n }\n\n return null\n}\n","/**\n * MIT License\n *\n * Copyright (c) React Training LLC 2015-2021\n * Copyright (c) Shopify Inc. 2022-2023\n * From https://github.com/remix-run/react-router-website/blob/main/app/ui/delegate-markdown-links.ts\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n */\nimport { useEffect } from 'react'\n\n// copied from React Router, unlikely to change\n// https://github.com/remix-run/react-router/blob/7b041811/packages/react-router/lib/router/history.ts#L32-L50\ninterface Path {\n pathname: string\n search: string\n hash: string\n}\n\n// https://github.com/remix-run/react-router/blob/7b041811/packages/react-router/lib/router/history.ts#L101-L105\ntype To = string | Partial<Path>\n\n// Converts regular AsciiDoc a tags and makes them React Routery\n// Added key so that this is reloaded when the user routes from one document to another directly\nfunction useDelegatedReactRouterLinks(\n // this is to avoid a dependency on remix/react router\n /** Pass in the result of `useNavigate()` in the calling application. */\n navigate: (to: To) => void,\n nodeRef: React.RefObject<HTMLElement | null>,\n key: string,\n) {\n useEffect(() => {\n const node = nodeRef.current\n const handler = (event: MouseEvent) => {\n if (!nodeRef.current) return\n\n if (!(event.target instanceof HTMLElement)) return\n\n const a = event.target.closest('a')\n\n if (\n a && // is anchor or has anchor parent\n a.hasAttribute('href') && // has an href\n a.host === window.location.host && // is internal\n event.button === 0 && // left click\n (!a.target || a.target === '_self') && // Let browser handle \"target=_blank\" etc.\n !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) // not modified\n ) {\n event.preventDefault()\n const { pathname, search, hash } = a\n navigate({ pathname, search, hash })\n }\n }\n\n if (!node) return\n node.addEventListener('click', handler)\n\n return () => {\n node?.removeEventListener('click', handler)\n }\n }, [navigate, nodeRef, key])\n}\n\nexport { useDelegatedReactRouterLinks }\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport asciidoctor, { type Document, type Registry } from '@asciidoctor/core'\nimport {\n Block,\n Inline,\n LiteralBlock,\n prepareDocument,\n processDocument,\n} from '@oxide/react-asciidoc'\nimport {\n bundledLanguages,\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n type HighlighterGeneric,\n type LanguageInput,\n} from 'shiki'\n\nimport { oxqlGrammar as oxql, p4Grammar as p4, oxideTheme as theme } from '../syntax'\n\nlet highlighterPromise: Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> | null =\n null\nconst customLanguages = ['oxql', 'p4']\nconst supportedLanguages = [...Object.keys(bundledLanguages), ...customLanguages]\n\nexport function getHighlighter() {\n if (!highlighterPromise) {\n const langs: LanguageInput[] = [{ ...oxql }, { ...p4 }]\n highlighterPromise = createHighlighter({ themes: [theme], langs })\n }\n return highlighterPromise\n}\n\nexport async function highlightCode(\n code: string,\n lang: string,\n { inline = false }: { inline?: boolean } = {},\n): Promise<string> {\n const h = await getHighlighter()\n const resolved = supportedLanguages.includes(lang) ? lang : 'text'\n if (!h.getLoadedLanguages().includes(resolved)) {\n await h.loadLanguage(resolved as BundledLanguage)\n }\n return h.codeToHtml(code, {\n lang: resolved,\n theme,\n ...(inline ? { structure: 'inline' as const } : {}),\n })\n}\n\nconst highlight = async (block: Block): Promise<Block> => {\n if (block.type === 'listing') {\n const literalBlock = block as LiteralBlock\n\n // Highlight `subbedSource`: `source` with react-asciidoc's text-level subs\n // (notably `attributes`) resolved, but still un-escaped and with raw `<N>`\n // callouts — the plain code to tokenize. Highlighting re-escapes, so feeding\n // it the specialchars-escaped `content` would double-escape (`&` -> `&`).\n if (typeof literalBlock.subbedSource !== 'string') {\n return block\n }\n const source = literalBlock.subbedSource\n\n // Turn raw callout markers (`<N>`, optionally comment-prefixed) into the\n // `<i class=\"conum\" data-value=\"N\"></i><b>(N)</b>` markup asciidoc.css\n // styles (it hides the trailing `<b>`). Keyed to the raw `<N>` form because\n // it runs on `source`, not the escaped `<N>` of `content`.\n const lineComment = literalBlock.attributes['line-comment']\n const content = Inline.subCalloutsRaw(\n source,\n true,\n lineComment !== undefined ? String(lineComment) : undefined,\n )\n\n // Replace the conum markup with placeholders before highlighting, otherwise\n // the syntax highlighter escapes it and it shows up as literal text. Cover\n // the trailing `<b>` badge too so the whole unit is restored intact.\n //\n // The placeholder must survive tokenization as a single unbroken run of\n // text — anything a grammar can tokenize (digits, underscores) gets split\n // across `<span>`s, leaving the placeholder literal in the output — so the\n // index is spelled with letters only (0–9 mapped to A–J).\n const calloutRegex = /<i class=\"conum\" data-value=\"\\d+\"><\\/i>(?:<b>\\(\\d+\\)<\\/b>)?/g\n const decodeIndex = (letters: string) =>\n parseInt(\n letters.replace(/[A-J]/g, (c) => String('ABCDEFGHIJ'.indexOf(c))),\n 10,\n )\n const callouts: string[] = []\n const placeholderContent = content.replace(calloutRegex, (match) => {\n callouts.push(match)\n const index = String(callouts.length - 1).replace(/\\d/g, (d) => 'ABCDEFGHIJ'[+d])\n return `CALLOUTPLACEHOLDER${index}END`\n })\n\n // If no language specified, we still want to support callouts. This content\n // skips the highlighter and goes straight to `innerHTML`, so escape the raw\n // text ourselves; the conum markup is held out as placeholders and restored\n // un-escaped after.\n if (!literalBlock.language) {\n return {\n ...block,\n content: Inline.subSpecialchars(placeholderContent).replace(\n /CALLOUTPLACEHOLDER([A-J]+)END/g,\n (_, index) => callouts[decodeIndex(index)],\n ),\n }\n }\n\n const highlightedContent = await highlightCode(\n placeholderContent,\n literalBlock.language,\n { inline: true },\n )\n\n // Restore callouts in the highlighted content\n const restoredContent = highlightedContent.replace(\n /CALLOUTPLACEHOLDER([A-J]+)END/g,\n (_, index) => callouts[decodeIndex(index)],\n )\n\n return {\n ...block,\n content: restoredContent,\n }\n }\n return block\n}\n\nconst attrs = {\n sectlinks: 'true',\n stem: 'latexmath',\n stylesheet: false,\n icons: 'font',\n}\n\nconst loadAsciidoctor = ({\n extensions = [],\n}: {\n extensions?: ((this: Registry) => void)[]\n}) => {\n const ad = asciidoctor()\n\n // Rendering goes through `prepareDocument` + React templates, so only\n // extensions need registering; they run at `ad.load` time (e.g. include\n // processing). Inline content (callouts, quotes, etc.) is produced by the\n // renderer's inline parser.\n extensions.forEach((extension) => ad.Extensions.register(extension))\n\n return ad\n}\n\nconst handleDocument = async (document: Document) => {\n const doc = prepareDocument(document)\n return await processDocument(doc, highlight)\n}\n\nexport { handleDocument, highlight, loadAsciidoctor, attrs }\n"],"mappings":";;;;;;;;;;;;;;AAOA;AAAA,EACE,WAAAA;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,OAGK;;;ACNP,SAAS,SAAS,oBAA0C;AAkBjD,cAYH,YAZG;AAdX,IAAM,qBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,KAAK;AACP;AAEA,IAAM,aAAa,CAAC,EAAE,KAAK,MAAiC;AAC1D,QAAMC,SAAQ,KAAK;AACnB,QAAM,QAAQ,mBAAmBA,OAAM,IAAI,KAAK;AAEhD,MAAI;AACJ,MAAIA,OAAM,SAAS,WAAW;AAC5B,WAAO,oBAAC,WAAQ;AAAA,EAClB,WAAWA,OAAM,SAAS,WAAW;AACnC,WAAO,oBAAC,aAAU;AAAA,EACpB,OAAO;AACL,WAAO,oBAAC,WAAQ,WAAU,cAAa;AAAA,EACzC;AAEA,SACE,qBAAC,SAAI,WAAW,mBAAmBA,OAAM,IAAI,IAAI,KAAK,IACpD;AAAA,wBAAC,SAAI,WAAU,mBAAmB,gBAAK;AAAA,IACvC,qBAAC,SAAI,WAAU,8BACb;AAAA,0BAAC,SAAK,oBAAUA,OAAM,KAAK,SAAS,CAAC,GAA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AC1B,0BAAAA,KAACC,UAAA,EAAQ,QAAQ,SAAS,QAAQ,GACpC;AAGF,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AASO,IAAM,mBAAmB,CAAC,SAAyB;AACxD,SAAO,KACJ,MAAM,YAAY,EAClB,IAAI,CAAC,YAAY;AAEhB,QAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,SAAS,GAAG,GAAG;AACpD,aAAO;AAAA,IACT;AAEA,WAAO,QAAQ,QAAQ,0BAA0B,SAAS;AAAA,EAC5D,CAAC,EACA,KAAK,EAAE;AACZ;AAeO,IAAM,kBAAmC;AAAA,EAC9C,QAAQ,CAAC,EAAE,KAAK,MAAM;AACpB,QAAI,EAAE,OAAO,IAAIC,YAAW,CAAC,IAAI,CAAC;AAClC,QAAI,KAAK,YAAY,cAAc;AACjC,eAAS,iBAAiB,MAAM;AAAA,IAClC;AACA,WAAO,gBAAAF,KAAAD,WAAA,EAAG,UAAAI,OAAM,MAAM,GAAE;AAAA,EAC1B;AACF;","names":["Content","inlineHtml","parse","attrs","Content","RenderInline","jsx","jsxs","jsx","parse","cn","Fragment","jsx","jsxs","observer","maxIndex","useEffect","Fragment","jsx","Content","inlineHtml","parse"]}
|
|
1
|
+
{"version":3,"sources":["../../../../components/src/asciidoc/index.tsx","../../../../components/src/asciidoc/Admonition.tsx","../../../../components/src/asciidoc/Section.tsx","../../../../components/src/asciidoc/Table.tsx","../../../../components/src/asciidoc/TableOfContents.tsx","../../../../components/src/asciidoc/use-delegated-links.ts","../../../../components/src/asciidoc/util.ts"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport {\n Content,\n inlineHtml,\n parse,\n type DocumentBlock,\n type InlineOverrides,\n} from '@oxide/react-asciidoc'\n\nimport Admonition from './Admonition'\nimport Section from './Section'\nimport Table from './Table'\nimport {\n DesktopOutline,\n SmallScreenOutline,\n useActiveSectionTracking,\n useIntersectionObserver,\n} from './TableOfContents'\nimport { useDelegatedReactRouterLinks } from './use-delegated-links'\nimport { attrs, handleDocument, highlight, loadAsciidoctor } from './util'\n\nconst MinimalDocument = ({ document }: { document: DocumentBlock }) => (\n <div id=\"content\" className=\"asciidoc-body w-full\">\n <Content blocks={document.blocks} />\n </div>\n)\n\nconst AsciiDocBlocks = {\n Admonition,\n Table,\n Section,\n MinimalDocument,\n}\n\n/**\n * Adds word break opportunities (<wbr/>) after slashes in text, except within HTML tags.\n * This function is used to improve line breaks for long paths or URLs in rendered content.\n * *\n * renderWithBreaks('/path/to/long/file.txt')\n * '/<wbr/>path/<wbr/>to/<wbr/>long/<wbr/>file.txt'\n */\nexport const renderWithBreaks = (text: string): string => {\n return text\n .split(/(<[^>]*>)/g)\n .map((segment) => {\n // if the segment is an HTML tag, leave it unchanged\n if (segment.startsWith('<') && segment.endsWith('>')) {\n return segment\n }\n // replace slashes that are not surrounded by spaces\n return segment.replace(/(?:^|(?<=\\S))\\/(?=\\S)/g, '/<wbr/>')\n })\n .join('')\n}\n\n/**\n * Inline-level overrides for the renderer. Pass these to `<Asciidoc>` as\n * `options.inlineOverrides` to apply our customisations to inline content:\n *\n * <Asciidoc document={doc} options={{ overrides: AsciiDocBlocks, inlineOverrides }} />\n *\n * The only customisation today is inserting `<wbr/>` break opportunities into\n * inline monospaced (`code`) spans so long paths and URLs wrap nicely. Every\n * other quoted subtype is rendered exactly as the renderer would by default —\n * we round-trip the node through `inlineHtml` (the renderer's own serialiser)\n * and `parse` it back into React elements, so there's no risk of drifting from\n * the stock output.\n */\nexport const inlineOverrides: InlineOverrides = {\n quoted: ({ node }) => {\n let { __html } = inlineHtml([node])\n if (node.subtype === 'monospaced') {\n __html = renderWithBreaks(__html)\n }\n return <>{parse(__html)}</>\n },\n}\n\nexport {\n AsciiDocBlocks,\n handleDocument,\n highlight,\n loadAsciidoctor,\n attrs,\n DesktopOutline,\n SmallScreenOutline,\n useActiveSectionTracking,\n useIntersectionObserver,\n useDelegatedReactRouterLinks,\n}\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Error12Icon, Info12Icon, Warning12Icon } from '@/icons/react'\nimport { Content, RenderInline, type AdmonitionBlock } from '@oxide/react-asciidoc'\nimport cn from 'classnames'\n\nimport { titleCase } from '../utils'\n\nconst themeForAdmonition: Record<string, string> = {\n note: 'green-theme',\n caution: 'yellow-theme',\n important: 'yellow-theme',\n warning: 'red-theme',\n tip: 'purple-theme',\n}\n\nconst Admonition = ({ node }: { node: AdmonitionBlock }) => {\n const attrs = node.attributes\n const theme = themeForAdmonition[attrs.name] || ''\n\n let icon\n if (attrs.name === 'caution') {\n icon = <Error12Icon />\n } else if (attrs.name === 'warning') {\n icon = <Warning12Icon />\n } else {\n icon = <Info12Icon />\n }\n\n return (\n <div\n id={node.id || undefined}\n className={cn('admonitionblock', attrs.name, theme, node.role)}\n {...(node.lineNumber ? { 'data-lineno': node.lineNumber } : {})}\n >\n <div className=\"admonition-icon\">{icon}</div>\n <div className=\"admonition-content content\">\n <div>{titleCase(attrs.name.toString())}</div>\n <div>\n {node.titleInlines && (\n <div className=\"admonition-title\">\n <RenderInline nodes={node.titleInlines} />\n </div>\n )}\n {/* Simple (single-paragraph) admonitions carry their content as an\n inline AST; multi-block admonitions render their child blocks. */}\n {node.inlines && <RenderInline nodes={node.inlines} />}\n <Content blocks={node.blocks} />\n </div>\n </div>\n </div>\n )\n}\n\nexport default Admonition\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Link16Icon } from '@/icons/react'\nimport {\n Content,\n inlineHtml,\n parse,\n RenderInline,\n type Inline,\n type SectionBlock,\n} from '@oxide/react-asciidoc'\nimport cn from 'classnames'\nimport { createElement, type JSX } from 'react'\n\n/** Remove `<a>` open/close tags from an HTML string, keeping their contents. */\nconst dropAnchorTags = <T extends string | undefined>(html: T): T =>\n (html?.includes('<a') ? html.replace(/<(?:a\\b[^>]*|\\/a)>/g, '') : html) as T\n\n/**\n * Strip links out of inline title content. The heading is wrapped in a self-link\n * `<a>` below, so any anchor in the title — an inline link, a cross-reference, a\n * footnote marker — would nest an `<a>` inside an `<a>`: invalid HTML that breaks\n * hydration. Unwrap inline links to their text, and render the stock footnote\n * marker with its `<a>` removed (which also drops any hover a footnote override\n * would otherwise add).\n */\nconst stripLinks = (nodes: Inline.InlineNode[]): Inline.InlineNode[] =>\n nodes.flatMap((node): Inline.InlineNode[] => {\n if (node.type === 'anchor') return stripLinks(node.text)\n if (node.type === 'footnote')\n return [{ type: 'text', text: dropAnchorTags(inlineHtml([node]).__html), raw: true }]\n return [node]\n })\n\nconst Section = ({ node }: { node: SectionBlock }) => {\n const level = node.level\n let title: JSX.Element | string = ''\n\n let sectNum = node.num\n sectNum = sectNum && sectNum[0] === '.' ? '' : sectNum\n\n // Captioned titles (appendices, etc.) arrive as an HTML string; everything\n // else comes from the inline AST. Either way, strip any links from the title\n // so they don't nest inside the self-link `<a>` we wrap it in below.\n const titleContent = node.hasCaption ? (\n parse(dropAnchorTags(node.title))\n ) : (\n <RenderInline nodes={node.titleInlines && stripLinks(node.titleInlines)} />\n )\n\n title = (\n <>\n <span className=\"anchor\" id={node.id || ''} aria-hidden=\"true\" />\n <a className=\"link group\" href={`#${node.id}`}>\n {titleContent}\n <Link16Icon className=\"text-accent-secondary ml-2 hidden group-hover:inline-block\" />\n </a>\n </>\n )\n\n if (level === 0) {\n return (\n <>\n <h1 className={cn('sect0', node.role)} data-sectnum={sectNum}>\n {title}\n </h1>\n <Content blocks={node.blocks} />\n </>\n )\n } else if (level === 1) {\n return (\n <div className={cn('sect1', node.role)}>\n {createElement('h2', { 'data-sectnum': sectNum }, title)}\n <div className=\"sectionbody\">\n <Content blocks={node.blocks} />\n </div>\n </div>\n )\n } else {\n return (\n <div className={cn(`sect${level}`, node.role)}>\n {createElement(`h${level + 1}`, { 'data-sectnum': sectNum }, title)}\n <Content blocks={node.blocks} />\n </div>\n )\n }\n}\n\nexport default Section\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { Table as InnerTable, type TableBlock } from '@oxide/react-asciidoc'\n\nconst Table = ({ node }: { node: TableBlock }) => (\n <div className=\"table-wrapper\">\n <InnerTable node={node} />\n </div>\n)\n\nexport default Table\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport { DirectionRightIcon } from '@/icons/react'\nimport { parse, type DocumentSection } from '@oxide/react-asciidoc'\nimport * as Accordion from '@radix-ui/react-accordion'\nimport cn from 'classnames'\nimport { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\n// A TOC entry is itself an `<a>`, so any anchors inside the title text would\n// nest (invalid HTML + a client/server hydration mismatch). Strip the anchor\n// tags but keep their inner content — mirrors asciidoctor's `DropAnchorRx`\n// (and the renderer's own `convert_outline`).\nconst dropAnchors = (html: string): string =>\n html.includes('<a') ? html.replace(/<(?:a\\b[^>]*|\\/a)>/g, '') : html\n\nexport function useIntersectionObserver(\n elements: Element[],\n callback: IntersectionObserverCallback,\n options: IntersectionObserverInit,\n) {\n const [observer, setObserver] = useState<IntersectionObserver | null>(null)\n\n // Create the observer in an effect so we can tear it down when this unmounts\n useEffect(() => {\n const observer = new IntersectionObserver(callback, options)\n setObserver(observer)\n\n return () => {\n observer.disconnect()\n }\n }, [callback, options])\n\n // Bind the elements that should be listened for\n useEffect(() => {\n if (observer) {\n for (const element of elements) {\n observer.observe(element)\n }\n }\n\n return () => {\n if (observer) {\n for (const element of elements) {\n observer.unobserve(element)\n }\n }\n }\n }, [elements, observer])\n\n return observer\n}\n\n// Create threshold steps that trigger intersection events every 0.05%. This is needed to provide\n// decent measurements on very tall elements. In the future we could instead compute the needed\n// thresholds on a per element basis so that we are measuring per pixel instead of per percent.\nconst THRESHOLD = [...Array(2000).keys()].map((n) => n / 2000)\n\nfunction isTopLevelSection(element: Element): boolean {\n return element.classList.contains('sect1')\n}\n\n// Uses the asciidoc generated classes to find the closest section wrapping parent element\nfunction findParentSection(element: Element): Element | null {\n const sect2Wrapper = element.closest('.sect2')\n return sect2Wrapper ? sect2Wrapper : element.closest('.sect1')\n}\n\nfunction newSection(\n node: number,\n element: Element,\n wrapper: Element,\n parent: number | null,\n): Section {\n return {\n node,\n element,\n wrapper,\n parent,\n children: [],\n }\n}\n\nfunction buildSectionTree(elements: Element[]): Section[] {\n const sections = []\n let parent = null\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n const parentWrapper = findParentSection(element)\n\n if (parentWrapper) {\n if (parentWrapper && isTopLevelSection(parentWrapper)) {\n const section = newSection(i, element, parentWrapper, null)\n sections.push(section)\n parent = section\n } else {\n if (parent === null) {\n // Fail to construct a tree if the provided elements are invalid\n return []\n } else {\n const section = newSection(i, element, parentWrapper, parent.node)\n parent.children.push(i)\n sections.push(section)\n }\n }\n } else {\n // Fail to construct a tree if the provided elements are invalid\n return []\n }\n }\n\n return sections\n}\n\nfunction maxIndex(nums: number[]): number | undefined {\n return nums.reduce<number | undefined>((maxIndex, current, currentIndex) => {\n const currentMax = maxIndex !== undefined ? nums[maxIndex] : 0\n return current > currentMax ? currentIndex : maxIndex\n }, undefined)\n}\n\ntype Section = {\n node: number\n element: Element\n wrapper: Element\n parent: number | null\n children: number[]\n}\n// This hook will call the provided callback whenever a section that is identified by a heading is\n// determined to be \"active\". A section is considered to be the \"active\" section when covers more\n// space of the specified measuring area than any other section.\nexport function useActiveSectionTracking(\n initialSections: Element[],\n onSectionChange: (element: Element) => void,\n debug = false,\n) {\n // Construct a tree in the form of a basic array that will allow for traversing between parent\n // an child nodes quickly\n const [sectionWrappers, setSectionWrappers] = useState<Section[]>(\n buildSectionTree(initialSections),\n )\n\n // Internally we need to track the coverage percentage for each element without triggering\n // renders\n const sectionMeasurements = useRef<number[]>([])\n\n // The caller only provides the hook with section headers and so we need to map those to their\n // relevant containing sections\n const setSections = useCallback(\n (sections: Element[]) => {\n setSectionWrappers(buildSectionTree(sections))\n\n // When sections change we need to also zero out our section visibility measurements\n sectionMeasurements.current = []\n },\n [setSectionWrappers],\n )\n\n // Create the section tracker\n const wrapperActivator = useCallback(\n (entries: IntersectionObserverEntry[]) => {\n // For each observed element that has interacted with our intersection window we want to\n // compute and record the percentage of space that is covered by the element. This work is all\n // performed off of the main thread\n for (const entry of entries) {\n // Find where in our list of section wrapper elements the entry that changed is\n const index = sectionWrappers.findIndex((node) => node.wrapper === entry.target)\n\n // We are only trying to detect vertical scroll changes and therefore only need to use the\n // heigh to compute the coverage percentage\n const covered = entry.intersectionRect.height / (entry.rootBounds?.height || 1)\n sectionMeasurements.current[index] = covered\n }\n\n // For each section element, compute the amount of space that is \"owned\" by that element. In\n // this check, space is considered \"owned\" by the element furthest down the tree.\n //\n // Example:\n // A parent element covers 70% of the measured space. This element has two child elements,\n // one that covers 30%, and another that covers 25%. In this case both of the child elements\n // own their respective spaces, and the parent owns 15% (70 - (30 + 25)) of the space.\n //\n // Because we are only trying to determine the space owned by a single element, we do not need\n // to traverse further than that elements direct descendants\n const ownedSectionSizes = sectionWrappers.map((section) => {\n const childSizes = section.children\n .map((c) => sectionMeasurements.current[c])\n .reduce((c, a) => c + a, 0)\n return sectionMeasurements.current[section.node] - childSizes\n })\n\n // Now that we have a list of how much of the measured space each element takes up, we simply\n // find the element that is taking up the most space, and assign it to be the current section\n const activeSectionIndex = maxIndex(ownedSectionSizes)\n\n if (activeSectionIndex !== undefined) {\n onSectionChange(sectionWrappers[activeSectionIndex].element)\n }\n },\n [sectionWrappers, onSectionChange],\n )\n\n // Define our measurement area. This space is relative to the root element (i.e. the screen). It\n // is a band that starts at 5% down from the top, and ends at 80% up from the bottom of the\n // screen.\n const wrapperSettings = useMemo(\n () => ({ threshold: THRESHOLD, rootMargin: `-15% 0px -70% 0px` }),\n [],\n )\n\n // We need to ensure that we are only sending valid sections to be observed\n const bindableWrappers = useMemo(\n () => sectionWrappers.map((s) => s.wrapper),\n [sectionWrappers],\n )\n\n // Generate the intersection observer based on the above configuration\n const sectionObserver = useIntersectionObserver(\n bindableWrappers,\n wrapperActivator,\n wrapperSettings,\n )\n\n let debugNode = null\n if (debug && sectionObserver?.root === null) {\n // Parse and invert the margins\n const edges = sectionObserver.rootMargin.split(' ').map((margin) => {\n if (margin.endsWith('%')) {\n return parseInt(margin) * -1 + '%'\n } else if (margin.endsWith('px')) {\n return parseInt(margin) * -1 + 'px'\n } else {\n return '0px'\n }\n })\n\n debugNode = (\n <div\n style={{\n position: 'fixed',\n top: edges[0],\n right: edges[1],\n bottom: edges[2],\n left: edges[3],\n background: 'rgba(255, 92, 170, 0.2)',\n border: '1px solid rgba(255, 92, 170)',\n pointerEvents: 'none',\n zIndex: 500,\n }}\n />\n )\n }\n\n return {\n setSections,\n debugNode,\n }\n}\n\nexport const DesktopOutline = ({\n toc,\n activeItem,\n className,\n}: {\n toc: DocumentSection[]\n activeItem: string\n className?: string\n}) => {\n const renderToc = (sections: DocumentSection[]) => {\n return sections.map((item) => (\n <Fragment key={item.id}>\n <li\n data-level={item.level}\n className={cn('text-sans-sm mb-0 list-none', item.level > 2 && 'hidden')}\n >\n <a\n href={`#${item.id}`}\n className={cn(\n 'block border-l py-[4px] pr-4',\n activeItem === item.id\n ? 'active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent hover:light:text-raise'\n : 'text-tertiary border-secondary hover:text-secondary',\n )}\n style={{\n paddingLeft: `${0.5 + item.level * 0.5}rem`,\n }}\n >\n {parse(dropAnchors(item.title))}\n </a>\n </li>\n {item.sections && renderToc(item.sections)}\n </Fragment>\n ))\n }\n\n if (toc && toc.length > 0) {\n return <ul className={cn('toc w-(--toc-width)', className)}>{renderToc(toc)}</ul>\n }\n\n return null\n}\nexport const SmallScreenOutline = ({\n toc,\n activeItem,\n className,\n}: {\n toc: DocumentSection[]\n activeItem: string\n className?: string\n}) => {\n const [value, setValue] = useState('')\n\n const renderToc = (sections: DocumentSection[]) => {\n return sections.map((item) => (\n <Fragment key={item.id}>\n <li\n data-level={item.level}\n className={cn('text-sans-sm list-none', item.level > 2 && 'hidden')}\n >\n <a\n href={`#${item.id}`}\n onClick={() => setValue('')}\n className={cn(\n 'block border-l py-[4px]',\n activeItem === item.id\n ? 'active text-accent-secondary light:text-default light:border-green-800 border-accent-secondary hover:text-accent'\n : 'text-tertiary border-secondary hover:text-secondary',\n )}\n style={{\n paddingLeft: `${0.5 + item.level * 0.5}rem`,\n }}\n >\n {parse(dropAnchors(item.title))}\n </a>\n </li>\n {item.sections && renderToc(item.sections)}\n </Fragment>\n ))\n }\n\n if (toc && toc.length > 0) {\n return (\n <Accordion.Root\n type=\"single\"\n className={cn(\n 'toc bg-default border-secondary sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-t border-b print:hidden',\n className,\n )}\n collapsible\n value={value}\n onValueChange={setValue}\n >\n <Accordion.Item value=\"toc\">\n <Accordion.Header>\n <Accordion.Trigger className=\"text-sans-md text-default hover:bg-hover flex h-12 w-full items-center justify-between px-(--container-px) [&>svg]:data-[state=open]:rotate-90\">\n Table of Contents{' '}\n <DirectionRightIcon className=\"text-tertiary transition-all\" />\n </Accordion.Trigger>\n </Accordion.Header>\n\n <Accordion.Content className=\"animated-accordion hydrated border-secondary max-h-[60vh] w-full overflow-y-scroll border-t px-(--container-px)\">\n <div className=\"py-4\">{renderToc(toc)}</div>\n </Accordion.Content>\n </Accordion.Item>\n </Accordion.Root>\n )\n }\n\n return null\n}\n","/**\n * MIT License\n *\n * Copyright (c) React Training LLC 2015-2021\n * Copyright (c) Shopify Inc. 2022-2023\n * From https://github.com/remix-run/react-router-website/blob/main/app/ui/delegate-markdown-links.ts\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n */\nimport { useEffect } from 'react'\n\n// copied from React Router, unlikely to change\n// https://github.com/remix-run/react-router/blob/7b041811/packages/react-router/lib/router/history.ts#L32-L50\ninterface Path {\n pathname: string\n search: string\n hash: string\n}\n\n// https://github.com/remix-run/react-router/blob/7b041811/packages/react-router/lib/router/history.ts#L101-L105\ntype To = string | Partial<Path>\n\n// Converts regular AsciiDoc a tags and makes them React Routery\n// Added key so that this is reloaded when the user routes from one document to another directly\nfunction useDelegatedReactRouterLinks(\n // this is to avoid a dependency on remix/react router\n /** Pass in the result of `useNavigate()` in the calling application. */\n navigate: (to: To) => void,\n nodeRef: React.RefObject<HTMLElement | null>,\n key: string,\n) {\n useEffect(() => {\n const node = nodeRef.current\n const handler = (event: MouseEvent) => {\n if (!nodeRef.current) return\n\n if (!(event.target instanceof HTMLElement)) return\n\n const a = event.target.closest('a')\n\n if (\n a && // is anchor or has anchor parent\n a.hasAttribute('href') && // has an href\n a.host === window.location.host && // is internal\n event.button === 0 && // left click\n (!a.target || a.target === '_self') && // Let browser handle \"target=_blank\" etc.\n !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) // not modified\n ) {\n event.preventDefault()\n const { pathname, search, hash } = a\n navigate({ pathname, search, hash })\n }\n }\n\n if (!node) return\n node.addEventListener('click', handler)\n\n return () => {\n node?.removeEventListener('click', handler)\n }\n }, [navigate, nodeRef, key])\n}\n\nexport { useDelegatedReactRouterLinks }\n","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, you can obtain one at https://mozilla.org/MPL/2.0/.\n *\n * Copyright Oxide Computer Company\n */\nimport asciidoctor, { type Document, type Registry } from '@asciidoctor/core'\nimport {\n Block,\n Inline,\n LiteralBlock,\n prepareDocument,\n processDocument,\n} from '@oxide/react-asciidoc'\nimport {\n bundledLanguages,\n createHighlighter,\n type BundledLanguage,\n type BundledTheme,\n type HighlighterGeneric,\n type LanguageInput,\n} from 'shiki'\n\nimport { oxqlGrammar as oxql, p4Grammar as p4, oxideTheme as theme } from '../syntax'\n\nlet highlighterPromise: Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> | null =\n null\nconst customLanguages = ['oxql', 'p4']\nconst supportedLanguages = [...Object.keys(bundledLanguages), ...customLanguages]\n\nexport function getHighlighter() {\n if (!highlighterPromise) {\n const langs: LanguageInput[] = [{ ...oxql }, { ...p4 }]\n highlighterPromise = createHighlighter({ themes: [theme], langs })\n }\n return highlighterPromise\n}\n\nexport async function highlightCode(\n code: string,\n lang: string,\n { inline = false }: { inline?: boolean } = {},\n): Promise<string> {\n const h = await getHighlighter()\n const resolved = supportedLanguages.includes(lang) ? lang : 'text'\n if (!h.getLoadedLanguages().includes(resolved)) {\n await h.loadLanguage(resolved as BundledLanguage)\n }\n return h.codeToHtml(code, {\n lang: resolved,\n theme,\n ...(inline ? { structure: 'inline' as const } : {}),\n })\n}\n\nconst highlight = async (block: Block): Promise<Block> => {\n if (block.type === 'listing') {\n const literalBlock = block as LiteralBlock\n\n // Highlight `subbedSource`: `source` with react-asciidoc's text-level subs\n // (notably `attributes`) resolved, but still un-escaped and with raw `<N>`\n // callouts — the plain code to tokenize. Highlighting re-escapes, so feeding\n // it the specialchars-escaped `content` would double-escape (`&` -> `&`).\n if (typeof literalBlock.subbedSource !== 'string') {\n return block\n }\n const source = literalBlock.subbedSource\n\n // Turn raw callout markers (`<N>`, optionally comment-prefixed) into the\n // `<i class=\"conum\" data-value=\"N\"></i><b>(N)</b>` markup asciidoc.css\n // styles (it hides the trailing `<b>`). Keyed to the raw `<N>` form because\n // it runs on `source`, not the escaped `<N>` of `content`.\n const lineComment = literalBlock.attributes['line-comment']\n const content = Inline.subCalloutsRaw(\n source,\n true,\n lineComment !== undefined ? String(lineComment) : undefined,\n )\n\n // Replace the conum markup with placeholders before highlighting, otherwise\n // the syntax highlighter escapes it and it shows up as literal text. Cover\n // the trailing `<b>` badge too so the whole unit is restored intact.\n //\n // The placeholder must survive tokenization as a single unbroken run of\n // text — anything a grammar can tokenize (digits, underscores) gets split\n // across `<span>`s, leaving the placeholder literal in the output — so the\n // index is spelled with letters only (0–9 mapped to A–J).\n const calloutRegex = /<i class=\"conum\" data-value=\"\\d+\"><\\/i>(?:<b>\\(\\d+\\)<\\/b>)?/g\n const decodeIndex = (letters: string) =>\n parseInt(\n letters.replace(/[A-J]/g, (c) => String('ABCDEFGHIJ'.indexOf(c))),\n 10,\n )\n const callouts: string[] = []\n const placeholderContent = content.replace(calloutRegex, (match) => {\n callouts.push(match)\n const index = String(callouts.length - 1).replace(/\\d/g, (d) => 'ABCDEFGHIJ'[+d])\n return `CALLOUTPLACEHOLDER${index}END`\n })\n\n // If no language specified, we still want to support callouts. This content\n // skips the highlighter and goes straight to `innerHTML`, so escape the raw\n // text ourselves; the conum markup is held out as placeholders and restored\n // un-escaped after.\n if (!literalBlock.language) {\n return {\n ...block,\n content: Inline.subSpecialchars(placeholderContent).replace(\n /CALLOUTPLACEHOLDER([A-J]+)END/g,\n (_, index) => callouts[decodeIndex(index)],\n ),\n }\n }\n\n const highlightedContent = await highlightCode(\n placeholderContent,\n literalBlock.language,\n { inline: true },\n )\n\n // Restore callouts in the highlighted content\n const restoredContent = highlightedContent.replace(\n /CALLOUTPLACEHOLDER([A-J]+)END/g,\n (_, index) => callouts[decodeIndex(index)],\n )\n\n return {\n ...block,\n content: restoredContent,\n }\n }\n return block\n}\n\nconst attrs = {\n sectlinks: 'true',\n stem: 'latexmath',\n stylesheet: false,\n icons: 'font',\n}\n\nconst loadAsciidoctor = ({\n extensions = [],\n}: {\n extensions?: ((this: Registry) => void)[]\n}) => {\n const ad = asciidoctor()\n\n // Rendering goes through `prepareDocument` + React templates, so only\n // extensions need registering; they run at `ad.load` time (e.g. include\n // processing). Inline content (callouts, quotes, etc.) is produced by the\n // renderer's inline parser.\n extensions.forEach((extension) => ad.Extensions.register(extension))\n\n return ad\n}\n\nconst handleDocument = async (document: Document) => {\n const doc = prepareDocument(document)\n return await processDocument(doc, highlight)\n}\n\nexport { handleDocument, highlight, loadAsciidoctor, attrs }\n"],"mappings":";;;;;;;;;;;;;;;;;AAOA;AAAA,EACE,WAAAA;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,OAGK;;;ACLP,SAAS,SAAS,oBAA0C;AAC5D,OAAO,QAAQ;AAkBJ,cAgBH,YAhBG;AAdX,IAAM,qBAA6C;AAAA,EACjD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,KAAK;AACP;AAEA,IAAM,aAAa,CAAC,EAAE,KAAK,MAAiC;AAC1D,QAAMC,SAAQ,KAAK;AACnB,QAAM,QAAQ,mBAAmBA,OAAM,IAAI,KAAK;AAEhD,MAAI;AACJ,MAAIA,OAAM,SAAS,WAAW;AAC5B,WAAO,oBAAC,uBAAY;AAAA,EACtB,WAAWA,OAAM,SAAS,WAAW;AACnC,WAAO,oBAAC,yBAAc;AAAA,EACxB,OAAO;AACL,WAAO,oBAAC,sBAAW;AAAA,EACrB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,KAAK,MAAM;AAAA,MACf,WAAW,GAAG,mBAAmBA,OAAM,MAAM,OAAO,KAAK,IAAI;AAAA,MAC5D,GAAI,KAAK,aAAa,EAAE,eAAe,KAAK,WAAW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D,CAAC,EACA,KAAK,EAAE;AACZ;AAeO,IAAM,kBAAmC;AAAA,EAC9C,QAAQ,CAAC,EAAE,KAAK,MAAM;AACpB,QAAI,EAAE,OAAO,IAAIC,YAAW,CAAC,IAAI,CAAC;AAClC,QAAI,KAAK,YAAY,cAAc;AACjC,eAAS,iBAAiB,MAAM;AAAA,IAClC;AACA,WAAO,gBAAAF,KAAAD,WAAA,EAAG,UAAAI,OAAM,MAAM,GAAE;AAAA,EAC1B;AACF;","names":["Content","inlineHtml","parse","attrs","Content","RenderInline","cn","jsx","jsxs","jsx","parse","cn","Fragment","jsx","jsxs","observer","maxIndex","useEffect","Fragment","jsx","Content","inlineHtml","parse"]}
|