synapse-react-client 4.0.30 → 4.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/SWC.index.d.ts +4 -0
  2. package/dist/SWC.index.d.ts.map +1 -1
  3. package/dist/SWC.index.js +2 -1
  4. package/dist/SWC.index.js.map +1 -1
  5. package/dist/assets/illustrations/curie_avatar.svg +52 -0
  6. package/dist/assets/illustrations/curie_avatar_head.js +91 -0
  7. package/dist/assets/illustrations/curie_avatar_head.js.map +1 -0
  8. package/dist/assets/illustrations/curie_avatar_head.svg +21 -0
  9. package/dist/assets/illustrations/discussions_illustration2.js +96 -0
  10. package/dist/assets/illustrations/discussions_illustration2.js.map +1 -0
  11. package/dist/assets/illustrations/discussions_illustration2.svg +17 -0
  12. package/dist/assets/illustrations/index.d.ts +3 -0
  13. package/dist/assets/illustrations/index.d.ts.map +1 -1
  14. package/dist/assets/illustrations/index.js +34 -32
  15. package/dist/assets/illustrations/index.js.map +1 -1
  16. package/dist/assets/mui_components/CurieAvatarHead.d.ts +5 -0
  17. package/dist/assets/mui_components/CurieAvatarHead.d.ts.map +1 -0
  18. package/dist/assets/mui_components/CurieAvatarHead.js +17 -0
  19. package/dist/assets/mui_components/CurieAvatarHead.js.map +1 -0
  20. package/dist/assets/themed_icons/Model.d.ts +3 -0
  21. package/dist/assets/themed_icons/Model.d.ts.map +1 -0
  22. package/dist/assets/themed_icons/Model.js +31 -0
  23. package/dist/assets/themed_icons/Model.js.map +1 -0
  24. package/dist/assets/themed_icons/index.d.ts +2 -1
  25. package/dist/assets/themed_icons/index.d.ts.map +1 -1
  26. package/dist/assets/themed_icons/index.js +19 -18
  27. package/dist/components/ChallengeDataDownload/ChallengeDataDownload.d.ts.map +1 -1
  28. package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js +49 -39
  29. package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js.map +1 -1
  30. package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
  31. package/dist/components/DataGrid/SynapseGrid.js +46 -45
  32. package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
  33. package/dist/components/DataGrid/utils/DataGridUtils.js +1 -1
  34. package/dist/components/DataGrid/utils/DataGridUtils.js.map +1 -1
  35. package/dist/components/EntityFinder/EntityFinder.js +127 -127
  36. package/dist/components/EntityFinder/EntityFinder.js.map +1 -1
  37. package/dist/components/EntityFinder/details/view/DetailsView.js +53 -53
  38. package/dist/components/EntitySidebar/EntitySidebar.css +1 -1
  39. package/dist/components/EntitySidebar/EntitySidebar.module.js +11 -11
  40. package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -1
  41. package/dist/components/EntitySidebar/EntitySidebar.module.scss +2 -2
  42. package/dist/components/EntityTreeTable/EntityTreeTable.d.ts +7 -0
  43. package/dist/components/EntityTreeTable/EntityTreeTable.d.ts.map +1 -1
  44. package/dist/components/EntityTreeTable/EntityTreeTable.js +24 -20
  45. package/dist/components/EntityTreeTable/EntityTreeTable.js.map +1 -1
  46. package/dist/components/EntityTreeTable/components/CheckboxCell.d.ts +4 -0
  47. package/dist/components/EntityTreeTable/components/CheckboxCell.d.ts.map +1 -0
  48. package/dist/components/EntityTreeTable/components/CheckboxCell.js +43 -0
  49. package/dist/components/EntityTreeTable/components/CheckboxCell.js.map +1 -0
  50. package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
  51. package/dist/components/EntityTreeTable/components/EntityNameCell.js +10 -9
  52. package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
  53. package/dist/components/EntityTreeTable/components/EntityTreeTableContext.d.ts +6 -0
  54. package/dist/components/EntityTreeTable/components/EntityTreeTableContext.d.ts.map +1 -1
  55. package/dist/components/EntityTreeTable/components/EntityTreeTableContext.js.map +1 -1
  56. package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts +1 -1
  57. package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
  58. package/dist/components/EntityTreeTable/hooks/useTableColumns.js +49 -39
  59. package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
  60. package/dist/components/EntityUpload/EntityUpload.js +6 -6
  61. package/dist/components/Forum/DiscussionEmpty.css +1 -0
  62. package/dist/components/Forum/DiscussionEmpty.d.ts +6 -0
  63. package/dist/components/Forum/DiscussionEmpty.d.ts.map +1 -0
  64. package/dist/components/Forum/DiscussionEmpty.js +30 -0
  65. package/dist/components/Forum/DiscussionEmpty.js.map +1 -0
  66. package/dist/components/Forum/DiscussionEmpty.module.js +10 -0
  67. package/dist/components/Forum/DiscussionEmpty.module.js.map +1 -0
  68. package/dist/components/Forum/DiscussionEmpty.module.scss +37 -0
  69. package/dist/components/Icon/Icon.d.ts.map +1 -1
  70. package/dist/components/Icon/Icon.js +82 -80
  71. package/dist/components/Icon/Icon.js.map +1 -1
  72. package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
  73. package/dist/components/ProvenanceGraph/ProvenanceGraph.js +39 -41
  74. package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
  75. package/dist/components/SynapseChat/AccessLevelMenu.d.ts.map +1 -1
  76. package/dist/components/SynapseChat/AccessLevelMenu.js +1 -0
  77. package/dist/components/SynapseChat/AccessLevelMenu.js.map +1 -1
  78. package/dist/components/SynapseChat/GridAgentChat.d.ts.map +1 -1
  79. package/dist/components/SynapseChat/GridAgentChat.js +34 -25
  80. package/dist/components/SynapseChat/GridAgentChat.js.map +1 -1
  81. package/dist/components/SynapseChat/SynapseChat.d.ts +10 -12
  82. package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
  83. package/dist/components/SynapseChat/SynapseChat.js +106 -103
  84. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  85. package/dist/components/SynapseChat/SynapseChatInteraction.css +1 -0
  86. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +22 -1
  87. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  88. package/dist/components/SynapseChat/SynapseChatInteraction.js +123 -94
  89. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  90. package/dist/components/SynapseChat/SynapseChatInteraction.module.js +8 -0
  91. package/dist/components/SynapseChat/SynapseChatInteraction.module.js.map +1 -0
  92. package/dist/components/SynapseChat/SynapseChatInteraction.module.scss +25 -0
  93. package/dist/components/SynapseChat/SynapseChatMessage.d.ts +16 -1
  94. package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
  95. package/dist/components/SynapseChat/SynapseChatMessage.js +25 -11
  96. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  97. package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.d.ts +27 -0
  98. package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.d.ts.map +1 -0
  99. package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.js +79 -0
  100. package/dist/components/SynapseChat/components/AddFilesDialog/AddFilesDialog.js.map +1 -0
  101. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.css +1 -0
  102. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.d.ts +33 -0
  103. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.d.ts.map +1 -0
  104. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.js +77 -0
  105. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.js.map +1 -0
  106. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.js +8 -0
  107. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.js.map +1 -0
  108. package/dist/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.scss +16 -0
  109. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.css +1 -0
  110. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.d.ts +23 -0
  111. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.d.ts.map +1 -0
  112. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.js +24 -0
  113. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.js.map +1 -0
  114. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.js +9 -0
  115. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.js.map +1 -0
  116. package/dist/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.scss +19 -0
  117. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.css +1 -0
  118. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.d.ts +22 -0
  119. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.d.ts.map +1 -0
  120. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +80 -0
  121. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -0
  122. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.js +9 -0
  123. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.js.map +1 -0
  124. package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.scss +39 -0
  125. package/dist/components/SynapseChat/useChatState.d.ts +12 -4
  126. package/dist/components/SynapseChat/useChatState.d.ts.map +1 -1
  127. package/dist/components/SynapseChat/useChatState.js +38 -20
  128. package/dist/components/SynapseChat/useChatState.js.map +1 -1
  129. package/dist/components/SynapseChat/utils/constants.d.ts +8 -0
  130. package/dist/components/SynapseChat/utils/constants.d.ts.map +1 -0
  131. package/dist/components/SynapseChat/utils/constants.js +12 -0
  132. package/dist/components/SynapseChat/utils/constants.js.map +1 -0
  133. package/dist/components/SynapseChat/utils/types.d.ts +13 -0
  134. package/dist/components/SynapseChat/utils/types.d.ts.map +1 -0
  135. package/dist/components/SynapseChat/utils/types.js +0 -0
  136. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +101 -101
  137. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  138. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +1 -0
  139. package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
  140. package/dist/components/entity/page/action_menu/EntityActionMenu.js +8 -0
  141. package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
  142. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +1 -1
  143. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
  144. package/dist/components/file/upload/BasicFileHandleUpload.d.ts +35 -4
  145. package/dist/components/file/upload/BasicFileHandleUpload.d.ts.map +1 -1
  146. package/dist/components/file/upload/BasicFileHandleUpload.js +22 -16
  147. package/dist/components/file/upload/BasicFileHandleUpload.js.map +1 -1
  148. package/dist/components/file/upload/MultiFileUploadProgress.js +6 -6
  149. package/dist/components/file/upload/UploadFilePanel.d.ts +32 -0
  150. package/dist/components/file/upload/UploadFilePanel.d.ts.map +1 -1
  151. package/dist/components/file/upload/UploadFilePanel.js +58 -42
  152. package/dist/components/file/upload/UploadFilePanel.js.map +1 -1
  153. package/dist/components/file/upload/validateFileSelection.d.ts +25 -0
  154. package/dist/components/file/upload/validateFileSelection.d.ts.map +1 -0
  155. package/dist/components/file/upload/validateFileSelection.js +18 -0
  156. package/dist/components/file/upload/validateFileSelection.js.map +1 -0
  157. package/dist/components/menu/DropdownMenu.d.ts +3 -0
  158. package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
  159. package/dist/components/menu/DropdownMenu.js +108 -83
  160. package/dist/components/menu/DropdownMenu.js.map +1 -1
  161. package/dist/features/curator/dashboard/components/CurationTaskCard.css +1 -1
  162. package/dist/features/curator/dashboard/components/CurationTaskCard.module.js +13 -13
  163. package/dist/features/curator/dashboard/components/CurationTaskCard.module.js.map +1 -1
  164. package/dist/features/curator/dashboard/components/CurationTaskCard.module.scss +2 -1
  165. package/dist/features/curator/dashboard/components/CurationTaskCardLayout.d.ts.map +1 -1
  166. package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js +35 -27
  167. package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js.map +1 -1
  168. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
  169. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +131 -131
  170. package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
  171. package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.d.ts.map +1 -1
  172. package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js +21 -18
  173. package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js.map +1 -1
  174. package/dist/features/entity/metadata-task/utils/dueDate.d.ts +1 -1
  175. package/dist/features/entity/metadata-task/utils/dueDate.js.map +1 -1
  176. package/dist/mocks/chat/mockChat.d.ts +13 -1
  177. package/dist/mocks/chat/mockChat.d.ts.map +1 -1
  178. package/dist/mocks/chat/mockChat.js +34 -9
  179. package/dist/mocks/chat/mockChat.js.map +1 -1
  180. package/dist/mocks/msw/handlers/chatHandlers.d.ts +1 -1
  181. package/dist/mocks/msw/handlers/chatHandlers.d.ts.map +1 -1
  182. package/dist/mocks/msw/handlers/chatHandlers.js +21 -7
  183. package/dist/mocks/msw/handlers/chatHandlers.js.map +1 -1
  184. package/dist/synapse-client/SynapseClient.d.ts +2 -2
  185. package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
  186. package/dist/synapse-client/SynapseClient.js.map +1 -1
  187. package/dist/synapse-queries/KeyFactory.d.ts +10 -1
  188. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  189. package/dist/synapse-queries/KeyFactory.js +29 -2
  190. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  191. package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.d.ts +2 -2
  192. package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.d.ts.map +1 -1
  193. package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.js +2 -1
  194. package/dist/synapse-queries/asynchronous/usePollAsynchronousJob.js.map +1 -1
  195. package/dist/synapse-queries/chat/useChat.d.ts +3 -2
  196. package/dist/synapse-queries/chat/useChat.d.ts.map +1 -1
  197. package/dist/synapse-queries/chat/useChat.js +7 -6
  198. package/dist/synapse-queries/chat/useChat.js.map +1 -1
  199. package/dist/synapse-queries/dataaccess/index.d.ts +1 -0
  200. package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
  201. package/dist/synapse-queries/dataaccess/index.js +4 -3
  202. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +44 -0
  203. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -0
  204. package/dist/synapse-queries/dataaccess/useEDuc.js +75 -0
  205. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -0
  206. package/dist/synapse-queries/featureflags/useGetFeatureFlag.d.ts.map +1 -1
  207. package/dist/synapse-queries/featureflags/useGetFeatureFlag.js +1 -1
  208. package/dist/synapse-queries/featureflags/useGetFeatureFlag.js.map +1 -1
  209. package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
  210. package/dist/synapse-queries/index.js +181 -172
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/dist/utils/SynapseConstants.d.ts +2 -0
  213. package/dist/utils/SynapseConstants.d.ts.map +1 -1
  214. package/dist/utils/SynapseConstants.js +122 -120
  215. package/dist/utils/SynapseConstants.js.map +1 -1
  216. package/dist/utils/featureflag/FeatureFlags.d.ts +3 -1
  217. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  218. package/dist/utils/featureflag/FeatureFlags.js +1 -1
  219. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  220. package/dist/utils/hooks/useUploadFileEntity/useUploadFileEntities.js +5 -5
  221. package/dist/utils/hooks/useUploadFileEntity/useUploadFiles.js +14 -14
  222. package/package.json +4 -4
