@corva/ui 3.71.0-9 → 3.72.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) 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/AttachFileButton/AttachFileButton.js +1 -1
  6. package/cjs-bundle/components/AttachFileButton/AttachFileButton.js.map +1 -1
  7. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
  8. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  9. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  10. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +2 -0
  11. package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -0
  12. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +2 -0
  13. package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -0
  14. package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js +2 -0
  15. package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js.map +1 -0
  16. package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
  17. package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
  18. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +2 -0
  19. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
  20. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  21. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  22. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  23. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  24. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  25. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  26. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  27. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  28. package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
  29. package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
  30. package/cjs-bundle/components/CommentCard/CommentCardReplies.js +1 -1
  31. package/cjs-bundle/components/CommentCard/CommentCardReplies.js.map +1 -1
  32. package/cjs-bundle/components/CommentCard/buildCommentReply.js +1 -1
  33. package/cjs-bundle/components/CommentCard/buildCommentReply.js.map +1 -1
  34. package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
  35. package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
  36. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
  37. package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
  38. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  39. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  40. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
  41. package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
  42. package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
  43. package/cjs-bundle/components/CommentInputNext/useFileDrop.js +2 -0
  44. package/cjs-bundle/components/CommentInputNext/useFileDrop.js.map +1 -0
  45. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  46. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  49. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  50. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  51. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  52. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  53. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  54. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  55. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  56. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  57. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  58. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  59. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  60. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  61. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  62. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  63. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  64. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  65. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  66. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  67. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  68. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  69. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  70. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  71. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  72. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  73. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  74. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  75. package/cjs-bundle/components/FeedCard/useActivityInteractions.js +1 -1
  76. package/cjs-bundle/components/FeedCard/useActivityInteractions.js.map +1 -1
  77. package/cjs-bundle/components/FeedCard/useFeedActivity.js +1 -1
  78. package/cjs-bundle/components/FeedCard/useFeedActivity.js.map +1 -1
  79. package/cjs-bundle/components/IconMenu/index.js +1 -1
  80. package/cjs-bundle/components/IconMenu/index.js.map +1 -1
  81. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  82. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  83. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  84. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  85. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  86. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  87. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  88. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  89. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  90. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  91. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  92. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  93. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  94. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  95. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  96. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  97. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  98. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  99. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  100. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  101. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  102. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  103. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  104. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  105. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  106. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  107. package/cjs-bundle/components/index.js +1 -1
  108. package/cjs-bundle/componentsV2/AppContainer/AppContainer.scss.js +1 -1
  109. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
  110. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
  111. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
  112. package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
  113. package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js +1 -1
  114. package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
  115. package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
  116. package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
  117. package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
  118. package/cjs-bundle/componentsV2/Checkbox/Checkbox.js +1 -1
  119. package/cjs-bundle/componentsV2/Checkbox/Checkbox.js.map +1 -1
  120. package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
  121. package/cjs-bundle/componentsV2/Menu/Menu.scss.js +1 -1
  122. package/cjs-bundle/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
  123. package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
  124. package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
  125. package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
  126. package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
  127. package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
  128. package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
  129. package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
  130. package/cjs-bundle/componentsV2/Paper/Paper.js +1 -1
  131. package/cjs-bundle/componentsV2/Paper/Paper.js.map +1 -1
  132. package/cjs-bundle/componentsV2/Paper/Paper.scss.js +1 -1
  133. package/cjs-bundle/componentsV2/Popover/Popover.js +1 -1
  134. package/cjs-bundle/componentsV2/Popover/Popover.js.map +1 -1
  135. package/cjs-bundle/componentsV2/Radio/Radio.js +1 -1
  136. package/cjs-bundle/componentsV2/Radio/Radio.js.map +1 -1
  137. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
  138. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
  139. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
  140. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
  141. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
  142. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
  143. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
  144. package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
  145. package/cjs-bundle/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
  146. package/cjs-bundle/componentsV2/Tabs/Tabs.js +1 -1
  147. package/cjs-bundle/componentsV2/Tabs/Tabs.js.map +1 -1
  148. package/cjs-bundle/componentsV2/Tabs/Tabs.scss.js +1 -1
  149. package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
  150. package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
  151. package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
  152. package/cjs-bundle/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
  153. package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
  154. package/cjs-bundle/config/theme/checkboxOverrides.js +1 -1
  155. package/cjs-bundle/config/theme/checkboxOverrides.js.map +1 -1
  156. package/cjs-bundle/config/theme/index.js +1 -1
  157. package/cjs-bundle/config/theme/index.js.map +1 -1
  158. package/cjs-bundle/config/theme/radioOverrides.js +1 -1
  159. package/cjs-bundle/config/theme/radioOverrides.js.map +1 -1
  160. package/cjs-bundle/constants/attachments.js +2 -0
  161. package/cjs-bundle/constants/attachments.js.map +1 -0
  162. package/cjs-bundle/constants/index.js +1 -1
  163. package/components/AddComment/Popover.js +1 -1
  164. package/components/AddComment/Popover.js.map +1 -1
  165. package/components/AddComment/components/Content.js +1 -1
  166. package/components/AddComment/components/Content.js.map +1 -1
  167. package/components/AttachFileButton/AttachFileButton.d.ts +2 -1
  168. package/components/AttachFileButton/AttachFileButton.d.ts.map +1 -1
  169. package/components/AttachFileButton/AttachFileButton.js +1 -1
  170. package/components/AttachFileButton/AttachFileButton.js.map +1 -1
  171. package/components/AttachmentPreview/AttachmentPreview.d.ts +4 -0
  172. package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
  173. package/components/AttachmentPreview/AttachmentPreview.js +1 -1
  174. package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  175. package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  176. package/components/AttachmentPreview/AttachmentPreview.types.d.ts +2 -0
  177. package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
  178. package/components/AttachmentPreview/AttachmentRow.d.ts +5 -0
  179. package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -0
  180. package/components/AttachmentPreview/AttachmentRow.js +2 -0
  181. package/components/AttachmentPreview/AttachmentRow.js.map +1 -0
  182. package/components/AttachmentPreview/AttachmentTile.d.ts +9 -0
  183. package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -0
  184. package/components/AttachmentPreview/AttachmentTile.js +2 -0
  185. package/components/AttachmentPreview/AttachmentTile.js.map +1 -0
  186. package/components/AttachmentPreview/SortableAttachments.d.ts +8 -0
  187. package/components/AttachmentPreview/SortableAttachments.d.ts.map +1 -0
  188. package/components/AttachmentPreview/SortableAttachments.js +2 -0
  189. package/components/AttachmentPreview/SortableAttachments.js.map +1 -0
  190. package/components/AttachmentPreview/StoredAttachmentPreview.d.ts +3 -3
  191. package/components/AttachmentPreview/StoredAttachmentPreview.d.ts.map +1 -1
  192. package/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
  193. package/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
  194. package/components/AttachmentPreview/index.d.ts +3 -0
  195. package/components/AttachmentPreview/index.d.ts.map +1 -1
  196. package/components/AttachmentPreview/useStoredAttachments.d.ts +8 -0
  197. package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -0
  198. package/components/AttachmentPreview/useStoredAttachments.js +2 -0
  199. package/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
  200. package/components/BICOffsetPickerDialog/index.js +1 -1
  201. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  202. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  203. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  204. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  205. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  206. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  207. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  208. package/components/CommentCard/CommentCard.d.ts.map +1 -1
  209. package/components/CommentCard/CommentCard.js +1 -1
  210. package/components/CommentCard/CommentCard.js.map +1 -1
  211. package/components/CommentCard/CommentCard.types.d.ts +5 -1
  212. package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
  213. package/components/CommentCard/CommentCardReplies.js +1 -1
  214. package/components/CommentCard/CommentCardReplies.js.map +1 -1
  215. package/components/CommentCard/__tests__/buildCommentReply.test.d.ts +2 -0
  216. package/components/CommentCard/__tests__/buildCommentReply.test.d.ts.map +1 -0
  217. package/components/CommentCard/buildCommentReply.d.ts +15 -7
  218. package/components/CommentCard/buildCommentReply.d.ts.map +1 -1
  219. package/components/CommentCard/buildCommentReply.js +1 -1
  220. package/components/CommentCard/buildCommentReply.js.map +1 -1
  221. package/components/CommentComposer/CommentComposer.d.ts +8 -3
  222. package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
  223. package/components/CommentComposer/CommentComposer.js +1 -1
  224. package/components/CommentComposer/CommentComposer.js.map +1 -1
  225. package/components/CommentComposer/CommentReplyInput.d.ts +6 -2
  226. package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
  227. package/components/CommentComposer/CommentReplyInput.js +1 -1
  228. package/components/CommentComposer/CommentReplyInput.js.map +1 -1
  229. package/components/CommentComposer/useAttachmentUpload.d.ts +15 -6
  230. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  231. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  232. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  233. package/components/CommentInputNext/CommentInputNext.d.ts +6 -0
  234. package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
  235. package/components/CommentInputNext/CommentInputNext.js +1 -1
  236. package/components/CommentInputNext/CommentInputNext.js.map +1 -1
  237. package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
  238. package/components/CommentInputNext/useFileDrop.d.ts +17 -0
  239. package/components/CommentInputNext/useFileDrop.d.ts.map +1 -0
  240. package/components/CommentInputNext/useFileDrop.js +2 -0
  241. package/components/CommentInputNext/useFileDrop.js.map +1 -0
  242. package/components/DocumentViewer/DocumentViewer.js +1 -1
  243. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  244. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  245. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  246. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  247. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  248. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  249. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  250. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  251. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  252. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  253. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  254. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  255. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  256. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  257. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  258. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  259. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  260. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  261. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  262. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  263. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  264. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  265. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  266. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  267. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  268. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  269. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  270. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  271. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  272. package/components/FeedCard/useActivityInteractions.d.ts +9 -2
  273. package/components/FeedCard/useActivityInteractions.d.ts.map +1 -1
  274. package/components/FeedCard/useActivityInteractions.js +1 -1
  275. package/components/FeedCard/useActivityInteractions.js.map +1 -1
  276. package/components/FeedCard/useFeedActivity.d.ts.map +1 -1
  277. package/components/FeedCard/useFeedActivity.js +1 -1
  278. package/components/FeedCard/useFeedActivity.js.map +1 -1
  279. package/components/IconMenu/index.d.ts +1 -1
  280. package/components/IconMenu/index.js +1 -1
  281. package/components/IconMenu/index.js.map +1 -1
  282. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  283. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  284. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  285. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  286. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  287. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  288. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  289. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  290. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  291. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  292. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  293. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  294. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  295. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  296. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  297. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  298. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  299. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  300. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  301. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  302. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  303. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  304. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  305. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  306. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  307. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  308. package/components/index.d.ts +2 -0
  309. package/components/index.d.ts.map +1 -1
  310. package/components/index.js +1 -1
  311. package/componentsV2/AppContainer/AppContainer.scss.js +1 -1
  312. package/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
  313. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.d.ts.map +1 -1
  314. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
  315. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
  316. package/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
  317. package/componentsV2/Autocomplete/Autocomplete.d.ts +5 -1
  318. package/componentsV2/Autocomplete/Autocomplete.d.ts.map +1 -1
  319. package/componentsV2/Autocomplete/Autocomplete.js +1 -1
  320. package/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
  321. package/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
  322. package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts +7 -3
  323. package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts.map +1 -1
  324. package/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
  325. package/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
  326. package/componentsV2/Autocomplete/AutocompleteNext.stories.d.ts.map +1 -1
  327. package/componentsV2/Checkbox/Checkbox.d.ts.map +1 -1
  328. package/componentsV2/Checkbox/Checkbox.js +1 -1
  329. package/componentsV2/Checkbox/Checkbox.js.map +1 -1
  330. package/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
  331. package/componentsV2/Menu/Menu.scss.js +1 -1
  332. package/componentsV2/Menu/Menu.stories.d.ts +1 -0
  333. package/componentsV2/Menu/Menu.stories.d.ts.map +1 -1
  334. package/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
  335. package/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
  336. package/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
  337. package/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
  338. package/componentsV2/Menu/MenuItem/MenuItem.d.ts +2 -0
  339. package/componentsV2/Menu/MenuItem/MenuItem.d.ts.map +1 -1
  340. package/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
  341. package/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
  342. package/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
  343. package/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
  344. package/componentsV2/Paper/Paper.d.ts.map +1 -1
  345. package/componentsV2/Paper/Paper.js +1 -1
  346. package/componentsV2/Paper/Paper.js.map +1 -1
  347. package/componentsV2/Paper/Paper.scss.js +1 -1
  348. package/componentsV2/Popover/Popover.d.ts.map +1 -1
  349. package/componentsV2/Popover/Popover.js +1 -1
  350. package/componentsV2/Popover/Popover.js.map +1 -1
  351. package/componentsV2/Radio/Radio.d.ts.map +1 -1
  352. package/componentsV2/Radio/Radio.js +1 -1
  353. package/componentsV2/Radio/Radio.js.map +1 -1
  354. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts +5 -0
  355. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts.map +1 -0
  356. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
  357. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
  358. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
  359. package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
  360. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts +2 -0
  361. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts.map +1 -0
  362. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
  363. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
  364. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
  365. package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
  366. package/componentsV2/RadioAndCheckboxIcons/index.d.ts +3 -0
  367. package/componentsV2/RadioAndCheckboxIcons/index.d.ts.map +1 -0
  368. package/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
  369. package/componentsV2/Tabs/Tabs.d.ts +1 -0
  370. package/componentsV2/Tabs/Tabs.d.ts.map +1 -1
  371. package/componentsV2/Tabs/Tabs.js +1 -1
  372. package/componentsV2/Tabs/Tabs.js.map +1 -1
  373. package/componentsV2/Tabs/Tabs.scss.js +1 -1
  374. package/componentsV2/Tabs/Tabs.stories.d.ts +1 -1
  375. package/componentsV2/Tabs/Tabs.stories.d.ts.map +1 -1
  376. package/componentsV2/TemplatesControl/ShareModal/ShareModal.d.ts.map +1 -1
  377. package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
  378. package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
  379. package/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
  380. package/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
  381. package/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
  382. package/config/theme/checkboxOverrides.d.ts +0 -9
  383. package/config/theme/checkboxOverrides.d.ts.map +1 -1
  384. package/config/theme/checkboxOverrides.js +1 -1
  385. package/config/theme/checkboxOverrides.js.map +1 -1
  386. package/config/theme/index.d.ts.map +1 -1
  387. package/config/theme/index.js +1 -1
  388. package/config/theme/index.js.map +1 -1
  389. package/config/theme/radioOverrides.d.ts +3 -15
  390. package/config/theme/radioOverrides.d.ts.map +1 -1
  391. package/config/theme/radioOverrides.js +1 -1
  392. package/config/theme/radioOverrides.js.map +1 -1
  393. package/constants/attachments.d.ts +2 -0
  394. package/constants/attachments.d.ts.map +1 -0
  395. package/constants/attachments.js +2 -0
  396. package/constants/attachments.js.map +1 -0
  397. package/constants/index.d.ts +2 -1
  398. package/constants/index.d.ts.map +1 -1
  399. package/constants/index.js +1 -1
  400. package/mcp-server/server.mjs +79 -11
  401. package/package.json +5 -1
  402. package/tsconfig.tsbuildinfo +1 -1
  403. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +0 -2
  404. package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
  405. package/components/AttachmentPreview/useStoredAttachment.js +0 -2
  406. package/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationPopup.js","sources":["../../../../../../src/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { Button, withStyles, makeStyles } from '@material-ui/core';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { Modal, Typography } from '~/components';\n\nconst StyledButton = withStyles({ root: { height: '36px' } })(Button);\nconst ClearAllButton = withStyles({ root: { margin: '0 16px 0 auto' } })(StyledButton);\nconst StyledText = withStyles({ root: { color: '#bdbdbd' } })(Typography.Regular16);\n\nexport const useStyles = makeStyles(theme => ({\n paper: {\n minWidth: ({ isMobile }) => (isMobile ? 0 : '416px'),\n minHeight: ({ isMobile }) => isMobile && '240px !important',\n maxWidth: ({ isMobile }) => isMobile && 'calc(100% - 24px)',\n },\n content: {\n width: ({ isMobile }) => (isMobile ? 'auto' : '300px'),\n color: theme.palette.primary.text6,\n },\n}));\n\nexport const ConfirmationPopup = ({ title, text, okText, handleClose, handleOk }) => {\n const styles = useStyles({ isMobile: isMobileDetected });\n\n return (\n <Modal\n open\n onClose={handleClose}\n title={title}\n isMobile={false}\n actions={\n <>\n <ClearAllButton color=\"primary\" onClick={handleClose}>\n Cancel\n </ClearAllButton>\n\n <StyledButton variant=\"contained\" color=\"primary\" onClick={handleOk}>\n {okText || 'OK'}\n </StyledButton>\n </>\n }\n contentContainerClassName={styles.paper}\n >\n <div className={styles.content}>\n <StyledText>{text}</StyledText>\n </div>\n </Modal>\n );\n};\n\nConfirmationPopup.propTypes = {\n title: PropTypes.string.isRequired,\n okText: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n handleClose: PropTypes.func.isRequired,\n handleOk: PropTypes.func.isRequired,\n};\n"],"names":["StyledButton","withStyles","root","height","Button","ClearAllButton","margin","StyledText","color","Typography","useStyles","makeStyles","theme","paper","minWidth","_ref","isMobile","minHeight","_ref2","maxWidth","_ref3","content","width","_ref4","palette","primary","text6","ConfirmationPopup","_ref5","title","text","okText","handleClose","handleOk","styles","isMobileDetected","_jsx","Modal","open","onClose","actions","_jsxs","_Fragment","children","onClick","variant","contentContainerClassName","className","propTypes","PropTypes","string","isRequired","func"],"mappings":"y98BAMA,IAAMA,EAAeC,EAAW,CAAEC,KAAM,CAAEC,OAAQ,SAA7BF,CAAyCG,GACxDC,EAAiBJ,EAAW,CAAEC,KAAM,CAAEI,OAAQ,kBAA7BL,CAAkDD,GACnEO,EAAaN,EAAW,CAAEC,KAAM,CAAEM,MAAO,YAA5BP,CAA2CQ,GAEjDC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CAC5CC,MAAO,CACLC,SAAU,SAAAC,GAAW,SAARC,SAA2B,EAAI,OAAQ,EACpDC,UAAW,SAAAC,GAAW,SAARF,UAA2B,kBAAkB,EAC3DG,SAAU,SAAAC,GAAW,SAARJ,UAA2B,mBAAmB,GAE7DK,QAAS,CACPC,MAAO,SAAAC,GAAW,SAARP,SAA2B,OAAS,OAAQ,EACtDR,MAAOI,EAAMY,QAAQC,QAAQC,OAEhC,IAEYC,EAAoB,SAAoDC,GAAA,IAAjDC,IAAAA,MAAOC,IAAAA,KAAMC,IAAAA,OAAQC,IAAAA,YAAaC,IAAAA,SAC9DC,EAASxB,EAAU,CAAEM,SAAUmB,IAErC,OACEC,EAACC,EAAK,CACJC,MAAI,EACJC,QAASP,EACTH,MAAOA,EACPb,UAAU,EACVwB,QACEC,EAAAC,EAAA,CAAAC,SAAA,CACEP,EAAC/B,EAAc,CAACG,MAAM,UAAUoC,QAASZ,EAAYW,SAAA,WAIrDP,EAACpC,EAAY,CAAC6C,QAAQ,YAAYrC,MAAM,UAAUoC,QAASX,EAASU,SACjEZ,GAAU,UAIjBe,0BAA2BZ,EAAOrB,MAAM8B,SAExCP,EAAA,MAAA,CAAKW,UAAWb,EAAOb,QAAQsB,SAC7BP,EAAC7B,EAAU,CAAAoC,SAAEb,OAIrB,EAEAH,EAAkBqB,UAAY,CAC5BnB,MAAOoB,EAAUC,OAAOC,WACxBpB,OAAQkB,EAAUC,OAAOC,WACzBrB,KAAMmB,EAAUC,OAAOC,WACvBnB,YAAaiB,EAAUG,KAAKD,WAC5BlB,SAAUgB,EAAUG,KAAKD"}
1
+ {"version":3,"file":"ConfirmationPopup.js","sources":["../../../../../../src/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { Button, withStyles, makeStyles } from '@material-ui/core';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { Modal, Typography } from '~/components';\n\nconst StyledButton = withStyles({ root: { height: '36px' } })(Button);\nconst ClearAllButton = withStyles({ root: { margin: '0 16px 0 auto' } })(StyledButton);\nconst StyledText = withStyles({ root: { color: '#bdbdbd' } })(Typography.Regular16);\n\nexport const useStyles = makeStyles(theme => ({\n paper: {\n minWidth: ({ isMobile }) => (isMobile ? 0 : '416px'),\n minHeight: ({ isMobile }) => isMobile && '240px !important',\n maxWidth: ({ isMobile }) => isMobile && 'calc(100% - 24px)',\n },\n content: {\n width: ({ isMobile }) => (isMobile ? 'auto' : '300px'),\n color: theme.palette.primary.text6,\n },\n}));\n\nexport const ConfirmationPopup = ({ title, text, okText, handleClose, handleOk }) => {\n const styles = useStyles({ isMobile: isMobileDetected });\n\n return (\n <Modal\n open\n onClose={handleClose}\n title={title}\n isMobile={false}\n actions={\n <>\n <ClearAllButton color=\"primary\" onClick={handleClose}>\n Cancel\n </ClearAllButton>\n\n <StyledButton variant=\"contained\" color=\"primary\" onClick={handleOk}>\n {okText || 'OK'}\n </StyledButton>\n </>\n }\n contentContainerClassName={styles.paper}\n >\n <div className={styles.content}>\n <StyledText>{text}</StyledText>\n </div>\n </Modal>\n );\n};\n\nConfirmationPopup.propTypes = {\n title: PropTypes.string.isRequired,\n okText: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n handleClose: PropTypes.func.isRequired,\n handleOk: PropTypes.func.isRequired,\n};\n"],"names":["StyledButton","withStyles","root","height","Button","ClearAllButton","margin","StyledText","color","Typography","useStyles","makeStyles","theme","paper","minWidth","_ref","isMobile","minHeight","_ref2","maxWidth","_ref3","content","width","_ref4","palette","primary","text6","ConfirmationPopup","_ref5","title","text","okText","handleClose","handleOk","styles","isMobileDetected","_jsx","Modal","open","onClose","actions","_jsxs","_Fragment","children","onClick","variant","contentContainerClassName","className","propTypes","PropTypes","string","isRequired","func"],"mappings":"ol9BAMA,IAAMA,EAAeC,EAAW,CAAEC,KAAM,CAAEC,OAAQ,SAA7BF,CAAyCG,GACxDC,EAAiBJ,EAAW,CAAEC,KAAM,CAAEI,OAAQ,kBAA7BL,CAAkDD,GACnEO,EAAaN,EAAW,CAAEC,KAAM,CAAEM,MAAO,YAA5BP,CAA2CQ,GAEjDC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CAC5CC,MAAO,CACLC,SAAU,SAAAC,GAAW,SAARC,SAA2B,EAAI,OAAQ,EACpDC,UAAW,SAAAC,GAAW,SAARF,UAA2B,kBAAkB,EAC3DG,SAAU,SAAAC,GAAW,SAARJ,UAA2B,mBAAmB,GAE7DK,QAAS,CACPC,MAAO,SAAAC,GAAW,SAARP,SAA2B,OAAS,OAAQ,EACtDR,MAAOI,EAAMY,QAAQC,QAAQC,OAEhC,IAEYC,EAAoB,SAAoDC,GAAA,IAAjDC,IAAAA,MAAOC,IAAAA,KAAMC,IAAAA,OAAQC,IAAAA,YAAaC,IAAAA,SAC9DC,EAASxB,EAAU,CAAEM,SAAUmB,IAErC,OACEC,EAACC,EAAK,CACJC,MAAI,EACJC,QAASP,EACTH,MAAOA,EACPb,UAAU,EACVwB,QACEC,EAAAC,EAAA,CAAAC,SAAA,CACEP,EAAC/B,EAAc,CAACG,MAAM,UAAUoC,QAASZ,EAAYW,SAAA,WAIrDP,EAACpC,EAAY,CAAC6C,QAAQ,YAAYrC,MAAM,UAAUoC,QAASX,EAASU,SACjEZ,GAAU,UAIjBe,0BAA2BZ,EAAOrB,MAAM8B,SAExCP,EAAA,MAAA,CAAKW,UAAWb,EAAOb,QAAQsB,SAC7BP,EAAC7B,EAAU,CAAAoC,SAAEb,OAIrB,EAEAH,EAAkBqB,UAAY,CAC5BnB,MAAOoB,EAAUC,OAAOC,WACxBpB,OAAQkB,EAAUC,OAAOC,WACzBrB,KAAMmB,EAAUC,OAAOC,WACvBnB,YAAaiB,EAAUG,KAAKD,WAC5BlB,SAAUgB,EAAUG,KAAKD"}
@@ -29,16 +29,23 @@ export type UseActivityInteractionsResult = {
29
29
  isReplyOpen: boolean;
30
30
  toggleReplyOpen: () => void;
31
31
  replies: CommentReply[];
32
+ editingReply: ActivityReply | null;
33
+ cancelReplyEdit: () => void;
34
+ updateReply: (replyId: string | number, body: string, attachments: {
35
+ url: string;
36
+ name: string;
37
+ size?: number;
38
+ }[]) => Promise<boolean>;
32
39
  hasMoreReplies: boolean;
33
40
  moreRepliesCount: number;
34
41
  showMoreReplies: () => void;
35
42
  toggleLike: () => Promise<void>;
36
43
  /** Resolves `false` when the post failed, so the composer can keep the draft. */
37
- postReply: (body: string, attachment?: {
44
+ postReply: (body: string, attachments?: {
38
45
  url: string;
39
46
  name: string;
40
47
  size?: number;
41
- } | null) => Promise<boolean>;
48
+ }[]) => Promise<boolean>;
42
49
  };
43
50
  export declare const useActivityInteractions: ({ activity, currentUser, onChanged, loadingState, }: UseActivityInteractionsOptions) => UseActivityInteractionsResult;
44
51
  //# sourceMappingURL=useActivityInteractions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useActivityInteractions.d.ts","sourceRoot":"","sources":["../../../src/components/FeedCard/useActivityInteractions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AASrE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,EAAE,CAAC;IAC9C,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B,CAAC;AAGF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,WAAW,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,YAAY,EAAE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AAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAC;CACnF,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,KACxD,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,iFAAiF;IACjF,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,KACzD,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,uBAAuB,wDAKjC,8BAA8B,KAAG,6BAsNnC,CAAC"}
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useRef as u,useCallback as o,useState as l,useMemo as c,useEffect as a}from"react";import s from"moment-timezone";import{buildCommentReply as f}from"../CommentCard/buildCommentReply.js";import{deleteFeedItemComment as p,toggleFeedItemLike as d,postFeedItemComment as m}from"../../clients/jsonApi/index.js";import{showErrorNotification as v,showSuccessNotification as h}from"../../utils/notificationToasts.js";function g(r,n){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable}))),e.push.apply(e,t)}return e}function b(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?g(Object(t),!0).forEach((function(e){r(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))}))}return n}var y=function(r){var g,y,S=r.activity,O=r.currentUser,w=r.onChanged,x=r.loadingState,j=u(w);j.current=w;var k=o((function(){var r;return null===(r=j.current)||void 0===r?void 0:r.call(j)}),[]),P=l(!1),C=t(P,2),R=C[0],A=C[1],D=x?x.isLoading:R,L=x?x.setIsLoading:A,M=l(!1),z=t(M,2),F=z[0],T=z[1],_=l(3),E=t(_,2),I=E[0],N=E[1],U=l([]),G=t(U,2),q=G[0],B=G[1],H=u(q);H.current=q;var J=l([]),K=t(J,2),Q=K[0],V=K[1],W=l(null),X=t(W,2),Y=X[0],Z=X[1],$=c((function(){var r;return null!==(r=null==S?void 0:S.comments)&&void 0!==r?r:[]}),[null==S?void 0:S.comments]),rr=c((function(){var r=new Set($.map((function(r){return String(r.id)}))),n=q.length?[].concat(e($),e(q.filter((function(n){return!r.has(String(n.id))})))):$;return Q.length?n.filter((function(r){return!Q.some((function(n){return String(n)===String(r.id)}))})):n}),[$,q,Q]);a((function(){if(q.length){var r=new Set($.map((function(r){return String(r.id)}))),n=q.filter((function(n){return!r.has(String(n.id))}));n.length!==q.length&&B(n)}}),[$,q]),a((function(){if(Q.length){var r=new Set($.map((function(r){return String(r.id)}))),n=Q.filter((function(n){return r.has(String(n))}));n.length!==Q.length&&V(n)}}),[$,Q]);var nr=(null!==(g=null==S?void 0:S.likes)&&void 0!==g?g:[]).some((function(r){var n;return Number(null===(n=r.user)||void 0===n?void 0:n.id)===Number(null==O?void 0:O.id)})),er=null!=Y?Y:nr,tr=null!==(y=null==S?void 0:S.likes_count)&&void 0!==y?y:0,ir=null===Y||Y===nr?tr:Math.max(0,tr+(Y?1:-1));a((function(){null!==Y&&Y===nr&&Z(null)}),[nr,Y]);var ur=function(){var r=n(i.mark((function r(){return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null!=(null==S?void 0:S.id)){r.next=2;break}return r.abrupt("return");case 2:return Z(!er),L(!0),r.prev=5,r.next=8,d(S.id);case 8:k(),r.next=15;break;case 11:r.prev=11,r.t0=r.catch(5),Z(null),v("Failed to update the like");case 15:return r.prev=15,L(!1),r.finish(15);case 18:case"end":return r.stop()}}),r,null,[[5,11,15,18]])})));return function(){return r.apply(this,arguments)}}(),or=function(){var r=n(i.mark((function r(n,t){var u,o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null!=(null==S?void 0:S.id)){r.next=2;break}return r.abrupt("return",!1);case 2:return L(!0),r.prev=3,u=b({body:n},t?{attachment:{url:t.url,size:t.size,file_name:t.name}}:{}),r.next=7,m(S.id,{comment:u});case 7:return null!=(o=r.sent)&&o.id&&B((function(r){return[].concat(e(r),[o])})),k(),r.abrupt("return",!0);case 13:return r.prev=13,r.t0=r.catch(3),v("Failed to post the reply"),r.abrupt("return",!1);case 17:return r.prev=17,L(!1),r.finish(17);case 20:case"end":return r.stop()}}),r,null,[[3,13,17,20]])})));return function(n,e){return r.apply(this,arguments)}}(),lr=o(function(){var r=n(i.mark((function r(n){var t;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null!=(null==S?void 0:S.id)){r.next=2;break}return r.abrupt("return");case 2:return L(!0),t=H.current.find((function(r){return String(r.id)===String(n)})),B((function(r){return r.filter((function(r){return String(r.id)!==String(n)}))})),V((function(r){return[].concat(e(r),[n])})),r.prev=6,r.next=9,p(S.id,n);case 9:k(),h("Reply was deleted"),r.next=18;break;case 13:r.prev=13,r.t0=r.catch(6),V((function(r){return r.filter((function(r){return String(r)!==String(n)}))})),t&&B((function(r){return[].concat(e(r),[t])})),v("Failed to delete the reply");case 18:return r.prev=18,L(!1),r.finish(18);case 21:case"end":return r.stop()}}),r,null,[[6,13,18,21]])})));return function(n){return r.apply(this,arguments)}}(),[null==S?void 0:S.id,k,L]),cr=c((function(){return rr.length?rr.map((function(r){return{reply:r,sortAt:s(r.created_at).unix()}})).sort((function(r,n){return n.sortAt-r.sortAt})).slice(0,I).map((function(r){var n=r.reply;return f(n,{currentUserId:null==O?void 0:O.id,onDelete:lr})})):[]}),[rr,I,lr,null==O?void 0:O.id]);return{isLoading:D,isLiked:er,likesCount:ir,commentsCount:rr.length,isReplyOpen:F,toggleReplyOpen:function(){return T((function(r){return!r}))},replies:cr,hasMoreReplies:rr.length>I,moreRepliesCount:Math.max(0,rr.length-I),showMoreReplies:function(){return N((function(r){return r+10}))},toggleLike:ur,postReply:or}};export{y as useActivityInteractions};
1
+ import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useRef as u,useCallback as o,useState as l,useMemo as a,useEffect as c}from"react";import s from"moment-timezone";import{buildCommentReply as p}from"../CommentCard/buildCommentReply.js";import{patchFeedItemComment as f,deleteFeedItemComment as d,toggleFeedItemLike as m,postFeedItemComment as v}from"../../clients/jsonApi/index.js";import{showErrorNotification as h,showSuccessNotification as g}from"../../utils/notificationToasts.js";function b(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.push.apply(r,e)}return r}function y(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?b(Object(e),!0).forEach((function(r){t(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var S=function(b){var S,w,x,O=b.activity,k=b.currentUser,j=b.onChanged,R=b.loadingState,P=u(j);P.current=j;var C=o((function(){var n;return null===(n=P.current)||void 0===n?void 0:n.call(P)}),[]),A=l(!1),z=e(A,2),D=z[0],L=z[1],E=R?R.isLoading:D,F=R?R.setIsLoading:L,M=l(!1),_=e(M,2),T=_[0],I=_[1],N=l(null),U=e(N,2),G=U[0],q=U[1],B=l(3),H=e(B,2),J=H[0],K=H[1],Q=l([]),V=e(Q,2),W=V[0],X=V[1],Y=l({}),Z=e(Y,2),$=Z[0],nn=Z[1],tn=u(W);tn.current=W;var rn=l([]),en=e(rn,2),un=en[0],on=en[1],ln=l(null),an=e(ln,2),cn=an[0],sn=an[1],pn=a((function(){var n;return null!==(n=null==O?void 0:O.comments)&&void 0!==n?n:[]}),[null==O?void 0:O.comments]),fn=a((function(){var n=new Set(pn.map((function(n){return String(n.id)}))),t=[].concat(r(pn.map((function(n){return y(y({},n),$[String(n.id)])}))),r(W.filter((function(t){return!n.has(String(t.id))}))));return un.length?t.filter((function(n){return!un.some((function(t){return String(t)===String(n.id)}))})):t}),[pn,W,$,un]);c((function(){if(W.length){var n=new Set(pn.map((function(n){return String(n.id)}))),t=W.filter((function(t){return!n.has(String(t.id))}));t.length!==W.length&&X(t)}}),[pn,W]),c((function(){if(un.length){var n=new Set(pn.map((function(n){return String(n.id)}))),t=un.filter((function(t){return n.has(String(t))}));t.length!==un.length&&on(t)}}),[pn,un]);var dn=(null!==(S=null==O?void 0:O.likes)&&void 0!==S?S:[]).some((function(n){var t;return Number(null===(t=n.user)||void 0===t?void 0:t.id)===Number(null==k?void 0:k.id)})),mn=null!=cn?cn:dn,vn=null!==(w=null==O?void 0:O.likes_count)&&void 0!==w?w:0,hn=null===cn||cn===dn?vn:Math.max(0,vn+(cn?1:-1));c((function(){null!==cn&&cn===dn&&sn(null)}),[dn,cn]);var gn=function(){var t=n(i.mark((function n(){return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=(null==O?void 0:O.id)){n.next=2;break}return n.abrupt("return");case 2:return sn(!mn),F(!0),n.prev=5,n.next=8,m(O.id);case 8:C(),n.next=15;break;case 11:n.prev=11,n.t0=n.catch(5),sn(null),h("Failed to update the like");case 15:return n.prev=15,F(!1),n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[5,11,15,18]])})));return function(){return t.apply(this,arguments)}}(),bn=function(){var t=n(i.mark((function n(t){var e,u,o,l,a=arguments;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=a.length>1&&void 0!==a[1]?a[1]:[],null!=(null==O?void 0:O.id)){n.next=3;break}return n.abrupt("return",!1);case 3:return F(!0),n.prev=4,u=e.map((function(n){return{url:n.url,size:n.size,file_name:n.name}})),o=y({body:t},u.length?{attachments:u,attachment:u[0]}:{}),n.next=9,v(O.id,{comment:o});case 9:return null!=(l=n.sent)&&l.id&&X((function(n){return[].concat(r(n),[l])})),C(),n.abrupt("return",!0);case 15:return n.prev=15,n.t0=n.catch(4),h("Failed to post the reply"),n.abrupt("return",!1);case 19:return n.prev=19,F(!1),n.finish(19);case 22:case"end":return n.stop()}}),n,null,[[4,15,19,22]])})));return function(n){return t.apply(this,arguments)}}(),yn=o(function(){var r=n(i.mark((function n(r,e,u){var o,l,a;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=(null==O?void 0:O.id)){n.next=2;break}return n.abrupt("return",!1);case 2:return F(!0),n.prev=3,l=u.map((function(n){return{url:n.url,size:n.size,file_name:n.name}})),a={body:e,attachments:l,attachment:null!==(o=l[0])&&void 0!==o?o:null},n.next=8,f(O.id,r,{comment:a});case 8:return nn((function(n){var i;return y(y({},n),{},t({},String(r),{body:e,attachments:l,attachment:null!==(i=l[0])&&void 0!==i?i:null}))})),q(null),C(),n.abrupt("return",!0);case 14:return n.prev=14,n.t0=n.catch(3),h("Failed to update the reply"),n.abrupt("return",!1);case 18:return n.prev=18,F(!1),n.finish(18);case 21:case"end":return n.stop()}}),n,null,[[3,14,18,21]])})));return function(n,t,e){return r.apply(this,arguments)}}(),[null==O?void 0:O.id,C,F]),Sn=o(function(){var t=n(i.mark((function n(t){var e;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=(null==O?void 0:O.id)){n.next=2;break}return n.abrupt("return");case 2:return F(!0),e=tn.current.find((function(n){return String(n.id)===String(t)})),X((function(n){return n.filter((function(n){return String(n.id)!==String(t)}))})),on((function(n){return[].concat(r(n),[t])})),n.prev=6,n.next=9,d(O.id,t);case 9:C(),g("Reply was deleted"),n.next=18;break;case 13:n.prev=13,n.t0=n.catch(6),on((function(n){return n.filter((function(n){return String(n)!==String(t)}))})),e&&X((function(n){return[].concat(r(n),[e])})),h("Failed to delete the reply");case 18:return n.prev=18,F(!1),n.finish(18);case 21:case"end":return n.stop()}}),n,null,[[6,13,18,21]])})));return function(n){return t.apply(this,arguments)}}(),[null==O?void 0:O.id,C,F]),wn=a((function(){return fn.length?fn.map((function(n){return{reply:n,sortAt:s(n.created_at).unix()}})).sort((function(n,t){return t.sortAt-n.sortAt})).slice(0,J).map((function(n){var t=n.reply;return p(t,{currentUserId:null==k?void 0:k.id,onDelete:Sn,onEdit:q})})):[]}),[fn,J,Sn,null==k?void 0:k.id]);return{isLoading:E,isLiked:mn,likesCount:hn,commentsCount:fn.length,isReplyOpen:T,toggleReplyOpen:function(){return I((function(n){return!n}))},replies:wn,editingReply:null!==(x=fn.find((function(n){return String(n.id)===String(G)})))&&void 0!==x?x:null,cancelReplyEdit:function(){return q(null)},hasMoreReplies:fn.length>J,moreRepliesCount:Math.max(0,fn.length-J),showMoreReplies:function(){return K((function(n){return n+10}))},toggleLike:gn,postReply:bn,updateReply:yn}};export{S as useActivityInteractions};
2
2
  //# sourceMappingURL=useActivityInteractions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useActivityInteractions.js","sources":["../../../src/components/FeedCard/useActivityInteractions.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport moment from 'moment-timezone';\n\nimport type { ActivityReply } from '../CommentCard/buildCommentReply';\nimport { buildCommentReply } from '../CommentCard/buildCommentReply';\nimport type { CommentReply } from '../CommentCard/CommentCard.types';\n\nimport { deleteFeedItemComment, postFeedItemComment, toggleFeedItemLike } from '~/clients/jsonApi';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\n\nconst INITIAL_VISIBLE_REPLIES = 3;\nconst MORE_REPLIES_INCREMENT = 10;\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\nexport type InteractionActivity = {\n id?: string | number;\n likes_count?: number;\n likes?: { user?: { id?: string | number } }[];\n comments?: ActivityReply[];\n};\n/* eslint-enable camelcase */\n\nexport type UseActivityInteractionsOptions = {\n activity: InteractionActivity;\n currentUser: { id?: string | number };\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n};\n\nexport type UseActivityInteractionsResult = {\n isLoading: boolean;\n isLiked: boolean;\n likesCount: number;\n commentsCount: number;\n isReplyOpen: boolean;\n toggleReplyOpen: () => void;\n replies: CommentReply[];\n hasMoreReplies: boolean;\n moreRepliesCount: number;\n showMoreReplies: () => void;\n toggleLike: () => Promise<void>;\n /** Resolves `false` when the post failed, so the composer can keep the draft. */\n postReply: (\n body: string,\n attachment?: { url: string; name: string; size?: number } | null\n ) => Promise<boolean>;\n};\n\n// Optimistic like / reply / reply-delete, reconciled once the host's refetch lands.\nexport const useActivityInteractions = ({\n activity,\n currentUser,\n onChanged,\n loadingState,\n}: UseActivityInteractionsOptions): UseActivityInteractionsResult => {\n // Read through a ref so an inline callback doesn't invalidate the memoized replies.\n const onChangedRef = useRef(onChanged);\n onChangedRef.current = onChanged;\n const notifyChanged = useCallback(() => onChangedRef.current?.(), []);\n\n const [localIsLoading, setLocalIsLoading] = useState(false);\n const isLoading = loadingState ? loadingState.isLoading : localIsLoading;\n const setIsLoading = loadingState ? loadingState.setIsLoading : setLocalIsLoading;\n\n const [isReplyOpen, setIsReplyOpen] = useState(false);\n const [visibleReplies, setVisibleReplies] = useState(INITIAL_VISIBLE_REPLIES);\n const [optimisticReplies, setOptimisticReplies] = useState<ActivityReply[]>([]);\n // Read through a ref so deleting a reply doesn't have to re-create its memoized handler.\n const optimisticRepliesRef = useRef(optimisticReplies);\n optimisticRepliesRef.current = optimisticReplies;\n const [deletedReplyIds, setDeletedReplyIds] = useState<(string | number)[]>([]);\n const [optimisticLiked, setOptimisticLiked] = useState<boolean | null>(null);\n\n const serverReplies = useMemo(() => activity?.comments ?? [], [activity?.comments]);\n const replies = useMemo(() => {\n // Ids arrive as string or number, so compare them as strings.\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const merged = optimisticReplies.length\n ? [...serverReplies, ...optimisticReplies.filter(reply => !serverIds.has(String(reply.id)))]\n : serverReplies;\n\n if (!deletedReplyIds.length) return merged;\n\n return merged.filter(reply => !deletedReplyIds.some(id => String(id) === String(reply.id)));\n }, [serverReplies, optimisticReplies, deletedReplyIds]);\n\n useEffect(() => {\n if (!optimisticReplies.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPending = optimisticReplies.filter(reply => !serverIds.has(String(reply.id)));\n if (stillPending.length !== optimisticReplies.length) setOptimisticReplies(stillPending);\n }, [serverReplies, optimisticReplies]);\n\n // Drop a deleted id once the refetch has removed it server-side.\n useEffect(() => {\n if (!deletedReplyIds.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPresent = deletedReplyIds.filter(id => serverIds.has(String(id)));\n if (stillPresent.length !== deletedReplyIds.length) setDeletedReplyIds(stillPresent);\n }, [serverReplies, deletedReplyIds]);\n\n const serverLiked = (activity?.likes ?? []).some(\n like => Number(like.user?.id) === Number(currentUser?.id)\n );\n const isLiked = optimisticLiked ?? serverLiked;\n const serverLikesCount = activity?.likes_count ?? 0;\n // Clamp: a stale likes array (count 0 while already liked) would render < 0.\n const likesCount =\n optimisticLiked === null || optimisticLiked === serverLiked\n ? serverLikesCount\n : Math.max(0, serverLikesCount + (optimisticLiked ? 1 : -1));\n\n useEffect(() => {\n if (optimisticLiked !== null && optimisticLiked === serverLiked) setOptimisticLiked(null);\n }, [serverLiked, optimisticLiked]);\n\n const toggleLike = async () => {\n if (activity?.id == null) return;\n const next = !isLiked;\n setOptimisticLiked(next);\n setIsLoading(true);\n try {\n await toggleFeedItemLike(activity.id);\n notifyChanged();\n } catch (err) {\n setOptimisticLiked(null);\n showErrorNotification('Failed to update the like');\n } finally {\n setIsLoading(false);\n }\n };\n\n const postReply = async (\n body: string,\n attachment?: { url: string; name: string; size?: number } | null\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const comment = {\n body,\n ...(attachment\n ? {\n attachment: {\n url: attachment.url,\n size: attachment.size,\n file_name: attachment.name,\n },\n }\n : {}),\n };\n const created = await postFeedItemComment(activity.id, { comment });\n if (created?.id) setOptimisticReplies(prev => [...prev, created]);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to post the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n };\n\n const deleteReply = useCallback(\n async (replyId: string | number) => {\n if (activity?.id == null) return;\n setIsLoading(true);\n // A reply posted in this session is not in the server list yet, so hiding it by id alone\n // would be undone by the reconciliation above: drop the local copy as well.\n const pendingCopy = optimisticRepliesRef.current.find(\n reply => String(reply.id) === String(replyId)\n );\n setOptimisticReplies(prev => prev.filter(reply => String(reply.id) !== String(replyId)));\n setDeletedReplyIds(prev => [...prev, replyId]); // hide immediately; the refetch drops it a moment later\n try {\n await deleteFeedItemComment(activity.id, replyId);\n notifyChanged();\n showSuccessNotification('Reply was deleted');\n } catch (err) {\n setDeletedReplyIds(prev => prev.filter(id => String(id) !== String(replyId)));\n if (pendingCopy) setOptimisticReplies(prev => [...prev, pendingCopy]);\n showErrorNotification('Failed to delete the reply');\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const mappedReplies = useMemo<CommentReply[]>(() => {\n if (!replies.length) return [];\n\n return replies\n .map(reply => ({ reply, sortAt: moment(reply.created_at).unix() }))\n .sort((a, b) => b.sortAt - a.sortAt)\n .slice(0, visibleReplies)\n .map(({ reply }) =>\n buildCommentReply(reply, { currentUserId: currentUser?.id, onDelete: deleteReply })\n );\n }, [replies, visibleReplies, deleteReply, currentUser?.id]);\n\n return {\n isLoading,\n isLiked,\n likesCount,\n commentsCount: replies.length,\n isReplyOpen,\n toggleReplyOpen: () => setIsReplyOpen(open => !open),\n replies: mappedReplies,\n hasMoreReplies: replies.length > visibleReplies,\n moreRepliesCount: Math.max(0, replies.length - visibleReplies),\n showMoreReplies: () => setVisibleReplies(prev => prev + MORE_REPLIES_INCREMENT),\n toggleLike,\n postReply,\n };\n};\n"],"names":["useActivityInteractions","_ref","_activity$likes","_activity$likes_count","activity","currentUser","onChanged","loadingState","onChangedRef","useRef","current","notifyChanged","useCallback","_onChangedRef$current","call","useState","_useState2","_slicedToArray","_useState","localIsLoading","setLocalIsLoading","isLoading","setIsLoading","_useState4","_useState3","isReplyOpen","setIsReplyOpen","_useState6","_useState5","visibleReplies","setVisibleReplies","_useState8","_useState7","optimisticReplies","setOptimisticReplies","optimisticRepliesRef","_useState10","_useState9","deletedReplyIds","setDeletedReplyIds","_useState12","_useState11","optimisticLiked","setOptimisticLiked","serverReplies","useMemo","_activity$comments","comments","replies","serverIds","Set","map","reply","String","id","merged","length","concat","_toConsumableArray","filter","has","some","useEffect","stillPending","stillPresent","serverLiked","likes","like","_like$user","Number","user","isLiked","serverLikesCount","likes_count","likesCount","Math","max","toggleLike","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","toggleFeedItemLike","t0","showErrorNotification","finish","stop","apply","this","arguments","postReply","_ref3","_callee2","body","attachment","comment","created","_context2","_objectSpread","url","size","file_name","name","postFeedItemComment","sent","_x","_x2","deleteReply","_ref4","replyId","pendingCopy","_context3","find","deleteFeedItemComment","showSuccessNotification","_callee3","_x3","mappedReplies","sortAt","moment","created_at","unix","sort","a","b","slice","_ref5","buildCommentReply","currentUserId","onDelete","commentsCount","toggleReplyOpen","open","hasMoreReplies","moreRepliesCount","showMoreReplies"],"mappings":"iuCAUA,IAuCaA,EAA0B,SAK8BC,GAAA,IAAAC,EAAAC,EAJnEC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,aAGMC,EAAeC,EAAOH,GAC5BE,EAAaE,QAAUJ,EACvB,IAAMK,EAAgBC,GAAY,WAAA,IAAAC,EAAA,OAAM,QAANA,EAAML,EAAaE,eAAb,IAAAG,OAAA,EAAAA,EAAAC,KAAAN,EAAwB,GAAE,IAEtBO,EAAAA,GAAS,GAAMC,EAAAC,EAAAC,EAAA,GAApDC,EAAcH,EAAA,GAAEI,EAAiBJ,EAAA,GAClCK,EAAYd,EAAeA,EAAac,UAAYF,EACpDG,EAAef,EAAeA,EAAae,aAAeF,EAE1BL,EAAAA,GAAS,GAAMQ,EAAAN,EAAAO,EAAA,GAA9CC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GACUR,EAAAA,EAvDd,GAuD+CY,EAAAV,EAAAW,EAAA,GAAtEC,EAAcF,EAAA,GAAEG,EAAiBH,EAAA,GACUZ,EAAAA,EAA0B,IAAGgB,EAAAd,EAAAe,EAAA,GAAxEC,EAAiBF,EAAA,GAAEG,EAAoBH,EAAA,GAExCI,EAAuB1B,EAAOwB,GACpCE,EAAqBzB,QA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A,OAAA,SAAAC,GAAA,OAAAR,EAAArB,MAAAC,KAAAC,UAAA,CAAA,CAtB4B,GAuB7B,CAAC3F,aAAAA,EAAAA,EAAUkD,GAAI3C,EAAeW,IAG1BqG,GAAgB9E,GAAwB,WAC5C,OAAKG,GAAQQ,OAENR,GACJG,KAAI,SAAAC,GAAK,MAAK,CAAEA,MAAAA,EAAOwE,OAAQC,EAAOzE,EAAM0E,YAAYC,OAAS,IACjEC,MAAK,SAACC,EAAGC,GAAC,OAAKA,EAAEN,OAASK,EAAEL,UAC5BO,MAAM,EAAGtG,GACTsB,KAAI,SAAAiF,GAAA,IAAGhF,IAAAA,MAAK,OACXiF,EAAkBjF,EAAO,CAAEkF,cAAejI,aAAAA,EAAAA,EAAaiD,GAAIiF,SAAUtB,QAP7C,EAS7B,GAAE,CAACjE,GAASnB,EAAgBoF,GAAa5G,aAAAA,EAAAA,EAAaiD,KAEvD,MAAO,CACLjC,UAAAA,EACAkD,QAAAA,GACAG,WAAAA,GACA8D,cAAexF,GAAQQ,OACvB/B,YAAAA,EACAgH,gBAAiB,WAAA,OAAM/G,GAAe,SAAAgH,GAAI,OAAKA,IAAK,EACpD1F,QAAS2E,GACTgB,eAAgB3F,GAAQQ,OAAS3B,EACjC+G,iBAAkBjE,KAAKC,IAAI,EAAG5B,GAAQQ,OAAS3B,GAC/CgH,gBAAiB,WAAA,OAAM/G,GAAkB,SAAAuD,GAAI,OAAIA,EA1MtB,KA0MoD,EAC/ER,WAAAA,GACAmB,UAAAA,GAEJ"}
