@opengeni/react 7.4.0-canary.36844267522001 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +0 -10
  2. package/dist/artifacts-document.js +2 -3
  3. package/dist/artifacts-presentation.js +2 -3
  4. package/dist/artifacts-spreadsheet.js +2 -2
  5. package/dist/artifacts.d.ts +0 -1
  6. package/dist/artifacts.js +1402 -505
  7. package/dist/artifacts.js.map +1 -1
  8. package/dist/{browser-viewer-AJO7LMVE.js → browser-viewer-2E6R2Y4W.js} +2 -2
  9. package/dist/{chunk-WUISZ3WU.js → chunk-3E2AITTZ.js} +28 -32
  10. package/dist/{chunk-WUISZ3WU.js.map → chunk-3E2AITTZ.js.map} +1 -1
  11. package/dist/{chunk-Y2PRMYLC.js → chunk-DUEBTL3N.js} +3 -4
  12. package/dist/{chunk-Y2PRMYLC.js.map → chunk-DUEBTL3N.js.map} +1 -1
  13. package/dist/{chunk-7UAMYXJY.js → chunk-KNDIXZN6.js} +18 -25
  14. package/dist/{chunk-7UAMYXJY.js.map → chunk-KNDIXZN6.js.map} +1 -1
  15. package/dist/{chunk-XVYRQ4PK.js → chunk-L4OSXQ6H.js} +116 -277
  16. package/dist/chunk-L4OSXQ6H.js.map +1 -0
  17. package/dist/{chunk-7B44WVGH.js → chunk-S5JQ4R22.js} +12 -31
  18. package/dist/chunk-S5JQ4R22.js.map +1 -0
  19. package/dist/{chunk-A4UJB2MM.js → chunk-SEEVCT36.js} +2 -2
  20. package/dist/chunk-UGMKPUEM.js +299 -0
  21. package/dist/chunk-UGMKPUEM.js.map +1 -0
  22. package/dist/{chunk-OQVBTOBJ.js → chunk-USXVQACU.js} +3 -3
  23. package/dist/{chunk-ASCSKOWU.js → chunk-V2ABIVYJ.js} +3 -50
  24. package/dist/chunk-V2ABIVYJ.js.map +1 -0
  25. package/dist/{chunk-UQUR5WG5.js → chunk-X4HIN6TV.js} +157 -66
  26. package/dist/chunk-X4HIN6TV.js.map +1 -0
  27. package/dist/{chunk-QLG6W33X.js → chunk-XEJEOAOV.js} +35 -46
  28. package/dist/chunk-XEJEOAOV.js.map +1 -0
  29. package/dist/components/artifacts/editable-artifact-ui.d.ts +1 -2
  30. package/dist/components/artifacts/index.d.ts +0 -7
  31. package/dist/components/message-timeline.d.ts +1 -7
  32. package/dist/components/open-geni-links.d.ts +0 -16
  33. package/dist/components/session-conversation.d.ts +1 -13
  34. package/dist/{computer-viewer-NB6O6BTV.js → computer-viewer-WMJE6OA3.js} +2 -2
  35. package/dist/connect.js +1 -2
  36. package/dist/connect.js.map +1 -1
  37. package/dist/hooks/latest-question.d.ts +1 -1
  38. package/dist/index.d.ts +2 -3
  39. package/dist/index.js +12 -22
  40. package/dist/index.js.map +1 -1
  41. package/dist/interaction.js +2 -2
  42. package/dist/{latest-question-3HGQUI2E.js → latest-question-QB4EUCW5.js} +2 -2
  43. package/dist/{markdown-table-layout-QXSLK4BY.js → markdown-table-layout-PFUEZ2U4.js} +5 -37
  44. package/dist/markdown-table-layout-PFUEZ2U4.js.map +1 -0
  45. package/dist/session-ui.d.ts +2 -3
  46. package/dist/session-ui.js +9 -18
  47. package/dist/session-ui.js.map +1 -1
  48. package/dist/session.js +2 -2
  49. package/dist/sites.js +289 -4
  50. package/dist/sites.js.map +1 -1
  51. package/package.json +3 -3
  52. package/src/artifacts.ts +0 -37
  53. package/src/components/artifacts/editable-artifact-ui.tsx +1 -3
  54. package/src/components/artifacts/editable-artifact-workbench.tsx +2 -5
  55. package/src/components/artifacts/editable-document.tsx +36 -34
  56. package/src/components/artifacts/editable-presentation.tsx +16 -21
  57. package/src/components/artifacts/index.ts +0 -41
  58. package/src/components/browser-viewer.tsx +20 -59
  59. package/src/components/computer-viewer.tsx +23 -51
  60. package/src/components/markdown-table-layout.ts +5 -49
  61. package/src/components/markdown.tsx +2 -5
  62. package/src/components/message-timeline.tsx +7 -59
  63. package/src/components/open-geni-links.tsx +0 -24
  64. package/src/components/session-conversation.tsx +20 -120
  65. package/src/index.ts +0 -7
  66. package/src/session-ui.ts +0 -7
  67. package/src/timeline/projection.ts +4 -54
  68. package/styles/compiled.css +0 -220
  69. package/dist/chat-interactive-block-VAGABN7J.js +0 -11
  70. package/dist/chunk-5CVXZA3Y.js +0 -292
  71. package/dist/chunk-5CVXZA3Y.js.map +0 -1
  72. package/dist/chunk-7B44WVGH.js.map +0 -1
  73. package/dist/chunk-ASCSKOWU.js.map +0 -1
  74. package/dist/chunk-QLG6W33X.js.map +0 -1
  75. package/dist/chunk-RAIQYITC.js +0 -1772
  76. package/dist/chunk-RAIQYITC.js.map +0 -1
  77. package/dist/chunk-SCOTPE2I.js +0 -589
  78. package/dist/chunk-SCOTPE2I.js.map +0 -1
  79. package/dist/chunk-UQUR5WG5.js.map +0 -1
  80. package/dist/chunk-WEHMPOXK.js +0 -39
  81. package/dist/chunk-WEHMPOXK.js.map +0 -1
  82. package/dist/chunk-XCHWDJ22.js +0 -107
  83. package/dist/chunk-XCHWDJ22.js.map +0 -1
  84. package/dist/chunk-XVYRQ4PK.js.map +0 -1
  85. package/dist/components/artifacts/artifact-chrome.d.ts +0 -120
  86. package/dist/components/artifacts/artifact-sandbox.d.ts +0 -27
  87. package/dist/components/artifacts/chat-interactive-block.d.ts +0 -29
  88. package/dist/components/artifacts/deferred-chat-media.d.ts +0 -15
  89. package/dist/components/artifacts/editable-artifact-view.d.ts +0 -46
  90. package/dist/components/artifacts/latest-task-runner.d.ts +0 -15
  91. package/dist/components/artifacts/session-artifact-viewer.d.ts +0 -39
  92. package/dist/components/artifacts/site-view.d.ts +0 -23
  93. package/dist/components/timeline-pill-geometry.d.ts +0 -6
  94. package/dist/components/timeline-pill-placement.d.ts +0 -18
  95. package/dist/computer-viewer-NB6O6BTV.js.map +0 -1
  96. package/dist/markdown-table-layout-QXSLK4BY.js.map +0 -1
  97. package/dist/timeline-pill-geometry-2G6EK47V.js +0 -73
  98. package/dist/timeline-pill-geometry-2G6EK47V.js.map +0 -1
  99. package/src/components/artifacts/artifact-chrome.tsx +0 -413
  100. package/src/components/artifacts/artifact-sandbox.tsx +0 -185
  101. package/src/components/artifacts/chat-interactive-block.tsx +0 -260
  102. package/src/components/artifacts/deferred-chat-media.tsx +0 -67
  103. package/src/components/artifacts/editable-artifact-view.tsx +0 -187
  104. package/src/components/artifacts/latest-task-runner.ts +0 -49
  105. package/src/components/artifacts/session-artifact-viewer.tsx +0 -376
  106. package/src/components/artifacts/site-view.tsx +0 -116
  107. package/src/components/timeline-pill-geometry.ts +0 -112
  108. package/src/components/timeline-pill-placement.ts +0 -81
  109. /package/dist/{browser-viewer-AJO7LMVE.js.map → browser-viewer-2E6R2Y4W.js.map} +0 -0
  110. /package/dist/{chunk-A4UJB2MM.js.map → chunk-SEEVCT36.js.map} +0 -0
  111. /package/dist/{chunk-OQVBTOBJ.js.map → chunk-USXVQACU.js.map} +0 -0
  112. /package/dist/{chat-interactive-block-VAGABN7J.js.map → computer-viewer-WMJE6OA3.js.map} +0 -0
  113. /package/dist/{latest-question-3HGQUI2E.js.map → latest-question-QB4EUCW5.js.map} +0 -0
