@oxide/design-system 3.2.0--canary.151.18509831946.0 → 3.2.0--canary.151.18510677674.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.
@@ -1,31 +1,2514 @@
1
+ // components/src/asciidoc/index.tsx
2
+ import asciidoctor2 from "@asciidoctor/core";
3
+ import { Content as Content4 } from "@oxide/react-asciidoc";
4
+
5
+ // components/src/asciidoc/Admonition.tsx
6
+ import { Content, parse, Title } from "@oxide/react-asciidoc";
7
+
8
+ // components/src/utils.ts
9
+ import cn from "classnames";
10
+ import { createElement } from "react";
11
+ var titleCase = (text) => {
12
+ return text.replace(
13
+ /\w\S*/g,
14
+ (text2) => text2.charAt(0).toUpperCase() + text2.substring(1).toLowerCase()
15
+ );
16
+ };
17
+ var make = (tag) => (
18
+ // only one argument here means string interpolations are not allowed
19
+ (strings) => {
20
+ const Comp = ({ className, children, ...rest }) => createElement(tag, { className: cn(strings[0], className), ...rest }, children);
21
+ Comp.displayName = `classed.${tag}`;
22
+ return Comp;
23
+ }
24
+ );
25
+ var classed = {
26
+ button: make("button"),
27
+ div: make("div"),
28
+ h1: make("h1"),
29
+ h2: make("h2"),
30
+ h3: make("h3"),
31
+ h4: make("h4"),
32
+ hr: make("hr"),
33
+ header: make("header"),
34
+ input: make("input"),
35
+ label: make("label"),
36
+ li: make("li"),
37
+ main: make("main"),
38
+ ol: make("ol"),
39
+ p: make("p"),
40
+ span: make("span"),
41
+ table: make("table"),
42
+ tbody: make("tbody"),
43
+ td: make("td"),
44
+ th: make("th"),
45
+ tr: make("tr")
46
+ };
47
+
48
+ // components/src/asciidoc/Admonition.tsx
49
+ import { jsx, jsxs } from "react/jsx-runtime";
50
+ var Admonition = ({ node }) => {
51
+ const attrs2 = node.attributes;
52
+ let icon;
53
+ if (attrs2.name === "caution") {
54
+ icon = /* @__PURE__ */ jsx(Error12, {});
55
+ } else if (attrs2.name === "warning") {
56
+ icon = /* @__PURE__ */ jsx(Warning12, {});
57
+ } else {
58
+ icon = /* @__PURE__ */ jsx(Error12, { className: "rotate-180" });
59
+ }
60
+ return /* @__PURE__ */ jsxs("div", { className: `admonitionblock ${attrs2.name}`, children: [
61
+ /* @__PURE__ */ jsx("div", { className: "admonition-icon", children: icon }),
62
+ /* @__PURE__ */ jsxs("div", { className: "admonition-content content", children: [
63
+ /* @__PURE__ */ jsx(Title, { text: node.title }),
64
+ /* @__PURE__ */ jsx("div", { children: titleCase(attrs2.name.toString()) }),
65
+ /* @__PURE__ */ jsxs("div", { children: [
66
+ /* @__PURE__ */ jsx(Title, { text: node.title }),
67
+ node.content && parse(node.content),
68
+ /* @__PURE__ */ jsx(Content, { blocks: node.blocks })
69
+ ] })
70
+ ] })
71
+ ] });
72
+ };
73
+ var Error12 = ({ 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
+ var Warning12 = ({ className }) => /* @__PURE__ */ jsx(
93
+ "svg",
94
+ {
95
+ width: "12",
96
+ height: "12",
97
+ viewBox: "0 0 12 12",
98
+ xmlns: "http://www.w3.org/2000/svg",
99
+ className,
100
+ children: /* @__PURE__ */ jsx(
101
+ "path",
102
+ {
103
+ fillRule: "evenodd",
104
+ clipRule: "evenodd",
105
+ 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",
106
+ fill: "currentColor"
107
+ }
108
+ )
109
+ }
110
+ );
111
+ var Admonition_default = Admonition;
112
+
113
+ // icons/react/Link16Icon.tsx
114
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
115
+ var Link16Icon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs2(
116
+ "svg",
117
+ {
118
+ xmlns: "http://www.w3.org/2000/svg",
119
+ width: 16,
120
+ height: 16,
121
+ viewBox: "0 0 16 16",
122
+ role: "img",
123
+ "aria-labelledby": titleId,
124
+ ...props,
125
+ children: [
126
+ title ? /* @__PURE__ */ jsx2("title", { id: titleId, children: title }) : null,
127
+ /* @__PURE__ */ jsxs2("g", { fill: "currentColor", children: [
128
+ /* @__PURE__ */ jsx2("path", { d: "m6.586 12.243 1.59-1.591a.75.75 0 0 1 1.061 0l.354.353a.75.75 0 0 1 0 1.06L8 13.658A4 4 0 0 1 2.343 8l1.591-1.591a.75.75 0 0 1 1.06 0l.354.354a.75.75 0 0 1 0 1.06l-1.59 1.591a2 2 0 1 0 2.828 2.829M12.066 9.591a.75.75 0 0 1-1.06 0l-.354-.354a.75.75 0 0 1 0-1.06l1.59-1.591a2 2 0 1 0-2.828-2.829l-1.59 1.591a.75.75 0 0 1-1.061 0l-.354-.353a.75.75 0 0 1 0-1.06L8 2.342A4 4 0 0 1 13.657 8z" }),
129
+ /* @__PURE__ */ jsx2("path", { d: "M9.945 5.702a.75.75 0 0 0-1.061 0L5.702 8.884a.75.75 0 0 0 0 1.06l.353.354a.75.75 0 0 0 1.061 0l3.182-3.182a.75.75 0 0 0 0-1.06z" })
130
+ ] })
131
+ ]
132
+ }
133
+ );
134
+ var Link16Icon_default = Link16Icon;
135
+
136
+ // icons/react/Checkmark12Icon.tsx
137
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
138
+ var Checkmark12Icon = ({
139
+ title,
140
+ titleId,
141
+ ...props
142
+ }) => /* @__PURE__ */ jsxs3(
143
+ "svg",
144
+ {
145
+ xmlns: "http://www.w3.org/2000/svg",
146
+ width: 12,
147
+ height: 12,
148
+ viewBox: "0 0 12 12",
149
+ role: "img",
150
+ "aria-labelledby": titleId,
151
+ ...props,
152
+ children: [
153
+ title ? /* @__PURE__ */ jsx3("title", { id: titleId, children: title }) : null,
154
+ /* @__PURE__ */ jsx3(
155
+ "path",
156
+ {
157
+ fill: "currentColor",
158
+ fillRule: "evenodd",
159
+ d: "M10.492 2.651c.28.242.31.665.067.944L5.448 9.463a.667.667 0 0 1-.974.035L1.475 6.516a.667.667 0 0 1 0-.946l.237-.235a.667.667 0 0 1 .94 0l2.24 2.226L9.3 2.501a.667.667 0 0 1 .938-.068z",
160
+ clipRule: "evenodd"
161
+ }
162
+ )
163
+ ]
164
+ }
165
+ );
166
+ var Checkmark12Icon_default = Checkmark12Icon;
167
+
168
+ // icons/react/DirectionRightIcon.tsx
169
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
170
+ var DirectionRightIcon = ({
171
+ title,
172
+ titleId,
173
+ ...props
174
+ }) => /* @__PURE__ */ jsxs4(
175
+ "svg",
176
+ {
177
+ xmlns: "http://www.w3.org/2000/svg",
178
+ width: 12,
179
+ height: 12,
180
+ viewBox: "0 0 12 12",
181
+ role: "img",
182
+ "aria-labelledby": titleId,
183
+ ...props,
184
+ children: [
185
+ title ? /* @__PURE__ */ jsx4("title", { id: titleId, children: title }) : null,
186
+ /* @__PURE__ */ jsx4(
187
+ "path",
188
+ {
189
+ fill: "currentColor",
190
+ d: "M8.807 6.597a.667.667 0 0 0 0-1.194l-5.842-2.92A.667.667 0 0 0 2 3.079v5.842c0 .496.522.818.965.596z"
191
+ }
192
+ )
193
+ ]
194
+ }
195
+ );
196
+ var DirectionRightIcon_default = DirectionRightIcon;
197
+
198
+ // icons/react/SelectArrows6Icon.tsx
199
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
200
+ var SelectArrows6Icon = ({
201
+ title,
202
+ titleId,
203
+ ...props
204
+ }) => /* @__PURE__ */ jsxs5(
205
+ "svg",
206
+ {
207
+ xmlns: "http://www.w3.org/2000/svg",
208
+ width: 6,
209
+ height: 14,
210
+ viewBox: "0 0 6 14",
211
+ role: "img",
212
+ "aria-labelledby": titleId,
213
+ ...props,
214
+ children: [
215
+ title ? /* @__PURE__ */ jsx5("title", { id: titleId, children: title }) : null,
216
+ /* @__PURE__ */ jsx5(
217
+ "path",
218
+ {
219
+ fill: "currentColor",
220
+ fillRule: "evenodd",
221
+ d: "M3.322.536a.375.375 0 0 0-.644 0L.341 4.432C.19 4.682.37 5 .662 5h4.676a.375.375 0 0 0 .321-.568zm-.644 12.928a.375.375 0 0 0 .644 0l2.337-3.896A.375.375 0 0 0 5.338 9H.662a.375.375 0 0 0-.321.568z",
222
+ clipRule: "evenodd"
223
+ }
224
+ )
225
+ ]
226
+ }
227
+ );
228
+ var SelectArrows6Icon_default = SelectArrows6Icon;
229
+
230
+ // components/src/asciidoc/Section.tsx
231
+ import { Content as Content2, parse as parse2 } from "@oxide/react-asciidoc";
232
+ import cn2 from "classnames";
233
+ import { createElement as createElement2 } from "react";
234
+ import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
235
+ var stripAnchors = (str) => str.replace(/<a[^>]*>(.*?)<\/a>/gi, "$1");
236
+ var Section = ({ node }) => {
237
+ const level = node.level;
238
+ let title = "";
239
+ let sectNum = node.num;
240
+ sectNum = sectNum && sectNum[0] === "." ? "" : sectNum;
241
+ title = /* @__PURE__ */ jsxs6(Fragment, { children: [
242
+ /* @__PURE__ */ jsx6("span", { className: "anchor", id: node.id || "", "aria-hidden": "true" }),
243
+ /* @__PURE__ */ jsxs6("a", { className: "link group", href: `#${node.id}`, children: [
244
+ parse2(stripAnchors(node.title)),
245
+ /* @__PURE__ */ jsx6(Link16Icon_default, { className: "text-accent-secondary ml-2 hidden group-hover:inline-block" })
246
+ ] })
247
+ ] });
248
+ if (level === 0) {
249
+ return /* @__PURE__ */ jsxs6(Fragment, { children: [
250
+ /* @__PURE__ */ jsx6("h1", { className: cn2("sect0", node.role), "data-sectnum": sectNum, children: title }),
251
+ /* @__PURE__ */ jsx6(Content2, { blocks: node.blocks })
252
+ ] });
253
+ } else {
254
+ return /* @__PURE__ */ jsxs6("div", { className: cn2(`sect${level}`, node.role), children: [
255
+ createElement2(`h${level + 1}`, { "data-sectnum": sectNum }, title),
256
+ /* @__PURE__ */ jsx6("div", { className: "sectionbody", children: /* @__PURE__ */ jsx6(Content2, { blocks: node.blocks }) })
257
+ ] });
258
+ }
259
+ };
260
+ var Section_default = Section;
261
+
262
+ // components/src/asciidoc/Table.tsx
263
+ import { Table as InnerTable } from "@oxide/react-asciidoc";
264
+ import { jsx as jsx7 } from "react/jsx-runtime";
265
+ var Table = ({ node }) => /* @__PURE__ */ jsx7("div", { className: "table-wrapper", children: /* @__PURE__ */ jsx7(InnerTable, { node }) });
266
+ var Table_default = Table;
267
+
268
+ // components/src/asciidoc/TableOfContents.tsx
269
+ import { parse as parse3 } from "@oxide/react-asciidoc";
270
+ import * as Accordion from "@radix-ui/react-accordion";
271
+ import cn3 from "classnames";
272
+ import { Fragment as Fragment2, useCallback, useEffect, useMemo, useRef, useState } from "react";
273
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
274
+ function useIntersectionObserver(elements, callback, options) {
275
+ const [observer, setObserver] = useState(null);
276
+ useEffect(() => {
277
+ const observer2 = new IntersectionObserver(callback, options);
278
+ setObserver(observer2);
279
+ return () => {
280
+ observer2.disconnect();
281
+ };
282
+ }, [callback, options]);
283
+ useEffect(() => {
284
+ if (observer) {
285
+ for (const element of elements) {
286
+ observer.observe(element);
287
+ }
288
+ }
289
+ return () => {
290
+ if (observer) {
291
+ for (const element of elements) {
292
+ observer.unobserve(element);
293
+ }
294
+ }
295
+ };
296
+ }, [elements, observer]);
297
+ return observer;
298
+ }
299
+ var THRESHOLD = [...Array(2e3).keys()].map((n) => n / 2e3);
300
+ function isTopLevelSection(element) {
301
+ return element.classList.contains("sect1");
302
+ }
303
+ function findParentSection(element) {
304
+ const sect2Wrapper = element.closest(".sect2");
305
+ return sect2Wrapper ? sect2Wrapper : element.closest(".sect1");
306
+ }
307
+ function newSection(node, element, wrapper, parent) {
308
+ return {
309
+ node,
310
+ element,
311
+ wrapper,
312
+ parent,
313
+ children: []
314
+ };
315
+ }
316
+ function buildSectionTree(elements) {
317
+ const sections = [];
318
+ let parent = null;
319
+ for (let i = 0; i < elements.length; i++) {
320
+ const element = elements[i];
321
+ const parentWrapper = findParentSection(element);
322
+ if (parentWrapper) {
323
+ if (parentWrapper && isTopLevelSection(parentWrapper)) {
324
+ const section = newSection(i, element, parentWrapper, null);
325
+ sections.push(section);
326
+ parent = section;
327
+ } else {
328
+ if (parent === null) {
329
+ return [];
330
+ } else {
331
+ const section = newSection(i, element, parentWrapper, parent.node);
332
+ parent.children.push(i);
333
+ sections.push(section);
334
+ }
335
+ }
336
+ } else {
337
+ return [];
338
+ }
339
+ }
340
+ return sections;
341
+ }
342
+ function maxIndex(nums) {
343
+ return nums.reduce((maxIndex2, current, currentIndex) => {
344
+ const currentMax = maxIndex2 !== void 0 ? nums[maxIndex2] : 0;
345
+ return current > currentMax ? currentIndex : maxIndex2;
346
+ }, void 0);
347
+ }
348
+ function useActiveSectionTracking(initialSections, onSectionChange, debug = false) {
349
+ const [sectionWrappers, setSectionWrappers] = useState(
350
+ buildSectionTree(initialSections)
351
+ );
352
+ const sectionMeasurements = useRef([]);
353
+ const setSections = useCallback(
354
+ (sections) => {
355
+ setSectionWrappers(buildSectionTree(sections));
356
+ sectionMeasurements.current = [];
357
+ },
358
+ [setSectionWrappers]
359
+ );
360
+ const wrapperActivator = useCallback(
361
+ (entries) => {
362
+ for (const entry of entries) {
363
+ const index = sectionWrappers.findIndex((node) => node.wrapper === entry.target);
364
+ const covered = entry.intersectionRect.height / (entry.rootBounds?.height || 1);
365
+ sectionMeasurements.current[index] = covered;
366
+ }
367
+ const ownedSectionSizes = sectionWrappers.map((section) => {
368
+ const childSizes = section.children.map((c) => sectionMeasurements.current[c]).reduce((c, a) => c + a, 0);
369
+ return sectionMeasurements.current[section.node] - childSizes;
370
+ });
371
+ const activeSectionIndex = maxIndex(ownedSectionSizes);
372
+ if (activeSectionIndex !== void 0) {
373
+ onSectionChange(sectionWrappers[activeSectionIndex].element);
374
+ }
375
+ },
376
+ [sectionWrappers, onSectionChange]
377
+ );
378
+ const wrapperSettings = useMemo(
379
+ () => ({ threshold: THRESHOLD, rootMargin: `-15% 0px -70% 0px` }),
380
+ []
381
+ );
382
+ const bindableWrappers = useMemo(
383
+ () => sectionWrappers.map((s) => s.wrapper),
384
+ [sectionWrappers]
385
+ );
386
+ const sectionObserver = useIntersectionObserver(
387
+ bindableWrappers,
388
+ wrapperActivator,
389
+ wrapperSettings
390
+ );
391
+ let debugNode = null;
392
+ if (debug && sectionObserver?.root === null) {
393
+ const edges = sectionObserver.rootMargin.split(" ").map((margin) => {
394
+ if (margin.endsWith("%")) {
395
+ return parseInt(margin) * -1 + "%";
396
+ } else if (margin.endsWith("px")) {
397
+ return parseInt(margin) * -1 + "px";
398
+ } else {
399
+ return "0px";
400
+ }
401
+ });
402
+ debugNode = /* @__PURE__ */ jsx8(
403
+ "div",
404
+ {
405
+ style: {
406
+ position: "fixed",
407
+ top: edges[0],
408
+ right: edges[1],
409
+ bottom: edges[2],
410
+ left: edges[3],
411
+ background: "rgba(255, 92, 170, 0.2)",
412
+ border: "1px solid rgba(255, 92, 170)",
413
+ pointerEvents: "none",
414
+ zIndex: 500
415
+ }
416
+ }
417
+ );
418
+ }
419
+ return {
420
+ setSections,
421
+ debugNode
422
+ };
423
+ }
424
+ var DesktopOutline = ({
425
+ toc,
426
+ activeItem,
427
+ className
428
+ }) => {
429
+ const renderToc = (sections) => {
430
+ return sections.map((item) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
431
+ /* @__PURE__ */ jsx8(
432
+ "li",
433
+ {
434
+ "data-level": item.level,
435
+ className: cn3("text-sans-sm mb-0 list-none", item.level > 2 && "hidden"),
436
+ children: /* @__PURE__ */ jsx8(
437
+ "a",
438
+ {
439
+ href: `#${item.id}`,
440
+ className: cn3(
441
+ "block border-l py-[4px] pr-4",
442
+ activeItem === item.id ? "active text-accent-secondary border-accent-secondary hover:text-accent" : "text-tertiary border-secondary hover:text-secondary"
443
+ ),
444
+ style: {
445
+ paddingLeft: `${0.5 + item.level * 0.5}rem`
446
+ },
447
+ children: parse3(stripAnchors(item.title))
448
+ }
449
+ )
450
+ }
451
+ ),
452
+ item.sections && renderToc(item.sections)
453
+ ] }, item.id));
454
+ };
455
+ if (toc && toc.length > 0) {
456
+ return /* @__PURE__ */ jsx8("ul", { className: cn3("toc w-(--toc-width)", className), children: renderToc(toc) });
457
+ }
458
+ return null;
459
+ };
460
+ var SmallScreenOutline = ({
461
+ toc,
462
+ activeItem,
463
+ className
464
+ }) => {
465
+ const [value, setValue] = useState("");
466
+ const renderToc = (sections) => {
467
+ return sections.map((item) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
468
+ /* @__PURE__ */ jsx8(
469
+ "li",
470
+ {
471
+ "data-level": item.level,
472
+ className: cn3("text-sans-sm list-none", item.level > 2 && "hidden"),
473
+ children: /* @__PURE__ */ jsx8(
474
+ "a",
475
+ {
476
+ href: `#${item.id}`,
477
+ onClick: () => setValue(""),
478
+ className: cn3(
479
+ "block border-l py-[4px]",
480
+ activeItem === item.id ? "active text-accent-secondary border-accent-secondary hover:text-accent" : "text-tertiary border-secondary hover:text-secondary"
481
+ ),
482
+ style: {
483
+ paddingLeft: `${0.5 + item.level * 0.5}rem`
484
+ },
485
+ children: parse3(stripAnchors(item.title))
486
+ }
487
+ )
488
+ }
489
+ ),
490
+ item.sections && renderToc(item.sections)
491
+ ] }, item.id));
492
+ };
493
+ if (toc && toc.length > 0) {
494
+ return /* @__PURE__ */ jsx8(
495
+ Accordion.Root,
496
+ {
497
+ type: "single",
498
+ className: cn3(
499
+ "toc bg-default border-secondary sticky top-[calc(var(--header-height)-1px)] z-10 -mt-px mb-10 block w-full border-b border-t print:hidden",
500
+ className
501
+ ),
502
+ collapsible: true,
503
+ value,
504
+ onValueChange: setValue,
505
+ children: /* @__PURE__ */ jsxs7(Accordion.Item, { value: "toc", children: [
506
+ /* @__PURE__ */ jsx8(Accordion.Header, { children: /* @__PURE__ */ jsxs7(Accordion.Trigger, { className: "text-sans-md text-default hover:bg-hover px-(--container-px) flex h-12 w-full items-center justify-between [&>svg]:data-[state=open]:rotate-90", children: [
507
+ "Table of Contents",
508
+ " ",
509
+ /* @__PURE__ */ jsx8(DirectionRightIcon_default, { className: "text-tertiary transition-all" })
510
+ ] }) }),
511
+ /* @__PURE__ */ jsx8(Accordion.Content, { className: "animated-accordion hydrated border-secondary px-(--container-px) max-h-[60vh] w-full overflow-y-scroll border-t", children: /* @__PURE__ */ jsx8("div", { className: "py-4", children: renderToc(toc) }) })
512
+ ] })
513
+ }
514
+ );
515
+ }
516
+ return null;
517
+ };
518
+
519
+ // components/src/asciidoc/use-delegated-links.ts
520
+ import { useEffect as useEffect2 } from "react";
521
+ function useDelegatedReactRouterLinks(navigate, nodeRef, key) {
522
+ useEffect2(() => {
523
+ const node = nodeRef.current;
524
+ const handler = (event) => {
525
+ if (!nodeRef.current) return;
526
+ if (!(event.target instanceof HTMLElement)) return;
527
+ const a = event.target.closest("a");
528
+ if (a && // is anchor or has anchor parent
529
+ a.hasAttribute("href") && // has an href
530
+ a.host === window.location.host && // is internal
531
+ event.button === 0 && // left click
532
+ (!a.target || a.target === "_self") && // Let browser handle "target=_blank" etc.
533
+ !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
534
+ event.preventDefault();
535
+ const { pathname, search, hash } = a;
536
+ navigate({ pathname, search, hash });
537
+ }
538
+ };
539
+ if (!node) return;
540
+ node.addEventListener("click", handler);
541
+ return () => {
542
+ node?.removeEventListener("click", handler);
543
+ };
544
+ }, [navigate, nodeRef, key]);
545
+ }
546
+
547
+ // components/src/asciidoc/util.ts
548
+ import asciidoctor from "@asciidoctor/core";
1
549
  import {
2
- AsciiDocBlocks,
3
- Badge,
4
- Button,
5
- Checkbox,
6
- DesktopOutline,
7
- InlineConverter,
8
- Listbox,
9
- SmallScreenOutline,
10
- Spinner,
11
- SpinnerLoader,
12
- Tabs,
13
- attrs,
14
- badgeColors,
15
- buttonSizes,
16
- buttonStyle,
17
- handleDocument,
18
- highlight,
19
- loadAsciidoctor,
20
- renderWithBreaks,
21
- spinnerSizes,
22
- spinnerVariants,
23
- useActiveSectionTracking,
24
- useDelegatedReactRouterLinks,
25
- useIntersectionObserver,
26
- variants
27
- } from "../../chunk-XPHTG73Y.js";
28
- import "../../chunk-BTKC2KJ2.js";
550
+ prepareDocument,
551
+ processDocument
552
+ } from "@oxide/react-asciidoc";
553
+ import {
554
+ bundledLanguages,
555
+ createHighlighter
556
+ } from "shiki";
557
+
558
+ // components/src/asciidoc/langs/oxql.tmLanguage.json
559
+ var oxql_tmLanguage_default = {
560
+ $schema: "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
561
+ name: "oxql",
562
+ repository: {
563
+ keywords: {
564
+ patterns: [
565
+ {
566
+ name: "keyword.control.oxql",
567
+ match: "\\b(if|while|for|return)\\b"
568
+ }
569
+ ]
570
+ },
571
+ strings: {
572
+ name: "string.quoted.double.oxql",
573
+ begin: '"',
574
+ end: '"',
575
+ patterns: [
576
+ {
577
+ name: "constant.character.escape.oxql",
578
+ match: "\\\\."
579
+ }
580
+ ]
581
+ }
582
+ },
583
+ scopeName: "source.oxql",
584
+ patterns: [
585
+ {
586
+ name: "keyword.control.oxql",
587
+ match: "\\b(get|join|align|filter|group_by)\\b"
588
+ },
589
+ {
590
+ name: "string.quoted.double.oxql",
591
+ begin: '"',
592
+ end: '"',
593
+ patterns: [
594
+ {
595
+ name: "constant.character.escape.oxql",
596
+ match: "\\\\."
597
+ }
598
+ ]
599
+ },
600
+ {
601
+ name: "constant.numeric.oxql",
602
+ match: "\\b\\d+[smhdw]\\b"
603
+ },
604
+ {
605
+ name: "constant.numeric.datetime.oxql",
606
+ match: "@\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}"
607
+ },
608
+ {
609
+ name: "constant.numeric.function.oxql",
610
+ match: "@now\\(\\)"
611
+ },
612
+ {
613
+ name: "constant.numeric.oxql",
614
+ match: "\\b\\d+\\b"
615
+ },
616
+ {
617
+ name: "comment.block.oxql",
618
+ begin: "/\\*",
619
+ end: "\\*/"
620
+ },
621
+ {
622
+ name: "comment.line.double-slash.oxql",
623
+ match: "//.*$"
624
+ },
625
+ {
626
+ name: "keyword.operator.oxql",
627
+ match: "\\|"
628
+ }
629
+ ]
630
+ };
631
+
632
+ // components/src/asciidoc/oxide-dark.json
633
+ var oxide_dark_default = {
634
+ name: "Oxide Dark",
635
+ colors: {
636
+ "editor.background": "#080F11",
637
+ "editor.foreground": "#E7E7E8"
638
+ },
639
+ tokenColors: [
640
+ {
641
+ scope: [
642
+ "text",
643
+ "source",
644
+ "variable.other.readwrite",
645
+ "punctuation.definition.variable"
646
+ ],
647
+ settings: {
648
+ foreground: "#E7E7E8"
649
+ }
650
+ },
651
+ {
652
+ scope: "punctuation",
653
+ settings: {
654
+ foreground: "#A1A4A5",
655
+ fontStyle: ""
656
+ }
657
+ },
658
+ {
659
+ scope: ["comment", "punctuation.definition.comment"],
660
+ settings: {
661
+ foreground: "#A1A4A5"
662
+ }
663
+ },
664
+ {
665
+ scope: ["string", "punctuation.definition.string"],
666
+ settings: {
667
+ foreground: "#68D9A7"
668
+ }
669
+ },
670
+ {
671
+ scope: "constant.character.escape",
672
+ settings: {
673
+ foreground: "#EFB7C2"
674
+ }
675
+ },
676
+ {
677
+ scope: [
678
+ "constant.numeric",
679
+ "variable.other.constant",
680
+ "entity.name.constant",
681
+ "constant.language.boolean",
682
+ "constant.language.false",
683
+ "constant.language.true",
684
+ "keyword.other.unit.user-defined",
685
+ "keyword.other.unit.suffix.floating-point"
686
+ ],
687
+ settings: {
688
+ foreground: "#EDD5A6"
689
+ }
690
+ },
691
+ {
692
+ scope: [
693
+ "keyword",
694
+ "keyword.operator.word",
695
+ "keyword.operator.new",
696
+ "variable.language.super",
697
+ "support.type.primitive",
698
+ "storage.type",
699
+ "storage.modifier",
700
+ "punctuation.definition.keyword"
701
+ ],
702
+ settings: {
703
+ foreground: "#C6A5EA",
704
+ fontStyle: ""
705
+ }
706
+ },
707
+ {
708
+ scope: "entity.name.tag.documentation",
709
+ settings: {
710
+ foreground: "#C6A5EA"
711
+ }
712
+ },
713
+ {
714
+ scope: [
715
+ "keyword.operator",
716
+ "punctuation.accessor",
717
+ "punctuation.definition.generic",
718
+ "meta.function.closure punctuation.section.parameters",
719
+ "punctuation.definition.tag",
720
+ "punctuation.separator.key-value"
721
+ ],
722
+ settings: {
723
+ foreground: "#A7E0C8"
724
+ }
725
+ },
726
+ {
727
+ scope: [
728
+ "entity.name.function",
729
+ "meta.function-call.method",
730
+ "support.function",
731
+ "support.function.misc",
732
+ "variable.function"
733
+ ],
734
+ settings: {
735
+ foreground: "#9DAFFA"
736
+ }
737
+ },
738
+ {
739
+ scope: [
740
+ "entity.name.class",
741
+ "entity.other.inherited-class",
742
+ "support.class",
743
+ "meta.function-call.constructor",
744
+ "entity.name.struct"
745
+ ],
746
+ settings: {
747
+ foreground: "#EDD5A6"
748
+ }
749
+ },
750
+ {
751
+ scope: "entity.name.enum",
752
+ settings: {
753
+ foreground: "#EDD5A6"
754
+ }
755
+ },
756
+ {
757
+ scope: ["meta.enum variable.other.readwrite", "variable.other.enummember"],
758
+ settings: {
759
+ foreground: "#A7E0C8"
760
+ }
761
+ },
762
+ {
763
+ scope: "meta.property.object",
764
+ settings: {
765
+ foreground: "#A7E0C8"
766
+ }
767
+ },
768
+ {
769
+ scope: ["meta.type", "meta.type-alias", "support.type", "entity.name.type"],
770
+ settings: {
771
+ foreground: "#EDD5A6"
772
+ }
773
+ },
774
+ {
775
+ scope: [
776
+ "meta.annotation variable.function",
777
+ "meta.annotation variable.annotation.function",
778
+ "meta.annotation punctuation.definition.annotation",
779
+ "meta.decorator",
780
+ "punctuation.decorator"
781
+ ],
782
+ settings: {
783
+ foreground: "#EDD5A6"
784
+ }
785
+ },
786
+ {
787
+ scope: ["variable.parameter", "meta.function.parameters"],
788
+ settings: {
789
+ foreground: "#F39EAE"
790
+ }
791
+ },
792
+ {
793
+ scope: ["constant.language", "support.function.builtin"],
794
+ settings: {
795
+ foreground: "#F7869B"
796
+ }
797
+ },
798
+ {
799
+ scope: "entity.other.attribute-name.documentation",
800
+ settings: {
801
+ foreground: "#F7869B"
802
+ }
803
+ },
804
+ {
805
+ scope: ["keyword.control.directive", "punctuation.definition.directive"],
806
+ settings: {
807
+ foreground: "#EDD5A6"
808
+ }
809
+ },
810
+ {
811
+ scope: "punctuation.definition.typeparameters",
812
+ settings: {
813
+ foreground: "#9DAFFA"
814
+ }
815
+ },
816
+ {
817
+ scope: "entity.name.namespace",
818
+ settings: {
819
+ foreground: "#EDD5A6"
820
+ }
821
+ },
822
+ {
823
+ scope: "support.type.property-name.css",
824
+ settings: {
825
+ foreground: "#9DAFFA",
826
+ fontStyle: ""
827
+ }
828
+ },
829
+ {
830
+ scope: [
831
+ "variable.language.this",
832
+ "variable.language.this punctuation.definition.variable"
833
+ ],
834
+ settings: {
835
+ foreground: "#F7869B"
836
+ }
837
+ },
838
+ {
839
+ scope: "variable.object.property",
840
+ settings: {
841
+ foreground: "#E7E7E8"
842
+ }
843
+ },
844
+ {
845
+ scope: ["string.template variable", "string variable"],
846
+ settings: {
847
+ foreground: "#E7E7E8"
848
+ }
849
+ },
850
+ {
851
+ scope: "keyword.operator.new",
852
+ settings: {
853
+ fontStyle: "bold"
854
+ }
855
+ },
856
+ {
857
+ scope: "storage.modifier.specifier.extern.cpp",
858
+ settings: {
859
+ foreground: "#C6A5EA"
860
+ }
861
+ },
862
+ {
863
+ scope: [
864
+ "entity.name.scope-resolution.template.call.cpp",
865
+ "entity.name.scope-resolution.parameter.cpp",
866
+ "entity.name.scope-resolution.cpp",
867
+ "entity.name.scope-resolution.function.definition.cpp"
868
+ ],
869
+ settings: {
870
+ foreground: "#EDD5A6"
871
+ }
872
+ },
873
+ {
874
+ scope: "storage.type.class.doxygen",
875
+ settings: {
876
+ fontStyle: ""
877
+ }
878
+ },
879
+ {
880
+ scope: ["storage.modifier.reference.cpp"],
881
+ settings: {
882
+ foreground: "#A7E0C8"
883
+ }
884
+ },
885
+ {
886
+ scope: "meta.interpolation.cs",
887
+ settings: {
888
+ foreground: "#E7E7E8"
889
+ }
890
+ },
891
+ {
892
+ scope: "comment.block.documentation.cs",
893
+ settings: {
894
+ foreground: "#E7E7E8"
895
+ }
896
+ },
897
+ {
898
+ scope: [
899
+ "source.css entity.other.attribute-name.class.css",
900
+ "entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css"
901
+ ],
902
+ settings: {
903
+ foreground: "#EDD5A6"
904
+ }
905
+ },
906
+ {
907
+ scope: "punctuation.separator.operator.css",
908
+ settings: {
909
+ foreground: "#A7E0C8"
910
+ }
911
+ },
912
+ {
913
+ scope: "source.css entity.other.attribute-name.pseudo-class",
914
+ settings: {
915
+ foreground: "#A7E0C8"
916
+ }
917
+ },
918
+ {
919
+ scope: "source.css constant.other.unicode-range",
920
+ settings: {
921
+ foreground: "#EDD5A6"
922
+ }
923
+ },
924
+ {
925
+ scope: "source.css variable.parameter.url",
926
+ settings: {
927
+ foreground: "#88DCB7",
928
+ fontStyle: ""
929
+ }
930
+ },
931
+ {
932
+ scope: ["support.type.vendored.property-name"],
933
+ settings: {
934
+ foreground: "#9DAFFA"
935
+ }
936
+ },
937
+ {
938
+ scope: [
939
+ "source.css meta.property-value variable",
940
+ "source.css meta.property-value variable.other.less",
941
+ "source.css meta.property-value variable.other.less punctuation.definition.variable.less",
942
+ "meta.definition.variable.scss"
943
+ ],
944
+ settings: {
945
+ foreground: "#F39EAE"
946
+ }
947
+ },
948
+ {
949
+ scope: [
950
+ "source.css meta.property-list variable",
951
+ "meta.property-list variable.other.less",
952
+ "meta.property-list variable.other.less punctuation.definition.variable.less"
953
+ ],
954
+ settings: {
955
+ foreground: "#9DAFFA"
956
+ }
957
+ },
958
+ {
959
+ scope: "keyword.other.unit.percentage.css",
960
+ settings: {
961
+ foreground: "#EDD5A6"
962
+ }
963
+ },
964
+ {
965
+ scope: "source.css meta.attribute-selector",
966
+ settings: {
967
+ foreground: "#88DCB7"
968
+ }
969
+ },
970
+ {
971
+ scope: [
972
+ "keyword.other.definition.ini",
973
+ "punctuation.support.type.property-name.json",
974
+ "support.type.property-name.json",
975
+ "punctuation.support.type.property-name.toml",
976
+ "support.type.property-name.toml",
977
+ "entity.name.tag.yaml",
978
+ "punctuation.support.type.property-name.yaml",
979
+ "support.type.property-name.yaml"
980
+ ],
981
+ settings: {
982
+ foreground: "#9DAFFA",
983
+ fontStyle: ""
984
+ }
985
+ },
986
+ {
987
+ scope: ["constant.language.json", "constant.language.yaml"],
988
+ settings: {
989
+ foreground: "#EDD5A6"
990
+ }
991
+ },
992
+ {
993
+ scope: ["entity.name.type.anchor.yaml", "variable.other.alias.yaml"],
994
+ settings: {
995
+ foreground: "#EDD5A6",
996
+ fontStyle: ""
997
+ }
998
+ },
999
+ {
1000
+ scope: ["support.type.property-name.table", "entity.name.section.group-title.ini"],
1001
+ settings: {
1002
+ foreground: "#EDD5A6"
1003
+ }
1004
+ },
1005
+ {
1006
+ scope: "constant.other.time.datetime.offset.toml",
1007
+ settings: {
1008
+ foreground: "#EFB7C2"
1009
+ }
1010
+ },
1011
+ {
1012
+ scope: ["punctuation.definition.anchor.yaml", "punctuation.definition.alias.yaml"],
1013
+ settings: {
1014
+ foreground: "#EFB7C2"
1015
+ }
1016
+ },
1017
+ {
1018
+ scope: "entity.other.document.begin.yaml",
1019
+ settings: {
1020
+ foreground: "#EFB7C2"
1021
+ }
1022
+ },
1023
+ {
1024
+ scope: "markup.changed.diff",
1025
+ settings: {
1026
+ foreground: "#EDD5A6"
1027
+ }
1028
+ },
1029
+ {
1030
+ scope: [
1031
+ "meta.diff.header.from-file",
1032
+ "meta.diff.header.to-file",
1033
+ "punctuation.definition.from-file.diff",
1034
+ "punctuation.definition.to-file.diff"
1035
+ ],
1036
+ settings: {
1037
+ foreground: "#9DAFFA"
1038
+ }
1039
+ },
1040
+ {
1041
+ scope: "markup.inserted.diff",
1042
+ settings: {
1043
+ foreground: "#88DCB7"
1044
+ }
1045
+ },
1046
+ {
1047
+ scope: "markup.deleted.diff",
1048
+ settings: {
1049
+ foreground: "#F7869B"
1050
+ }
1051
+ },
1052
+ {
1053
+ scope: ["variable.other.env"],
1054
+ settings: {
1055
+ foreground: "#9DAFFA"
1056
+ }
1057
+ },
1058
+ {
1059
+ scope: ["string.quoted variable.other.env"],
1060
+ settings: {
1061
+ foreground: "#E7E7E8"
1062
+ }
1063
+ },
1064
+ {
1065
+ scope: "support.function.builtin.gdscript",
1066
+ settings: {
1067
+ foreground: "#9DAFFA"
1068
+ }
1069
+ },
1070
+ {
1071
+ scope: "constant.language.gdscript",
1072
+ settings: {
1073
+ foreground: "#EDD5A6"
1074
+ }
1075
+ },
1076
+ {
1077
+ scope: "comment meta.annotation.go",
1078
+ settings: {
1079
+ foreground: "#F39EAE"
1080
+ }
1081
+ },
1082
+ {
1083
+ scope: "comment meta.annotation.parameters.go",
1084
+ settings: {
1085
+ foreground: "#EDD5A6"
1086
+ }
1087
+ },
1088
+ {
1089
+ scope: "constant.language.go",
1090
+ settings: {
1091
+ foreground: "#EDD5A6"
1092
+ }
1093
+ },
1094
+ {
1095
+ scope: "variable.graphql",
1096
+ settings: {
1097
+ foreground: "#E7E7E8"
1098
+ }
1099
+ },
1100
+ {
1101
+ scope: "string.unquoted.alias.graphql",
1102
+ settings: {
1103
+ foreground: "#F2CDCD"
1104
+ }
1105
+ },
1106
+ {
1107
+ scope: "constant.character.enum.graphql",
1108
+ settings: {
1109
+ foreground: "#A7E0C8"
1110
+ }
1111
+ },
1112
+ {
1113
+ scope: "meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql",
1114
+ settings: {
1115
+ foreground: "#F2CDCD"
1116
+ }
1117
+ },
1118
+ {
1119
+ scope: [
1120
+ "keyword.other.doctype",
1121
+ "meta.tag.sgml.doctype punctuation.definition.tag",
1122
+ "meta.tag.metadata.doctype entity.name.tag",
1123
+ "meta.tag.metadata.doctype punctuation.definition.tag"
1124
+ ],
1125
+ settings: {
1126
+ foreground: "#C6A5EA"
1127
+ }
1128
+ },
1129
+ {
1130
+ scope: ["entity.name.tag"],
1131
+ settings: {
1132
+ foreground: "#9DAFFA",
1133
+ fontStyle: ""
1134
+ }
1135
+ },
1136
+ {
1137
+ scope: [
1138
+ "text.html constant.character.entity",
1139
+ "text.html constant.character.entity punctuation",
1140
+ "constant.character.entity.xml",
1141
+ "constant.character.entity.xml punctuation",
1142
+ "constant.character.entity.js.jsx",
1143
+ "constant.charactger.entity.js.jsx punctuation",
1144
+ "constant.character.entity.tsx",
1145
+ "constant.character.entity.tsx punctuation"
1146
+ ],
1147
+ settings: {
1148
+ foreground: "#F7869B"
1149
+ }
1150
+ },
1151
+ {
1152
+ scope: ["entity.other.attribute-name"],
1153
+ settings: {
1154
+ foreground: "#EDD5A6"
1155
+ }
1156
+ },
1157
+ {
1158
+ scope: [
1159
+ "support.class.component",
1160
+ "support.class.component.jsx",
1161
+ "support.class.component.tsx",
1162
+ "support.class.component.vue"
1163
+ ],
1164
+ settings: {
1165
+ foreground: "#EFB7C2",
1166
+ fontStyle: ""
1167
+ }
1168
+ },
1169
+ {
1170
+ scope: ["punctuation.definition.annotation", "storage.type.annotation"],
1171
+ settings: {
1172
+ foreground: "#EDD5A6"
1173
+ }
1174
+ },
1175
+ {
1176
+ scope: "constant.other.enum.java",
1177
+ settings: {
1178
+ foreground: "#A7E0C8"
1179
+ }
1180
+ },
1181
+ {
1182
+ scope: "storage.modifier.import.java",
1183
+ settings: {
1184
+ foreground: "#E7E7E8"
1185
+ }
1186
+ },
1187
+ {
1188
+ scope: "comment.block.javadoc.java keyword.other.documentation.javadoc.java",
1189
+ settings: {
1190
+ fontStyle: ""
1191
+ }
1192
+ },
1193
+ {
1194
+ scope: "meta.export variable.other.readwrite.js",
1195
+ settings: {
1196
+ foreground: "#F39EAE"
1197
+ }
1198
+ },
1199
+ {
1200
+ scope: [
1201
+ "variable.other.constant.js",
1202
+ "variable.other.constant.ts",
1203
+ "variable.other.property.js",
1204
+ "variable.other.property.ts"
1205
+ ],
1206
+ settings: {
1207
+ foreground: "#E7E7E8"
1208
+ }
1209
+ },
1210
+ {
1211
+ scope: ["variable.other.jsdoc", "comment.block.documentation variable.other"],
1212
+ settings: {
1213
+ foreground: "#F39EAE",
1214
+ fontStyle: ""
1215
+ }
1216
+ },
1217
+ {
1218
+ scope: "storage.type.class.jsdoc",
1219
+ settings: {
1220
+ fontStyle: ""
1221
+ }
1222
+ },
1223
+ {
1224
+ scope: "support.type.object.console.js",
1225
+ settings: {
1226
+ foreground: "#E7E7E8"
1227
+ }
1228
+ },
1229
+ {
1230
+ scope: ["support.constant.node", "support.type.object.module.js"],
1231
+ settings: {
1232
+ foreground: "#C6A5EA"
1233
+ }
1234
+ },
1235
+ {
1236
+ scope: "storage.modifier.implements",
1237
+ settings: {
1238
+ foreground: "#C6A5EA"
1239
+ }
1240
+ },
1241
+ {
1242
+ scope: [
1243
+ "constant.language.null.js",
1244
+ "constant.language.null.ts",
1245
+ "constant.language.undefined.js",
1246
+ "constant.language.undefined.ts",
1247
+ "support.type.builtin.ts"
1248
+ ],
1249
+ settings: {
1250
+ foreground: "#C6A5EA"
1251
+ }
1252
+ },
1253
+ {
1254
+ scope: "variable.parameter.generic",
1255
+ settings: {
1256
+ foreground: "#EDD5A6"
1257
+ }
1258
+ },
1259
+ {
1260
+ scope: ["keyword.declaration.function.arrow.js", "storage.type.function.arrow.ts"],
1261
+ settings: {
1262
+ foreground: "#A7E0C8"
1263
+ }
1264
+ },
1265
+ {
1266
+ scope: "punctuation.decorator.ts",
1267
+ settings: {
1268
+ foreground: "#9DAFFA"
1269
+ }
1270
+ },
1271
+ {
1272
+ scope: [
1273
+ "keyword.operator.expression.in.js",
1274
+ "keyword.operator.expression.in.ts",
1275
+ "keyword.operator.expression.infer.ts",
1276
+ "keyword.operator.expression.instanceof.js",
1277
+ "keyword.operator.expression.instanceof.ts",
1278
+ "keyword.operator.expression.is",
1279
+ "keyword.operator.expression.keyof.ts",
1280
+ "keyword.operator.expression.of.js",
1281
+ "keyword.operator.expression.of.ts",
1282
+ "keyword.operator.expression.typeof.ts"
1283
+ ],
1284
+ settings: {
1285
+ foreground: "#C6A5EA"
1286
+ }
1287
+ },
1288
+ {
1289
+ scope: "support.function.macro.julia",
1290
+ settings: {
1291
+ foreground: "#A7E0C8"
1292
+ }
1293
+ },
1294
+ {
1295
+ scope: "constant.language.julia",
1296
+ settings: {
1297
+ foreground: "#EDD5A6"
1298
+ }
1299
+ },
1300
+ {
1301
+ scope: "constant.other.symbol.julia",
1302
+ settings: {
1303
+ foreground: "#F39EAE"
1304
+ }
1305
+ },
1306
+ {
1307
+ scope: "text.tex keyword.control.preamble",
1308
+ settings: {
1309
+ foreground: "#A7E0C8"
1310
+ }
1311
+ },
1312
+ {
1313
+ scope: "text.tex support.function.be",
1314
+ settings: {
1315
+ foreground: "#9DAFFA"
1316
+ }
1317
+ },
1318
+ {
1319
+ scope: "constant.other.general.math.tex",
1320
+ settings: {
1321
+ foreground: "#F2CDCD"
1322
+ }
1323
+ },
1324
+ {
1325
+ scope: "comment.line.double-dash.documentation.lua storage.type.annotation.lua",
1326
+ settings: {
1327
+ foreground: "#C6A5EA",
1328
+ fontStyle: ""
1329
+ }
1330
+ },
1331
+ {
1332
+ scope: [
1333
+ "comment.line.double-dash.documentation.lua entity.name.variable.lua",
1334
+ "comment.line.double-dash.documentation.lua variable.lua"
1335
+ ],
1336
+ settings: {
1337
+ foreground: "#E7E7E8"
1338
+ }
1339
+ },
1340
+ {
1341
+ scope: [
1342
+ "heading.1.markdown punctuation.definition.heading.markdown",
1343
+ "heading.1.markdown",
1344
+ "heading.1.quarto punctuation.definition.heading.quarto",
1345
+ "heading.1.quarto",
1346
+ "markup.heading.atx.1.mdx",
1347
+ "markup.heading.atx.1.mdx punctuation.definition.heading.mdx",
1348
+ "markup.heading.setext.1.markdown",
1349
+ "markup.heading.heading-0.asciidoc"
1350
+ ],
1351
+ settings: {
1352
+ foreground: "#F7869B"
1353
+ }
1354
+ },
1355
+ {
1356
+ scope: [
1357
+ "heading.2.markdown punctuation.definition.heading.markdown",
1358
+ "heading.2.markdown",
1359
+ "heading.2.quarto punctuation.definition.heading.quarto",
1360
+ "heading.2.quarto",
1361
+ "markup.heading.atx.2.mdx",
1362
+ "markup.heading.atx.2.mdx punctuation.definition.heading.mdx",
1363
+ "markup.heading.setext.2.markdown",
1364
+ "markup.heading.heading-1.asciidoc"
1365
+ ],
1366
+ settings: {
1367
+ foreground: "#EDD5A6"
1368
+ }
1369
+ },
1370
+ {
1371
+ scope: [
1372
+ "heading.3.markdown punctuation.definition.heading.markdown",
1373
+ "heading.3.markdown",
1374
+ "heading.3.quarto punctuation.definition.heading.quarto",
1375
+ "heading.3.quarto",
1376
+ "markup.heading.atx.3.mdx",
1377
+ "markup.heading.atx.3.mdx punctuation.definition.heading.mdx",
1378
+ "markup.heading.heading-2.asciidoc"
1379
+ ],
1380
+ settings: {
1381
+ foreground: "#EDD5A6"
1382
+ }
1383
+ },
1384
+ {
1385
+ scope: [
1386
+ "heading.4.markdown punctuation.definition.heading.markdown",
1387
+ "heading.4.markdown",
1388
+ "heading.4.quarto punctuation.definition.heading.quarto",
1389
+ "heading.4.quarto",
1390
+ "markup.heading.atx.4.mdx",
1391
+ "markup.heading.atx.4.mdx punctuation.definition.heading.mdx",
1392
+ "markup.heading.heading-3.asciidoc"
1393
+ ],
1394
+ settings: {
1395
+ foreground: "#88DCB7"
1396
+ }
1397
+ },
1398
+ {
1399
+ scope: [
1400
+ "heading.5.markdown punctuation.definition.heading.markdown",
1401
+ "heading.5.markdown",
1402
+ "heading.5.quarto punctuation.definition.heading.quarto",
1403
+ "heading.5.quarto",
1404
+ "markup.heading.atx.5.mdx",
1405
+ "markup.heading.atx.5.mdx punctuation.definition.heading.mdx",
1406
+ "markup.heading.heading-4.asciidoc"
1407
+ ],
1408
+ settings: {
1409
+ foreground: "#9DAFFA"
1410
+ }
1411
+ },
1412
+ {
1413
+ scope: [
1414
+ "heading.6.markdown punctuation.definition.heading.markdown",
1415
+ "heading.6.markdown",
1416
+ "heading.6.quarto punctuation.definition.heading.quarto",
1417
+ "heading.6.quarto",
1418
+ "markup.heading.atx.6.mdx",
1419
+ "markup.heading.atx.6.mdx punctuation.definition.heading.mdx",
1420
+ "markup.heading.heading-5.asciidoc"
1421
+ ],
1422
+ settings: {
1423
+ foreground: "#C6A5EA"
1424
+ }
1425
+ },
1426
+ {
1427
+ scope: "markup.bold",
1428
+ settings: {
1429
+ foreground: "#F7869B",
1430
+ fontStyle: "bold"
1431
+ }
1432
+ },
1433
+ {
1434
+ scope: "markup.italic",
1435
+ settings: {
1436
+ foreground: "#F7869B"
1437
+ }
1438
+ },
1439
+ {
1440
+ scope: "markup.strikethrough",
1441
+ settings: {
1442
+ foreground: "#A6ADC8",
1443
+ fontStyle: "strikethrough"
1444
+ }
1445
+ },
1446
+ {
1447
+ scope: ["punctuation.definition.link", "markup.underline.link"],
1448
+ settings: {
1449
+ foreground: "#9DAFFA"
1450
+ }
1451
+ },
1452
+ {
1453
+ scope: [
1454
+ "text.html.markdown punctuation.definition.link.title",
1455
+ "text.html.quarto punctuation.definition.link.title",
1456
+ "string.other.link.title.markdown",
1457
+ "string.other.link.title.quarto",
1458
+ "markup.link",
1459
+ "punctuation.definition.constant.markdown",
1460
+ "punctuation.definition.constant.quarto",
1461
+ "constant.other.reference.link.markdown",
1462
+ "constant.other.reference.link.quarto",
1463
+ "markup.substitution.attribute-reference"
1464
+ ],
1465
+ settings: {
1466
+ foreground: "#B4BEFE"
1467
+ }
1468
+ },
1469
+ {
1470
+ scope: [
1471
+ "punctuation.definition.raw.markdown",
1472
+ "punctuation.definition.raw.quarto",
1473
+ "markup.inline.raw.string.markdown",
1474
+ "markup.inline.raw.string.quarto",
1475
+ "markup.raw.block.markdown",
1476
+ "markup.raw.block.quarto"
1477
+ ],
1478
+ settings: {
1479
+ foreground: "#88DCB7"
1480
+ }
1481
+ },
1482
+ {
1483
+ scope: "fenced_code.block.language",
1484
+ settings: {
1485
+ foreground: "#9DAFFA"
1486
+ }
1487
+ },
1488
+ {
1489
+ scope: [
1490
+ "markup.fenced_code.block punctuation.definition",
1491
+ "markup.raw support.asciidoc"
1492
+ ],
1493
+ settings: {
1494
+ foreground: "#A1A4A5"
1495
+ }
1496
+ },
1497
+ {
1498
+ scope: ["markup.quote", "punctuation.definition.quote.begin"],
1499
+ settings: {
1500
+ foreground: "#EFB7C2"
1501
+ }
1502
+ },
1503
+ {
1504
+ scope: "meta.separator.markdown",
1505
+ settings: {
1506
+ foreground: "#A7E0C8"
1507
+ }
1508
+ },
1509
+ {
1510
+ scope: [
1511
+ "punctuation.definition.list.begin.markdown",
1512
+ "punctuation.definition.list.begin.quarto",
1513
+ "markup.list.bullet"
1514
+ ],
1515
+ settings: {
1516
+ foreground: "#A7E0C8"
1517
+ }
1518
+ },
1519
+ {
1520
+ scope: "markup.heading.quarto",
1521
+ settings: {
1522
+ fontStyle: "bold"
1523
+ }
1524
+ },
1525
+ {
1526
+ scope: [
1527
+ "entity.other.attribute-name.multipart.nix",
1528
+ "entity.other.attribute-name.single.nix"
1529
+ ],
1530
+ settings: {
1531
+ foreground: "#9DAFFA"
1532
+ }
1533
+ },
1534
+ {
1535
+ scope: "variable.parameter.name.nix",
1536
+ settings: {
1537
+ foreground: "#E7E7E8",
1538
+ fontStyle: ""
1539
+ }
1540
+ },
1541
+ {
1542
+ scope: "meta.embedded variable.parameter.name.nix",
1543
+ settings: {
1544
+ foreground: "#B4BEFE",
1545
+ fontStyle: ""
1546
+ }
1547
+ },
1548
+ {
1549
+ scope: "string.unquoted.path.nix",
1550
+ settings: {
1551
+ foreground: "#EFB7C2",
1552
+ fontStyle: ""
1553
+ }
1554
+ },
1555
+ {
1556
+ scope: ["support.attribute.builtin", "meta.attribute.php"],
1557
+ settings: {
1558
+ foreground: "#EDD5A6"
1559
+ }
1560
+ },
1561
+ {
1562
+ scope: "meta.function.parameters.php punctuation.definition.variable.php",
1563
+ settings: {
1564
+ foreground: "#F39EAE"
1565
+ }
1566
+ },
1567
+ {
1568
+ scope: "constant.language.php",
1569
+ settings: {
1570
+ foreground: "#C6A5EA"
1571
+ }
1572
+ },
1573
+ {
1574
+ scope: "text.html.php support.function",
1575
+ settings: {
1576
+ foreground: "#9DAFFA"
1577
+ }
1578
+ },
1579
+ {
1580
+ scope: "keyword.other.phpdoc.php",
1581
+ settings: {
1582
+ fontStyle: ""
1583
+ }
1584
+ },
1585
+ {
1586
+ scope: ["support.variable.magic.python", "meta.function-call.arguments.python"],
1587
+ settings: {
1588
+ foreground: "#E7E7E8"
1589
+ }
1590
+ },
1591
+ {
1592
+ scope: ["support.function.magic.python"],
1593
+ settings: {
1594
+ foreground: "#9DAFFA"
1595
+ }
1596
+ },
1597
+ {
1598
+ scope: [
1599
+ "variable.parameter.function.language.special.self.python",
1600
+ "variable.language.special.self.python"
1601
+ ],
1602
+ settings: {
1603
+ foreground: "#F7869B"
1604
+ }
1605
+ },
1606
+ {
1607
+ scope: ["keyword.control.flow.python", "keyword.operator.logical.python"],
1608
+ settings: {
1609
+ foreground: "#C6A5EA"
1610
+ }
1611
+ },
1612
+ {
1613
+ scope: "storage.type.function.python",
1614
+ settings: {
1615
+ foreground: "#C6A5EA"
1616
+ }
1617
+ },
1618
+ {
1619
+ scope: [
1620
+ "support.token.decorator.python",
1621
+ "meta.function.decorator.identifier.python"
1622
+ ],
1623
+ settings: {
1624
+ foreground: "#9DAFFA"
1625
+ }
1626
+ },
1627
+ {
1628
+ scope: ["meta.function-call.python"],
1629
+ settings: {
1630
+ foreground: "#9DAFFA"
1631
+ }
1632
+ },
1633
+ {
1634
+ scope: [
1635
+ "entity.name.function.decorator.python",
1636
+ "punctuation.definition.decorator.python"
1637
+ ],
1638
+ settings: {
1639
+ foreground: "#EDD5A6"
1640
+ }
1641
+ },
1642
+ {
1643
+ scope: "constant.character.format.placeholder.other.python",
1644
+ settings: {
1645
+ foreground: "#EFB7C2"
1646
+ }
1647
+ },
1648
+ {
1649
+ scope: ["support.type.exception.python", "support.function.builtin.python"],
1650
+ settings: {
1651
+ foreground: "#EDD5A6"
1652
+ }
1653
+ },
1654
+ {
1655
+ scope: ["support.type.python"],
1656
+ settings: {
1657
+ foreground: "#EDD5A6"
1658
+ }
1659
+ },
1660
+ {
1661
+ scope: "constant.language.python",
1662
+ settings: {
1663
+ foreground: "#C6A5EA"
1664
+ }
1665
+ },
1666
+ {
1667
+ scope: ["meta.indexed-name.python", "meta.item-access.python"],
1668
+ settings: {
1669
+ foreground: "#F39EAE"
1670
+ }
1671
+ },
1672
+ {
1673
+ scope: "storage.type.string.python",
1674
+ settings: {
1675
+ foreground: "#88DCB7"
1676
+ }
1677
+ },
1678
+ {
1679
+ scope: "meta.function.parameters.python",
1680
+ settings: {
1681
+ fontStyle: ""
1682
+ }
1683
+ },
1684
+ {
1685
+ scope: [
1686
+ "string.regexp punctuation.definition.string.begin",
1687
+ "string.regexp punctuation.definition.string.end"
1688
+ ],
1689
+ settings: {
1690
+ foreground: "#EFB7C2"
1691
+ }
1692
+ },
1693
+ {
1694
+ scope: "keyword.control.anchor.regexp",
1695
+ settings: {
1696
+ foreground: "#C6A5EA"
1697
+ }
1698
+ },
1699
+ {
1700
+ scope: "string.regexp.ts",
1701
+ settings: {
1702
+ foreground: "#E7E7E8"
1703
+ }
1704
+ },
1705
+ {
1706
+ scope: [
1707
+ "punctuation.definition.group.regexp",
1708
+ "keyword.other.back-reference.regexp"
1709
+ ],
1710
+ settings: {
1711
+ foreground: "#88DCB7"
1712
+ }
1713
+ },
1714
+ {
1715
+ scope: "punctuation.definition.character-class.regexp",
1716
+ settings: {
1717
+ foreground: "#EDD5A6"
1718
+ }
1719
+ },
1720
+ {
1721
+ scope: "constant.other.character-class.regexp",
1722
+ settings: {
1723
+ foreground: "#EFB7C2"
1724
+ }
1725
+ },
1726
+ {
1727
+ scope: "constant.other.character-class.range.regexp",
1728
+ settings: {
1729
+ foreground: "#F5E0DC"
1730
+ }
1731
+ },
1732
+ {
1733
+ scope: "keyword.operator.quantifier.regexp",
1734
+ settings: {
1735
+ foreground: "#A7E0C8"
1736
+ }
1737
+ },
1738
+ {
1739
+ scope: "constant.character.numeric.regexp",
1740
+ settings: {
1741
+ foreground: "#EDD5A6"
1742
+ }
1743
+ },
1744
+ {
1745
+ scope: [
1746
+ "punctuation.definition.group.no-capture.regexp",
1747
+ "meta.assertion.look-ahead.regexp",
1748
+ "meta.assertion.negative-look-ahead.regexp"
1749
+ ],
1750
+ settings: {
1751
+ foreground: "#9DAFFA"
1752
+ }
1753
+ },
1754
+ {
1755
+ scope: [
1756
+ "meta.annotation.rust",
1757
+ "meta.annotation.rust punctuation",
1758
+ "meta.attribute.rust",
1759
+ "punctuation.definition.attribute.rust"
1760
+ ],
1761
+ settings: {
1762
+ foreground: "#EDD5A6"
1763
+ }
1764
+ },
1765
+ {
1766
+ scope: [
1767
+ "meta.attribute.rust string.quoted.double.rust",
1768
+ "meta.attribute.rust string.quoted.single.char.rust"
1769
+ ],
1770
+ settings: {
1771
+ fontStyle: ""
1772
+ }
1773
+ },
1774
+ {
1775
+ scope: [
1776
+ "entity.name.function.macro.rules.rust",
1777
+ "storage.type.module.rust",
1778
+ "storage.modifier.rust",
1779
+ "storage.type.struct.rust",
1780
+ "storage.type.enum.rust",
1781
+ "storage.type.trait.rust",
1782
+ "storage.type.union.rust",
1783
+ "storage.type.impl.rust",
1784
+ "storage.type.rust",
1785
+ "storage.type.function.rust",
1786
+ "storage.type.type.rust"
1787
+ ],
1788
+ settings: {
1789
+ foreground: "#C6A5EA",
1790
+ fontStyle: ""
1791
+ }
1792
+ },
1793
+ {
1794
+ scope: "entity.name.type.numeric.rust",
1795
+ settings: {
1796
+ foreground: "#C6A5EA",
1797
+ fontStyle: ""
1798
+ }
1799
+ },
1800
+ {
1801
+ scope: "meta.generic.rust",
1802
+ settings: {
1803
+ foreground: "#EDD5A6"
1804
+ }
1805
+ },
1806
+ {
1807
+ scope: "entity.name.impl.rust",
1808
+ settings: {
1809
+ foreground: "#EDD5A6"
1810
+ }
1811
+ },
1812
+ {
1813
+ scope: "entity.name.module.rust",
1814
+ settings: {
1815
+ foreground: "#EDD5A6"
1816
+ }
1817
+ },
1818
+ {
1819
+ scope: "entity.name.trait.rust",
1820
+ settings: {
1821
+ foreground: "#EDD5A6"
1822
+ }
1823
+ },
1824
+ {
1825
+ scope: "storage.type.source.rust",
1826
+ settings: {
1827
+ foreground: "#EDD5A6"
1828
+ }
1829
+ },
1830
+ {
1831
+ scope: "entity.name.union.rust",
1832
+ settings: {
1833
+ foreground: "#EDD5A6"
1834
+ }
1835
+ },
1836
+ {
1837
+ scope: "meta.enum.rust storage.type.source.rust",
1838
+ settings: {
1839
+ foreground: "#A7E0C8"
1840
+ }
1841
+ },
1842
+ {
1843
+ scope: [
1844
+ "support.macro.rust",
1845
+ "meta.macro.rust support.function.rust",
1846
+ "entity.name.function.macro.rust"
1847
+ ],
1848
+ settings: {
1849
+ foreground: "#9DAFFA"
1850
+ }
1851
+ },
1852
+ {
1853
+ scope: ["storage.modifier.lifetime.rust", "entity.name.type.lifetime"],
1854
+ settings: {
1855
+ foreground: "#9DAFFA"
1856
+ }
1857
+ },
1858
+ {
1859
+ scope: "string.quoted.double.rust constant.other.placeholder.rust",
1860
+ settings: {
1861
+ foreground: "#EFB7C2"
1862
+ }
1863
+ },
1864
+ {
1865
+ scope: "meta.function.return-type.rust meta.generic.rust storage.type.rust",
1866
+ settings: {
1867
+ foreground: "#E7E7E8"
1868
+ }
1869
+ },
1870
+ {
1871
+ scope: "meta.function.call.rust",
1872
+ settings: {
1873
+ foreground: "#9DAFFA"
1874
+ }
1875
+ },
1876
+ {
1877
+ scope: "punctuation.brackets.angle.rust",
1878
+ settings: {
1879
+ foreground: "#9DAFFA"
1880
+ }
1881
+ },
1882
+ {
1883
+ scope: "constant.other.caps.rust",
1884
+ settings: {
1885
+ foreground: "#EDD5A6"
1886
+ }
1887
+ },
1888
+ {
1889
+ scope: ["meta.function.definition.rust variable.other.rust"],
1890
+ settings: {
1891
+ foreground: "#F39EAE"
1892
+ }
1893
+ },
1894
+ {
1895
+ scope: "meta.function.call.rust variable.other.rust",
1896
+ settings: {
1897
+ foreground: "#E7E7E8"
1898
+ }
1899
+ },
1900
+ {
1901
+ scope: "variable.language.self.rust",
1902
+ settings: {
1903
+ foreground: "#F7869B"
1904
+ }
1905
+ },
1906
+ {
1907
+ scope: [
1908
+ "variable.other.metavariable.name.rust",
1909
+ "meta.macro.metavariable.rust keyword.operator.macro.dollar.rust"
1910
+ ],
1911
+ settings: {
1912
+ foreground: "#EFB7C2"
1913
+ }
1914
+ },
1915
+ {
1916
+ scope: [
1917
+ "comment.line.shebang",
1918
+ "comment.line.shebang punctuation.definition.comment",
1919
+ "comment.line.shebang",
1920
+ "punctuation.definition.comment.shebang.shell",
1921
+ "meta.shebang.shell"
1922
+ ],
1923
+ settings: {
1924
+ foreground: "#EFB7C2"
1925
+ }
1926
+ },
1927
+ {
1928
+ scope: "comment.line.shebang constant.language",
1929
+ settings: {
1930
+ foreground: "#A7E0C8"
1931
+ }
1932
+ },
1933
+ {
1934
+ scope: [
1935
+ "meta.function-call.arguments.shell punctuation.definition.variable.shell",
1936
+ "meta.function-call.arguments.shell punctuation.section.interpolation",
1937
+ "meta.function-call.arguments.shell punctuation.definition.variable.shell",
1938
+ "meta.function-call.arguments.shell punctuation.section.interpolation"
1939
+ ],
1940
+ settings: {
1941
+ foreground: "#F7869B"
1942
+ }
1943
+ },
1944
+ {
1945
+ scope: "meta.string meta.interpolation.parameter.shell variable.other.readwrite",
1946
+ settings: {
1947
+ foreground: "#EDD5A6"
1948
+ }
1949
+ },
1950
+ {
1951
+ scope: [
1952
+ "source.shell punctuation.section.interpolation",
1953
+ "punctuation.definition.evaluation.backticks.shell"
1954
+ ],
1955
+ settings: {
1956
+ foreground: "#A7E0C8"
1957
+ }
1958
+ },
1959
+ {
1960
+ scope: "entity.name.tag.heredoc.shell",
1961
+ settings: {
1962
+ foreground: "#C6A5EA"
1963
+ }
1964
+ },
1965
+ {
1966
+ scope: "string.quoted.double.shell variable.other.normal.shell",
1967
+ settings: {
1968
+ foreground: "#E7E7E8"
1969
+ }
1970
+ },
1971
+ {
1972
+ scope: "token.info-token",
1973
+ settings: {
1974
+ foreground: "#8BA1FF"
1975
+ }
1976
+ },
1977
+ {
1978
+ scope: "token.warn-token",
1979
+ settings: {
1980
+ foreground: "#F5B944"
1981
+ }
1982
+ },
1983
+ {
1984
+ scope: "token.error-token",
1985
+ settings: {
1986
+ foreground: "#FB6E88"
1987
+ }
1988
+ },
1989
+ {
1990
+ scope: "token.debug-token",
1991
+ settings: {
1992
+ foreground: "#BE95EB"
1993
+ }
1994
+ }
1995
+ ]
1996
+ };
1997
+
1998
+ // components/src/asciidoc/util.ts
1999
+ var highlighter = null;
2000
+ var customLanguages = ["oxql"];
2001
+ var supportedLanguages = [...Object.keys(bundledLanguages), ...customLanguages];
2002
+ async function getOrCreateHighlighter() {
2003
+ if (!highlighter) {
2004
+ const langs = [];
2005
+ langs.push({
2006
+ ...oxql_tmLanguage_default
2007
+ });
2008
+ highlighter = await createHighlighter({
2009
+ themes: [oxide_dark_default],
2010
+ langs
2011
+ });
2012
+ }
2013
+ return highlighter;
2014
+ }
2015
+ var highlight = async (block) => {
2016
+ if (block.type === "listing") {
2017
+ const literalBlock = block;
2018
+ if (!literalBlock.content) {
2019
+ return block;
2020
+ }
2021
+ const calloutRegex = /<i class="conum" data-value="\d+"><\/i>/g;
2022
+ const callouts = [];
2023
+ const placeholderContent = literalBlock.content.replace(calloutRegex, (match) => {
2024
+ callouts.push(match);
2025
+ return `__CALLOUT_PLACEHOLDER_${callouts.length - 1}__`;
2026
+ });
2027
+ if (!literalBlock.language) {
2028
+ return {
2029
+ ...block,
2030
+ content: placeholderContent.replace(
2031
+ /__CALLOUT_PLACEHOLDER_(\d+)__/g,
2032
+ (_, index) => callouts[parseInt(index)]
2033
+ )
2034
+ };
2035
+ }
2036
+ let lang = literalBlock.language;
2037
+ const h = await getOrCreateHighlighter();
2038
+ const loadedLanguages = h.getLoadedLanguages();
2039
+ if (!supportedLanguages.includes(lang)) {
2040
+ lang = "text";
2041
+ }
2042
+ if (!loadedLanguages.includes(lang)) {
2043
+ await h.loadLanguage(lang);
2044
+ }
2045
+ const highlightedContent = h.codeToHtml(placeholderContent, {
2046
+ lang,
2047
+ theme: oxide_dark_default,
2048
+ structure: "inline"
2049
+ });
2050
+ const restoredContent = highlightedContent.replace(
2051
+ /__CALLOUT_PLACEHOLDER_(\d+)__/g,
2052
+ (_, index) => callouts[parseInt(index)]
2053
+ );
2054
+ return {
2055
+ ...block,
2056
+ content: restoredContent
2057
+ };
2058
+ }
2059
+ return block;
2060
+ };
2061
+ var attrs = {
2062
+ sectlinks: "true",
2063
+ stem: "latexmath",
2064
+ stylesheet: false
2065
+ };
2066
+ var loadAsciidoctor = ({
2067
+ extensions = []
2068
+ }) => {
2069
+ const ad2 = asciidoctor();
2070
+ class InlineConverter2 {
2071
+ baseConverter;
2072
+ constructor() {
2073
+ this.baseConverter = new ad2.Html5Converter();
2074
+ }
2075
+ convert(node, transform) {
2076
+ switch (node.getNodeName()) {
2077
+ case "inline_callout":
2078
+ return convertInlineCallout(node);
2079
+ // We know this is always inline
2080
+ default:
2081
+ break;
2082
+ }
2083
+ return this.baseConverter.convert(node, transform);
2084
+ }
2085
+ }
2086
+ extensions.forEach((extension) => ad2.Extensions.register(extension));
2087
+ ad2.ConverterFactory.register(new InlineConverter2(), ["html5"]);
2088
+ return ad2;
2089
+ };
2090
+ function convertInlineCallout(node) {
2091
+ return `<i class="conum" data-value="${node.getText()}"></i>`;
2092
+ }
2093
+ var handleDocument = async (document) => {
2094
+ const doc = prepareDocument(document);
2095
+ return await processDocument(doc, highlight);
2096
+ };
2097
+
2098
+ // components/src/asciidoc/index.tsx
2099
+ import { jsx as jsx9 } from "react/jsx-runtime";
2100
+ var MinimalDocument = ({ document }) => /* @__PURE__ */ jsx9("div", { id: "content", className: "asciidoc-body w-full", children: /* @__PURE__ */ jsx9(Content4, { blocks: document.blocks }) });
2101
+ var AsciiDocBlocks = {
2102
+ Admonition: Admonition_default,
2103
+ Table: Table_default,
2104
+ Section: Section_default,
2105
+ MinimalDocument
2106
+ };
2107
+ var renderWithBreaks = (text) => {
2108
+ return text.split(/(<[^>]*>)/g).map((segment) => {
2109
+ if (segment.startsWith("<") && segment.endsWith(">")) {
2110
+ return segment;
2111
+ }
2112
+ return segment.replace(/(?:^|(?<=\S))\/(?=\S)/g, "/<wbr/>");
2113
+ }).join("");
2114
+ };
2115
+ var QUOTE_TAGS = {
2116
+ "monospaced": ["<code>", "</code>", true],
2117
+ "emphasis": ["<em>", "</em>", true],
2118
+ "strong": ["<strong>", "</strong>", true],
2119
+ "double": ["&#8220;", "&#8221;"],
2120
+ "single": ["&#8216;", "&#8217;"],
2121
+ "mark": ["<mark>", "</mark>", true],
2122
+ "superscript": ["<sup>", "</sup>", true],
2123
+ "subscript": ["<sub>", "</sub>", true],
2124
+ "unquoted": ["<span>", "</span>", true],
2125
+ "asciimath": ["\\$", "\\$"],
2126
+ "latexmath": ["\\(", "\\)"]
2127
+ };
2128
+ var chop = (str) => str.substring(0, str.length - 1);
2129
+ var convertInlineQuoted = (node) => {
2130
+ const type = node.getType();
2131
+ const quoteTag = QUOTE_TAGS[type];
2132
+ const [open, close, tag] = quoteTag || ["", ""];
2133
+ let text = node.getText();
2134
+ if (type === "monospaced") {
2135
+ text = renderWithBreaks(text);
2136
+ }
2137
+ const id = node.getId();
2138
+ const role = node.getRole();
2139
+ const idAttr = id ? `id="${id}"` : "";
2140
+ const classAttr = role ? `class="${role}"` : "";
2141
+ const attrs2 = `${idAttr} ${classAttr}`;
2142
+ if (id || role) {
2143
+ if (tag) {
2144
+ return `${chop(open)} ${attrs2}>${text}${close}`;
2145
+ } else {
2146
+ return `<span ${attrs2}>${open}${text}${close}</span>`;
2147
+ }
2148
+ } else {
2149
+ return `${open}${text}${close}`;
2150
+ }
2151
+ };
2152
+ function convertInlineCallout2(node) {
2153
+ return `<i class="conum" data-value="${node.getText()}"></i>`;
2154
+ }
2155
+ var ad = asciidoctor2();
2156
+ var InlineConverter = class {
2157
+ baseConverter;
2158
+ constructor() {
2159
+ this.baseConverter = new ad.Html5Converter();
2160
+ }
2161
+ convert(node, transform) {
2162
+ switch (node.getNodeName()) {
2163
+ case "inline_quoted":
2164
+ return convertInlineQuoted(node);
2165
+ // We know this is always inline
2166
+ case "inline_callout":
2167
+ return convertInlineCallout2(node);
2168
+ // We know this is always inline
2169
+ default:
2170
+ break;
2171
+ }
2172
+ return this.baseConverter.convert(node, transform);
2173
+ }
2174
+ };
2175
+
2176
+ // components/src/ui/badge/Badge.tsx
2177
+ import cn4 from "classnames";
2178
+ import { jsx as jsx10 } from "react/jsx-runtime";
2179
+ var badgeColors = {
2180
+ default: {
2181
+ default: "bg-accent-secondary text-accent ring-accent/15",
2182
+ destructive: "bg-destructive-secondary text-destructive ring-destructive/15",
2183
+ notice: "bg-notice-secondary text-notice ring-notice/15",
2184
+ blue: "bg-blue-200 text-blue-800 ring-blue-800/15",
2185
+ purple: "bg-purple-200 text-purple-800 ring-purple-800/15",
2186
+ neutral: "bg-secondary text-default ring-neutral-700/15"
2187
+ },
2188
+ solid: {
2189
+ default: "bg-accent text-inverse",
2190
+ destructive: "bg-destructive text-inverse",
2191
+ notice: "bg-notice text-inverse",
2192
+ neutral: "bg-inverse-tertiary text-inverse",
2193
+ purple: "bg-purple-700 text-inverse",
2194
+ blue: "bg-info text-inverse"
2195
+ }
2196
+ };
2197
+ var Badge = ({
2198
+ className,
2199
+ children,
2200
+ color = "default",
2201
+ variant = "default"
2202
+ }) => {
2203
+ return /* @__PURE__ */ jsx10(
2204
+ "span",
2205
+ {
2206
+ className: cn4(
2207
+ "ox-badge ring ring-inset",
2208
+ `variant-${variant}`,
2209
+ "text-mono-sm inline-flex h-4 items-center whitespace-nowrap rounded-sm px-[3px] py-[1px] uppercase",
2210
+ badgeColors[variant][color],
2211
+ className
2212
+ ),
2213
+ children: /* @__PURE__ */ jsx10("span", { children })
2214
+ }
2215
+ );
2216
+ };
2217
+
2218
+ // components/src/ui/button/Button.tsx
2219
+ import cn5 from "classnames";
2220
+ import { forwardRef } from "react";
2221
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
2222
+ var buttonSizes = ["sm", "icon", "base"];
2223
+ var variants = ["primary", "secondary", "ghost", "danger"];
2224
+ var sizeStyle = {
2225
+ sm: "h-8 px-3 text-mono-sm svg:w-4",
2226
+ // meant for buttons that only contain a single icon
2227
+ icon: "h-8 w-8 text-mono-sm svg:w-4",
2228
+ base: "h-10 px-4 text-mono-sm svg:w-5"
2229
+ };
2230
+ var buttonStyle = ({
2231
+ size: size2 = "base",
2232
+ variant = "primary"
2233
+ } = {}) => {
2234
+ return cn5(
2235
+ "ox-button inline-flex items-center justify-center rounded align-top elevation-1 disabled:cursor-not-allowed",
2236
+ `btn-${variant}`,
2237
+ sizeStyle[size2],
2238
+ variant === "danger" ? "focus:outline-destructive-secondary" : "focus:outline-accent-secondary"
2239
+ );
2240
+ };
2241
+ var noop = (e) => {
2242
+ e.stopPropagation();
2243
+ e.preventDefault();
2244
+ };
2245
+ var Button = forwardRef(
2246
+ ({
2247
+ type = "button",
2248
+ children,
2249
+ size: size2,
2250
+ variant,
2251
+ className,
2252
+ loading,
2253
+ innerClassName,
2254
+ disabled,
2255
+ onClick,
2256
+ // needs to be a spread because we sometimes get passed arbitrary <button>
2257
+ // props by the parent
2258
+ ...rest
2259
+ }, ref) => {
2260
+ const isDisabled = disabled || loading;
2261
+ return /* @__PURE__ */ jsxs8(
2262
+ "button",
2263
+ {
2264
+ className: cn5(buttonStyle({ size: size2, variant }), className, {
2265
+ "visually-disabled": isDisabled
2266
+ }),
2267
+ ref,
2268
+ type,
2269
+ onMouseDown: isDisabled ? noop : void 0,
2270
+ onClick: isDisabled ? noop : onClick,
2271
+ "aria-disabled": isDisabled,
2272
+ ...rest,
2273
+ children: [
2274
+ loading && /* @__PURE__ */ jsx11(Spinner, { className: "absolute", variant }),
2275
+ /* @__PURE__ */ jsx11("span", { className: cn5("flex items-center", innerClassName, { invisible: loading }), children })
2276
+ ]
2277
+ }
2278
+ );
2279
+ }
2280
+ );
2281
+
2282
+ // components/src/ui/spinner/Spinner.tsx
2283
+ import cn6 from "classnames";
2284
+ import { useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
2285
+ import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
2286
+ var spinnerSizes = ["base", "lg"];
2287
+ var spinnerVariants = ["primary", "secondary", "ghost", "danger"];
2288
+ var Spinner = ({
2289
+ className,
2290
+ size: size2 = "base",
2291
+ variant = "primary"
2292
+ }) => {
2293
+ const frameSize = size2 === "lg" ? 36 : 12;
2294
+ const center = size2 === "lg" ? 18 : 6;
2295
+ const radius = size2 === "lg" ? 16 : 5;
2296
+ const strokeWidth = size2 === "lg" ? 3 : 2;
2297
+ return /* @__PURE__ */ jsxs9(
2298
+ "svg",
2299
+ {
2300
+ width: frameSize,
2301
+ height: frameSize,
2302
+ viewBox: `0 0 ${frameSize + " " + frameSize}`,
2303
+ fill: "none",
2304
+ xmlns: "http://www.w3.org/2000/svg",
2305
+ "aria-labelledby": "Spinner",
2306
+ className: cn6("spinner", `spinner-${variant}`, `spinner-${size2}`, className),
2307
+ children: [
2308
+ /* @__PURE__ */ jsx12(
2309
+ "circle",
2310
+ {
2311
+ fill: "none",
2312
+ className: "bg",
2313
+ strokeWidth,
2314
+ strokeLinecap: "round",
2315
+ cx: center,
2316
+ cy: center,
2317
+ r: radius,
2318
+ strokeOpacity: 0.2
2319
+ }
2320
+ ),
2321
+ /* @__PURE__ */ jsx12(
2322
+ "circle",
2323
+ {
2324
+ className: "path",
2325
+ fill: "none",
2326
+ stroke: "currentColor",
2327
+ strokeWidth,
2328
+ strokeLinecap: "round",
2329
+ cx: center,
2330
+ cy: center,
2331
+ r: radius
2332
+ }
2333
+ )
2334
+ ]
2335
+ }
2336
+ );
2337
+ };
2338
+ var SpinnerLoader = ({ isLoading, children = null, minTime = 500 }) => {
2339
+ const [isVisible, setIsVisible] = useState2(isLoading);
2340
+ const hideTimeout = useRef2(null);
2341
+ const loadingStartTime = useRef2(0);
2342
+ useEffect3(() => {
2343
+ if (isLoading) {
2344
+ setIsVisible(true);
2345
+ loadingStartTime.current = Date.now();
2346
+ } else {
2347
+ if (hideTimeout.current) clearTimeout(hideTimeout.current);
2348
+ const elapsedTime = Date.now() - loadingStartTime.current;
2349
+ const remainingTime = Math.max(0, minTime - elapsedTime);
2350
+ if (remainingTime === 0) {
2351
+ setIsVisible(false);
2352
+ } else {
2353
+ hideTimeout.current = setTimeout(() => setIsVisible(false), remainingTime);
2354
+ }
2355
+ }
2356
+ return () => {
2357
+ if (hideTimeout.current) clearTimeout(hideTimeout.current);
2358
+ };
2359
+ }, [isLoading, minTime]);
2360
+ return isVisible ? /* @__PURE__ */ jsx12(Spinner, {}) : /* @__PURE__ */ jsx12(Fragment3, { children });
2361
+ };
2362
+
2363
+ // components/src/ui/tabs/Tabs.tsx
2364
+ import { Content as Content5, List, Root as Root2, Trigger as Trigger2 } from "@radix-ui/react-tabs";
2365
+ import cn7 from "classnames";
2366
+ import { jsx as jsx13 } from "react/jsx-runtime";
2367
+ var Tabs = {
2368
+ Root: ({ className, ...props }) => /* @__PURE__ */ jsx13(Root2, { ...props, className: cn7("ox-tabs", className) }),
2369
+ Trigger: ({ children, className, ...props }) => /* @__PURE__ */ jsx13(Trigger2, { ...props, className: cn7("ox-tab", className), children: /* @__PURE__ */ jsx13("div", { children }) }),
2370
+ List: ({ className, ...props }) => /* @__PURE__ */ jsx13(List, { ...props, className: cn7("ox-tabs-list", className) }),
2371
+ Content: ({ className, ...props }) => /* @__PURE__ */ jsx13(Content5, { ...props, className: cn7("ox-tabs-panel", className) })
2372
+ };
2373
+
2374
+ // components/src/ui/checkbox/Checkbox.tsx
2375
+ import cn8 from "classnames";
2376
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
2377
+ var Check = () => /* @__PURE__ */ jsx14(Checkmark12Icon_default, { className: "text-accent pointer-events-none absolute left-0.5 top-0.5 h-3 w-3 fill-current" });
2378
+ var Indeterminate = classed.div`absolute w-2 h-0.5 left-1 top-[7px] bg-accent pointer-events-none`;
2379
+ var inputStyle = `
2380
+ appearance-none border border-default bg-default h-4 w-4 rounded-sm absolute left-0 outline-none
2381
+ disabled:cursor-not-allowed
2382
+ hover:border-hover hover:cursor-pointer
2383
+ checked:bg-accent-secondary checked:border-accent-secondary checked:hover:border-accent
2384
+ indeterminate:bg-accent-secondary indeterminate:border-accent hover:indeterminate:bg-accent-secondary-hover
2385
+ `;
2386
+ var Checkbox = ({
2387
+ indeterminate,
2388
+ children,
2389
+ className,
2390
+ ...inputProps
2391
+ }) => /* @__PURE__ */ jsxs10("label", { className: "inline-flex items-center", children: [
2392
+ /* @__PURE__ */ jsxs10("span", { className: "relative h-4 w-4", children: [
2393
+ /* @__PURE__ */ jsx14(
2394
+ "input",
2395
+ {
2396
+ className: cn8(inputStyle, className),
2397
+ type: "checkbox",
2398
+ ref: (el) => {
2399
+ if (el) el.indeterminate = !!indeterminate;
2400
+ },
2401
+ ...inputProps
2402
+ }
2403
+ ),
2404
+ inputProps.checked && !indeterminate && /* @__PURE__ */ jsx14(Check, {}),
2405
+ indeterminate && /* @__PURE__ */ jsx14(Indeterminate, {})
2406
+ ] }),
2407
+ children && /* @__PURE__ */ jsx14("span", { className: "text-sans-md text-secondary ml-2.5", children })
2408
+ ] });
2409
+
2410
+ // components/src/ui/listbox/Listbox.tsx
2411
+ import { flip, FloatingPortal, offset, size, useFloating } from "@floating-ui/react";
2412
+ import { Listbox as Select } from "@headlessui/react";
2413
+ import cn9 from "classnames";
2414
+ import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
2415
+ var Listbox = ({
2416
+ name,
2417
+ selected,
2418
+ items,
2419
+ placeholder = "Select an option",
2420
+ className,
2421
+ onChange,
2422
+ hasError = false,
2423
+ disabled,
2424
+ isLoading = false,
2425
+ ...props
2426
+ }) => {
2427
+ const { refs, floatingStyles } = useFloating({
2428
+ middleware: [
2429
+ offset(12),
2430
+ flip(),
2431
+ size({
2432
+ apply({ rects, elements }) {
2433
+ Object.assign(elements.floating.style, {
2434
+ width: `${rects.reference.width}px`
2435
+ });
2436
+ }
2437
+ })
2438
+ ]
2439
+ });
2440
+ const selectedItem = selected && items.find((i) => i.value === selected);
2441
+ const noItems = !isLoading && items.length === 0;
2442
+ const isDisabled = disabled || noItems;
2443
+ return /* @__PURE__ */ jsx15("div", { className: cn9("relative", className), children: /* @__PURE__ */ jsx15(
2444
+ Select,
2445
+ {
2446
+ value: selected,
2447
+ onChange: (val) => val !== null && onChange(val),
2448
+ disabled: isDisabled || isLoading,
2449
+ children: ({ open }) => /* @__PURE__ */ jsxs11(Fragment4, { children: [
2450
+ /* @__PURE__ */ jsxs11(
2451
+ Select.Button,
2452
+ {
2453
+ name,
2454
+ ref: refs.setReference,
2455
+ className: cn9(
2456
+ `text-sans-md flex h-10 w-full items-center justify-between rounded border`,
2457
+ hasError ? "focus-error border-error-secondary hover:border-error" : "border-default hover:border-hover",
2458
+ open && "ring-accent-secondary ring-2",
2459
+ open && hasError && "ring-error-secondary",
2460
+ isDisabled ? "text-disabled bg-disabled !border-default cursor-not-allowed" : "bg-default",
2461
+ isDisabled && hasError && "!border-error-secondary"
2462
+ ),
2463
+ ...props,
2464
+ children: [
2465
+ /* @__PURE__ */ jsx15("div", { className: "w-full px-3 text-left", children: selectedItem ? (
2466
+ // labelString is one line, which is what we need when label is a ReactNode
2467
+ selectedItem.labelString || selectedItem.label
2468
+ ) : /* @__PURE__ */ jsx15("span", { className: "text-quaternary", children: noItems ? "No items" : placeholder }) }),
2469
+ !isDisabled && /* @__PURE__ */ jsx15(SpinnerLoader, { isLoading }),
2470
+ /* @__PURE__ */ jsx15(
2471
+ "div",
2472
+ {
2473
+ className: "border-secondary ml-3 flex h-[calc(100%-12px)] items-center border-l px-3",
2474
+ "aria-hidden": true,
2475
+ children: /* @__PURE__ */ jsx15(SelectArrows6Icon_default, { className: "text-tertiary h-[14px] w-2" })
2476
+ }
2477
+ )
2478
+ ]
2479
+ }
2480
+ ),
2481
+ /* @__PURE__ */ jsx15(FloatingPortal, { children: /* @__PURE__ */ jsx15(
2482
+ Select.Options,
2483
+ {
2484
+ ref: refs.setFloating,
2485
+ style: floatingStyles,
2486
+ className: "ox-menu pointer-events-auto z-50 overflow-y-auto !outline-none",
2487
+ children: items.map((item) => /* @__PURE__ */ jsx15(
2488
+ Select.Option,
2489
+ {
2490
+ value: item.value,
2491
+ className: "border-secondary relative border-b last:border-0",
2492
+ children: ({ active, selected: selected2 }) => /* @__PURE__ */ jsx15(
2493
+ "div",
2494
+ {
2495
+ className: cn9(
2496
+ "ox-menu-item text-secondary",
2497
+ selected2 && "is-selected",
2498
+ active && "is-highlighted"
2499
+ ),
2500
+ children: item.label
2501
+ }
2502
+ )
2503
+ },
2504
+ item.value
2505
+ ))
2506
+ }
2507
+ ) })
2508
+ ] })
2509
+ }
2510
+ ) });
2511
+ };
29
2512
  export {
30
2513
  AsciiDocBlocks,
31
2514
  Badge,