1
+ {"version":3,"file":"useActivityInteractions.js","sources":["../../../src/components/FeedCard/useActivityInteractions.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport moment from 'moment-timezone';\n\nimport type { ActivityReply } from '../CommentCard/buildCommentReply';\nimport { buildCommentReply } from '../CommentCard/buildCommentReply';\nimport type { CommentReply } from '../CommentCard/CommentCard.types';\n\nimport {\n deleteFeedItemComment,\n patchFeedItemComment,\n postFeedItemComment,\n toggleFeedItemLike,\n} from '~/clients/jsonApi';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\n\nconst INITIAL_VISIBLE_REPLIES = 3;\nconst MORE_REPLIES_INCREMENT = 10;\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\nexport type InteractionActivity = {\n id?: string | number;\n likes_count?: number;\n likes?: { user?: { id?: string | number } }[];\n comments?: ActivityReply[];\n};\n/* eslint-enable camelcase */\n\nexport type UseActivityInteractionsOptions = {\n activity: InteractionActivity;\n currentUser: { id?: string | number };\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n};\n\nexport type UseActivityInteractionsResult = {\n isLoading: boolean;\n isLiked: boolean;\n likesCount: number;\n commentsCount: number;\n isReplyOpen: boolean;\n toggleReplyOpen: () => void;\n replies: CommentReply[];\n editingReply: ActivityReply | null;\n cancelReplyEdit: () => void;\n updateReply: (\n replyId: string | number,\n body: string,\n attachments: { url: string; name: string; size?: number }[]\n ) => Promise<boolean>;\n hasMoreReplies: boolean;\n moreRepliesCount: number;\n showMoreReplies: () => void;\n toggleLike: () => Promise<void>;\n /** Resolves `false` when the post failed, so the composer can keep the draft. */\n postReply: (\n body: string,\n attachments?: { url: string; name: string; size?: number }[]\n ) => Promise<boolean>;\n};\n\n// Optimistic like / reply / reply-delete, reconciled once the host's refetch lands.\nexport const useActivityInteractions = ({\n activity,\n currentUser,\n onChanged,\n loadingState,\n}: UseActivityInteractionsOptions): UseActivityInteractionsResult => {\n // Read through a ref so an inline callback doesn't invalidate the memoized replies.\n const onChangedRef = useRef(onChanged);\n onChangedRef.current = onChanged;\n const notifyChanged = useCallback(() => onChangedRef.current?.(), []);\n\n const [localIsLoading, setLocalIsLoading] = useState(false);\n const isLoading = loadingState ? loadingState.isLoading : localIsLoading;\n const setIsLoading = loadingState ? loadingState.setIsLoading : setLocalIsLoading;\n\n const [isReplyOpen, setIsReplyOpen] = useState(false);\n const [editingReplyId, setEditingReplyId] = useState<string | number | null>(null);\n const [visibleReplies, setVisibleReplies] = useState(INITIAL_VISIBLE_REPLIES);\n const [optimisticReplies, setOptimisticReplies] = useState<ActivityReply[]>([]);\n const [updatedReplies, setUpdatedReplies] = useState<Record<string, Partial<ActivityReply>>>({});\n // Read through a ref so deleting a reply doesn't have to re-create its memoized handler.\n const optimisticRepliesRef = useRef(optimisticReplies);\n optimisticRepliesRef.current = optimisticReplies;\n const [deletedReplyIds, setDeletedReplyIds] = useState<(string | number)[]>([]);\n const [optimisticLiked, setOptimisticLiked] = useState<boolean | null>(null);\n\n const serverReplies = useMemo(() => activity?.comments ?? [], [activity?.comments]);\n const replies = useMemo(() => {\n // Ids arrive as string or number, so compare them as strings.\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const merged = [\n ...serverReplies.map(reply => ({ ...reply, ...updatedReplies[String(reply.id)] })),\n ...optimisticReplies.filter(reply => !serverIds.has(String(reply.id))),\n ];\n\n if (!deletedReplyIds.length) return merged;\n\n return merged.filter(reply => !deletedReplyIds.some(id => String(id) === String(reply.id)));\n }, [serverReplies, optimisticReplies, updatedReplies, deletedReplyIds]);\n\n useEffect(() => {\n if (!optimisticReplies.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPending = optimisticReplies.filter(reply => !serverIds.has(String(reply.id)));\n if (stillPending.length !== optimisticReplies.length) setOptimisticReplies(stillPending);\n }, [serverReplies, optimisticReplies]);\n\n // Drop a deleted id once the refetch has removed it server-side.\n useEffect(() => {\n if (!deletedReplyIds.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPresent = deletedReplyIds.filter(id => serverIds.has(String(id)));\n if (stillPresent.length !== deletedReplyIds.length) setDeletedReplyIds(stillPresent);\n }, [serverReplies, deletedReplyIds]);\n\n const serverLiked = (activity?.likes ?? []).some(\n like => Number(like.user?.id) === Number(currentUser?.id)\n );\n const isLiked = optimisticLiked ?? serverLiked;\n const serverLikesCount = activity?.likes_count ?? 0;\n // Clamp: a stale likes array (count 0 while already liked) would render < 0.\n const likesCount =\n optimisticLiked === null || optimisticLiked === serverLiked\n ? serverLikesCount\n : Math.max(0, serverLikesCount + (optimisticLiked ? 1 : -1));\n\n useEffect(() => {\n if (optimisticLiked !== null && optimisticLiked === serverLiked) setOptimisticLiked(null);\n }, [serverLiked, optimisticLiked]);\n\n const toggleLike = async () => {\n if (activity?.id == null) return;\n const next = !isLiked;\n setOptimisticLiked(next);\n setIsLoading(true);\n try {\n await toggleFeedItemLike(activity.id);\n notifyChanged();\n } catch (err) {\n setOptimisticLiked(null);\n showErrorNotification('Failed to update the like');\n } finally {\n setIsLoading(false);\n }\n };\n\n const postReply = async (\n body: string,\n attachments: { url: string; name: string; size?: number }[] = []\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const files = attachments.map(file => ({\n url: file.url,\n size: file.size,\n file_name: file.name,\n }));\n // `attachment` mirrors the first file for clients still reading the legacy field.\n const comment = {\n body,\n ...(files.length ? { attachments: files, attachment: files[0] } : {}),\n };\n const created = await postFeedItemComment(activity.id, { comment });\n if (created?.id) setOptimisticReplies(prev => [...prev, created]);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to post the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n };\n\n const updateReply = useCallback(\n async (\n replyId: string | number,\n body: string,\n attachments: { url: string; name: string; size?: number }[]\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const files = attachments.map(file => ({\n url: file.url,\n size: file.size,\n file_name: file.name,\n }));\n const comment = {\n body,\n attachments: files,\n attachment: files[0] ?? null,\n };\n await patchFeedItemComment(activity.id, replyId, { comment });\n setUpdatedReplies(prev => ({\n ...prev,\n [String(replyId)]: {\n body,\n attachments: files,\n attachment: files[0] ?? null,\n },\n }));\n setEditingReplyId(null);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to update the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const deleteReply = useCallback(\n async (replyId: string | number) => {\n if (activity?.id == null) return;\n setIsLoading(true);\n // A reply posted in this session is not in the server list yet, so hiding it by id alone\n // would be undone by the reconciliation above: drop the local copy as well.\n const pendingCopy = optimisticRepliesRef.current.find(\n reply => String(reply.id) === String(replyId)\n );\n setOptimisticReplies(prev => prev.filter(reply => String(reply.id) !== String(replyId)));\n setDeletedReplyIds(prev => [...prev, replyId]); // hide immediately; the refetch drops it a moment later\n try {\n await deleteFeedItemComment(activity.id, replyId);\n notifyChanged();\n showSuccessNotification('Reply was deleted');\n } catch (err) {\n setDeletedReplyIds(prev => prev.filter(id => String(id) !== String(replyId)));\n if (pendingCopy) setOptimisticReplies(prev => [...prev, pendingCopy]);\n showErrorNotification('Failed to delete the reply');\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const mappedReplies = useMemo<CommentReply[]>(() => {\n if (!replies.length) return [];\n\n return replies\n .map(reply => ({ reply, sortAt: moment(reply.created_at).unix() }))\n .sort((a, b) => b.sortAt - a.sortAt)\n .slice(0, visibleReplies)\n .map(({ reply }) =>\n buildCommentReply(reply, {\n currentUserId: currentUser?.id,\n onDelete: deleteReply,\n onEdit: setEditingReplyId,\n })\n );\n }, [replies, visibleReplies, deleteReply, currentUser?.id]);\n\n return {\n isLoading,\n isLiked,\n likesCount,\n commentsCount: replies.length,\n isReplyOpen,\n toggleReplyOpen: () => setIsReplyOpen(open => !open),\n replies: mappedReplies,\n editingReply: replies.find(reply => String(reply.id) === String(editingReplyId)) ?? null,\n cancelReplyEdit: () => setEditingReplyId(null),\n hasMoreReplies: replies.length > visibleReplies,\n moreRepliesCount: Math.max(0, replies.length - visibleReplies),\n showMoreReplies: () => setVisibleReplies(prev => prev + MORE_REPLIES_INCREMENT),\n toggleLike,\n postReply,\n updateReply,\n };\n};\n"],"names":["useActivityInteractions","_ref","_activity$likes","_activity$likes_count","_replies$find","activity","currentUser","onChanged","loadingState","onChangedRef","useRef","current","notifyChanged","useCallback","_onChangedRef$current","call","useState","_useState2","_slicedToArray","_useState","localIsLoading","setLocalIsLoading","isLoading","setIsLoading","_useState4","_useState3","isReplyOpen","setIsReplyOpen","_useState6","_useState5","editingReplyId","setEditingReplyId","_useState8","_useState7","visibleReplies","setVisibleReplies","_useState10","_useState9","optimisticReplies","setOptimisticReplies","_useState11","_useState12","updatedReplies","setUpdatedReplies","optimisticRepliesRef","_useState14","_useState13","deletedReplyIds","setDeletedReplyIds","_useState16","_useState15","optimisticLiked","setOptimisticLiked","serverReplies","useMemo","_activity$comments","comments","replies","serverIds","Set","map","reply","String","id","merged","filter","has","length","some","useEffect","stillPending","stillPresent","serverLiked","likes","like","_like$user","Number","user","isLiked","serverLikesCount","likes_count","likesCount","Math","max","toggleLike","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","toggleFeedItemLike","t0","showErrorNotification","finish","stop","apply","this","arguments","postReply","_ref3","body","attachments","files","comment","created","_args2","_context2","file","url","size","file_name","name","_objectSpread","attachment","postFeedItemComment","sent","_callee2","_x","updateReply","_ref4","replyId","_files$","_context3","patchFeedItemComment","_files$2","_callee3","_x2","_x3","_x4","deleteReply","_ref5","pendingCopy","_context4","find","deleteFeedItemComment","showSuccessNotification","_callee4","_x5","mappedReplies","sortAt","moment","created_at","unix","sort","a","b","slice","_ref6","buildCommentReply","currentUserId","onDelete","onEdit","commentsCount","toggleReplyOpen","open","editingReply","cancelReplyEdit","hasMoreReplies","moreRepliesCount","showMoreReplies"],"mappings":"2vCAeA,IA8CaA,EAA0B,SAK8BC,GAAA,IAAAC,EAAAC,EAAAC,EAJnEC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,aAGMC,EAAeC,EAAOH,GAC5BE,EAAaE,QAAUJ,EACvB,IAAMK,EAAgBC,GAAY,WAAA,IAAAC,EAAA,OAAM,QAANA,EAAML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A,CAtB4B,GAuB7B,CAACjG,aAAAA,EAAAA,EAAU0D,GAAInD,EAAeW,IAG1BwH,GAAgBzF,GAAwB,WAC5C,OAAKG,GAAQU,OAENV,GACJG,KAAI,SAAAC,GAAK,MAAK,CAAEA,MAAAA,EAAOmF,OAAQC,EAAOpF,EAAMqF,YAAYC,OAAS,IACjEC,MAAK,SAACC,EAAGC,GAAC,OAAKA,EAAEN,OAASK,EAAEL,UAC5BO,MAAM,EAAGrH,GACT0B,KAAI,SAAA4F,GAAA,IAAG3F,IAAAA,MAAK,OACX4F,EAAkB5F,EAAO,CACvB6F,cAAepJ,aAAAA,EAAAA,EAAayD,GAC5B4F,SAAUrB,GACVsB,OAAQ7H,OAVc,EAa7B,GAAE,CAAC0B,GAASvB,EAAgBoG,GAAahI,aAAAA,EAAAA,EAAayD,KAEvD,MAAO,CACLzC,UAAAA,EACAwD,QAAAA,GACAG,WAAAA,GACA4E,cAAepG,GAAQU,OACvBzC,YAAAA,EACAoI,gBAAiB,WAAA,OAAMnI,GAAe,SAAAoI,GAAI,OAAKA,IAAK,EACpDtG,QAASsF,GACTiB,uBAAcvG,GAAQiF,MAAK,SAAA7E,GAAK,OAAIC,OAAOD,EAAME,MAAQD,OAAOhC,EAAe,mBAAK,KACpFmI,gBAAiB,WAAA,OAAMlI,EAAkB,KAAK,EAC9CmI,eAAgBzG,GAAQU,OAASjC,EACjCiI,iBAAkBjF,KAAKC,IAAI,EAAG1B,GAAQU,OAASjC,GAC/CkI,gBAAiB,WAAA,OAAMjI,GAAkB,SAAAyD,GAAI,OAAIA,EAnQtB,KAmQoD,EAC/ER,WAAAA,GACAmB,UAAAA,GACAoB,YAAAA,GAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFeedActivity.d.ts","sourceRoot":"","sources":["../../../src/components/FeedCard/useFeedActivity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,Y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E,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC;AAGF,eAAO,MAAM,eAAe,aAChB,iBAAiB,GAAG,SAAS,WAE9B,MAAM,KACd,mBAAmB,GAAG,IA0FxB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{CommentReplyInput as o}from"../CommentComposer/CommentReplyInput.js";import s from"../ConfirmationDialog.js";import{DeleteFourIcon as c}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{useActivityInteractions as i}from"./useActivityInteractions.js";import{useDeleteFeedItem as n}from"./useDeleteFeedItem.js";import{jsx as t}from"react/jsx-runtime";var e=s,m=function(s,m){var r,l,p,u,a,I,d,j=i({activity:null!==(r=null==s?void 0:s.data)&&void 0!==r?r:{},currentUser:null!==(l=null==s?void 0:s.currentUser)&&void 0!==l?l:{},onChanged:null==s?void 0:s.onChanged,loadingState:null==s?void 0:s.loadingState}),C=n({id:null==s||null===(p=s.data)||void 0===p?void 0:p.id,successMessage:"".concat(m[0].toUpperCase()).concat(m.slice(1)," was deleted"),errorMessage:"Failed to delete the ".concat(m),onDeleted:function(){var o,c;null==s||null===(o=s.onChanged)||void 0===o||o.call(s),null==s||null===(c=s.onDeleted)||void 0===c||c.call(s)}});return s?{isDeleted:C.isDeleted,isLiked:j.isLiked,likesCount:j.likesCount,commentsCount:j.commentsCount,isReplyOpen:j.isReplyOpen,replies:j.replies,hasMoreReplies:j.hasMoreReplies,moreRepliesCount:j.moreRepliesCount,onLike:j.toggleLike,onReplyToggle:j.toggleReplyOpen,onShowMoreReplies:j.showMoreReplies,replyInput:t(o,{onSubmit:j.postReply,disabled:j.isLoading,author:{name:(a=s.currentUser,"".concat(null!==(I=null==a?void 0:a.first_name)&&void 0!==I?I:""," ").concat(null!==(d=null==a?void 0:a.last_name)&&void 0!==d?d:"").trim()),avatarUrl:null===(u=s.currentUser)||void 0===u?void 0:u.profile_photo}}),menuItems:s.canDelete?[{label:"Delete",icon:t(c,{size:16}),onClick:C.openDeleteDialog}]:[],deleteDialog:t(e,{open:C.isDialogOpen,title:"Delete ".concat(m),text:"Are you sure you want to delete this ".concat(m,"?"),okText:"Delete",disableOk:C.isDeleting,handleOk:C.confirmDelete,handleClose:C.closeDeleteDialog})}:null};export{m as useFeedActivity};
1
+ import o from"@babel/runtime/helpers/defineProperty";import{getReplyAttachments as s}from"../CommentCard/buildCommentReply.js";import{CommentReplyInput as i}from"../CommentComposer/CommentReplyInput.js";import n from"../ConfirmationDialog.js";import{DeleteFourIcon as c}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{useActivityInteractions as t}from"./useActivityInteractions.js";import{useDeleteFeedItem as e}from"./useDeleteFeedItem.js";import{jsx as r}from"react/jsx-runtime";function m(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,n)}return i}function l(s){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?m(Object(n),!0).forEach((function(i){o(s,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(n,o))}))}return s}var p=n,u=function(o){var s,i;return"".concat(null!==(s=null==o?void 0:o.first_name)&&void 0!==s?s:""," ").concat(null!==(i=null==o?void 0:o.last_name)&&void 0!==i?i:"").trim()},a=function(o,n){var m,a,d,j,I=t({activity:null!==(m=null==o?void 0:o.data)&&void 0!==m?m:{},currentUser:null!==(a=null==o?void 0:o.currentUser)&&void 0!==a?a:{},onChanged:null==o?void 0:o.onChanged,loadingState:null==o?void 0:o.loadingState}),v=e({id:null==o||null===(d=o.data)||void 0===d?void 0:d.id,successMessage:"".concat(n[0].toUpperCase()).concat(n.slice(1)," was deleted"),errorMessage:"Failed to delete the ".concat(n),onDeleted:function(){var s,i;null==o||null===(s=o.onChanged)||void 0===s||s.call(o),null==o||null===(i=o.onDeleted)||void 0===i||i.call(o)}});if(!o)return null;var g=I.replies.map((function(o){var n,c;return I.editingReply&&String(o.id)===String(I.editingReply.id)?l(l({},o),{},{editForm:r(i,{onSubmit:function(s,i){var n,c;return I.updateReply(null!==(n=null===(c=I.editingReply)||void 0===c?void 0:c.id)&&void 0!==n?n:o.id,s,i)},onCancel:I.cancelReplyEdit,disabled:I.isLoading,initialBody:null!==(n=I.editingReply.body)&&void 0!==n?n:"",initialAttachments:s(I.editingReply),author:{name:u(I.editingReply.user),avatarUrl:null===(c=I.editingReply.user)||void 0===c?void 0:c.profile_photo}})}):o}));return{isDeleted:v.isDeleted,isLiked:I.isLiked,likesCount:I.likesCount,commentsCount:I.commentsCount,isReplyOpen:I.isReplyOpen,replies:g,hasMoreReplies:I.hasMoreReplies,moreRepliesCount:I.moreRepliesCount,onLike:I.toggleLike,onReplyToggle:I.toggleReplyOpen,onShowMoreReplies:I.showMoreReplies,replyInput:r(i,{onSubmit:I.postReply,disabled:I.isLoading,author:{name:u(o.currentUser),avatarUrl:null===(j=o.currentUser)||void 0===j?void 0:j.profile_photo}}),menuItems:o.canDelete?[{label:"Delete",icon:r(c,{size:16}),onClick:v.openDeleteDialog}]:[],deleteDialog:r(p,{open:v.isDialogOpen,title:"Delete ".concat(n),text:"Are you sure you want to delete this ".concat(n,"?"),okText:"Delete",disableOk:v.isDeleting,handleOk:v.confirmDelete,handleClose:v.closeDeleteDialog})}};export{a as useFeedActivity};
2
2
  //# sourceMappingURL=useFeedActivity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFeedActivity.js","sources":["../../../src/components/FeedCard/useFeedActivity.tsx"],"sourcesContent":["import { ComponentType, ReactNode } from 'react';\n\nimport { CommentMenuItem, CommentReply } from '../CommentCard/CommentCard.types';\nimport { CommentReplyInput } from '../CommentComposer/CommentReplyInput';\nimport ConfirmationDialogJs from '../ConfirmationDialog';\nimport { DeleteFourIcon } from '../../icons';\n\nimport { useActivityInteractions } from './useActivityInteractions';\nimport type { InteractionActivity } from './useActivityInteractions';\nimport { useDeleteFeedItem } from './useDeleteFeedItem';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type FeedActivityUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n/* eslint-enable camelcase */\n\nexport type FeedActivityProps = {\n data: InteractionActivity;\n currentUser: FeedActivityUser;\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n canDelete?: boolean;\n onDeleted?: () => void;\n};\n\nconst ConfirmationDialog = ConfirmationDialogJs as unknown as ComponentType<{\n open: boolean;\n title: string;\n text: string;\n okText: string;\n disableOk: boolean;\n handleOk: () => void;\n handleClose: () => void;\n}>;\n\nconst getUserName = (user?: FeedActivityUser) =>\n `${user?.first_name ?? ''} ${user?.last_name ?? ''}`.trim();\n\nexport type FeedActivityBinding = {\n isDeleted: boolean;\n isLiked?: boolean;\n likesCount?: number;\n commentsCount?: number;\n isReplyOpen?: boolean;\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n onLike?: () => void;\n onReplyToggle?: () => void;\n onShowMoreReplies?: () => void;\n replyInput?: ReactNode;\n menuItems: CommentMenuItem[];\n deleteDialog: ReactNode;\n};\n\n// Returns `null` without an `activity`, so the card falls back to its presentational props.\nexport const useFeedActivity = (\n activity: FeedActivityProps | undefined,\n // What the delete dialog and its notifications call the item: \"comment\", \"item\".\n subject: string\n): FeedActivityBinding | null => {\n const interactions = useActivityInteractions({\n activity: activity?.data ?? {},\n currentUser: activity?.currentUser ?? {},\n onChanged: activity?.onChanged,\n loadingState: activity?.loadingState,\n });\n\n const deletion = useDeleteFeedItem({\n id: activity?.data?.id,\n successMessage: `${subject[0].toUpperCase()}${subject.slice(1)} was deleted`,\n errorMessage: `Failed to delete the ${subject}`,\n onDeleted: () => {\n activity?.onChanged?.();\n activity?.onDeleted?.();\n },\n });\n\n if (!activity) return null;\n\n return {\n isDeleted: deletion.isDeleted,\n isLiked: interactions.isLiked,\n likesCount: interactions.likesCount,\n commentsCount: interactions.commentsCount,\n isReplyOpen: interactions.isReplyOpen,\n replies: interactions.replies,\n hasMoreReplies: interactions.hasMoreReplies,\n moreRepliesCount: interactions.moreRepliesCount,\n onLike: interactions.toggleLike,\n onReplyToggle: interactions.toggleReplyOpen,\n onShowMoreReplies: interactions.showMoreReplies,\n replyInput: (\n <CommentReplyInput\n onSubmit={interactions.postReply}\n disabled={interactions.isLoading}\n author={{\n name: getUserName(activity.currentUser),\n avatarUrl: activity.currentUser?.profile_photo,\n }}\n />\n ),\n menuItems: activity.canDelete\n ? [\n {\n label: 'Delete',\n icon: <DeleteFourIcon size={16} />,\n onClick: deletion.openDeleteDialog,\n },\n ]\n : [],\n deleteDialog: (\n <ConfirmationDialog\n open={deletion.isDialogOpen}\n title={`Delete ${subject}`}\n text={`Are you sure you want to delete this ${subject}?`}\n okText=\"Delete\"\n disableOk={deletion.isDeleting}\n handleOk={deletion.confirmDelete}\n handleClose={deletion.closeDeleteDialog}\n />\n ),\n };\n};\n"],"names":["ConfirmationDialog","ConfirmationDialogJs","useFeedActivity","activity","subject","_activity$data","_activity$currentUser","_activity$data2","_activity$currentUser2","user","_user$first_name","_user$last_name","interactions","useActivityInteractions","data","currentUser","onChanged","loadingState","deletion","useDeleteFeedItem","id","successMessage","toUpperCase","concat","slice","errorMessage","onDeleted","_activity$onChanged","_activity$onDeleted","isDeleted","isLiked","likesCount","commentsCount","isReplyOpen","replies","hasMoreReplies","moreRepliesCount","onLike","toggleLike","onReplyToggle","toggleReplyOpen","onShowMoreReplies","showMoreReplies","replyInput","_jsx","CommentReplyInput","onSubmit","postReply","disabled","isLoading","author","name","first_name","last_name","trim","avatarUrl","profile_photo","menuItems","canDelete","label","icon","DeleteFourIcon","size","onClick","openDeleteDialog","deleteDialog","open","isDialogOpen","title","text","okText","disableOk","isDeleting","handleOk","confirmDelete","handleClose","closeDeleteDialog"],"mappings":"66HA6BA,IAAMA,EAAqBC,EA+BdC,EAAkB,SAC7BC,EAEAC,GAC+B,IAAAC,EAAAC,EAAAC,EAAAC,EAzBZC,EAAuBC,EAAAC,EA0BpCC,EAAeC,EAAwB,CAC3CV,SAA4B,QAApBE,EAAEF,aAAQ,EAARA,EAAUW,YAAQ,IAAAT,EAAAA,EAAA,CAAE,EAC9BU,YAAsC,QAA3BT,EAAEH,aAAQ,EAARA,EAAUY,mBAAe,IAAAT,EAAAA,EAAA,CAAE,EACxCU,UAAWb,aAAAA,EAAAA,EAAUa,UACrBC,aAAcd,aAAQ,EAARA,EAAUc,eAGpBC,EAAWC,EAAkB,CACjCC,GAAIjB,SAAA,QAAQI,EAARJ,EAAUW,YAAV,IAAAP,OAAQ,EAARA,EAAgBa,GACpBC,eAAmBjB,GAAAA,OAAAA,EAAQ,GAAGkB,eAAaC,OAAGnB,EAAQoB,MAAM,GAAgB,gBAC5EC,aAAY,wBAAAF,OAA0BnB,GACtCsB,UAAW,WAAM,IAAAC,EAAAC,EACfzB,SAAmB,QAAnBA,EAAAA,EAAUa,iBAAS,IAAAW,GAAnBA,EAAAxB,KAAAA,GACAA,SAAmB,QAAnBA,EAAAA,EAAUuB,iBAAS,IAAAE,GAAnBA,EAAAzB,KAAAA,EACF,IAGF,OAAKA,EAEE,CACL0B,UAAWX,EAASW,UACpBC,QAASlB,EAAakB,QACtBC,WAAYnB,EAAamB,WACzBC,cAAepB,EAAaoB,cAC5BC,YAAarB,EAAaqB,YAC1BC,QAAStB,EAAasB,QACtBC,eAAgBvB,EAAauB,eAC7BC,iBAAkBxB,EAAawB,iBAC/BC,OAAQzB,EAAa0B,WACrBC,cAAe3B,EAAa4B,gBAC5BC,kBAAmB7B,EAAa8B,gBAChCC,WACEC,EAACC,EAAiB,CAChBC,SAAUlC,EAAamC,UACvBC,SAAUpC,EAAaqC,UACvBC,OAAQ,CACNC,MA9DW1C,EA8DON,EAASY,YA7DnC,GAAAQ,OAAmB,QAAnBb,EAAGD,eAAAA,EAAM2C,kBAAU,IAAA1C,EAAAA,EAAI,GAAE,KAAAa,OAAuB,QAAvBZ,EAAIF,eAAAA,EAAM4C,iBAAa,IAAA1C,EAAAA,EAAA,IAAK2C,QA8D7CC,kBAAWpD,EAAAA,EAASY,gCAATP,EAAsBgD,iBAIvCC,UAAWtD,EAASuD,UAChB,CACE,CACEC,MAAO,SACPC,KAAMhB,EAACiB,EAAc,CAACC,KAAM,KAC5BC,QAAS7C,EAAS8C,mBAGtB,GACJC,aACErB,EAAC5C,EAAkB,CACjBkE,KAAMhD,EAASiD,aACfC,MAAK,UAAA7C,OAAYnB,GACjBiE,KAAI,wCAAA9C,OAA0CnB,EAAW,KACzDkE,OAAO,SACPC,UAAWrD,EAASsD,WACpBC,SAAUvD,EAASwD,cACnBC,YAAazD,EAAS0D,qBAzCN,IA6CxB"}
