@opengeni/react 7.4.0 → 7.5.0-canary.36919050519001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -27
- package/dist/artifacts-document.js +3 -2
- package/dist/artifacts-presentation.js +3 -2
- package/dist/artifacts-spreadsheet.js +2 -2
- package/dist/artifacts.d.ts +1 -0
- package/dist/artifacts.js +516 -1413
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-2E6R2Y4W.js → browser-viewer-Z7S7QEJL.js} +6 -5
- package/dist/chat-interactive-block-UGBTNB3L.js +11 -0
- package/dist/{chunk-Y3QTZN2F.js → chunk-2VFNCX4E.js} +6 -6
- package/dist/{chunk-UDD6DLLT.js → chunk-3IJJEYW4.js} +15 -3
- package/dist/chunk-3IJJEYW4.js.map +1 -0
- package/dist/chunk-4RVYOY4O.js +379 -0
- package/dist/chunk-4RVYOY4O.js.map +1 -0
- package/dist/chunk-5CVXZA3Y.js +292 -0
- package/dist/chunk-5CVXZA3Y.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-5J4FOW6Q.js} +2 -10
- package/dist/chunk-5J4FOW6Q.js.map +1 -0
- package/dist/{chunk-KVERXCFY.js → chunk-5KYZIQFY.js} +40 -3
- package/dist/chunk-5KYZIQFY.js.map +1 -0
- package/dist/{chunk-KNDIXZN6.js → chunk-7UAMYXJY.js} +25 -18
- package/dist/{chunk-KNDIXZN6.js.map → chunk-7UAMYXJY.js.map} +1 -1
- package/dist/{chunk-SEEVCT36.js → chunk-A4UJB2MM.js} +2 -2
- package/dist/{chunk-X4HIN6TV.js → chunk-AFLPWUQ7.js} +71 -162
- package/dist/chunk-AFLPWUQ7.js.map +1 -0
- package/dist/chunk-B3V6TG77.js +41 -0
- package/dist/chunk-B3V6TG77.js.map +1 -0
- package/dist/{chunk-XEJEOAOV.js → chunk-B7WMS3CS.js} +51 -40
- package/dist/chunk-B7WMS3CS.js.map +1 -0
- package/dist/{chunk-S5JQ4R22.js → chunk-BDKR6BAR.js} +54 -24
- package/dist/chunk-BDKR6BAR.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-DYWBUX5Q.js} +24 -12
- package/dist/chunk-DYWBUX5Q.js.map +1 -0
- package/dist/{chunk-YZ3YYMOM.js → chunk-E3G7SAYZ.js} +252 -624
- package/dist/chunk-E3G7SAYZ.js.map +1 -0
- package/dist/chunk-JT4JW7BC.js +54 -0
- package/dist/chunk-JT4JW7BC.js.map +1 -0
- package/dist/{chunk-5AZSK6MV.js → chunk-LWNLETQT.js} +5 -5
- package/dist/{chunk-USXVQACU.js → chunk-M7LBYP63.js} +5 -4
- package/dist/{chunk-USXVQACU.js.map → chunk-M7LBYP63.js.map} +1 -1
- package/dist/{chunk-L4OSXQ6H.js → chunk-NBOHNRLJ.js} +1289 -1060
- package/dist/chunk-NBOHNRLJ.js.map +1 -0
- package/dist/chunk-RHREZ7BO.js +11 -0
- package/dist/chunk-RHREZ7BO.js.map +1 -0
- package/dist/chunk-SCOTPE2I.js +589 -0
- package/dist/chunk-SCOTPE2I.js.map +1 -0
- package/dist/chunk-WEHMPOXK.js +39 -0
- package/dist/chunk-WEHMPOXK.js.map +1 -0
- package/dist/chunk-WRHIZYZF.js +988 -0
- package/dist/chunk-WRHIZYZF.js.map +1 -0
- package/dist/{chunk-3E2AITTZ.js → chunk-WUISZ3WU.js} +32 -28
- package/dist/{chunk-3E2AITTZ.js.map → chunk-WUISZ3WU.js.map} +1 -1
- package/dist/chunk-XCHWDJ22.js +107 -0
- package/dist/chunk-XCHWDJ22.js.map +1 -0
- package/dist/{chunk-DUEBTL3N.js → chunk-Y2PRMYLC.js} +4 -3
- package/dist/{chunk-DUEBTL3N.js.map → chunk-Y2PRMYLC.js.map} +1 -1
- package/dist/chunk-YBXQDQFX.js +1772 -0
- package/dist/chunk-YBXQDQFX.js.map +1 -0
- package/dist/chunk-YV4L3ILF.js +9 -0
- package/dist/chunk-YV4L3ILF.js.map +1 -0
- package/dist/{chunk-V2ABIVYJ.js → chunk-ZXSEDZP7.js} +70 -6
- package/dist/chunk-ZXSEDZP7.js.map +1 -0
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +27 -0
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
- package/dist/components/artifacts/editable-artifact-view.d.ts +46 -0
- package/dist/components/artifacts/index.d.ts +7 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +23 -0
- package/dist/components/browser-select-control.d.ts +3 -1
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +20 -3
- package/dist/components/open-geni-links.d.ts +16 -0
- package/dist/components/session-conversation.d.ts +20 -1
- package/dist/components/timeline-pill-geometry.d.ts +8 -0
- package/dist/components/timeline-pill-placement.d.ts +24 -0
- package/dist/components/usage-limit-notice.d.ts +49 -0
- package/dist/components/usage-member-list.d.ts +91 -0
- package/dist/components/usage-meter.d.ts +73 -0
- package/dist/composer.js +5 -5
- package/dist/{computer-viewer-WMJE6OA3.js → computer-viewer-KJWLH3GI.js} +7 -5
- package/dist/connect.js +7 -6
- package/dist/connect.js.map +1 -1
- package/dist/conversation-timeline.d.ts +1 -1
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +26 -0
- package/dist/desktop.js.map +1 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +21 -0
- package/dist/editor.js.map +1 -0
- package/dist/hooks/latest-question.d.ts +1 -1
- package/dist/hooks/use-composer.d.ts +4 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +460 -1386
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +8 -6
- package/dist/interaction.js.map +1 -1
- package/dist/{latest-question-QB4EUCW5.js → latest-question-IS445HOW.js} +3 -3
- package/dist/lib/format.d.ts +6 -1
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/machines.js +2 -2
- package/dist/{markdown-table-layout-PFUEZ2U4.js → markdown-table-layout-QXSLK4BY.js} +37 -5
- package/dist/markdown-table-layout-QXSLK4BY.js.map +1 -0
- package/dist/{queue-surface-implementation-IM2HD3SK.js → queue-surface-implementation-2CAQAIHM.js} +2 -2
- package/dist/realtime.js +3 -3
- package/dist/{sandbox-files-PXPIZAFG.js → sandbox-files-AEJTWGT4.js} +8 -5
- package/dist/sandbox-files-AEJTWGT4.js.map +1 -0
- package/dist/session-ui.d.ts +9 -2
- package/dist/session-ui.js +39 -20
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +4 -4
- package/dist/sites.js +4 -289
- package/dist/sites.js.map +1 -1
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +31 -0
- package/dist/terminal.js.map +1 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/genie-loading.d.ts +3 -1
- package/dist/timeline/types.d.ts +8 -1
- package/dist/{timeline-annotation-selection-ODLVF4OI.js → timeline-annotation-selection-DMLMM2TX.js} +6 -1
- package/dist/timeline-annotation-selection-DMLMM2TX.js.map +1 -0
- package/dist/timeline-pill-geometry-Z23V243M.js +110 -0
- package/dist/timeline-pill-geometry-Z23V243M.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +13 -0
- package/dist/usage.js +1073 -0
- package/dist/usage.js.map +1 -0
- package/package.json +19 -3
- package/src/artifacts.ts +37 -0
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +185 -0
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +67 -0
- package/src/components/artifacts/editable-artifact-ui.tsx +3 -1
- package/src/components/artifacts/editable-artifact-view.tsx +187 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
- package/src/components/artifacts/editable-document.tsx +34 -36
- package/src/components/artifacts/editable-presentation.tsx +21 -16
- package/src/components/artifacts/index.ts +41 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/session-artifact-viewer.tsx +376 -0
- package/src/components/artifacts/site-view.tsx +116 -0
- package/src/components/browser-select-control.tsx +4 -1
- package/src/components/browser-viewer.tsx +81 -22
- package/src/components/code-editor.tsx +13 -16
- package/src/components/computer-viewer.tsx +51 -23
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/markdown-table-layout.ts +49 -5
- package/src/components/markdown.tsx +5 -2
- package/src/components/message-timeline.tsx +557 -516
- package/src/components/open-geni-links.tsx +24 -0
- package/src/components/sandbox-terminal.tsx +48 -11
- package/src/components/session-chrome.tsx +22 -3
- package/src/components/session-conversation.tsx +195 -102
- package/src/components/timeline-annotation-selection.tsx +7 -0
- package/src/components/timeline-pill-geometry.ts +169 -0
- package/src/components/timeline-pill-placement.ts +99 -0
- package/src/components/usage-limit-notice.tsx +179 -0
- package/src/components/usage-member-list.tsx +792 -0
- package/src/components/usage-meter.tsx +382 -0
- package/src/conversation-timeline.ts +10 -2
- package/src/desktop.ts +24 -0
- package/src/editor.ts +13 -0
- package/src/hooks/use-available-models.ts +1 -1
- package/src/hooks/use-composer.ts +57 -2
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-usage.ts +100 -0
- package/src/index.ts +22 -0
- package/src/lib/format.ts +32 -6
- package/src/lib/workbench-peers.ts +62 -0
- package/src/session-ui.ts +22 -0
- package/src/terminal.ts +26 -0
- package/src/timeline/activity-rail.tsx +5 -3
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/genie-loading.tsx +16 -6
- package/src/timeline/projection.ts +78 -4
- package/src/timeline/types.ts +8 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +50 -0
- package/styles/compiled.css +325 -0
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-KVERXCFY.js.map +0 -1
- package/dist/chunk-L4OSXQ6H.js.map +0 -1
- package/dist/chunk-S5JQ4R22.js.map +0 -1
- package/dist/chunk-UDD6DLLT.js.map +0 -1
- package/dist/chunk-UGMKPUEM.js +0 -299
- package/dist/chunk-UGMKPUEM.js.map +0 -1
- package/dist/chunk-V2ABIVYJ.js.map +0 -1
- package/dist/chunk-X4HIN6TV.js.map +0 -1
- package/dist/chunk-XEJEOAOV.js.map +0 -1
- package/dist/chunk-YZ3YYMOM.js.map +0 -1
- package/dist/markdown-table-layout-PFUEZ2U4.js.map +0 -1
- package/dist/timeline-annotation-selection-ODLVF4OI.js.map +0 -1
- /package/dist/{browser-viewer-2E6R2Y4W.js.map → browser-viewer-Z7S7QEJL.js.map} +0 -0
- /package/dist/{computer-viewer-WMJE6OA3.js.map → chat-interactive-block-UGBTNB3L.js.map} +0 -0
- /package/dist/{chunk-Y3QTZN2F.js.map → chunk-2VFNCX4E.js.map} +0 -0
- /package/dist/{chunk-SEEVCT36.js.map → chunk-A4UJB2MM.js.map} +0 -0
- /package/dist/{chunk-5AZSK6MV.js.map → chunk-LWNLETQT.js.map} +0 -0
- /package/dist/{sandbox-files-PXPIZAFG.js.map → computer-viewer-KJWLH3GI.js.map} +0 -0
- /package/dist/{latest-question-QB4EUCW5.js.map → latest-question-IS445HOW.js.map} +0 -0
- /package/dist/{queue-surface-implementation-IM2HD3SK.js.map → queue-surface-implementation-2CAQAIHM.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
editableArtifactAccessRevoked,
|
|
5
5
|
editableArtifactStatusLabel,
|
|
6
6
|
useEditableArtifactView
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Y2PRMYLC.js";
|
|
8
8
|
import {
|
|
9
9
|
cn
|
|
10
10
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -2835,4 +2835,4 @@ export {
|
|
|
2835
2835
|
EditableSpreadsheetGrid,
|
|
2836
2836
|
EditableSpreadsheetArtifactSurface
|
|
2837
2837
|
};
|
|
2838
|
-
//# sourceMappingURL=chunk-
|
|
2838
|
+
//# sourceMappingURL=chunk-A4UJB2MM.js.map
|
|
@@ -6,6 +6,14 @@ import {
|
|
|
6
6
|
rangeFromOffsets,
|
|
7
7
|
visibleClientRect
|
|
8
8
|
} from "./chunk-447JLCBU.js";
|
|
9
|
+
import {
|
|
10
|
+
chainLinkResolvers,
|
|
11
|
+
useOpenGeniLinkResolver
|
|
12
|
+
} from "./chunk-XCHWDJ22.js";
|
|
13
|
+
import {
|
|
14
|
+
copyTextToClipboard,
|
|
15
|
+
tableElementToTsv
|
|
16
|
+
} from "./chunk-JVYQRRC4.js";
|
|
9
17
|
import {
|
|
10
18
|
Tooltip,
|
|
11
19
|
TooltipContent,
|
|
@@ -15,14 +23,10 @@ import {
|
|
|
15
23
|
} from "./chunk-BRM6FVZA.js";
|
|
16
24
|
import {
|
|
17
25
|
stringifyPayload
|
|
18
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3IJJEYW4.js";
|
|
19
27
|
import {
|
|
20
28
|
cn
|
|
21
29
|
} from "./chunk-22KP6LR5.js";
|
|
22
|
-
import {
|
|
23
|
-
copyTextToClipboard,
|
|
24
|
-
tableElementToTsv
|
|
25
|
-
} from "./chunk-JVYQRRC4.js";
|
|
26
30
|
|
|
27
31
|
// src/timeline/disclosure-context.tsx
|
|
28
32
|
import { createContext, useContext } from "react";
|
|
@@ -586,107 +590,15 @@ function CopyHoverFrame({
|
|
|
586
590
|
] });
|
|
587
591
|
}
|
|
588
592
|
|
|
589
|
-
// src/components/open-geni-links.tsx
|
|
590
|
-
import { createContext as createContext4, useContext as useContext4, useMemo } from "react";
|
|
591
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
592
|
-
var OpenGeniLinkContext = createContext4(null);
|
|
593
|
-
function chainLinkResolvers(...resolvers) {
|
|
594
|
-
const active = resolvers.filter(
|
|
595
|
-
(resolver) => Boolean(resolver)
|
|
596
|
-
);
|
|
597
|
-
if (active.length === 0) return null;
|
|
598
|
-
if (active.length === 1) return active[0];
|
|
599
|
-
return (target) => {
|
|
600
|
-
for (const resolver of active) {
|
|
601
|
-
const resolution = resolver(target);
|
|
602
|
-
if (resolution) return resolution;
|
|
603
|
-
}
|
|
604
|
-
return null;
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
function OpenGeniLinkProvider({
|
|
608
|
-
resolveLink,
|
|
609
|
-
children
|
|
610
|
-
}) {
|
|
611
|
-
const parent = useContext4(OpenGeniLinkContext);
|
|
612
|
-
const value = useMemo(() => chainLinkResolvers(resolveLink, parent), [resolveLink, parent]);
|
|
613
|
-
return /* @__PURE__ */ jsx4(OpenGeniLinkContext.Provider, { value, children });
|
|
614
|
-
}
|
|
615
|
-
function useOpenGeniLinkResolver() {
|
|
616
|
-
return useContext4(OpenGeniLinkContext);
|
|
617
|
-
}
|
|
618
|
-
var SANDBOX_DOWNLOAD_MAX_BYTES = 25 * 1024 * 1024;
|
|
619
|
-
function saveBlob(blob, filename) {
|
|
620
|
-
const url = URL.createObjectURL(blob);
|
|
621
|
-
const link = document.createElement("a");
|
|
622
|
-
link.href = url;
|
|
623
|
-
link.download = filename;
|
|
624
|
-
link.rel = "noopener";
|
|
625
|
-
document.body.append(link);
|
|
626
|
-
link.click();
|
|
627
|
-
link.remove();
|
|
628
|
-
setTimeout(() => URL.revokeObjectURL(url), 6e4);
|
|
629
|
-
}
|
|
630
|
-
function openUrl(url) {
|
|
631
|
-
const link = document.createElement("a");
|
|
632
|
-
link.href = url;
|
|
633
|
-
link.rel = "noopener noreferrer";
|
|
634
|
-
link.target = "_blank";
|
|
635
|
-
document.body.append(link);
|
|
636
|
-
link.click();
|
|
637
|
-
link.remove();
|
|
638
|
-
}
|
|
639
|
-
function base64Bytes(content) {
|
|
640
|
-
const binary = atob(content);
|
|
641
|
-
const bytes = new Uint8Array(binary.length);
|
|
642
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
643
|
-
return bytes;
|
|
644
|
-
}
|
|
645
|
-
function sessionLinkResolver(input) {
|
|
646
|
-
const { client, workspaceId, sessionId } = input;
|
|
647
|
-
return (target) => {
|
|
648
|
-
if (target.kind === "file") {
|
|
649
|
-
if (target.workspaceId !== null && target.workspaceId !== workspaceId) return null;
|
|
650
|
-
if (typeof client.createFileDownloadUrl !== "function") return null;
|
|
651
|
-
return {
|
|
652
|
-
open: async () => {
|
|
653
|
-
const { url } = await client.createFileDownloadUrl(workspaceId, target.fileId, {
|
|
654
|
-
sessionId
|
|
655
|
-
});
|
|
656
|
-
openUrl(url);
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
if (target.kind === "sandbox-file") {
|
|
661
|
-
if (input.sandboxFiles === false) return null;
|
|
662
|
-
if (typeof client.fsRead !== "function") return null;
|
|
663
|
-
return {
|
|
664
|
-
open: async () => {
|
|
665
|
-
const file = await client.fsRead(workspaceId, sessionId, {
|
|
666
|
-
path: target.path,
|
|
667
|
-
encoding: "base64",
|
|
668
|
-
maxBytes: SANDBOX_DOWNLOAD_MAX_BYTES
|
|
669
|
-
});
|
|
670
|
-
if (file.truncated) throw new Error("File is too large to download here.");
|
|
671
|
-
const name = file.path.split(/[\\/]/u).at(-1) || "download";
|
|
672
|
-
const bytes = file.encoding === "base64" ? base64Bytes(file.content) : new TextEncoder().encode(file.content);
|
|
673
|
-
saveBlob(new Blob([bytes], { type: "application/octet-stream" }), name);
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
return null;
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
|
|
681
593
|
// src/components/markdown.tsx
|
|
682
594
|
import {
|
|
683
595
|
Children,
|
|
684
|
-
createContext as
|
|
685
|
-
useContext as
|
|
596
|
+
createContext as createContext4,
|
|
597
|
+
useContext as useContext4,
|
|
686
598
|
isValidElement,
|
|
687
599
|
memo as memo2,
|
|
688
600
|
useEffect as useEffect4,
|
|
689
|
-
useMemo
|
|
601
|
+
useMemo,
|
|
690
602
|
useReducer,
|
|
691
603
|
useRef as useRef4,
|
|
692
604
|
useState as useState3
|
|
@@ -702,7 +614,7 @@ var MOTION_INSPECT_SCALE = 1;
|
|
|
702
614
|
|
|
703
615
|
// src/components/preview-loading.tsx
|
|
704
616
|
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
705
|
-
import { jsx as
|
|
617
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
706
618
|
function PreviewLoading() {
|
|
707
619
|
const ref = useRef3(null);
|
|
708
620
|
useEffect3(() => {
|
|
@@ -837,8 +749,8 @@ function PreviewLoading() {
|
|
|
837
749
|
};
|
|
838
750
|
}, []);
|
|
839
751
|
return /* @__PURE__ */ jsxs3("div", { className: "og-preview-loading", children: [
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ jsx4("canvas", { ref, "aria-hidden": "true" }),
|
|
753
|
+
/* @__PURE__ */ jsx4("span", { className: "og-preview-loading-label", children: "Preparing preview\u2026" })
|
|
842
754
|
] });
|
|
843
755
|
}
|
|
844
756
|
|
|
@@ -1116,10 +1028,10 @@ import {
|
|
|
1116
1028
|
isReservedOpenGeniLink,
|
|
1117
1029
|
openGeniLinkScheme
|
|
1118
1030
|
} from "@opengeni/sdk";
|
|
1119
|
-
import { Fragment as Fragment2, jsx as
|
|
1120
|
-
var InteractiveContext =
|
|
1031
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1032
|
+
var InteractiveContext = createContext4({ source: "" });
|
|
1121
1033
|
var baseComponents = {
|
|
1122
|
-
h1: ({ children, ...props }) => /* @__PURE__ */
|
|
1034
|
+
h1: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1123
1035
|
"h1",
|
|
1124
1036
|
{
|
|
1125
1037
|
className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
|
|
@@ -1127,8 +1039,8 @@ var baseComponents = {
|
|
|
1127
1039
|
children
|
|
1128
1040
|
}
|
|
1129
1041
|
),
|
|
1130
|
-
h2: ({ children, ...props }) => /* @__PURE__ */
|
|
1131
|
-
h3: ({ children, ...props }) => /* @__PURE__ */
|
|
1042
|
+
h2: ({ children, ...props }) => /* @__PURE__ */ jsx5("h2", { className: "mt-5 mb-2 text-lg font-semibold tracking-tight text-og-fg first:mt-0", ...props, children }),
|
|
1043
|
+
h3: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1132
1044
|
"h3",
|
|
1133
1045
|
{
|
|
1134
1046
|
className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
|
|
@@ -1136,7 +1048,7 @@ var baseComponents = {
|
|
|
1136
1048
|
children
|
|
1137
1049
|
}
|
|
1138
1050
|
),
|
|
1139
|
-
h4: ({ children, ...props }) => /* @__PURE__ */
|
|
1051
|
+
h4: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1140
1052
|
"h4",
|
|
1141
1053
|
{
|
|
1142
1054
|
className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg first:mt-0",
|
|
@@ -1144,10 +1056,10 @@ var baseComponents = {
|
|
|
1144
1056
|
children
|
|
1145
1057
|
}
|
|
1146
1058
|
),
|
|
1147
|
-
p: ({ children, ...props }) => /* @__PURE__ */
|
|
1148
|
-
strong: ({ children, ...props }) => /* @__PURE__ */
|
|
1149
|
-
em: ({ children, ...props }) => /* @__PURE__ */
|
|
1150
|
-
ul: ({ children, ...props }) => /* @__PURE__ */
|
|
1059
|
+
p: ({ children, ...props }) => /* @__PURE__ */ jsx5("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
|
|
1060
|
+
strong: ({ children, ...props }) => /* @__PURE__ */ jsx5("strong", { className: "font-semibold text-og-fg", ...props, children }),
|
|
1061
|
+
em: ({ children, ...props }) => /* @__PURE__ */ jsx5("em", { className: "italic", ...props, children }),
|
|
1062
|
+
ul: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1151
1063
|
"ul",
|
|
1152
1064
|
{
|
|
1153
1065
|
className: "my-2.5 ml-5 flex list-disc flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
@@ -1155,7 +1067,7 @@ var baseComponents = {
|
|
|
1155
1067
|
children
|
|
1156
1068
|
}
|
|
1157
1069
|
),
|
|
1158
|
-
ol: ({ children, ...props }) => /* @__PURE__ */
|
|
1070
|
+
ol: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1159
1071
|
"ol",
|
|
1160
1072
|
{
|
|
1161
1073
|
className: "my-2.5 ml-5 flex list-decimal flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
|
|
@@ -1166,7 +1078,7 @@ var baseComponents = {
|
|
|
1166
1078
|
// GFM task-list items carry a leading checkbox <input>; `list-none` + a
|
|
1167
1079
|
// negative margin pull the checkbox back to the bullet column so it aligns
|
|
1168
1080
|
// with the text.
|
|
1169
|
-
li: ({ children, ...props }) => /* @__PURE__ */
|
|
1081
|
+
li: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1170
1082
|
"li",
|
|
1171
1083
|
{
|
|
1172
1084
|
className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
|
|
@@ -1174,7 +1086,7 @@ var baseComponents = {
|
|
|
1174
1086
|
children
|
|
1175
1087
|
}
|
|
1176
1088
|
),
|
|
1177
|
-
input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */
|
|
1089
|
+
input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx5(
|
|
1178
1090
|
"input",
|
|
1179
1091
|
{
|
|
1180
1092
|
...props,
|
|
@@ -1182,8 +1094,8 @@ var baseComponents = {
|
|
|
1182
1094
|
disabled: true,
|
|
1183
1095
|
className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
|
|
1184
1096
|
}
|
|
1185
|
-
) : /* @__PURE__ */
|
|
1186
|
-
blockquote: ({ children, ...props }) => /* @__PURE__ */
|
|
1097
|
+
) : /* @__PURE__ */ jsx5("input", { type, ...props }),
|
|
1098
|
+
blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1187
1099
|
"blockquote",
|
|
1188
1100
|
{
|
|
1189
1101
|
className: "my-3 border-l-2 border-og-border-strong pl-3.5 text-og-fg-muted [&>p]:my-1.5 first:mt-0 last:mb-0",
|
|
@@ -1191,11 +1103,11 @@ var baseComponents = {
|
|
|
1191
1103
|
children
|
|
1192
1104
|
}
|
|
1193
1105
|
),
|
|
1194
|
-
hr: (props) => /* @__PURE__ */
|
|
1106
|
+
hr: (props) => /* @__PURE__ */ jsx5("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
|
|
1195
1107
|
// Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
|
|
1196
1108
|
// `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
|
|
1197
1109
|
// the `pre` renderer), so a `code` reaching here is treated as inline.
|
|
1198
|
-
code: ({ children, className: _className, ...props }) => /* @__PURE__ */
|
|
1110
|
+
code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx5(
|
|
1199
1111
|
"code",
|
|
1200
1112
|
{
|
|
1201
1113
|
className: "rounded-og-xs bg-og-surface-2 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
|
|
@@ -1206,9 +1118,9 @@ var baseComponents = {
|
|
|
1206
1118
|
// Fenced code — quiet mono block (no card / no nested vertical scroll).
|
|
1207
1119
|
pre: InteractiveCodeBlock,
|
|
1208
1120
|
// Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
|
|
1209
|
-
table: ({ children, ...props }) => /* @__PURE__ */
|
|
1210
|
-
thead: ({ children, ...props }) => /* @__PURE__ */
|
|
1211
|
-
th: ({ children, ...props }) => /* @__PURE__ */
|
|
1121
|
+
table: ({ children, ...props }) => /* @__PURE__ */ jsx5(MarkdownTable, { ...props, children }),
|
|
1122
|
+
thead: ({ children, ...props }) => /* @__PURE__ */ jsx5("thead", { ...props, children }),
|
|
1123
|
+
th: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1212
1124
|
"th",
|
|
1213
1125
|
{
|
|
1214
1126
|
className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
|
|
@@ -1216,7 +1128,7 @@ var baseComponents = {
|
|
|
1216
1128
|
children
|
|
1217
1129
|
}
|
|
1218
1130
|
),
|
|
1219
|
-
td: ({ children, ...props }) => /* @__PURE__ */
|
|
1131
|
+
td: ({ children, ...props }) => /* @__PURE__ */ jsx5(
|
|
1220
1132
|
"td",
|
|
1221
1133
|
{
|
|
1222
1134
|
className: "border-b border-og-border/70 px-0 py-1.5 pr-4 align-top text-og-fg-muted [tr:last-child>&]:border-b-0",
|
|
@@ -1227,7 +1139,7 @@ var baseComponents = {
|
|
|
1227
1139
|
img: MarkdownImage
|
|
1228
1140
|
};
|
|
1229
1141
|
var MARKDOWN_LINK_CLASS = "break-words font-medium text-og-accent-strong underline-offset-2 hover:underline";
|
|
1230
|
-
var MarkdownLinkContext =
|
|
1142
|
+
var MarkdownLinkContext = createContext4({});
|
|
1231
1143
|
var UNAVAILABLE_LABEL = {
|
|
1232
1144
|
file: "This file needs a workspace-aware host to open",
|
|
1233
1145
|
"editable-artifact": "This artifact needs a workspace-aware host to open",
|
|
@@ -1246,17 +1158,17 @@ var markdownComponents = {
|
|
|
1246
1158
|
(child) => child.type === "element" && child.tagName === "img" && typeof child.properties.src === "string" && retainedImageId(child.properties.src)
|
|
1247
1159
|
);
|
|
1248
1160
|
const Tag = containsArtifact ? "div" : "p";
|
|
1249
|
-
return /* @__PURE__ */
|
|
1161
|
+
return /* @__PURE__ */ jsx5(Tag, { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children });
|
|
1250
1162
|
},
|
|
1251
1163
|
a: ({ children, href, ...props }) => {
|
|
1252
|
-
const { onSandboxFile, artifactHref, resolveLink } =
|
|
1164
|
+
const { onSandboxFile, artifactHref, resolveLink } = useContext4(MarkdownLinkContext);
|
|
1253
1165
|
const inherited = useOpenGeniLinkResolver();
|
|
1254
1166
|
const target = parseOpenGeniLink(href);
|
|
1255
1167
|
if (target) {
|
|
1256
1168
|
if (target.kind === "file" && target.workspaceId === null && artifactHref) {
|
|
1257
1169
|
const destination2 = defaultUrlTransform(artifactHref(target.fileId));
|
|
1258
1170
|
if (destination2) {
|
|
1259
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsx5(
|
|
1260
1172
|
"a",
|
|
1261
1173
|
{
|
|
1262
1174
|
className: MARKDOWN_LINK_CLASS,
|
|
@@ -1271,7 +1183,7 @@ var markdownComponents = {
|
|
|
1271
1183
|
const resolution = target.kind === "sandbox-file" && onSandboxFile ? { open: () => onSandboxFile(target.path, target.line ?? void 0) } : chainLinkResolvers(resolveLink, inherited)?.(target);
|
|
1272
1184
|
const destination = resolution?.href ? defaultUrlTransform(resolution.href) : "";
|
|
1273
1185
|
if (destination) {
|
|
1274
|
-
return /* @__PURE__ */
|
|
1186
|
+
return /* @__PURE__ */ jsx5(
|
|
1275
1187
|
"a",
|
|
1276
1188
|
{
|
|
1277
1189
|
className: MARKDOWN_LINK_CLASS,
|
|
@@ -1283,10 +1195,10 @@ var markdownComponents = {
|
|
|
1283
1195
|
);
|
|
1284
1196
|
}
|
|
1285
1197
|
if (resolution?.open) {
|
|
1286
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ jsx5(ActionMarkdownLink, { title: linkActionTitle(target), onOpen: resolution.open, children });
|
|
1287
1199
|
}
|
|
1288
1200
|
if (target.kind === "sandbox-file") {
|
|
1289
|
-
return /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ jsx5(
|
|
1290
1202
|
"span",
|
|
1291
1203
|
{
|
|
1292
1204
|
className: "break-words font-medium text-og-fg-subtle underline decoration-dotted underline-offset-2",
|
|
@@ -1315,7 +1227,7 @@ var markdownComponents = {
|
|
|
1315
1227
|
}
|
|
1316
1228
|
);
|
|
1317
1229
|
}
|
|
1318
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsx5(
|
|
1319
1231
|
"a",
|
|
1320
1232
|
{
|
|
1321
1233
|
className: MARKDOWN_LINK_CLASS,
|
|
@@ -1340,12 +1252,13 @@ function ActionMarkdownLink({
|
|
|
1340
1252
|
type: "button",
|
|
1341
1253
|
className: cn(
|
|
1342
1254
|
MARKDOWN_LINK_CLASS,
|
|
1343
|
-
"inline-flex min-h-7 cursor-pointer items-center disabled:cursor-wait disabled:opacity-70 pointer-coarse:min-h-11"
|
|
1255
|
+
"inline-flex min-h-7 cursor-pointer items-center aria-disabled:cursor-wait aria-disabled:opacity-70 pointer-coarse:min-h-11"
|
|
1344
1256
|
),
|
|
1345
|
-
disabled: state === "loading",
|
|
1257
|
+
"aria-disabled": state === "loading" || void 0,
|
|
1346
1258
|
"aria-busy": state === "loading",
|
|
1347
1259
|
title: state === "error" ? "Couldn't open this file. Select to retry." : title,
|
|
1348
1260
|
onClick: () => {
|
|
1261
|
+
if (state === "loading") return;
|
|
1349
1262
|
setState("loading");
|
|
1350
1263
|
void Promise.resolve().then(onOpen).then(
|
|
1351
1264
|
() => setState("idle"),
|
|
@@ -1372,19 +1285,19 @@ function retainedImageId(src) {
|
|
|
1372
1285
|
return parseRetainedFileReference(src);
|
|
1373
1286
|
}
|
|
1374
1287
|
function MarkdownImage({ src, alt }) {
|
|
1375
|
-
const { renderImage, suppressImages } =
|
|
1288
|
+
const { renderImage, suppressImages } = useContext4(InteractiveContext);
|
|
1376
1289
|
if (suppressImages)
|
|
1377
1290
|
return /* @__PURE__ */ jsxs4("span", { "data-og-image-placeholder": "", children: [
|
|
1378
1291
|
alt || "Image",
|
|
1379
1292
|
" (preview unavailable)"
|
|
1380
1293
|
] });
|
|
1381
|
-
if (!src) return /* @__PURE__ */
|
|
1294
|
+
if (!src) return /* @__PURE__ */ jsx5("span", { children: alt ?? "Image unavailable" });
|
|
1382
1295
|
if (retainedImageId(src))
|
|
1383
|
-
return renderImage ? /* @__PURE__ */
|
|
1296
|
+
return renderImage ? /* @__PURE__ */ jsx5(Fragment2, { children: renderImage({ src, alt: alt ?? "" }) }) : /* @__PURE__ */ jsxs4("span", { children: [
|
|
1384
1297
|
alt || "Image",
|
|
1385
1298
|
" (preview unavailable)"
|
|
1386
1299
|
] });
|
|
1387
|
-
return /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ jsx5("img", { src, alt: alt ?? "", loading: "lazy", className: "my-3 max-w-full rounded-og-md" });
|
|
1388
1301
|
}
|
|
1389
1302
|
var markdownUrlTransform = (url, key, node) => key === "href" && node.tagName === "a" && isReservedOpenGeniLink(url) || key === "src" && node.tagName === "img" && retainedImageId(url) ? url : defaultUrlTransform(url);
|
|
1390
1303
|
var REVEAL_LINGER_MS = 480 * MOTION_INSPECT_SCALE;
|
|
@@ -1418,7 +1331,7 @@ function fenceLanguage(children) {
|
|
|
1418
1331
|
return found;
|
|
1419
1332
|
}
|
|
1420
1333
|
function InteractiveCodeBlock({ children, node }) {
|
|
1421
|
-
const { source, render, streaming } =
|
|
1334
|
+
const { source, render, streaming } = useContext4(InteractiveContext);
|
|
1422
1335
|
const language = fenceLanguage(children);
|
|
1423
1336
|
if (render && (language === "opengeni-html" || language === "opengeni-site")) {
|
|
1424
1337
|
const start = node?.position?.start.offset;
|
|
@@ -1429,10 +1342,10 @@ function InteractiveCodeBlock({ children, node }) {
|
|
|
1429
1342
|
const closing = lines.at(-1)?.replace(/^\s*(?:>\s*)+/, "").trim();
|
|
1430
1343
|
const complete = opening && lines.length > 1 && closing && closing.length >= opening[1].length && [...closing].every((c) => c === opening[1][0]);
|
|
1431
1344
|
if (!complete) {
|
|
1432
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ jsx5("div", { role: "status", "aria-live": "polite", "aria-busy": streaming === true, className: "my-3", children: streaming ? /* @__PURE__ */ jsx5(PreviewLoading, {}) : /* @__PURE__ */ jsx5(
|
|
1433
1346
|
ActivityDisclosure,
|
|
1434
1347
|
{
|
|
1435
|
-
icon: /* @__PURE__ */
|
|
1348
|
+
icon: /* @__PURE__ */ jsx5(PanelsTopLeftIcon, { "aria-hidden": true, className: "size-3.5" }),
|
|
1436
1349
|
title: "Preview incomplete",
|
|
1437
1350
|
running: false,
|
|
1438
1351
|
expandable: false,
|
|
@@ -1440,22 +1353,22 @@ function InteractiveCodeBlock({ children, node }) {
|
|
|
1440
1353
|
}
|
|
1441
1354
|
) });
|
|
1442
1355
|
}
|
|
1443
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsx5(Fragment2, { children: render({
|
|
1444
1357
|
kind: language === "opengeni-html" ? "html" : "site",
|
|
1445
1358
|
content: nodeText(children).replace(/\n$/, "")
|
|
1446
1359
|
}) });
|
|
1447
1360
|
}
|
|
1448
|
-
return /* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ jsx5(MarkdownCodeBlock, { children });
|
|
1449
1362
|
}
|
|
1450
1363
|
function MarkdownCodeBlock({ children }) {
|
|
1451
1364
|
const code = nodeText(children).replace(/\n$/, "");
|
|
1452
1365
|
const language = fenceLanguage(children);
|
|
1453
1366
|
return /* @__PURE__ */ jsxs4("div", { className: "group/copy relative mt-3 first:mt-0", children: [
|
|
1454
1367
|
/* @__PURE__ */ jsxs4("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
|
|
1455
|
-
language ? /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1368
|
+
language ? /* @__PURE__ */ jsx5("span", { className: "rounded px-1 py-0.5 font-og-mono text-[10px] uppercase tracking-wide text-og-fg-subtle/80 opacity-0 transition-opacity group-hover/copy:opacity-100 pointer-coarse:opacity-70", children: language }) : null,
|
|
1369
|
+
/* @__PURE__ */ jsx5("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx5(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
|
|
1457
1370
|
] }),
|
|
1458
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ jsx5(
|
|
1459
1372
|
"pre",
|
|
1460
1373
|
{
|
|
1461
1374
|
tabIndex: 0,
|
|
@@ -1474,7 +1387,7 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
1474
1387
|
const table = tableRef.current;
|
|
1475
1388
|
if (!wrapper?.closest("[data-og-wide-table-message]") || !table) return;
|
|
1476
1389
|
let disposed = false;
|
|
1477
|
-
void import("./markdown-table-layout-
|
|
1390
|
+
void import("./markdown-table-layout-QXSLK4BY.js").then(({ observeMarkdownTableLayout }) => {
|
|
1478
1391
|
if (!disposed) layoutRef.current = observeMarkdownTableLayout(wrapper, table);
|
|
1479
1392
|
}).catch(() => {
|
|
1480
1393
|
});
|
|
@@ -1488,7 +1401,7 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
1488
1401
|
layoutRef.current?.measure();
|
|
1489
1402
|
}, [children]);
|
|
1490
1403
|
return /* @__PURE__ */ jsxs4("div", { ref: wrapperRef, className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
|
|
1491
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsx5("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx5("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx5(
|
|
1492
1405
|
CopyButton,
|
|
1493
1406
|
{
|
|
1494
1407
|
text: () => tableElementToTsv(tableRef.current),
|
|
@@ -1496,7 +1409,7 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
1496
1409
|
reveal: "group-hover"
|
|
1497
1410
|
}
|
|
1498
1411
|
) }) }),
|
|
1499
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ jsx5("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx5(
|
|
1500
1413
|
"table",
|
|
1501
1414
|
{
|
|
1502
1415
|
ref: tableRef,
|
|
@@ -1580,11 +1493,11 @@ function MarkdownImpl({
|
|
|
1580
1493
|
return () => clearTimeout(timer);
|
|
1581
1494
|
}, [streaming]);
|
|
1582
1495
|
const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
|
|
1583
|
-
const linkContext =
|
|
1496
|
+
const linkContext = useMemo(
|
|
1584
1497
|
() => ({ onSandboxFile, artifactHref, resolveLink }),
|
|
1585
1498
|
[onSandboxFile, artifactHref, resolveLink]
|
|
1586
1499
|
);
|
|
1587
|
-
const interactiveContext =
|
|
1500
|
+
const interactiveContext = useMemo(
|
|
1588
1501
|
() => ({
|
|
1589
1502
|
source: children,
|
|
1590
1503
|
streaming,
|
|
@@ -1594,7 +1507,7 @@ function MarkdownImpl({
|
|
|
1594
1507
|
}),
|
|
1595
1508
|
[children, streaming, renderInteractiveBlock, renderImage, suppressImages]
|
|
1596
1509
|
);
|
|
1597
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ jsx5(MarkdownLinkContext.Provider, { value: linkContext, children: /* @__PURE__ */ jsx5(InteractiveContext.Provider, { value: interactiveContext, children: /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx5(
|
|
1598
1511
|
"div",
|
|
1599
1512
|
{
|
|
1600
1513
|
ref: bodyRef,
|
|
@@ -1603,7 +1516,7 @@ function MarkdownImpl({
|
|
|
1603
1516
|
settling && "og-markdown-settle",
|
|
1604
1517
|
className
|
|
1605
1518
|
),
|
|
1606
|
-
children: /* @__PURE__ */
|
|
1519
|
+
children: /* @__PURE__ */ jsx5(
|
|
1607
1520
|
ReactMarkdown,
|
|
1608
1521
|
{
|
|
1609
1522
|
remarkPlugins: [remarkGfm],
|
|
@@ -1624,10 +1537,10 @@ var Markdown = memo2(function SearchableMarkdown(props) {
|
|
|
1624
1537
|
setRetained({ text: props.children, target: props.searchTarget });
|
|
1625
1538
|
}
|
|
1626
1539
|
const target = props.searchTarget ?? (retained?.text === props.children ? retained.target : null);
|
|
1627
|
-
if (!target) return /* @__PURE__ */
|
|
1540
|
+
if (!target) return /* @__PURE__ */ jsx5(MarkdownImpl, { ...props });
|
|
1628
1541
|
const offset = searchMatchOffset(props.children, target);
|
|
1629
1542
|
if (offset < 0)
|
|
1630
|
-
return props.searchTarget ? /* @__PURE__ */
|
|
1543
|
+
return props.searchTarget ? /* @__PURE__ */ jsx5("div", { role: "status", children: "This match is no longer in the message source." }) : /* @__PURE__ */ jsx5(MarkdownImpl, { ...props });
|
|
1631
1544
|
let start = Math.max(0, offset - 240);
|
|
1632
1545
|
let end = Math.min(props.children.length, offset + target.query.length + 240);
|
|
1633
1546
|
if (start > 0 && /[\uDC00-\uDFFF]/.test(props.children[start])) start--;
|
|
@@ -1636,7 +1549,7 @@ var Markdown = memo2(function SearchableMarkdown(props) {
|
|
|
1636
1549
|
return /* @__PURE__ */ jsxs4("div", { className: cn("og-markdown-body min-w-0 break-words", props.className), children: [
|
|
1637
1550
|
/* @__PURE__ */ jsxs4("div", { "data-og-annotation-chrome": "", className: "text-xs opacity-70", children: [
|
|
1638
1551
|
"Match in message source \xB7 Excerpt stays in place when Find closes",
|
|
1639
|
-
/* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ jsx5(
|
|
1640
1553
|
"button",
|
|
1641
1554
|
{
|
|
1642
1555
|
type: "button",
|
|
@@ -1651,7 +1564,7 @@ var Markdown = memo2(function SearchableMarkdown(props) {
|
|
|
1651
1564
|
/* @__PURE__ */ jsxs4("div", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere" }, children: [
|
|
1652
1565
|
start > 0 ? "\u2026" : "",
|
|
1653
1566
|
props.children.slice(start, offset),
|
|
1654
|
-
/* @__PURE__ */
|
|
1567
|
+
/* @__PURE__ */ jsx5(
|
|
1655
1568
|
MatchTag,
|
|
1656
1569
|
{
|
|
1657
1570
|
"data-og-search-occurrence": target.occurrence ?? 0,
|
|
@@ -1687,13 +1600,9 @@ export {
|
|
|
1687
1600
|
MOTION_INSPECT_SCALE,
|
|
1688
1601
|
CopyButton,
|
|
1689
1602
|
CopyHoverFrame,
|
|
1690
|
-
chainLinkResolvers,
|
|
1691
|
-
OpenGeniLinkProvider,
|
|
1692
|
-
useOpenGeniLinkResolver,
|
|
1693
|
-
sessionLinkResolver,
|
|
1694
1603
|
sandboxFileLocationFromHref,
|
|
1695
1604
|
sandboxFilePathFromHref,
|
|
1696
1605
|
retainedImageId,
|
|
1697
1606
|
Markdown
|
|
1698
1607
|
};
|
|
1699
|
-
//# sourceMappingURL=chunk-
|
|
1608
|
+
//# sourceMappingURL=chunk-AFLPWUQ7.js.map
|