@@ -0,0 +1,33 @@
1
+ export type AttachmentChipStatus = 'default' | 'failed';
2
+ export type AttachmentChipProps = {
3
+ /**
4
+ * Display name for the attachment. For a pending/just-uploaded attachment this is the real
5
+ * filename; for a restored/polled turn where file metadata isn't available, pass the
6
+ * fileHandleId instead.
7
+ */
8
+ label: string;
9
+ /**
10
+ * MIME content type, used to derive a short type label (e.g. "PDF"). Omit when the type is
11
+ * unknown (e.g. a restored turn).
12
+ */
13
+ contentType?: string;
14
+ /**
15
+ * @default 'default'
16
+ */
17
+ status?: AttachmentChipStatus;
18
+ /** Shown in a tooltip on the chip when `status` is 'failed'. */
19
+ errorMessage?: string;
20
+ /** If provided, renders a remove ("x") button; invoked when clicked. */
21
+ onRemove?: () => void;
22
+ /** Accessible label for the remove button. @default `Remove ${label}` */
23
+ removeButtonLabel?: string;
24
+ };
25
+ export declare function getContentTypeLabel(contentType?: string): string;
26
+ /**
27
+ * Displays a single chat attachment as a chip with a filename and type label. Used both for
28
+ * attachments still pending send (with a remove button) and for attachments on a sent/restored
29
+ * chat turn (read-only, optionally showing a server-reported failure).
30
+ */
31
+ export declare function AttachmentChip({ label, contentType, status, errorMessage, onRemove, removeButtonLabel, }: AttachmentChipProps): import("react/jsx-runtime").JSX.Element;
32
+ export default AttachmentChip;
33
+ //# sourceMappingURL=AttachmentChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/SynapseChat/components/AttachmentChip/AttachmentChip.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAUD,wBAAgB,mBAAmB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,MAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,iBAAqC,GACtC,EAAE,mBAAmB,2CA+DrB;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,77 @@
1
+ import e from "./AttachmentChip.module.js";
2
+ import { Box as t, IconButton as n, Tooltip as r, Typography as i } from "@mui/material";
3
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import s from "@mui/icons-material/Close";
5
+ //#region src/components/SynapseChat/components/AttachmentChip/AttachmentChip.tsx
6
+ var c = {
7
+ "application/pdf": "PDF",
8
+ "text/plain": "TXT",
9
+ "text/csv": "CSV",
10
+ "application/json": "JSON",
11
+ "text/tab-separated-values": "TSV"
12
+ };
13
+ function l(e) {
14
+ return e ? c[e] ?? "FILE" : "FILE";
15
+ }
16
+ function u({ label: c, contentType: u, status: d = "default", errorMessage: f, onRemove: p, removeButtonLabel: m = `Remove ${c}` }) {
17
+ let h = d === "failed", g = /* @__PURE__ */ o(t, {
18
+ className: e.chip,
19
+ sx: {
20
+ display: "flex",
21
+ alignItems: "center",
22
+ gap: "10px",
23
+ border: "1px solid",
24
+ borderColor: h ? "error.main" : "grey.300",
25
+ borderRadius: "8px",
26
+ boxShadow: "0px 1px 1px rgba(0,0,0,0.05)",
27
+ p: "10px"
28
+ },
29
+ children: [/* @__PURE__ */ o(t, {
30
+ sx: {
31
+ minWidth: 0,
32
+ flex: 1
33
+ },
34
+ children: [/* @__PURE__ */ a(i, {
35
+ variant: "body1",
36
+ sx: {
37
+ fontWeight: 700,
38
+ fontSize: "14px",
39
+ color: h ? "error.main" : "grey.900",
40
+ overflow: "hidden",
41
+ textOverflow: "ellipsis",
42
+ whiteSpace: "nowrap"
43
+ },
44
+ children: c
45
+ }), /* @__PURE__ */ a(i, {
46
+ variant: "body1",
47
+ sx: {
48
+ fontSize: "12px",
49
+ color: "grey.600"
50
+ },
51
+ children: h ? "Failed" : l(u)
52
+ })]
53
+ }), p && /* @__PURE__ */ a(n, {
54
+ type: "button",
55
+ "aria-label": m,
56
+ onClick: p,
57
+ size: "small",
58
+ className: e.removeBadge,
59
+ sx: {
60
+ border: "1px solid",
61
+ borderColor: "grey.300",
62
+ backgroundColor: "white",
63
+ width: "16px",
64
+ height: "16px"
65
+ },
66
+ children: /* @__PURE__ */ a(s, { sx: { fontSize: "10px" } })
67
+ })]
68
+ });
69
+ return h && f ? /* @__PURE__ */ a(r, {
70
+ title: f,
71
+ children: g
72
+ }) : g;
73
+ }
74
+ //#endregion
75
+ export { u as AttachmentChip, u as default, l as getContentTypeLabel };
76
+
77
+ //# sourceMappingURL=AttachmentChip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentChip.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/AttachmentChip/AttachmentChip.tsx"],"sourcesContent":["import CloseIcon from '@mui/icons-material/Close'\nimport { Box, IconButton, Tooltip, Typography } from '@mui/material'\nimport styles from './AttachmentChip.module.scss'\n\nexport type AttachmentChipStatus = 'default' | 'failed'\n\nexport type AttachmentChipProps = {\n /**\n * Display name for the attachment. For a pending/just-uploaded attachment this is the real\n * filename; for a restored/polled turn where file metadata isn't available, pass the\n * fileHandleId instead.\n */\n label: string\n /**\n * MIME content type, used to derive a short type label (e.g. \"PDF\"). Omit when the type is\n * unknown (e.g. a restored turn).\n */\n contentType?: string\n /**\n * @default 'default'\n */\n status?: AttachmentChipStatus\n /** Shown in a tooltip on the chip when `status` is 'failed'. */\n errorMessage?: string\n /** If provided, renders a remove (\"x\") button; invoked when clicked. */\n onRemove?: () => void\n /** Accessible label for the remove button. @default `Remove ${label}` */\n removeButtonLabel?: string\n}\n\nconst CONTENT_TYPE_LABELS: Record<string, string> = {\n 'application/pdf': 'PDF',\n 'text/plain': 'TXT',\n 'text/csv': 'CSV',\n 'application/json': 'JSON',\n 'text/tab-separated-values': 'TSV',\n}\n\nexport function getContentTypeLabel(contentType?: string): string {\n if (!contentType) {\n return 'FILE'\n }\n return CONTENT_TYPE_LABELS[contentType] ?? 'FILE'\n}\n\n/**\n * Displays a single chat attachment as a chip with a filename and type label. Used both for\n * attachments still pending send (with a remove button) and for attachments on a sent/restored\n * chat turn (read-only, optionally showing a server-reported failure).\n */\nexport function AttachmentChip({\n label,\n contentType,\n status = 'default',\n errorMessage,\n onRemove,\n removeButtonLabel = `Remove ${label}`,\n}: AttachmentChipProps) {\n const isFailed = status === 'failed'\n\n const chip = (\n <Box\n className={styles.chip}\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: '10px',\n border: '1px solid',\n borderColor: isFailed ? 'error.main' : 'grey.300',\n borderRadius: '8px',\n boxShadow: '0px 1px 1px rgba(0,0,0,0.05)',\n p: '10px',\n }}\n >\n <Box sx={{ minWidth: 0, flex: 1 }}>\n <Typography\n variant=\"body1\"\n sx={{\n fontWeight: 700,\n fontSize: '14px',\n color: isFailed ? 'error.main' : 'grey.900',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {label}\n </Typography>\n <Typography\n variant=\"body1\"\n sx={{ fontSize: '12px', color: 'grey.600' }}\n >\n {isFailed ? 'Failed' : getContentTypeLabel(contentType)}\n </Typography>\n </Box>\n {onRemove && (\n <IconButton\n type=\"button\"\n aria-label={removeButtonLabel}\n onClick={onRemove}\n size=\"small\"\n className={styles.removeBadge}\n sx={{\n border: '1px solid',\n borderColor: 'grey.300',\n backgroundColor: 'white',\n width: '16px',\n height: '16px',\n }}\n >\n <CloseIcon sx={{ fontSize: '10px' }} />\n </IconButton>\n )}\n </Box>\n )\n\n if (isFailed && errorMessage) {\n return <Tooltip title={errorMessage}>{chip}</Tooltip>\n }\n return chip\n}\n\nexport default AttachmentChip\n"],"mappings":";;;;;AA8BA,IAAM,IAA8C;CAClD,mBAAmB;CACnB,cAAc;CACd,YAAY;CACZ,oBAAoB;CACpB,6BAA6B;AAC/B;AAEA,SAAgB,EAAoB,GAA8B;CAIhE,OAHK,IAGE,EAAoB,MAAgB,SAFlC;AAGX;AAOA,SAAgB,EAAe,EAC7B,UACA,gBACA,YAAS,WACT,iBACA,aACA,uBAAoB,UAAU,OACR;CACtB,IAAM,IAAW,MAAW,UAEtB,IACJ,kBAAC,GAAD;EACE,WAAW,EAAO;EAClB,IAAI;GACF,SAAS;GACT,YAAY;GACZ,KAAK;GACL,QAAQ;GACR,aAAa,IAAW,eAAe;GACvC,cAAc;GACd,WAAW;GACX,GAAG;EACL;YAXF,CAaE,kBAAC,GAAD;GAAK,IAAI;IAAE,UAAU;IAAG,MAAM;GAAE;aAAhC,CACE,kBAAC,GAAD;IACE,SAAQ;IACR,IAAI;KACF,YAAY;KACZ,UAAU;KACV,OAAO,IAAW,eAAe;KACjC,UAAU;KACV,cAAc;KACd,YAAY;IACd;cAEC;GACS,CAAA,GACZ,kBAAC,GAAD;IACE,SAAQ;IACR,IAAI;KAAE,UAAU;KAAQ,OAAO;IAAW;cAEzC,IAAW,WAAW,EAAoB,CAAW;GAC5C,CAAA,CACT;MACJ,KACC,kBAAC,GAAD;GACE,MAAK;GACL,cAAY;GACZ,SAAS;GACT,MAAK;GACL,WAAW,EAAO;GAClB,IAAI;IACF,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,OAAO;IACP,QAAQ;GACV;aAEA,kBAAC,GAAD,EAAW,IAAI,EAAE,UAAU,OAAO,EAAI,CAAA;EAC5B,CAAA,CAEX;;CAMP,OAHI,KAAY,IACP,kBAAC,GAAD;EAAS,OAAO;YAAe;CAAc,CAAA,IAE/C;AACT"}
@@ -0,0 +1,8 @@
1
+ import './AttachmentChip.css';var e = {
2
+ chip: "_chip_1uzei_1",
3
+ removeBadge: "_removeBadge_1uzei_5"
4
+ };
5
+ //#endregion
6
+ export { e as default };
7
+
8
+ //# sourceMappingURL=AttachmentChip.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentChip.module.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/AttachmentChip/AttachmentChip.module.scss"],"sourcesContent":[".chip {\n position: relative;\n}\n\n.removeBadge:global(.MuiButtonBase-root) {\n position: absolute;\n top: -6px;\n left: -6px;\n opacity: 0;\n transition: opacity 100ms;\n}\n\n.chip:hover .removeBadge,\n.chip:focus-within .removeBadge {\n opacity: 1;\n}\n"],"mappings":""}
@@ -0,0 +1,16 @@
1
+ .chip {
2
+ position: relative;
3
+ }
4
+
5
+ .removeBadge:global(.MuiButtonBase-root) {
6
+ position: absolute;
7
+ top: -6px;
8
+ left: -6px;
9
+ opacity: 0;
10
+ transition: opacity 100ms;
11
+ }
12
+
13
+ .chip:hover .removeBadge,
14
+ .chip:focus-within .removeBadge {
15
+ opacity: 1;
16
+ }
@@ -0,0 +1 @@
1
+ ._strip_10c32_1{gap:10px;display:flex;overflow-x:auto}._wrap_10c32_7{flex-wrap:wrap;overflow-x:visible}._item_10c32_12{flex:1 1 0;min-width:140px}
@@ -0,0 +1,23 @@
1
+ import { AttachmentChipStatus } from '../AttachmentChip/AttachmentChip';
2
+ export type AttachmentStripItem = {
3
+ fileHandleId: string;
4
+ label: string;
5
+ contentType?: string;
6
+ status?: AttachmentChipStatus;
7
+ errorMessage?: string;
8
+ };
9
+ export type ChatAttachmentStripProps = {
10
+ items: AttachmentStripItem[];
11
+ /** Wrap to multiple rows instead of overflowing horizontally. @default false */
12
+ wrap?: boolean;
13
+ /** If provided, each chip gets a remove badge. Invoked with the fileHandleId of the attachment to remove. */
14
+ onRemove?: (fileHandleId: string) => void;
15
+ };
16
+ /**
17
+ * A strip of attachment chips. Used both above the chat text input for attachments pending
18
+ * send (horizontally-scrolling, with a remove control on each chip) and below a sent message
19
+ * in the chat transcript (wrapping, read-only).
20
+ */
21
+ export declare function ChatAttachmentStrip({ items, wrap, onRemove, }: ChatAttachmentStripProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export default ChatAttachmentStrip;
23
+ //# sourceMappingURL=ChatAttachmentStrip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatAttachmentStrip.d.ts","sourceRoot":"","sources":["../../../../../src/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACrB,MAAM,kCAAkC,CAAA;AAGzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,mBAAmB,EAAE,CAAA;IAC5B,gFAAgF;IAChF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAY,EACZ,QAAQ,GACT,EAAE,wBAAwB,kDAoB1B;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { AttachmentChip as e } from "../AttachmentChip/AttachmentChip.js";
2
+ import t from "./ChatAttachmentStrip.module.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import r from "classnames";
5
+ //#region src/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.tsx
6
+ function i({ items: i, wrap: a = !1, onRemove: o }) {
7
+ return i.length === 0 ? null : /* @__PURE__ */ n("div", {
8
+ className: r(t.strip, a && t.wrap),
9
+ children: i.map((r) => /* @__PURE__ */ n("div", {
10
+ className: t.item,
11
+ children: /* @__PURE__ */ n(e, {
12
+ label: r.label,
13
+ contentType: r.contentType,
14
+ status: r.status,
15
+ errorMessage: r.errorMessage,
16
+ onRemove: o ? () => o(r.fileHandleId) : void 0
17
+ })
18
+ }, r.fileHandleId))
19
+ });
20
+ }
21
+ //#endregion
22
+ export { i as ChatAttachmentStrip, i as default };
23
+
24
+ //# sourceMappingURL=ChatAttachmentStrip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatAttachmentStrip.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport {\n AttachmentChip,\n AttachmentChipStatus,\n} from '../AttachmentChip/AttachmentChip'\nimport styles from './ChatAttachmentStrip.module.scss'\n\nexport type AttachmentStripItem = {\n fileHandleId: string\n label: string\n contentType?: string\n status?: AttachmentChipStatus\n errorMessage?: string\n}\n\nexport type ChatAttachmentStripProps = {\n items: AttachmentStripItem[]\n /** Wrap to multiple rows instead of overflowing horizontally. @default false */\n wrap?: boolean\n /** If provided, each chip gets a remove badge. Invoked with the fileHandleId of the attachment to remove. */\n onRemove?: (fileHandleId: string) => void\n}\n\n/**\n * A strip of attachment chips. Used both above the chat text input for attachments pending\n * send (horizontally-scrolling, with a remove control on each chip) and below a sent message\n * in the chat transcript (wrapping, read-only).\n */\nexport function ChatAttachmentStrip({\n items,\n wrap = false,\n onRemove,\n}: ChatAttachmentStripProps) {\n if (items.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.strip, wrap && styles.wrap)}>\n {items.map(item => (\n <div key={item.fileHandleId} className={styles.item}>\n <AttachmentChip\n label={item.label}\n contentType={item.contentType}\n status={item.status}\n errorMessage={item.errorMessage}\n onRemove={onRemove ? () => onRemove(item.fileHandleId) : undefined}\n />\n </div>\n ))}\n </div>\n )\n}\n\nexport default ChatAttachmentStrip\n"],"mappings":";;;;;AA4BA,SAAgB,EAAoB,EAClC,UACA,UAAO,IACP,eAC2B;CAK3B,OAJI,EAAM,WAAW,IACZ,OAIP,kBAAC,OAAD;EAAK,WAAW,EAAW,EAAO,OAAO,KAAQ,EAAO,IAAI;YACzD,EAAM,KAAI,MACT,kBAAC,OAAD;GAA6B,WAAW,EAAO;aAC7C,kBAAC,GAAD;IACE,OAAO,EAAK;IACZ,aAAa,EAAK;IAClB,QAAQ,EAAK;IACb,cAAc,EAAK;IACnB,UAAU,UAAiB,EAAS,EAAK,YAAY,IAAI,KAAA;GAC1D,CAAA;EACE,GARK,EAAK,YAQV,CACN;CACE,CAAA;AAET"}
@@ -0,0 +1,9 @@
1
+ import './ChatAttachmentStrip.css';var e = {
2
+ strip: "_strip_10c32_1",
3
+ wrap: "_wrap_10c32_7",
4
+ item: "_item_10c32_12"
5
+ };
6
+ //#endregion
7
+ export { e as default };
8
+
9
+ //# sourceMappingURL=ChatAttachmentStrip.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatAttachmentStrip.module.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/ChatAttachmentStrip/ChatAttachmentStrip.module.scss"],"sourcesContent":["// Minimum width for each chip so 3 attachments are visible and a 4th is partially offscreen\n// in the 480px-wide composer. Kept as a SCSS variable since CSS is its only consumer.\n$chip-min-width: 140px;\n\n.strip {\n display: flex;\n gap: 10px;\n overflow-x: auto;\n}\n\n.wrap {\n flex-wrap: wrap;\n overflow-x: visible;\n}\n\n.item {\n flex: 1 1 0;\n min-width: $chip-min-width;\n}\n"],"mappings":""}
@@ -0,0 +1,19 @@
1
+ // Minimum width for each chip so 3 attachments are visible and a 4th is partially offscreen
2
+ // in the 480px-wide composer. Kept as a SCSS variable since CSS is its only consumer.
3
+ $chip-min-width: 140px;
4
+
5
+ .strip {
6
+ display: flex;
7
+ gap: 10px;
8
+ overflow-x: auto;
9
+ }
10
+
11
+ .wrap {
12
+ flex-wrap: wrap;
13
+ overflow-x: visible;
14
+ }
15
+
16
+ .item {
17
+ flex: 1 1 0;
18
+ min-width: $chip-min-width;
19
+ }
@@ -0,0 +1 @@
1
+ ._card_2es7d_1{background:var(--synapse-white);border:1px solid var(--synapse-gray-300);border-radius:8px;flex-direction:column;gap:8px;padding:16px;display:flex;box-shadow:0 6px 6px #00000008,0 1px 1px #00000008}._card_2es7d_1:has(textarea:focus){border-color:var(--synapse-primary-focus-border);box-shadow:0 6px 6px #00000008, 0 1px 1px #00000008, 0 0 0 .1rem var(--synapse-primary-focus-shadow)}._textarea_2es7d_16{width:100%;min-height:44px;box-shadow:none;resize:none;font:inherit;background:0 0;border:0;outline:0;padding:0}._actions_2es7d_28{justify-content:flex-end;align-items:center;gap:10px;display:flex}
@@ -0,0 +1,22 @@
1
+ import { ChatAttachment } from '../../utils/types';
2
+ /** Max number of visible rows the textarea grows to before it scrolls internally. */
3
+ export declare const MAX_CHAT_INPUT_ROWS = 6;
4
+ export type ChatInputAreaProps = {
5
+ value: string;
6
+ onValueChange: (value: string) => void;
7
+ onSend: (message: string, attachments: ChatAttachment[]) => void;
8
+ placeholder?: string;
9
+ /** No session yet, or a response is in flight. */
10
+ disabled?: boolean;
11
+ /** @default false */
12
+ allowAttachments?: boolean;
13
+ };
14
+ /**
15
+ * The chat composer: a bordered card containing a conditional attachment strip, an
16
+ * auto-growing borderless text input, and a right-aligned row of actions (attach + send).
17
+ * Owns attachment upload state end-to-end; the message text itself is controlled by the
18
+ * caller since it can also be set from outside the card (e.g. suggested-prompt pills).
19
+ */
20
+ export declare function ChatInputArea({ value, onValueChange, onSend, placeholder, disabled, allowAttachments, }: ChatInputAreaProps): import("react/jsx-runtime").JSX.Element;
21
+ export default ChatInputArea;
22
+ //# sourceMappingURL=ChatInputArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInputArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/SynapseChat/components/ChatInputArea/ChatInputArea.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAUD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,aAAa,EACb,MAAM,EACN,WAAW,EACX,QAAgB,EAChB,gBAAwB,GACzB,EAAE,kBAAkB,2CAyGpB;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,80 @@
1
+ import { ALLOWED_FILE_TYPES_LABEL as e, AddFilesDialog as t } from "../AddFilesDialog/AddFilesDialog.js";
2
+ import { ChatAttachmentStrip as n } from "../ChatAttachmentStrip/ChatAttachmentStrip.js";
3
+ import r from "./ChatInputArea.module.js";
4
+ import { useMemo as i, useState as a } from "react";
5
+ import { Box as o, IconButton as s, TextareaAutosize as c, Tooltip as l } from "@mui/material";
6
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { Add as p } from "@mui/icons-material";
8
+ import m from "@mui/icons-material/ArrowUpward";
9
+ //#region src/components/SynapseChat/components/ChatInputArea/ChatInputArea.tsx
10
+ var h = 6, g = {
11
+ height: "36px",
12
+ px: "12px",
13
+ border: "1px solid",
14
+ borderColor: "grey.300",
15
+ borderRadius: "1px"
16
+ };
17
+ function _({ value: h, onValueChange: _, onSend: v, placeholder: y, disabled: b = !1, allowAttachments: x = !1 }) {
18
+ let [S, C] = a([]), [w, T] = a(!1), [E, D] = a(!1), O = b || !h.trim() || E, k = () => {
19
+ O || (v(h.trim(), S), C([]));
20
+ }, A = (e) => {
21
+ e.preventDefault(), k();
22
+ }, j = (e) => {
23
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), k());
24
+ }, M = i(() => S.map((e) => ({
25
+ fileHandleId: e.fileHandleId,
26
+ label: e.fileName,
27
+ contentType: e.contentType
28
+ })), [S]);
29
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(o, {
30
+ component: "form",
31
+ className: r.card,
32
+ onSubmit: A,
33
+ children: [
34
+ x && /* @__PURE__ */ d(n, {
35
+ items: M,
36
+ onRemove: (e) => C((t) => t.filter((t) => t.fileHandleId !== e))
37
+ }),
38
+ /* @__PURE__ */ d(c, {
39
+ className: r.textarea,
40
+ minRows: 1,
41
+ maxRows: 6,
42
+ value: h,
43
+ onChange: (e) => _(e.target.value),
44
+ onKeyDown: j,
45
+ placeholder: y
46
+ }),
47
+ /* @__PURE__ */ f("div", {
48
+ className: r.actions,
49
+ children: [x && /* @__PURE__ */ d(l, {
50
+ title: `Upload files (${e})`,
51
+ placement: "left",
52
+ children: /* @__PURE__ */ d(s, {
53
+ type: "button",
54
+ "aria-label": "Add files",
55
+ disabled: b,
56
+ onClick: () => T(!0),
57
+ sx: g,
58
+ children: /* @__PURE__ */ d(p, {})
59
+ })
60
+ }), /* @__PURE__ */ d(s, {
61
+ type: "submit",
62
+ "aria-label": "Send message",
63
+ disabled: O,
64
+ sx: g,
65
+ children: /* @__PURE__ */ d(m, {})
66
+ })]
67
+ })
68
+ ]
69
+ }), x && /* @__PURE__ */ d(t, {
70
+ open: w,
71
+ onClose: () => T(!1),
72
+ currentAttachmentCount: S.length,
73
+ onAttachmentUploaded: (e) => C((t) => [...t, e]),
74
+ onUploadStateChange: (e) => D(e === "UPLOADING")
75
+ })] });
76
+ }
77
+ //#endregion
78
+ export { _ as ChatInputArea, _ as default, h as MAX_CHAT_INPUT_ROWS };
79
+
80
+ //# sourceMappingURL=ChatInputArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInputArea.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/ChatInputArea/ChatInputArea.tsx"],"sourcesContent":["import { Add } from '@mui/icons-material'\nimport ArrowUpward from '@mui/icons-material/ArrowUpward'\nimport { Box, IconButton, TextareaAutosize, Tooltip } from '@mui/material'\nimport {\n FormEventHandler,\n KeyboardEventHandler,\n useMemo,\n useState,\n} from 'react'\nimport {\n AddFilesDialog,\n ALLOWED_FILE_TYPES_LABEL,\n} from '../AddFilesDialog/AddFilesDialog'\nimport {\n AttachmentStripItem,\n ChatAttachmentStrip,\n} from '../ChatAttachmentStrip/ChatAttachmentStrip'\nimport styles from './ChatInputArea.module.scss'\nimport { ChatAttachment } from '../../utils/types'\n\n/** Max number of visible rows the textarea grows to before it scrolls internally. */\nexport const MAX_CHAT_INPUT_ROWS = 6\n\nexport type ChatInputAreaProps = {\n value: string\n onValueChange: (value: string) => void\n onSend: (message: string, attachments: ChatAttachment[]) => void\n placeholder?: string\n /** No session yet, or a response is in flight. */\n disabled?: boolean\n /** @default false */\n allowAttachments?: boolean\n}\n\nconst actionButtonSx = {\n height: '36px',\n px: '12px',\n border: '1px solid',\n borderColor: 'grey.300',\n borderRadius: '1px',\n}\n\n/**\n * The chat composer: a bordered card containing a conditional attachment strip, an\n * auto-growing borderless text input, and a right-aligned row of actions (attach + send).\n * Owns attachment upload state end-to-end; the message text itself is controlled by the\n * caller since it can also be set from outside the card (e.g. suggested-prompt pills).\n */\nexport function ChatInputArea({\n value,\n onValueChange,\n onSend,\n placeholder,\n disabled = false,\n allowAttachments = false,\n}: ChatInputAreaProps) {\n const [pendingAttachments, setPendingAttachments] = useState<\n ChatAttachment[]\n >([])\n const [isAddFilesDialogOpen, setIsAddFilesDialogOpen] = useState(false)\n const [isUploadingAttachments, setIsUploadingAttachments] = useState(false)\n\n const isSendDisabled = disabled || !value.trim() || isUploadingAttachments\n\n const submit = () => {\n if (isSendDisabled) {\n return\n }\n onSend(value.trim(), pendingAttachments)\n setPendingAttachments([])\n }\n\n const handleFormSubmit: FormEventHandler<HTMLFormElement> = event => {\n event.preventDefault()\n submit()\n }\n\n const handleTextareaKeyDown: KeyboardEventHandler<\n HTMLTextAreaElement\n > = event => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n submit()\n }\n }\n\n const attachmentItems: AttachmentStripItem[] = useMemo(\n () =>\n pendingAttachments.map(attachment => ({\n fileHandleId: attachment.fileHandleId,\n label: attachment.fileName,\n contentType: attachment.contentType,\n })),\n [pendingAttachments],\n )\n\n return (\n <>\n <Box component=\"form\" className={styles.card} onSubmit={handleFormSubmit}>\n {allowAttachments && (\n <ChatAttachmentStrip\n items={attachmentItems}\n onRemove={fileHandleId =>\n setPendingAttachments(prev =>\n prev.filter(a => a.fileHandleId !== fileHandleId),\n )\n }\n />\n )}\n <TextareaAutosize\n className={styles.textarea}\n minRows={1}\n maxRows={MAX_CHAT_INPUT_ROWS}\n value={value}\n onChange={e => onValueChange(e.target.value)}\n onKeyDown={handleTextareaKeyDown}\n placeholder={placeholder}\n />\n <div className={styles.actions}>\n {allowAttachments && (\n <Tooltip\n title={`Upload files (${ALLOWED_FILE_TYPES_LABEL})`}\n placement=\"left\"\n >\n <IconButton\n type=\"button\"\n aria-label=\"Add files\"\n disabled={disabled}\n onClick={() => setIsAddFilesDialogOpen(true)}\n sx={actionButtonSx}\n >\n <Add />\n </IconButton>\n </Tooltip>\n )}\n <IconButton\n type=\"submit\"\n aria-label=\"Send message\"\n disabled={isSendDisabled}\n sx={actionButtonSx}\n >\n <ArrowUpward />\n </IconButton>\n </div>\n </Box>\n {allowAttachments && (\n <AddFilesDialog\n open={isAddFilesDialogOpen}\n onClose={() => setIsAddFilesDialogOpen(false)}\n currentAttachmentCount={pendingAttachments.length}\n onAttachmentUploaded={attachment =>\n setPendingAttachments(prev => [...prev, attachment])\n }\n onUploadStateChange={state =>\n setIsUploadingAttachments(state === 'UPLOADING')\n }\n />\n )}\n </>\n )\n}\n\nexport default ChatInputArea\n"],"mappings":";;;;;;;;;AAqBA,IAAa,IAAsB,GAa7B,IAAiB;CACrB,QAAQ;CACR,IAAI;CACJ,QAAQ;CACR,aAAa;CACb,cAAc;AAChB;AAQA,SAAgB,EAAc,EAC5B,UACA,kBACA,WACA,gBACA,cAAW,IACX,sBAAmB,MACE;CACrB,IAAM,CAAC,GAAoB,KAAyB,EAElD,CAAC,CAAC,GACE,CAAC,GAAsB,KAA2B,EAAS,EAAK,GAChE,CAAC,GAAwB,KAA6B,EAAS,EAAK,GAEpE,IAAiB,KAAY,CAAC,EAAM,KAAK,KAAK,GAE9C,UAAe;EACf,MAGJ,EAAO,EAAM,KAAK,GAAG,CAAkB,GACvC,EAAsB,CAAC,CAAC;CAC1B,GAEM,KAAsD,MAAS;EAEnE,AADA,EAAM,eAAe,GACrB,EAAO;CACT,GAEM,KAEF,MAAS;EACX,AAAI,EAAM,QAAQ,WAAW,CAAC,EAAM,aAClC,EAAM,eAAe,GACrB,EAAO;CAEX,GAEM,IAAyC,QAE3C,EAAmB,KAAI,OAAe;EACpC,cAAc,EAAW;EACzB,OAAO,EAAW;EAClB,aAAa,EAAW;CAC1B,EAAE,GACJ,CAAC,CAAkB,CACrB;CAEA,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EAAK,WAAU;EAAO,WAAW,EAAO;EAAM,UAAU;YAAxD;GACG,KACC,kBAAC,GAAD;IACE,OAAO;IACP,WAAU,MACR,GAAsB,MACpB,EAAK,QAAO,MAAK,EAAE,iBAAiB,CAAY,CAClD;GAEH,CAAA;GAEH,kBAAC,GAAD;IACE,WAAW,EAAO;IAClB,SAAS;IACT,SAAA;IACO;IACP,WAAU,MAAK,EAAc,EAAE,OAAO,KAAK;IAC3C,WAAW;IACE;GACd,CAAA;GACD,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAvB,CACG,KACC,kBAAC,GAAD;KACE,OAAO,iBAAiB,EAAyB;KACjD,WAAU;eAEV,kBAAC,GAAD;MACE,MAAK;MACL,cAAW;MACD;MACV,eAAe,EAAwB,EAAI;MAC3C,IAAI;gBAEJ,kBAAC,GAAD,CAAM,CAAA;KACI,CAAA;IACL,CAAA,GAEX,kBAAC,GAAD;KACE,MAAK;KACL,cAAW;KACX,UAAU;KACV,IAAI;eAEJ,kBAAC,GAAD,CAAc,CAAA;IACJ,CAAA,CACT;;EACF;KACJ,KACC,kBAAC,GAAD;EACE,MAAM;EACN,eAAe,EAAwB,EAAK;EAC5C,wBAAwB,EAAmB;EAC3C,uBAAsB,MACpB,GAAsB,MAAQ,CAAC,GAAG,GAAM,CAAU,CAAC;EAErD,sBAAqB,MACnB,EAA0B,MAAU,WAAW;CAElD,CAAA,CAEH,EAAA,CAAA;AAEN"}
@@ -0,0 +1,9 @@
1
+ import './ChatInputArea.css';var e = {
2
+ card: "_card_2es7d_1",
3
+ textarea: "_textarea_2es7d_16",
4
+ actions: "_actions_2es7d_28"
5
+ };
6
+ //#endregion
7
+ export { e as default };
8
+
9
+ //# sourceMappingURL=ChatInputArea.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInputArea.module.js","names":[],"sources":["../../../../../src/components/SynapseChat/components/ChatInputArea/ChatInputArea.module.scss"],"sourcesContent":[".card {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px;\n background: var(--synapse-white);\n border: 1px solid var(--synapse-gray-300);\n border-radius: 8px;\n box-shadow:\n 0 6px 6px rgb(0 0 0 / 3%),\n 0 1px 1px rgb(0 0 0 / 3%);\n\n &:has(textarea:focus) {\n border-color: var(--synapse-primary-focus-border);\n box-shadow:\n 0 6px 6px rgb(0 0 0 / 3%),\n 0 1px 1px rgb(0 0 0 / 3%),\n 0 0 0 0.1rem var(--synapse-primary-focus-shadow);\n }\n}\n\n.textarea {\n width: 100%;\n min-height: 44px;\n padding: 0;\n border: 0;\n outline: 0;\n box-shadow: none;\n resize: none;\n background: transparent;\n font: inherit;\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 10px;\n}\n"],"mappings":""}
@@ -0,0 +1,39 @@
1
+ .card {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 8px;
5
+ padding: 16px;
6
+ background: var(--synapse-white);
7
+ border: 1px solid var(--synapse-gray-300);
8
+ border-radius: 8px;
9
+ box-shadow:
10
+ 0 6px 6px rgb(0 0 0 / 3%),
11
+ 0 1px 1px rgb(0 0 0 / 3%);
12
+
13
+ &:has(textarea:focus) {
14
+ border-color: var(--synapse-primary-focus-border);
15
+ box-shadow:
16
+ 0 6px 6px rgb(0 0 0 / 3%),
17
+ 0 1px 1px rgb(0 0 0 / 3%),
18
+ 0 0 0 0.1rem var(--synapse-primary-focus-shadow);
19
+ }
20
+ }
21
+
22
+ .textarea {
23
+ width: 100%;
24
+ min-height: 44px;
25
+ padding: 0;
26
+ border: 0;
27
+ outline: 0;
28
+ box-shadow: none;
29
+ resize: none;
30
+ background: transparent;
31
+ font: inherit;
32
+ }
33
+
34
+ .actions {
35
+ display: flex;
36
+ justify-content: flex-end;
37
+ align-items: center;
38
+ gap: 10px;
39
+ }
@@ -1,8 +1,16 @@
1
- import { AgentSession } from '@sage-bionetworks/synapse-types';
1
+ import { AgentSession, FileHandleAssociation } from '@sage-bionetworks/synapse-client';
2
+ export type ChatInteraction = {
3
+ /** client-generated at send time; stable for the interaction's whole life */
4
+ id: string;
5
+ /** known at send time, never re-fetched */
6
+ userMessage: string;
7
+ /** undefined until the async job is registered */
8
+ jobId?: string;
9
+ };
2
10
  export type ChatState = {
3
- sendChat: (message: string) => void;
4
- pendingMessage: string | null;
5
- chatJobIds: string[];
11
+ sendChat: (message: string, attachments?: FileHandleAssociation[]) => void;
12
+ interactions: ChatInteraction[];
13
+ isAwaitingResponse: boolean;
6
14
  };
