@corva/ui 3.74.0-0 → 3.74.0-2

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 (412) hide show
  1. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  2. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  4. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  5. package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
  6. package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  7. package/cjs-bundle/components/AssetEditorV2/index.js +1 -1
  8. package/cjs-bundle/components/AssetEditorV2/index.js.map +1 -1
  9. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js +2 -0
  10. package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
  11. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
  12. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
  13. package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
  14. package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
  15. package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
  16. package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
  17. package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
  18. package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js +2 -0
  19. package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
  20. package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
  21. package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
  22. package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js +2 -0
  23. package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js.map +1 -0
  24. package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
  25. package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
  26. package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
  27. package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
  28. package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js +2 -0
  29. package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js.map +1 -0
  30. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
  31. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  32. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  33. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +1 -1
  34. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -1
  35. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +1 -1
  36. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -1
  37. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +2 -0
  38. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
  39. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
  40. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  41. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  42. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  43. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  44. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  46. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  47. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  48. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  49. package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
  50. package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
  51. package/cjs-bundle/components/CommentCard/CommentMenu.js +1 -1
  52. package/cjs-bundle/components/CommentCard/CommentMenu.js.map +1 -1
  53. package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
  54. package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
  55. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
  56. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
  57. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  58. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  59. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
  60. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
  61. package/cjs-bundle/components/CommentInputNext/useFilePaste.js +2 -0
  62. package/cjs-bundle/components/CommentInputNext/useFilePaste.js.map +1 -0
  63. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  64. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  65. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  66. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  67. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  68. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  69. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  70. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  71. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  72. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  73. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  74. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  75. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  76. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  77. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  78. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  79. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  80. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  81. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  82. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  83. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  84. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  85. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  86. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  87. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  88. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  89. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  90. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  91. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  92. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  93. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  94. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  95. package/cjs-bundle/components/IconMenu/index.js +1 -1
  96. package/cjs-bundle/components/IconMenu/index.js.map +1 -1
  97. package/cjs-bundle/components/KeyboardDateTimePicker.js +1 -1
  98. package/cjs-bundle/components/KeyboardDateTimePicker.js.map +1 -1
  99. package/cjs-bundle/components/LinkedText/LinkedText.js +2 -0
  100. package/cjs-bundle/components/LinkedText/LinkedText.js.map +1 -0
  101. package/cjs-bundle/components/LinkedText/LinkedText.scss.js +2 -0
  102. package/cjs-bundle/components/LinkedText/LinkedText.scss.js.map +1 -0
  103. package/cjs-bundle/components/NewDocumentViewer/utils.js +1 -1
  104. package/cjs-bundle/components/NewDocumentViewer/utils.js.map +1 -1
  105. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  106. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  107. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  108. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  109. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  110. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  111. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  112. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  113. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  114. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  115. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  116. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  117. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  118. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  119. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  120. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  121. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  122. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  123. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  124. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  125. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  126. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  127. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  128. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  129. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  130. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  131. package/cjs-bundle/components/PostInput/PostInput.js +1 -1
  132. package/cjs-bundle/components/PostInput/PostInput.js.map +1 -1
  133. package/cjs-bundle/components/UserMention/constants.js +1 -1
  134. package/cjs-bundle/components/UserMention/constants.js.map +1 -1
  135. package/cjs-bundle/components/UserMention/index.js +1 -1
  136. package/cjs-bundle/components/UserMention/index.js.map +1 -1
  137. package/cjs-bundle/components/index.js +1 -1
  138. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  139. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
  140. package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
  141. package/cjs-bundle/componentsV2/Modal/Modal.js +1 -1
  142. package/cjs-bundle/componentsV2/Modal/Modal.js.map +1 -1
  143. package/cjs-bundle/componentsV2/Modal/constants.js +2 -0
  144. package/cjs-bundle/componentsV2/Modal/constants.js.map +1 -0
  145. package/cjs-bundle/effects/useOutsideClick.js +1 -1
  146. package/cjs-bundle/effects/useOutsideClick.js.map +1 -1
  147. package/cjs-bundle/utils/fetchAttachment.js +2 -0
  148. package/cjs-bundle/utils/fetchAttachment.js.map +1 -0
  149. package/cjs-bundle/utils/links.js +2 -0
  150. package/cjs-bundle/utils/links.js.map +1 -0
  151. package/components/AddComment/Popover.js +1 -1
  152. package/components/AddComment/Popover.js.map +1 -1
  153. package/components/AddComment/components/Content.js +1 -1
  154. package/components/AddComment/components/Content.js.map +1 -1
  155. package/components/AssetEditor/AssetEditorAutocomplete.d.ts +96 -13
  156. package/components/AssetEditor/AssetEditorAutocomplete.d.ts.map +1 -1
  157. package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
  158. package/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  159. package/components/AssetEditorV2/index.d.ts +28 -12
  160. package/components/AssetEditorV2/index.d.ts.map +1 -1
  161. package/components/AssetEditorV2/index.js +1 -1
  162. package/components/AssetEditorV2/index.js.map +1 -1
  163. package/components/AttachmentLightbox/AttachmentDocument.d.ts +6 -0
  164. package/components/AttachmentLightbox/AttachmentDocument.d.ts.map +1 -0
  165. package/components/AttachmentLightbox/AttachmentDocument.js +2 -0
  166. package/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
  167. package/components/AttachmentLightbox/AttachmentLightbox.d.ts +9 -8
  168. package/components/AttachmentLightbox/AttachmentLightbox.d.ts.map +1 -1
  169. package/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
  170. package/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
  171. package/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
  172. package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts +9 -0
  173. package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts.map +1 -0
  174. package/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
  175. package/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
  176. package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts +2 -0
  177. package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts.map +1 -0
  178. package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts +2 -0
  179. package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts.map +1 -0
  180. package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts +2 -0
  181. package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts.map +1 -0
  182. package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts +2 -0
  183. package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts.map +1 -0
  184. package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts +2 -0
  185. package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts.map +1 -0
  186. package/components/AttachmentLightbox/copyImageToClipboard.d.ts +4 -0
  187. package/components/AttachmentLightbox/copyImageToClipboard.d.ts.map +1 -0
  188. package/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
  189. package/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
  190. package/components/AttachmentLightbox/downloadAttachment.d.ts +10 -0
  191. package/components/AttachmentLightbox/downloadAttachment.d.ts.map +1 -0
  192. package/components/AttachmentLightbox/downloadAttachment.js +2 -0
  193. package/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
  194. package/components/AttachmentLightbox/useAttachmentLightbox.d.ts +6 -2
  195. package/components/AttachmentLightbox/useAttachmentLightbox.d.ts.map +1 -1
  196. package/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
  197. package/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
  198. package/components/AttachmentLightbox/useZoomPan.d.ts +29 -0
  199. package/components/AttachmentLightbox/useZoomPan.d.ts.map +1 -0
  200. package/components/AttachmentLightbox/useZoomPan.js +2 -0
  201. package/components/AttachmentLightbox/useZoomPan.js.map +1 -0
  202. package/components/AttachmentPreview/AttachmentActionsMenu.d.ts +16 -0
  203. package/components/AttachmentPreview/AttachmentActionsMenu.d.ts.map +1 -0
  204. package/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
  205. package/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
  206. package/components/AttachmentPreview/AttachmentDownloadLink.d.ts +11 -0
  207. package/components/AttachmentPreview/AttachmentDownloadLink.d.ts.map +1 -0
  208. package/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
  209. package/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
  210. package/components/AttachmentPreview/AttachmentImage.d.ts +12 -0
  211. package/components/AttachmentPreview/AttachmentImage.d.ts.map +1 -0
  212. package/components/AttachmentPreview/AttachmentImage.js +2 -0
  213. package/components/AttachmentPreview/AttachmentImage.js.map +1 -0
  214. package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
  215. package/components/AttachmentPreview/AttachmentPreview.js +1 -1
  216. package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  217. package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  218. package/components/AttachmentPreview/AttachmentPreview.types.d.ts +7 -0
  219. package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
  220. package/components/AttachmentPreview/AttachmentRow.d.ts +7 -3
  221. package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -1
  222. package/components/AttachmentPreview/AttachmentRow.js +1 -1
  223. package/components/AttachmentPreview/AttachmentRow.js.map +1 -1
  224. package/components/AttachmentPreview/AttachmentTile.d.ts +5 -1
  225. package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -1
  226. package/components/AttachmentPreview/AttachmentTile.js +1 -1
  227. package/components/AttachmentPreview/AttachmentTile.js.map +1 -1
  228. package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts +2 -0
  229. package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts.map +1 -0
  230. package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts +2 -0
  231. package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts.map +1 -0
  232. package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts +2 -0
  233. package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts.map +1 -0
  234. package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts +2 -0
  235. package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts.map +1 -0
  236. package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts +2 -0
  237. package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts.map +1 -0
  238. package/components/AttachmentPreview/useStoredAttachment.d.ts +8 -0
  239. package/components/AttachmentPreview/useStoredAttachment.d.ts.map +1 -1
  240. package/components/AttachmentPreview/useStoredAttachment.js +2 -0
  241. package/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
  242. package/components/AttachmentPreview/useStoredAttachments.d.ts +1 -1
  243. package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
  244. package/components/AttachmentPreview/useStoredAttachments.js +1 -1
  245. package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  246. package/components/BICOffsetPickerDialog/index.js +1 -1
  247. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  248. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  249. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  250. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  251. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  252. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  253. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  254. package/components/CommentCard/CommentCard.d.ts.map +1 -1
  255. package/components/CommentCard/CommentCard.js +1 -1
  256. package/components/CommentCard/CommentCard.js.map +1 -1
  257. package/components/CommentCard/CommentCard.types.d.ts +2 -0
  258. package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
  259. package/components/CommentCard/CommentMenu.d.ts.map +1 -1
  260. package/components/CommentCard/CommentMenu.js +1 -1
  261. package/components/CommentCard/CommentMenu.js.map +1 -1
  262. package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
  263. package/components/CommentComposer/CommentComposer.js +1 -1
  264. package/components/CommentComposer/CommentComposer.js.map +1 -1
  265. package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
  266. package/components/CommentComposer/CommentReplyInput.js +1 -1
  267. package/components/CommentComposer/CommentReplyInput.js.map +1 -1
  268. package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts +2 -0
  269. package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts.map +1 -0
  270. package/components/CommentComposer/useAttachmentUpload.d.ts +1 -0
  271. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  272. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  273. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  274. package/components/CommentInputNext/CommentInputNext.d.ts +2 -0
  275. package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
  276. package/components/CommentInputNext/CommentInputNext.js +1 -1
  277. package/components/CommentInputNext/CommentInputNext.js.map +1 -1
  278. package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts +2 -0
  279. package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts.map +1 -0
  280. package/components/CommentInputNext/useFilePaste.d.ts +17 -0
  281. package/components/CommentInputNext/useFilePaste.d.ts.map +1 -0
  282. package/components/CommentInputNext/useFilePaste.js +2 -0
  283. package/components/CommentInputNext/useFilePaste.js.map +1 -0
  284. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts +5 -1
  285. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts.map +1 -1
  286. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  287. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  288. package/components/DocumentViewer/DocumentViewer.js +1 -1
  289. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  290. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  291. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  292. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  293. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  294. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  295. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  296. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  297. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  298. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  299. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  300. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  301. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  302. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  303. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  304. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  305. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  306. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  307. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  308. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  309. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  310. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  311. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  312. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  313. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  314. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  315. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  316. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  317. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  318. package/components/IconMenu/index.d.ts +67 -21
  319. package/components/IconMenu/index.d.ts.map +1 -1
  320. package/components/IconMenu/index.js +1 -1
  321. package/components/IconMenu/index.js.map +1 -1
  322. package/components/KeyboardDateTimePicker.d.ts +6 -7
  323. package/components/KeyboardDateTimePicker.d.ts.map +1 -1
  324. package/components/KeyboardDateTimePicker.js +1 -1
  325. package/components/KeyboardDateTimePicker.js.map +1 -1
  326. package/components/LinkedText/LinkedText.d.ts +17 -0
  327. package/components/LinkedText/LinkedText.d.ts.map +1 -0
  328. package/components/LinkedText/LinkedText.js +2 -0
  329. package/components/LinkedText/LinkedText.js.map +1 -0
  330. package/components/LinkedText/LinkedText.scss.js +2 -0
  331. package/components/LinkedText/LinkedText.scss.js.map +1 -0
  332. package/components/LinkedText/__tests__/LinkedText.test.d.ts +2 -0
  333. package/components/LinkedText/__tests__/LinkedText.test.d.ts.map +1 -0
  334. package/components/LinkedText/index.d.ts +2 -0
  335. package/components/LinkedText/index.d.ts.map +1 -0
  336. package/components/NewDocumentViewer/utils.d.ts.map +1 -1
  337. package/components/NewDocumentViewer/utils.js +1 -1
  338. package/components/NewDocumentViewer/utils.js.map +1 -1
  339. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  340. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  341. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  342. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  343. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  344. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  345. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  346. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  347. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  348. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  349. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  350. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  351. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  352. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  353. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  354. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  355. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  356. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  357. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  358. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  359. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  360. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  361. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  362. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  363. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  364. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  365. package/components/PostInput/PostInput.d.ts +20 -10
  366. package/components/PostInput/PostInput.d.ts.map +1 -1
  367. package/components/PostInput/PostInput.js +1 -1
  368. package/components/PostInput/PostInput.js.map +1 -1
  369. package/components/UserMention/__tests__/highlightLinks.test.d.ts +2 -0
  370. package/components/UserMention/__tests__/highlightLinks.test.d.ts.map +1 -0
  371. package/components/UserMention/constants.d.ts +1 -0
  372. package/components/UserMention/constants.d.ts.map +1 -1
  373. package/components/UserMention/constants.js +1 -1
  374. package/components/UserMention/constants.js.map +1 -1
  375. package/components/UserMention/index.js +1 -1
  376. package/components/UserMention/index.js.map +1 -1
  377. package/components/index.d.ts +2 -0
  378. package/components/index.d.ts.map +1 -1
  379. package/components/index.js +1 -1
  380. package/componentsV2/ButtonIcon/ButtonIcon.d.ts +2 -0
  381. package/componentsV2/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  382. package/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
  383. package/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
  384. package/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
  385. package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts +1 -0
  386. package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts.map +1 -1
  387. package/componentsV2/Modal/Modal.d.ts.map +1 -1
  388. package/componentsV2/Modal/Modal.js +1 -1
  389. package/componentsV2/Modal/Modal.js.map +1 -1
  390. package/componentsV2/Modal/constants.d.ts +3 -0
  391. package/componentsV2/Modal/constants.d.ts.map +1 -0
  392. package/componentsV2/Modal/constants.js +2 -0
  393. package/componentsV2/Modal/constants.js.map +1 -0
  394. package/effects/__tests__/useOutsideClick.test.d.ts.map +1 -1
  395. package/effects/useOutsideClick.d.ts.map +1 -1
  396. package/effects/useOutsideClick.js +1 -1
  397. package/effects/useOutsideClick.js.map +1 -1
  398. package/mcp-server/server.mjs +35 -9
  399. package/package.json +1 -1
  400. package/tsconfig.tsbuildinfo +1 -1
  401. package/utils/__tests__/fetchAttachment.test.d.ts +2 -0
  402. package/utils/__tests__/fetchAttachment.test.d.ts.map +1 -0
  403. package/utils/__tests__/links.test.d.ts +2 -0
  404. package/utils/__tests__/links.test.d.ts.map +1 -0
  405. package/utils/fetchAttachment.d.ts +3 -0
  406. package/utils/fetchAttachment.d.ts.map +1 -0
  407. package/utils/fetchAttachment.js +2 -0
  408. package/utils/fetchAttachment.js.map +1 -0
  409. package/utils/links.d.ts +14 -0
  410. package/utils/links.d.ts.map +1 -0
  411. package/utils/links.js +2 -0
  412. package/utils/links.js.map +1 -0
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("@babel/runtime/helpers/slicedToArray"),o=require("react"),c=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),i=require("../../componentsV2/Tooltip/Tooltip.js"),n=require("../../componentsV2/Menu/Menu.js"),e=require("../AttachmentLightbox/copyImageToClipboard.js"),r=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js");var u=require("../../utils/notificationToasts.js"),t=require("../../utils/main.js"),a=require("react/jsx-runtime");function m(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var l=m(s);exports.AttachmentActionsMenu=function(s){var m,I=s.item,j=s.onShare,q=s.size,d=void 0===q?"small":q,p=s.testIdPrefix,h=void 0===p?"attachment-preview":p,C=s.tooltip,f=void 0===C?"More":C,b=s.imageRef,g=s.className,x=o.useState(null),v=l.default(x,2),M=v[0],y=v[1];o.useEffect((function(){y(null)}),[I.id]);var F=I.src||I.downloadUrl,O="image"===(null!==(m=I.kind)&&void 0!==m?m:"file")&&!!I.src&&e.getCanCopyImages(),k=function(s){return function(o){o.stopPropagation(),s(),y(null)}};return a.jsxs(a.Fragment,{children:[a.jsx(i.Tooltip,{title:f,children:a.jsx(c.ButtonIcon,{size:d,type:"tertiaryBg",ariaLabel:"More actions",isActive:!!M,className:g,onClick:function(s){s.stopPropagation(),y(s.currentTarget)},testId:"".concat(h,"-more"),children:a.jsx(r.MoreOneIcon,{})})}),!!M&&a.jsxs(n.Menu,{open:!0,anchorEl:M,placement:"bottom-end",onClose:function(){return y(null)},children:[!!j&&a.jsx(n.Menu.Item,{prefix:a.jsx(r.ShareTwoIcon,{}),onClick:k((function(){return j(I)})),testId:"".concat(h,"-share"),children:"Share file"}),a.jsx(n.Menu.Item,{prefix:a.jsx(r.LinkOneIcon,{}),disabled:!F,onClick:k((function(){F&&(t.default.copyToClipboard(F),u.showSuccessNotification("Link copied to clipboard"))})),testId:"".concat(h,"-copy-link"),children:"Copy link"}),O&&a.jsx(n.Menu.Item,{prefix:a.jsx(r.PictureIcon,{}),onClick:k((function(){e.copyImageToClipboard(I.src,null==b?void 0:b.current).then((function(s){s?u.showSuccessNotification("Image copied to clipboard"):u.showErrorNotification("Could not copy the image")}))})),testId:"".concat(h,"-copy-image"),children:"Copy image"})]})]})};
2
+ //# sourceMappingURL=AttachmentActionsMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentActionsMenu.js","sources":["../../../../src/components/AttachmentPreview/AttachmentActionsMenu.tsx"],"sourcesContent":["import { MouseEvent, RefObject, useEffect, useState } from 'react';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { Menu } from '../../componentsV2/Menu';\nimport { copyImageToClipboard, getCanCopyImages } from '../AttachmentLightbox/copyImageToClipboard';\n\nimport { AttachmentPreviewItem } from './AttachmentPreview.types';\n\nimport { LinkOneIcon, MoreOneIcon, PictureIcon, ShareTwoIcon } from '~/icons';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\nimport utils from '~/utils/main';\n\nexport type AttachmentActionsMenuProps = {\n item: AttachmentPreviewItem;\n /** Adds \"Share file\" to the menu. */\n onShare?: (item: AttachmentPreviewItem) => void;\n /** `xs` sits on a tile, `small` in the preview modal's header. */\n size?: 'xs' | 'small';\n /** Test ids read `<prefix>-more`, `<prefix>-share`, and so on. */\n testIdPrefix?: string;\n tooltip?: string;\n imageRef?: RefObject<HTMLImageElement>;\n className?: string;\n};\n\nexport const AttachmentActionsMenu = ({\n item,\n onShare,\n size = 'small',\n testIdPrefix = 'attachment-preview',\n tooltip = 'More',\n imageRef,\n className,\n}: AttachmentActionsMenuProps) => {\n const [menuAnchor, setMenuAnchor] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n setMenuAnchor(null);\n }, [item.id]);\n\n const shareableUrl = item.src || item.downloadUrl;\n const canCopyImage = (item.kind ?? 'file') === 'image' && !!item.src && getCanCopyImages();\n\n const copyImage = () => {\n copyImageToClipboard(item.src as string, imageRef?.current).then(copied => {\n if (copied) showSuccessNotification('Image copied to clipboard');\n else showErrorNotification('Could not copy the image');\n });\n };\n\n // A portalled menu still bubbles its clicks up the React tree, where the tile would take\n // them as its own and open the preview over whatever the action just started.\n const runAndClose = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n setMenuAnchor(null);\n };\n\n return (\n <>\n <Tooltip title={tooltip}>\n <ButtonIcon\n size={size}\n type=\"tertiaryBg\"\n ariaLabel=\"More actions\"\n isActive={!!menuAnchor}\n className={className}\n onClick={event => {\n event.stopPropagation();\n setMenuAnchor(event.currentTarget);\n }}\n testId={`${testIdPrefix}-more`}\n >\n <MoreOneIcon />\n </ButtonIcon>\n </Tooltip>\n\n {!!menuAnchor && (\n <Menu open anchorEl={menuAnchor} placement=\"bottom-end\" onClose={() => setMenuAnchor(null)}>\n {!!onShare && (\n <Menu.Item\n prefix={<ShareTwoIcon />}\n onClick={runAndClose(() => onShare(item))}\n testId={`${testIdPrefix}-share`}\n >\n Share file\n </Menu.Item>\n )}\n\n <Menu.Item\n prefix={<LinkOneIcon />}\n disabled={!shareableUrl}\n onClick={runAndClose(() => {\n if (!shareableUrl) return;\n utils.copyToClipboard(shareableUrl);\n showSuccessNotification('Link copied to clipboard');\n })}\n testId={`${testIdPrefix}-copy-link`}\n >\n Copy link\n </Menu.Item>\n\n {/* Only images: no browser lets a page put a video or a document on the clipboard. */}\n {canCopyImage && (\n <Menu.Item\n prefix={<PictureIcon />}\n onClick={runAndClose(copyImage)}\n testId={`${testIdPrefix}-copy-image`}\n >\n Copy image\n </Menu.Item>\n )}\n </Menu>\n )}\n </>\n );\n};\n"],"names":["_ref","_item$kind","item","onShare","_ref$size","size","_ref$testIdPrefix","testIdPrefix","_ref$tooltip","tooltip","imageRef","className","useState","_useState2","_slicedToArray","_useState","menuAnchor","setMenuAnchor","useEffect","id","shareableUrl","src","downloadUrl","canCopyImage","kind","getCanCopyImages","runAndClose","action","event","stopPropagation","_jsxs","_Fragment","children","_jsx","Tooltip","title","ButtonIcon","type","ariaLabel","isActive","onClick","currentTarget","testId","concat","MoreOneIcon","Menu","open","anchorEl","placement","onClose","Item","prefix","ShareTwoIcon","LinkOneIcon","disabled","utils","copyToClipboard","showSuccessNotification","PictureIcon","copyImageToClipboard","current","then","copied","showErrorNotification"],"mappings":"q5IA0BqC,SAQHA,GAAA,IAAAC,EAPhCC,IAAAA,KACAC,IAAAA,QAAOC,EAAAJ,EACPK,KAAAA,aAAO,QAAOD,EAAAE,EAAAN,EACdO,aAAAA,aAAe,qBAAoBD,EAAAE,EAAAR,EACnCS,QAAAA,aAAU,OAAMD,EAChBE,IAAAA,SACAC,IAAAA,UAEoCC,EAAAA,EAAQA,SAAqB,MAAKC,EAAAC,EAAAA,QAAAC,EAAA,GAA/DC,EAAUH,EAAA,GAAEI,EAAaJ,EAAA,GAEhCK,EAAAA,WAAU,WACRD,EAAc,KAChB,GAAG,CAACf,EAAKiB,KAET,IAAMC,EAAelB,EAAKmB,KAAOnB,EAAKoB,YAChCC,EAAyC,mBAA1BtB,EAACC,EAAKsB,oBAAQ,WAAyBtB,EAAKmB,KAAOI,EAAAA,mBAWlEC,EAAc,SAACC,GAAkB,OAAK,SAACC,GAC3CA,EAAMC,kBACNF,IACAV,EAAc,MACf,EAED,OACEa,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACEC,MAACC,UAAO,CAACC,MAAO1B,EAAQuB,SACtBC,MAACG,aAAU,CACT/B,KAAMA,EACNgC,KAAK,aACLC,UAAU,eACVC,WAAYvB,EACZL,UAAWA,EACX6B,QAAS,SAAAZ,GACPA,EAAMC,kBACNZ,EAAcW,EAAMa,cACpB,EACFC,OAAM,GAAAC,OAAKpC,EAAoB,SAAAyB,SAE/BC,EAAAA,IAACW,EAAWA,YAAA,UAIb5B,GACDc,EAAAA,KAACe,EAAAA,KAAI,CAACC,MAAI,EAACC,SAAU/B,EAAYgC,UAAU,aAAaC,QAAS,WAAA,OAAMhC,EAAc,KAAM,EAAAe,SAAA,GACtF7B,GACD8B,EAAAA,IAACY,EAAAA,KAAKK,KAAI,CACRC,OAAQlB,EAAAA,IAACmB,EAAYA,aAAI,IACzBZ,QAASd,GAAY,WAAA,OAAMvB,EAAQD,MACnCwC,OAAM,GAAAC,OAAKpC,EAAqB,UAAAyB,SAAA,eAMpCC,EAAAA,IAACY,EAAIA,KAACK,KAAI,CACRC,OAAQlB,EAAAA,IAACoB,EAAWA,YAAI,IACxBC,UAAWlC,EACXoB,QAASd,GAAY,WACdN,IACLmC,UAAMC,gBAAgBpC,GACtBqC,EAAuBA,wBAAC,4BAC1B,IACAf,OAAM,GAAAC,OAAKpC,EAAyB,cAAAyB,SAAA,cAMrCT,GACCU,MAACY,EAAAA,KAAKK,KAAI,CACRC,OAAQlB,EAAAA,IAACyB,EAAWA,YAAI,IACxBlB,QAASd,GA/DH,WAChBiC,EAAAA,qBAAqBzD,EAAKmB,IAAeX,aAAQ,EAARA,EAAUkD,SAASC,MAAK,SAAAC,GAC3DA,EAAQL,EAAAA,wBAAwB,6BAC/BM,EAAAA,sBAAsB,2BAC7B,OA4DUrB,OAAM,GAAAC,OAAKpC,EAA0B,eAAAyB,SAAA,oBASnD"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),o=require("../../componentsV2/Tooltip/Tooltip.js"),c=require("../AttachmentLightbox/downloadAttachment.js"),i=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js");var n=require("react/jsx-runtime");exports.AttachmentDownloadLink=function(e){var r=e.url,u=e.fileName,t=e.size,m=void 0===t?"small":t,a=e.className,j=e.testId,I=void 0===j?"attachment-download":j;return n.jsx(o.Tooltip,{title:"Download",children:n.jsx("a",{href:r,download:u,target:"_blank",rel:"noopener noreferrer",className:a,"data-testid":I,onClick:function(s){s.preventDefault(),s.stopPropagation(),c.saveAttachment(r,u)},children:n.jsx(s.ButtonIcon,{size:m,type:"tertiaryBg",ariaLabel:"Download",children:n.jsx(i.DownloadIcon,{size:"xs"===m?"small":void 0})})})})};
2
+ //# sourceMappingURL=AttachmentDownloadLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentDownloadLink.js","sources":["../../../../src/components/AttachmentPreview/AttachmentDownloadLink.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { saveAttachment } from '../AttachmentLightbox/downloadAttachment';\n\nimport { DownloadIcon } from '~/icons';\n\nexport type AttachmentDownloadLinkProps = {\n url: string;\n fileName: string;\n /** `xs` sits on a tile, `small` in the preview modal's header. */\n size?: 'xs' | 'small';\n className?: string;\n testId?: string;\n};\n\n/** Keeps the link semantics but fetches the bytes, since `download` is ignored cross-origin. */\nexport const AttachmentDownloadLink = ({\n url,\n fileName,\n size = 'small',\n className,\n testId = 'attachment-download',\n}: AttachmentDownloadLinkProps) => {\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n saveAttachment(url, fileName);\n };\n\n return (\n <Tooltip title=\"Download\">\n <a\n href={url}\n download={fileName}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n data-testid={testId}\n onClick={handleClick}\n >\n <ButtonIcon size={size} type=\"tertiaryBg\" ariaLabel=\"Download\">\n <DownloadIcon size={size === 'xs' ? 'small' : undefined} />\n </ButtonIcon>\n </a>\n </Tooltip>\n );\n};\n"],"names":["_ref","url","fileName","_ref$size","size","className","_ref$testId","testId","_jsx","Tooltip","title","children","jsx","href","download","target","rel","onClick","event","preventDefault","stopPropagation","saveAttachment","ButtonIcon","type","ariaLabel","DownloadIcon","undefined"],"mappings":"+nIAkBsC,SAMHA,GAAA,IALjCC,IAAAA,IACAC,IAAAA,SAAQC,EAAAH,EACRI,KAAAA,aAAO,QAAOD,EACdE,IAAAA,UAASC,EAAAN,EACTO,OAAAA,aAAS,sBAAqBD,EAQ9B,OACEE,EAAAA,IAACC,EAAAA,QAAO,CAACC,MAAM,WAAUC,SACvBH,EAAAI,IAAA,IAAA,CACEC,KAAMZ,EACNa,SAAUZ,EACVa,OAAO,SACPC,IAAI,sBACJX,UAAWA,EACX,cAAaE,EACbU,QAfc,SAACC,GACnBA,EAAMC,iBACND,EAAME,kBACNC,iBAAepB,EAAKC,IAYKS,SAErBH,MAACc,aAAU,CAAClB,KAAMA,EAAMmB,KAAK,aAAaC,UAAU,WAAUb,SAC5DH,MAACiB,eAAY,CAACrB,KAAe,OAATA,EAAgB,aAAUsB,SAKxD"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),t=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),n=r.forwardRef((function(e,a){var n=e.src,u=e.alt,o=e.className,i=e.draggable,c=r.useState(!0),l=s.default(c,2),f=l[0],d=l[1];return t.jsx("img",{ref:a,src:n,alt:u,className:o,draggable:i,crossOrigin:f?"anonymous":void 0,onError:function(){return d(!1)}},f?"cors":"plain")}));exports.AttachmentImage=n;
2
+ //# sourceMappingURL=AttachmentImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentImage.js","sources":["../../../../src/components/AttachmentPreview/AttachmentImage.tsx"],"sourcesContent":["import { forwardRef, useState } from 'react';\n\nexport type AttachmentImageProps = {\n src?: string;\n alt: string;\n className?: string;\n draggable?: boolean;\n};\n\n/**\n * Asks with CORS so the page may read the pixels, which is what lets Copy image work off the\n * screen. A host that answers without the header refuses outright, so a failed load retries plain.\n */\nexport const AttachmentImage = forwardRef<HTMLImageElement, AttachmentImageProps>(\n ({ src, alt, className, draggable }, ref) => {\n const [readable, setReadable] = useState(true);\n\n return (\n <img\n // Keyed so the browser re-requests rather than reusing the refused response.\n key={readable ? 'cors' : 'plain'}\n ref={ref}\n src={src}\n alt={alt}\n className={className}\n draggable={draggable}\n crossOrigin={readable ? 'anonymous' : undefined}\n onError={() => setReadable(false)}\n />\n );\n }\n);\n"],"names":["AttachmentImage","forwardRef","_ref","ref","src","alt","className","draggable","useState","_useState2","_slicedToArray","_useState","readable","setReadable","_jsx","crossOrigin","undefined","onError"],"mappings":"+PAaaA,EAAkBC,EAAUA,YACvC,SAAAC,EAAqCC,GAAQ,IAA1CC,IAAAA,IAAKC,IAAAA,IAAKC,IAAAA,UAAWC,IAAAA,UACUC,EAAAA,EAAQA,UAAC,GAAKC,EAAAC,EAAAA,QAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GAE5B,OACEK,EAAAA,IAAA,MAAA,CAGEX,IAAKA,EACLC,IAAKA,EACLC,IAAKA,EACLC,UAAWA,EACXC,UAAWA,EACXQ,YAAaH,EAAW,iBAAcI,EACtCC,QAAS,WAAA,OAAMJ,GAAY,EAAM,GAP5BD,EAAW,OAAS,QAU/B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),n=require("../AttachmentLightbox/useAttachmentLightbox.js"),o=require("./AttachmentRow.js"),i=require("./SortableAttachments.js"),c=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(e),l=u(t),s=["onReorder","onItemClick"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){a.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=r.forwardRef((function(e,t){var r=e.onReorder,u=e.onItemClick,a=l.default(e,s),b=n.useAttachmentLightbox(),p=b.openAttachment,h=b.lightbox;if(!a.items.length)return null;var m=!!r&&a.items.length>1?c.jsx(i.SortableAttachments,f(f({},a),{},{ref:t,onReorder:r,onItemClick:null!=u?u:p})):c.jsx(o.AttachmentRow,f(f({},a),{},{ref:t,onItemClick:null!=u?u:p}));return c.jsxs(c.Fragment,{children:[m,!u&&h]})}));exports.AttachmentPreview=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),n=require("../AttachmentLightbox/useAttachmentLightbox.js"),o=require("./AttachmentRow.js"),i=require("./SortableAttachments.js"),c=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(t),s=["onReorder","onItemClick","onShare"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=r.forwardRef((function(e,t){var r=e.onReorder,a=e.onItemClick,u=e.onShare,b=l.default(e,s),f=n.useAttachmentLightbox(b.items,{onShare:u}),p=f.openAttachment,m=f.lightbox;if(!b.items.length)return null;var j=!!r&&b.items.length>1?c.jsx(i.SortableAttachments,h(h({},b),{},{ref:t,onReorder:r,onItemClick:null!=a?a:p})):c.jsx(o.AttachmentRow,h(h({},b),{},{ref:t,onShare:u,onItemClick:null!=a?a:p}));return c.jsxs(c.Fragment,{children:[j,!a&&m]})}));exports.AttachmentPreview=f;
2
2
  //# sourceMappingURL=AttachmentPreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentPreview.js","sources":["../../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { useAttachmentLightbox } from '../AttachmentLightbox/useAttachmentLightbox';\n\nimport { AttachmentRow } from './AttachmentRow';\nimport { SortableAttachments } from './SortableAttachments';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\n/**\n * Picks the strip that fits — reorderable or plain — and gives it a lightbox. Rendering lives in\n * `AttachmentRow`, drag-and-drop in `SortableAttachments`, the modal in `useAttachmentLightbox`.\n */\nexport const AttachmentPreview = forwardRef<HTMLDivElement, AttachmentPreviewProps>(\n ({ onReorder, onItemClick, ...props }, ref) => {\n // Images and videos open in the lightbox by default; passing `onItemClick` takes that over.\n const { openAttachment, lightbox } = useAttachmentLightbox();\n\n if (!props.items.length) return null;\n\n const isSortable = !!onReorder && props.items.length > 1;\n const strip = isSortable ? (\n <SortableAttachments\n {...props}\n ref={ref}\n onReorder={onReorder}\n onItemClick={onItemClick ?? openAttachment}\n />\n ) : (\n <AttachmentRow {...props} ref={ref} onItemClick={onItemClick ?? openAttachment} />\n );\n\n return (\n <>\n {strip}\n {!onItemClick && lightbox}\n </>\n );\n }\n);\n"],"names":["AttachmentPreview","forwardRef","_ref","ref","onReorder","onItemClick","props","_objectWithoutProperties","_excluded","_useAttachmentLightbo","useAttachmentLightbox","openAttachment","lightbox","items","length","strip","_jsx","SortableAttachments","jsx","AttachmentRow","_objectSpread","_jsxs","_Fragment","children"],"mappings":"8iCAYaA,EAAoBC,EAAUA,YACzC,SAAAC,EAAuCC,GAAQ,IAA5CC,IAAAA,UAAWC,IAAAA,YAAgBC,EAAKC,EAAA,QAAAL,EAAAM,GAEjCC,EAAqCC,EAAAA,wBAA7BC,IAAAA,eAAgBC,IAAAA,SAExB,IAAKN,EAAMO,MAAMC,OAAQ,OAAO,KAEhC,IACMC,IADeX,GAAaE,EAAMO,MAAMC,OAAS,EAErDE,EAAAA,IAACC,EAAmBA,2BACdX,GAAK,GAAA,CACTH,IAAKA,EACLC,UAAWA,EACXC,YAAaA,QAAAA,EAAeM,KAG9BK,EAAAE,IAACC,gBAAaC,EAAAA,EAAA,CAAA,EAAKd,GAAK,GAAA,CAAEH,IAAKA,EAAKE,YAAaA,QAAAA,EAAeM,KAGlE,OACEU,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACGR,GACCV,GAAeO,IAGvB"}