@@ -6,10 +6,6 @@ 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
9
  import {
14
10
  Tooltip,
15
11
  TooltipContent,
@@ -590,15 +586,107 @@ function CopyHoverFrame({
590
586
  ] });
591
587
  }
592
588
 
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
+
593
681
  // src/components/markdown.tsx
594
682
  import {
595
683
  Children,
596
- createContext as createContext4,
597
- useContext as useContext4,
684
+ createContext as createContext5,
685
+ useContext as useContext5,
598
686
  isValidElement,
599
687
  memo as memo2,
600
688
  useEffect as useEffect4,
601
- useMemo,
689
+ useMemo as useMemo2,
602
690
  useReducer,
603
691
  useRef as useRef4,
604
692
  useState as useState3
@@ -614,7 +702,7 @@ var MOTION_INSPECT_SCALE = 1;
614
702
 
615
703
  // src/components/preview-loading.tsx
616
704
  import { useEffect as useEffect3, useRef as useRef3 } from "react";
617
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
705
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
618
706
  function PreviewLoading() {
619
707
  const ref = useRef3(null);
620
708
  useEffect3(() => {
@@ -749,8 +837,8 @@ function PreviewLoading() {
749
837
  };
750
838
  }, []);
751
839
  return /* @__PURE__ */ jsxs3("div", { className: "og-preview-loading", children: [
752
- /* @__PURE__ */ jsx4("canvas", { ref, "aria-hidden": "true" }),
753
- /* @__PURE__ */ jsx4("span", { className: "og-preview-loading-label", children: "Preparing preview\u2026" })
840
+ /* @__PURE__ */ jsx5("canvas", { ref, "aria-hidden": "true" }),
841
+ /* @__PURE__ */ jsx5("span", { className: "og-preview-loading-label", children: "Preparing preview\u2026" })
754
842
  ] });
755
843
  }
756
844
 
@@ -1028,10 +1116,10 @@ import {
1028
1116
  isReservedOpenGeniLink,
1029
1117
  openGeniLinkScheme
1030
1118
  } from "@opengeni/sdk";
1031
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1032
- var InteractiveContext = createContext4({ source: "" });
1119
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1120
+ var InteractiveContext = createContext5({ source: "" });
1033
1121
  var baseComponents = {
1034
- h1: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1122
+ h1: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1035
1123
  "h1",
1036
1124
  {
1037
1125
  className: "mt-5 mb-2.5 text-xl font-semibold tracking-tight text-og-fg first:mt-0",
@@ -1039,8 +1127,8 @@ var baseComponents = {
1039
1127
  children
1040
1128
  }
1041
1129
  ),
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(
1130
+ h2: ({ children, ...props }) => /* @__PURE__ */ jsx6("h2", { className: "mt-5 mb-2 text-lg font-semibold tracking-tight text-og-fg first:mt-0", ...props, children }),
1131
+ h3: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1044
1132
  "h3",
1045
1133
  {
1046
1134
  className: "mt-4 mb-1.5 text-og-md font-semibold tracking-tight text-og-fg first:mt-0",
@@ -1048,7 +1136,7 @@ var baseComponents = {
1048
1136
  children
1049
1137
  }
1050
1138
  ),
1051
- h4: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1139
+ h4: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1052
1140
  "h4",
1053
1141
  {
1054
1142
  className: "mt-4 mb-1.5 text-og-sm font-semibold uppercase tracking-[0.04em] text-og-fg first:mt-0",
@@ -1056,10 +1144,10 @@ var baseComponents = {
1056
1144
  children
1057
1145
  }
1058
1146
  ),
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(
1147
+ p: ({ children, ...props }) => /* @__PURE__ */ jsx6("p", { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children }),
1148
+ strong: ({ children, ...props }) => /* @__PURE__ */ jsx6("strong", { className: "font-semibold text-og-fg", ...props, children }),
1149
+ em: ({ children, ...props }) => /* @__PURE__ */ jsx6("em", { className: "italic", ...props, children }),
1150
+ ul: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1063
1151
  "ul",
1064
1152
  {
1065
1153
  className: "my-2.5 ml-5 flex list-disc flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
@@ -1067,7 +1155,7 @@ var baseComponents = {
1067
1155
  children
1068
1156
  }
1069
1157
  ),
1070
- ol: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1158
+ ol: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1071
1159
  "ol",
1072
1160
  {
1073
1161
  className: "my-2.5 ml-5 flex list-decimal flex-col gap-1 marker:text-og-fg-subtle first:mt-0 last:mb-0",
@@ -1078,7 +1166,7 @@ var baseComponents = {
1078
1166
  // GFM task-list items carry a leading checkbox <input>; `list-none` + a
1079
1167
  // negative margin pull the checkbox back to the bullet column so it aligns
1080
1168
  // with the text.
1081
- li: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1169
+ li: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1082
1170
  "li",
1083
1171
  {
1084
1172
  className: "leading-7 marker:text-og-fg-subtle [&>ul]:my-1 [&>ol]:my-1 [&:has(>input)]:list-none [&:has(>input)]:-ml-5",
@@ -1086,7 +1174,7 @@ var baseComponents = {
1086
1174
  children
1087
1175
  }
1088
1176
  ),
1089
- input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx5(
1177
+ input: ({ type, ...props }) => type === "checkbox" ? /* @__PURE__ */ jsx6(
1090
1178
  "input",
1091
1179
  {
1092
1180
  ...props,
@@ -1094,8 +1182,8 @@ var baseComponents = {
1094
1182
  disabled: true,
1095
1183
  className: "mr-2 size-3.5 translate-y-[2px] cursor-default accent-og-accent align-baseline"
1096
1184
  }
1097
- ) : /* @__PURE__ */ jsx5("input", { type, ...props }),
1098
- blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1185
+ ) : /* @__PURE__ */ jsx6("input", { type, ...props }),
1186
+ blockquote: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1099
1187
  "blockquote",
1100
1188
  {
1101
1189
  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",
@@ -1103,11 +1191,11 @@ var baseComponents = {
1103
1191
  children
1104
1192
  }
1105
1193
  ),
1106
- hr: (props) => /* @__PURE__ */ jsx5("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
1194
+ hr: (props) => /* @__PURE__ */ jsx6("hr", { className: "my-4 border-0 border-t border-og-border", ...props }),
1107
1195
  // Inline `code` vs fenced code blocks. react-markdown v10 no longer passes an
1108
1196
  // `inline` flag; a fenced block is a <code> whose parent is <pre> (styled by
1109
1197
  // the `pre` renderer), so a `code` reaching here is treated as inline.
1110
- code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx5(
1198
+ code: ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx6(
1111
1199
  "code",
1112
1200
  {
1113
1201
  className: "rounded-og-xs bg-og-surface-2 px-1 py-0.5 font-og-mono text-og-sm text-og-fg",
@@ -1118,9 +1206,9 @@ var baseComponents = {
1118
1206
  // Fenced code — quiet mono block (no card / no nested vertical scroll).
1119
1207
  pre: InteractiveCodeBlock,
1120
1208
  // Tables stay unboxed (hairline rules); hover reveals a TSV copy control.
1121
- table: ({ children, ...props }) => /* @__PURE__ */ jsx5(MarkdownTable, { ...props, children }),
1122
- thead: ({ children, ...props }) => /* @__PURE__ */ jsx5("thead", { ...props, children }),
1123
- th: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1209
+ table: ({ children, ...props }) => /* @__PURE__ */ jsx6(MarkdownTable, { ...props, children }),
1210
+ thead: ({ children, ...props }) => /* @__PURE__ */ jsx6("thead", { ...props, children }),
1211
+ th: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1124
1212
  "th",
1125
1213
  {
1126
1214
  className: "border-b border-og-border px-0 py-1.5 pr-4 text-left font-medium text-og-fg first:pl-0",
@@ -1128,7 +1216,7 @@ var baseComponents = {
1128
1216
  children
1129
1217
  }
1130
1218
  ),
1131
- td: ({ children, ...props }) => /* @__PURE__ */ jsx5(
1219
+ td: ({ children, ...props }) => /* @__PURE__ */ jsx6(
1132
1220
  "td",
1133
1221
  {
1134
1222
  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",
@@ -1139,7 +1227,7 @@ var baseComponents = {
1139
1227
  img: MarkdownImage
1140
1228
  };
1141
1229
  var MARKDOWN_LINK_CLASS = "break-words font-medium text-og-accent-strong underline-offset-2 hover:underline";
1142
- var MarkdownLinkContext = createContext4({});
1230
+ var MarkdownLinkContext = createContext5({});
1143
1231
  var UNAVAILABLE_LABEL = {
1144
1232
  file: "This file needs a workspace-aware host to open",
1145
1233
  "editable-artifact": "This artifact needs a workspace-aware host to open",
@@ -1158,17 +1246,17 @@ var markdownComponents = {
1158
1246
  (child) => child.type === "element" && child.tagName === "img" && typeof child.properties.src === "string" && retainedImageId(child.properties.src)
1159
1247
  );
1160
1248
  const Tag = containsArtifact ? "div" : "p";
1161
- return /* @__PURE__ */ jsx5(Tag, { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children });
1249
+ return /* @__PURE__ */ jsx6(Tag, { className: "my-2.5 leading-7 first:mt-0 last:mb-0", ...props, children });
1162
1250
  },
1163
1251
  a: ({ children, href, ...props }) => {
1164
- const { onSandboxFile, artifactHref, resolveLink } = useContext4(MarkdownLinkContext);
1252
+ const { onSandboxFile, artifactHref, resolveLink } = useContext5(MarkdownLinkContext);
1165
1253
  const inherited = useOpenGeniLinkResolver();
1166
1254
  const target = parseOpenGeniLink(href);
1167
1255
  if (target) {
1168
1256
  if (target.kind === "file" && target.workspaceId === null && artifactHref) {
1169
1257
  const destination2 = defaultUrlTransform(artifactHref(target.fileId));
1170
1258
  if (destination2) {
1171
- return /* @__PURE__ */ jsx5(
1259
+ return /* @__PURE__ */ jsx6(
1172
1260
  "a",
1173
1261
  {
1174
1262
  className: MARKDOWN_LINK_CLASS,
@@ -1183,7 +1271,7 @@ var markdownComponents = {
1183
1271
  const resolution = target.kind === "sandbox-file" && onSandboxFile ? { open: () => onSandboxFile(target.path, target.line ?? void 0) } : chainLinkResolvers(resolveLink, inherited)?.(target);
1184
1272
  const destination = resolution?.href ? defaultUrlTransform(resolution.href) : "";
1185
1273
  if (destination) {
1186
- return /* @__PURE__ */ jsx5(
1274
+ return /* @__PURE__ */ jsx6(
1187
1275
  "a",
1188
1276
  {
1189
1277
  className: MARKDOWN_LINK_CLASS,
@@ -1195,10 +1283,10 @@ var markdownComponents = {
1195
1283
  );
1196
1284
  }
1197
1285
  if (resolution?.open) {
1198
- return /* @__PURE__ */ jsx5(ActionMarkdownLink, { title: linkActionTitle(target), onOpen: resolution.open, children });
1286
+ return /* @__PURE__ */ jsx6(ActionMarkdownLink, { title: linkActionTitle(target), onOpen: resolution.open, children });
1199
1287
  }
1200
1288
  if (target.kind === "sandbox-file") {
1201
- return /* @__PURE__ */ jsx5(
1289
+ return /* @__PURE__ */ jsx6(
1202
1290
  "span",
1203
1291
  {
1204
1292
  className: "break-words font-medium text-og-fg-subtle underline decoration-dotted underline-offset-2",
@@ -1227,7 +1315,7 @@ var markdownComponents = {
1227
1315
  }
1228
1316
  );
1229
1317
  }
1230
- return /* @__PURE__ */ jsx5(
1318
+ return /* @__PURE__ */ jsx6(
1231
1319
  "a",
1232
1320
  {
1233
1321
  className: MARKDOWN_LINK_CLASS,
@@ -1252,13 +1340,12 @@ function ActionMarkdownLink({
1252
1340
  type: "button",
1253
1341
  className: cn(
1254
1342
  MARKDOWN_LINK_CLASS,
1255
- "inline-flex min-h-7 cursor-pointer items-center aria-disabled:cursor-wait aria-disabled:opacity-70 pointer-coarse:min-h-11"
1343
+ "inline-flex min-h-7 cursor-pointer items-center disabled:cursor-wait disabled:opacity-70 pointer-coarse:min-h-11"
1256
1344
  ),
1257
- "aria-disabled": state === "loading" || void 0,
1345
+ disabled: state === "loading",
1258
1346
  "aria-busy": state === "loading",
1259
1347
  title: state === "error" ? "Couldn't open this file. Select to retry." : title,
1260
1348
  onClick: () => {
1261
- if (state === "loading") return;
1262
1349
  setState("loading");
1263
1350
  void Promise.resolve().then(onOpen).then(
1264
1351
  () => setState("idle"),
@@ -1285,19 +1372,19 @@ function retainedImageId(src) {
1285
1372
  return parseRetainedFileReference(src);
1286
1373
  }
1287
1374
  function MarkdownImage({ src, alt }) {
1288
- const { renderImage, suppressImages } = useContext4(InteractiveContext);
1375
+ const { renderImage, suppressImages } = useContext5(InteractiveContext);
1289
1376
  if (suppressImages)
1290
1377
  return /* @__PURE__ */ jsxs4("span", { "data-og-image-placeholder": "", children: [
1291
1378
  alt || "Image",
1292
1379
  " (preview unavailable)"
1293
1380
  ] });
1294
- if (!src) return /* @__PURE__ */ jsx5("span", { children: alt ?? "Image unavailable" });
1381
+ if (!src) return /* @__PURE__ */ jsx6("span", { children: alt ?? "Image unavailable" });
1295
1382
  if (retainedImageId(src))
1296
- return renderImage ? /* @__PURE__ */ jsx5(Fragment2, { children: renderImage({ src, alt: alt ?? "" }) }) : /* @__PURE__ */ jsxs4("span", { children: [
1383
+ return renderImage ? /* @__PURE__ */ jsx6(Fragment2, { children: renderImage({ src, alt: alt ?? "" }) }) : /* @__PURE__ */ jsxs4("span", { children: [
1297
1384
  alt || "Image",
1298
1385
  " (preview unavailable)"
1299
1386
  ] });
1300
- return /* @__PURE__ */ jsx5("img", { src, alt: alt ?? "", loading: "lazy", className: "my-3 max-w-full rounded-og-md" });
1387
+ return /* @__PURE__ */ jsx6("img", { src, alt: alt ?? "", loading: "lazy", className: "my-3 max-w-full rounded-og-md" });
1301
1388
  }
1302
1389
  var markdownUrlTransform = (url, key, node) => key === "href" && node.tagName === "a" && isReservedOpenGeniLink(url) || key === "src" && node.tagName === "img" && retainedImageId(url) ? url : defaultUrlTransform(url);
1303
1390
  var REVEAL_LINGER_MS = 480 * MOTION_INSPECT_SCALE;
@@ -1331,7 +1418,7 @@ function fenceLanguage(children) {
1331
1418
  return found;
1332
1419
  }
1333
1420
  function InteractiveCodeBlock({ children, node }) {
1334
- const { source, render, streaming } = useContext4(InteractiveContext);
1421
+ const { source, render, streaming } = useContext5(InteractiveContext);
1335
1422
  const language = fenceLanguage(children);
1336
1423
  if (render && (language === "opengeni-html" || language === "opengeni-site")) {
1337
1424
  const start = node?.position?.start.offset;
@@ -1342,10 +1429,10 @@ function InteractiveCodeBlock({ children, node }) {
1342
1429
  const closing = lines.at(-1)?.replace(/^\s*(?:>\s*)+/, "").trim();
1343
1430
  const complete = opening && lines.length > 1 && closing && closing.length >= opening[1].length && [...closing].every((c) => c === opening[1][0]);
1344
1431
  if (!complete) {
1345
- return /* @__PURE__ */ jsx5("div", { role: "status", "aria-live": "polite", "aria-busy": streaming === true, className: "my-3", children: streaming ? /* @__PURE__ */ jsx5(PreviewLoading, {}) : /* @__PURE__ */ jsx5(
1432
+ return /* @__PURE__ */ jsx6("div", { role: "status", "aria-live": "polite", "aria-busy": streaming === true, className: "my-3", children: streaming ? /* @__PURE__ */ jsx6(PreviewLoading, {}) : /* @__PURE__ */ jsx6(
1346
1433
  ActivityDisclosure,
1347
1434
  {
1348
- icon: /* @__PURE__ */ jsx5(PanelsTopLeftIcon, { "aria-hidden": true, className: "size-3.5" }),
1435
+ icon: /* @__PURE__ */ jsx6(PanelsTopLeftIcon, { "aria-hidden": true, className: "size-3.5" }),
1349
1436
  title: "Preview incomplete",
1350
1437
  running: false,
1351
1438
  expandable: false,
@@ -1353,22 +1440,22 @@ function InteractiveCodeBlock({ children, node }) {
1353
1440
  }
1354
1441
  ) });
1355
1442
  }
1356
- return /* @__PURE__ */ jsx5(Fragment2, { children: render({
1443
+ return /* @__PURE__ */ jsx6(Fragment2, { children: render({
1357
1444
  kind: language === "opengeni-html" ? "html" : "site",
1358
1445
  content: nodeText(children).replace(/\n$/, "")
1359
1446
  }) });
1360
1447
  }
1361
- return /* @__PURE__ */ jsx5(MarkdownCodeBlock, { children });
1448
+ return /* @__PURE__ */ jsx6(MarkdownCodeBlock, { children });
1362
1449
  }
1363
1450
  function MarkdownCodeBlock({ children }) {
1364
1451
  const code = nodeText(children).replace(/\n$/, "");
1365
1452
  const language = fenceLanguage(children);
1366
1453
  return /* @__PURE__ */ jsxs4("div", { className: "group/copy relative mt-3 first:mt-0", children: [
1367
1454
  /* @__PURE__ */ jsxs4("div", { className: "pointer-events-none absolute top-1.5 right-1.5 z-10 flex items-center gap-1", children: [
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" }) })
1455
+ language ? /* @__PURE__ */ jsx6("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,
1456
+ /* @__PURE__ */ jsx6("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx6(CopyButton, { text: code, label: "Copy code", reveal: "group-hover" }) })
1370
1457
  ] }),
1371
- /* @__PURE__ */ jsx5(
1458
+ /* @__PURE__ */ jsx6(
1372
1459
  "pre",
1373
1460
  {
1374
1461
  tabIndex: 0,
@@ -1387,7 +1474,7 @@ function MarkdownTable({ children, className, ...props }) {
1387
1474
  const table = tableRef.current;
1388
1475
  if (!wrapper?.closest("[data-og-wide-table-message]") || !table) return;
1389
1476
  let disposed = false;
1390
- void import("./markdown-table-layout-QXSLK4BY.js").then(({ observeMarkdownTableLayout }) => {
1477
+ void import("./markdown-table-layout-PFUEZ2U4.js").then(({ observeMarkdownTableLayout }) => {
1391
1478
  if (!disposed) layoutRef.current = observeMarkdownTableLayout(wrapper, table);
1392
1479
  }).catch(() => {
1393
1480
  });
@@ -1401,7 +1488,7 @@ function MarkdownTable({ children, className, ...props }) {
1401
1488
  layoutRef.current?.measure();
1402
1489
  }, [children]);
1403
1490
  return /* @__PURE__ */ jsxs4("div", { ref: wrapperRef, className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
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(
1491
+ /* @__PURE__ */ jsx6("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx6("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx6(
1405
1492
  CopyButton,
1406
1493
  {
1407
1494
  text: () => tableElementToTsv(tableRef.current),
@@ -1409,7 +1496,7 @@ function MarkdownTable({ children, className, ...props }) {
1409
1496
  reveal: "group-hover"
1410
1497
  }
1411
1498
  ) }) }),
1412
- /* @__PURE__ */ jsx5("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx5(
1499
+ /* @__PURE__ */ jsx6("div", { className: "overflow-x-auto", tabIndex: 0, children: /* @__PURE__ */ jsx6(
1413
1500
  "table",
1414
1501
  {
1415
1502
  ref: tableRef,
@@ -1493,11 +1580,11 @@ function MarkdownImpl({
1493
1580
  return () => clearTimeout(timer);
1494
1581
  }, [streaming]);
1495
1582
  const parseText = streaming || revealActive ? softenStreamingMarkdown(children) : children;
1496
- const linkContext = useMemo(
1583
+ const linkContext = useMemo2(
1497
1584
  () => ({ onSandboxFile, artifactHref, resolveLink }),
1498
1585
  [onSandboxFile, artifactHref, resolveLink]
1499
1586
  );
1500
- const interactiveContext = useMemo(
1587
+ const interactiveContext = useMemo2(
1501
1588
  () => ({
1502
1589
  source: children,
1503
1590
  streaming,
@@ -1507,7 +1594,7 @@ function MarkdownImpl({
1507
1594
  }),
1508
1595
  [children, streaming, renderInteractiveBlock, renderImage, suppressImages]
1509
1596
  );
1510
- return /* @__PURE__ */ jsx5(MarkdownLinkContext.Provider, { value: linkContext, children: /* @__PURE__ */ jsx5(InteractiveContext.Provider, { value: interactiveContext, children: /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx5(
1597
+ return /* @__PURE__ */ jsx6(MarkdownLinkContext.Provider, { value: linkContext, children: /* @__PURE__ */ jsx6(InteractiveContext.Provider, { value: interactiveContext, children: /* @__PURE__ */ jsx6(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsx6(
1511
1598
  "div",
1512
1599
  {
1513
1600
  ref: bodyRef,
@@ -1516,7 +1603,7 @@ function MarkdownImpl({
1516
1603
  settling && "og-markdown-settle",
1517
1604
  className
1518
1605
  ),
1519
- children: /* @__PURE__ */ jsx5(
1606
+ children: /* @__PURE__ */ jsx6(
1520
1607
  ReactMarkdown,
1521
1608
  {
1522
1609
  remarkPlugins: [remarkGfm],
@@ -1537,10 +1624,10 @@ var Markdown = memo2(function SearchableMarkdown(props) {
1537
1624
  setRetained({ text: props.children, target: props.searchTarget });
1538
1625
  }
1539
1626
  const target = props.searchTarget ?? (retained?.text === props.children ? retained.target : null);
1540
- if (!target) return /* @__PURE__ */ jsx5(MarkdownImpl, { ...props });
1627
+ if (!target) return /* @__PURE__ */ jsx6(MarkdownImpl, { ...props });
1541
1628
  const offset = searchMatchOffset(props.children, target);
1542
1629
  if (offset < 0)
1543
- return props.searchTarget ? /* @__PURE__ */ jsx5("div", { role: "status", children: "This match is no longer in the message source." }) : /* @__PURE__ */ jsx5(MarkdownImpl, { ...props });
1630
+ return props.searchTarget ? /* @__PURE__ */ jsx6("div", { role: "status", children: "This match is no longer in the message source." }) : /* @__PURE__ */ jsx6(MarkdownImpl, { ...props });
1544
1631
  let start = Math.max(0, offset - 240);
1545
1632
  let end = Math.min(props.children.length, offset + target.query.length + 240);
1546
1633
  if (start > 0 && /[\uDC00-\uDFFF]/.test(props.children[start])) start--;
@@ -1549,7 +1636,7 @@ var Markdown = memo2(function SearchableMarkdown(props) {
1549
1636
  return /* @__PURE__ */ jsxs4("div", { className: cn("og-markdown-body min-w-0 break-words", props.className), children: [
1550
1637
  /* @__PURE__ */ jsxs4("div", { "data-og-annotation-chrome": "", className: "text-xs opacity-70", children: [
1551
1638
  "Match in message source \xB7 Excerpt stays in place when Find closes",
1552
- /* @__PURE__ */ jsx5(
1639
+ /* @__PURE__ */ jsx6(
1553
1640
  "button",
1554
1641
  {
1555
1642
  type: "button",
@@ -1564,7 +1651,7 @@ var Markdown = memo2(function SearchableMarkdown(props) {
1564
1651
  /* @__PURE__ */ jsxs4("div", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere" }, children: [
1565
1652
  start > 0 ? "\u2026" : "",
1566
1653
  props.children.slice(start, offset),
1567
- /* @__PURE__ */ jsx5(
1654
+ /* @__PURE__ */ jsx6(
1568
1655
  MatchTag,
1569
1656
  {
1570
1657
  "data-og-search-occurrence": target.occurrence ?? 0,
@@ -1600,9 +1687,13 @@ export {
1600
1687
  MOTION_INSPECT_SCALE,
1601
1688
  CopyButton,
1602
1689
  CopyHoverFrame,
1690
+ chainLinkResolvers,
1691
+ OpenGeniLinkProvider,
1692
+ useOpenGeniLinkResolver,
1693
+ sessionLinkResolver,
1603
1694
  sandboxFileLocationFromHref,
1604
1695
  sandboxFilePathFromHref,
1605
1696
  retainedImageId,
1606
1697
  Markdown
1607
1698
  };
1608
- //# sourceMappingURL=chunk-UQUR5WG5.js.map
1699
+ //# sourceMappingURL=chunk-X4HIN6TV.js.map