1
+ {"version":3,"file":"useFeedActivity.js","sources":["../../../src/components/FeedCard/useFeedActivity.tsx"],"sourcesContent":["import { ComponentType, ReactNode } from 'react';\n\nimport { CommentMenuItem, CommentReply } from '../CommentCard/CommentCard.types';\nimport { getReplyAttachments } from '../CommentCard/buildCommentReply';\nimport { CommentReplyInput } from '../CommentComposer/CommentReplyInput';\nimport ConfirmationDialogJs from '../ConfirmationDialog';\nimport { DeleteFourIcon } from '../../icons';\n\nimport { useActivityInteractions } from './useActivityInteractions';\nimport type { InteractionActivity } from './useActivityInteractions';\nimport { useDeleteFeedItem } from './useDeleteFeedItem';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type FeedActivityUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n/* eslint-enable camelcase */\n\nexport type FeedActivityProps = {\n data: InteractionActivity;\n currentUser: FeedActivityUser;\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n canDelete?: boolean;\n onDeleted?: () => void;\n};\n\nconst ConfirmationDialog = ConfirmationDialogJs as unknown as ComponentType<{\n open: boolean;\n title: string;\n text: string;\n okText: string;\n disableOk: boolean;\n handleOk: () => void;\n handleClose: () => void;\n}>;\n\nconst getUserName = (user?: FeedActivityUser) =>\n `${user?.first_name ?? ''} ${user?.last_name ?? ''}`.trim();\n\nexport type FeedActivityBinding = {\n isDeleted: boolean;\n isLiked?: boolean;\n likesCount?: number;\n commentsCount?: number;\n isReplyOpen?: boolean;\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n onLike?: () => void;\n onReplyToggle?: () => void;\n onShowMoreReplies?: () => void;\n replyInput?: ReactNode;\n menuItems: CommentMenuItem[];\n deleteDialog: ReactNode;\n};\n\n// Returns `null` without an `activity`, so the card falls back to its presentational props.\nexport const useFeedActivity = (\n activity: FeedActivityProps | undefined,\n // What the delete dialog and its notifications call the item: \"comment\", \"item\".\n subject: string\n): FeedActivityBinding | null => {\n const interactions = useActivityInteractions({\n activity: activity?.data ?? {},\n currentUser: activity?.currentUser ?? {},\n onChanged: activity?.onChanged,\n loadingState: activity?.loadingState,\n });\n\n const deletion = useDeleteFeedItem({\n id: activity?.data?.id,\n successMessage: `${subject[0].toUpperCase()}${subject.slice(1)} was deleted`,\n errorMessage: `Failed to delete the ${subject}`,\n onDeleted: () => {\n activity?.onChanged?.();\n activity?.onDeleted?.();\n },\n });\n\n if (!activity) return null;\n\n const replies = interactions.replies.map(reply =>\n interactions.editingReply && String(reply.id) === String(interactions.editingReply.id)\n ? {\n ...reply,\n editForm: (\n <CommentReplyInput\n onSubmit={(body, attachments) =>\n interactions.updateReply(\n interactions.editingReply?.id ?? reply.id,\n body,\n attachments\n )\n }\n onCancel={interactions.cancelReplyEdit}\n disabled={interactions.isLoading}\n initialBody={interactions.editingReply.body ?? ''}\n initialAttachments={getReplyAttachments(interactions.editingReply)}\n author={{\n name: getUserName(interactions.editingReply.user),\n avatarUrl: interactions.editingReply.user?.profile_photo,\n }}\n />\n ),\n }\n : reply\n );\n\n return {\n isDeleted: deletion.isDeleted,\n isLiked: interactions.isLiked,\n likesCount: interactions.likesCount,\n commentsCount: interactions.commentsCount,\n isReplyOpen: interactions.isReplyOpen,\n replies,\n hasMoreReplies: interactions.hasMoreReplies,\n moreRepliesCount: interactions.moreRepliesCount,\n onLike: interactions.toggleLike,\n onReplyToggle: interactions.toggleReplyOpen,\n onShowMoreReplies: interactions.showMoreReplies,\n replyInput: (\n <CommentReplyInput\n onSubmit={interactions.postReply}\n disabled={interactions.isLoading}\n author={{\n name: getUserName(activity.currentUser),\n avatarUrl: activity.currentUser?.profile_photo,\n }}\n />\n ),\n menuItems: activity.canDelete\n ? [\n {\n label: 'Delete',\n icon: <DeleteFourIcon size={16} />,\n onClick: deletion.openDeleteDialog,\n },\n ]\n : [],\n deleteDialog: (\n <ConfirmationDialog\n open={deletion.isDialogOpen}\n title={`Delete ${subject}`}\n text={`Are you sure you want to delete this ${subject}?`}\n okText=\"Delete\"\n disableOk={deletion.isDeleting}\n handleOk={deletion.confirmDelete}\n handleClose={deletion.closeDeleteDialog}\n />\n ),\n };\n};\n"],"names":["ConfirmationDialog","ConfirmationDialogJs","getUserName","user","_user$first_name","_user$last_name","concat","first_name","last_name","trim","useFeedActivity","activity","subject","_activity$data","_activity$currentUser","_activity$data2","_activity$currentUser2","interactions","useActivityInteractions","data","currentUser","onChanged","loadingState","deletion","useDeleteFeedItem","id","successMessage","toUpperCase","slice","errorMessage","onDeleted","_activity$onChanged","_activity$onDeleted","replies","map","reply","_interactions$editing3","_interactions$editing4","editingReply","String","editForm","_jsx","CommentReplyInput","onSubmit","body","attachments","_interactions$editing","_interactions$editing2","updateReply","onCancel","cancelReplyEdit","disabled","isLoading","initialBody","initialAttachments","getReplyAttachments","author","name","avatarUrl","profile_photo","isDeleted","isLiked","likesCount","commentsCount","isReplyOpen","hasMoreReplies","moreRepliesCount","onLike","toggleLike","onReplyToggle","toggleReplyOpen","onShowMoreReplies","showMoreReplies","replyInput","postReply","menuItems","canDelete","label","icon","DeleteFourIcon","size","onClick","openDeleteDialog","deleteDialog","open","isDialogOpen","title","text","okText","disableOk","isDeleting","handleOk","confirmDelete","handleClose","closeDeleteDialog"],"mappings":"2mJA8BA,IAAMA,EAAqBC,EAUrBC,EAAc,SAACC,GAAuB,IAAAC,EAAAC,EAAA,MAC1C,GAAAC,OAAmB,QAAnBF,EAAGD,eAAAA,EAAMI,kBAAU,IAAAH,EAAAA,EAAI,GAAE,KAAAE,OAAuB,QAAvBD,EAAIF,eAAAA,EAAMK,iBAAa,IAAAH,EAAAA,EAAA,IAAKI,MAAM,EAoBhDC,EAAkB,SAC7BC,EAEAC,GAC+B,IAAAC,EAAAC,EAAAC,EAAAC,EACzBC,EAAeC,EAAwB,CAC3CP,SAA4B,QAApBE,EAAEF,aAAQ,EAARA,EAAUQ,YAAQ,IAAAN,EAAAA,EAAA,CAAE,EAC9BO,YAAsC,QAA3BN,EAAEH,aAAQ,EAARA,EAAUS,mBAAe,IAAAN,EAAAA,EAAA,CAAE,EACxCO,UAAWV,aAAAA,EAAAA,EAAUU,UACrBC,aAAcX,aAAQ,EAARA,EAAUW,eAGpBC,EAAWC,EAAkB,CACjCC,GAAId,SAAA,QAAQI,EAARJ,EAAUQ,YAAV,IAAAJ,OAAQ,E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,kBAAmBtD,EAAauD,gBAChCC,WACEhC,EAACC,EAAiB,CAChBC,SAAU1B,EAAayD,UACvBvB,SAAUlC,EAAamC,UACvBI,OAAQ,CACNC,KAAMvD,EAAYS,EAASS,aAC3BsC,kBAAW/C,EAAAA,EAASS,gCAATJ,EAAsB2C,iBAIvCgB,UAAWhE,EAASiE,UAChB,CACE,CACEC,MAAO,SACPC,KAAMrC,EAACsC,EAAc,CAACC,KAAM,KAC5BC,QAAS1D,EAAS2D,mBAGtB,GACJC,aACE1C,EAACzC,EAAkB,CACjBoF,KAAM7D,EAAS8D,aACfC,MAAK,UAAAhF,OAAYM,GACjB2E,KAAI,wCAAAjF,OAA0CM,EAAW,KACzD4E,OAAO,SACPC,UAAWlE,EAASmE,WACpBC,SAAUpE,EAASqE,cACnBC,YAAatE,EAASuE,oBAI9B"}
@@ -71,6 +71,6 @@ declare const _default: import("react").ComponentType<Pick<Pick<Pick<{
71
71
  menuProps?: PropTypes.InferProps<{}> | null | undefined;
72
72
  iconButtonProps?: PropTypes.InferProps<{}> | null | undefined;
73
73
  paperClassName?: string | null | undefined;
74
- } & {}, "IconButtonComponent" | "IconElement" | "anchorOrigin" | "children" | "className" | "color" | "data-testid" | "disableRipple" | "disabled" | "iconButtonProps" | "iconButtonStyle" | "marginThreshold" | "menuProps" | "paperClassName" | "tooltipProps" | "transformOrigin"> & import("@material-ui/styles").StyledComponentProps<"iconButton">>;
74
+ } & {}, "IconButtonComponent" | "IconElement" | "anchorOrigin" | "children" | "className" | "color" | "data-testid" | "disableRipple" | "disabled" | "iconButtonProps" | "iconButtonStyle" | "marginThreshold" | "menuProps" | "paperClassName" | "tooltipProps" | "transformOrigin"> & import("@material-ui/styles").StyledComponentProps<"iconButton" | "paper">>;
75
75
  export default _default;
