@octanejs/streamdown 0.1.30 → 0.1.32
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/client/chunks/{chunk-HOETYBTH.js → chunk-HTKGPGBF.js} +394 -305
- package/dist/client/chunks/{highlighted-body-X5FGOOXL.js → highlighted-body-PO42OPN2.js} +9 -9
- package/dist/{server/chunks/mermaid-SICAYVAP.js → client/chunks/mermaid-2J5JVDRZ.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/server/chunks/{chunk-55X6YY2C.js → chunk-SZ5CVE3Y.js} +783 -411
- package/dist/server/chunks/{highlighted-body-NLELYOBH.js → highlighted-body-7UTJYNOJ.js} +18 -9
- package/dist/{client/chunks/mermaid-RM4TPAM4.js → server/chunks/mermaid-EGA7TDDR.js} +1 -1
- package/dist/server/index.js +1 -1
- package/dist/types/index.d.ts +8 -2
- package/dist/types/lib/code-block/body.d.ts +4 -1
- package/dist/types/lib/code-block/container.d.ts +1 -1
- package/dist/types/lib/code-block/copy-button.d.ts +1 -1
- package/dist/types/lib/code-block/download-button.d.ts +1 -1
- package/dist/types/lib/code-block/header.d.ts +1 -1
- package/dist/types/lib/code-block/highlighted-body.d.ts +1 -1
- package/dist/types/lib/code-block/index.d.ts +1 -1
- package/dist/types/lib/code-block/skeleton.d.ts +1 -1
- package/dist/types/lib/icon-context.d.ts +1 -1
- package/dist/types/lib/icons.d.ts +10 -10
- package/dist/types/lib/image.d.ts +1 -1
- package/dist/types/lib/link-modal.d.ts +1 -1
- package/dist/types/lib/mermaid/download-button.d.ts +1 -1
- package/dist/types/lib/mermaid/fullscreen-button.d.ts +1 -1
- package/dist/types/lib/mermaid/index.d.ts +1 -1
- package/dist/types/lib/mermaid/pan-zoom.d.ts +1 -1
- package/dist/types/lib/table/copy-dropdown.d.ts +1 -1
- package/dist/types/lib/table/download-dropdown.d.ts +2 -2
- package/dist/types/lib/table/fullscreen-button.d.ts +1 -1
- package/dist/types/lib/table/index.d.ts +1 -1
- package/package.json +7 -7
|
@@ -2,18 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
// src/lib/mermaid/index.tsrx
|
|
4
4
|
import {
|
|
5
|
-
createElement as _$
|
|
5
|
+
createElement as _$createElement7,
|
|
6
6
|
createScopedElement as _$createScopedElement19,
|
|
7
7
|
createScopedValue as _$createScopedValue21,
|
|
8
|
+
hookSlots as _$hookSlots22,
|
|
8
9
|
positionalChildren as _$positionalChildren14,
|
|
9
10
|
useContext as useContext15,
|
|
10
11
|
useEffect as useEffect12,
|
|
11
12
|
useRef as useRef10,
|
|
12
|
-
useState as useState13
|
|
13
|
+
useState as useState13,
|
|
14
|
+
withSlot as _$withSlot19
|
|
13
15
|
} from "octane/server";
|
|
16
|
+
import { createElementFromConfig as _$createElementFromConfig16 } from "octane/internal/server";
|
|
14
17
|
|
|
15
18
|
// src/hooks/use-deferred-render.tsrx
|
|
16
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
hookSlots as _$hookSlots,
|
|
21
|
+
useEffect,
|
|
22
|
+
useMemo,
|
|
23
|
+
useRef,
|
|
24
|
+
useState
|
|
25
|
+
} from "octane/server";
|
|
26
|
+
var _hs$ = /* @__PURE__ */ _$hookSlots(8);
|
|
27
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
28
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
29
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
30
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
31
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
32
|
+
var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
33
|
+
var _h$6 = /* @__PURE__ */ Symbol(_hs$ + 6);
|
|
34
|
+
var _h$7 = /* @__PURE__ */ Symbol(_hs$ + 7);
|
|
17
35
|
var DEFERRED_RENDER_DEBOUNCE_DELAY = 300;
|
|
18
36
|
var DEFERRED_RENDER_ROOT_MARGIN = "300px";
|
|
19
37
|
var DEFERRED_RENDER_IDLE_TIMEOUT = 500;
|
|
@@ -27,10 +45,10 @@ function useDeferredRender(options = {}) {
|
|
|
27
45
|
rootMargin = DEFERRED_RENDER_ROOT_MARGIN,
|
|
28
46
|
idleTimeout = DEFERRED_RENDER_IDLE_TIMEOUT
|
|
29
47
|
} = withoutSlot(options) ?? {};
|
|
30
|
-
const [shouldRender, setShouldRender] = useState(false);
|
|
31
|
-
const containerRef = useRef(null);
|
|
32
|
-
const renderTimeoutRef = useRef(null);
|
|
33
|
-
const idleCallbackRef = useRef(null);
|
|
48
|
+
const [shouldRender, setShouldRender] = useState(false, _h$0);
|
|
49
|
+
const containerRef = useRef(null, _h$1);
|
|
50
|
+
const renderTimeoutRef = useRef(null, _h$2);
|
|
51
|
+
const idleCallbackRef = useRef(null, _h$3);
|
|
34
52
|
const requestIdleCallbackPolyfill = useMemo(
|
|
35
53
|
() => (callback) => {
|
|
36
54
|
const start = Date.now();
|
|
@@ -44,17 +62,20 @@ function useDeferredRender(options = {}) {
|
|
|
44
62
|
1
|
|
45
63
|
);
|
|
46
64
|
},
|
|
47
|
-
[]
|
|
65
|
+
[],
|
|
66
|
+
_h$4
|
|
48
67
|
);
|
|
49
68
|
const requestIdleCallbackWrapper = useMemo(
|
|
50
69
|
() => typeof window !== "undefined" && window.requestIdleCallback ? (cb, opts) => window.requestIdleCallback(cb, opts) : requestIdleCallbackPolyfill,
|
|
51
|
-
[requestIdleCallbackPolyfill]
|
|
70
|
+
[requestIdleCallbackPolyfill],
|
|
71
|
+
_h$5
|
|
52
72
|
);
|
|
53
73
|
const cancelIdleCallbackWrapper = useMemo(
|
|
54
74
|
() => typeof window !== "undefined" && window.cancelIdleCallback ? (id) => window.cancelIdleCallback(id) : (id) => {
|
|
55
75
|
clearTimeout(id);
|
|
56
76
|
},
|
|
57
|
-
[]
|
|
77
|
+
[],
|
|
78
|
+
_h$6
|
|
58
79
|
);
|
|
59
80
|
useEffect(
|
|
60
81
|
() => {
|
|
@@ -149,7 +170,8 @@ function useDeferredRender(options = {}) {
|
|
|
149
170
|
idleTimeout,
|
|
150
171
|
cancelIdleCallbackWrapper,
|
|
151
172
|
requestIdleCallbackWrapper
|
|
152
|
-
]
|
|
173
|
+
],
|
|
174
|
+
_h$7
|
|
153
175
|
);
|
|
154
176
|
return { shouldRender, containerRef };
|
|
155
177
|
}
|
|
@@ -158,9 +180,10 @@ function useDeferredRender(options = {}) {
|
|
|
158
180
|
import {
|
|
159
181
|
createContext as createContext7,
|
|
160
182
|
createElement as createElement3,
|
|
161
|
-
createElement as _$
|
|
183
|
+
createElement as _$createElement6,
|
|
162
184
|
createScopedElement as _$createScopedElement17,
|
|
163
185
|
createScopedValue as _$createScopedValue19,
|
|
186
|
+
hookSlots as _$hookSlots20,
|
|
164
187
|
memo as memo3,
|
|
165
188
|
positionalChildren as _$positionalChildren12,
|
|
166
189
|
useEffect as useEffect10,
|
|
@@ -170,6 +193,7 @@ import {
|
|
|
170
193
|
useState as useState11,
|
|
171
194
|
useTransition
|
|
172
195
|
} from "octane/server";
|
|
196
|
+
import { createElementFromConfig as _$createElementFromConfig14 } from "octane/internal/server";
|
|
173
197
|
import { harden } from "rehype-harden";
|
|
174
198
|
import rehypeRaw2 from "rehype-raw";
|
|
175
199
|
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
@@ -336,28 +360,33 @@ import {
|
|
|
336
360
|
Fragment as _$Fragment4,
|
|
337
361
|
Suspense as Suspense2,
|
|
338
362
|
cloneElement,
|
|
339
|
-
createElement as _$
|
|
363
|
+
createElement as _$createElement5,
|
|
340
364
|
createScopedElement as _$createScopedElement16,
|
|
341
365
|
createScopedValue as _$createScopedValue18,
|
|
366
|
+
hookSlots as _$hookSlots19,
|
|
342
367
|
isValidElement,
|
|
343
368
|
lazy as lazy2,
|
|
344
369
|
memo as memo2,
|
|
345
370
|
positionalChildren as _$positionalChildren11,
|
|
346
371
|
useCallback as useCallback3,
|
|
347
372
|
useContext as useContext14,
|
|
348
|
-
useState as useState10
|
|
373
|
+
useState as useState10,
|
|
374
|
+
withSlot as _$withSlot17
|
|
349
375
|
} from "octane/server";
|
|
376
|
+
import { createElementFromConfig as _$createElementFromConfig13 } from "octane/internal/server";
|
|
350
377
|
|
|
351
378
|
// src/lib/code-block/index.tsrx
|
|
352
379
|
import {
|
|
353
380
|
Suspense,
|
|
354
|
-
createElement as _$createElement2,
|
|
355
381
|
createScopedElement as _$createScopedElement3,
|
|
356
382
|
createScopedValue as _$createScopedValue4,
|
|
383
|
+
hookSlots as _$hookSlots5,
|
|
357
384
|
lazy,
|
|
358
385
|
positionalChildren as _$positionalChildren,
|
|
359
|
-
useMemo as useMemo3
|
|
386
|
+
useMemo as useMemo3,
|
|
387
|
+
withSlot as _$withSlot4
|
|
360
388
|
} from "octane/server";
|
|
389
|
+
import { createElementFromConfig as _$createElementFromConfig } from "octane/internal/server";
|
|
361
390
|
|
|
362
391
|
// src/lib/prefix-context.tsrx
|
|
363
392
|
import { createContext as createContext2, useContext as useContext2 } from "octane/server";
|
|
@@ -396,9 +425,15 @@ var useCn = () => useContext2(PrefixContext);
|
|
|
396
425
|
import {
|
|
397
426
|
createScopedElement as _$createScopedElement,
|
|
398
427
|
createScopedValue as _$createScopedValue,
|
|
428
|
+
hookSlots as _$hookSlots2,
|
|
399
429
|
memo,
|
|
400
|
-
useMemo as useMemo2
|
|
430
|
+
useMemo as useMemo2,
|
|
431
|
+
withSlot as _$withSlot
|
|
401
432
|
} from "octane/server";
|
|
433
|
+
var _hs$2 = /* @__PURE__ */ _$hookSlots2(3);
|
|
434
|
+
var _h$02 = /* @__PURE__ */ Symbol(_hs$2);
|
|
435
|
+
var _h$12 = /* @__PURE__ */ Symbol(_hs$2 + 1);
|
|
436
|
+
var _h$22 = /* @__PURE__ */ Symbol(_hs$2 + 2);
|
|
402
437
|
var LINE_NUMBER_CLASSES_BASE = cn("before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-6", "before:mr-4", "before:text-[13px]", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none");
|
|
403
438
|
var parseRootStyle = (rootStyle) => {
|
|
404
439
|
const style = {};
|
|
@@ -424,8 +459,8 @@ var CodeBlockBody = memo(
|
|
|
424
459
|
lineNumbers = true,
|
|
425
460
|
...rest
|
|
426
461
|
}) => {
|
|
427
|
-
const cn2 = useCn
|
|
428
|
-
const lineClasses = useMemo2(() => cn2("block", lineNumbers && LINE_NUMBER_CLASSES_BASE), [cn2, lineNumbers]);
|
|
462
|
+
const cn2 = _$withSlot(_h$02, useCn);
|
|
463
|
+
const lineClasses = useMemo2(() => cn2("block", lineNumbers && LINE_NUMBER_CLASSES_BASE), [cn2, lineNumbers], _h$12);
|
|
429
464
|
const preStyle = useMemo2(
|
|
430
465
|
() => {
|
|
431
466
|
const style = {};
|
|
@@ -440,7 +475,8 @@ var CodeBlockBody = memo(
|
|
|
440
475
|
}
|
|
441
476
|
return style;
|
|
442
477
|
},
|
|
443
|
-
[result.bg, result.fg, result.rootStyle]
|
|
478
|
+
[result.bg, result.fg, result.rootStyle],
|
|
479
|
+
_h$22
|
|
444
480
|
);
|
|
445
481
|
return _$createScopedValue(() => _$createScopedElement(
|
|
446
482
|
"div",
|
|
@@ -506,10 +542,14 @@ var CodeBlockBody = memo(
|
|
|
506
542
|
// src/lib/code-block/container.tsrx
|
|
507
543
|
import {
|
|
508
544
|
createElement as _$createElement,
|
|
509
|
-
createScopedValue as _$createScopedValue2
|
|
545
|
+
createScopedValue as _$createScopedValue2,
|
|
546
|
+
hookSlots as _$hookSlots3,
|
|
547
|
+
withSlot as _$withSlot2
|
|
510
548
|
} from "octane/server";
|
|
549
|
+
var _hs$3 = /* @__PURE__ */ _$hookSlots3(1);
|
|
550
|
+
var _h$03 = /* @__PURE__ */ Symbol(_hs$3);
|
|
511
551
|
var CodeBlockContainer = ({ className, language, style, isIncomplete, ...props }) => {
|
|
512
|
-
const cn2 = useCn
|
|
552
|
+
const cn2 = _$withSlot2(_h$03, useCn);
|
|
513
553
|
return _$createScopedValue2(() => _$createElement("div", {
|
|
514
554
|
className: cn2("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", className),
|
|
515
555
|
"data-incomplete": isIncomplete || void 0,
|
|
@@ -532,10 +572,14 @@ var useCodeBlockContext = () => useContext3(CodeBlockContext);
|
|
|
532
572
|
// src/lib/code-block/header.tsrx
|
|
533
573
|
import {
|
|
534
574
|
createScopedElement as _$createScopedElement2,
|
|
535
|
-
createScopedValue as _$createScopedValue3
|
|
575
|
+
createScopedValue as _$createScopedValue3,
|
|
576
|
+
hookSlots as _$hookSlots4,
|
|
577
|
+
withSlot as _$withSlot3
|
|
536
578
|
} from "octane/server";
|
|
579
|
+
var _hs$4 = /* @__PURE__ */ _$hookSlots4(1);
|
|
580
|
+
var _h$04 = /* @__PURE__ */ Symbol(_hs$4);
|
|
537
581
|
var CodeBlockHeader = ({ language }) => {
|
|
538
|
-
const cn2 = useCn
|
|
582
|
+
const cn2 = _$withSlot3(_h$04, useCn);
|
|
539
583
|
return _$createScopedValue3(() => _$createScopedElement2(
|
|
540
584
|
"div",
|
|
541
585
|
{
|
|
@@ -548,6 +592,10 @@ var CodeBlockHeader = ({ language }) => {
|
|
|
548
592
|
};
|
|
549
593
|
|
|
550
594
|
// src/lib/code-block/index.tsrx
|
|
595
|
+
var _hs$5 = /* @__PURE__ */ _$hookSlots5(3);
|
|
596
|
+
var _h$05 = /* @__PURE__ */ Symbol(_hs$5);
|
|
597
|
+
var _h$13 = /* @__PURE__ */ Symbol(_hs$5 + 1);
|
|
598
|
+
var _h$23 = /* @__PURE__ */ Symbol(_hs$5 + 2);
|
|
551
599
|
var trimTrailingNewlines = (str) => {
|
|
552
600
|
let end = str.length;
|
|
553
601
|
while (end > 0 && str[end - 1] === "\n") {
|
|
@@ -555,7 +603,7 @@ var trimTrailingNewlines = (str) => {
|
|
|
555
603
|
}
|
|
556
604
|
return str.slice(0, end);
|
|
557
605
|
};
|
|
558
|
-
var HighlightedCodeBlockBody = /* @__PURE__ */ lazy(() => import("./highlighted-body-
|
|
606
|
+
var HighlightedCodeBlockBody = /* @__PURE__ */ lazy(() => import("./highlighted-body-7UTJYNOJ.js").then((mod) => ({ default: mod.HighlightedCodeBlockBody })));
|
|
559
607
|
var CodeBlock = ({
|
|
560
608
|
code,
|
|
561
609
|
language,
|
|
@@ -566,8 +614,8 @@ var CodeBlock = ({
|
|
|
566
614
|
lineNumbers,
|
|
567
615
|
...rest
|
|
568
616
|
}) => {
|
|
569
|
-
const cn2 = useCn
|
|
570
|
-
const trimmedCode = useMemo3(() => trimTrailingNewlines(code), [code]);
|
|
617
|
+
const cn2 = _$withSlot4(_h$05, useCn);
|
|
618
|
+
const trimmedCode = useMemo3(() => trimTrailingNewlines(code), [code], _h$13);
|
|
571
619
|
const raw = useMemo3(
|
|
572
620
|
() => ({
|
|
573
621
|
bg: "transparent",
|
|
@@ -582,58 +630,72 @@ var CodeBlock = ({
|
|
|
582
630
|
}
|
|
583
631
|
])
|
|
584
632
|
}),
|
|
585
|
-
[trimmedCode]
|
|
633
|
+
[trimmedCode],
|
|
634
|
+
_h$23
|
|
586
635
|
);
|
|
587
|
-
return _$createScopedValue4(() => _$createScopedElement3(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
636
|
+
return _$createScopedValue4(() => _$createScopedElement3(
|
|
637
|
+
CodeBlockContext,
|
|
638
|
+
{ value: { code } },
|
|
639
|
+
() => _$createScopedValue4(() => _$createScopedElement3(
|
|
640
|
+
CodeBlockContainer,
|
|
641
|
+
{ isIncomplete, language },
|
|
642
|
+
() => _$positionalChildren([
|
|
643
|
+
_$createScopedValue4(() => _$createElementFromConfig("c:57b3a094", CodeBlockHeader, { language })),
|
|
644
|
+
children ? _$createScopedValue4(() => _$createScopedElement3(
|
|
645
|
+
"div",
|
|
646
|
+
{
|
|
647
|
+
className: cn2("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end")
|
|
648
|
+
},
|
|
649
|
+
() => _$createScopedValue4(() => _$createScopedElement3(
|
|
650
|
+
"div",
|
|
651
|
+
{
|
|
652
|
+
className: cn2("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),
|
|
653
|
+
"data-streamdown": "code-block-actions"
|
|
654
|
+
},
|
|
655
|
+
() => children
|
|
656
|
+
))
|
|
657
|
+
)) : null,
|
|
658
|
+
_$createScopedValue4(() => _$createScopedElement3(
|
|
659
|
+
Suspense,
|
|
660
|
+
{
|
|
661
|
+
fallback: _$createScopedValue4(() => _$createElementFromConfig("c:1daece3e", CodeBlockBody, {
|
|
662
|
+
className,
|
|
663
|
+
language,
|
|
664
|
+
lineNumbers,
|
|
665
|
+
result: raw,
|
|
666
|
+
startLine,
|
|
667
|
+
...rest
|
|
668
|
+
}))
|
|
669
|
+
},
|
|
670
|
+
() => _$createScopedValue4(() => _$createElementFromConfig("c:a038f091", HighlightedCodeBlockBody, {
|
|
671
|
+
className,
|
|
672
|
+
code: trimmedCode,
|
|
673
|
+
language,
|
|
674
|
+
lineNumbers,
|
|
675
|
+
raw,
|
|
676
|
+
startLine,
|
|
677
|
+
...rest
|
|
678
|
+
})),
|
|
679
|
+
"c:12e1bcaf"
|
|
680
|
+
))
|
|
681
|
+
]),
|
|
682
|
+
"c:dbefdff7"
|
|
683
|
+
)),
|
|
684
|
+
"c:292e16ce"
|
|
685
|
+
));
|
|
626
686
|
};
|
|
627
687
|
|
|
628
688
|
// src/lib/code-block/copy-button.tsrx
|
|
689
|
+
import { createElementFromConfig as _$createElementFromConfig2 } from "octane/internal/server";
|
|
629
690
|
import {
|
|
630
|
-
createElement as _$createElement4,
|
|
631
691
|
createScopedElement as _$createScopedElement5,
|
|
632
692
|
createScopedValue as _$createScopedValue7,
|
|
693
|
+
hookSlots as _$hookSlots7,
|
|
633
694
|
useContext as useContext6,
|
|
634
695
|
useEffect as useEffect2,
|
|
635
696
|
useRef as useRef3,
|
|
636
|
-
useState as useState2
|
|
697
|
+
useState as useState2,
|
|
698
|
+
withSlot as _$withSlot5
|
|
637
699
|
} from "octane/server";
|
|
638
700
|
|
|
639
701
|
// src/lib/icon-context.tsrx
|
|
@@ -641,16 +703,17 @@ import {
|
|
|
641
703
|
createContext as createContext4,
|
|
642
704
|
createScopedElement as _$createScopedElement4,
|
|
643
705
|
createScopedValue as _$createScopedValue6,
|
|
706
|
+
hookSlots as _$hookSlots6,
|
|
644
707
|
useContext as useContext4,
|
|
645
708
|
useRef as useRef2
|
|
646
709
|
} from "octane/server";
|
|
647
710
|
|
|
648
711
|
// src/lib/icons.tsrx
|
|
649
712
|
import {
|
|
650
|
-
createElement as _$
|
|
713
|
+
createElement as _$createElement2,
|
|
651
714
|
createScopedValue as _$createScopedValue5
|
|
652
715
|
} from "octane/server";
|
|
653
|
-
var CheckIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
716
|
+
var CheckIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
654
717
|
"svg",
|
|
655
718
|
{
|
|
656
719
|
color: "currentColor",
|
|
@@ -660,14 +723,14 @@ var CheckIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$create
|
|
|
660
723
|
width: size,
|
|
661
724
|
...props
|
|
662
725
|
},
|
|
663
|
-
_$
|
|
726
|
+
_$createElement2("path", {
|
|
664
727
|
clipRule: "evenodd",
|
|
665
728
|
d: "M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",
|
|
666
729
|
fill: "currentColor",
|
|
667
730
|
fillRule: "evenodd"
|
|
668
731
|
})
|
|
669
732
|
));
|
|
670
|
-
var CopyIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
733
|
+
var CopyIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
671
734
|
"svg",
|
|
672
735
|
{
|
|
673
736
|
color: "currentColor",
|
|
@@ -677,14 +740,14 @@ var CopyIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createE
|
|
|
677
740
|
width: size,
|
|
678
741
|
...props
|
|
679
742
|
},
|
|
680
|
-
_$
|
|
743
|
+
_$createElement2("path", {
|
|
681
744
|
clipRule: "evenodd",
|
|
682
745
|
d: "M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",
|
|
683
746
|
fill: "currentColor",
|
|
684
747
|
fillRule: "evenodd"
|
|
685
748
|
})
|
|
686
749
|
));
|
|
687
|
-
var DownloadIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
750
|
+
var DownloadIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
688
751
|
"svg",
|
|
689
752
|
{
|
|
690
753
|
color: "currentColor",
|
|
@@ -694,14 +757,14 @@ var DownloadIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$cre
|
|
|
694
757
|
width: size,
|
|
695
758
|
...props
|
|
696
759
|
},
|
|
697
|
-
_$
|
|
760
|
+
_$createElement2("path", {
|
|
698
761
|
clipRule: "evenodd",
|
|
699
762
|
d: "M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",
|
|
700
763
|
fill: "currentColor",
|
|
701
764
|
fillRule: "evenodd"
|
|
702
765
|
})
|
|
703
766
|
));
|
|
704
|
-
var Loader2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
767
|
+
var Loader2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
705
768
|
"svg",
|
|
706
769
|
{
|
|
707
770
|
color: "currentColor",
|
|
@@ -711,63 +774,63 @@ var Loader2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$crea
|
|
|
711
774
|
width: size,
|
|
712
775
|
...props
|
|
713
776
|
},
|
|
714
|
-
_$
|
|
715
|
-
_$
|
|
777
|
+
_$createElement2("path", { d: "M8 0V4", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
778
|
+
_$createElement2("path", {
|
|
716
779
|
d: "M8 16V12",
|
|
717
780
|
opacity: "0.5",
|
|
718
781
|
stroke: "currentColor",
|
|
719
782
|
strokeWidth: "1.5"
|
|
720
783
|
}),
|
|
721
|
-
_$
|
|
784
|
+
_$createElement2("path", {
|
|
722
785
|
d: "M3.29773 1.52783L5.64887 4.7639",
|
|
723
786
|
opacity: "0.9",
|
|
724
787
|
stroke: "currentColor",
|
|
725
788
|
strokeWidth: "1.5"
|
|
726
789
|
}),
|
|
727
|
-
_$
|
|
790
|
+
_$createElement2("path", {
|
|
728
791
|
d: "M12.7023 1.52783L10.3511 4.7639",
|
|
729
792
|
opacity: "0.1",
|
|
730
793
|
stroke: "currentColor",
|
|
731
794
|
strokeWidth: "1.5"
|
|
732
795
|
}),
|
|
733
|
-
_$
|
|
796
|
+
_$createElement2("path", {
|
|
734
797
|
d: "M12.7023 14.472L10.3511 11.236",
|
|
735
798
|
opacity: "0.4",
|
|
736
799
|
stroke: "currentColor",
|
|
737
800
|
strokeWidth: "1.5"
|
|
738
801
|
}),
|
|
739
|
-
_$
|
|
802
|
+
_$createElement2("path", {
|
|
740
803
|
d: "M3.29773 14.472L5.64887 11.236",
|
|
741
804
|
opacity: "0.6",
|
|
742
805
|
stroke: "currentColor",
|
|
743
806
|
strokeWidth: "1.5"
|
|
744
807
|
}),
|
|
745
|
-
_$
|
|
808
|
+
_$createElement2("path", {
|
|
746
809
|
d: "M15.6085 5.52783L11.8043 6.7639",
|
|
747
810
|
opacity: "0.2",
|
|
748
811
|
stroke: "currentColor",
|
|
749
812
|
strokeWidth: "1.5"
|
|
750
813
|
}),
|
|
751
|
-
_$
|
|
814
|
+
_$createElement2("path", {
|
|
752
815
|
d: "M0.391602 10.472L4.19583 9.23598",
|
|
753
816
|
opacity: "0.7",
|
|
754
817
|
stroke: "currentColor",
|
|
755
818
|
strokeWidth: "1.5"
|
|
756
819
|
}),
|
|
757
|
-
_$
|
|
820
|
+
_$createElement2("path", {
|
|
758
821
|
d: "M15.6085 10.4722L11.8043 9.2361",
|
|
759
822
|
opacity: "0.3",
|
|
760
823
|
stroke: "currentColor",
|
|
761
824
|
strokeWidth: "1.5"
|
|
762
825
|
}),
|
|
763
|
-
_$
|
|
826
|
+
_$createElement2("path", {
|
|
764
827
|
d: "M0.391602 5.52783L4.19583 6.7639",
|
|
765
828
|
opacity: "0.8",
|
|
766
829
|
stroke: "currentColor",
|
|
767
830
|
strokeWidth: "1.5"
|
|
768
831
|
})
|
|
769
832
|
));
|
|
770
|
-
var Maximize2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
833
|
+
var Maximize2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
771
834
|
"svg",
|
|
772
835
|
{
|
|
773
836
|
color: "currentColor",
|
|
@@ -777,14 +840,14 @@ var Maximize2Icon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$cr
|
|
|
777
840
|
width: size,
|
|
778
841
|
...props
|
|
779
842
|
},
|
|
780
|
-
_$
|
|
843
|
+
_$createElement2("path", {
|
|
781
844
|
clipRule: "evenodd",
|
|
782
845
|
d: "M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",
|
|
783
846
|
fill: "currentColor",
|
|
784
847
|
fillRule: "evenodd"
|
|
785
848
|
})
|
|
786
849
|
));
|
|
787
|
-
var RotateCcwIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
850
|
+
var RotateCcwIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
788
851
|
"svg",
|
|
789
852
|
{
|
|
790
853
|
color: "currentColor",
|
|
@@ -794,14 +857,14 @@ var RotateCcwIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$cr
|
|
|
794
857
|
width: size,
|
|
795
858
|
...props
|
|
796
859
|
},
|
|
797
|
-
_$
|
|
860
|
+
_$createElement2("path", {
|
|
798
861
|
clipRule: "evenodd",
|
|
799
862
|
d: "M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",
|
|
800
863
|
fill: "currentColor",
|
|
801
864
|
fillRule: "evenodd"
|
|
802
865
|
})
|
|
803
866
|
));
|
|
804
|
-
var XIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
867
|
+
var XIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
805
868
|
"svg",
|
|
806
869
|
{
|
|
807
870
|
color: "currentColor",
|
|
@@ -811,14 +874,14 @@ var XIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElem
|
|
|
811
874
|
width: size,
|
|
812
875
|
...props
|
|
813
876
|
},
|
|
814
|
-
_$
|
|
877
|
+
_$createElement2("path", {
|
|
815
878
|
clipRule: "evenodd",
|
|
816
879
|
d: "M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",
|
|
817
880
|
fill: "currentColor",
|
|
818
881
|
fillRule: "evenodd"
|
|
819
882
|
})
|
|
820
883
|
));
|
|
821
|
-
var ExternalLinkIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
884
|
+
var ExternalLinkIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
822
885
|
"svg",
|
|
823
886
|
{
|
|
824
887
|
color: "currentColor",
|
|
@@ -828,14 +891,14 @@ var ExternalLinkIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _
|
|
|
828
891
|
width: size,
|
|
829
892
|
...props
|
|
830
893
|
},
|
|
831
|
-
_$
|
|
894
|
+
_$createElement2("path", {
|
|
832
895
|
clipRule: "evenodd",
|
|
833
896
|
d: "M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",
|
|
834
897
|
fill: "currentColor",
|
|
835
898
|
fillRule: "evenodd"
|
|
836
899
|
})
|
|
837
900
|
));
|
|
838
|
-
var ZoomInIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
901
|
+
var ZoomInIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
839
902
|
"svg",
|
|
840
903
|
{
|
|
841
904
|
color: "currentColor",
|
|
@@ -845,14 +908,14 @@ var ZoomInIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$creat
|
|
|
845
908
|
width: size,
|
|
846
909
|
...props
|
|
847
910
|
},
|
|
848
|
-
_$
|
|
911
|
+
_$createElement2("path", {
|
|
849
912
|
clipRule: "evenodd",
|
|
850
913
|
d: "M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",
|
|
851
914
|
fill: "currentColor",
|
|
852
915
|
fillRule: "evenodd"
|
|
853
916
|
})
|
|
854
917
|
));
|
|
855
|
-
var ZoomOutIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$
|
|
918
|
+
var ZoomOutIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$createElement2(
|
|
856
919
|
"svg",
|
|
857
920
|
{
|
|
858
921
|
color: "currentColor",
|
|
@@ -862,7 +925,7 @@ var ZoomOutIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$crea
|
|
|
862
925
|
width: size,
|
|
863
926
|
...props
|
|
864
927
|
},
|
|
865
|
-
_$
|
|
928
|
+
_$createElement2("path", {
|
|
866
929
|
clipRule: "evenodd",
|
|
867
930
|
d: "M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",
|
|
868
931
|
fill: "currentColor",
|
|
@@ -871,6 +934,9 @@ var ZoomOutIcon = ({ size = 16, ...props }) => _$createScopedValue5(() => _$crea
|
|
|
871
934
|
));
|
|
872
935
|
|
|
873
936
|
// src/lib/icon-context.tsrx
|
|
937
|
+
var _hs$6 = /* @__PURE__ */ _$hookSlots6(2);
|
|
938
|
+
var _h$06 = /* @__PURE__ */ Symbol(_hs$6);
|
|
939
|
+
var _h$14 = /* @__PURE__ */ Symbol(_hs$6 + 1);
|
|
874
940
|
var defaultIcons = {
|
|
875
941
|
CheckIcon,
|
|
876
942
|
CopyIcon,
|
|
@@ -899,14 +965,14 @@ var shallowEqual = (a, b) => {
|
|
|
899
965
|
return keysA.every((key) => a[key] === b[key]);
|
|
900
966
|
};
|
|
901
967
|
var IconProvider = ({ icons, children }) => {
|
|
902
|
-
const prevIconsRef = useRef2(icons);
|
|
903
|
-
const prevValueRef = useRef2(icons ? { ...defaultIcons, ...icons } : defaultIcons);
|
|
968
|
+
const prevIconsRef = useRef2(icons, _h$06);
|
|
969
|
+
const prevValueRef = useRef2(icons ? { ...defaultIcons, ...icons } : defaultIcons, _h$14);
|
|
904
970
|
if (!shallowEqual(prevIconsRef.current, icons)) {
|
|
905
971
|
prevIconsRef.current = icons;
|
|
906
972
|
prevValueRef.current = icons ? { ...defaultIcons, ...icons } : defaultIcons;
|
|
907
973
|
}
|
|
908
974
|
const value = prevValueRef.current;
|
|
909
|
-
return _$createScopedValue6(() => _$createScopedElement4(IconContext
|
|
975
|
+
return _$createScopedValue6(() => _$createScopedElement4(IconContext, { value }, () => children, "c:5201f800"));
|
|
910
976
|
};
|
|
911
977
|
var useIcons = () => useContext4(IconContext);
|
|
912
978
|
|
|
@@ -947,6 +1013,14 @@ var TranslationsContext = createContext5(defaultTranslations);
|
|
|
947
1013
|
var useTranslations = () => useContext5(TranslationsContext);
|
|
948
1014
|
|
|
949
1015
|
// src/lib/code-block/copy-button.tsrx
|
|
1016
|
+
var _hs$7 = /* @__PURE__ */ _$hookSlots7(7);
|
|
1017
|
+
var _h$07 = /* @__PURE__ */ Symbol(_hs$7);
|
|
1018
|
+
var _h$15 = /* @__PURE__ */ Symbol(_hs$7 + 1);
|
|
1019
|
+
var _h$24 = /* @__PURE__ */ Symbol(_hs$7 + 2);
|
|
1020
|
+
var _h$32 = /* @__PURE__ */ Symbol(_hs$7 + 3);
|
|
1021
|
+
var _h$42 = /* @__PURE__ */ Symbol(_hs$7 + 4);
|
|
1022
|
+
var _h$52 = /* @__PURE__ */ Symbol(_hs$7 + 5);
|
|
1023
|
+
var _h$62 = /* @__PURE__ */ Symbol(_hs$7 + 6);
|
|
950
1024
|
var CodeBlockCopyButton = ({
|
|
951
1025
|
onCopy,
|
|
952
1026
|
onError,
|
|
@@ -956,12 +1030,12 @@ var CodeBlockCopyButton = ({
|
|
|
956
1030
|
code: propCode,
|
|
957
1031
|
...props
|
|
958
1032
|
}) => {
|
|
959
|
-
const cn2 = useCn
|
|
960
|
-
const [isCopied, setIsCopied] = useState2(false);
|
|
961
|
-
const timeoutRef = useRef3(0);
|
|
962
|
-
const { code: contextCode } = useCodeBlockContext
|
|
1033
|
+
const cn2 = _$withSlot5(_h$07, useCn);
|
|
1034
|
+
const [isCopied, setIsCopied] = useState2(false, _h$15);
|
|
1035
|
+
const timeoutRef = useRef3(0, _h$24);
|
|
1036
|
+
const { code: contextCode } = _$withSlot5(_h$32, useCodeBlockContext);
|
|
963
1037
|
const { isAnimating } = useContext6(StreamdownContext);
|
|
964
|
-
const t = useTranslations
|
|
1038
|
+
const t = _$withSlot5(_h$42, useTranslations);
|
|
965
1039
|
const code = propCode ?? contextCode;
|
|
966
1040
|
const copyToClipboard = async () => {
|
|
967
1041
|
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
@@ -983,9 +1057,10 @@ var CodeBlockCopyButton = ({
|
|
|
983
1057
|
() => () => {
|
|
984
1058
|
window.clearTimeout(timeoutRef.current);
|
|
985
1059
|
},
|
|
986
|
-
[]
|
|
1060
|
+
[],
|
|
1061
|
+
_h$52
|
|
987
1062
|
);
|
|
988
|
-
const icons = useIcons
|
|
1063
|
+
const icons = _$withSlot5(_h$62, useIcons);
|
|
989
1064
|
const Icon = isCopied ? icons.CheckIcon : icons.CopyIcon;
|
|
990
1065
|
return _$createScopedValue7(() => _$createScopedElement5(
|
|
991
1066
|
"button",
|
|
@@ -998,17 +1073,24 @@ var CodeBlockCopyButton = ({
|
|
|
998
1073
|
type: "button",
|
|
999
1074
|
...props
|
|
1000
1075
|
},
|
|
1001
|
-
() => children ?? _$
|
|
1076
|
+
() => children ?? _$createElementFromConfig2("c:c4f382a3", Icon, { size: 14 })
|
|
1002
1077
|
));
|
|
1003
1078
|
};
|
|
1004
1079
|
|
|
1005
1080
|
// src/lib/code-block/download-button.tsrx
|
|
1081
|
+
import { createElementFromConfig as _$createElementFromConfig3 } from "octane/internal/server";
|
|
1006
1082
|
import {
|
|
1007
|
-
createElement as _$createElement5,
|
|
1008
1083
|
createScopedElement as _$createScopedElement6,
|
|
1009
1084
|
createScopedValue as _$createScopedValue8,
|
|
1010
|
-
|
|
1085
|
+
hookSlots as _$hookSlots8,
|
|
1086
|
+
useContext as useContext7,
|
|
1087
|
+
withSlot as _$withSlot6
|
|
1011
1088
|
} from "octane/server";
|
|
1089
|
+
var _hs$8 = /* @__PURE__ */ _$hookSlots8(4);
|
|
1090
|
+
var _h$08 = /* @__PURE__ */ Symbol(_hs$8);
|
|
1091
|
+
var _h$16 = /* @__PURE__ */ Symbol(_hs$8 + 1);
|
|
1092
|
+
var _h$25 = /* @__PURE__ */ Symbol(_hs$8 + 2);
|
|
1093
|
+
var _h$33 = /* @__PURE__ */ Symbol(_hs$8 + 3);
|
|
1012
1094
|
var languageExtensionMap = {
|
|
1013
1095
|
"1c": "1c",
|
|
1014
1096
|
"1c-query": "1cq",
|
|
@@ -1326,11 +1408,11 @@ var CodeBlockDownloadButton = ({
|
|
|
1326
1408
|
code: propCode,
|
|
1327
1409
|
...props
|
|
1328
1410
|
}) => {
|
|
1329
|
-
const cn2 = useCn
|
|
1330
|
-
const { code: contextCode } = useCodeBlockContext
|
|
1411
|
+
const cn2 = _$withSlot6(_h$08, useCn);
|
|
1412
|
+
const { code: contextCode } = _$withSlot6(_h$16, useCodeBlockContext);
|
|
1331
1413
|
const { isAnimating } = useContext7(StreamdownContext);
|
|
1332
|
-
const t = useTranslations
|
|
1333
|
-
const icons = useIcons
|
|
1414
|
+
const t = _$withSlot6(_h$25, useTranslations);
|
|
1415
|
+
const icons = _$withSlot6(_h$33, useIcons);
|
|
1334
1416
|
const code = propCode ?? contextCode;
|
|
1335
1417
|
const extension = language && language in languageExtensionMap ? languageExtensionMap[language] : "txt";
|
|
1336
1418
|
const filename = `file.${extension}`;
|
|
@@ -1354,28 +1436,34 @@ var CodeBlockDownloadButton = ({
|
|
|
1354
1436
|
type: "button",
|
|
1355
1437
|
...props
|
|
1356
1438
|
},
|
|
1357
|
-
() => children ?? _$createScopedValue8(() => _$
|
|
1439
|
+
() => children ?? _$createScopedValue8(() => _$createElementFromConfig3("c:695e73ca", icons.DownloadIcon, { size: 14 }))
|
|
1358
1440
|
));
|
|
1359
1441
|
};
|
|
1360
1442
|
|
|
1361
1443
|
// src/lib/code-block/skeleton.tsrx
|
|
1362
1444
|
import {
|
|
1363
|
-
createElement as _$
|
|
1445
|
+
createElement as _$createElement3,
|
|
1364
1446
|
createScopedElement as _$createScopedElement7,
|
|
1365
1447
|
createScopedValue as _$createScopedValue9,
|
|
1366
|
-
|
|
1448
|
+
hookSlots as _$hookSlots9,
|
|
1449
|
+
positionalChildren as _$positionalChildren2,
|
|
1450
|
+
withSlot as _$withSlot7
|
|
1367
1451
|
} from "octane/server";
|
|
1452
|
+
import { createElementFromConfig as _$createElementFromConfig4 } from "octane/internal/server";
|
|
1453
|
+
var _hs$9 = /* @__PURE__ */ _$hookSlots9(2);
|
|
1454
|
+
var _h$09 = /* @__PURE__ */ Symbol(_hs$9);
|
|
1455
|
+
var _h$17 = /* @__PURE__ */ Symbol(_hs$9 + 1);
|
|
1368
1456
|
var CodeBlockSkeleton = () => {
|
|
1369
|
-
const { Loader2Icon: Loader2Icon2 } = useIcons
|
|
1370
|
-
const cn2 = useCn
|
|
1457
|
+
const { Loader2Icon: Loader2Icon2 } = _$withSlot7(_h$09, useIcons);
|
|
1458
|
+
const cn2 = _$withSlot7(_h$17, useCn);
|
|
1371
1459
|
return _$createScopedValue9(() => _$createScopedElement7(
|
|
1372
1460
|
"div",
|
|
1373
1461
|
{
|
|
1374
1462
|
className: cn2("w-full divide-y divide-border overflow-hidden rounded-xl border border-border")
|
|
1375
1463
|
},
|
|
1376
1464
|
() => _$positionalChildren2([
|
|
1377
|
-
_$createScopedValue9(() => _$
|
|
1378
|
-
_$createScopedValue9(() => _$createScopedElement7("div", { className: cn2("flex w-full items-center justify-center p-4") }, () => _$createScopedValue9(() => _$
|
|
1465
|
+
_$createScopedValue9(() => _$createElement3("div", { className: cn2("h-[46px] w-full bg-muted/80") })),
|
|
1466
|
+
_$createScopedValue9(() => _$createScopedElement7("div", { className: cn2("flex w-full items-center justify-center p-4") }, () => _$createScopedValue9(() => _$createElementFromConfig4("c:986888e5", Loader2Icon2, { className: cn2("size-4 animate-spin") }))))
|
|
1379
1467
|
])
|
|
1380
1468
|
));
|
|
1381
1469
|
};
|
|
@@ -1383,15 +1471,27 @@ var CodeBlockSkeleton = () => {
|
|
|
1383
1471
|
// src/lib/image.tsrx
|
|
1384
1472
|
import {
|
|
1385
1473
|
createElement,
|
|
1386
|
-
createElement as _$
|
|
1474
|
+
createElement as _$createElement4,
|
|
1387
1475
|
createScopedElement as _$createScopedElement8,
|
|
1388
1476
|
createScopedValue as _$createScopedValue10,
|
|
1477
|
+
hookSlots as _$hookSlots10,
|
|
1389
1478
|
positionalChildren as _$positionalChildren3,
|
|
1390
1479
|
useCallback,
|
|
1391
1480
|
useEffect as useEffect3,
|
|
1392
1481
|
useRef as useRef4,
|
|
1393
|
-
useState as useState3
|
|
1482
|
+
useState as useState3,
|
|
1483
|
+
withSlot as _$withSlot8
|
|
1394
1484
|
} from "octane/server";
|
|
1485
|
+
import { createElementFromConfig as _$createElementFromConfig5 } from "octane/internal/server";
|
|
1486
|
+
var _hs$10 = /* @__PURE__ */ _$hookSlots10(8);
|
|
1487
|
+
var _h$010 = /* @__PURE__ */ Symbol(_hs$10);
|
|
1488
|
+
var _h$18 = /* @__PURE__ */ Symbol(_hs$10 + 1);
|
|
1489
|
+
var _h$26 = /* @__PURE__ */ Symbol(_hs$10 + 2);
|
|
1490
|
+
var _h$34 = /* @__PURE__ */ Symbol(_hs$10 + 3);
|
|
1491
|
+
var _h$43 = /* @__PURE__ */ Symbol(_hs$10 + 4);
|
|
1492
|
+
var _h$53 = /* @__PURE__ */ Symbol(_hs$10 + 5);
|
|
1493
|
+
var _h$63 = /* @__PURE__ */ Symbol(_hs$10 + 6);
|
|
1494
|
+
var _h$72 = /* @__PURE__ */ Symbol(_hs$10 + 7);
|
|
1395
1495
|
var fileExtensionPattern = /\.[^/.]+$/;
|
|
1396
1496
|
var ImageComponent = ({
|
|
1397
1497
|
node,
|
|
@@ -1402,11 +1502,11 @@ var ImageComponent = ({
|
|
|
1402
1502
|
onError: onErrorProp,
|
|
1403
1503
|
...props
|
|
1404
1504
|
}) => {
|
|
1405
|
-
const { DownloadIcon: DownloadIcon2 } = useIcons
|
|
1406
|
-
const cn2 = useCn
|
|
1407
|
-
const imgRef = useRef4(null);
|
|
1408
|
-
const [imageState, setImageState] = useState3({ error: false, loaded: false, source: src });
|
|
1409
|
-
const t = useTranslations
|
|
1505
|
+
const { DownloadIcon: DownloadIcon2 } = _$withSlot8(_h$010, useIcons);
|
|
1506
|
+
const cn2 = _$withSlot8(_h$18, useCn);
|
|
1507
|
+
const imgRef = useRef4(null, _h$26);
|
|
1508
|
+
const [imageState, setImageState] = useState3({ error: false, loaded: false, source: src }, _h$34);
|
|
1509
|
+
const t = _$withSlot8(_h$43, useTranslations);
|
|
1410
1510
|
const imageLoaded = imageState.source === src && imageState.loaded;
|
|
1411
1511
|
const imageError = imageState.source === src && imageState.error;
|
|
1412
1512
|
const hasExplicitDimensions = props.width != null || props.height != null;
|
|
@@ -1421,21 +1521,24 @@ var ImageComponent = ({
|
|
|
1421
1521
|
setImageState({ error: !loaded, loaded, source: src });
|
|
1422
1522
|
}
|
|
1423
1523
|
},
|
|
1424
|
-
[src]
|
|
1524
|
+
[src],
|
|
1525
|
+
_h$53
|
|
1425
1526
|
);
|
|
1426
1527
|
const handleLoad = useCallback(
|
|
1427
1528
|
(event) => {
|
|
1428
1529
|
setImageState({ error: false, loaded: true, source: src });
|
|
1429
1530
|
onLoadProp?.(event);
|
|
1430
1531
|
},
|
|
1431
|
-
[onLoadProp, src]
|
|
1532
|
+
[onLoadProp, src],
|
|
1533
|
+
_h$63
|
|
1432
1534
|
);
|
|
1433
1535
|
const handleError = useCallback(
|
|
1434
1536
|
(event) => {
|
|
1435
1537
|
setImageState({ error: true, loaded: false, source: src });
|
|
1436
1538
|
onErrorProp?.(event);
|
|
1437
1539
|
},
|
|
1438
|
-
[onErrorProp, src]
|
|
1540
|
+
[onErrorProp, src],
|
|
1541
|
+
_h$72
|
|
1439
1542
|
);
|
|
1440
1543
|
const downloadImage = async () => {
|
|
1441
1544
|
if (!src) {
|
|
@@ -1502,7 +1605,7 @@ var ImageComponent = ({
|
|
|
1502
1605
|
},
|
|
1503
1606
|
() => t.imageNotAvailable
|
|
1504
1607
|
)),
|
|
1505
|
-
_$createScopedValue10(() => _$
|
|
1608
|
+
_$createScopedValue10(() => _$createElement4("div", {
|
|
1506
1609
|
className: cn2("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")
|
|
1507
1610
|
})),
|
|
1508
1611
|
showDownload && _$createScopedValue10(() => _$createScopedElement8(
|
|
@@ -1513,7 +1616,7 @@ var ImageComponent = ({
|
|
|
1513
1616
|
title: t.downloadImage,
|
|
1514
1617
|
type: "button"
|
|
1515
1618
|
},
|
|
1516
|
-
() => _$
|
|
1619
|
+
() => _$createElementFromConfig5("c:75fe6da8", DownloadIcon2, { size: 14 })
|
|
1517
1620
|
))
|
|
1518
1621
|
])
|
|
1519
1622
|
));
|
|
@@ -1522,14 +1625,16 @@ var ImageComponent = ({
|
|
|
1522
1625
|
// src/lib/link-modal.tsrx
|
|
1523
1626
|
import {
|
|
1524
1627
|
Fragment as _$Fragment,
|
|
1525
|
-
createElement as _$createElement8,
|
|
1526
1628
|
createScopedElement as _$createScopedElement9,
|
|
1527
1629
|
createScopedValue as _$createScopedValue11,
|
|
1630
|
+
hookSlots as _$hookSlots11,
|
|
1528
1631
|
positionalChildren as _$positionalChildren4,
|
|
1529
1632
|
useCallback as useCallback2,
|
|
1530
1633
|
useEffect as useEffect4,
|
|
1531
|
-
useState as useState4
|
|
1634
|
+
useState as useState4,
|
|
1635
|
+
withSlot as _$withSlot9
|
|
1532
1636
|
} from "octane/server";
|
|
1637
|
+
import { createElementFromConfig as _$createElementFromConfig6 } from "octane/internal/server";
|
|
1533
1638
|
|
|
1534
1639
|
// src/lib/scroll-lock.ts
|
|
1535
1640
|
var activeCount = 0;
|
|
@@ -1547,11 +1652,19 @@ var unlockBodyScroll = () => {
|
|
|
1547
1652
|
};
|
|
1548
1653
|
|
|
1549
1654
|
// src/lib/link-modal.tsrx
|
|
1655
|
+
var _hs$11 = /* @__PURE__ */ _$hookSlots11(7);
|
|
1656
|
+
var _h$011 = /* @__PURE__ */ Symbol(_hs$11);
|
|
1657
|
+
var _h$19 = /* @__PURE__ */ Symbol(_hs$11 + 1);
|
|
1658
|
+
var _h$27 = /* @__PURE__ */ Symbol(_hs$11 + 2);
|
|
1659
|
+
var _h$35 = /* @__PURE__ */ Symbol(_hs$11 + 3);
|
|
1660
|
+
var _h$44 = /* @__PURE__ */ Symbol(_hs$11 + 4);
|
|
1661
|
+
var _h$54 = /* @__PURE__ */ Symbol(_hs$11 + 5);
|
|
1662
|
+
var _h$64 = /* @__PURE__ */ Symbol(_hs$11 + 6);
|
|
1550
1663
|
var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
1551
|
-
const { CheckIcon: CheckIcon2, CopyIcon: CopyIcon2, ExternalLinkIcon: ExternalLinkIcon2, XIcon: XIcon2 } = useIcons
|
|
1552
|
-
const cn2 = useCn
|
|
1553
|
-
const [copied, setCopied] = useState4(false);
|
|
1554
|
-
const t = useTranslations
|
|
1664
|
+
const { CheckIcon: CheckIcon2, CopyIcon: CopyIcon2, ExternalLinkIcon: ExternalLinkIcon2, XIcon: XIcon2 } = _$withSlot9(_h$011, useIcons);
|
|
1665
|
+
const cn2 = _$withSlot9(_h$19, useCn);
|
|
1666
|
+
const [copied, setCopied] = useState4(false, _h$27);
|
|
1667
|
+
const t = _$withSlot9(_h$35, useTranslations);
|
|
1555
1668
|
const handleCopy = useCallback2(
|
|
1556
1669
|
async () => {
|
|
1557
1670
|
try {
|
|
@@ -1561,14 +1674,16 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1561
1674
|
} catch {
|
|
1562
1675
|
}
|
|
1563
1676
|
},
|
|
1564
|
-
[url]
|
|
1677
|
+
[url],
|
|
1678
|
+
_h$44
|
|
1565
1679
|
);
|
|
1566
1680
|
const handleConfirm = useCallback2(
|
|
1567
1681
|
() => {
|
|
1568
1682
|
onConfirm();
|
|
1569
1683
|
onClose();
|
|
1570
1684
|
},
|
|
1571
|
-
[onConfirm, onClose]
|
|
1685
|
+
[onConfirm, onClose],
|
|
1686
|
+
_h$54
|
|
1572
1687
|
);
|
|
1573
1688
|
useEffect4(
|
|
1574
1689
|
() => {
|
|
@@ -1586,7 +1701,8 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1586
1701
|
};
|
|
1587
1702
|
}
|
|
1588
1703
|
},
|
|
1589
|
-
[isOpen, onClose]
|
|
1704
|
+
[isOpen, onClose],
|
|
1705
|
+
_h$64
|
|
1590
1706
|
);
|
|
1591
1707
|
if (!isOpen) {
|
|
1592
1708
|
return null;
|
|
@@ -1622,7 +1738,7 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1622
1738
|
title: t.close,
|
|
1623
1739
|
type: "button"
|
|
1624
1740
|
},
|
|
1625
|
-
() => _$
|
|
1741
|
+
() => _$createElementFromConfig6("c:bb74145d", XIcon2, { size: 16 })
|
|
1626
1742
|
)),
|
|
1627
1743
|
_$createScopedValue11(() => _$createScopedElement9("div", { className: cn2("flex flex-col gap-2") }, () => _$positionalChildren4([
|
|
1628
1744
|
_$createScopedValue11(() => _$createScopedElement9(
|
|
@@ -1631,7 +1747,7 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1631
1747
|
className: cn2("flex items-center gap-2 font-semibold text-lg")
|
|
1632
1748
|
},
|
|
1633
1749
|
() => _$positionalChildren4([
|
|
1634
|
-
_$
|
|
1750
|
+
_$createElementFromConfig6("c:d2395277", ExternalLinkIcon2, { size: 20 }),
|
|
1635
1751
|
_$createScopedElement9("span", {}, () => t.openExternalLink)
|
|
1636
1752
|
])
|
|
1637
1753
|
)),
|
|
@@ -1653,10 +1769,10 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1653
1769
|
type: "button"
|
|
1654
1770
|
},
|
|
1655
1771
|
() => copied ? _$createScopedElement9(_$Fragment, {}, () => _$positionalChildren4([
|
|
1656
|
-
_$
|
|
1772
|
+
_$createElementFromConfig6("c:4e056c63", CheckIcon2, { size: 14 }),
|
|
1657
1773
|
_$createScopedElement9("span", {}, () => t.copied)
|
|
1658
1774
|
])) : _$createScopedElement9(_$Fragment, {}, () => _$positionalChildren4([
|
|
1659
|
-
_$
|
|
1775
|
+
_$createElementFromConfig6("c:f679c944", CopyIcon2, { size: 14 }),
|
|
1660
1776
|
_$createScopedElement9("span", {}, () => t.copyLink)
|
|
1661
1777
|
]))
|
|
1662
1778
|
)),
|
|
@@ -1668,7 +1784,7 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1668
1784
|
type: "button"
|
|
1669
1785
|
},
|
|
1670
1786
|
() => _$positionalChildren4([
|
|
1671
|
-
_$
|
|
1787
|
+
_$createElementFromConfig6("c:3207e193", ExternalLinkIcon2, { size: 14 }),
|
|
1672
1788
|
_$createScopedElement9("span", {}, () => t.openLink)
|
|
1673
1789
|
])
|
|
1674
1790
|
))
|
|
@@ -1679,31 +1795,44 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1679
1795
|
};
|
|
1680
1796
|
|
|
1681
1797
|
// src/lib/mermaid/download-button.tsrx
|
|
1798
|
+
import { createElementFromConfig as _$createElementFromConfig7 } from "octane/internal/server";
|
|
1682
1799
|
import {
|
|
1683
|
-
createElement as _$createElement9,
|
|
1684
1800
|
createScopedElement as _$createScopedElement10,
|
|
1685
1801
|
createScopedValue as _$createScopedValue12,
|
|
1802
|
+
hookSlots as _$hookSlots13,
|
|
1686
1803
|
positionalChildren as _$positionalChildren5,
|
|
1687
1804
|
useContext as useContext9,
|
|
1688
1805
|
useEffect as useEffect5,
|
|
1689
1806
|
useRef as useRef5,
|
|
1690
|
-
useState as useState5
|
|
1807
|
+
useState as useState5,
|
|
1808
|
+
withSlot as _$withSlot11
|
|
1691
1809
|
} from "octane/server";
|
|
1692
1810
|
|
|
1693
1811
|
// src/lib/plugin-context.tsrx
|
|
1694
|
-
import {
|
|
1812
|
+
import {
|
|
1813
|
+
createContext as createContext6,
|
|
1814
|
+
hookSlots as _$hookSlots12,
|
|
1815
|
+
useContext as useContext8,
|
|
1816
|
+
withSlot as _$withSlot10
|
|
1817
|
+
} from "octane/server";
|
|
1818
|
+
var _hs$12 = /* @__PURE__ */ _$hookSlots12(5);
|
|
1819
|
+
var _h$012 = /* @__PURE__ */ Symbol(_hs$12);
|
|
1820
|
+
var _h$110 = /* @__PURE__ */ Symbol(_hs$12 + 1);
|
|
1821
|
+
var _h$28 = /* @__PURE__ */ Symbol(_hs$12 + 2);
|
|
1822
|
+
var _h$36 = /* @__PURE__ */ Symbol(_hs$12 + 3);
|
|
1823
|
+
var _h$45 = /* @__PURE__ */ Symbol(_hs$12 + 4);
|
|
1695
1824
|
var PluginContext = createContext6(null);
|
|
1696
1825
|
var usePlugins = () => useContext8(PluginContext);
|
|
1697
1826
|
var useCodePlugin = () => {
|
|
1698
|
-
const plugins = usePlugins
|
|
1827
|
+
const plugins = _$withSlot10(_h$012, usePlugins);
|
|
1699
1828
|
return plugins?.code ?? null;
|
|
1700
1829
|
};
|
|
1701
1830
|
var useMermaidPlugin = () => {
|
|
1702
|
-
const plugins = usePlugins
|
|
1831
|
+
const plugins = _$withSlot10(_h$110, usePlugins);
|
|
1703
1832
|
return plugins?.mermaid ?? null;
|
|
1704
1833
|
};
|
|
1705
1834
|
var useCustomRenderer = (language) => {
|
|
1706
|
-
const plugins = usePlugins
|
|
1835
|
+
const plugins = _$withSlot10(_h$45, usePlugins);
|
|
1707
1836
|
if (!(plugins?.renderers && language)) {
|
|
1708
1837
|
return null;
|
|
1709
1838
|
}
|
|
@@ -1743,14 +1872,22 @@ var svgToPngBlob = (svgString, options) => {
|
|
|
1743
1872
|
};
|
|
1744
1873
|
|
|
1745
1874
|
// src/lib/mermaid/download-button.tsrx
|
|
1875
|
+
var _hs$13 = /* @__PURE__ */ _$hookSlots13(7);
|
|
1876
|
+
var _h$013 = /* @__PURE__ */ Symbol(_hs$13);
|
|
1877
|
+
var _h$111 = /* @__PURE__ */ Symbol(_hs$13 + 1);
|
|
1878
|
+
var _h$29 = /* @__PURE__ */ Symbol(_hs$13 + 2);
|
|
1879
|
+
var _h$37 = /* @__PURE__ */ Symbol(_hs$13 + 3);
|
|
1880
|
+
var _h$46 = /* @__PURE__ */ Symbol(_hs$13 + 4);
|
|
1881
|
+
var _h$55 = /* @__PURE__ */ Symbol(_hs$13 + 5);
|
|
1882
|
+
var _h$65 = /* @__PURE__ */ Symbol(_hs$13 + 6);
|
|
1746
1883
|
var MermaidDownloadDropdown = ({ chart, children, className, onDownload, config, onError }) => {
|
|
1747
|
-
const cn2 = useCn
|
|
1748
|
-
const [isOpen, setIsOpen] = useState5(false);
|
|
1749
|
-
const dropdownRef = useRef5(null);
|
|
1884
|
+
const cn2 = _$withSlot11(_h$013, useCn);
|
|
1885
|
+
const [isOpen, setIsOpen] = useState5(false, _h$111);
|
|
1886
|
+
const dropdownRef = useRef5(null, _h$29);
|
|
1750
1887
|
const { isAnimating } = useContext9(StreamdownContext);
|
|
1751
|
-
const icons = useIcons
|
|
1752
|
-
const mermaidPlugin = useMermaidPlugin
|
|
1753
|
-
const t = useTranslations
|
|
1888
|
+
const icons = _$withSlot11(_h$37, useIcons);
|
|
1889
|
+
const mermaidPlugin = _$withSlot11(_h$46, useMermaidPlugin);
|
|
1890
|
+
const t = _$withSlot11(_h$55, useTranslations);
|
|
1754
1891
|
const downloadMermaid = async (format) => {
|
|
1755
1892
|
try {
|
|
1756
1893
|
if (format === "mmd") {
|
|
@@ -1810,7 +1947,8 @@ var MermaidDownloadDropdown = ({ chart, children, className, onDownload, config,
|
|
|
1810
1947
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1811
1948
|
};
|
|
1812
1949
|
},
|
|
1813
|
-
[]
|
|
1950
|
+
[],
|
|
1951
|
+
_h$65
|
|
1814
1952
|
);
|
|
1815
1953
|
return _$createScopedValue12(() => _$createScopedElement10("div", { className: cn2("relative"), ref: dropdownRef }, () => _$positionalChildren5([
|
|
1816
1954
|
_$createScopedValue12(() => _$createScopedElement10(
|
|
@@ -1822,7 +1960,7 @@ var MermaidDownloadDropdown = ({ chart, children, className, onDownload, config,
|
|
|
1822
1960
|
title: t.downloadDiagram,
|
|
1823
1961
|
type: "button"
|
|
1824
1962
|
},
|
|
1825
|
-
() => children ?? _$createScopedValue12(() => _$
|
|
1963
|
+
() => children ?? _$createScopedValue12(() => _$createElementFromConfig7("c:43d7362c", icons.DownloadIcon, { size: 14 }))
|
|
1826
1964
|
)),
|
|
1827
1965
|
isOpen ? _$createScopedValue12(() => _$createScopedElement10(
|
|
1828
1966
|
"div",
|
|
@@ -1868,21 +2006,30 @@ var MermaidDownloadDropdown = ({ chart, children, className, onDownload, config,
|
|
|
1868
2006
|
// src/lib/mermaid/fullscreen-button.tsrx
|
|
1869
2007
|
import {
|
|
1870
2008
|
Fragment as _$Fragment2,
|
|
1871
|
-
createElement as _$createElement10,
|
|
1872
2009
|
createPortal,
|
|
1873
2010
|
createScopedElement as _$createScopedElement11,
|
|
1874
2011
|
createScopedValue as _$createScopedValue13,
|
|
2012
|
+
hookSlots as _$hookSlots14,
|
|
1875
2013
|
positionalChildren as _$positionalChildren6,
|
|
1876
2014
|
useContext as useContext10,
|
|
1877
2015
|
useEffect as useEffect6,
|
|
1878
|
-
useState as useState6
|
|
2016
|
+
useState as useState6,
|
|
2017
|
+
withSlot as _$withSlot12
|
|
1879
2018
|
} from "octane/server";
|
|
2019
|
+
import { createElementFromConfig as _$createElementFromConfig8 } from "octane/internal/server";
|
|
2020
|
+
var _hs$14 = /* @__PURE__ */ _$hookSlots14(6);
|
|
2021
|
+
var _h$014 = /* @__PURE__ */ Symbol(_hs$14);
|
|
2022
|
+
var _h$112 = /* @__PURE__ */ Symbol(_hs$14 + 1);
|
|
2023
|
+
var _h$210 = /* @__PURE__ */ Symbol(_hs$14 + 2);
|
|
2024
|
+
var _h$38 = /* @__PURE__ */ Symbol(_hs$14 + 3);
|
|
2025
|
+
var _h$47 = /* @__PURE__ */ Symbol(_hs$14 + 4);
|
|
2026
|
+
var _h$56 = /* @__PURE__ */ Symbol(_hs$14 + 5);
|
|
1880
2027
|
var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className, ...props }) => {
|
|
1881
|
-
const { Maximize2Icon: Maximize2Icon2, XIcon: XIcon2 } = useIcons
|
|
1882
|
-
const cn2 = useCn
|
|
1883
|
-
const [isFullscreen, setIsFullscreen] = useState6(false);
|
|
2028
|
+
const { Maximize2Icon: Maximize2Icon2, XIcon: XIcon2 } = _$withSlot12(_h$014, useIcons);
|
|
2029
|
+
const cn2 = _$withSlot12(_h$112, useCn);
|
|
2030
|
+
const [isFullscreen, setIsFullscreen] = useState6(false, _h$210);
|
|
1884
2031
|
const { isAnimating, controls: controlsConfig } = useContext10(StreamdownContext);
|
|
1885
|
-
const t = useTranslations
|
|
2032
|
+
const t = _$withSlot12(_h$38, useTranslations);
|
|
1886
2033
|
const showPanZoomControls = (() => {
|
|
1887
2034
|
if (typeof controlsConfig === "boolean") {
|
|
1888
2035
|
return controlsConfig;
|
|
@@ -1915,7 +2062,8 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1915
2062
|
};
|
|
1916
2063
|
}
|
|
1917
2064
|
},
|
|
1918
|
-
[isFullscreen]
|
|
2065
|
+
[isFullscreen],
|
|
2066
|
+
_h$47
|
|
1919
2067
|
);
|
|
1920
2068
|
useEffect6(
|
|
1921
2069
|
() => {
|
|
@@ -1925,7 +2073,8 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1925
2073
|
onExit();
|
|
1926
2074
|
}
|
|
1927
2075
|
},
|
|
1928
|
-
[isFullscreen, onFullscreen, onExit]
|
|
2076
|
+
[isFullscreen, onFullscreen, onExit],
|
|
2077
|
+
_h$56
|
|
1929
2078
|
);
|
|
1930
2079
|
return _$createScopedElement11(_$Fragment2, {}, () => _$positionalChildren6([
|
|
1931
2080
|
_$createScopedValue13(() => _$createScopedElement11(
|
|
@@ -1938,7 +2087,7 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1938
2087
|
type: "button",
|
|
1939
2088
|
...props
|
|
1940
2089
|
},
|
|
1941
|
-
() => _$
|
|
2090
|
+
() => _$createElementFromConfig8("c:9e767713", Maximize2Icon2, { size: 14 })
|
|
1942
2091
|
)),
|
|
1943
2092
|
isFullscreen ? createPortal(
|
|
1944
2093
|
_$createScopedValue13(() => _$createScopedElement11(
|
|
@@ -1963,7 +2112,7 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1963
2112
|
title: t.exitFullscreen,
|
|
1964
2113
|
type: "button"
|
|
1965
2114
|
},
|
|
1966
|
-
() => _$
|
|
2115
|
+
() => _$createElementFromConfig8("c:67dc7e4f", XIcon2, { size: 20 })
|
|
1967
2116
|
)),
|
|
1968
2117
|
_$createScopedValue13(() => _$createScopedElement11(
|
|
1969
2118
|
"div",
|
|
@@ -1973,7 +2122,7 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1973
2122
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1974
2123
|
role: "presentation"
|
|
1975
2124
|
},
|
|
1976
|
-
() => _$createScopedValue13(() => _$
|
|
2125
|
+
() => _$createScopedValue13(() => _$createElementFromConfig8("c:f35e3414", Mermaid, {
|
|
1977
2126
|
chart,
|
|
1978
2127
|
className: cn2("size-full [&_svg]:h-auto [&_svg]:w-auto"),
|
|
1979
2128
|
config,
|
|
@@ -1989,23 +2138,27 @@ var MermaidFullscreenButton = ({ chart, config, onFullscreen, onExit, className,
|
|
|
1989
2138
|
};
|
|
1990
2139
|
|
|
1991
2140
|
// src/lib/table/index.tsrx
|
|
2141
|
+
import { createElementFromConfig as _$createElementFromConfig12 } from "octane/internal/server";
|
|
1992
2142
|
import {
|
|
1993
|
-
createElement as _$createElement14,
|
|
1994
2143
|
createScopedElement as _$createScopedElement15,
|
|
1995
2144
|
createScopedValue as _$createScopedValue17,
|
|
1996
|
-
|
|
2145
|
+
hookSlots as _$hookSlots18,
|
|
2146
|
+
positionalChildren as _$positionalChildren10,
|
|
2147
|
+
withSlot as _$withSlot16
|
|
1997
2148
|
} from "octane/server";
|
|
1998
2149
|
|
|
1999
2150
|
// src/lib/table/copy-dropdown.tsrx
|
|
2151
|
+
import { createElementFromConfig as _$createElementFromConfig9 } from "octane/internal/server";
|
|
2000
2152
|
import {
|
|
2001
|
-
createElement as _$createElement11,
|
|
2002
2153
|
createScopedElement as _$createScopedElement12,
|
|
2003
2154
|
createScopedValue as _$createScopedValue14,
|
|
2155
|
+
hookSlots as _$hookSlots15,
|
|
2004
2156
|
positionalChildren as _$positionalChildren7,
|
|
2005
2157
|
useContext as useContext11,
|
|
2006
2158
|
useEffect as useEffect7,
|
|
2007
2159
|
useRef as useRef6,
|
|
2008
|
-
useState as useState7
|
|
2160
|
+
useState as useState7,
|
|
2161
|
+
withSlot as _$withSlot13
|
|
2009
2162
|
} from "octane/server";
|
|
2010
2163
|
|
|
2011
2164
|
// src/lib/table/utils.ts
|
|
@@ -2162,14 +2315,23 @@ var tableDataToMarkdown = (data) => {
|
|
|
2162
2315
|
};
|
|
2163
2316
|
|
|
2164
2317
|
// src/lib/table/copy-dropdown.tsrx
|
|
2318
|
+
var _hs$15 = /* @__PURE__ */ _$hookSlots15(8);
|
|
2319
|
+
var _h$015 = /* @__PURE__ */ Symbol(_hs$15);
|
|
2320
|
+
var _h$113 = /* @__PURE__ */ Symbol(_hs$15 + 1);
|
|
2321
|
+
var _h$211 = /* @__PURE__ */ Symbol(_hs$15 + 2);
|
|
2322
|
+
var _h$39 = /* @__PURE__ */ Symbol(_hs$15 + 3);
|
|
2323
|
+
var _h$48 = /* @__PURE__ */ Symbol(_hs$15 + 4);
|
|
2324
|
+
var _h$57 = /* @__PURE__ */ Symbol(_hs$15 + 5);
|
|
2325
|
+
var _h$66 = /* @__PURE__ */ Symbol(_hs$15 + 6);
|
|
2326
|
+
var _h$73 = /* @__PURE__ */ Symbol(_hs$15 + 7);
|
|
2165
2327
|
var TableCopyDropdown = ({ children, className, onCopy, onError, timeout = 2e3 }) => {
|
|
2166
|
-
const cn2 = useCn
|
|
2167
|
-
const [isOpen, setIsOpen] = useState7(false);
|
|
2168
|
-
const [isCopied, setIsCopied] = useState7(false);
|
|
2169
|
-
const dropdownRef = useRef6(null);
|
|
2170
|
-
const timeoutRef = useRef6(0);
|
|
2328
|
+
const cn2 = _$withSlot13(_h$015, useCn);
|
|
2329
|
+
const [isOpen, setIsOpen] = useState7(false, _h$113);
|
|
2330
|
+
const [isCopied, setIsCopied] = useState7(false, _h$211);
|
|
2331
|
+
const dropdownRef = useRef6(null, _h$39);
|
|
2332
|
+
const timeoutRef = useRef6(0, _h$48);
|
|
2171
2333
|
const { isAnimating } = useContext11(StreamdownContext);
|
|
2172
|
-
const t = useTranslations
|
|
2334
|
+
const t = _$withSlot13(_h$57, useTranslations);
|
|
2173
2335
|
const copyTableData = async (format) => {
|
|
2174
2336
|
if (typeof window === "undefined" || !navigator?.clipboard?.write) {
|
|
2175
2337
|
onError?.(new Error("Clipboard API not available"));
|
|
@@ -2216,9 +2378,10 @@ var TableCopyDropdown = ({ children, className, onCopy, onError, timeout = 2e3 }
|
|
|
2216
2378
|
window.clearTimeout(timeoutRef.current);
|
|
2217
2379
|
};
|
|
2218
2380
|
},
|
|
2219
|
-
[]
|
|
2381
|
+
[],
|
|
2382
|
+
_h$66
|
|
2220
2383
|
);
|
|
2221
|
-
const icons = useIcons
|
|
2384
|
+
const icons = _$withSlot13(_h$73, useIcons);
|
|
2222
2385
|
const Icon = isCopied ? icons.CheckIcon : icons.CopyIcon;
|
|
2223
2386
|
return _$createScopedValue14(() => _$createScopedElement12("div", { className: cn2("relative"), ref: dropdownRef }, () => _$positionalChildren7([
|
|
2224
2387
|
_$createScopedValue14(() => _$createScopedElement12(
|
|
@@ -2230,7 +2393,7 @@ var TableCopyDropdown = ({ children, className, onCopy, onError, timeout = 2e3 }
|
|
|
2230
2393
|
title: t.copyTable,
|
|
2231
2394
|
type: "button"
|
|
2232
2395
|
},
|
|
2233
|
-
() => children ?? _$
|
|
2396
|
+
() => children ?? _$createElementFromConfig9("c:c05b4554", Icon, { height: 14, width: 14 })
|
|
2234
2397
|
)),
|
|
2235
2398
|
isOpen ? _$createScopedValue14(() => _$createScopedElement12(
|
|
2236
2399
|
"div",
|
|
@@ -2274,16 +2437,28 @@ var TableCopyDropdown = ({ children, className, onCopy, onError, timeout = 2e3 }
|
|
|
2274
2437
|
};
|
|
2275
2438
|
|
|
2276
2439
|
// src/lib/table/download-dropdown.tsrx
|
|
2440
|
+
import { createElementFromConfig as _$createElementFromConfig10 } from "octane/internal/server";
|
|
2277
2441
|
import {
|
|
2278
|
-
createElement as _$createElement12,
|
|
2279
2442
|
createScopedElement as _$createScopedElement13,
|
|
2280
2443
|
createScopedValue as _$createScopedValue15,
|
|
2444
|
+
hookSlots as _$hookSlots16,
|
|
2281
2445
|
positionalChildren as _$positionalChildren8,
|
|
2282
2446
|
useContext as useContext12,
|
|
2283
2447
|
useEffect as useEffect8,
|
|
2284
2448
|
useRef as useRef7,
|
|
2285
|
-
useState as useState8
|
|
2449
|
+
useState as useState8,
|
|
2450
|
+
withSlot as _$withSlot14
|
|
2286
2451
|
} from "octane/server";
|
|
2452
|
+
var _hs$16 = /* @__PURE__ */ _$hookSlots16(9);
|
|
2453
|
+
var _h$016 = /* @__PURE__ */ Symbol(_hs$16);
|
|
2454
|
+
var _h$114 = /* @__PURE__ */ Symbol(_hs$16 + 1);
|
|
2455
|
+
var _h$212 = /* @__PURE__ */ Symbol(_hs$16 + 2);
|
|
2456
|
+
var _h$310 = /* @__PURE__ */ Symbol(_hs$16 + 3);
|
|
2457
|
+
var _h$49 = /* @__PURE__ */ Symbol(_hs$16 + 4);
|
|
2458
|
+
var _h$58 = /* @__PURE__ */ Symbol(_hs$16 + 5);
|
|
2459
|
+
var _h$67 = /* @__PURE__ */ Symbol(_hs$16 + 6);
|
|
2460
|
+
var _h$74 = /* @__PURE__ */ Symbol(_hs$16 + 7);
|
|
2461
|
+
var _h$8 = /* @__PURE__ */ Symbol(_hs$16 + 8);
|
|
2287
2462
|
var TableDownloadButton = ({
|
|
2288
2463
|
children,
|
|
2289
2464
|
className,
|
|
@@ -2292,10 +2467,10 @@ var TableDownloadButton = ({
|
|
|
2292
2467
|
format = "csv",
|
|
2293
2468
|
filename
|
|
2294
2469
|
}) => {
|
|
2295
|
-
const cn2 = useCn
|
|
2470
|
+
const cn2 = _$withSlot14(_h$016, useCn);
|
|
2296
2471
|
const { isAnimating } = useContext12(StreamdownContext);
|
|
2297
|
-
const t = useTranslations
|
|
2298
|
-
const icons = useIcons
|
|
2472
|
+
const t = _$withSlot14(_h$114, useTranslations);
|
|
2473
|
+
const icons = _$withSlot14(_h$212, useIcons);
|
|
2299
2474
|
const downloadTableData = (event) => {
|
|
2300
2475
|
try {
|
|
2301
2476
|
const tableElement = findTableForControl(event.currentTarget);
|
|
@@ -2338,16 +2513,16 @@ var TableDownloadButton = ({
|
|
|
2338
2513
|
title: format === "csv" ? t.downloadTableAsCsv : t.downloadTableAsMarkdown,
|
|
2339
2514
|
type: "button"
|
|
2340
2515
|
},
|
|
2341
|
-
() => children ?? _$createScopedValue15(() => _$
|
|
2516
|
+
() => children ?? _$createScopedValue15(() => _$createElementFromConfig10("c:8bf08d42", icons.DownloadIcon, { size: 14 }))
|
|
2342
2517
|
));
|
|
2343
2518
|
};
|
|
2344
2519
|
var TableDownloadDropdown = ({ children, className, onDownload, onError }) => {
|
|
2345
|
-
const cn2 = useCn
|
|
2346
|
-
const [isOpen, setIsOpen] = useState8(false);
|
|
2347
|
-
const dropdownRef = useRef7(null);
|
|
2520
|
+
const cn2 = _$withSlot14(_h$310, useCn);
|
|
2521
|
+
const [isOpen, setIsOpen] = useState8(false, _h$49);
|
|
2522
|
+
const dropdownRef = useRef7(null, _h$58);
|
|
2348
2523
|
const { isAnimating } = useContext12(StreamdownContext);
|
|
2349
|
-
const t = useTranslations
|
|
2350
|
-
const icons = useIcons
|
|
2524
|
+
const t = _$withSlot14(_h$67, useTranslations);
|
|
2525
|
+
const icons = _$withSlot14(_h$74, useIcons);
|
|
2351
2526
|
const downloadTableData = (format) => {
|
|
2352
2527
|
try {
|
|
2353
2528
|
const tableElement = findTableForControl(dropdownRef.current);
|
|
@@ -2380,7 +2555,8 @@ var TableDownloadDropdown = ({ children, className, onDownload, onError }) => {
|
|
|
2380
2555
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2381
2556
|
};
|
|
2382
2557
|
},
|
|
2383
|
-
[]
|
|
2558
|
+
[],
|
|
2559
|
+
_h$8
|
|
2384
2560
|
);
|
|
2385
2561
|
return _$createScopedValue15(() => _$createScopedElement13("div", { className: cn2("relative"), ref: dropdownRef }, () => _$positionalChildren8([
|
|
2386
2562
|
_$createScopedValue15(() => _$createScopedElement13(
|
|
@@ -2392,7 +2568,7 @@ var TableDownloadDropdown = ({ children, className, onDownload, onError }) => {
|
|
|
2392
2568
|
title: t.downloadTable,
|
|
2393
2569
|
type: "button"
|
|
2394
2570
|
},
|
|
2395
|
-
() => children ?? _$createScopedValue15(() => _$
|
|
2571
|
+
() => children ?? _$createScopedValue15(() => _$createElementFromConfig10("c:b748805c", icons.DownloadIcon, { size: 14 }))
|
|
2396
2572
|
)),
|
|
2397
2573
|
isOpen ? _$createScopedValue15(() => _$createScopedElement13(
|
|
2398
2574
|
"div",
|
|
@@ -2428,21 +2604,29 @@ var TableDownloadDropdown = ({ children, className, onDownload, onError }) => {
|
|
|
2428
2604
|
// src/lib/table/fullscreen-button.tsrx
|
|
2429
2605
|
import {
|
|
2430
2606
|
Fragment as _$Fragment3,
|
|
2431
|
-
createElement as _$createElement13,
|
|
2432
2607
|
createPortal as createPortal2,
|
|
2433
2608
|
createScopedElement as _$createScopedElement14,
|
|
2434
2609
|
createScopedValue as _$createScopedValue16,
|
|
2610
|
+
hookSlots as _$hookSlots17,
|
|
2435
2611
|
positionalChildren as _$positionalChildren9,
|
|
2436
2612
|
useContext as useContext13,
|
|
2437
2613
|
useEffect as useEffect9,
|
|
2438
|
-
useState as useState9
|
|
2614
|
+
useState as useState9,
|
|
2615
|
+
withSlot as _$withSlot15
|
|
2439
2616
|
} from "octane/server";
|
|
2617
|
+
import { createElementFromConfig as _$createElementFromConfig11 } from "octane/internal/server";
|
|
2618
|
+
var _hs$17 = /* @__PURE__ */ _$hookSlots17(5);
|
|
2619
|
+
var _h$017 = /* @__PURE__ */ Symbol(_hs$17);
|
|
2620
|
+
var _h$115 = /* @__PURE__ */ Symbol(_hs$17 + 1);
|
|
2621
|
+
var _h$213 = /* @__PURE__ */ Symbol(_hs$17 + 2);
|
|
2622
|
+
var _h$311 = /* @__PURE__ */ Symbol(_hs$17 + 3);
|
|
2623
|
+
var _h$410 = /* @__PURE__ */ Symbol(_hs$17 + 4);
|
|
2440
2624
|
var TableFullscreenButton = ({ children, className, showCopy = true, showDownload = true }) => {
|
|
2441
|
-
const { Maximize2Icon: Maximize2Icon2, XIcon: XIcon2 } = useIcons
|
|
2442
|
-
const cn2 = useCn
|
|
2443
|
-
const [isFullscreen, setIsFullscreen] = useState9(false);
|
|
2625
|
+
const { Maximize2Icon: Maximize2Icon2, XIcon: XIcon2 } = _$withSlot15(_h$017, useIcons);
|
|
2626
|
+
const cn2 = _$withSlot15(_h$115, useCn);
|
|
2627
|
+
const [isFullscreen, setIsFullscreen] = useState9(false, _h$213);
|
|
2444
2628
|
const { isAnimating } = useContext13(StreamdownContext);
|
|
2445
|
-
const t = useTranslations
|
|
2629
|
+
const t = _$withSlot15(_h$311, useTranslations);
|
|
2446
2630
|
const handleOpen = () => {
|
|
2447
2631
|
setIsFullscreen(true);
|
|
2448
2632
|
};
|
|
@@ -2465,7 +2649,8 @@ var TableFullscreenButton = ({ children, className, showCopy = true, showDownloa
|
|
|
2465
2649
|
};
|
|
2466
2650
|
}
|
|
2467
2651
|
},
|
|
2468
|
-
[isFullscreen]
|
|
2652
|
+
[isFullscreen],
|
|
2653
|
+
_h$410
|
|
2469
2654
|
);
|
|
2470
2655
|
return _$createScopedElement14(_$Fragment3, {}, () => _$positionalChildren9([
|
|
2471
2656
|
_$createScopedValue16(() => _$createScopedElement14(
|
|
@@ -2477,7 +2662,7 @@ var TableFullscreenButton = ({ children, className, showCopy = true, showDownloa
|
|
|
2477
2662
|
title: t.viewFullscreen,
|
|
2478
2663
|
type: "button"
|
|
2479
2664
|
},
|
|
2480
|
-
() => _$
|
|
2665
|
+
() => _$createElementFromConfig11("c:06098222", Maximize2Icon2, { size: 14 })
|
|
2481
2666
|
)),
|
|
2482
2667
|
isFullscreen ? createPortal2(
|
|
2483
2668
|
_$createScopedValue16(() => _$createScopedElement14(
|
|
@@ -2505,8 +2690,8 @@ var TableFullscreenButton = ({ children, className, showCopy = true, showDownloa
|
|
|
2505
2690
|
},
|
|
2506
2691
|
() => _$positionalChildren9([
|
|
2507
2692
|
_$createScopedValue16(() => _$createScopedElement14("div", { className: cn2("flex items-center justify-end gap-1 p-4") }, () => _$positionalChildren9([
|
|
2508
|
-
showCopy ? _$
|
|
2509
|
-
showDownload ? _$
|
|
2693
|
+
showCopy ? _$createElementFromConfig11("c:ea761060", TableCopyDropdown, {}) : null,
|
|
2694
|
+
showDownload ? _$createElementFromConfig11("c:01eb7b5a", TableDownloadDropdown, {}) : null,
|
|
2510
2695
|
_$createScopedValue16(() => _$createScopedElement14(
|
|
2511
2696
|
"button",
|
|
2512
2697
|
{
|
|
@@ -2515,7 +2700,7 @@ var TableFullscreenButton = ({ children, className, showCopy = true, showDownloa
|
|
|
2515
2700
|
title: t.exitFullscreen,
|
|
2516
2701
|
type: "button"
|
|
2517
2702
|
},
|
|
2518
|
-
() => _$
|
|
2703
|
+
() => _$createElementFromConfig11("c:6341d405", XIcon2, { size: 20 })
|
|
2519
2704
|
))
|
|
2520
2705
|
]))),
|
|
2521
2706
|
_$createScopedValue16(() => _$createScopedElement14(
|
|
@@ -2541,6 +2726,8 @@ var TableFullscreenButton = ({ children, className, showCopy = true, showDownloa
|
|
|
2541
2726
|
};
|
|
2542
2727
|
|
|
2543
2728
|
// src/lib/table/index.tsrx
|
|
2729
|
+
var _hs$18 = /* @__PURE__ */ _$hookSlots18(1);
|
|
2730
|
+
var _h$018 = /* @__PURE__ */ Symbol(_hs$18);
|
|
2544
2731
|
var Table = ({
|
|
2545
2732
|
children,
|
|
2546
2733
|
className,
|
|
@@ -2550,7 +2737,7 @@ var Table = ({
|
|
|
2550
2737
|
showFullscreen = true,
|
|
2551
2738
|
...props
|
|
2552
2739
|
}) => {
|
|
2553
|
-
const cn2 = useCn
|
|
2740
|
+
const cn2 = _$withSlot16(_h$018, useCn);
|
|
2554
2741
|
const hasCopy = showControls && showCopy;
|
|
2555
2742
|
const hasDownload = showControls && showDownload;
|
|
2556
2743
|
const hasFullscreen = showControls && showFullscreen;
|
|
@@ -2563,9 +2750,9 @@ var Table = ({
|
|
|
2563
2750
|
},
|
|
2564
2751
|
() => _$positionalChildren10([
|
|
2565
2752
|
hasAnyControl ? _$createScopedValue17(() => _$createScopedElement15("div", { className: cn2("flex items-center justify-end gap-1") }, () => _$positionalChildren10([
|
|
2566
|
-
hasCopy ? _$
|
|
2567
|
-
hasDownload ? _$
|
|
2568
|
-
hasFullscreen ? _$createScopedValue17(() => _$createScopedElement15(TableFullscreenButton, { showCopy: hasCopy, showDownload: hasDownload }, () => children)) : null
|
|
2753
|
+
hasCopy ? _$createElementFromConfig12("c:00fe617c", TableCopyDropdown, {}) : null,
|
|
2754
|
+
hasDownload ? _$createElementFromConfig12("c:b652fccb", TableDownloadDropdown, {}) : null,
|
|
2755
|
+
hasFullscreen ? _$createScopedValue17(() => _$createScopedElement15(TableFullscreenButton, { showCopy: hasCopy, showDownload: hasDownload }, () => children, "c:2f548659")) : null
|
|
2569
2756
|
]))) : null,
|
|
2570
2757
|
_$createScopedValue17(() => _$createScopedElement15(
|
|
2571
2758
|
"div",
|
|
@@ -2587,9 +2774,38 @@ var Table = ({
|
|
|
2587
2774
|
};
|
|
2588
2775
|
|
|
2589
2776
|
// src/lib/components.tsrx
|
|
2777
|
+
var _hs$19 = /* @__PURE__ */ _$hookSlots19(28);
|
|
2778
|
+
var _h$019 = /* @__PURE__ */ Symbol(_hs$19);
|
|
2779
|
+
var _h$116 = /* @__PURE__ */ Symbol(_hs$19 + 1);
|
|
2780
|
+
var _h$214 = /* @__PURE__ */ Symbol(_hs$19 + 2);
|
|
2781
|
+
var _h$312 = /* @__PURE__ */ Symbol(_hs$19 + 3);
|
|
2782
|
+
var _h$411 = /* @__PURE__ */ Symbol(_hs$19 + 4);
|
|
2783
|
+
var _h$59 = /* @__PURE__ */ Symbol(_hs$19 + 5);
|
|
2784
|
+
var _h$68 = /* @__PURE__ */ Symbol(_hs$19 + 6);
|
|
2785
|
+
var _h$75 = /* @__PURE__ */ Symbol(_hs$19 + 7);
|
|
2786
|
+
var _h$82 = /* @__PURE__ */ Symbol(_hs$19 + 8);
|
|
2787
|
+
var _h$9 = /* @__PURE__ */ Symbol(_hs$19 + 9);
|
|
2788
|
+
var _h$10 = /* @__PURE__ */ Symbol(_hs$19 + 10);
|
|
2789
|
+
var _h$11 = /* @__PURE__ */ Symbol(_hs$19 + 11);
|
|
2790
|
+
var _h$122 = /* @__PURE__ */ Symbol(_hs$19 + 12);
|
|
2791
|
+
var _h$132 = /* @__PURE__ */ Symbol(_hs$19 + 13);
|
|
2792
|
+
var _h$142 = /* @__PURE__ */ Symbol(_hs$19 + 14);
|
|
2793
|
+
var _h$152 = /* @__PURE__ */ Symbol(_hs$19 + 15);
|
|
2794
|
+
var _h$162 = /* @__PURE__ */ Symbol(_hs$19 + 16);
|
|
2795
|
+
var _h$172 = /* @__PURE__ */ Symbol(_hs$19 + 17);
|
|
2796
|
+
var _h$182 = /* @__PURE__ */ Symbol(_hs$19 + 18);
|
|
2797
|
+
var _h$192 = /* @__PURE__ */ Symbol(_hs$19 + 19);
|
|
2798
|
+
var _h$20 = /* @__PURE__ */ Symbol(_hs$19 + 20);
|
|
2799
|
+
var _h$21 = /* @__PURE__ */ Symbol(_hs$19 + 21);
|
|
2800
|
+
var _h$222 = /* @__PURE__ */ Symbol(_hs$19 + 22);
|
|
2801
|
+
var _h$232 = /* @__PURE__ */ Symbol(_hs$19 + 23);
|
|
2802
|
+
var _h$242 = /* @__PURE__ */ Symbol(_hs$19 + 24);
|
|
2803
|
+
var _h$252 = /* @__PURE__ */ Symbol(_hs$19 + 25);
|
|
2804
|
+
var _h$262 = /* @__PURE__ */ Symbol(_hs$19 + 26);
|
|
2805
|
+
var _h$272 = /* @__PURE__ */ Symbol(_hs$19 + 27);
|
|
2590
2806
|
var START_LINE_PATTERN = /startLine=(\d+)/;
|
|
2591
2807
|
var NO_LINE_NUMBERS_PATTERN = /\bnoLineNumbers\b/;
|
|
2592
|
-
var Mermaid2 = /* @__PURE__ */ lazy2(() => import("./mermaid-
|
|
2808
|
+
var Mermaid2 = /* @__PURE__ */ lazy2(() => import("./mermaid-EGA7TDDR.js").then((mod) => ({ default: mod.Mermaid })));
|
|
2593
2809
|
var LANGUAGE_REGEX = /language-([^\s]+)/;
|
|
2594
2810
|
function sameNodePosition(prev, next) {
|
|
2595
2811
|
if (!(prev?.position || next?.position)) {
|
|
@@ -2654,7 +2870,7 @@ var shouldShowMermaidControl = (config, controlType) => {
|
|
|
2654
2870
|
};
|
|
2655
2871
|
var MemoOl = memo2(
|
|
2656
2872
|
({ children, className, node, ...props }) => {
|
|
2657
|
-
const cn2 = useCn
|
|
2873
|
+
const cn2 = _$withSlot17(_h$019, useCn);
|
|
2658
2874
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2659
2875
|
"ol",
|
|
2660
2876
|
{
|
|
@@ -2670,7 +2886,7 @@ var MemoOl = memo2(
|
|
|
2670
2886
|
Object.assign(MemoOl, { displayName: "MarkdownOl" });
|
|
2671
2887
|
var MemoLi = memo2(
|
|
2672
2888
|
({ children, className, node, ...props }) => {
|
|
2673
|
-
const cn2 = useCn
|
|
2889
|
+
const cn2 = _$withSlot17(_h$116, useCn);
|
|
2674
2890
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2675
2891
|
"li",
|
|
2676
2892
|
{
|
|
@@ -2686,7 +2902,7 @@ var MemoLi = memo2(
|
|
|
2686
2902
|
Object.assign(MemoLi, { displayName: "MarkdownLi" });
|
|
2687
2903
|
var MemoUl = memo2(
|
|
2688
2904
|
({ children, className, node, ...props }) => {
|
|
2689
|
-
const cn2 = useCn
|
|
2905
|
+
const cn2 = _$withSlot17(_h$214, useCn);
|
|
2690
2906
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2691
2907
|
"ul",
|
|
2692
2908
|
{
|
|
@@ -2702,8 +2918,8 @@ var MemoUl = memo2(
|
|
|
2702
2918
|
Object.assign(MemoUl, { displayName: "MarkdownUl" });
|
|
2703
2919
|
var MemoHr = memo2(
|
|
2704
2920
|
({ className, node, ...props }) => {
|
|
2705
|
-
const cn2 = useCn
|
|
2706
|
-
return _$createScopedValue18(() => _$
|
|
2921
|
+
const cn2 = _$withSlot17(_h$312, useCn);
|
|
2922
|
+
return _$createScopedValue18(() => _$createElement5("hr", {
|
|
2707
2923
|
className: cn2("my-6 border-border", className),
|
|
2708
2924
|
"data-streamdown": "horizontal-rule",
|
|
2709
2925
|
...props
|
|
@@ -2714,7 +2930,7 @@ var MemoHr = memo2(
|
|
|
2714
2930
|
Object.assign(MemoHr, { displayName: "MarkdownHr" });
|
|
2715
2931
|
var MemoStrong = memo2(
|
|
2716
2932
|
({ children, className, node, ...props }) => {
|
|
2717
|
-
const cn2 = useCn
|
|
2933
|
+
const cn2 = _$withSlot17(_h$411, useCn);
|
|
2718
2934
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2719
2935
|
"span",
|
|
2720
2936
|
{
|
|
@@ -2729,9 +2945,9 @@ var MemoStrong = memo2(
|
|
|
2729
2945
|
);
|
|
2730
2946
|
Object.assign(MemoStrong, { displayName: "MarkdownStrong" });
|
|
2731
2947
|
var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
2732
|
-
const cn2 = useCn
|
|
2948
|
+
const cn2 = _$withSlot17(_h$59, useCn);
|
|
2733
2949
|
const { linkSafety } = useContext14(StreamdownContext);
|
|
2734
|
-
const [isModalOpen, setIsModalOpen] = useState10(false);
|
|
2950
|
+
const [isModalOpen, setIsModalOpen] = useState10(false, _h$68);
|
|
2735
2951
|
const isIncomplete = href === "streamdown:incomplete-link";
|
|
2736
2952
|
const handleClick = useCallback3(
|
|
2737
2953
|
async (e) => {
|
|
@@ -2748,7 +2964,8 @@ var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
|
2748
2964
|
}
|
|
2749
2965
|
setIsModalOpen(true);
|
|
2750
2966
|
},
|
|
2751
|
-
[linkSafety, href, isIncomplete]
|
|
2967
|
+
[linkSafety, href, isIncomplete],
|
|
2968
|
+
_h$75
|
|
2752
2969
|
);
|
|
2753
2970
|
const handleConfirm = useCallback3(
|
|
2754
2971
|
() => {
|
|
@@ -2756,13 +2973,15 @@ var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
|
2756
2973
|
window.open(href, "_blank", "noreferrer");
|
|
2757
2974
|
}
|
|
2758
2975
|
},
|
|
2759
|
-
[href]
|
|
2976
|
+
[href],
|
|
2977
|
+
_h$82
|
|
2760
2978
|
);
|
|
2761
2979
|
const handleCloseModal = useCallback3(
|
|
2762
2980
|
() => {
|
|
2763
2981
|
setIsModalOpen(false);
|
|
2764
2982
|
},
|
|
2765
|
-
[]
|
|
2983
|
+
[],
|
|
2984
|
+
_h$9
|
|
2766
2985
|
);
|
|
2767
2986
|
const modalProps = {
|
|
2768
2987
|
url: href ?? "",
|
|
@@ -2783,7 +3002,7 @@ var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
|
2783
3002
|
},
|
|
2784
3003
|
() => children
|
|
2785
3004
|
)),
|
|
2786
|
-
linkSafety.renderModal ? linkSafety.renderModal(modalProps) : _$createScopedValue18(() => _$
|
|
3005
|
+
linkSafety.renderModal ? linkSafety.renderModal(modalProps) : _$createScopedValue18(() => _$createElementFromConfig13("c:5b3f51d7", LinkSafetyModal, { ...modalProps }))
|
|
2787
3006
|
]));
|
|
2788
3007
|
}
|
|
2789
3008
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
@@ -2804,7 +3023,7 @@ var MemoA = memo2(LinkComponent, (p, n) => sameClassAndNode(p, n) && p.href ===
|
|
|
2804
3023
|
Object.assign(MemoA, { displayName: "MarkdownA" });
|
|
2805
3024
|
var MemoH1 = memo2(
|
|
2806
3025
|
({ children, className, node, ...props }) => {
|
|
2807
|
-
const cn2 = useCn
|
|
3026
|
+
const cn2 = _$withSlot17(_h$10, useCn);
|
|
2808
3027
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2809
3028
|
"h1",
|
|
2810
3029
|
{
|
|
@@ -2820,7 +3039,7 @@ var MemoH1 = memo2(
|
|
|
2820
3039
|
Object.assign(MemoH1, { displayName: "MarkdownH1" });
|
|
2821
3040
|
var MemoH2 = memo2(
|
|
2822
3041
|
({ children, className, node, ...props }) => {
|
|
2823
|
-
const cn2 = useCn
|
|
3042
|
+
const cn2 = _$withSlot17(_h$11, useCn);
|
|
2824
3043
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2825
3044
|
"h2",
|
|
2826
3045
|
{
|
|
@@ -2836,7 +3055,7 @@ var MemoH2 = memo2(
|
|
|
2836
3055
|
Object.assign(MemoH2, { displayName: "MarkdownH2" });
|
|
2837
3056
|
var MemoH3 = memo2(
|
|
2838
3057
|
({ children, className, node, ...props }) => {
|
|
2839
|
-
const cn2 = useCn
|
|
3058
|
+
const cn2 = _$withSlot17(_h$122, useCn);
|
|
2840
3059
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2841
3060
|
"h3",
|
|
2842
3061
|
{
|
|
@@ -2852,7 +3071,7 @@ var MemoH3 = memo2(
|
|
|
2852
3071
|
Object.assign(MemoH3, { displayName: "MarkdownH3" });
|
|
2853
3072
|
var MemoH4 = memo2(
|
|
2854
3073
|
({ children, className, node, ...props }) => {
|
|
2855
|
-
const cn2 = useCn
|
|
3074
|
+
const cn2 = _$withSlot17(_h$132, useCn);
|
|
2856
3075
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2857
3076
|
"h4",
|
|
2858
3077
|
{
|
|
@@ -2868,7 +3087,7 @@ var MemoH4 = memo2(
|
|
|
2868
3087
|
Object.assign(MemoH4, { displayName: "MarkdownH4" });
|
|
2869
3088
|
var MemoH5 = memo2(
|
|
2870
3089
|
({ children, className, node, ...props }) => {
|
|
2871
|
-
const cn2 = useCn
|
|
3090
|
+
const cn2 = _$withSlot17(_h$142, useCn);
|
|
2872
3091
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2873
3092
|
"h5",
|
|
2874
3093
|
{
|
|
@@ -2884,7 +3103,7 @@ var MemoH5 = memo2(
|
|
|
2884
3103
|
Object.assign(MemoH5, { displayName: "MarkdownH5" });
|
|
2885
3104
|
var MemoH6 = memo2(
|
|
2886
3105
|
({ children, className, node, ...props }) => {
|
|
2887
|
-
const cn2 = useCn
|
|
3106
|
+
const cn2 = _$withSlot17(_h$152, useCn);
|
|
2888
3107
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2889
3108
|
"h6",
|
|
2890
3109
|
{
|
|
@@ -2915,7 +3134,8 @@ var MemoTable = memo2(
|
|
|
2915
3134
|
showFullscreen,
|
|
2916
3135
|
...props
|
|
2917
3136
|
},
|
|
2918
|
-
() => children
|
|
3137
|
+
() => children,
|
|
3138
|
+
"c:c99c56ec"
|
|
2919
3139
|
));
|
|
2920
3140
|
},
|
|
2921
3141
|
(p, n) => sameClassAndNode(p, n)
|
|
@@ -2923,7 +3143,7 @@ var MemoTable = memo2(
|
|
|
2923
3143
|
Object.assign(MemoTable, { displayName: "MarkdownTable" });
|
|
2924
3144
|
var MemoThead = memo2(
|
|
2925
3145
|
({ children, className, node, ...props }) => {
|
|
2926
|
-
const cn2 = useCn
|
|
3146
|
+
const cn2 = _$withSlot17(_h$162, useCn);
|
|
2927
3147
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2928
3148
|
"thead",
|
|
2929
3149
|
{
|
|
@@ -2939,7 +3159,7 @@ var MemoThead = memo2(
|
|
|
2939
3159
|
Object.assign(MemoThead, { displayName: "MarkdownThead" });
|
|
2940
3160
|
var MemoTbody = memo2(
|
|
2941
3161
|
({ children, className, node, ...props }) => {
|
|
2942
|
-
const cn2 = useCn
|
|
3162
|
+
const cn2 = _$withSlot17(_h$172, useCn);
|
|
2943
3163
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2944
3164
|
"tbody",
|
|
2945
3165
|
{
|
|
@@ -2955,7 +3175,7 @@ var MemoTbody = memo2(
|
|
|
2955
3175
|
Object.assign(MemoTbody, { displayName: "MarkdownTbody" });
|
|
2956
3176
|
var MemoTr = memo2(
|
|
2957
3177
|
({ children, className, node, ...props }) => {
|
|
2958
|
-
const cn2 = useCn
|
|
3178
|
+
const cn2 = _$withSlot17(_h$182, useCn);
|
|
2959
3179
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2960
3180
|
"tr",
|
|
2961
3181
|
{
|
|
@@ -2971,7 +3191,7 @@ var MemoTr = memo2(
|
|
|
2971
3191
|
Object.assign(MemoTr, { displayName: "MarkdownTr" });
|
|
2972
3192
|
var MemoTh = memo2(
|
|
2973
3193
|
({ children, className, node, ...props }) => {
|
|
2974
|
-
const cn2 = useCn
|
|
3194
|
+
const cn2 = _$withSlot17(_h$192, useCn);
|
|
2975
3195
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2976
3196
|
"th",
|
|
2977
3197
|
{
|
|
@@ -2987,7 +3207,7 @@ var MemoTh = memo2(
|
|
|
2987
3207
|
Object.assign(MemoTh, { displayName: "MarkdownTh" });
|
|
2988
3208
|
var MemoTd = memo2(
|
|
2989
3209
|
({ children, className, node, ...props }) => {
|
|
2990
|
-
const cn2 = useCn
|
|
3210
|
+
const cn2 = _$withSlot17(_h$20, useCn);
|
|
2991
3211
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
2992
3212
|
"td",
|
|
2993
3213
|
{
|
|
@@ -3003,7 +3223,7 @@ var MemoTd = memo2(
|
|
|
3003
3223
|
Object.assign(MemoTd, { displayName: "MarkdownTd" });
|
|
3004
3224
|
var MemoBlockquote = memo2(
|
|
3005
3225
|
({ children, className, node, ...props }) => {
|
|
3006
|
-
const cn2 = useCn
|
|
3226
|
+
const cn2 = _$withSlot17(_h$21, useCn);
|
|
3007
3227
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3008
3228
|
"blockquote",
|
|
3009
3229
|
{
|
|
@@ -3019,7 +3239,7 @@ var MemoBlockquote = memo2(
|
|
|
3019
3239
|
Object.assign(MemoBlockquote, { displayName: "MarkdownBlockquote" });
|
|
3020
3240
|
var MemoSup = memo2(
|
|
3021
3241
|
({ children, className, node, ...props }) => {
|
|
3022
|
-
const cn2 = useCn
|
|
3242
|
+
const cn2 = _$withSlot17(_h$222, useCn);
|
|
3023
3243
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3024
3244
|
"sup",
|
|
3025
3245
|
{
|
|
@@ -3035,7 +3255,7 @@ var MemoSup = memo2(
|
|
|
3035
3255
|
Object.assign(MemoSup, { displayName: "MarkdownSup" });
|
|
3036
3256
|
var MemoSub = memo2(
|
|
3037
3257
|
({ children, className, node, ...props }) => {
|
|
3038
|
-
const cn2 = useCn
|
|
3258
|
+
const cn2 = _$withSlot17(_h$232, useCn);
|
|
3039
3259
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3040
3260
|
"sub",
|
|
3041
3261
|
{
|
|
@@ -3114,18 +3334,18 @@ var MemoSection = memo2(
|
|
|
3114
3334
|
);
|
|
3115
3335
|
Object.assign(MemoSection, { displayName: "MarkdownSection" });
|
|
3116
3336
|
var CodeComponent = ({ node, className, children, ...props }) => {
|
|
3117
|
-
const cn2 = useCn
|
|
3337
|
+
const cn2 = _$withSlot17(_h$242, useCn);
|
|
3118
3338
|
const inline = !("data-block" in props);
|
|
3119
3339
|
const {
|
|
3120
3340
|
mermaid: mermaidContext,
|
|
3121
3341
|
controls: controlsConfig,
|
|
3122
3342
|
lineNumbers: contextLineNumbers
|
|
3123
3343
|
} = useContext14(StreamdownContext);
|
|
3124
|
-
const mermaidPlugin = useMermaidPlugin
|
|
3125
|
-
const isBlockIncomplete = useIsCodeFenceIncomplete
|
|
3344
|
+
const mermaidPlugin = _$withSlot17(_h$252, useMermaidPlugin);
|
|
3345
|
+
const isBlockIncomplete = _$withSlot17(_h$262, useIsCodeFenceIncomplete);
|
|
3126
3346
|
const match = className?.match(LANGUAGE_REGEX);
|
|
3127
3347
|
const language = match?.at(1) ?? "";
|
|
3128
|
-
const customRenderer = useCustomRenderer
|
|
3348
|
+
const customRenderer = _$withSlot17(_h$272, useCustomRenderer, language);
|
|
3129
3349
|
if (inline) {
|
|
3130
3350
|
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3131
3351
|
"code",
|
|
@@ -3151,12 +3371,19 @@ var CodeComponent = ({ node, className, children, ...props }) => {
|
|
|
3151
3371
|
}
|
|
3152
3372
|
if (customRenderer) {
|
|
3153
3373
|
const CustomComponent = customRenderer.component;
|
|
3154
|
-
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3374
|
+
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3375
|
+
Suspense2,
|
|
3376
|
+
{
|
|
3377
|
+
fallback: _$createElementFromConfig13("c:a21b100d", CodeBlockSkeleton, {})
|
|
3378
|
+
},
|
|
3379
|
+
() => _$createScopedValue18(() => _$createElementFromConfig13("c:4d96e250", CustomComponent, {
|
|
3380
|
+
code,
|
|
3381
|
+
isIncomplete: isBlockIncomplete,
|
|
3382
|
+
language,
|
|
3383
|
+
meta: metastring
|
|
3384
|
+
})),
|
|
3385
|
+
"c:a0dec580"
|
|
3386
|
+
));
|
|
3160
3387
|
}
|
|
3161
3388
|
if (language === "mermaid" && mermaidPlugin) {
|
|
3162
3389
|
const showMermaidControls = shouldShowControls(controlsConfig, "mermaid");
|
|
@@ -3165,51 +3392,58 @@ var CodeComponent = ({ node, className, children, ...props }) => {
|
|
|
3165
3392
|
const showFullscreen = shouldShowMermaidControl(controlsConfig, "fullscreen");
|
|
3166
3393
|
const showPanZoomControls = shouldShowMermaidControl(controlsConfig, "panZoom");
|
|
3167
3394
|
const shouldShowMermaidControls = showMermaidControls && (showDownload2 || showCopy2 || showFullscreen);
|
|
3168
|
-
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3169
|
-
|
|
3395
|
+
return _$createScopedValue18(() => _$createScopedElement16(
|
|
3396
|
+
Suspense2,
|
|
3170
3397
|
{
|
|
3171
|
-
|
|
3172
|
-
"data-streamdown": "mermaid-block"
|
|
3398
|
+
fallback: _$createElementFromConfig13("c:014dfcb3", CodeBlockSkeleton, {})
|
|
3173
3399
|
},
|
|
3174
|
-
() => _$
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
shouldShowMermaidControls ? _$createScopedValue18(() => _$createScopedElement16(
|
|
3183
|
-
"div",
|
|
3184
|
-
{
|
|
3185
|
-
className: cn2("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end")
|
|
3186
|
-
},
|
|
3187
|
-
() => _$createScopedValue18(() => _$createScopedElement16(
|
|
3400
|
+
() => _$createScopedValue18(() => _$createScopedElement16(
|
|
3401
|
+
"div",
|
|
3402
|
+
{
|
|
3403
|
+
className: cn2("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", className),
|
|
3404
|
+
"data-streamdown": "mermaid-block"
|
|
3405
|
+
},
|
|
3406
|
+
() => _$positionalChildren11([
|
|
3407
|
+
_$createScopedValue18(() => _$createScopedElement16(
|
|
3188
3408
|
"div",
|
|
3189
3409
|
{
|
|
3190
|
-
className: cn2("
|
|
3191
|
-
"data-streamdown": "mermaid-block-actions"
|
|
3410
|
+
className: cn2("flex h-8 items-center text-muted-foreground text-xs")
|
|
3192
3411
|
},
|
|
3193
|
-
() => _$
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3412
|
+
() => _$createScopedValue18(() => _$createElement5("span", { className: cn2("ml-1 font-mono lowercase") }, "mermaid"))
|
|
3413
|
+
)),
|
|
3414
|
+
shouldShowMermaidControls ? _$createScopedValue18(() => _$createScopedElement16(
|
|
3415
|
+
"div",
|
|
3416
|
+
{
|
|
3417
|
+
className: cn2("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end")
|
|
3418
|
+
},
|
|
3419
|
+
() => _$createScopedValue18(() => _$createScopedElement16(
|
|
3420
|
+
"div",
|
|
3421
|
+
{
|
|
3422
|
+
className: cn2("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),
|
|
3423
|
+
"data-streamdown": "mermaid-block-actions"
|
|
3424
|
+
},
|
|
3425
|
+
() => _$positionalChildren11([
|
|
3426
|
+
showDownload2 ? _$createScopedValue18(() => _$createElementFromConfig13("c:d909645c", MermaidDownloadDropdown, { chart: code, config: mermaidContext?.config })) : null,
|
|
3427
|
+
showCopy2 ? _$createScopedValue18(() => _$createElementFromConfig13("c:b1c7f947", CodeBlockCopyButton, { code })) : null,
|
|
3428
|
+
showFullscreen ? _$createScopedValue18(() => _$createElementFromConfig13("c:3ff4690e", MermaidFullscreenButton, { chart: code, config: mermaidContext?.config })) : null
|
|
3429
|
+
])
|
|
3430
|
+
))
|
|
3431
|
+
)) : null,
|
|
3432
|
+
_$createScopedValue18(() => _$createScopedElement16(
|
|
3433
|
+
"div",
|
|
3434
|
+
{
|
|
3435
|
+
className: cn2("rounded-md border border-border bg-background")
|
|
3436
|
+
},
|
|
3437
|
+
() => _$createScopedValue18(() => _$createElementFromConfig13("c:18b8a90e", Mermaid2, {
|
|
3438
|
+
chart: code,
|
|
3439
|
+
config: mermaidContext?.config,
|
|
3440
|
+
showControls: showPanZoomControls
|
|
3441
|
+
}))
|
|
3198
3442
|
))
|
|
3199
|
-
)
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
className: cn2("rounded-md border border-border bg-background")
|
|
3204
|
-
},
|
|
3205
|
-
() => _$createScopedValue18(() => _$createElement15(Mermaid2, {
|
|
3206
|
-
chart: code,
|
|
3207
|
-
config: mermaidContext?.config,
|
|
3208
|
-
showControls: showPanZoomControls
|
|
3209
|
-
}))
|
|
3210
|
-
))
|
|
3211
|
-
])
|
|
3212
|
-
))));
|
|
3443
|
+
])
|
|
3444
|
+
)),
|
|
3445
|
+
"c:cedf5a7f"
|
|
3446
|
+
));
|
|
3213
3447
|
}
|
|
3214
3448
|
const showCodeControls = shouldShowControls(controlsConfig, "code");
|
|
3215
3449
|
const showDownload = shouldShowCodeControl(controlsConfig, "download");
|
|
@@ -3226,9 +3460,10 @@ var CodeComponent = ({ node, className, children, ...props }) => {
|
|
|
3226
3460
|
startLine
|
|
3227
3461
|
},
|
|
3228
3462
|
() => shouldShowCodeControls ? _$createScopedElement16(_$Fragment4, {}, () => _$positionalChildren11([
|
|
3229
|
-
showDownload ? _$createScopedValue18(() => _$
|
|
3230
|
-
showCopy ? _$
|
|
3231
|
-
])) : null
|
|
3463
|
+
showDownload ? _$createScopedValue18(() => _$createElementFromConfig13("c:2aa19271", CodeBlockDownloadButton, { code, language })) : null,
|
|
3464
|
+
showCopy ? _$createElementFromConfig13("c:801704e7", CodeBlockCopyButton, {}) : null
|
|
3465
|
+
])) : null,
|
|
3466
|
+
"c:3237a6ea"
|
|
3232
3467
|
));
|
|
3233
3468
|
};
|
|
3234
3469
|
var MemoCode = memo2(CodeComponent, (p, n) => p.className === n.className && sameNodePosition(p.node, n.node));
|
|
@@ -3769,6 +4004,31 @@ var remarkCodeMeta = () => (tree) => {
|
|
|
3769
4004
|
};
|
|
3770
4005
|
|
|
3771
4006
|
// src/index.tsrx
|
|
4007
|
+
var _hs$20 = /* @__PURE__ */ _$hookSlots20(24);
|
|
4008
|
+
var _h$020 = /* @__PURE__ */ Symbol(_hs$20);
|
|
4009
|
+
var _h$117 = /* @__PURE__ */ Symbol(_hs$20 + 1);
|
|
4010
|
+
var _h$215 = /* @__PURE__ */ Symbol(_hs$20 + 2);
|
|
4011
|
+
var _h$313 = /* @__PURE__ */ Symbol(_hs$20 + 3);
|
|
4012
|
+
var _h$412 = /* @__PURE__ */ Symbol(_hs$20 + 4);
|
|
4013
|
+
var _h$510 = /* @__PURE__ */ Symbol(_hs$20 + 5);
|
|
4014
|
+
var _h$69 = /* @__PURE__ */ Symbol(_hs$20 + 6);
|
|
4015
|
+
var _h$76 = /* @__PURE__ */ Symbol(_hs$20 + 7);
|
|
4016
|
+
var _h$83 = /* @__PURE__ */ Symbol(_hs$20 + 8);
|
|
4017
|
+
var _h$92 = /* @__PURE__ */ Symbol(_hs$20 + 9);
|
|
4018
|
+
var _h$102 = /* @__PURE__ */ Symbol(_hs$20 + 10);
|
|
4019
|
+
var _h$118 = /* @__PURE__ */ Symbol(_hs$20 + 11);
|
|
4020
|
+
var _h$123 = /* @__PURE__ */ Symbol(_hs$20 + 12);
|
|
4021
|
+
var _h$133 = /* @__PURE__ */ Symbol(_hs$20 + 13);
|
|
4022
|
+
var _h$143 = /* @__PURE__ */ Symbol(_hs$20 + 14);
|
|
4023
|
+
var _h$153 = /* @__PURE__ */ Symbol(_hs$20 + 15);
|
|
4024
|
+
var _h$163 = /* @__PURE__ */ Symbol(_hs$20 + 16);
|
|
4025
|
+
var _h$173 = /* @__PURE__ */ Symbol(_hs$20 + 17);
|
|
4026
|
+
var _h$183 = /* @__PURE__ */ Symbol(_hs$20 + 18);
|
|
4027
|
+
var _h$193 = /* @__PURE__ */ Symbol(_hs$20 + 19);
|
|
4028
|
+
var _h$202 = /* @__PURE__ */ Symbol(_hs$20 + 20);
|
|
4029
|
+
var _h$216 = /* @__PURE__ */ Symbol(_hs$20 + 21);
|
|
4030
|
+
var _h$223 = /* @__PURE__ */ Symbol(_hs$20 + 22);
|
|
4031
|
+
var _h$233 = /* @__PURE__ */ Symbol(_hs$20 + 23);
|
|
3772
4032
|
var HTML_BLOCK_START_PATTERN = /^[ \t]*<[\w!/?-]/;
|
|
3773
4033
|
var HTML_LINE_INDENT_PATTERN = /(^|\n)[ \t]{4,}(?=<[\w!/?-])/g;
|
|
3774
4034
|
var normalizeHtmlIndentation = (content) => {
|
|
@@ -3837,8 +4097,13 @@ var Block = memo3(({
|
|
|
3837
4097
|
animatePluginProp.setPrevContentLength(prevCount);
|
|
3838
4098
|
}
|
|
3839
4099
|
const normalizedContent = typeof content === "string" && shouldNormalizeHtmlIndentation ? normalizeHtmlIndentation(content) : content;
|
|
3840
|
-
const inner = _$createScopedValue19(() => _$createScopedElement17(Markdown, { ...props }, () => normalizedContent));
|
|
3841
|
-
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4100
|
+
const inner = _$createScopedValue19(() => _$createScopedElement17(Markdown, { ...props }, () => normalizedContent, "c:3d95de58"));
|
|
4101
|
+
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4102
|
+
BlockIncompleteContext,
|
|
4103
|
+
{ value: isIncomplete },
|
|
4104
|
+
() => dir ? _$createScopedValue19(() => _$createScopedElement17("div", { dir, style: { display: "contents" } }, () => inner)) : inner,
|
|
4105
|
+
"c:3d14fe88"
|
|
4106
|
+
));
|
|
3842
4107
|
});
|
|
3843
4108
|
Object.assign(Block, { displayName: "Block" });
|
|
3844
4109
|
var Streamdown = memo3(({
|
|
@@ -3872,12 +4137,12 @@ var Streamdown = memo3(({
|
|
|
3872
4137
|
onAnimationEnd,
|
|
3873
4138
|
...props
|
|
3874
4139
|
}) => {
|
|
3875
|
-
const generatedId = useId();
|
|
3876
|
-
const [_isPending, startTransition] = useTransition();
|
|
3877
|
-
const prefixedCn = useMemo4(() => createCn(prefix), [prefix]);
|
|
3878
|
-
const prevIsAnimatingRef = useRef8(null);
|
|
3879
|
-
const onAnimationStartRef = useRef8(onAnimationStart);
|
|
3880
|
-
const onAnimationEndRef = useRef8(onAnimationEnd);
|
|
4140
|
+
const generatedId = useId(_h$020);
|
|
4141
|
+
const [_isPending, startTransition] = useTransition(_h$117);
|
|
4142
|
+
const prefixedCn = useMemo4(() => createCn(prefix), [prefix], _h$215);
|
|
4143
|
+
const prevIsAnimatingRef = useRef8(null, _h$313);
|
|
4144
|
+
const onAnimationStartRef = useRef8(onAnimationStart, _h$412);
|
|
4145
|
+
const onAnimationEndRef = useRef8(onAnimationEnd, _h$510);
|
|
3881
4146
|
onAnimationStartRef.current = onAnimationStart;
|
|
3882
4147
|
onAnimationEndRef.current = onAnimationEnd;
|
|
3883
4148
|
useEffect10(
|
|
@@ -3899,9 +4164,10 @@ var Streamdown = memo3(({
|
|
|
3899
4164
|
onAnimationEndRef.current?.();
|
|
3900
4165
|
}
|
|
3901
4166
|
},
|
|
3902
|
-
[isAnimating, mode]
|
|
4167
|
+
[isAnimating, mode],
|
|
4168
|
+
_h$69
|
|
3903
4169
|
);
|
|
3904
|
-
const allowedTagNames = useMemo4(() => allowedTags ? Object.keys(allowedTags) : [], [allowedTags]);
|
|
4170
|
+
const allowedTagNames = useMemo4(() => allowedTags ? Object.keys(allowedTags) : [], [allowedTags], _h$76);
|
|
3905
4171
|
const processedChildren = useMemo4(
|
|
3906
4172
|
() => {
|
|
3907
4173
|
if (typeof children !== "string") {
|
|
@@ -3923,10 +4189,11 @@ var Streamdown = memo3(({
|
|
|
3923
4189
|
remendOptions,
|
|
3924
4190
|
allowedTagNames,
|
|
3925
4191
|
literalTagContent
|
|
3926
|
-
]
|
|
4192
|
+
],
|
|
4193
|
+
_h$83
|
|
3927
4194
|
);
|
|
3928
|
-
const blocks = useMemo4(() => parseMarkdownIntoBlocksFn(processedChildren), [processedChildren, parseMarkdownIntoBlocksFn]);
|
|
3929
|
-
const [displayBlocks, setDisplayBlocks] = useState11(blocks);
|
|
4195
|
+
const blocks = useMemo4(() => parseMarkdownIntoBlocksFn(processedChildren), [processedChildren, parseMarkdownIntoBlocksFn], _h$92);
|
|
4196
|
+
const [displayBlocks, setDisplayBlocks] = useState11(blocks, _h$102);
|
|
3930
4197
|
useEffect10(
|
|
3931
4198
|
() => {
|
|
3932
4199
|
if (mode === "streaming" && !animatePlugin) {
|
|
@@ -3937,11 +4204,12 @@ var Streamdown = memo3(({
|
|
|
3937
4204
|
setDisplayBlocks(blocks);
|
|
3938
4205
|
}
|
|
3939
4206
|
},
|
|
3940
|
-
[blocks, mode]
|
|
4207
|
+
[blocks, mode],
|
|
4208
|
+
_h$118
|
|
3941
4209
|
);
|
|
3942
4210
|
const blocksToRender = mode === "streaming" ? displayBlocks : blocks;
|
|
3943
|
-
const blockDirections = useMemo4(() => dir === "auto" ? blocksToRender.map(detectTextDirection) : void 0, [blocksToRender, dir]);
|
|
3944
|
-
const blockKeys = useMemo4(() => blocksToRender.map((_block, idx) => `${generatedId}-${idx}`), [blocksToRender.length, generatedId]);
|
|
4211
|
+
const blockDirections = useMemo4(() => dir === "auto" ? blocksToRender.map(detectTextDirection) : void 0, [blocksToRender, dir], _h$123);
|
|
4212
|
+
const blockKeys = useMemo4(() => blocksToRender.map((_block, idx) => `${generatedId}-${idx}`), [blocksToRender.length, generatedId], _h$133);
|
|
3945
4213
|
const animatedKey = useMemo4(
|
|
3946
4214
|
() => {
|
|
3947
4215
|
if (animated === true) {
|
|
@@ -3952,7 +4220,8 @@ var Streamdown = memo3(({
|
|
|
3952
4220
|
}
|
|
3953
4221
|
return "";
|
|
3954
4222
|
},
|
|
3955
|
-
[animated]
|
|
4223
|
+
[animated],
|
|
4224
|
+
_h$143
|
|
3956
4225
|
);
|
|
3957
4226
|
const animatePlugin = useMemo4(
|
|
3958
4227
|
() => {
|
|
@@ -3964,7 +4233,8 @@ var Streamdown = memo3(({
|
|
|
3964
4233
|
}
|
|
3965
4234
|
return createAnimatePlugin(animated);
|
|
3966
4235
|
},
|
|
3967
|
-
[animatedKey]
|
|
4236
|
+
[animatedKey],
|
|
4237
|
+
_h$153
|
|
3968
4238
|
);
|
|
3969
4239
|
const contextValue = useMemo4(
|
|
3970
4240
|
() => ({
|
|
@@ -3985,10 +4255,11 @@ var Streamdown = memo3(({
|
|
|
3985
4255
|
mermaid,
|
|
3986
4256
|
linkSafety,
|
|
3987
4257
|
plugins?.code
|
|
3988
|
-
]
|
|
4258
|
+
],
|
|
4259
|
+
_h$163
|
|
3989
4260
|
);
|
|
3990
|
-
const translationsKey = useMemo4(() => translations ? JSON.stringify(translations) : "", [translations]);
|
|
3991
|
-
const translationsValue = useMemo4(() => ({ ...defaultTranslations, ...translations }), [translationsKey]);
|
|
4261
|
+
const translationsKey = useMemo4(() => translations ? JSON.stringify(translations) : "", [translations], _h$173);
|
|
4262
|
+
const translationsValue = useMemo4(() => ({ ...defaultTranslations, ...translations }), [translationsKey], _h$183);
|
|
3992
4263
|
const mergedComponents = useMemo4(
|
|
3993
4264
|
() => {
|
|
3994
4265
|
const { inlineCode, ...userComponents } = components2 ?? {};
|
|
@@ -4005,7 +4276,8 @@ var Streamdown = memo3(({
|
|
|
4005
4276
|
}
|
|
4006
4277
|
return merged;
|
|
4007
4278
|
},
|
|
4008
|
-
[components2]
|
|
4279
|
+
[components2],
|
|
4280
|
+
_h$193
|
|
4009
4281
|
);
|
|
4010
4282
|
const mergedRemarkPlugins = useMemo4(
|
|
4011
4283
|
() => {
|
|
@@ -4022,7 +4294,8 @@ var Streamdown = memo3(({
|
|
|
4022
4294
|
}
|
|
4023
4295
|
return result;
|
|
4024
4296
|
},
|
|
4025
|
-
[remarkPlugins, plugins?.math, plugins?.cjk]
|
|
4297
|
+
[remarkPlugins, plugins?.math, plugins?.cjk],
|
|
4298
|
+
_h$202
|
|
4026
4299
|
);
|
|
4027
4300
|
const mergedRehypePlugins = useMemo4(
|
|
4028
4301
|
() => {
|
|
@@ -4060,7 +4333,8 @@ var Streamdown = memo3(({
|
|
|
4060
4333
|
isAnimating,
|
|
4061
4334
|
allowedTags,
|
|
4062
4335
|
literalTagContent
|
|
4063
|
-
]
|
|
4336
|
+
],
|
|
4337
|
+
_h$216
|
|
4064
4338
|
);
|
|
4065
4339
|
const shouldHideCaret = useMemo4(
|
|
4066
4340
|
() => {
|
|
@@ -4070,78 +4344,153 @@ var Streamdown = memo3(({
|
|
|
4070
4344
|
const lastBlock = blocksToRender.at(-1);
|
|
4071
4345
|
return hasIncompleteCodeFence(lastBlock) || hasTable(lastBlock);
|
|
4072
4346
|
},
|
|
4073
|
-
[isAnimating, blocksToRender]
|
|
4347
|
+
[isAnimating, blocksToRender],
|
|
4348
|
+
_h$223
|
|
4074
4349
|
);
|
|
4075
4350
|
const style = useMemo4(
|
|
4076
4351
|
() => caret && isAnimating && !shouldHideCaret ? { "--streamdown-caret": `"${carets[caret]}"` } : void 0,
|
|
4077
|
-
[caret, isAnimating, shouldHideCaret]
|
|
4352
|
+
[caret, isAnimating, shouldHideCaret],
|
|
4353
|
+
_h$233
|
|
4078
4354
|
);
|
|
4079
4355
|
if (mode === "static") {
|
|
4080
4356
|
animatePlugin?.setActiveBlock("static");
|
|
4081
|
-
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4082
|
-
|
|
4083
|
-
{
|
|
4084
|
-
className: prefixedCn("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className),
|
|
4085
|
-
dir: dir === "auto" ? detectTextDirection(processedChildren) : dir
|
|
4086
|
-
},
|
|
4357
|
+
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4358
|
+
TranslationsContext,
|
|
4359
|
+
{ value: translationsValue },
|
|
4087
4360
|
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4088
|
-
|
|
4089
|
-
{
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4361
|
+
PluginContext,
|
|
4362
|
+
{ value: plugins ?? null },
|
|
4363
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4364
|
+
StreamdownContext,
|
|
4365
|
+
{ value: contextValue },
|
|
4366
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4367
|
+
IconProvider,
|
|
4368
|
+
{ icons: iconOverrides },
|
|
4369
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4370
|
+
PrefixContext,
|
|
4371
|
+
{ value: prefixedCn },
|
|
4372
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4373
|
+
"div",
|
|
4374
|
+
{
|
|
4375
|
+
className: prefixedCn("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className),
|
|
4376
|
+
dir: dir === "auto" ? detectTextDirection(processedChildren) : dir
|
|
4377
|
+
},
|
|
4378
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4379
|
+
Markdown,
|
|
4380
|
+
{
|
|
4381
|
+
components: mergedComponents,
|
|
4382
|
+
rehypePlugins: mergedRehypePlugins,
|
|
4383
|
+
remarkPlugins: mergedRemarkPlugins,
|
|
4384
|
+
...props
|
|
4385
|
+
},
|
|
4386
|
+
() => processedChildren,
|
|
4387
|
+
"c:87a87cf7"
|
|
4388
|
+
))
|
|
4389
|
+
)),
|
|
4390
|
+
"c:83592d58"
|
|
4391
|
+
)),
|
|
4392
|
+
"c:b3ad250d"
|
|
4393
|
+
)),
|
|
4394
|
+
"c:6a5bc70f"
|
|
4395
|
+
)),
|
|
4396
|
+
"c:6044c2c4"
|
|
4397
|
+
)),
|
|
4398
|
+
"c:b2350cae"
|
|
4399
|
+
));
|
|
4098
4400
|
}
|
|
4099
|
-
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4100
|
-
|
|
4101
|
-
{
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4401
|
+
return _$createScopedValue19(() => _$createScopedElement17(
|
|
4402
|
+
TranslationsContext,
|
|
4403
|
+
{ value: translationsValue },
|
|
4404
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4405
|
+
PluginContext,
|
|
4406
|
+
{ value: plugins ?? null },
|
|
4407
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4408
|
+
StreamdownContext,
|
|
4409
|
+
{ value: contextValue },
|
|
4410
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4411
|
+
IconProvider,
|
|
4412
|
+
{ icons: iconOverrides },
|
|
4413
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4414
|
+
PrefixContext,
|
|
4415
|
+
{ value: prefixedCn },
|
|
4416
|
+
() => _$createScopedValue19(() => _$createScopedElement17(
|
|
4417
|
+
"div",
|
|
4418
|
+
{
|
|
4419
|
+
className: prefixedCn(
|
|
4420
|
+
"space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
4421
|
+
caret && !shouldHideCaret ? "[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]" : null,
|
|
4422
|
+
className
|
|
4423
|
+
),
|
|
4424
|
+
style
|
|
4425
|
+
},
|
|
4426
|
+
() => _$positionalChildren12([
|
|
4427
|
+
blocksToRender.length === 0 && caret && isAnimating && _$createElement6("span", {}),
|
|
4428
|
+
blocksToRender.map((block, index) => {
|
|
4429
|
+
const isLastBlock = index === blocksToRender.length - 1;
|
|
4430
|
+
const isIncomplete = isAnimating && isLastBlock && hasIncompleteCodeFence(block);
|
|
4431
|
+
return _$createElementFromConfig14("c:0e7d24cb", BlockComponent, {
|
|
4432
|
+
animatePlugin,
|
|
4433
|
+
components: mergedComponents,
|
|
4434
|
+
content: block,
|
|
4435
|
+
dir: blockDirections?.[index] ?? (dir !== "auto" ? dir : void 0),
|
|
4436
|
+
index,
|
|
4437
|
+
isIncomplete,
|
|
4438
|
+
key: blockKeys[index],
|
|
4439
|
+
rehypePlugins: mergedRehypePlugins,
|
|
4440
|
+
remarkPlugins: mergedRemarkPlugins,
|
|
4441
|
+
shouldNormalizeHtmlIndentation,
|
|
4442
|
+
shouldParseIncompleteMarkdown,
|
|
4443
|
+
...props
|
|
4444
|
+
});
|
|
4445
|
+
})
|
|
4446
|
+
])
|
|
4447
|
+
)),
|
|
4448
|
+
"c:bfd3933c"
|
|
4449
|
+
)),
|
|
4450
|
+
"c:469aa280"
|
|
4451
|
+
)),
|
|
4452
|
+
"c:9aac48b7"
|
|
4453
|
+
)),
|
|
4454
|
+
"c:2dccd544"
|
|
4455
|
+
)),
|
|
4456
|
+
"c:90a5f7cf"
|
|
4457
|
+
));
|
|
4131
4458
|
});
|
|
4132
4459
|
Object.assign(Streamdown, { displayName: "Streamdown" });
|
|
4133
4460
|
|
|
4134
4461
|
// src/lib/mermaid/pan-zoom.tsrx
|
|
4462
|
+
import { createElementFromConfig as _$createElementFromConfig15 } from "octane/internal/server";
|
|
4135
4463
|
import {
|
|
4136
|
-
createElement as _$createElement17,
|
|
4137
4464
|
createScopedElement as _$createScopedElement18,
|
|
4138
4465
|
createScopedValue as _$createScopedValue20,
|
|
4466
|
+
hookSlots as _$hookSlots21,
|
|
4139
4467
|
positionalChildren as _$positionalChildren13,
|
|
4140
4468
|
useCallback as useCallback4,
|
|
4141
4469
|
useEffect as useEffect11,
|
|
4142
4470
|
useRef as useRef9,
|
|
4143
|
-
useState as useState12
|
|
4471
|
+
useState as useState12,
|
|
4472
|
+
withSlot as _$withSlot18
|
|
4144
4473
|
} from "octane/server";
|
|
4474
|
+
var _hs$21 = /* @__PURE__ */ _$hookSlots21(19);
|
|
4475
|
+
var _h$021 = /* @__PURE__ */ Symbol(_hs$21);
|
|
4476
|
+
var _h$119 = /* @__PURE__ */ Symbol(_hs$21 + 1);
|
|
4477
|
+
var _h$217 = /* @__PURE__ */ Symbol(_hs$21 + 2);
|
|
4478
|
+
var _h$314 = /* @__PURE__ */ Symbol(_hs$21 + 3);
|
|
4479
|
+
var _h$413 = /* @__PURE__ */ Symbol(_hs$21 + 4);
|
|
4480
|
+
var _h$511 = /* @__PURE__ */ Symbol(_hs$21 + 5);
|
|
4481
|
+
var _h$610 = /* @__PURE__ */ Symbol(_hs$21 + 6);
|
|
4482
|
+
var _h$77 = /* @__PURE__ */ Symbol(_hs$21 + 7);
|
|
4483
|
+
var _h$84 = /* @__PURE__ */ Symbol(_hs$21 + 8);
|
|
4484
|
+
var _h$93 = /* @__PURE__ */ Symbol(_hs$21 + 9);
|
|
4485
|
+
var _h$103 = /* @__PURE__ */ Symbol(_hs$21 + 10);
|
|
4486
|
+
var _h$1110 = /* @__PURE__ */ Symbol(_hs$21 + 11);
|
|
4487
|
+
var _h$124 = /* @__PURE__ */ Symbol(_hs$21 + 12);
|
|
4488
|
+
var _h$134 = /* @__PURE__ */ Symbol(_hs$21 + 13);
|
|
4489
|
+
var _h$144 = /* @__PURE__ */ Symbol(_hs$21 + 14);
|
|
4490
|
+
var _h$154 = /* @__PURE__ */ Symbol(_hs$21 + 15);
|
|
4491
|
+
var _h$164 = /* @__PURE__ */ Symbol(_hs$21 + 16);
|
|
4492
|
+
var _h$174 = /* @__PURE__ */ Symbol(_hs$21 + 17);
|
|
4493
|
+
var _h$184 = /* @__PURE__ */ Symbol(_hs$21 + 18);
|
|
4145
4494
|
var PanZoom = ({
|
|
4146
4495
|
children,
|
|
4147
4496
|
className,
|
|
@@ -4152,15 +4501,15 @@ var PanZoom = ({
|
|
|
4152
4501
|
initialZoom = 1,
|
|
4153
4502
|
fullscreen = false
|
|
4154
4503
|
}) => {
|
|
4155
|
-
const { RotateCcwIcon: RotateCcwIcon2, ZoomInIcon: ZoomInIcon2, ZoomOutIcon: ZoomOutIcon2 } = useIcons
|
|
4156
|
-
const cn2 = useCn
|
|
4157
|
-
const containerRef = useRef9(null);
|
|
4158
|
-
const contentRef = useRef9(null);
|
|
4159
|
-
const [zoom, setZoom] = useState12(initialZoom);
|
|
4160
|
-
const [pan, setPan] = useState12({ x: 0, y: 0 });
|
|
4161
|
-
const [isPanning, setIsPanning] = useState12(false);
|
|
4162
|
-
const [panStart, setPanStart] = useState12({ x: 0, y: 0 });
|
|
4163
|
-
const [panStartPosition, setPanStartPosition] = useState12({ x: 0, y: 0 });
|
|
4504
|
+
const { RotateCcwIcon: RotateCcwIcon2, ZoomInIcon: ZoomInIcon2, ZoomOutIcon: ZoomOutIcon2 } = _$withSlot18(_h$021, useIcons);
|
|
4505
|
+
const cn2 = _$withSlot18(_h$119, useCn);
|
|
4506
|
+
const containerRef = useRef9(null, _h$217);
|
|
4507
|
+
const contentRef = useRef9(null, _h$314);
|
|
4508
|
+
const [zoom, setZoom] = useState12(initialZoom, _h$413);
|
|
4509
|
+
const [pan, setPan] = useState12({ x: 0, y: 0 }, _h$511);
|
|
4510
|
+
const [isPanning, setIsPanning] = useState12(false, _h$610);
|
|
4511
|
+
const [panStart, setPanStart] = useState12({ x: 0, y: 0 }, _h$77);
|
|
4512
|
+
const [panStartPosition, setPanStartPosition] = useState12({ x: 0, y: 0 }, _h$84);
|
|
4164
4513
|
const handleZoom = useCallback4(
|
|
4165
4514
|
(delta) => {
|
|
4166
4515
|
setZoom((prevZoom) => {
|
|
@@ -4168,26 +4517,30 @@ var PanZoom = ({
|
|
|
4168
4517
|
return newZoom;
|
|
4169
4518
|
});
|
|
4170
4519
|
},
|
|
4171
|
-
[minZoom, maxZoom]
|
|
4520
|
+
[minZoom, maxZoom],
|
|
4521
|
+
_h$93
|
|
4172
4522
|
);
|
|
4173
4523
|
const handleZoomIn = useCallback4(
|
|
4174
4524
|
() => {
|
|
4175
4525
|
handleZoom(zoomStep);
|
|
4176
4526
|
},
|
|
4177
|
-
[handleZoom, zoomStep]
|
|
4527
|
+
[handleZoom, zoomStep],
|
|
4528
|
+
_h$103
|
|
4178
4529
|
);
|
|
4179
4530
|
const handleZoomOut = useCallback4(
|
|
4180
4531
|
() => {
|
|
4181
4532
|
handleZoom(-zoomStep);
|
|
4182
4533
|
},
|
|
4183
|
-
[handleZoom, zoomStep]
|
|
4534
|
+
[handleZoom, zoomStep],
|
|
4535
|
+
_h$1110
|
|
4184
4536
|
);
|
|
4185
4537
|
const handleReset = useCallback4(
|
|
4186
4538
|
() => {
|
|
4187
4539
|
setZoom(initialZoom);
|
|
4188
4540
|
setPan({ x: 0, y: 0 });
|
|
4189
4541
|
},
|
|
4190
|
-
[initialZoom]
|
|
4542
|
+
[initialZoom],
|
|
4543
|
+
_h$124
|
|
4191
4544
|
);
|
|
4192
4545
|
const handleWheel = useCallback4(
|
|
4193
4546
|
(e) => {
|
|
@@ -4195,7 +4548,8 @@ var PanZoom = ({
|
|
|
4195
4548
|
const delta = e.deltaY > 0 ? -zoomStep : zoomStep;
|
|
4196
4549
|
handleZoom(delta);
|
|
4197
4550
|
},
|
|
4198
|
-
[handleZoom, zoomStep]
|
|
4551
|
+
[handleZoom, zoomStep],
|
|
4552
|
+
_h$134
|
|
4199
4553
|
);
|
|
4200
4554
|
const handlePointerDown = useCallback4(
|
|
4201
4555
|
(e) => {
|
|
@@ -4210,7 +4564,8 @@ var PanZoom = ({
|
|
|
4210
4564
|
target.setPointerCapture(e.pointerId);
|
|
4211
4565
|
}
|
|
4212
4566
|
},
|
|
4213
|
-
[pan]
|
|
4567
|
+
[pan],
|
|
4568
|
+
_h$144
|
|
4214
4569
|
);
|
|
4215
4570
|
const handlePointerMove = useCallback4(
|
|
4216
4571
|
(e) => {
|
|
@@ -4225,7 +4580,8 @@ var PanZoom = ({
|
|
|
4225
4580
|
y: panStartPosition.y + deltaY
|
|
4226
4581
|
});
|
|
4227
4582
|
},
|
|
4228
|
-
[isPanning, panStart, panStartPosition]
|
|
4583
|
+
[isPanning, panStart, panStartPosition],
|
|
4584
|
+
_h$154
|
|
4229
4585
|
);
|
|
4230
4586
|
const handlePointerUp = useCallback4(
|
|
4231
4587
|
(e) => {
|
|
@@ -4235,7 +4591,8 @@ var PanZoom = ({
|
|
|
4235
4591
|
target.releasePointerCapture(e.pointerId);
|
|
4236
4592
|
}
|
|
4237
4593
|
},
|
|
4238
|
-
[]
|
|
4594
|
+
[],
|
|
4595
|
+
_h$164
|
|
4239
4596
|
);
|
|
4240
4597
|
useEffect11(
|
|
4241
4598
|
() => {
|
|
@@ -4248,7 +4605,8 @@ var PanZoom = ({
|
|
|
4248
4605
|
container.removeEventListener("wheel", handleWheel);
|
|
4249
4606
|
};
|
|
4250
4607
|
},
|
|
4251
|
-
[handleWheel]
|
|
4608
|
+
[handleWheel],
|
|
4609
|
+
_h$174
|
|
4252
4610
|
);
|
|
4253
4611
|
useEffect11(
|
|
4254
4612
|
() => {
|
|
@@ -4269,7 +4627,8 @@ var PanZoom = ({
|
|
|
4269
4627
|
};
|
|
4270
4628
|
}
|
|
4271
4629
|
},
|
|
4272
|
-
[isPanning, handlePointerMove, handlePointerUp]
|
|
4630
|
+
[isPanning, handlePointerMove, handlePointerUp],
|
|
4631
|
+
_h$184
|
|
4273
4632
|
);
|
|
4274
4633
|
return _$createScopedValue20(() => _$createScopedElement18(
|
|
4275
4634
|
"div",
|
|
@@ -4294,7 +4653,7 @@ var PanZoom = ({
|
|
|
4294
4653
|
title: "Zoom in",
|
|
4295
4654
|
type: "button"
|
|
4296
4655
|
},
|
|
4297
|
-
() => _$
|
|
4656
|
+
() => _$createElementFromConfig15("c:86059c57", ZoomInIcon2, { size: 16 })
|
|
4298
4657
|
)),
|
|
4299
4658
|
_$createScopedValue20(() => _$createScopedElement18(
|
|
4300
4659
|
"button",
|
|
@@ -4305,7 +4664,7 @@ var PanZoom = ({
|
|
|
4305
4664
|
title: "Zoom out",
|
|
4306
4665
|
type: "button"
|
|
4307
4666
|
},
|
|
4308
|
-
() => _$
|
|
4667
|
+
() => _$createElementFromConfig15("c:c5368084", ZoomOutIcon2, { size: 16 })
|
|
4309
4668
|
)),
|
|
4310
4669
|
_$createScopedValue20(() => _$createScopedElement18(
|
|
4311
4670
|
"button",
|
|
@@ -4315,7 +4674,7 @@ var PanZoom = ({
|
|
|
4315
4674
|
title: "Reset zoom and pan",
|
|
4316
4675
|
type: "button"
|
|
4317
4676
|
},
|
|
4318
|
-
() => _$
|
|
4677
|
+
() => _$createElementFromConfig15("c:1ed9eaeb", RotateCcwIcon2, { size: 16 })
|
|
4319
4678
|
))
|
|
4320
4679
|
])
|
|
4321
4680
|
)) : null,
|
|
@@ -4340,6 +4699,17 @@ var PanZoom = ({
|
|
|
4340
4699
|
};
|
|
4341
4700
|
|
|
4342
4701
|
// src/lib/mermaid/index.tsrx
|
|
4702
|
+
var _hs$22 = /* @__PURE__ */ _$hookSlots22(10);
|
|
4703
|
+
var _h$022 = /* @__PURE__ */ Symbol(_hs$22);
|
|
4704
|
+
var _h$120 = /* @__PURE__ */ Symbol(_hs$22 + 1);
|
|
4705
|
+
var _h$218 = /* @__PURE__ */ Symbol(_hs$22 + 2);
|
|
4706
|
+
var _h$315 = /* @__PURE__ */ Symbol(_hs$22 + 3);
|
|
4707
|
+
var _h$414 = /* @__PURE__ */ Symbol(_hs$22 + 4);
|
|
4708
|
+
var _h$512 = /* @__PURE__ */ Symbol(_hs$22 + 5);
|
|
4709
|
+
var _h$611 = /* @__PURE__ */ Symbol(_hs$22 + 6);
|
|
4710
|
+
var _h$78 = /* @__PURE__ */ Symbol(_hs$22 + 7);
|
|
4711
|
+
var _h$85 = /* @__PURE__ */ Symbol(_hs$22 + 8);
|
|
4712
|
+
var _h$94 = /* @__PURE__ */ Symbol(_hs$22 + 9);
|
|
4343
4713
|
var Mermaid = ({
|
|
4344
4714
|
chart,
|
|
4345
4715
|
className,
|
|
@@ -4347,17 +4717,17 @@ var Mermaid = ({
|
|
|
4347
4717
|
fullscreen = false,
|
|
4348
4718
|
showControls = true
|
|
4349
4719
|
}) => {
|
|
4350
|
-
const cn2 = useCn
|
|
4351
|
-
const [error, setError] = useState13(null);
|
|
4352
|
-
const [isLoading, setIsLoading] = useState13(false);
|
|
4353
|
-
const [svgContent, setSvgContent] = useState13("");
|
|
4354
|
-
const [lastValidSvg, setLastValidSvg] = useState13("");
|
|
4355
|
-
const [retryCount, setRetryCount] = useState13(0);
|
|
4356
|
-
const activeRenderRef = useRef10(null);
|
|
4720
|
+
const cn2 = _$withSlot19(_h$022, useCn);
|
|
4721
|
+
const [error, setError] = useState13(null, _h$120);
|
|
4722
|
+
const [isLoading, setIsLoading] = useState13(false, _h$218);
|
|
4723
|
+
const [svgContent, setSvgContent] = useState13("", _h$315);
|
|
4724
|
+
const [lastValidSvg, setLastValidSvg] = useState13("", _h$414);
|
|
4725
|
+
const [retryCount, setRetryCount] = useState13(0, _h$512);
|
|
4726
|
+
const activeRenderRef = useRef10(null, _h$611);
|
|
4357
4727
|
const { mermaid: mermaidContext } = useContext15(StreamdownContext);
|
|
4358
|
-
const mermaidPlugin = useMermaidPlugin
|
|
4728
|
+
const mermaidPlugin = _$withSlot19(_h$78, useMermaidPlugin);
|
|
4359
4729
|
const ErrorComponent = mermaidContext?.errorComponent;
|
|
4360
|
-
const { shouldRender, containerRef } = useDeferredRender
|
|
4730
|
+
const { shouldRender, containerRef } = _$withSlot19(_h$85, useDeferredRender, { immediate: fullscreen });
|
|
4361
4731
|
useEffect12(
|
|
4362
4732
|
() => {
|
|
4363
4733
|
const renderRequest = {};
|
|
@@ -4410,10 +4780,11 @@ var Mermaid = ({
|
|
|
4410
4780
|
renderChart();
|
|
4411
4781
|
return cancelRender;
|
|
4412
4782
|
},
|
|
4413
|
-
[chart, config, retryCount, shouldRender, mermaidPlugin]
|
|
4783
|
+
[chart, config, retryCount, shouldRender, mermaidPlugin],
|
|
4784
|
+
_h$94
|
|
4414
4785
|
);
|
|
4415
4786
|
if (!(shouldRender || svgContent || lastValidSvg)) {
|
|
4416
|
-
return _$createScopedValue21(() => _$
|
|
4787
|
+
return _$createScopedValue21(() => _$createElement7("div", {
|
|
4417
4788
|
className: cn2("my-4 min-h-[200px]", className),
|
|
4418
4789
|
ref: containerRef
|
|
4419
4790
|
}));
|
|
@@ -4431,10 +4802,10 @@ var Mermaid = ({
|
|
|
4431
4802
|
className: cn2("flex items-center space-x-2 text-muted-foreground")
|
|
4432
4803
|
},
|
|
4433
4804
|
() => _$positionalChildren14([
|
|
4434
|
-
_$createScopedValue21(() => _$
|
|
4805
|
+
_$createScopedValue21(() => _$createElement7("div", {
|
|
4435
4806
|
className: cn2("h-4 w-4 animate-spin rounded-full border-current border-b-2")
|
|
4436
4807
|
})),
|
|
4437
|
-
_$createScopedValue21(() => _$
|
|
4808
|
+
_$createScopedValue21(() => _$createElement7("span", { className: cn2("text-sm") }, "Loading diagram..."))
|
|
4438
4809
|
])
|
|
4439
4810
|
))
|
|
4440
4811
|
));
|
|
@@ -4442,7 +4813,7 @@ var Mermaid = ({
|
|
|
4442
4813
|
if (error && !svgContent && !lastValidSvg) {
|
|
4443
4814
|
const retry = () => setRetryCount((count) => count + 1);
|
|
4444
4815
|
if (ErrorComponent) {
|
|
4445
|
-
return _$createScopedValue21(() => _$createScopedElement19("div", { ref: containerRef }, () => _$createScopedValue21(() => _$
|
|
4816
|
+
return _$createScopedValue21(() => _$createScopedElement19("div", { ref: containerRef }, () => _$createScopedValue21(() => _$createElementFromConfig16("c:41f09895", ErrorComponent, { chart, error, retry }))));
|
|
4446
4817
|
}
|
|
4447
4818
|
return _$createScopedValue21(() => _$createScopedElement19(
|
|
4448
4819
|
"div",
|
|
@@ -4451,9 +4822,9 @@ var Mermaid = ({
|
|
|
4451
4822
|
ref: containerRef
|
|
4452
4823
|
},
|
|
4453
4824
|
() => _$positionalChildren14([
|
|
4454
|
-
_$createScopedValue21(() => _$createScopedElement19("p", { className: cn2("font-mono text-red-700 text-sm") }, () => _$positionalChildren14(["
|
|
4825
|
+
_$createScopedValue21(() => _$createScopedElement19("p", { className: cn2("font-mono text-red-700 text-sm") }, () => _$positionalChildren14(["Mermaid Error:", error]))),
|
|
4455
4826
|
_$createScopedValue21(() => _$createScopedElement19("details", { className: cn2("mt-2") }, () => _$positionalChildren14([
|
|
4456
|
-
_$createScopedValue21(() => _$
|
|
4827
|
+
_$createScopedValue21(() => _$createElement7("summary", { className: cn2("cursor-pointer text-red-600 text-xs") }, "Show Code")),
|
|
4457
4828
|
_$createScopedValue21(() => _$createScopedElement19(
|
|
4458
4829
|
"pre",
|
|
4459
4830
|
{
|
|
@@ -4483,12 +4854,13 @@ var Mermaid = ({
|
|
|
4483
4854
|
showControls,
|
|
4484
4855
|
zoomStep: 0.1
|
|
4485
4856
|
},
|
|
4486
|
-
() => _$createScopedValue21(() => _$
|
|
4857
|
+
() => _$createScopedValue21(() => _$createElement7("div", {
|
|
4487
4858
|
"aria-label": "Mermaid chart",
|
|
4488
4859
|
className: cn2("flex justify-center", fullscreen ? "size-full items-center" : null),
|
|
4489
4860
|
dangerouslySetInnerHTML: { __html: displaySvg },
|
|
4490
4861
|
role: "img"
|
|
4491
|
-
}))
|
|
4862
|
+
})),
|
|
4863
|
+
"c:88f2b72c"
|
|
4492
4864
|
))
|
|
4493
4865
|
));
|
|
4494
4866
|
};
|