1
+ {"version":3,"file":"AttachmentPreview.js","sources":["../../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { useAttachmentLightbox } from '../AttachmentLightbox/useAttachmentLightbox';\n\nimport { AttachmentRow } from './AttachmentRow';\nimport { SortableAttachments } from './SortableAttachments';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\n/**\n * Picks the strip that fits — reorderable or plain — and gives it a lightbox. Rendering lives in\n * `AttachmentRow`, drag-and-drop in `SortableAttachments`, the modal in `useAttachmentLightbox`.\n */\nexport const AttachmentPreview = forwardRef<HTMLDivElement, AttachmentPreviewProps>(\n ({ onReorder, onItemClick, onShare, ...props }, ref) => {\n const { openAttachment, lightbox } = useAttachmentLightbox(props.items, { onShare });\n\n if (!props.items.length) return null;\n\n const isSortable = !!onReorder && props.items.length > 1;\n const strip = isSortable ? (\n <SortableAttachments\n {...props}\n ref={ref}\n onReorder={onReorder}\n onItemClick={onItemClick ?? openAttachment}\n />\n ) : (\n <AttachmentRow\n {...props}\n ref={ref}\n onShare={onShare}\n onItemClick={onItemClick ?? openAttachment}\n />\n );\n\n return (\n <>\n {strip}\n {!onItemClick && lightbox}\n </>\n );\n }\n);\n"],"names":["AttachmentPreview","forwardRef","_ref","ref","onReorder","onItemClick","onShare","props","_objectWithoutProperties","_excluded","_useAttachmentLightbo","useAttachmentLightbox","items","openAttachment","lightbox","length","strip","_jsx","SortableAttachments","jsx","AttachmentRow","_objectSpread","_jsxs","_Fragment","children"],"mappings":"wjCAYaA,EAAoBC,EAAUA,YACzC,SAAAC,EAAgDC,GAAQ,IAArDC,IAAAA,UAAWC,IAAAA,YAAaC,IAAAA,QAAYC,EAAKC,EAAA,QAAAN,EAAAO,GAC1CC,EAAqCC,EAAAA,sBAAsBJ,EAAMK,MAAO,CAAEN,QAAAA,IAAlEO,IAAAA,eAAgBC,IAAAA,SAExB,IAAKP,EAAMK,MAAMG,OAAQ,OAAO,KAEhC,IACMC,IADeZ,GAAaG,EAAMK,MAAMG,OAAS,EAErDE,EAAAA,IAACC,EAAmBA,2BACdX,GAAK,GAAA,CACTJ,IAAKA,EACLC,UAAWA,EACXC,YAAaA,QAAAA,EAAeQ,KAG9BI,EAAAE,IAACC,gBAAaC,EAAAA,EAAA,CAAA,EACRd,GAAK,GAAA,CACTJ,IAAKA,EACLG,QAASA,EACTD,YAAaA,QAAAA,EAAeQ,KAIhC,OACES,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACGR,GACCX,GAAeS,IAGvB"}
@@ -1,2 +1,2 @@
1
- "use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')('.AttachmentPreview_scroller__ZqYC8{-ms-overflow-style:none;align-items:flex-start;display:flex;gap:12px;margin-left:-8px;overflow-x:auto;overflow-y:visible;padding-left:8px;padding-right:8px;padding-top:6px;scroll-behavior:smooth;scrollbar-width:none}.AttachmentPreview_scroller__ZqYC8::-webkit-scrollbar{display:none}.AttachmentPreview_slot__ewKLo{border-radius:8px;cursor:grab;flex-shrink:0;position:relative;touch-action:none}.AttachmentPreview_slot__ewKLo:focus-visible{outline:none}.AttachmentPreview_slot__ewKLo:focus-visible:before{border:2px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:5}.AttachmentPreview_slotDragging__hrfJX{cursor:grabbing}.AttachmentPreview_slotDragging__hrfJX .AttachmentPreview_slotContent__GNuSu{visibility:hidden}.AttachmentPreview_slotDragging__hrfJX:focus-visible:before{display:none}.AttachmentPreview_slotDragging__hrfJX:after{background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px dashed var(--palette-primary-text-6);border-radius:8px;content:"";inset:0;position:absolute}.AttachmentPreview_insertion__iFqlp{background:var(--palette-primary-main);border-radius:2px;bottom:0;box-shadow:0 0 6px rgb(from var(--palette-primary-main) r g b/.6);position:absolute;top:0;width:2px;z-index:4}.AttachmentPreview_insertionBefore__jyWQM,.AttachmentPreview_insertionEdge__Bjk1t{left:-7px}.AttachmentPreview_insertionAfter__4NvhP{right:-7px}.AttachmentPreview_dragGhost__4aSzE{background:var(--palette-background-b-6);border-radius:8px;box-shadow:0 10px 20px rgb(from var(--palette-background-b-1) r g b/.45);cursor:grabbing;opacity:.9;position:relative;transform:rotate(4deg)}.AttachmentPreview_dragGhostHandle__Gu2CP{align-items:center;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute;z-index:2}.AttachmentPreview_dragGhostHandle__Gu2CP button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.16)!important;color:var(--palette-primary-text-1)!important}.AttachmentPreview_dragGhostHandle__Gu2CP svg{color:var(--palette-primary-text-1)}.AttachmentPreview_thumbnail__ytI2L{border-radius:8px;flex-shrink:0;height:64px;overflow:visible;position:relative;width:64px}.AttachmentPreview_clickable__BEXzK{cursor:pointer}.AttachmentPreview_clickable__BEXzK:hover{opacity:.9}.AttachmentPreview_thumbnailInner__9Ex4-{border-radius:8px;inset:0;overflow:hidden;pointer-events:none;position:absolute}.AttachmentPreview_thumbnailImage__RQ4fL{height:100%;left:50%;max-width:none;min-width:100%;object-fit:cover;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:auto}.AttachmentPreview_videoOverlay__5Lgi1{align-items:center;background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute}.AttachmentPreview_playIcon__OOnql{color:var(--palette-primary-text-1);font-size:32px}.AttachmentPreview_fileCard__oxDbD{align-items:flex-start;border:1px solid rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:8px;display:flex;flex-direction:column;flex-shrink:0;height:64px;justify-content:center;padding:8px 16px;position:relative;width:142px}.AttachmentPreview_fileCardLink__TDpvh{color:inherit;cursor:pointer;text-decoration:none}.AttachmentPreview_fileCardLink__TDpvh:hover{border-color:rgb(from var(--palette-primary-text-1) r g b/.16)}.AttachmentPreview_fileCardContent__c-99Q{align-items:center;display:flex;gap:8px;width:100%}.AttachmentPreview_fileInfo__eqJ-B{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;justify-content:center;min-width:0}.AttachmentPreview_fileName__1Ccg0{color:var(--palette-primary-text-1)}.AttachmentPreview_fileName__1Ccg0,.AttachmentPreview_fileType__0v6E4{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.AttachmentPreview_fileType__0v6E4{color:var(--palette-primary-text-6);text-transform:uppercase}.AttachmentPreview_downloadButton__9oBz-{opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_downloadButton__9oBz- button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_downloadButton__9oBz- button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_downloadButton__9oBz-{opacity:1}.AttachmentPreview_removeButton__aX-qu{opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_removeButton__aX-qu button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_removeButton__aX-qu button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_removeButton__aX-qu,.AttachmentPreview_removeButtonVisible__BVjYB,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_removeButton__aX-qu{opacity:1}.AttachmentPreview_thumbnailError__yyH08{border:1px solid rgb(from var(--palette-error-main) r g b/.4)}.AttachmentPreview_uploadingOverlay__leV1D{background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_uploadingSpinner__u-t7d{align-items:center;backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:6px;display:flex;height:24px;justify-content:center;position:absolute;right:-6px;top:-6px;width:24px;z-index:2}.AttachmentPreview_loader__HK5bZ{color:var(--palette-primary-text-6)!important;height:14px!important;width:14px!important}.AttachmentPreview_errorOverlay__8sM1d{background:rgb(from var(--palette-error-main) r g b/.08);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_retryButton__tKVV0{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:2}.AttachmentPreview_retryButton__tKVV0 button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_retryButton__tKVV0 button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}'),module.exports={spacing:"8",scroller:"AttachmentPreview_scroller__ZqYC8",slot:"AttachmentPreview_slot__ewKLo",slotDragging:"AttachmentPreview_slotDragging__hrfJX",slotContent:"AttachmentPreview_slotContent__GNuSu",insertion:"AttachmentPreview_insertion__iFqlp",insertionBefore:"AttachmentPreview_insertionBefore__jyWQM",insertionEdge:"AttachmentPreview_insertionEdge__Bjk1t",insertionAfter:"AttachmentPreview_insertionAfter__4NvhP",dragGhost:"AttachmentPreview_dragGhost__4aSzE",dragGhostHandle:"AttachmentPreview_dragGhostHandle__Gu2CP",thumbnail:"AttachmentPreview_thumbnail__ytI2L",clickable:"AttachmentPreview_clickable__BEXzK",thumbnailInner:"AttachmentPreview_thumbnailInner__9Ex4-",thumbnailImage:"AttachmentPreview_thumbnailImage__RQ4fL",videoOverlay:"AttachmentPreview_videoOverlay__5Lgi1",playIcon:"AttachmentPreview_playIcon__OOnql",fileCard:"AttachmentPreview_fileCard__oxDbD",fileCardLink:"AttachmentPreview_fileCardLink__TDpvh",fileCardContent:"AttachmentPreview_fileCardContent__c-99Q",fileInfo:"AttachmentPreview_fileInfo__eqJ-B",fileName:"AttachmentPreview_fileName__1Ccg0",fileType:"AttachmentPreview_fileType__0v6E4",downloadButton:"AttachmentPreview_downloadButton__9oBz-",removeButton:"AttachmentPreview_removeButton__aX-qu",removeButtonVisible:"AttachmentPreview_removeButtonVisible__BVjYB",thumbnailError:"AttachmentPreview_thumbnailError__yyH08",uploadingOverlay:"AttachmentPreview_uploadingOverlay__leV1D",uploadingSpinner:"AttachmentPreview_uploadingSpinner__u-t7d",loader:"AttachmentPreview_loader__HK5bZ",errorOverlay:"AttachmentPreview_errorOverlay__8sM1d",retryButton:"AttachmentPreview_retryButton__tKVV0"};
1
+ "use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')('.AttachmentPreview_scroller__ZqYC8{-ms-overflow-style:none;align-items:flex-start;display:flex;gap:12px;margin-left:-8px;overflow-x:auto;overflow-y:visible;padding-left:8px;padding-right:8px;padding-top:6px;scroll-behavior:smooth;scrollbar-width:none}.AttachmentPreview_scroller__ZqYC8::-webkit-scrollbar{display:none}.AttachmentPreview_slot__ewKLo{border-radius:8px;cursor:grab;flex-shrink:0;position:relative;touch-action:none}.AttachmentPreview_slot__ewKLo:focus-visible{outline:none}.AttachmentPreview_slot__ewKLo:focus-visible:before{border:2px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:5}.AttachmentPreview_slotDragging__hrfJX{cursor:grabbing}.AttachmentPreview_slotDragging__hrfJX .AttachmentPreview_slotContent__GNuSu{visibility:hidden}.AttachmentPreview_slotDragging__hrfJX:focus-visible:before{display:none}.AttachmentPreview_slotDragging__hrfJX:after{background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px dashed var(--palette-primary-text-6);border-radius:8px;content:"";inset:0;position:absolute}.AttachmentPreview_insertion__iFqlp{background:var(--palette-primary-main);border-radius:2px;bottom:0;box-shadow:0 0 6px rgb(from var(--palette-primary-main) r g b/.6);position:absolute;top:0;width:2px;z-index:4}.AttachmentPreview_insertionBefore__jyWQM,.AttachmentPreview_insertionEdge__Bjk1t{left:-7px}.AttachmentPreview_insertionAfter__4NvhP{right:-7px}.AttachmentPreview_dragGhost__4aSzE{background:var(--palette-background-b-6);border-radius:8px;box-shadow:0 10px 20px rgb(from var(--palette-background-b-1) r g b/.45);cursor:grabbing;opacity:.9;position:relative;transform:rotate(4deg)}.AttachmentPreview_dragGhostHandle__Gu2CP{align-items:center;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute;z-index:2}.AttachmentPreview_dragGhostHandle__Gu2CP button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.16)!important;color:var(--palette-primary-text-1)!important}.AttachmentPreview_dragGhostHandle__Gu2CP svg{color:var(--palette-primary-text-1)}.AttachmentPreview_thumbnail__ytI2L{border-radius:8px;flex-shrink:0;height:64px;overflow:visible;position:relative;width:64px}.AttachmentPreview_clickable__BEXzK{cursor:pointer}.AttachmentPreview_clickable__BEXzK:hover{opacity:.9}.AttachmentPreview_selected__JRuMO:after{border:1px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:4}.AttachmentPreview_thumbnailInner__9Ex4-{border-radius:8px;inset:0;overflow:hidden;pointer-events:none;position:absolute}.AttachmentPreview_thumbnailImage__RQ4fL{height:100%;left:50%;max-width:none;min-width:100%;object-fit:cover;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:auto}.AttachmentPreview_videoOverlay__5Lgi1{align-items:center;background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute}.AttachmentPreview_playIcon__OOnql{color:var(--palette-primary-text-1);font-size:32px}.AttachmentPreview_fileCard__oxDbD{align-items:flex-start;border:1px solid rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:8px;display:flex;flex-direction:column;flex-shrink:0;height:64px;justify-content:center;padding:8px 16px;position:relative;width:142px}.AttachmentPreview_fileCardLink__TDpvh{color:inherit;cursor:pointer;text-decoration:none}.AttachmentPreview_fileCardLink__TDpvh:hover{border-color:rgb(from var(--palette-primary-text-1) r g b/.16)}.AttachmentPreview_fileCardContent__c-99Q{align-items:center;display:flex;gap:8px;width:100%}.AttachmentPreview_fileInfo__eqJ-B{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;justify-content:center;min-width:0}.AttachmentPreview_fileName__1Ccg0{color:var(--palette-primary-text-1)}.AttachmentPreview_fileName__1Ccg0,.AttachmentPreview_fileType__0v6E4{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.AttachmentPreview_fileType__0v6E4{color:var(--palette-primary-text-6);text-transform:uppercase}.AttachmentPreview_tileActions__2nLlw{display:flex;gap:4px;opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_tileActions__2nLlw button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_tileActions__2nLlw button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_tileActions__2nLlw,.AttachmentPreview_thumbnail__ytI2L .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_tileActions__2nLlw{opacity:1}.AttachmentPreview_tileActionLink__aMyS4{display:inline-flex}.AttachmentPreview_removeButton__aX-qu{opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_removeButton__aX-qu button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_removeButton__aX-qu button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_removeButton__aX-qu,.AttachmentPreview_removeButtonVisible__BVjYB,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_removeButton__aX-qu{opacity:1}.AttachmentPreview_thumbnailError__yyH08{border:1px solid rgb(from var(--palette-error-main) r g b/.4)}.AttachmentPreview_uploadingOverlay__leV1D{background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_uploadingSpinner__u-t7d{align-items:center;backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:6px;display:flex;height:24px;justify-content:center;position:absolute;right:-6px;top:-6px;width:24px;z-index:2}.AttachmentPreview_loader__HK5bZ{color:var(--palette-primary-text-6)!important;height:14px!important;width:14px!important}.AttachmentPreview_errorOverlay__8sM1d{background:rgb(from var(--palette-error-main) r g b/.08);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_retryButton__tKVV0{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:2}.AttachmentPreview_retryButton__tKVV0 button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_retryButton__tKVV0 button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}'),module.exports={spacing:"8",scroller:"AttachmentPreview_scroller__ZqYC8",slot:"AttachmentPreview_slot__ewKLo",slotDragging:"AttachmentPreview_slotDragging__hrfJX",slotContent:"AttachmentPreview_slotContent__GNuSu",insertion:"AttachmentPreview_insertion__iFqlp",insertionBefore:"AttachmentPreview_insertionBefore__jyWQM",insertionEdge:"AttachmentPreview_insertionEdge__Bjk1t",insertionAfter:"AttachmentPreview_insertionAfter__4NvhP",dragGhost:"AttachmentPreview_dragGhost__4aSzE",dragGhostHandle:"AttachmentPreview_dragGhostHandle__Gu2CP",thumbnail:"AttachmentPreview_thumbnail__ytI2L",clickable:"AttachmentPreview_clickable__BEXzK",selected:"AttachmentPreview_selected__JRuMO",thumbnailInner:"AttachmentPreview_thumbnailInner__9Ex4-",thumbnailImage:"AttachmentPreview_thumbnailImage__RQ4fL",videoOverlay:"AttachmentPreview_videoOverlay__5Lgi1",playIcon:"AttachmentPreview_playIcon__OOnql",fileCard:"AttachmentPreview_fileCard__oxDbD",fileCardLink:"AttachmentPreview_fileCardLink__TDpvh",fileCardContent:"AttachmentPreview_fileCardContent__c-99Q",fileInfo:"AttachmentPreview_fileInfo__eqJ-B",fileName:"AttachmentPreview_fileName__1Ccg0",fileType:"AttachmentPreview_fileType__0v6E4",tileActions:"AttachmentPreview_tileActions__2nLlw",tileActionLink:"AttachmentPreview_tileActionLink__aMyS4",removeButton:"AttachmentPreview_removeButton__aX-qu",removeButtonVisible:"AttachmentPreview_removeButtonVisible__BVjYB",thumbnailError:"AttachmentPreview_thumbnailError__yyH08",uploadingOverlay:"AttachmentPreview_uploadingOverlay__leV1D",uploadingSpinner:"AttachmentPreview_uploadingSpinner__u-t7d",loader:"AttachmentPreview_loader__HK5bZ",errorOverlay:"AttachmentPreview_errorOverlay__8sM1d",retryButton:"AttachmentPreview_retryButton__tKVV0"};
2
2
  //# sourceMappingURL=AttachmentPreview.scss.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("./AttachmentTile.js"),n=require("./AttachmentPreview.scss.js"),s=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(t),c=e.forwardRef((function(e,t){var a=e.items,c=e.onRemove,o=e.onRetry,u=e.onItemClick,l=e.className,m=e.testId;return s.jsx("div",{ref:t,"data-testid":m,className:i.default(n.scroller,l),children:a.map((function(e){return s.jsx(r.AttachmentTile,{item:e,onRemove:c,onRetry:o,onItemClick:u},e.id)}))})}));exports.AttachmentRow=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("./AttachmentTile.js"),i=require("./AttachmentPreview.scss.js"),n=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=s(t),o=e.forwardRef((function(e,t){var s=e.items,o=e.onRemove,c=e.onRetry,d=e.onItemClick,u=e.onShare,l=e.selectedId,m=e.hideActions,f=e.className,h=e.testId;return n.jsx("div",{ref:t,"data-testid":h,className:a.default(i.scroller,f),children:s.map((function(e){return n.jsx(r.AttachmentTile,{item:e,onRemove:o,onRetry:c,onItemClick:d,onShare:u,isSelected:void 0!==l&&e.id===l,hideActions:m},e.id)}))})}));exports.AttachmentRow=o;
