@octanejs/streamdown 0.1.19 → 0.1.20
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-6IDAODM4.js → chunk-546NLYEB.js} +307 -187
- package/dist/client/chunks/{highlighted-body-PYQZ7NZ4.js → highlighted-body-F5VO3CPW.js} +8 -2
- package/dist/client/chunks/{mermaid-I6WR5JDC.js → mermaid-DL22PFDA.js} +1 -1
- package/dist/client/index.js +1 -1
- package/package.json +4 -4
|
@@ -22,6 +22,12 @@ import {
|
|
|
22
22
|
useRef,
|
|
23
23
|
useState
|
|
24
24
|
} from "octane";
|
|
25
|
+
import {
|
|
26
|
+
memoPublish as _$memoPublish,
|
|
27
|
+
memoSlot as _$memoSlot,
|
|
28
|
+
memoTake0 as _$memoTake0,
|
|
29
|
+
memoTake1 as _$memoTake1
|
|
30
|
+
} from "octane/internal/client";
|
|
25
31
|
var _hs$ = /* @__PURE__ */ _$hookSlots(8);
|
|
26
32
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
27
33
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
@@ -38,6 +44,7 @@ function withoutSlot(value) {
|
|
|
38
44
|
return typeof value === "symbol" ? void 0 : value;
|
|
39
45
|
}
|
|
40
46
|
function useDeferredRender(options = {}) {
|
|
47
|
+
let __hks, __hke, __hks$, __hkd0, __hke$, __hks$$, __hke$$;
|
|
41
48
|
const {
|
|
42
49
|
immediate = false,
|
|
43
50
|
debounceDelay = DEFERRED_RENDER_DEBOUNCE_DELAY,
|
|
@@ -48,34 +55,26 @@ function useDeferredRender(options = {}) {
|
|
|
48
55
|
const containerRef = useRef(null, _h$1);
|
|
49
56
|
const renderTimeoutRef = useRef(null, _h$2);
|
|
50
57
|
const idleCallbackRef = useRef(null, _h$3);
|
|
51
|
-
const requestIdleCallbackPolyfill = useMemo(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
const cancelIdleCallbackWrapper = useMemo(
|
|
73
|
-
() => typeof window !== "undefined" && window.cancelIdleCallback ? (id) => window.cancelIdleCallback(id) : (id) => {
|
|
74
|
-
clearTimeout(id);
|
|
75
|
-
},
|
|
76
|
-
[],
|
|
77
|
-
_h$6
|
|
78
|
-
);
|
|
58
|
+
const requestIdleCallbackPolyfill = (__hks = _$memoSlot(_h$4, "useMemo"), __hke = _$memoTake0(__hks), __hke === null ? _$memoPublish(__hks, (callback) => {
|
|
59
|
+
const start = Date.now();
|
|
60
|
+
return window.setTimeout(
|
|
61
|
+
() => {
|
|
62
|
+
callback({
|
|
63
|
+
didTimeout: false,
|
|
64
|
+
timeRemaining: () => Math.max(0, 50 - (Date.now() - start))
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
1
|
|
68
|
+
);
|
|
69
|
+
}) : __hke.value);
|
|
70
|
+
const requestIdleCallbackWrapper = (__hkd0 = requestIdleCallbackPolyfill, __hks$ = _$memoSlot(_h$5, "useMemo"), __hke$ = _$memoTake1(__hks$, __hkd0), __hke$ === null ? _$memoPublish(
|
|
71
|
+
__hks$,
|
|
72
|
+
typeof window !== "undefined" && window.requestIdleCallback ? (cb, opts) => window.requestIdleCallback(cb, opts) : requestIdleCallbackPolyfill,
|
|
73
|
+
__hkd0
|
|
74
|
+
) : __hke$.value);
|
|
75
|
+
const cancelIdleCallbackWrapper = (__hks$$ = _$memoSlot(_h$6, "useMemo"), __hke$$ = _$memoTake0(__hks$$), __hke$$ === null ? _$memoPublish(__hks$$, typeof window !== "undefined" && window.cancelIdleCallback ? (id) => window.cancelIdleCallback(id) : (id) => {
|
|
76
|
+
clearTimeout(id);
|
|
77
|
+
}) : __hke$$.value);
|
|
79
78
|
useEffect(
|
|
80
79
|
() => {
|
|
81
80
|
if (immediate) {
|
|
@@ -192,6 +191,13 @@ import {
|
|
|
192
191
|
useState as useState11,
|
|
193
192
|
useTransition
|
|
194
193
|
} from "octane";
|
|
194
|
+
import {
|
|
195
|
+
memoPublish as _$memoPublish7,
|
|
196
|
+
memoSlot as _$memoSlot7,
|
|
197
|
+
memoTake1 as _$memoTake15,
|
|
198
|
+
memoTake2 as _$memoTake24,
|
|
199
|
+
memoTake3 as _$memoTake33
|
|
200
|
+
} from "octane/internal/client";
|
|
195
201
|
import { harden } from "rehype-harden";
|
|
196
202
|
import rehypeRaw2 from "rehype-raw";
|
|
197
203
|
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
@@ -371,6 +377,13 @@ import {
|
|
|
371
377
|
useState as useState10,
|
|
372
378
|
withSlot as _$withSlot17
|
|
373
379
|
} from "octane";
|
|
380
|
+
import {
|
|
381
|
+
memoPublish as _$memoPublish6,
|
|
382
|
+
memoSlot as _$memoSlot6,
|
|
383
|
+
memoTake0 as _$memoTake02,
|
|
384
|
+
memoTake1 as _$memoTake14,
|
|
385
|
+
memoTake3 as _$memoTake32
|
|
386
|
+
} from "octane/internal/client";
|
|
374
387
|
|
|
375
388
|
// src/lib/code-block/index.tsrx
|
|
376
389
|
import {
|
|
@@ -384,6 +397,11 @@ import {
|
|
|
384
397
|
useMemo as useMemo3,
|
|
385
398
|
withSlot as _$withSlot4
|
|
386
399
|
} from "octane";
|
|
400
|
+
import {
|
|
401
|
+
memoPublish as _$memoPublish3,
|
|
402
|
+
memoSlot as _$memoSlot3,
|
|
403
|
+
memoTake1 as _$memoTake12
|
|
404
|
+
} from "octane/internal/client";
|
|
387
405
|
|
|
388
406
|
// src/lib/prefix-context.tsrx
|
|
389
407
|
import { createContext as createContext2, useContext as useContext2 } from "octane";
|
|
@@ -427,6 +445,12 @@ import {
|
|
|
427
445
|
useMemo as useMemo2,
|
|
428
446
|
withSlot as _$withSlot
|
|
429
447
|
} from "octane";
|
|
448
|
+
import {
|
|
449
|
+
memoPublish as _$memoPublish2,
|
|
450
|
+
memoSlot as _$memoSlot2,
|
|
451
|
+
memoTake2 as _$memoTake2,
|
|
452
|
+
memoTake3 as _$memoTake3
|
|
453
|
+
} from "octane/internal/client";
|
|
430
454
|
var _hs$2 = /* @__PURE__ */ _$hookSlots2(3);
|
|
431
455
|
var _h$02 = /* @__PURE__ */ Symbol(_hs$2);
|
|
432
456
|
var _h$12 = /* @__PURE__ */ Symbol(_hs$2 + 1);
|
|
@@ -456,25 +480,37 @@ var CodeBlockBody = memo(
|
|
|
456
480
|
lineNumbers = true,
|
|
457
481
|
...rest
|
|
458
482
|
}) => {
|
|
483
|
+
let __hks, __hkd0, __hkd1, __hke, __hkr, __hks$, __hkd0$, __hkd1$, __hkd2, __hkv, __hke$;
|
|
459
484
|
const cn2 = _$withSlot(_h$02, useCn, _h$02);
|
|
460
|
-
const lineClasses =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
485
|
+
const lineClasses = (__hkd0 = cn2, __hkd1 = lineNumbers, __hks = _$memoSlot2(_h$12, "useMemo"), __hke = _$memoTake2(__hks, __hkd0, __hkd1), __hke === null ? _$memoPublish2(__hks, cn2("block", lineNumbers && LINE_NUMBER_CLASSES_BASE), __hkd0, __hkd1) : __hke.value);
|
|
486
|
+
{
|
|
487
|
+
__hkd0$ = result.bg;
|
|
488
|
+
__hkd1$ = result.fg;
|
|
489
|
+
__hkd2 = result.rootStyle;
|
|
490
|
+
__hks$ = _$memoSlot2(_h$22, "useMemo");
|
|
491
|
+
__hke$ = _$memoTake3(__hks$, __hkd0$, __hkd1$, __hkd2);
|
|
492
|
+
if (__hke$ === null) {
|
|
493
|
+
__hkl: {
|
|
494
|
+
const style = {};
|
|
495
|
+
if (result.bg) {
|
|
496
|
+
style["--sdm-bg"] = result.bg;
|
|
497
|
+
}
|
|
498
|
+
if (result.fg) {
|
|
499
|
+
style["--sdm-fg"] = result.fg;
|
|
500
|
+
}
|
|
501
|
+
if (result.rootStyle) {
|
|
502
|
+
Object.assign(style, parseRootStyle(result.rootStyle));
|
|
503
|
+
}
|
|
504
|
+
{
|
|
505
|
+
__hkv = style;
|
|
506
|
+
break __hkl;
|
|
507
|
+
}
|
|
508
|
+
__hkv = void 0;
|
|
472
509
|
}
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
);
|
|
510
|
+
__hkr = _$memoPublish2(__hks$, __hkv, __hkd0$, __hkd1$, __hkd2);
|
|
511
|
+
} else __hkr = __hke$.value;
|
|
512
|
+
}
|
|
513
|
+
const preStyle = __hkr;
|
|
478
514
|
return _$createScopedValue(() => _$createScopedElement(
|
|
479
515
|
"div",
|
|
480
516
|
{
|
|
@@ -600,7 +636,7 @@ var trimTrailingNewlines = (str) => {
|
|
|
600
636
|
}
|
|
601
637
|
return str.slice(0, end);
|
|
602
638
|
};
|
|
603
|
-
var HighlightedCodeBlockBody = /* @__PURE__ */ lazy(() => import("./highlighted-body-
|
|
639
|
+
var HighlightedCodeBlockBody = /* @__PURE__ */ lazy(() => import("./highlighted-body-F5VO3CPW.js").then((mod) => ({ default: mod.HighlightedCodeBlockBody })));
|
|
604
640
|
var CodeBlock = ({
|
|
605
641
|
code,
|
|
606
642
|
language,
|
|
@@ -611,10 +647,12 @@ var CodeBlock = ({
|
|
|
611
647
|
lineNumbers,
|
|
612
648
|
...rest
|
|
613
649
|
}) => {
|
|
650
|
+
let __hks, __hkd0, __hke, __hks$, __hkd0$, __hke$;
|
|
614
651
|
const cn2 = _$withSlot4(_h$05, useCn, _h$05);
|
|
615
|
-
const trimmedCode =
|
|
616
|
-
const raw =
|
|
617
|
-
|
|
652
|
+
const trimmedCode = (__hkd0 = code, __hks = _$memoSlot3(_h$13, "useMemo"), __hke = _$memoTake12(__hks, __hkd0), __hke === null ? _$memoPublish3(__hks, trimTrailingNewlines(code), __hkd0) : __hke.value);
|
|
653
|
+
const raw = (__hkd0$ = trimmedCode, __hks$ = _$memoSlot3(_h$23, "useMemo"), __hke$ = _$memoTake12(__hks$, __hkd0$), __hke$ === null ? _$memoPublish3(
|
|
654
|
+
__hks$,
|
|
655
|
+
{
|
|
618
656
|
bg: "transparent",
|
|
619
657
|
fg: "inherit",
|
|
620
658
|
tokens: trimmedCode.split("\n").map((line) => [
|
|
@@ -626,10 +664,9 @@ var CodeBlock = ({
|
|
|
626
664
|
offset: 0
|
|
627
665
|
}
|
|
628
666
|
])
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
);
|
|
667
|
+
},
|
|
668
|
+
__hkd0$
|
|
669
|
+
) : __hke$.value);
|
|
633
670
|
return _$createScopedValue4(() => _$createScopedElement3(CodeBlockContext.Provider, { value: { code } }, () => _$createScopedValue4(() => _$createScopedElement3(CodeBlockContainer, { isIncomplete, language }, () => _$positionalChildren([
|
|
634
671
|
_$createScopedValue4(() => _$createElement2(CodeBlockHeader, { language })),
|
|
635
672
|
children ? _$createScopedValue4(() => _$createScopedElement3(
|
|
@@ -1467,6 +1504,11 @@ import {
|
|
|
1467
1504
|
useState as useState3,
|
|
1468
1505
|
withSlot as _$withSlot8
|
|
1469
1506
|
} from "octane";
|
|
1507
|
+
import {
|
|
1508
|
+
memoPublish as _$memoPublish4,
|
|
1509
|
+
memoSlot as _$memoSlot4,
|
|
1510
|
+
memoTake2 as _$memoTake22
|
|
1511
|
+
} from "octane/internal/client";
|
|
1470
1512
|
var _hs$10 = /* @__PURE__ */ _$hookSlots10(8);
|
|
1471
1513
|
var _h$010 = /* @__PURE__ */ Symbol(_hs$10);
|
|
1472
1514
|
var _h$18 = /* @__PURE__ */ Symbol(_hs$10 + 1);
|
|
@@ -1486,6 +1528,7 @@ var ImageComponent = ({
|
|
|
1486
1528
|
onError: onErrorProp,
|
|
1487
1529
|
...props
|
|
1488
1530
|
}) => {
|
|
1531
|
+
let __hks, __hkd0, __hkd1, __hke, __hks$, __hkd0$, __hkd1$, __hke$;
|
|
1489
1532
|
const { DownloadIcon: DownloadIcon2 } = _$withSlot8(_h$010, useIcons, _h$010);
|
|
1490
1533
|
const cn2 = _$withSlot8(_h$18, useCn, _h$18);
|
|
1491
1534
|
const imgRef = useRef4(null, _h$26);
|
|
@@ -1508,22 +1551,24 @@ var ImageComponent = ({
|
|
|
1508
1551
|
[src],
|
|
1509
1552
|
_h$53
|
|
1510
1553
|
);
|
|
1511
|
-
const handleLoad = useCallback(
|
|
1554
|
+
const handleLoad = (__hkd0 = onLoadProp, __hkd1 = src, __hks = _$memoSlot4(_h$63, "useCallback"), __hke = _$memoTake22(__hks, __hkd0, __hkd1), __hke === null ? _$memoPublish4(
|
|
1555
|
+
__hks,
|
|
1512
1556
|
(event) => {
|
|
1513
1557
|
setImageState({ error: false, loaded: true, source: src });
|
|
1514
1558
|
onLoadProp?.(event);
|
|
1515
1559
|
},
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
);
|
|
1519
|
-
const handleError = useCallback(
|
|
1560
|
+
__hkd0,
|
|
1561
|
+
__hkd1
|
|
1562
|
+
) : __hke.value);
|
|
1563
|
+
const handleError = (__hkd0$ = onErrorProp, __hkd1$ = src, __hks$ = _$memoSlot4(_h$72, "useCallback"), __hke$ = _$memoTake22(__hks$, __hkd0$, __hkd1$), __hke$ === null ? _$memoPublish4(
|
|
1564
|
+
__hks$,
|
|
1520
1565
|
(event) => {
|
|
1521
1566
|
setImageState({ error: true, loaded: false, source: src });
|
|
1522
1567
|
onErrorProp?.(event);
|
|
1523
1568
|
},
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
);
|
|
1569
|
+
__hkd0$,
|
|
1570
|
+
__hkd1$
|
|
1571
|
+
) : __hke$.value);
|
|
1527
1572
|
const downloadImage = async () => {
|
|
1528
1573
|
if (!src) {
|
|
1529
1574
|
return;
|
|
@@ -1619,6 +1664,12 @@ import {
|
|
|
1619
1664
|
useState as useState4,
|
|
1620
1665
|
withSlot as _$withSlot9
|
|
1621
1666
|
} from "octane";
|
|
1667
|
+
import {
|
|
1668
|
+
memoPublish as _$memoPublish5,
|
|
1669
|
+
memoSlot as _$memoSlot5,
|
|
1670
|
+
memoTake1 as _$memoTake13,
|
|
1671
|
+
memoTake2 as _$memoTake23
|
|
1672
|
+
} from "octane/internal/client";
|
|
1622
1673
|
|
|
1623
1674
|
// src/lib/scroll-lock.ts
|
|
1624
1675
|
var activeCount = 0;
|
|
@@ -1645,11 +1696,13 @@ var _h$44 = /* @__PURE__ */ Symbol(_hs$11 + 4);
|
|
|
1645
1696
|
var _h$54 = /* @__PURE__ */ Symbol(_hs$11 + 5);
|
|
1646
1697
|
var _h$64 = /* @__PURE__ */ Symbol(_hs$11 + 6);
|
|
1647
1698
|
var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
1699
|
+
let __hks, __hkd0, __hke, __hks$, __hkd0$, __hkd1, __hke$;
|
|
1648
1700
|
const { CheckIcon: CheckIcon2, CopyIcon: CopyIcon2, ExternalLinkIcon: ExternalLinkIcon2, XIcon: XIcon2 } = _$withSlot9(_h$011, useIcons, _h$011);
|
|
1649
1701
|
const cn2 = _$withSlot9(_h$19, useCn, _h$19);
|
|
1650
1702
|
const [copied, setCopied] = useState4(false, _h$27);
|
|
1651
1703
|
const t = _$withSlot9(_h$35, useTranslations, _h$35);
|
|
1652
|
-
const handleCopy =
|
|
1704
|
+
const handleCopy = (__hkd0 = url, __hks = _$memoSlot5(_h$44, "useCallback"), __hke = _$memoTake13(__hks, __hkd0), __hke === null ? _$memoPublish5(
|
|
1705
|
+
__hks,
|
|
1653
1706
|
async () => {
|
|
1654
1707
|
try {
|
|
1655
1708
|
await navigator.clipboard.writeText(url);
|
|
@@ -1658,17 +1711,17 @@ var LinkSafetyModal = ({ url, isOpen, onClose, onConfirm }) => {
|
|
|
1658
1711
|
} catch {
|
|
1659
1712
|
}
|
|
1660
1713
|
},
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
)
|
|
1664
|
-
|
|
1714
|
+
__hkd0
|
|
1715
|
+
) : __hke.value);
|
|
1716
|
+
const handleConfirm = (__hkd0$ = onConfirm, __hkd1 = onClose, __hks$ = _$memoSlot5(_h$54, "useCallback"), __hke$ = _$memoTake23(__hks$, __hkd0$, __hkd1), __hke$ === null ? _$memoPublish5(
|
|
1717
|
+
__hks$,
|
|
1665
1718
|
() => {
|
|
1666
1719
|
onConfirm();
|
|
1667
1720
|
onClose();
|
|
1668
1721
|
},
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
);
|
|
1722
|
+
__hkd0$,
|
|
1723
|
+
__hkd1
|
|
1724
|
+
) : __hke$.value);
|
|
1672
1725
|
useEffect4(
|
|
1673
1726
|
() => {
|
|
1674
1727
|
if (isOpen) {
|
|
@@ -2789,7 +2842,7 @@ var _h$262 = /* @__PURE__ */ Symbol(_hs$19 + 26);
|
|
|
2789
2842
|
var _h$272 = /* @__PURE__ */ Symbol(_hs$19 + 27);
|
|
2790
2843
|
var START_LINE_PATTERN = /startLine=(\d+)/;
|
|
2791
2844
|
var NO_LINE_NUMBERS_PATTERN = /\bnoLineNumbers\b/;
|
|
2792
|
-
var Mermaid2 = /* @__PURE__ */ lazy2(() => import("./mermaid-
|
|
2845
|
+
var Mermaid2 = /* @__PURE__ */ lazy2(() => import("./mermaid-DL22PFDA.js").then((mod) => ({ default: mod.Mermaid })));
|
|
2793
2846
|
var LANGUAGE_REGEX = /language-([^\s]+)/;
|
|
2794
2847
|
function sameNodePosition(prev, next) {
|
|
2795
2848
|
if (!(prev?.position || next?.position)) {
|
|
@@ -2929,11 +2982,13 @@ var MemoStrong = memo2(
|
|
|
2929
2982
|
);
|
|
2930
2983
|
Object.assign(MemoStrong, { displayName: "MarkdownStrong" });
|
|
2931
2984
|
var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
2985
|
+
let __hks, __hkd0, __hkd1, __hkd2, __hke, __hks$, __hkd0$, __hke$, __hks$$, __hke$$;
|
|
2932
2986
|
const cn2 = _$withSlot17(_h$59, useCn, _h$59);
|
|
2933
2987
|
const { linkSafety } = useContext14(StreamdownContext);
|
|
2934
2988
|
const [isModalOpen, setIsModalOpen] = useState10(false, _h$68);
|
|
2935
2989
|
const isIncomplete = href === "streamdown:incomplete-link";
|
|
2936
|
-
const handleClick =
|
|
2990
|
+
const handleClick = (__hkd0 = linkSafety, __hkd1 = href, __hkd2 = isIncomplete, __hks = _$memoSlot6(_h$75, "useCallback"), __hke = _$memoTake32(__hks, __hkd0, __hkd1, __hkd2), __hke === null ? _$memoPublish6(
|
|
2991
|
+
__hks,
|
|
2937
2992
|
async (e) => {
|
|
2938
2993
|
if (!(linkSafety?.enabled && href) || isIncomplete) {
|
|
2939
2994
|
return;
|
|
@@ -2948,25 +3003,22 @@ var LinkComponent = ({ children, className, href, node, ...props }) => {
|
|
|
2948
3003
|
}
|
|
2949
3004
|
setIsModalOpen(true);
|
|
2950
3005
|
},
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
3006
|
+
__hkd0,
|
|
3007
|
+
__hkd1,
|
|
3008
|
+
__hkd2
|
|
3009
|
+
) : __hke.value);
|
|
3010
|
+
const handleConfirm = (__hkd0$ = href, __hks$ = _$memoSlot6(_h$82, "useCallback"), __hke$ = _$memoTake14(__hks$, __hkd0$), __hke$ === null ? _$memoPublish6(
|
|
3011
|
+
__hks$,
|
|
2955
3012
|
() => {
|
|
2956
3013
|
if (href) {
|
|
2957
3014
|
window.open(href, "_blank", "noreferrer");
|
|
2958
3015
|
}
|
|
2959
3016
|
},
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
)
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
setIsModalOpen(false);
|
|
2966
|
-
},
|
|
2967
|
-
[],
|
|
2968
|
-
_h$9
|
|
2969
|
-
);
|
|
3017
|
+
__hkd0$
|
|
3018
|
+
) : __hke$.value);
|
|
3019
|
+
const handleCloseModal = (__hks$$ = _$memoSlot6(_h$9, "useCallback"), __hke$$ = _$memoTake02(__hks$$), __hke$$ === null ? _$memoPublish6(__hks$$, () => {
|
|
3020
|
+
setIsModalOpen(false);
|
|
3021
|
+
}) : __hke$$.value);
|
|
2970
3022
|
const modalProps = {
|
|
2971
3023
|
url: href ?? "",
|
|
2972
3024
|
isOpen: isModalOpen,
|
|
@@ -4100,9 +4152,10 @@ var Streamdown = memo3(({
|
|
|
4100
4152
|
onAnimationEnd,
|
|
4101
4153
|
...props
|
|
4102
4154
|
}) => {
|
|
4155
|
+
let __hks, __hkd0, __hke, __hks$, __hkd0$, __hke$, __hks$$, __hkd0$$, __hkd1, __hke$$, __hks$$$, __hkd0$$$, __hkd1$, __hke$$$, __hks$$$$, __hkd0$$$$, __hkd1$$, __hke$$$$, __hkr, __hks$$$$$, __hkd0$$$$$, __hkv, __hke$$$$$, __hkr$, __hks$$$$$$, __hkd0$$$$$$, __hkv$, __hke$$$$$$, __hks$$$$$$$, __hkd0$$$$$$$, __hke$$$$$$$, __hks$$$$$$$$, __hkd0$$$$$$$$, __hke$$$$$$$$, __hkr$$, __hks$$$$$$$$$, __hkd0$$$$$$$$$, __hkd1$$$, __hkd2, __hkv$$, __hke$$$$$$$$$, __hkr$$$, __hks$$$$$$$$$$, __hkd0$$$$$$$$$$, __hkd1$$$$, __hkv$$$, __hke$$$$$$$$$$, __hks$$$$$$$$$$$, __hkd0$$$$$$$$$$$, __hkd1$$$$$, __hkd2$, __hke$$$$$$$$$$$;
|
|
4103
4156
|
const generatedId = useId(_h$020);
|
|
4104
4157
|
const [_isPending, startTransition] = useTransition(_h$117);
|
|
4105
|
-
const prefixedCn =
|
|
4158
|
+
const prefixedCn = (__hkd0 = prefix, __hks = _$memoSlot7(_h$215, "useMemo"), __hke = _$memoTake15(__hks, __hkd0), __hke === null ? _$memoPublish7(__hks, createCn(prefix), __hkd0) : __hke.value);
|
|
4106
4159
|
const prevIsAnimatingRef = useRef8(null, _h$313);
|
|
4107
4160
|
const onAnimationStartRef = useRef8(onAnimationStart, _h$412);
|
|
4108
4161
|
const onAnimationEndRef = useRef8(onAnimationEnd, _h$510);
|
|
@@ -4130,7 +4183,7 @@ var Streamdown = memo3(({
|
|
|
4130
4183
|
[isAnimating, mode],
|
|
4131
4184
|
_h$69
|
|
4132
4185
|
);
|
|
4133
|
-
const allowedTagNames =
|
|
4186
|
+
const allowedTagNames = (__hkd0$ = allowedTags, __hks$ = _$memoSlot7(_h$76, "useMemo"), __hke$ = _$memoTake15(__hks$, __hkd0$), __hke$ === null ? _$memoPublish7(__hks$, allowedTags ? Object.keys(allowedTags) : [], __hkd0$) : __hke$.value);
|
|
4134
4187
|
const processedChildren = useMemo4(
|
|
4135
4188
|
() => {
|
|
4136
4189
|
if (typeof children !== "string") {
|
|
@@ -4155,7 +4208,7 @@ var Streamdown = memo3(({
|
|
|
4155
4208
|
],
|
|
4156
4209
|
_h$83
|
|
4157
4210
|
);
|
|
4158
|
-
const blocks =
|
|
4211
|
+
const blocks = (__hkd0$$ = processedChildren, __hkd1 = parseMarkdownIntoBlocksFn, __hks$$ = _$memoSlot7(_h$92, "useMemo"), __hke$$ = _$memoTake24(__hks$$, __hkd0$$, __hkd1), __hke$$ === null ? _$memoPublish7(__hks$$, parseMarkdownIntoBlocksFn(processedChildren), __hkd0$$, __hkd1) : __hke$$.value);
|
|
4159
4212
|
const [displayBlocks, setDisplayBlocks] = useState11(blocks, _h$102);
|
|
4160
4213
|
useEffect10(
|
|
4161
4214
|
() => {
|
|
@@ -4171,34 +4224,64 @@ var Streamdown = memo3(({
|
|
|
4171
4224
|
_h$118
|
|
4172
4225
|
);
|
|
4173
4226
|
const blocksToRender = mode === "streaming" ? displayBlocks : blocks;
|
|
4174
|
-
const blockDirections =
|
|
4175
|
-
const blockKeys =
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4227
|
+
const blockDirections = (__hkd0$$$ = blocksToRender, __hkd1$ = dir, __hks$$$ = _$memoSlot7(_h$123, "useMemo"), __hke$$$ = _$memoTake24(__hks$$$, __hkd0$$$, __hkd1$), __hke$$$ === null ? _$memoPublish7(__hks$$$, dir === "auto" ? blocksToRender.map(detectTextDirection) : void 0, __hkd0$$$, __hkd1$) : __hke$$$.value);
|
|
4228
|
+
const blockKeys = (__hkd0$$$$ = blocksToRender.length, __hkd1$$ = generatedId, __hks$$$$ = _$memoSlot7(_h$133, "useMemo"), __hke$$$$ = _$memoTake24(__hks$$$$, __hkd0$$$$, __hkd1$$), __hke$$$$ === null ? _$memoPublish7(__hks$$$$, blocksToRender.map((_block, idx) => `${generatedId}-${idx}`), __hkd0$$$$, __hkd1$$) : __hke$$$$.value);
|
|
4229
|
+
{
|
|
4230
|
+
__hkd0$$$$$ = animated;
|
|
4231
|
+
__hks$$$$$ = _$memoSlot7(_h$143, "useMemo");
|
|
4232
|
+
__hke$$$$$ = _$memoTake15(__hks$$$$$, __hkd0$$$$$);
|
|
4233
|
+
if (__hke$$$$$ === null) {
|
|
4234
|
+
__hkl: {
|
|
4235
|
+
if (animated === true) {
|
|
4236
|
+
{
|
|
4237
|
+
__hkv = "true";
|
|
4238
|
+
break __hkl;
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
if (animated) {
|
|
4242
|
+
{
|
|
4243
|
+
__hkv = JSON.stringify(animated);
|
|
4244
|
+
break __hkl;
|
|
4245
|
+
}
|
|
4246
|
+
}
|
|
4247
|
+
{
|
|
4248
|
+
__hkv = "";
|
|
4249
|
+
break __hkl;
|
|
4250
|
+
}
|
|
4251
|
+
__hkv = void 0;
|
|
4193
4252
|
}
|
|
4194
|
-
|
|
4195
|
-
|
|
4253
|
+
__hkr = _$memoPublish7(__hks$$$$$, __hkv, __hkd0$$$$$);
|
|
4254
|
+
} else __hkr = __hke$$$$$.value;
|
|
4255
|
+
}
|
|
4256
|
+
const animatedKey = __hkr;
|
|
4257
|
+
{
|
|
4258
|
+
__hkd0$$$$$$ = animatedKey;
|
|
4259
|
+
__hks$$$$$$ = _$memoSlot7(_h$153, "useMemo");
|
|
4260
|
+
__hke$$$$$$ = _$memoTake15(__hks$$$$$$, __hkd0$$$$$$);
|
|
4261
|
+
if (__hke$$$$$$ === null) {
|
|
4262
|
+
__hkl$: {
|
|
4263
|
+
if (!animatedKey) {
|
|
4264
|
+
{
|
|
4265
|
+
__hkv$ = null;
|
|
4266
|
+
break __hkl$;
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
if (animatedKey === "true") {
|
|
4270
|
+
{
|
|
4271
|
+
__hkv$ = createAnimatePlugin();
|
|
4272
|
+
break __hkl$;
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
{
|
|
4276
|
+
__hkv$ = createAnimatePlugin(animated);
|
|
4277
|
+
break __hkl$;
|
|
4278
|
+
}
|
|
4279
|
+
__hkv$ = void 0;
|
|
4196
4280
|
}
|
|
4197
|
-
|
|
4198
|
-
}
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
);
|
|
4281
|
+
__hkr$ = _$memoPublish7(__hks$$$$$$, __hkv$, __hkd0$$$$$$);
|
|
4282
|
+
} else __hkr$ = __hke$$$$$$.value;
|
|
4283
|
+
}
|
|
4284
|
+
const animatePlugin = __hkr$;
|
|
4202
4285
|
const contextValue = useMemo4(
|
|
4203
4286
|
() => ({
|
|
4204
4287
|
shikiTheme: plugins?.code?.getThemes() ?? shikiTheme,
|
|
@@ -4221,8 +4304,8 @@ var Streamdown = memo3(({
|
|
|
4221
4304
|
],
|
|
4222
4305
|
_h$163
|
|
4223
4306
|
);
|
|
4224
|
-
const translationsKey =
|
|
4225
|
-
const translationsValue =
|
|
4307
|
+
const translationsKey = (__hkd0$$$$$$$ = translations, __hks$$$$$$$ = _$memoSlot7(_h$173, "useMemo"), __hke$$$$$$$ = _$memoTake15(__hks$$$$$$$, __hkd0$$$$$$$), __hke$$$$$$$ === null ? _$memoPublish7(__hks$$$$$$$, translations ? JSON.stringify(translations) : "", __hkd0$$$$$$$) : __hke$$$$$$$.value);
|
|
4308
|
+
const translationsValue = (__hkd0$$$$$$$$ = translationsKey, __hks$$$$$$$$ = _$memoSlot7(_h$183, "useMemo"), __hke$$$$$$$$ = _$memoTake15(__hks$$$$$$$$, __hkd0$$$$$$$$), __hke$$$$$$$$ === null ? _$memoPublish7(__hks$$$$$$$$, { ...defaultTranslations, ...translations }, __hkd0$$$$$$$$) : __hke$$$$$$$$.value);
|
|
4226
4309
|
const mergedComponents = useMemo4(
|
|
4227
4310
|
() => {
|
|
4228
4311
|
const { inlineCode, ...userComponents } = components2 ?? {};
|
|
@@ -4242,24 +4325,35 @@ var Streamdown = memo3(({
|
|
|
4242
4325
|
[components2],
|
|
4243
4326
|
_h$193
|
|
4244
4327
|
);
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
result = [
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4328
|
+
{
|
|
4329
|
+
__hkd0$$$$$$$$$ = remarkPlugins;
|
|
4330
|
+
__hkd1$$$ = plugins?.math;
|
|
4331
|
+
__hkd2 = plugins?.cjk;
|
|
4332
|
+
__hks$$$$$$$$$ = _$memoSlot7(_h$202, "useMemo");
|
|
4333
|
+
__hke$$$$$$$$$ = _$memoTake33(__hks$$$$$$$$$, __hkd0$$$$$$$$$, __hkd1$$$, __hkd2);
|
|
4334
|
+
if (__hke$$$$$$$$$ === null) {
|
|
4335
|
+
__hkl$$: {
|
|
4336
|
+
let result = [];
|
|
4337
|
+
if (plugins?.cjk) {
|
|
4338
|
+
result = [...result, ...plugins.cjk.remarkPluginsBefore];
|
|
4339
|
+
}
|
|
4340
|
+
result = [...result, ...remarkPlugins];
|
|
4341
|
+
if (plugins?.cjk) {
|
|
4342
|
+
result = [...result, ...plugins.cjk.remarkPluginsAfter];
|
|
4343
|
+
}
|
|
4344
|
+
if (plugins?.math) {
|
|
4345
|
+
result = [...result, plugins.math.remarkPlugin];
|
|
4346
|
+
}
|
|
4347
|
+
{
|
|
4348
|
+
__hkv$$ = result;
|
|
4349
|
+
break __hkl$$;
|
|
4350
|
+
}
|
|
4351
|
+
__hkv$$ = void 0;
|
|
4257
4352
|
}
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
);
|
|
4353
|
+
__hkr$$ = _$memoPublish7(__hks$$$$$$$$$, __hkv$$, __hkd0$$$$$$$$$, __hkd1$$$, __hkd2);
|
|
4354
|
+
} else __hkr$$ = __hke$$$$$$$$$.value;
|
|
4355
|
+
}
|
|
4356
|
+
const mergedRemarkPlugins = __hkr$$;
|
|
4263
4357
|
const mergedRehypePlugins = useMemo4(
|
|
4264
4358
|
() => {
|
|
4265
4359
|
let result = rehypePlugins;
|
|
@@ -4299,22 +4393,37 @@ var Streamdown = memo3(({
|
|
|
4299
4393
|
],
|
|
4300
4394
|
_h$216
|
|
4301
4395
|
);
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4396
|
+
{
|
|
4397
|
+
__hkd0$$$$$$$$$$ = isAnimating;
|
|
4398
|
+
__hkd1$$$$ = blocksToRender;
|
|
4399
|
+
__hks$$$$$$$$$$ = _$memoSlot7(_h$223, "useMemo");
|
|
4400
|
+
__hke$$$$$$$$$$ = _$memoTake24(__hks$$$$$$$$$$, __hkd0$$$$$$$$$$, __hkd1$$$$);
|
|
4401
|
+
if (__hke$$$$$$$$$$ === null) {
|
|
4402
|
+
__hkl$$$: {
|
|
4403
|
+
if (!isAnimating || blocksToRender.length === 0) {
|
|
4404
|
+
{
|
|
4405
|
+
__hkv$$$ = false;
|
|
4406
|
+
break __hkl$$$;
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
const lastBlock = blocksToRender.at(-1);
|
|
4410
|
+
{
|
|
4411
|
+
__hkv$$$ = hasIncompleteCodeFence(lastBlock) || hasTable(lastBlock);
|
|
4412
|
+
break __hkl$$$;
|
|
4413
|
+
}
|
|
4414
|
+
__hkv$$$ = void 0;
|
|
4306
4415
|
}
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
);
|
|
4416
|
+
__hkr$$$ = _$memoPublish7(__hks$$$$$$$$$$, __hkv$$$, __hkd0$$$$$$$$$$, __hkd1$$$$);
|
|
4417
|
+
} else __hkr$$$ = __hke$$$$$$$$$$.value;
|
|
4418
|
+
}
|
|
4419
|
+
const shouldHideCaret = __hkr$$$;
|
|
4420
|
+
const style = (__hkd0$$$$$$$$$$$ = caret, __hkd1$$$$$ = isAnimating, __hkd2$ = shouldHideCaret, __hks$$$$$$$$$$$ = _$memoSlot7(_h$233, "useMemo"), __hke$$$$$$$$$$$ = _$memoTake33(__hks$$$$$$$$$$$, __hkd0$$$$$$$$$$$, __hkd1$$$$$, __hkd2$), __hke$$$$$$$$$$$ === null ? _$memoPublish7(
|
|
4421
|
+
__hks$$$$$$$$$$$,
|
|
4422
|
+
caret && isAnimating && !shouldHideCaret ? { "--streamdown-caret": `"${carets[caret]}"` } : void 0,
|
|
4423
|
+
__hkd0$$$$$$$$$$$,
|
|
4424
|
+
__hkd1$$$$$,
|
|
4425
|
+
__hkd2$
|
|
4426
|
+
) : __hke$$$$$$$$$$$.value);
|
|
4318
4427
|
if (mode === "static") {
|
|
4319
4428
|
animatePlugin?.setActiveBlock("static");
|
|
4320
4429
|
return _$createScopedValue19(() => _$createScopedElement17(TranslationsContext.Provider, { value: translationsValue }, () => _$createScopedValue19(() => _$createScopedElement17(PluginContext.Provider, { value: plugins ?? null }, () => _$createScopedValue19(() => _$createScopedElement17(StreamdownContext.Provider, { value: contextValue }, () => _$createScopedValue19(() => _$createScopedElement17(IconProvider, { icons: iconOverrides }, () => _$createScopedValue19(() => _$createScopedElement17(PrefixContext.Provider, { value: prefixedCn }, () => _$createScopedValue19(() => _$createScopedElement17(
|
|
@@ -4383,6 +4492,14 @@ import {
|
|
|
4383
4492
|
useState as useState12,
|
|
4384
4493
|
withSlot as _$withSlot18
|
|
4385
4494
|
} from "octane";
|
|
4495
|
+
import {
|
|
4496
|
+
memoPublish as _$memoPublish8,
|
|
4497
|
+
memoSlot as _$memoSlot8,
|
|
4498
|
+
memoTake0 as _$memoTake03,
|
|
4499
|
+
memoTake1 as _$memoTake16,
|
|
4500
|
+
memoTake2 as _$memoTake25,
|
|
4501
|
+
memoTake3 as _$memoTake34
|
|
4502
|
+
} from "octane/internal/client";
|
|
4386
4503
|
var _hs$21 = /* @__PURE__ */ _$hookSlots21(19);
|
|
4387
4504
|
var _h$021 = /* @__PURE__ */ Symbol(_hs$21);
|
|
4388
4505
|
var _h$119 = /* @__PURE__ */ Symbol(_hs$21 + 1);
|
|
@@ -4413,6 +4530,7 @@ var PanZoom = ({
|
|
|
4413
4530
|
initialZoom = 1,
|
|
4414
4531
|
fullscreen = false
|
|
4415
4532
|
}) => {
|
|
4533
|
+
let __hks, __hkd0, __hkd1, __hke, __hks$, __hkd0$, __hkd1$, __hke$, __hks$$, __hkd0$$, __hkd1$$, __hke$$, __hks$$$, __hkd0$$$, __hke$$$, __hks$$$$, __hkd0$$$$, __hkd1$$$, __hke$$$$, __hks$$$$$, __hkd0$$$$$, __hke$$$$$, __hks$$$$$$, __hkd0$$$$$$, __hkd1$$$$, __hkd2, __hke$$$$$$, __hks$$$$$$$, __hke$$$$$$$;
|
|
4416
4534
|
const { RotateCcwIcon: RotateCcwIcon2, ZoomInIcon: ZoomInIcon2, ZoomOutIcon: ZoomOutIcon2 } = _$withSlot18(_h$021, useIcons, _h$021);
|
|
4417
4535
|
const cn2 = _$withSlot18(_h$119, useCn, _h$119);
|
|
4418
4536
|
const containerRef = useRef9(null, _h$217);
|
|
@@ -4422,48 +4540,53 @@ var PanZoom = ({
|
|
|
4422
4540
|
const [isPanning, setIsPanning] = useState12(false, _h$610);
|
|
4423
4541
|
const [panStart, setPanStart] = useState12({ x: 0, y: 0 }, _h$77);
|
|
4424
4542
|
const [panStartPosition, setPanStartPosition] = useState12({ x: 0, y: 0 }, _h$84);
|
|
4425
|
-
const handleZoom =
|
|
4543
|
+
const handleZoom = (__hkd0 = minZoom, __hkd1 = maxZoom, __hks = _$memoSlot8(_h$93, "useCallback"), __hke = _$memoTake25(__hks, __hkd0, __hkd1), __hke === null ? _$memoPublish8(
|
|
4544
|
+
__hks,
|
|
4426
4545
|
(delta) => {
|
|
4427
4546
|
setZoom((prevZoom) => {
|
|
4428
4547
|
const newZoom = Math.max(minZoom, Math.min(maxZoom, prevZoom + delta));
|
|
4429
4548
|
return newZoom;
|
|
4430
4549
|
});
|
|
4431
4550
|
},
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
);
|
|
4435
|
-
const handleZoomIn =
|
|
4551
|
+
__hkd0,
|
|
4552
|
+
__hkd1
|
|
4553
|
+
) : __hke.value);
|
|
4554
|
+
const handleZoomIn = (__hkd0$ = handleZoom, __hkd1$ = zoomStep, __hks$ = _$memoSlot8(_h$103, "useCallback"), __hke$ = _$memoTake25(__hks$, __hkd0$, __hkd1$), __hke$ === null ? _$memoPublish8(
|
|
4555
|
+
__hks$,
|
|
4436
4556
|
() => {
|
|
4437
4557
|
handleZoom(zoomStep);
|
|
4438
4558
|
},
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
);
|
|
4442
|
-
const handleZoomOut =
|
|
4559
|
+
__hkd0$,
|
|
4560
|
+
__hkd1$
|
|
4561
|
+
) : __hke$.value);
|
|
4562
|
+
const handleZoomOut = (__hkd0$$ = handleZoom, __hkd1$$ = zoomStep, __hks$$ = _$memoSlot8(_h$1110, "useCallback"), __hke$$ = _$memoTake25(__hks$$, __hkd0$$, __hkd1$$), __hke$$ === null ? _$memoPublish8(
|
|
4563
|
+
__hks$$,
|
|
4443
4564
|
() => {
|
|
4444
4565
|
handleZoom(-zoomStep);
|
|
4445
4566
|
},
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
);
|
|
4449
|
-
const handleReset =
|
|
4567
|
+
__hkd0$$,
|
|
4568
|
+
__hkd1$$
|
|
4569
|
+
) : __hke$$.value);
|
|
4570
|
+
const handleReset = (__hkd0$$$ = initialZoom, __hks$$$ = _$memoSlot8(_h$124, "useCallback"), __hke$$$ = _$memoTake16(__hks$$$, __hkd0$$$), __hke$$$ === null ? _$memoPublish8(
|
|
4571
|
+
__hks$$$,
|
|
4450
4572
|
() => {
|
|
4451
4573
|
setZoom(initialZoom);
|
|
4452
4574
|
setPan({ x: 0, y: 0 });
|
|
4453
4575
|
},
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
)
|
|
4457
|
-
|
|
4576
|
+
__hkd0$$$
|
|
4577
|
+
) : __hke$$$.value);
|
|
4578
|
+
const handleWheel = (__hkd0$$$$ = handleZoom, __hkd1$$$ = zoomStep, __hks$$$$ = _$memoSlot8(_h$134, "useCallback"), __hke$$$$ = _$memoTake25(__hks$$$$, __hkd0$$$$, __hkd1$$$), __hke$$$$ === null ? _$memoPublish8(
|
|
4579
|
+
__hks$$$$,
|
|
4458
4580
|
(e) => {
|
|
4459
4581
|
e.preventDefault();
|
|
4460
4582
|
const delta = e.deltaY > 0 ? -zoomStep : zoomStep;
|
|
4461
4583
|
handleZoom(delta);
|
|
4462
4584
|
},
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
);
|
|
4466
|
-
const handlePointerDown =
|
|
4585
|
+
__hkd0$$$$,
|
|
4586
|
+
__hkd1$$$
|
|
4587
|
+
) : __hke$$$$.value);
|
|
4588
|
+
const handlePointerDown = (__hkd0$$$$$ = pan, __hks$$$$$ = _$memoSlot8(_h$144, "useCallback"), __hke$$$$$ = _$memoTake16(__hks$$$$$, __hkd0$$$$$), __hke$$$$$ === null ? _$memoPublish8(
|
|
4589
|
+
__hks$$$$$,
|
|
4467
4590
|
(e) => {
|
|
4468
4591
|
if (e.button !== 0 || e.isPrimary === false) {
|
|
4469
4592
|
return;
|
|
@@ -4476,10 +4599,10 @@ var PanZoom = ({
|
|
|
4476
4599
|
target.setPointerCapture(e.pointerId);
|
|
4477
4600
|
}
|
|
4478
4601
|
},
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
)
|
|
4482
|
-
|
|
4602
|
+
__hkd0$$$$$
|
|
4603
|
+
) : __hke$$$$$.value);
|
|
4604
|
+
const handlePointerMove = (__hkd0$$$$$$ = isPanning, __hkd1$$$$ = panStart, __hkd2 = panStartPosition, __hks$$$$$$ = _$memoSlot8(_h$154, "useCallback"), __hke$$$$$$ = _$memoTake34(__hks$$$$$$, __hkd0$$$$$$, __hkd1$$$$, __hkd2), __hke$$$$$$ === null ? _$memoPublish8(
|
|
4605
|
+
__hks$$$$$$,
|
|
4483
4606
|
(e) => {
|
|
4484
4607
|
if (!isPanning) {
|
|
4485
4608
|
return;
|
|
@@ -4492,20 +4615,17 @@ var PanZoom = ({
|
|
|
4492
4615
|
y: panStartPosition.y + deltaY
|
|
4493
4616
|
});
|
|
4494
4617
|
},
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
[],
|
|
4507
|
-
_h$164
|
|
4508
|
-
);
|
|
4618
|
+
__hkd0$$$$$$,
|
|
4619
|
+
__hkd1$$$$,
|
|
4620
|
+
__hkd2
|
|
4621
|
+
) : __hke$$$$$$.value);
|
|
4622
|
+
const handlePointerUp = (__hks$$$$$$$ = _$memoSlot8(_h$164, "useCallback"), __hke$$$$$$$ = _$memoTake03(__hks$$$$$$$), __hke$$$$$$$ === null ? _$memoPublish8(__hks$$$$$$$, (e) => {
|
|
4623
|
+
setIsPanning(false);
|
|
4624
|
+
const target = e.currentTarget;
|
|
4625
|
+
if (target instanceof HTMLElement) {
|
|
4626
|
+
target.releasePointerCapture(e.pointerId);
|
|
4627
|
+
}
|
|
4628
|
+
}) : __hke$$$$$$$.value);
|
|
4509
4629
|
useEffect11(
|
|
4510
4630
|
() => {
|
|
4511
4631
|
const container = containerRef.current;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
CodeBlockBody,
|
|
4
4
|
StreamdownContext,
|
|
5
5
|
useCodePlugin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-546NLYEB.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/code-block/highlighted-body.tsrx
|
|
9
9
|
import {
|
|
@@ -17,6 +17,11 @@ import {
|
|
|
17
17
|
useState,
|
|
18
18
|
withSlot as _$withSlot
|
|
19
19
|
} from "octane";
|
|
20
|
+
import {
|
|
21
|
+
memoPublish as _$memoPublish,
|
|
22
|
+
memoSlot as _$memoSlot,
|
|
23
|
+
memoTake4 as _$memoTake4
|
|
24
|
+
} from "octane/internal/client";
|
|
20
25
|
var _hs$ = /* @__PURE__ */ _$hookSlots(5);
|
|
21
26
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
22
27
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
@@ -32,9 +37,10 @@ var HighlightedCodeBlockBody = ({
|
|
|
32
37
|
lineNumbers,
|
|
33
38
|
...rest
|
|
34
39
|
}) => {
|
|
40
|
+
let __hks, __hkd0, __hkd1, __hkd2, __hkd3, __hke;
|
|
35
41
|
const { shikiTheme } = useContext(StreamdownContext);
|
|
36
42
|
const codePlugin = _$withSlot(_h$0, useCodePlugin, _h$0);
|
|
37
|
-
const request =
|
|
43
|
+
const request = (__hkd0 = code, __hkd1 = language, __hkd2 = codePlugin, __hkd3 = shikiTheme, __hks = _$memoSlot(_h$1, "useMemo"), __hke = _$memoTake4(__hks, __hkd0, __hkd1, __hkd2, __hkd3), __hke === null ? _$memoPublish(__hks, { code, language, plugin: codePlugin, themes: shikiTheme }, __hkd0, __hkd1, __hkd2, __hkd3) : __hke.value);
|
|
38
44
|
const [highlight, setHighlight] = useState({ request, result: raw }, _h$2);
|
|
39
45
|
const requestRef = useRef(request, _h$3);
|
|
40
46
|
requestRef.current = request;
|
package/dist/client/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/streamdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"unist-util-visit-parents": "^6.0.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"octane": "0.1.
|
|
95
|
+
"octane": "0.1.41"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"@streamdown/mermaid": "1.0.2",
|
|
109
109
|
"@streamdown/cjk": "1.0.3",
|
|
110
110
|
"vitest": "^4.1.10",
|
|
111
|
-
"@octanejs/testing-library": "0.1.
|
|
112
|
-
"octane": "0.1.
|
|
111
|
+
"@octanejs/testing-library": "0.1.38",
|
|
112
|
+
"octane": "0.1.41"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|
|
115
115
|
"build": "node scripts/build.mjs",
|