7
15
  export declare function useChatState(agentSession?: AgentSession, onChatResponse?: (responseText: string) => void): ChatState;
8
16
  //# sourceMappingURL=useChatState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChatState.d.ts","sourceRoot":"","sources":["../../../src/components/SynapseChat/useChatState.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAEb,MAAM,iCAAiC,CAAA;AAGxC,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED,wBAAgB,YAAY,CAC1B,YAAY,CAAC,EAAE,YAAY,EAC3B,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,GAC9C,SAAS,CAyCX"}
1
+ {"version":3,"file":"useChatState.d.ts","sourceRoot":"","sources":["../../../src/components/SynapseChat/useChatState.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAGZ,qBAAqB,EACtB,MAAM,kCAAkC,CAAA;AAKzC,MAAM,MAAM,eAAe,GAAG;IAC5B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAA;IAC1E,YAAY,EAAE,eAAe,EAAE,CAAA;IAC/B,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,wBAAgB,YAAY,CAC1B,YAAY,CAAC,EAAE,YAAY,EAC3B,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,GAC9C,SAAS,CAuEX"}
@@ -1,35 +1,53 @@
1
- import { useSendChatMessageToAgent as e } from "../../synapse-queries/chat/useChat.js";
2
- import { useCallback as t, useMemo as n, useState as r } from "react";
1
+ import { useSynapseContext as e } from "../../utils/context/SynapseContext.js";
2
+ import "../../utils/index.js";
3
+ import { useSendChatMessageToAgent as t } from "../../synapse-queries/chat/useChat.js";
4
+ import { useCallback as n, useMemo as r, useRef as i, useState as a } from "react";
5
+ import { useQueryClient as o } from "@tanstack/react-query";
3
6
  //#region src/components/SynapseChat/useChatState.ts
4
- function i(i, a) {
5
- let [o, s] = r([]), [c, l] = r(null), { mutate: u } = e({
7
+ function s(s, c) {
8
+ let { keyFactory: l } = e(), u = o(), [d, f] = a([]), p = i(0), { mutate: m, isPending: h } = t({
6
9
  onMutate: (e) => {
7
- l(e.chatText);
10
+ let t = String(p.current++);
11
+ f((n) => [...n, {
12
+ id: t,
13
+ userMessage: e.chatText
14
+ }]);
8
15
  },
9
16
  onSuccess: (e) => {
10
- a?.(e.responseText);
17
+ c?.(e?.responseBody?.responseText);
11
18
  }
12
19
  }, (e) => {
13
- o.includes(e.jobId) || (l(null), s(() => [...o, e.jobId]));
14
- }), d = t((e) => {
15
- if (!i?.sessionId) throw Error("No agent session available to send chat message.");
16
- u({
20
+ u.setQueryData(l.getAsyncJobStatusQueryKey(e.jobId), e), f((t) => {
21
+ if (t.some((t) => t.jobId === e.jobId)) return t;
22
+ let n = t.findIndex((e) => e.jobId == null);
23
+ if (n === -1) return t;
24
+ let r = [...t];
25
+ return r[n] = {
26
+ ...r[n],
27
+ jobId: e.jobId
28
+ }, r;
29
+ });
30
+ }), g = n((e, t) => {
31
+ if (!s?.sessionId) throw Error("No agent session available to send chat message.");
32
+ m({
33
+ concreteType: "org.sagebionetworks.repo.model.agent.AgentChatRequest",
17
34
  chatText: e,
18
- sessionId: i.sessionId,
19
- enableTrace: !0
35
+ sessionId: s.sessionId,
36
+ enableTrace: !0,
37
+ ...t && t.length > 0 ? { attachments: t } : {}
20
38
  });
21
- }, [i?.sessionId, u]);
22
- return n(() => ({
23
- sendChat: d,
24
- pendingMessage: c,
25
- chatJobIds: o
39
+ }, [s?.sessionId, m]);
40
+ return r(() => ({
41
+ sendChat: g,
42
+ interactions: d,
43
+ isAwaitingResponse: h
26
44
  }), [
45
+ g,
27
46
  d,
28
- c,
29
- o
47
+ h
30
48
  ]);
31
49
  }
32
50
  //#endregion
33
- export { i as useChatState };
51
+ export { s as useChatState };
34
52
 
35
53
  //# sourceMappingURL=useChatState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useChatState.js","names":[],"sources":["../../../src/components/SynapseChat/useChatState.ts"],"sourcesContent":["import { useSendChatMessageToAgent } from '@/synapse-queries/chat/useChat'\nimport {\n AgentChatRequest,\n AgentChatResponse,\n AgentSession,\n AsynchronousJobStatus,\n} from '@sage-bionetworks/synapse-types'\nimport { useCallback, useMemo, useState } from 'react'\n\nexport type ChatState = {\n sendChat: (message: string) => void\n pendingMessage: string | null\n chatJobIds: string[]\n}\n\nexport function useChatState(\n agentSession?: AgentSession,\n onChatResponse?: (responseText: string) => void,\n): ChatState {\n const [chatJobIds, setChatJobIds] = useState<string[]>([])\n // Optimistic update state for latest unprocessed message\n const [pendingMessage, setPendingMessage] = useState<string | null>(null)\n\n const { mutate: sendChatMessageToAgent } = useSendChatMessageToAgent(\n {\n onMutate: (newChatMessage: AgentChatRequest) => {\n // set the pending message to the new chat message\n setPendingMessage(newChatMessage.chatText)\n },\n onSuccess: (response: AgentChatResponse) => {\n onChatResponse?.(response.responseText)\n },\n },\n (status: AsynchronousJobStatus<AgentChatRequest, AgentChatResponse>) => {\n if (!chatJobIds.includes(status.jobId)) {\n setPendingMessage(null)\n setChatJobIds(() => [...chatJobIds, status.jobId])\n }\n },\n )\n\n const sendChat = useCallback(\n (message: string) => {\n if (!agentSession?.sessionId) {\n throw new Error('No agent session available to send chat message.')\n }\n sendChatMessageToAgent({\n chatText: message,\n sessionId: agentSession.sessionId,\n enableTrace: true,\n })\n },\n [agentSession?.sessionId, sendChatMessageToAgent],\n )\n\n return useMemo(\n () => ({ sendChat, pendingMessage, chatJobIds }),\n [sendChat, pendingMessage, chatJobIds],\n )\n}\n"],"mappings":";;;AAeA,SAAgB,EACd,GACA,GACW;CACX,IAAM,CAAC,GAAY,KAAiB,EAAmB,CAAC,CAAC,GAEnD,CAAC,GAAgB,KAAqB,EAAwB,IAAI,GAElE,EAAE,QAAQ,MAA2B,EACzC;EACE,WAAW,MAAqC;GAE9C,EAAkB,EAAe,QAAQ;EAC3C;EACA,YAAY,MAAgC;GAC1C,IAAiB,EAAS,YAAY;EACxC;CACF,IACC,MAAuE;EACtE,AAAK,EAAW,SAAS,EAAO,KAAK,MACnC,EAAkB,IAAI,GACtB,QAAoB,CAAC,GAAG,GAAY,EAAO,KAAK,CAAC;CAErD,CACF,GAEM,IAAW,GACd,MAAoB;EACnB,IAAI,CAAC,GAAc,WACjB,MAAU,MAAM,kDAAkD;EAEpE,EAAuB;GACrB,UAAU;GACV,WAAW,EAAa;GACxB,aAAa;EACf,CAAC;CACH,GACA,CAAC,GAAc,WAAW,CAAsB,CAClD;CAEA,OAAO,SACE;EAAE;EAAU;EAAgB;CAAW,IAC9C;EAAC;EAAU;EAAgB;CAAU,CACvC;AACF"}
1
+ {"version":3,"file":"useChatState.js","names":[],"sources":["../../../src/components/SynapseChat/useChatState.ts"],"sourcesContent":["import { useSendChatMessageToAgent } from '@/synapse-queries/chat/useChat'\nimport { useSynapseContext } from '@/utils'\nimport {\n AgentSession,\n AgentChatRequest,\n AgentChatResponse,\n FileHandleAssociation,\n} from '@sage-bionetworks/synapse-client'\nimport { AsynchronousJobStatus } from '@sage-bionetworks/synapse-types'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useCallback, useMemo, useRef, useState } from 'react'\n\nexport type ChatInteraction = {\n /** client-generated at send time; stable for the interaction's whole life */\n id: string\n /** known at send time, never re-fetched */\n userMessage: string\n /** undefined until the async job is registered */\n jobId?: string\n}\n\nexport type ChatState = {\n sendChat: (message: string, attachments?: FileHandleAssociation[]) => void\n interactions: ChatInteraction[]\n isAwaitingResponse: boolean\n}\n\nexport function useChatState(\n agentSession?: AgentSession,\n onChatResponse?: (responseText: string) => void,\n): ChatState {\n const { keyFactory } = useSynapseContext()\n const queryClient = useQueryClient()\n\n const [interactions, setInteractions] = useState<ChatInteraction[]>([])\n const nextInteractionId = useRef(0)\n\n const { mutate: sendChatMessageToAgent, isPending: isAwaitingResponse } =\n useSendChatMessageToAgent(\n {\n onMutate: (newChatMessage: AgentChatRequest) => {\n const id = String(nextInteractionId.current++)\n setInteractions(prev => [\n ...prev,\n { id, userMessage: newChatMessage.chatText! },\n ])\n },\n onSuccess: response => {\n onChatResponse?.(response?.responseBody?.responseText!)\n },\n },\n (status: AsynchronousJobStatus<AgentChatRequest, AgentChatResponse>) => {\n // Seed the cache so usePollAsynchronousJob (a fallback for restored history / a dead\n // mutation loop) renders the same status immediately instead of re-fetching, and so its\n // own polling interval self-disables once the job leaves PROCESSING.\n queryClient.setQueryData(\n keyFactory.getAsyncJobStatusQueryKey(status.jobId),\n status,\n )\n\n setInteractions(prev => {\n if (prev.some(interaction => interaction.jobId === status.jobId)) {\n // already attached; this is a later poll of the same job\n return prev\n }\n const pendingIndex = prev.findIndex(\n interaction => interaction.jobId == null,\n )\n if (pendingIndex === -1) {\n return prev\n }\n const next = [...prev]\n next[pendingIndex] = {\n ...next[pendingIndex],\n jobId: status.jobId,\n }\n return next\n })\n },\n )\n\n const sendChat = useCallback(\n (message: string, attachments?: FileHandleAssociation[]) => {\n if (!agentSession?.sessionId) {\n throw new Error('No agent session available to send chat message.')\n }\n sendChatMessageToAgent({\n concreteType: 'org.sagebionetworks.repo.model.agent.AgentChatRequest',\n chatText: message,\n sessionId: agentSession.sessionId,\n enableTrace: true,\n ...(attachments && attachments.length > 0 ? { attachments } : {}),\n })\n },\n [agentSession?.sessionId, sendChatMessageToAgent],\n )\n\n return useMemo(\n () => ({ sendChat, interactions, isAwaitingResponse }),\n [sendChat, interactions, isAwaitingResponse],\n )\n}\n"],"mappings":";;;;;;AA2BA,SAAgB,EACd,GACA,GACW;CACX,IAAM,EAAE,kBAAe,EAAkB,GACnC,IAAc,EAAe,GAE7B,CAAC,GAAc,KAAmB,EAA4B,CAAC,CAAC,GAChE,IAAoB,EAAO,CAAC,GAE5B,EAAE,QAAQ,GAAwB,WAAW,MACjD,EACE;EACE,WAAW,MAAqC;GAC9C,IAAM,IAAK,OAAO,EAAkB,SAAS;GAC7C,GAAgB,MAAQ,CACtB,GAAG,GACH;IAAE;IAAI,aAAa,EAAe;GAAU,CAC9C,CAAC;EACH;EACA,YAAW,MAAY;GACrB,IAAiB,GAAU,cAAc,YAAa;EACxD;CACF,IACC,MAAuE;EAStE,AALA,EAAY,aACV,EAAW,0BAA0B,EAAO,KAAK,GACjD,CACF,GAEA,GAAgB,MAAQ;GACtB,IAAI,EAAK,MAAK,MAAe,EAAY,UAAU,EAAO,KAAK,GAE7D,OAAO;GAET,IAAM,IAAe,EAAK,WACxB,MAAe,EAAY,SAAS,IACtC;GACA,IAAI,MAAiB,IACnB,OAAO;GAET,IAAM,IAAO,CAAC,GAAG,CAAI;GAKrB,OAJA,EAAK,KAAgB;IACnB,GAAG,EAAK;IACR,OAAO,EAAO;GAChB,GACO;EACT,CAAC;CACH,CACF,GAEI,IAAW,GACd,GAAiB,MAA0C;EAC1D,IAAI,CAAC,GAAc,WACjB,MAAU,MAAM,kDAAkD;EAEpE,EAAuB;GACrB,cAAc;GACd,UAAU;GACV,WAAW,EAAa;GACxB,aAAa;GACb,GAAI,KAAe,EAAY,SAAS,IAAI,EAAE,eAAY,IAAI,CAAC;EACjE,CAAC;CACH,GACA,CAAC,GAAc,WAAW,CAAsB,CAClD;CAEA,OAAO,SACE;EAAE;EAAU;EAAc;CAAmB,IACpD;EAAC;EAAU;EAAc;CAAkB,CAC7C;AACF"}
@@ -0,0 +1,8 @@
1
+ /** Maximum number of attachments allowed on a single AgentChatRequest. */
2
+ export declare const MAX_AGENT_CHAT_ATTACHMENTS = 20;
3
+ /** Maximum size, in bytes, of a single attachment. */
4
+ export declare const MAX_ATTACHMENT_FILE_SIZE_BYTES: number;
5
+ /** Content types accepted for chat attachments. */
6
+ export declare const APPROVED_ATTACHMENT_CONTENT_TYPES: readonly ["application/pdf", "application/json", "text/plain", "text/csv", "text/tab-separated-values"];
7
+ export type ApprovedAttachmentContentType = (typeof APPROVED_ATTACHMENT_CONTENT_TYPES)[number];
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/SynapseChat/utils/constants.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,QAAoB,CAAA;AAE/D,mDAAmD;AACnD,eAAO,MAAM,iCAAiC,yGAMpC,CAAA;AAEV,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ //#region src/components/SynapseChat/utils/constants.ts
2
+ var e = 20, t = 100 * 1024 * 1024, n = [
3
+ "application/pdf",
4
+ "application/json",
5
+ "text/plain",
6
+ "text/csv",
7
+ "text/tab-separated-values"
8
+ ];
9
+ //#endregion
10
+ export { n as APPROVED_ATTACHMENT_CONTENT_TYPES, e as MAX_AGENT_CHAT_ATTACHMENTS, t as MAX_ATTACHMENT_FILE_SIZE_BYTES };
11
+
12
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../../../src/components/SynapseChat/utils/constants.ts"],"sourcesContent":["/** Maximum number of attachments allowed on a single AgentChatRequest. */\nexport const MAX_AGENT_CHAT_ATTACHMENTS = 20\n\n/** Maximum size, in bytes, of a single attachment. */\nexport const MAX_ATTACHMENT_FILE_SIZE_BYTES = 100 * 1024 * 1024\n\n/** Content types accepted for chat attachments. */\nexport const APPROVED_ATTACHMENT_CONTENT_TYPES = [\n 'application/pdf',\n 'application/json',\n 'text/plain',\n 'text/csv',\n 'text/tab-separated-values',\n] as const\n\nexport type ApprovedAttachmentContentType =\n (typeof APPROVED_ATTACHMENT_CONTENT_TYPES)[number]\n"],"mappings":";AACA,IAAa,IAA6B,IAG7B,IAAiC,MAAM,OAAO,MAG9C,IAAoC;CAC/C;CACA;CACA;CACA;CACA;AACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A file the user has attached to an in-progress chat message, pending send. Only fully
3
+ * uploaded files are represented here -- upload-in-progress state is shown by
4
+ * BasicFileHandleUpload's own progress UI while the Add Files dialog is open (see decision to
5
+ * render "completed uploads" as chips).
6
+ */
7
+ export type ChatAttachment = {
8
+ fileHandleId: string;
9
+ fileName: string;
10
+ contentType: string;
11
+ sizeBytes: number;
12
+ };
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/SynapseChat/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
File without changes