2
2
  //# sourceMappingURL=AttachmentRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentRow.js","sources":["../../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport { AttachmentTile } from './AttachmentTile';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nexport type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'>;\n\n/** The plain, non-reorderable strip. `SortableAttachments` is its drag-and-drop counterpart. */\nexport const AttachmentRow = forwardRef<HTMLDivElement, AttachmentRowProps>(\n ({ items, onRemove, onRetry, onItemClick, className, testId }, ref) => (\n <div ref={ref} data-testid={testId} className={classNames(styles.scroller, className)}>\n {items.map(item => (\n <AttachmentTile\n key={item.id}\n item={item}\n onRemove={onRemove}\n onRetry={onRetry}\n onItemClick={onItemClick}\n />\n ))}\n </div>\n )\n);\n"],"names":["AttachmentRow","forwardRef","ref","items","onRemove","onRetry","onItemClick","className","testId","_jsx","classNames","styles","scroller","children","map","item","AttachmentTile","id"],"mappings":"+SAWaA,EAAgBC,EAAUA,YACrC,WAA+DC,GAAG,IAA/DC,IAAAA,MAAOC,IAAAA,SAAUC,IAAAA,QAASC,IAAAA,YAAaC,IAAAA,UAAWC,IAAAA,OAAM,OACzDC,EAAAA,IAAA,MAAA,CAAKP,IAAKA,EAAK,cAAaM,EAAQD,UAAWG,EAAU,QAACC,EAAOC,SAAUL,GAAWM,SACnFV,EAAMW,KAAI,SAAAC,GAAI,OACbN,EAAAA,IAACO,EAAAA,eAAc,CAEbD,KAAMA,EACNX,SAAUA,EACVC,QAASA,EACTC,YAAaA,GAJRS,EAAKE,QAOV"}