76
76
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as t}from"react";import n from"prop-types";import{withStyles as i,Tooltip as a,Menu as s}from"@material-ui/core";import{MoreVert as p}from"@material-ui/icons";import l from"../IconButton/index.js";import{jsx as c,jsxs as u,Fragment as d}from"react/jsx-runtime";function m(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),r.push.apply(r,t)}return r}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){o(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}))}return e}function f(o){var n=o.classes,i=o["data-testid"],p=o.iconButtonStyle,l=o.color,m=o.disableRipple,f=o.className,b=o.IconElement,g=o.IconButtonComponent,O=o.disabled,y=o.iconButtonProps,P=o.children,v=o.anchorOrigin,j=o.transformOrigin,B=o.marginThreshold,T=o.menuProps,C=o.tooltipProps,w=o.paperClassName,I=r(null),N=e(I,2),R=N[0],x=N[1],D=!!R,E=r(!1),S=e(E,2),k=S[0],z=S[1];t((function(){var o;return D&&setTimeout((function(){o=z(D)}),500),function(){o&&clearTimeout(o)}}),[D]);var M=function(o){o.stopPropagation(),x(null),z(!1)},A=c(g,h(h({"aria-label":"IconMenu","aria-owns":D?"icon-menu":void 0,"aria-haspopup":"true","data-testid":i,onClick:function(o){o.stopPropagation(),o.preventDefault(),x(o.currentTarget)},classes:{root:n.iconButton},className:f,style:p,color:l,disableRipple:m,disabled:O},y),{},{children:b}));return u(d,{children:[C?c(a,h(h({},C),{},{children:A})):A,c(s,h(h({id:"icon-menu",anchorEl:R,open:D,MenuListProps:{"data-testid":"".concat(i,"Dropdown")},disableAutoFocus:!k,autoFocus:k,onClose:M,onClick:M,anchorOrigin:v,transformOrigin:j,classes:{paper:n.paper},elevation:0,marginThreshold:B,PaperProps:{className:n[w]}},T),{},{children:P}))]})}f.propTypes={children:n.oneOfType([n.string,n.node,n.array]),classes:n.shape({iconButton:n.string,paper:n.string}),className:n.string,color:n.string,IconElement:n.element,IconButtonComponent:n.any,iconButtonStyle:n.shape({}),anchorOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),transformOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),disableRipple:n.bool,"data-testid":n.string,marginThreshold:n.number,disabled:n.bool,tooltipProps:n.shape({}),menuProps:n.shape({}),iconButtonProps:n.shape({}),paperClassName:n.string},f.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:c(p,{}),iconButtonStyle:void 0,IconButtonComponent:l,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"top"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{},paperClassName:""};var b=i((function(o){return{iconButton:{borderRadius:8,padding:"10px",color:o.palette.primary.text6,"&:hover":{color:o.palette.primary.text1,backgroundColor:"rgba(255, 255, 255, 0.16)"},"& .MuiTouchRipple-child":{borderRadius:8},paper:{}}}}))(f);export{b as default};
1
+ import o from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as t}from"react";import n from"prop-types";import{withStyles as i,Tooltip as a,Menu as s}from"@material-ui/core";import{MoreVert as p}from"@material-ui/icons";import l from"../IconButton/index.js";import{jsx as c,jsxs as u,Fragment as d}from"react/jsx-runtime";function m(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),r.push.apply(r,t)}return r}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){o(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}))}return e}function f(o){var n=o.classes,i=o["data-testid"],p=o.iconButtonStyle,l=o.color,m=o.disableRipple,f=o.className,b=o.IconElement,g=o.IconButtonComponent,O=o.disabled,y=o.iconButtonProps,P=o.children,v=o.anchorOrigin,j=o.transformOrigin,B=o.marginThreshold,T=o.menuProps,C=o.tooltipProps,w=o.paperClassName,I=r(null),N=e(I,2),R=N[0],x=N[1],D=!!R,E=r(!1),S=e(E,2),k=S[0],z=S[1];t((function(){var o;return D&&setTimeout((function(){o=z(D)}),500),function(){o&&clearTimeout(o)}}),[D]);var M=function(o){o.stopPropagation(),x(null),z(!1)},A=c(g,h(h({"aria-label":"IconMenu","aria-owns":D?"icon-menu":void 0,"aria-haspopup":"true","data-testid":i,onClick:function(o){o.stopPropagation(),o.preventDefault(),x(o.currentTarget)},classes:{root:n.iconButton},className:f,style:p,color:l,disableRipple:m,disabled:O},y),{},{children:b}));return u(d,{children:[C?c(a,h(h({},C),{},{children:A})):A,c(s,h(h({id:"icon-menu",anchorEl:R,open:D,MenuListProps:{"data-testid":"".concat(i,"Dropdown")},disableAutoFocus:!k,autoFocus:k,onClose:M,onClick:M,anchorOrigin:v,transformOrigin:j,classes:{paper:n.paper},elevation:0,marginThreshold:B,PaperProps:{className:n[w]}},T),{},{children:P}))]})}f.propTypes={children:n.oneOfType([n.string,n.node,n.array]),classes:n.shape({iconButton:n.string,paper:n.string}),className:n.string,color:n.string,IconElement:n.element,IconButtonComponent:n.any,iconButtonStyle:n.shape({}),anchorOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),transformOrigin:n.shape({horizontal:n.oneOf(["left","center","right"]),vertical:n.oneOf(["top","center","bottom"])}),disableRipple:n.bool,"data-testid":n.string,marginThreshold:n.number,disabled:n.bool,tooltipProps:n.shape({}),menuProps:n.shape({}),iconButtonProps:n.shape({}),paperClassName:n.string},f.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:c(p,{}),iconButtonStyle:void 0,IconButtonComponent:l,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"top"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{},paperClassName:""};var b=i((function(o){return{iconButton:{borderRadius:8,padding:"10px",color:o.palette.primary.text6,"&:hover":{color:o.palette.primary.text1,backgroundColor:"rgba(255, 255, 255, 0.16)"},"& .MuiTouchRipple-child":{borderRadius:8}},paper:{}}}))(f);export{b as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport { MoreVert } from '@material-ui/icons';\n\nimport IconButton from '../IconButton';\n\nconst muiStyles = theme => ({\n iconButton: {\n borderRadius: 8,\n padding: '10px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n backgroundColor: 'rgba(255, 255, 255, 0.16)',\n },\n '& .MuiTouchRipple-child': {\n borderRadius: 8,\n },\n paper: {},\n },\n});\n\nfunction IconMenu({\n classes,\n // IconButtonComponentProps\n 'data-testid': testId,\n iconButtonStyle,\n color,\n disableRipple,\n className,\n IconElement,\n IconButtonComponent,\n disabled,\n iconButtonProps,\n // MenuProps\n children,\n anchorOrigin,\n transformOrigin,\n marginThreshold,\n menuProps,\n // Tooltip\n tooltipProps,\n paperClassName,\n}) {\n const [anchorEl, setAnchorEl] = useState(null);\n const isOpen = !!anchorEl;\n\n /*\n A fix of the issue: https://corvaqa.atlassian.net/browse/DC-3713\n\n When Material Menu is rendered, at first it's displayed at the top of the container\n and only then moves to the anchor element. When the focus is enabled, and the element is\n inside of an iframe but outside the view - browsers scroll the page to it. Because of this, we set focus in async\n manner, to wait for correct position - and then set focus.\n\n https://github.dev/mui/material-ui/blob/v4.x/packages/material-ui/src/Popover/Popover.js#L323-L331\n */\n const [isMenuAutofocus, setIsMenuAutofocus] = useState(false);\n useEffect(() => {\n let timerId;\n\n if (isOpen) {\n setTimeout(() => {\n timerId = setIsMenuAutofocus(isOpen);\n // Why 500? The lower delay doesn't actually work, so this is the lowest value I could get to make it work\n }, 500);\n }\n\n return () => {\n if (timerId) {\n clearTimeout(timerId);\n }\n };\n }, [isOpen]);\n\n const handleClose = event => {\n event.stopPropagation();\n setAnchorEl(null);\n setIsMenuAutofocus(false);\n };\n const handleOpen = event => {\n event.stopPropagation();\n event.preventDefault();\n setAnchorEl(event.currentTarget);\n };\n\n const iconButtonElement = (\n <IconButtonComponent\n aria-label=\"IconMenu\"\n aria-owns={isOpen ? 'icon-menu' : undefined}\n aria-haspopup=\"true\"\n data-testid={testId}\n onClick={handleOpen}\n classes={{ root: classes.iconButton }}\n className={className}\n style={iconButtonStyle}\n color={color}\n disableRipple={disableRipple}\n disabled={disabled}\n {...iconButtonProps}\n >\n {IconElement}\n </IconButtonComponent>\n );\n\n return (\n <>\n {tooltipProps ? <Tooltip {...tooltipProps}>{iconButtonElement}</Tooltip> : iconButtonElement}\n <Menu\n id=\"icon-menu\"\n anchorEl={anchorEl}\n open={isOpen}\n MenuListProps={{ 'data-testid': `${testId}Dropdown` }}\n disableAutoFocus={!isMenuAutofocus}\n autoFocus={isMenuAutofocus}\n onClose={handleClose}\n onClick={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n classes={{ paper: classes.paper }}\n elevation={0}\n marginThreshold={marginThreshold}\n PaperProps={{\n className: classes[paperClassName],\n }}\n {...menuProps}\n >\n {children}\n </Menu>\n </>\n );\n}\n\nIconMenu.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.array]),\n classes: PropTypes.shape({\n iconButton: PropTypes.string,\n paper: PropTypes.string,\n }),\n className: PropTypes.string,\n color: PropTypes.string,\n IconElement: PropTypes.element,\n // eslint-disable-next-line react/forbid-prop-types\n IconButtonComponent: PropTypes.any,\n iconButtonStyle: PropTypes.shape({}),\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n transformOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n disableRipple: PropTypes.bool,\n 'data-testid': PropTypes.string,\n marginThreshold: PropTypes.number,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({}),\n menuProps: PropTypes.shape({}),\n iconButtonProps: PropTypes.shape({}),\n paperClassName: PropTypes.string,\n};\n\nIconMenu.defaultProps = {\n children: undefined,\n classes: {},\n className: undefined,\n color: undefined,\n 'data-testid': undefined,\n IconElement: <MoreVert />,\n iconButtonStyle: undefined,\n IconButtonComponent: IconButton,\n disableRipple: false,\n anchorOrigin: { horizontal: 'right', vertical: 'top' },\n transformOrigin: { horizontal: 'right', vertical: 'bottom' },\n marginThreshold: undefined,\n disabled: false,\n tooltipProps: undefined,\n menuProps: {},\n iconButtonProps: {},\n paperClassName: '',\n};\n\nexport default withStyles(muiStyles)(IconMenu);\n"],"names":["IconMenu","_ref","classes","testId","iconButtonStyle","color","disableRipple","className","IconElement","IconButtonComponent","disabled","iconButtonProps","children","anchorOrigin","transformOrigin","marginThreshold","menuProps","tooltipProps","paperClassName","useState","_useState2","_slicedToArray","_useState","anchorEl","setAnchorEl","isOpen","_useState4","_useState3","isMenuAutofocus","setIsMenuAutofocus","useEffect","timerId","setTimeout","clearTimeout","handleClose","event","stopPropagation","iconButtonElement","_jsx","_objectSpread","undefined","onClick","preventDefault","currentTarget","root","iconButton","style","_jsxs","_Fragment","Tooltip","Menu","id","open","MenuListProps","disableAutoFocus","autoFocus","onClose","paper","elevation","PaperProps","propTypes","PropTypes","oneOfType","string","node","array","shape","element","any","horizontal","oneOf","vertical","bool","number","defaultProps","MoreVert","IconButton","index","withStyles","theme","borderRadius","padding","palette","primary","text6","text1","backgroundColor"],"mappings":"48BAuBA,SAASA,EAqBNC,GAAA,IApBDC,IAAAA,QAEeC,IAAf,eACAC,IAAAA,gBACAC,IAAAA,MACAC,IAAAA,cACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oBACAC,IAAAA,SACAC,IAAAA,gBAEAC,IAAAA,SACAC,IAAAA,aACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,UAEAC,IAAAA,aACAC,IAAAA,eAEgCC,EAAAA,EAAS,MAAKC,EAAAC,EAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GACtBK,IAAWF,EAY6BJ,EAAAA,GAAS,GAAMO,EAAAL,EAAAM,EAAA,GAAtDC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAC1CI,GAAU,WACR,IAAIC,EASJ,OAPIN,GACFO,YAAW,WACTD,EAAUF,EAAmBJ,EAE9B,GAAE,KAGE,WACDM,GACFE,aAAaF,GAGnB,GAAG,CAACN,IAEJ,IAAMS,EAAc,SAAAC,GAClBA,EAAMC,kBACNZ,EAAY,MACZK,GAAmB,IAQfQ,EACJC,EAAC7B,EAAmB8B,EAAAA,EAAA,CAClB,aAAW,WACX,YAAWd,EAAS,iBAAce,EAClC,gBAAc,OACd,cAAarC,EACbsC,QAZe,SAAAN,GACjBA,EAAMC,kBACND,EAAMO,iBACNlB,EAAYW,EAAMQ,gBAUhBzC,QAAS,CAAE0C,KAAM1C,EAAQ2C,YACzBtC,UAAWA,EACXuC,MAAO1C,EACPC,MAAOA,EACPC,cAAeA,EACfI,SAAUA,GACNC,GAAe,GAAA,CAAAC,SAElBJ,KAIL,OACEuC,EAAAC,EAAA,CAAApC,SAAA,CACGK,EAAeqB,E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AS,CAAE,EACXK,eAAWiC,EACXnC,WAAOmC,EACP,mBAAeA,EACfhC,YAAa8B,EAACqC,EAAW,IACzBvE,qBAAiBoC,EACjB/B,oBAAqBmE,EACrBtE,eAAe,EACfO,aAAc,CAAEwD,WAAY,QAASE,SAAU,OAC/CzD,gBAAiB,CAAEuD,WAAY,QAASE,SAAU,UAClDxD,qBAAiByB,EACjB9B,UAAU,EACVO,kBAAcuB,EACdxB,UAAW,CAAE,EACbL,gBAAiB,CAAE,EACnBO,eAAgB,IAGlB,IAAA2D,EAAeC,GAjLG,SAAAC,GAAK,MAAK,CAC1BlC,WAAY,CACVmC,aAAc,EACdC,QAAS,OACT5E,MAAO0E,EAAMG,QAAQC,QAAQC,MAC7B,UAAW,CACT/E,MAAO0E,EAAMG,QAAQC,QAAQE,MAC7BC,gBAAiB,6BAEnB,0BAA2B,CACzBN,aAAc,GAEhBvB,MAAO,CAAC,GAEX,GAmKcqB,CAAsB9E"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport { MoreVert } from '@material-ui/icons';\n\nimport IconButton from '../IconButton';\n\nconst muiStyles = theme => ({\n iconButton: {\n borderRadius: 8,\n padding: '10px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n backgroundColor: 'rgba(255, 255, 255, 0.16)',\n },\n '& .MuiTouchRipple-child': {\n borderRadius: 8,\n },\n },\n paper: {},\n});\n\nfunction IconMenu({\n classes,\n // IconButtonComponentProps\n 'data-testid': testId,\n iconButtonStyle,\n color,\n disableRipple,\n className,\n IconElement,\n IconButtonComponent,\n disabled,\n iconButtonProps,\n // MenuProps\n children,\n anchorOrigin,\n transformOrigin,\n marginThreshold,\n menuProps,\n // Tooltip\n tooltipProps,\n paperClassName,\n}) {\n const [anchorEl, setAnchorEl] = useState(null);\n const isOpen = !!anchorEl;\n\n /*\n A fix of the issue: https://corvaqa.atlassian.net/browse/DC-3713\n\n When Material Menu is rendered, at first it's displayed at the top of the container\n and only then moves to the anchor element. When the focus is enabled, and the element is\n inside of an iframe but outside the view - browsers scroll the page to it. Because of this, we set focus in async\n manner, to wait for correct position - and then set focus.\n\n https://github.dev/mui/material-ui/blob/v4.x/packages/material-ui/src/Popover/Popover.js#L323-L331\n */\n const [isMenuAutofocus, setIsMenuAutofocus] = useState(false);\n useEffect(() => {\n let timerId;\n\n if (isOpen) {\n setTimeout(() => {\n timerId = setIsMenuAutofocus(isOpen);\n // Why 500? The lower delay doesn't actually work, so this is the lowest value I could get to make it work\n }, 500);\n }\n\n return () => {\n if (timerId) {\n clearTimeout(timerId);\n }\n };\n }, [isOpen]);\n\n const handleClose = event => {\n event.stopPropagation();\n setAnchorEl(null);\n setIsMenuAutofocus(false);\n };\n const handleOpen = event => {\n event.stopPropagation();\n event.preventDefault();\n setAnchorEl(event.currentTarget);\n };\n\n const iconButtonElement = (\n <IconButtonComponent\n aria-label=\"IconMenu\"\n aria-owns={isOpen ? 'icon-menu' : undefined}\n aria-haspopup=\"true\"\n data-testid={testId}\n onClick={handleOpen}\n classes={{ root: classes.iconButton }}\n className={className}\n style={iconButtonStyle}\n color={color}\n disableRipple={disableRipple}\n disabled={disabled}\n {...iconButtonProps}\n >\n {IconElement}\n </IconButtonComponent>\n );\n\n return (\n <>\n {tooltipProps ? <Tooltip {...tooltipProps}>{iconButtonElement}</Tooltip> : iconButtonElement}\n <Menu\n id=\"icon-menu\"\n anchorEl={anchorEl}\n open={isOpen}\n MenuListProps={{ 'data-testid': `${testId}Dropdown` }}\n disableAutoFocus={!isMenuAutofocus}\n autoFocus={isMenuAutofocus}\n onClose={handleClose}\n onClick={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n classes={{ paper: classes.paper }}\n elevation={0}\n marginThreshold={marginThreshold}\n PaperProps={{\n className: classes[paperClassName],\n }}\n {...menuProps}\n >\n {children}\n </Menu>\n </>\n );\n}\n\nIconMenu.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.array]),\n classes: PropTypes.shape({\n iconButton: PropTypes.string,\n paper: PropTypes.string,\n }),\n className: PropTypes.string,\n color: PropTypes.string,\n IconElement: PropTypes.element,\n // eslint-disable-next-line react/forbid-prop-types\n IconButtonComponent: PropTypes.any,\n iconButtonStyle: PropTypes.shape({}),\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n transformOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n disableRipple: PropTypes.bool,\n 'data-testid': PropTypes.string,\n marginThreshold: PropTypes.number,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({}),\n menuProps: PropTypes.shape({}),\n iconButtonProps: PropTypes.shape({}),\n paperClassName: PropTypes.string,\n};\n\nIconMenu.defaultProps = {\n children: undefined,\n classes: {},\n className: undefined,\n color: undefined,\n 'data-testid': undefined,\n IconElement: <MoreVert />,\n iconButtonStyle: undefined,\n IconButtonComponent: IconButton,\n disableRipple: false,\n anchorOrigin: { horizontal: 'right', vertical: 'top' },\n transformOrigin: { horizontal: 'right', vertical: 'bottom' },\n marginThreshold: undefined,\n disabled: false,\n tooltipProps: undefined,\n menuProps: {},\n iconButtonProps: {},\n paperClassName: '',\n};\n\nexport default withStyles(muiStyles)(IconMenu);\n"],"names":["IconMenu","_ref","classes","testId","iconButtonStyle","color","disableRipple","className","IconElement","IconButtonComponent","disabled","iconButtonProps","children","anchorOrigin","transformOrigin","marginThreshold","menuProps","tooltipProps","paperClassName","useState","_useState2","_slicedToArray","_useState","anchorEl","setAnchorEl","isOpen","_useState4","_useState3","isMenuAutofocus","setIsMenuAutofocus","useEffect","timerId","setTimeout","clearTimeout","handleClose","event","stopPropagation","iconButtonElement","_jsx","_objectSpread","undefined","onClick","preventDefault","currentTarget","root","iconButton","style","_jsxs","_Fragment","Tooltip","Menu","id","open","MenuListProps","disableAutoFocus","autoFocus","onClose","paper","elevation","PaperProps","propTypes","PropTypes","oneOfType","string","node","array","shape","element","any","horizontal","oneOf","vertical","bool","number","defaultProps","MoreVert","IconButton","index","withStyles","theme","borderRadius","padding","palette","primary","text6","text1","backgroundColor"],"mappings":"48BAuBA,SAASA,EAqBNC,GAAA,IApBDC,IAAAA,QAEeC,IAAf,eACAC,IAAAA,gBACAC,IAAAA,MACAC,IAAAA,cACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oBACAC,IAAAA,SACAC,IAAAA,gBAEAC,IAAAA,SACAC,IAAAA,aACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,UAEAC,IAAAA,aACAC,IAAAA,eAEgCC,EAAAA,EAAS,MAAKC,EAAAC,EAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GACtBK,IAAWF,EAY6BJ,EAAAA,GAAS,GAAMO,EAAAL,EAAAM,EAAA,GAAtDC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAC1CI,GAAU,WACR,IAAIC,EASJ,OAPIN,GACFO,YAAW,WACTD,EAAUF,EAAmBJ,EAE9B,GAAE,KAGE,WACDM,GACFE,aAAaF,GAGnB,GAAG,CAACN,IAEJ,IAAMS,EAAc,SAAAC,GAClBA,EAAMC,kBACNZ,EAAY,MACZK,GAAmB,IAQfQ,EACJC,EAAC7B,EAAmB8B,EAAAA,EAAA,CAClB,aAAW,WACX,YAAWd,EAAS,iBAAce,EAClC,gBAAc,OACd,cAAarC,EACbsC,QAZe,SAAAN,GACjBA,EAAMC,kBACND,EAAMO,iBACNlB,EAAYW,EAAMQ,gBAUhBzC,QAAS,CAAE0C,KAAM1C,EAAQ2C,YACzBtC,UAAWA,EACXuC,MAAO1C,EACPC,MAAOA,EACPC,cAAeA,EACfI,S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