1
+ {"version":3,"file":"AttachmentRow.js","sources":["../../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport { AttachmentTile } from './AttachmentTile';\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nexport type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'> & {\n selectedId?: AttachmentPreviewItem['id'];\n};\n\n/** The plain, non-reorderable strip. `SortableAttachments` is its drag-and-drop counterpart. */\nexport const AttachmentRow = forwardRef<HTMLDivElement, AttachmentRowProps>(\n (\n { items, onRemove, onRetry, onItemClick, onShare, selectedId, hideActions, className, testId },\n ref\n ) => (\n <div ref={ref} data-testid={testId} className={classNames(styles.scroller, className)}>\n {items.map(item => (\n <AttachmentTile\n key={item.id}\n item={item}\n onRemove={onRemove}\n onRetry={onRetry}\n onItemClick={onItemClick}\n onShare={onShare}\n isSelected={selectedId !== undefined && item.id === selectedId}\n hideActions={hideActions}\n />\n ))}\n </div>\n )\n);\n"],"names":["AttachmentRow","forwardRef","ref","items","onRemove","onRetry","onItemClick","onShare","selectedId","hideActions","className","testId","_jsx","classNames","styles","scroller","children","map","item","AttachmentTile","isSelected","undefined","id"],"mappings":"+SAaaA,EAAgBC,EAAUA,YACrC,WAEEC,GAAG,IADDC,IAAAA,MAAOC,IAAAA,SAAUC,IAAAA,QAASC,IAAAA,YAAaC,IAAAA,QAASC,IAAAA,WAAYC,IAAAA,YAAaC,IAAAA,UAAWC,IAAAA,OAAM,OAG5FC,EAAAA,IAAA,MAAA,CAAKV,IAAKA,EAAK,cAAaS,EAAQD,UAAWG,EAAU,QAACC,EAAOC,SAAUL,GAAWM,SACnFb,EAAMc,KAAI,SAAAC,GAAI,OACbN,EAAAA,IAACO,EAAAA,eAAc,CAEbD,KAAMA,EACNd,SAAUA,EACVC,QAASA,EACTC,YAAaA,EACbC,QAASA,EACTa,gBAA2BC,IAAfb,GAA4BU,EAAKI,KAAOd,EACpDC,YAAaA,GAPRS,EAAKI,QAUV"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("classnames"),o=require("../../componentsV2/FileIcon/FileIcon.js"),e=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),i=require("../../componentsV2/Tooltip/Tooltip.js"),c=require("../../componentsV2/LoaderCircular/LoaderCircular.js"),n=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js");var r=require("./AttachmentPreview.scss.js"),t=require("../../utils/main.js"),u=require("react/jsx-runtime");function a(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var l=a(s),m=function(s){var o,e=s.split(".");return e.length>1?(null!==(o=e.pop())&&void 0!==o?o:"").toUpperCase():""},d=function(s){return function(o){o.stopPropagation(),s()}},j=function(s){var o=s.item,t=s.onRemove,a=s.onRetry;return u.jsxs(u.Fragment,{children:[o.isUploading&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:r.uploadingOverlay}),u.jsx("div",{className:r.uploadingSpinner,children:u.jsx(c.LoaderCircular,{size:"xs",className:r.loader})})]}),!!o.error&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:r.errorOverlay}),a&&u.jsx(i.Tooltip,{title:"Retry upload",children:u.jsx("div",{className:r.retryButton,children:u.jsx(e.ButtonIcon,{size:"xs",type:"tertiaryBg",onClick:d((function(){return a(o.id)})),testId:"attachment-retry",children:u.jsx(n.UndoIcon,{size:"small"})})})})]}),t&&!o.isUploading&&u.jsx(i.Tooltip,{title:"Remove",children:u.jsx("div",{className:l.default(r.removeButton,!!o.error&&r.removeButtonVisible),children:u.jsx(e.ButtonIcon,{size:"xs",type:"tertiaryBg",onClick:d((function(){return t(o.id)})),testId:"attachment-remove",children:u.jsx(n.CloseSmallIcon,{size:"small"})})})})]})};exports.AttachmentTile=function(s){var c,a,d=s.item,I=s.onRemove,q=s.onRetry,p=s.onItemClick,h=null!==(c=d.kind)&&void 0!==c?c:"file",v=u.jsx(j,{item:d,onRemove:I,onRetry:q}),x=t.default.getFileNameWithExtensionFromPath(d.name);if("image"===h||"video"===h){var C=!!p&&!d.isUploading&&!d.error;return u.jsxs("div",{className:l.default(r.thumbnail,C&&r.clickable,!!d.error&&r.thumbnailError),onClick:C?function(){return null==p?void 0:p(d)}:void 0,children:[u.jsx("div",{className:r.thumbnailInner,children:"image"===h?u.jsx("img",{src:d.src,alt:x,className:r.thumbnailImage}):u.jsx("video",{src:(a=d.src,a&&!a.includes("#t=")?"".concat(a,"#t=0.1"):a),className:r.thumbnailImage,preload:"metadata",playsInline:!0,muted:!0})}),"video"===h&&u.jsx("div",{className:r.videoOverlay,children:u.jsx(n.PlayOneIcon,{theme:"filled",className:r.playIcon})}),v]})}var f,g=!(!d.downloadUrl||I||d.isUploading||d.error),F=u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:r.fileCardContent,children:[u.jsx(o.FileIcon,{name:x}),u.jsxs("div",{className:r.fileInfo,children:[u.jsx(i.Tooltip,{title:x,children:u.jsx("div",{className:r.fileName,children:(f=x,f.replace(/\.[^/.]+$/,""))})}),u.jsx("div",{className:r.fileType,children:m(x)})]})]}),g&&u.jsx(i.Tooltip,{title:"Download",children:u.jsx("div",{className:r.downloadButton,children:u.jsx(e.ButtonIcon,{size:"xs",type:"tertiaryBg",testId:"attachment-download-button",children:u.jsx(n.DownloadIcon,{size:"small"})})})}),v]});return g?u.jsx("a",{href:d.downloadUrl,download:x,className:l.default(r.fileCard,r.fileCardLink),"data-testid":"attachment-download",children:F}):u.jsx("div",{className:l.default(r.fileCard,!!d.error&&r.thumbnailError),children:F})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("react"),o=require("classnames"),n=require("../../componentsV2/FileIcon/FileIcon.js"),i=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),c=require("../../componentsV2/Tooltip/Tooltip.js"),r=require("../../componentsV2/LoaderCircular/LoaderCircular.js"),t=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js");var u=require("./AttachmentActionsMenu.js"),a=require("./AttachmentImage.js"),l=require("./AttachmentDownloadLink.js"),m=require("./AttachmentPreview.scss.js"),j=require("../../utils/main.js"),d=require("react/jsx-runtime");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var q=I(e),p=I(o);function h(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,n)}return o}function v(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?h(Object(o),!0).forEach((function(s){q.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var f=function(e){var s,o=e.split(".");return o.length>1?(null!==(s=o.pop())&&void 0!==s?s:"").toUpperCase():""},x=function(e){var s=e.item,o=e.onShare,n=e.imageRef,i=j.default.getFileNameWithExtensionFromPath(s.name),c=s.downloadUrl||s.src;return d.jsxs("div",{className:m.tileActions,"data-testid":"attachment-tile-actions",children:[!!c&&d.jsx(l.AttachmentDownloadLink,{url:c,fileName:i,size:"xs",className:m.tileActionLink}),d.jsx(u.AttachmentActionsMenu,{item:s,onShare:o,size:"xs",testIdPrefix:"attachment-tile",tooltip:"More actions",imageRef:n})]})},g=function(e){return function(s){s.stopPropagation(),e()}},b=function(e){var s=e.item,o=e.onRemove,n=e.onRetry;return d.jsxs(d.Fragment,{children:[s.isUploading&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:m.uploadingOverlay}),d.jsx("div",{className:m.uploadingSpinner,children:d.jsx(r.LoaderCircular,{size:"xs",className:m.loader})})]}),!!s.error&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:m.errorOverlay}),n&&d.jsx(c.Tooltip,{title:"Retry upload",children:d.jsx("div",{className:m.retryButton,children:d.jsx(i.ButtonIcon,{size:"xs",type:"tertiaryBg",onClick:g((function(){return n(s.id)})),testId:"attachment-retry",children:d.jsx(t.UndoIcon,{size:"small"})})})})]}),o&&!s.isUploading&&d.jsx(c.Tooltip,{title:"Remove",children:d.jsx("div",{className:p.default(m.removeButton,!!s.error&&m.removeButtonVisible),children:d.jsx(i.ButtonIcon,{size:"xs",type:"tertiaryBg",onClick:g((function(){return o(s.id)})),testId:"attachment-remove",children:d.jsx(t.CloseSmallIcon,{size:"small"})})})})]})};exports.AttachmentTile=function(e){var o,i,r=e.item,u=e.onRemove,l=e.onRetry,I=e.onItemClick,q=e.isSelected,h=e.hideActions,g=e.onShare,C=s.useRef(null),y=null!==(o=r.kind)&&void 0!==o?o:"file",O=d.jsx(b,{item:r,onRemove:u,onRetry:l}),F=j.default.getFileNameWithExtensionFromPath(r.name),P=!r.isUploading&&!r.error,N=!!I&&P,A=!h&&!u&&P;if("image"===y||"video"===y)return d.jsxs("div",{className:p.default(m.thumbnail,N&&m.clickable,q&&m.selected,!!r.error&&m.thumbnailError),onClick:N?function(){return null==I?void 0:I(r)}:void 0,children:[d.jsx("div",{className:m.thumbnailInner,children:"image"===y?d.jsx(a.AttachmentImage,{ref:C,src:r.src,alt:F,className:m.thumbnailImage}):d.jsx("video",{src:(i=r.src,i&&!i.includes("#t=")?"".concat(i,"#t=0.1"):i),className:m.thumbnailImage,preload:"metadata",playsInline:!0,muted:!0})}),"video"===y&&d.jsx("div",{className:m.videoOverlay,children:d.jsx(t.PlayOneIcon,{theme:"filled",className:m.playIcon})}),A&&d.jsx(x,{item:r,onShare:g,imageRef:C}),O]});var k,R=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:m.fileCardContent,children:[d.jsx(n.FileIcon,{name:F}),d.jsxs("div",{className:m.fileInfo,children:[d.jsx(c.Tooltip,{title:F,children:d.jsx("div",{className:m.fileName,children:(k=F,k.replace(/\.[^/.]+$/,""))})}),d.jsx("div",{className:m.fileType,children:f(F)})]})]}),A&&d.jsx(x,{item:r,onShare:g}),O]}),S=N?{role:"button",tabIndex:0,onClick:function(){return null==I?void 0:I(r)},onKeyDown:function(e){e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),null==I||I(r)))}}:{};return d.jsx("div",v(v({className:p.default(m.fileCard,N&&m.fileCardLink,q&&m.selected,!!r.error&&m.thumbnailError)},S),{},{children:R}))};
2
2
  //# sourceMappingURL=AttachmentTile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentTile.js","sources":["../../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\nimport classNames from 'classnames';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { PlayOneIcon, CloseSmallIcon, UndoIcon } from '../../icons';\n\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nimport { DownloadIcon } from '~/icons';\nimport utils from '~/utils/main';\n\nconst getExtension = (name: string) => {\n const parts = name.split('.');\n return parts.length > 1 ? (parts.pop() ?? '').toUpperCase() : '';\n};\n\nconst dropExtension = (name: string) => name.replace(/\\.[^/.]+$/, '');\n\n// A bare <video> paints nothing until a frame is decoded; the media fragment forces one.\nconst withFirstFrame = (src?: string) => (src && !src.includes('#t=') ? `${src}#t=0.1` : src);\n\nexport type AttachmentTileProps = {\n item: AttachmentPreviewItem;\n onRemove?: AttachmentPreviewProps['onRemove'];\n onRetry?: AttachmentPreviewProps['onRetry'];\n onItemClick?: AttachmentPreviewProps['onItemClick'];\n};\n\nconst stopAndRun = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n};\n\nconst TileOverlays = ({ item, onRemove, onRetry }: Omit<AttachmentTileProps, 'onItemClick'>) => (\n <>\n {item.isUploading && (\n <>\n <div className={styles.uploadingOverlay} />\n <div className={styles.uploadingSpinner}>\n <LoaderCircular size=\"xs\" className={styles.loader} />\n </div>\n </>\n )}\n\n {!!item.error && (\n <>\n <div className={styles.errorOverlay} />\n {onRetry && (\n <Tooltip title=\"Retry upload\">\n <div className={styles.retryButton}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRetry(item.id))}\n testId=\"attachment-retry\"\n >\n <UndoIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n )}\n\n {onRemove && !item.isUploading && (\n <Tooltip title=\"Remove\">\n <div\n className={classNames(styles.removeButton, !!item.error && styles.removeButtonVisible)}\n >\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRemove(item.id))}\n testId=\"attachment-remove\"\n >\n <CloseSmallIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n);\n\nexport const AttachmentTile = ({ item, onRemove, onRetry, onItemClick }: AttachmentTileProps) => {\n const kind = item.kind ?? 'file';\n const overlays = <TileOverlays item={item} onRemove={onRemove} onRetry={onRetry} />;\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n\n if (kind === 'image' || kind === 'video') {\n const clickable = !!onItemClick && !item.isUploading && !item.error;\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames(\n styles.thumbnail,\n clickable && styles.clickable,\n !!item.error && styles.thumbnailError\n )}\n onClick={clickable ? () => onItemClick?.(item) : undefined}\n >\n <div className={styles.thumbnailInner}>\n {kind === 'image' ? (\n <img src={item.src} alt={fileName} className={styles.thumbnailImage} />\n ) : (\n <video\n src={withFirstFrame(item.src)}\n className={styles.thumbnailImage}\n preload=\"metadata\"\n playsInline\n muted\n />\n )}\n </div>\n {kind === 'video' && (\n <div className={styles.videoOverlay}>\n <PlayOneIcon theme=\"filled\" className={styles.playIcon} />\n </div>\n )}\n {overlays}\n </div>\n );\n }\n\n // Download and remove share the tile's top-right corner, so an editable tile keeps only Remove.\n const isDownloadable = !!item.downloadUrl && !onRemove && !item.isUploading && !item.error;\n\n const fileCardContent = (\n <>\n <div className={styles.fileCardContent}>\n <FileIcon name={fileName} />\n <div className={styles.fileInfo}>\n <Tooltip title={fileName}>\n <div className={styles.fileName}>{dropExtension(fileName)}</div>\n </Tooltip>\n <div className={styles.fileType}>{getExtension(fileName)}</div>\n </div>\n </div>\n {isDownloadable && (\n <Tooltip title=\"Download\">\n <div className={styles.downloadButton}>\n <ButtonIcon size=\"xs\" type=\"tertiaryBg\" testId=\"attachment-download-button\">\n <DownloadIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n {overlays}\n </>\n );\n\n if (isDownloadable) {\n return (\n <a\n href={item.downloadUrl}\n download={fileName}\n className={classNames(styles.fileCard, styles.fileCardLink)}\n data-testid=\"attachment-download\"\n >\n {fileCardContent}\n </a>\n );\n }\n\n return (\n <div className={classNames(styles.fileCard, !!item.error && styles.thumbnailError)}>\n {fileCardContent}\n </div>\n );\n};\n"],"names":["getExtension","name","_parts$pop","parts","split","length","pop","toUpperCase","stopAndRun","action","event","stopPropagation","TileOverlays","_ref","item","onRemove","onRetry","_jsxs","_Fragment","children","isUploading","_jsx","jsx","className","styles","uploadingOverlay","uploadingSpinner","LoaderCircular","size","loader","error","errorOverlay","Tooltip","title","retryButton","ButtonIcon","type","onClick","id","testId","UndoIcon","classNames","removeButton","removeButtonVisible","CloseSmallIcon","_ref2","_item$kind","src","onItemClick","kind","overlays","fileName","utils","getFileNameWithExtensionFromPath","clickable","thumbnail","thumbnailError","undefined","thumbnailInner","alt","thumbnailImage","includes","concat","preload","playsInline","muted","videoOverlay","PlayOneIcon","theme","playIcon","isDownloadable","downloadUrl","fileCardContent","jsxs","FileIcon","fileInfo","replace","fileType","downloadButton","DownloadIcon","href","download","fileCard","fileCardLink"],"mappings":"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"}
1
+ {"version":3,"file":"AttachmentTile.js","sources":["../../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"sourcesContent":["import { KeyboardEvent, MouseEvent, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { PlayOneIcon, CloseSmallIcon, UndoIcon } from '../../icons';\n\nimport { AttachmentActionsMenu } from './AttachmentActionsMenu';\nimport { AttachmentImage } from './AttachmentImage';\nimport { AttachmentDownloadLink } from './AttachmentDownloadLink';\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nimport utils from '~/utils/main';\n\nconst getExtension = (name: string) => {\n const parts = name.split('.');\n return parts.length > 1 ? (parts.pop() ?? '').toUpperCase() : '';\n};\n\nconst dropExtension = (name: string) => name.replace(/\\.[^/.]+$/, '');\n\n// A bare <video> paints nothing until a frame is decoded; the media fragment forces one.\nconst withFirstFrame = (src?: string) => (src && !src.includes('#t=') ? `${src}#t=0.1` : src);\n\nexport type AttachmentTileProps = {\n item: AttachmentPreviewItem;\n onRemove?: AttachmentPreviewProps['onRemove'];\n onRetry?: AttachmentPreviewProps['onRetry'];\n onItemClick?: AttachmentPreviewProps['onItemClick'];\n isSelected?: boolean;\n hideActions?: boolean;\n /** Adds \"Share file\" to the tile's hover menu. */\n onShare?: (item: AttachmentPreviewItem) => void;\n};\n\nconst TileActions = ({\n item,\n onShare,\n imageRef,\n}: Pick<AttachmentTileProps, 'item' | 'onShare'> & {\n imageRef?: RefObject<HTMLImageElement>;\n}) => {\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const downloadUrl = item.downloadUrl || item.src;\n\n return (\n <div className={styles.tileActions} data-testid=\"attachment-tile-actions\">\n {!!downloadUrl && (\n <AttachmentDownloadLink\n url={downloadUrl}\n fileName={fileName}\n size=\"xs\"\n className={styles.tileActionLink}\n />\n )}\n\n <AttachmentActionsMenu\n item={item}\n onShare={onShare}\n size=\"xs\"\n testIdPrefix=\"attachment-tile\"\n tooltip=\"More actions\"\n imageRef={imageRef}\n />\n </div>\n );\n};\n\nconst stopAndRun = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n};\n\nconst TileOverlays = ({ item, onRemove, onRetry }: Omit<AttachmentTileProps, 'onItemClick'>) => (\n <>\n {item.isUploading && (\n <>\n <div className={styles.uploadingOverlay} />\n <div className={styles.uploadingSpinner}>\n <LoaderCircular size=\"xs\" className={styles.loader} />\n </div>\n </>\n )}\n\n {!!item.error && (\n <>\n <div className={styles.errorOverlay} />\n {onRetry && (\n <Tooltip title=\"Retry upload\">\n <div className={styles.retryButton}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRetry(item.id))}\n testId=\"attachment-retry\"\n >\n <UndoIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n )}\n\n {onRemove && !item.isUploading && (\n <Tooltip title=\"Remove\">\n <div\n className={classNames(styles.removeButton, !!item.error && styles.removeButtonVisible)}\n >\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRemove(item.id))}\n testId=\"attachment-remove\"\n >\n <CloseSmallIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n);\n\nexport const AttachmentTile = ({\n item,\n onRemove,\n onRetry,\n onItemClick,\n isSelected,\n hideActions,\n onShare,\n}: AttachmentTileProps) => {\n const imageRef = useRef<HTMLImageElement>(null);\n const kind = item.kind ?? 'file';\n const overlays = <TileOverlays item={item} onRemove={onRemove} onRetry={onRetry} />;\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const isReady = !item.isUploading && !item.error;\n const clickable = !!onItemClick && isReady;\n // A tile being composed shows Remove in the same corner, and has nothing to link to.\n const showActions = !hideActions && !onRemove && isReady;\n\n if (kind === 'image' || kind === 'video') {\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames(\n styles.thumbnail,\n clickable && styles.clickable,\n isSelected && styles.selected,\n !!item.error && styles.thumbnailError\n )}\n onClick={clickable ? () => onItemClick?.(item) : undefined}\n >\n <div className={styles.thumbnailInner}>\n {kind === 'image' ? (\n <AttachmentImage\n ref={imageRef}\n src={item.src}\n alt={fileName}\n className={styles.thumbnailImage}\n />\n ) : (\n <video\n src={withFirstFrame(item.src)}\n className={styles.thumbnailImage}\n preload=\"metadata\"\n playsInline\n muted\n />\n )}\n </div>\n {kind === 'video' && (\n <div className={styles.videoOverlay}>\n <PlayOneIcon theme=\"filled\" className={styles.playIcon} />\n </div>\n )}\n {showActions && <TileActions item={item} onShare={onShare} imageRef={imageRef} />}\n {overlays}\n </div>\n );\n }\n\n const fileCardContent = (\n <>\n <div className={styles.fileCardContent}>\n <FileIcon name={fileName} />\n <div className={styles.fileInfo}>\n <Tooltip title={fileName}>\n <div className={styles.fileName}>{dropExtension(fileName)}</div>\n </Tooltip>\n <div className={styles.fileType}>{getExtension(fileName)}</div>\n </div>\n </div>\n {showActions && <TileActions item={item} onShare={onShare} />}\n {overlays}\n </>\n );\n\n const cardInteraction = clickable\n ? {\n role: 'button',\n tabIndex: 0,\n onClick: () => onItemClick?.(item),\n onKeyDown: (event: KeyboardEvent) => {\n // Keys bubbling from the nested download link must reach it, not open the preview.\n if (event.target !== event.currentTarget) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n\n // Space would otherwise scroll the surrounding feed.\n event.preventDefault();\n onItemClick?.(item);\n },\n }\n : {};\n\n return (\n <div\n className={classNames(\n styles.fileCard,\n clickable && styles.fileCardLink,\n isSelected && styles.selected,\n !!item.error && styles.thumbnailError\n )}\n {...cardInteraction}\n >\n {fileCardContent}\n </div>\n );\n};\n"],"names":["getExtension","name","_parts$pop","parts","split","length","pop","toUpperCase","TileActions","_ref","item","onShare","imageRef","fileName","utils","getFileNameWithExtensionFromPath","downloadUrl","src","_jsxs","className","styles","tileActions","children","_jsx","AttachmentDownloadLink","url","size","tileActionLink","AttachmentActionsMenu","testIdPrefix","tooltip","stopAndRun","action","event","stopPropagation","TileOverlays","_ref2","onRemove","onRetry","_Fragment","isUploading","jsx","uploadingOverlay","uploadingSpinner","LoaderCircular","loader","error","errorOverlay","Tooltip","title","retryButton","ButtonIcon","type","onClick","id","testId","UndoIcon","classNames","removeButton","removeButtonVisible","CloseSmallIcon","_ref3","_item$kind","onItemClick","isSelected","hideActions","useRef","kind","overlays","isReady","clickable","showActions","thumbnail","selected","thumbnailError","undefined","thumbnailInner","AttachmentImage","ref","alt","thumbnailImage","includes","concat","preload","playsInline","muted","videoOverlay","PlayOneIcon","theme","playIcon","fileCardContent","jsxs","FileIcon","fileInfo","replace","fileType","cardInteraction","role","tabIndex","onKeyDown","target","currentTarget","key","preventDefault","_objectSpread","fileCard","fileCardLink"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@babel/runtime/helpers/slicedToArray"),require("react"),require("../../clients/jsonApi/index.js"),require("file-extension"),require("image-extensions"),require("video-extensions");exports.getIsStoredKey=function(e){return e.includes("/")};
2
+ //# sourceMappingURL=useStoredAttachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoredAttachment.js","sources":["../../../../src/components/AttachmentPreview/useStoredAttachment.ts"],"sourcesContent":["import useSignedURL from '../../effects/useSignedURL';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\n\nexport type StoredAttachment = {\n name: string;\n url: string;\n /** Bytes, as recorded at upload time. */\n size?: number;\n};\n\n/**\n * One of ours is stored under an S3 key, which is a path. An attachment that was linked rather\n * than uploaded keeps a bare file name and a url that already works, so signing it would only\n * produce a link to an object that was never there.\n */\nexport const getIsStoredKey = (name: string): boolean => name.includes('/');\n\nexport const useStoredAttachment = (\n attachment?: StoredAttachment | null\n): AttachmentPreviewItem | null => {\n const kind = attachment ? getAttachmentKind(attachment) : undefined;\n const key = attachment && getIsStoredKey(attachment.name) ? attachment.name : '';\n const signed = useSignedURL(key, 'inline');\n // `download` is ignored cross-origin, so only an attachment-disposition link saves.\n const downloadUrl = useSignedURL(key, 'attachment');\n const src = key ? signed : attachment?.url;\n\n if (!attachment || !src) return null;\n\n return {\n id: attachment.url,\n name: attachment.name,\n src,\n kind,\n size: attachment.size,\n downloadUrl: downloadUrl || undefined,\n };\n};\n"],"names":["name","includes"],"mappings":"wRAiB8B,SAACA,GAAY,OAAcA,EAAKC,SAAS,IAAI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),u=require("react"),a=require("./getAttachmentKind.js"),c=require("../../clients/jsonApi/index.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e),s=o(r),f=o(t),l=o(n);function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach((function(r){i.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var b=function(){var e=f.default(l.default.mark((function e(r,t){var n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.getS3DownloadLink(r,t);case 3:return n=e.sent,u=n.url,e.abrupt("return",u);case 8:return e.prev=8,e.t0=e.catch(0),console.error('Failed to sign attachment "'.concat(r,'"'),e.t0),e.abrupt("return","");case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(r,t){return e.apply(this,arguments)}}(),m=function(){var e=f.default(l.default.mark((function e(r,t){var n,u;return l.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(r,"inline");case 2:if(n=e.sent,"file"!==t){e.next=9;break}return e.next=6,b(r,"attachment");case 6:e.t0=e.sent,e.next=10;break;case 9:e.t0="";case 10:return u=e.t0,e.abrupt("return",[r,{src:n,downloadUrl:u}]);case 12:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}();exports.useStoredAttachments=function(e){var r=u.useState({}),t=s.default(r,2),n=t[0],c=t[1],o=u.useRef(n);o.current=n;var i=u.useMemo((function(){return null!=e?e:[]}),[e]),f=i.map((function(e){return e.name})).join("|");return u.useEffect((function(){var e=i.filter((function(e){return!(e.name in o.current)}));if(e.length){var r=!0;return Promise.all(e.map((function(e){return m(e.name,a.getAttachmentKind(e))}))).then((function(e){r&&c((function(r){return d(d({},r),Object.fromEntries(e))}))})),function(){r=!1}}}),[f]),i.reduce((function(e,r){var t=n[r.name];return null!=t&&t.src?(e.push({id:r.url,name:r.name,src:t.src,kind:a.getAttachmentKind(r),downloadUrl:t.downloadUrl||void 0}),e):e}),[])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),u=require("react"),c=require("./getAttachmentKind.js"),a=require("./useStoredAttachment.js"),i=require("../../clients/jsonApi/index.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),f=o(r),l=o(t),p=o(n);function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){s.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var m=function(){var e=l.default(p.default.mark((function e(r,t){var n,u;return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getS3DownloadLink(r,t);case 3:return n=e.sent,u=n.url,e.abrupt("return",u);case 8:return e.prev=8,e.t0=e.catch(0),console.error('Failed to sign attachment "'.concat(r,'"'),e.t0),e.abrupt("return","");case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(r,t){return e.apply(this,arguments)}}();exports.useStoredAttachments=function(e){var r=u.useState({}),t=f.default(r,2),n=t[0],i=t[1],o=u.useRef(n);o.current=n;var l=u.useMemo((function(){return null!=e?e:[]}),[e]),p=l.map((function(e){return e.name})).join("|");return u.useEffect((function(){var e=l.filter((function(e){return!(e.name in o.current)}));if(e.length){var r=!0,t=function(e,r){return i((function(t){return b(b({},t),{},s.default({},e,b(b({},t[e]),r)))}))};return i((function(r){var t=b({},r);return e.forEach((function(e){var r;t[e.name]=null!==(r=t[e.name])&&void 0!==r?r:{}})),t})),e.forEach((function(e){a.getIsStoredKey(e.name)?m(e.name,"inline").then((function(n){r&&n&&t(e.name,{src:n})})):t(e.name,{src:e.url})})),function(){r=!1}}}),[p]),l.reduce((function(e,r){var t=n[r.name];return null!=t&&t.src?(e.push({id:r.url,name:r.name,src:t.src,kind:c.getAttachmentKind(r),size:r.size}),e):e}),[])};
2
2
  //# sourceMappingURL=useStoredAttachments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStoredAttachments.js","sources":["../../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\nimport type { StoredAttachment } from './useStoredAttachment';\n\nimport { getS3DownloadLink } from '~/clients/jsonApi';\n\ntype SignedLinks = Record<string, { src: string; downloadUrl: string }>;\n\nconst getSignedLink = async (name: string, disposition: 'attachment' | 'inline') => {\n try {\n const { url } = await getS3DownloadLink(name, disposition);\n\n return url;\n } catch (error) {\n console.error(`Failed to sign attachment \"${name}\"`, error);\n\n return '';\n }\n};\n\nconst sign = async (name: string, kind: string) => {\n const src = await getSignedLink(name, 'inline');\n\n // Only documents get a download action; images and videos skip the extra round trip.\n const downloadUrl = kind === 'file' ? await getSignedLink(name, 'attachment') : '';\n\n return [name, { src, downloadUrl }] as const;\n};\n\n/**\n * Signs a whole list of stored attachments — the hook-per-file `useStoredAttachment`\n * can't cover a list whose length changes between renders.\n */\nexport const useStoredAttachments = (\n attachments?: StoredAttachment[] | null\n): AttachmentPreviewItem[] => {\n const [links, setLinks] = useState<SignedLinks>({});\n const linksRef = useRef(links);\n linksRef.current = links;\n\n const list = useMemo(() => attachments ?? [], [attachments]);\n const key = list.map(attachment => attachment.name).join('|');\n\n useEffect(() => {\n const pending = list.filter(attachment => !(attachment.name in linksRef.current));\n if (!pending.length) return undefined;\n\n let isActive = true;\n Promise.all(\n pending.map(attachment => sign(attachment.name, getAttachmentKind(attachment)))\n ).then(resolved => {\n if (isActive) setLinks(prev => ({ ...prev, ...Object.fromEntries(resolved) }));\n });\n\n return () => {\n isActive = false;\n };\n // `key` tracks the list contents; `list` itself is a fresh array on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return list.reduce<AttachmentPreviewItem[]>((acc, attachment) => {\n const link = links[attachment.name];\n if (!link?.src) return acc;\n\n acc.push({\n id: attachment.url,\n name: attachment.name,\n src: link.src,\n kind: getAttachmentKind(attachment),\n downloadUrl: link.downloadUrl || undefined,\n });\n return acc;\n }, []);\n};\n"],"names":["getSignedLink","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","name","disposition","_yield$getS3DownloadL","url","wrap","_context","prev","next","getS3DownloadLink","sent","abrupt","t0","console","error","stop","_x","_x2","apply","this","arguments","sign","_ref2","_callee2","kind","src","downloadUrl","_context2","_x3","_x4","attachments","_useState","useState","_useState2","_slicedToArray","links","setLinks","linksRef","useRef","current","list","useMemo","key","map","attachment","join","useEffect","pending","filter","length","isActive","Promise","all","getAttachmentKind","then","resolved","_objectSpread","Object","fromEntries","reduce","acc","link","push","id","undefined"],"mappings":"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"}
1
+ {"version":3,"file":"useStoredAttachments.js","sources":["../../../../src/components/AttachmentPreview/useStoredAttachments.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { AttachmentPreviewItem } from './AttachmentPreview.types';\nimport { getAttachmentKind } from './getAttachmentKind';\nimport { getIsStoredKey, type StoredAttachment } from './useStoredAttachment';\n\nimport { getS3DownloadLink } from '~/clients/jsonApi';\n\ntype SignedLinks = Record<string, { src?: string }>;\n\nconst getSignedLink = async (name: string, disposition: 'attachment' | 'inline') => {\n try {\n const { url } = await getS3DownloadLink(name, disposition);\n\n return url;\n } catch (error) {\n console.error(`Failed to sign attachment \"${name}\"`, error);\n\n return '';\n }\n};\n\n/**\n * Signs a whole list of stored attachments — the hook-per-file `useStoredAttachment`\n * can't cover a list whose length changes between renders.\n */\nexport const useStoredAttachments = (\n attachments?: StoredAttachment[] | null\n): AttachmentPreviewItem[] => {\n const [links, setLinks] = useState<SignedLinks>({});\n const linksRef = useRef(links);\n linksRef.current = links;\n\n const list = useMemo(() => attachments ?? [], [attachments]);\n const key = list.map(attachment => attachment.name).join('|');\n\n useEffect(() => {\n const pending = list.filter(attachment => !(attachment.name in linksRef.current));\n if (!pending.length) return undefined;\n\n let isActive = true;\n\n const applyLink = (name: string, patch: SignedLinks[string]) =>\n setLinks(prev => ({ ...prev, [name]: { ...prev[name], ...patch } }));\n\n // Claim the names up front so a re-render mid-flight does not ask again.\n setLinks(prev => {\n const claimed = { ...prev };\n\n pending.forEach(attachment => {\n claimed[attachment.name] = claimed[attachment.name] ?? {};\n });\n\n return claimed;\n });\n\n pending.forEach(attachment => {\n // A linked attachment already carries a url that works; only a key of ours needs signing.\n if (!getIsStoredKey(attachment.name)) {\n applyLink(attachment.name, { src: attachment.url });\n\n return;\n }\n\n getSignedLink(attachment.name, 'inline').then(src => {\n if (isActive && src) applyLink(attachment.name, { src });\n });\n });\n\n return () => {\n isActive = false;\n };\n // `key` tracks the list contents; `list` itself is a fresh array on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [key]);\n\n return list.reduce<AttachmentPreviewItem[]>((acc, attachment) => {\n const link = links[attachment.name];\n if (!link?.src) return acc;\n\n acc.push({\n id: attachment.url,\n name: attachment.name,\n src: link.src,\n kind: getAttachmentKind(attachment),\n size: attachment.size,\n });\n return acc;\n }, []);\n};\n"],"names":["getSignedLink","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","name","disposition","_yield$getS3DownloadL","url","wrap","_context","prev","next","getS3DownloadLink","sent","abrupt","t0","console","error","stop","_x","_x2","apply","this","arguments","attachments","_useState","useState","_useState2","_slicedToArray","links","setLinks","linksRef","useRef","current","list","useMemo","key","map","attachment","join","useEffect","pending","filter","length","isActive","applyLink","patch","_objectSpread","claimed","forEach","_claimed$attachment$n","getIsStoredKey","then","src","reduce","acc","link","push","id","kind","getAttachmentKind","size"],"mappings":"kkCAUA,IAAMA,EAAa,WAAA,IAAGC,EAAAC,EAAAA,QAAAC,EAAA,QAAAC,MAAA,SAAAC,EAAOC,EAAcC,GAAoC,IAAAC,EAAAC,EAAA,OAAAN,UAAAO,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAErDC,EAAiBA,kBAACR,EAAMC,GAAY,KAAA,EAA/C,OAA+CC,EAAAG,EAAAI,KAAlDN,IAAAA,IAAGE,EAAAK,OAAA,SAEJP,GAAG,KAAA,EAEkD,OAFlDE,EAAAC,KAAA,EAAAD,EAAAM,GAAAN,EAAA,MAAA,GAEVO,QAAQC,MAAoCb,8BAAAA,OAAAA,EAAe,KAAAK,EAAAM,IAACN,EAAAK,OAAA,SAErD,IAAE,KAAA,GAAA,IAAA,MAAA,OAAAL,EAAAS,OAAA,GAAAf,EAAA,KAAA,CAAA,CAAA,EAAA,IAEZ,KAAA,OAAA,SAVkBgB,EAAAC,GAAA,OAAArB,EAAAsB,MAAAC,KAAAC,UAAA,CAAA,CAAA,gCAgBiB,SAClCC,GAEA,IAAAC,EAA0BC,EAAQA,SAAc,IAAGC,EAAAC,EAAAA,QAAAH,EAAA,GAA5CI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAChBI,EAAWC,SAAOH,GACxBE,EAASE,QAAUJ,EAEnB,IAAMK,EAAOC,EAAAA,SAAQ,WAAA,OAAMX,QAAAA,EAAe,KAAI,CAACA,IACzCY,EAAMF,EAAKG,KAAI,SAAAC,GAAU,OAAIA,EAAWlC,IAAI,IAAEmC,KAAK,KA0CzD,OAxCAC,EAAAA,WAAU,WACR,IAAMC,EAAUP,EAAKQ,QAAO,SAAAJ,GAAU,QAAMA,EAAWlC,QAAQ2B,EAASE,YACxE,GAAKQ,EAAQE,OAAb,CAEA,IAAIC,GAAW,EAETC,EAAY,SAACzC,EAAc0C,GAA0B,OACzDhB,GAAS,SAAApB,GAAI,OAAUA,EAAAA,EAAAA,CAAAA,EAAAA,mBAAON,EAAI2C,EAAAA,EAAA,CAAA,EAAQrC,EAAKN,IAAU0C,IAAK,GAAM,EA0BtE,OAvBAhB,GAAS,SAAApB,GACP,IAAMsC,EAAetC,EAAAA,CAAAA,EAAAA,GAMrB,OAJA+B,EAAQQ,SAAQ,SAAAX,GAAc,IAAAY,EAC5BF,EAAQV,EAAWlC,MAAgC,QAAxB4C,EAAAA,EAAQV,EAAWlC,aAAK,IAAA8C,EAAAA,EAAI,CAAA,CACzD,IAEOF,CACT,IAEAP,EAAQQ,SAAQ,SAAAX,GAETa,EAAcA,eAACb,EAAWlC,MAM/BN,EAAcwC,EAAWlC,KAAM,UAAUgD,MAAK,SAAAC,GACxCT,GAAYS,GAAKR,EAAUP,EAAWlC,KAAM,CAAEiD,IAAAA,GACpD,IAPER,EAAUP,EAAWlC,KAAM,CAAEiD,IAAKf,EAAW/B,KAQjD,IAEO,WACLqC,GAAW,EAhCwB,CAoCvC,GAAG,CAACR,IAEGF,EAAKoB,QAAgC,SAACC,EAAKjB,GAChD,IAAMkB,EAAO3B,EAAMS,EAAWlC,MAC9B,OAAKoD,SAAAA,EAAMH,KAEXE,EAAIE,KAAK,CACPC,GAAIpB,EAAW/B,IACfH,KAAMkC,EAAWlC,KACjBiD,IAAKG,EAAKH,IACVM,KAAMC,EAAiBA,kBAACtB,GACxBuB,KAAMvB,EAAWuB,OAEZN,GATgBA,CAUxB,GAAE,GACL"}