@corva/ui 3.21.0-4 → 3.22.0-rc.1

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 (299) hide show
  1. package/cjs-bundle/clients/jsonApi/index.js +1 -1
  2. package/cjs-bundle/clients/jsonApi/index.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  4. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  5. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  6. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  7. package/cjs-bundle/components/AdvancedSlider/Handle.js +1 -1
  8. package/cjs-bundle/components/AdvancedSlider/Handle.js.map +1 -1
  9. package/cjs-bundle/components/Attachment/index.js +1 -1
  10. package/cjs-bundle/components/Attachment/index.js.map +1 -1
  11. package/cjs-bundle/components/Avatar/index.js +1 -1
  12. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  13. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  14. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  15. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  16. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  17. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  18. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  19. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  20. package/cjs-bundle/components/Chart/components/AxisOverlay.js +1 -1
  21. package/cjs-bundle/components/Chart/components/AxisOverlay.js.map +1 -1
  22. package/cjs-bundle/components/CollapsableSidebar.js +1 -1
  23. package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
  24. package/cjs-bundle/components/Comment/index.js +1 -1
  25. package/cjs-bundle/components/Comment/index.js.map +1 -1
  26. package/cjs-bundle/components/CommentInput/index.js +1 -1
  27. package/cjs-bundle/components/CommentInput/index.js.map +1 -1
  28. package/cjs-bundle/components/CopyToClipboard/CopyToClipboard.js +1 -1
  29. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  30. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  31. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  32. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
  33. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
  34. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
  35. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  36. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  37. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  38. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  39. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  40. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  41. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  42. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  43. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  44. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  46. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  49. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  50. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  51. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  52. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  53. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  54. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  55. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  56. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  57. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  58. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  59. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  60. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  61. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  62. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  63. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  64. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  65. package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
  66. package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
  67. package/cjs-bundle/components/FeedItem/FeedItemEditProvider/FeedItemEditModal.js +1 -1
  68. package/cjs-bundle/components/FeedItem/FeedItemEditProvider/FeedItemEditModal.js.map +1 -1
  69. package/cjs-bundle/components/FeedItem/components/FeedComments.js +1 -1
  70. package/cjs-bundle/components/FeedItem/components/FeedComments.js.map +1 -1
  71. package/cjs-bundle/components/FeedItem/components/Reactions.js +1 -1
  72. package/cjs-bundle/components/FeedItem/components/Reactions.js.map +1 -1
  73. package/cjs-bundle/components/FilePreview/index.js +1 -1
  74. package/cjs-bundle/components/FilePreview/index.js.map +1 -1
  75. package/cjs-bundle/components/ImageViewer/index.js +1 -1
  76. package/cjs-bundle/components/ImageViewer/index.js.map +1 -1
  77. package/cjs-bundle/components/OffsetWellChips/Chip.js +1 -1
  78. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
  79. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
  80. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js +1 -1
  81. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js.map +1 -1
  82. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  83. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  84. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  85. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  86. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  87. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  88. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/SidetrackSwitch.js +1 -1
  89. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/SidetrackSwitch.js.map +1 -1
  90. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  91. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  92. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  93. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  94. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  95. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  96. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  97. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  98. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  99. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  100. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  101. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  102. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  103. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  104. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  105. package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
  106. package/cjs-bundle/components/OffsetWellPickerV4/components/Filter/Filter.js +1 -1
  107. package/cjs-bundle/components/OffsetWellPickerV4/components/Filter/Filter.js.map +1 -1
  108. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js +1 -1
  109. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js.map +1 -1
  110. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  111. package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js.map +1 -1
  112. package/cjs-bundle/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js +1 -1
  113. package/cjs-bundle/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js.map +1 -1
  114. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  115. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  116. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  117. package/cjs-bundle/components/PinnableFilters/effects/index.js +1 -1
  118. package/cjs-bundle/components/PinnableFilters/effects/index.js.map +1 -1
  119. package/cjs-bundle/components/Popover/Popover.js +1 -1
  120. package/cjs-bundle/components/Popper/Popper.js +1 -1
  121. package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  122. package/cjs-bundle/components/WellSummary/WellSummaryItemValue.js +1 -1
  123. package/cjs-bundle/components/WellSummary/WellSummaryItemValue.js.map +1 -1
  124. package/cjs-bundle/componentsV2/Accordion/Accordion.js +1 -1
  125. package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
  126. package/cjs-bundle/componentsV2/Avatar/Avatar.js +1 -1
  127. package/cjs-bundle/componentsV2/Avatar/constants.js +1 -1
  128. package/cjs-bundle/config/highcharts/highcharts.js +1 -1
  129. package/cjs-bundle/config/highcharts/highcharts.js.map +1 -1
  130. package/cjs-bundle/config/theme/lightThemePalette.mjs.js +1 -1
  131. package/cjs-bundle/config/theme/lightThemePalette.mjs.js.map +1 -1
  132. package/cjs-bundle/permissions/constants/index.js +1 -1
  133. package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
  134. package/cjs-bundle/utils/index.js +1 -1
  135. package/cjs-bundle/utils/index.js.map +1 -1
  136. package/cjs-bundle/utils/lasParser.js +1 -1
  137. package/cjs-bundle/utils/lasParser.js.map +1 -1
  138. package/cjs-bundle/utils/main.js +1 -1
  139. package/cjs-bundle/utils/main.js.map +1 -1
  140. package/cjs-bundle/utils/mapUnits.js +1 -1
  141. package/cjs-bundle/utils/mapUnits.js.map +1 -1
  142. package/cjs-bundle/utils/permissions.js +1 -1
  143. package/cjs-bundle/utils/permissions.js.map +1 -1
  144. package/clients/jsonApi/index.d.ts +1 -0
  145. package/clients/jsonApi/index.d.ts.map +1 -1
  146. package/clients/jsonApi/index.js +1 -1
  147. package/clients/jsonApi/index.js.map +1 -1
  148. package/components/AddComment/Popover.js +1 -1
  149. package/components/AddComment/Popover.js.map +1 -1
  150. package/components/AddComment/components/Content.js +1 -1
  151. package/components/AddComment/components/Content.js.map +1 -1
  152. package/components/AdvancedSlider/AdvancedSlider.stories.d.ts.map +1 -1
  153. package/components/AdvancedSlider/Handle.d.ts.map +1 -1
  154. package/components/AdvancedSlider/Handle.js +1 -1
  155. package/components/AdvancedSlider/Handle.js.map +1 -1
  156. package/components/BICOffsetPickerDialog/index.js +1 -1
  157. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  158. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  159. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  160. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  161. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  162. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  163. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  164. package/components/Chart/components/AxisOverlay.d.ts +3 -1
  165. package/components/Chart/components/AxisOverlay.d.ts.map +1 -1
  166. package/components/Chart/components/AxisOverlay.js +1 -1
  167. package/components/Chart/components/AxisOverlay.js.map +1 -1
  168. package/components/CollapsableSidebar.js +1 -1
  169. package/components/CollapsableSidebar.js.map +1 -1
  170. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  171. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  172. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.stories.d.ts.map +1 -1
  173. package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
  174. package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
  175. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
  176. package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
  177. package/components/DocumentViewer/DocumentViewer.js +1 -1
  178. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  179. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  180. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  181. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  182. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  183. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  184. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  185. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  186. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  187. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  188. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  189. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  190. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  191. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  192. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  193. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  194. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  195. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  196. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  197. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  198. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  199. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  200. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  201. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  202. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  203. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  204. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  205. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  206. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  207. package/components/EChartsWrapper/ECharts.stories.d.ts +1 -0
  208. package/components/EChartsWrapper/ECharts.stories.d.ts.map +1 -1
  209. package/components/FeedItem/FeedItem.js +1 -1
  210. package/components/FeedItem/FeedItem.js.map +1 -1
  211. package/components/FeedItem/components/FeedComments.js +1 -1
  212. package/components/FeedItem/components/FeedComments.js.map +1 -1
  213. package/components/ImageViewer/index.js +1 -1
  214. package/components/ImageViewer/index.js.map +1 -1
  215. package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
  216. package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
  217. package/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js +1 -1
  218. package/components/OffsetWellPickerV2/components/Filter/SidetrackSwitch.js.map +1 -1
  219. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  220. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  221. package/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  222. package/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  223. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  224. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  225. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/SidetrackSwitch.js +1 -1
  226. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/SidetrackSwitch.js.map +1 -1
  227. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  228. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  229. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  230. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  231. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  232. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  233. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  234. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  235. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  236. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  237. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  238. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  239. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  240. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  241. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
  242. package/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
  243. package/components/OffsetWellPickerV4/components/Filter/Filter.js +1 -1
  244. package/components/OffsetWellPickerV4/components/Filter/Filter.js.map +1 -1
  245. package/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js +1 -1
  246. package/components/OffsetWellPickerV4/components/OffsetWellsTable/MetricsSettingMenu.js.map +1 -1
  247. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js +1 -1
  248. package/components/OffsetWellPickerV4/components/OffsetWellsTable/OffsetWellsTable.js.map +1 -1
  249. package/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js +1 -1
  250. package/components/OffsetWellPickerV4/components/Toolbar/Toolbar.js.map +1 -1
  251. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  252. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  253. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  254. package/components/PinnableFilters/effects/index.js +1 -1
  255. package/components/PinnableFilters/effects/index.js.map +1 -1
  256. package/components/Popover/Popover.js +1 -1
  257. package/components/Popper/Popper.js +1 -1
  258. package/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
  259. package/componentsV2/Accordion/Accordion.d.ts +5 -1
  260. package/componentsV2/Accordion/Accordion.d.ts.map +1 -1
  261. package/componentsV2/Accordion/Accordion.js +1 -1
  262. package/componentsV2/Accordion/Accordion.stories.d.ts +1 -0
  263. package/componentsV2/Accordion/Accordion.stories.d.ts.map +1 -1
  264. package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.d.ts.map +1 -1
  265. package/componentsV2/AppHeader/V3/AssetSelector/AssetSelector.js +1 -1
  266. package/componentsV2/CopyToClipboard/CopyToClipboard.js +1 -1
  267. package/config/highcharts/highcharts.d.ts.map +1 -1
  268. package/config/highcharts/highcharts.js +1 -1
  269. package/config/highcharts/highcharts.js.map +1 -1
  270. package/config/theme/lightThemePalette.d.mts +12 -36
  271. package/config/theme/lightThemePalette.d.mts.map +1 -1
  272. package/config/theme/lightThemePalette.mjs.js +1 -1
  273. package/config/theme/lightThemePalette.mjs.js.map +1 -1
  274. package/config/theme/themeVariables.d.mts +9 -27
  275. package/config/theme/themeVariables.d.mts.map +1 -1
  276. package/package.json +5 -4
  277. package/permissions/constants/index.js +1 -1
  278. package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
  279. package/types/shared/Completions.d.ts +0 -5
  280. package/types/shared/Completions.d.ts.map +1 -1
  281. package/types/shared/assets.d.ts +6 -0
  282. package/types/shared/assets.d.ts.map +1 -0
  283. package/types/shared/index.d.ts +1 -0
  284. package/types/shared/index.d.ts.map +1 -1
  285. package/utils/lasParser.d.ts +2 -1
  286. package/utils/lasParser.js +1 -1
  287. package/utils/lasParser.js.map +1 -1
  288. package/utils/main.d.ts +53 -112
  289. package/utils/main.d.ts.map +1 -1
  290. package/utils/main.js +1 -1
  291. package/utils/main.js.map +1 -1
  292. package/utils/mapUnits.d.ts +1 -10
  293. package/utils/mapUnits.d.ts.map +1 -1
  294. package/utils/mapUnits.js +1 -1
  295. package/utils/mapUnits.js.map +1 -1
  296. package/utils/permissions.d.ts +2 -1
  297. package/utils/permissions.d.ts.map +1 -1
  298. package/utils/permissions.js +1 -1
  299. package/utils/permissions.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsableSidebar.js","sources":["../../../src/components/CollapsableSidebar.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\nimport { withStyles, IconButton, Box } from '@material-ui/core';\nimport ChevronLeftRoundedIcon from '@material-ui/icons/ChevronLeftRounded';\nimport ChevronRightRoundedIcon from '@material-ui/icons/ChevronRightRounded';\n\nimport { SideBar } from './DevCenter';\n\nconst PAGE_NAME = 'CollapsableSidebar';\n\nconst muiStyles = theme => ({\n drawer: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n drawerPaper: {\n '&$drawerClosed': {\n cursor: 'pointer',\n '&:hover::before': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n background: theme.palette.background.b7,\n },\n },\n },\n drawerClosed: {\n width: ({ closedWidth }) => closedWidth,\n },\n openToggleIcon: {\n fontSize: '1.25rem',\n color: theme.palette.primary.text7,\n },\n openToggleIconClosed: {\n transform: 'rotate(180deg)',\n },\n openToggleIconButton: {\n padding: 6,\n },\n openToggleContainer: {\n display: 'flex',\n position: 'absolute',\n bottom: 0,\n width: '100%',\n flex: '0 0',\n padding: theme.spacing(2, 1, 1.5),\n },\n openToggleContainerCollapsed: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n justifyContent: 'center',\n },\n openToggleContainerOpened: {\n justifyContent: ({ anchor }) => (anchor === 'left' ? 'flex-end' : 'flex-start'),\n },\n list: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n overflow: 'hidden',\n paddingBottom: 60,\n },\n});\n\nconst CollapsableSidebar = ({\n classes,\n children,\n onStateChange,\n initialState,\n drawerPaperClassName,\n isToolbarGutterShown,\n openedDrawerWidth,\n anchor,\n}) => {\n const [isOpen, setIsOpen] = useState(initialState);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n onStateChange(!isOpen);\n };\n\n const onSidebarClick = () => {\n if (!isOpen) {\n toggleIsOpen();\n }\n };\n\n const ChevroneIcon = anchor === 'left' ? ChevronLeftRoundedIcon : ChevronRightRoundedIcon;\n\n return (\n <SideBar\n isToolbarGutterShown={isToolbarGutterShown}\n drawerWidth={openedDrawerWidth}\n drawerClassName={classnames(classes.drawer, !isOpen && classes.drawerClosed)}\n drawerPaperClassName={classnames(\n classes.drawer,\n classes.drawerPaper,\n drawerPaperClassName,\n !isOpen && classes.drawerClosed\n )}\n anchor={anchor}\n listClassName={classes.list}\n onClick={onSidebarClick}\n >\n {children}\n <Box\n className={classnames(classes.openToggleContainer, {\n [classes.openToggleContainerCollapsed]: !isOpen,\n [classes.openToggleContainerOpened]: isOpen,\n })}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_toggle`}\n aria-label=\"toggle sidebar\"\n className={classes.openToggleIconButton}\n onClick={toggleIsOpen}\n >\n <ChevroneIcon\n className={classnames(classes.openToggleIcon, {\n [classes.openToggleIconClosed]: !isOpen,\n })}\n />\n </IconButton>\n </Box>\n </SideBar>\n );\n};\n\nCollapsableSidebar.propTypes = {\n children: PropTypes.node.isRequired,\n onStateChange: PropTypes.func,\n initialState: PropTypes.bool,\n drawerPaperClassName: PropTypes.string,\n isToolbarGutterShown: PropTypes.bool,\n openedDrawerWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n anchor: PropTypes.oneOf(['left', 'right']),\n // eslint-disable-next-line react/no-unused-prop-types\n closedWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nCollapsableSidebar.defaultProps = {\n onStateChange: noop,\n initialState: true,\n closedWidth: 48,\n drawerPaperClassName: null,\n isToolbarGutterShown: undefined,\n openedDrawerWidth: undefined,\n anchor: undefined,\n};\n\nexport default withStyles(muiStyles)(CollapsableSidebar);\n"],"names":["CollapsableSidebar","_ref3","_classnames","classes","children","onStateChange","initialState","drawerPaperClassName","isToolbarGutterShown","openedDrawerWidth","anchor","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","toggleIsOpen","ChevroneIcon","ChevronLeftRoundedIcon","ChevronRightRoundedIcon","_jsxs","SideBar","drawerWidth","drawerClassName","classnames","drawer","drawerClosed","drawerPaper","listClassName","list","onClick","_jsx","jsx","Box","className","openToggleContainer","openToggleContainerCollapsed","openToggleContainerOpened","IconButton","concat","openToggleIconButton","openToggleIcon","openToggleIconClosed","propTypes","PropTypes","node","isRequired","func","bool","string","oneOfType","number","oneOf","closedWidth","defaultProps","noop","undefined","CollapsableSidebar$1","withStyles","theme","display","flexDirection","height","cursor","content","position","top","right","bottom","left","background","palette","b7","width","_ref","fontSize","color","primary","text7","transform","padding","flex","spacing","paddingRight","paddingLeft","justifyContent","_ref2","flexGrow","overflow","paddingBottom"],"mappings":"s+YAsEMA,EAAqB,SASrBC,GAAA,IAAAC,EARJC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,cACAC,IAAAA,aACAC,IAAAA,qBACAC,IAAAA,qBACAC,IAAAA,kBACAC,IAAAA,OAE4BC,EAAAA,EAAQA,SAACL,GA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OAAQL,EAAAA,QAAUO,UAGhEpD,EAAmBuD,aAAe,CAChClD,cAAemD,EAAIA,KACnBlD,cAAc,EACdgD,YAAa,GACb/C,qBAAsB,KACtBC,0BAAsBiD,EACtBhD,uBAAmBgD,EACnB/C,YAAQ+C,GAGV,IAAAC,EAAeC,cAhJG,SAAAC,GAAK,MAAK,CAC1BlC,OAAQ,CACNmC,QAAS,OACTC,cAAe,SACfC,OAAQ,QAEVnC,YAAa,CACX,iBAAkB,CAChBoC,OAAQ,UACR,kBAAmB,CACjBC,QAAS,KACTC,SAAU,WACVC,IAAK,EACLC,MAAO,EACPC,OAAQ,EACRC,KAAM,EACNC,WAAYX,EAAMY,QAAQD,WAAWE,MAI3C9C,aAAc,CACZ+C,MAAO,SAAAC,GAAc,SAAXrB,WAA6B,GAEzCZ,eAAgB,CACdkC,SAAU,UACVC,MAAOjB,EAAMY,QAAQM,QAAQC,OAE/BpC,qBAAsB,CACpBqC,UAAW,kBAEbvC,qBAAsB,CACpBwC,QAAS,GAEX7C,oBAAqB,CACnByB,QAAS,OACTK,SAAU,WACVG,OAAQ,EACRK,MAAO,OACPQ,KAAM,MACND,QAASrB,EAAMuB,QAAQ,EAAG,EAAG,MAE/B9C,6BAA8B,CAC5B+C,aAAcxB,EAAMuB,QAAQ,GAC5BE,YAAazB,EAAMuB,QAAQ,GAC3BG,eAAgB,UAElBhD,0BAA2B,CACzBgD,eAAgB,SAAAC,GAAS,MAAmB,WAAzB7E,OAAkC,WAAa,YAAY,GAEhFoB,KAAM,CACJ+B,QAAS,OACTC,cAAe,SACf0B,SAAU,EACVC,SAAU,SACVC,cAAe,IAElB,GAwFc/B,CAAsB3D"}
1
+ {"version":3,"file":"CollapsableSidebar.js","sources":["../../../src/components/CollapsableSidebar.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\nimport { withStyles, IconButton, Box } from '@material-ui/core';\nimport ChevronLeftRoundedIcon from '@material-ui/icons/ChevronLeftRounded';\nimport ChevronRightRoundedIcon from '@material-ui/icons/ChevronRightRounded';\n\nimport { SideBar } from './DevCenter';\n\nconst PAGE_NAME = 'CollapsableSidebar';\n\nconst muiStyles = theme => ({\n drawer: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n drawerPaper: {\n '&$drawerClosed': {\n cursor: 'pointer',\n '&:hover::before': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n background: theme.palette.background.b7,\n },\n },\n },\n drawerClosed: {\n width: ({ closedWidth }) => closedWidth,\n },\n openToggleIcon: {\n fontSize: '1.25rem',\n color: theme.palette.primary.text7,\n },\n openToggleIconClosed: {\n transform: 'rotate(180deg)',\n },\n openToggleIconButton: {\n padding: 6,\n },\n openToggleContainer: {\n display: 'flex',\n position: 'absolute',\n bottom: 0,\n width: '100%',\n flex: '0 0',\n padding: theme.spacing(2, 1, 1.5),\n },\n openToggleContainerCollapsed: {\n paddingRight: theme.spacing(1),\n paddingLeft: theme.spacing(1),\n justifyContent: 'center',\n },\n openToggleContainerOpened: {\n justifyContent: ({ anchor }) => (anchor === 'left' ? 'flex-end' : 'flex-start'),\n },\n list: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n overflow: 'hidden',\n paddingBottom: 60,\n },\n});\n\nconst CollapsableSidebar = ({\n classes,\n children,\n onStateChange,\n initialState,\n drawerPaperClassName,\n isToolbarGutterShown,\n openedDrawerWidth,\n anchor,\n}) => {\n const [isOpen, setIsOpen] = useState(initialState);\n\n const toggleIsOpen = () => {\n setIsOpen(!isOpen);\n onStateChange(!isOpen);\n };\n\n const onSidebarClick = () => {\n if (!isOpen) {\n toggleIsOpen();\n }\n };\n\n const ChevroneIcon = anchor === 'left' ? ChevronLeftRoundedIcon : ChevronRightRoundedIcon;\n\n return (\n <SideBar\n isToolbarGutterShown={isToolbarGutterShown}\n drawerWidth={openedDrawerWidth}\n drawerClassName={classnames(classes.drawer, !isOpen && classes.drawerClosed)}\n drawerPaperClassName={classnames(\n classes.drawer,\n classes.drawerPaper,\n drawerPaperClassName,\n !isOpen && classes.drawerClosed\n )}\n anchor={anchor}\n listClassName={classes.list}\n onClick={onSidebarClick}\n >\n {children}\n <Box\n className={classnames(classes.openToggleContainer, {\n [classes.openToggleContainerCollapsed]: !isOpen,\n [classes.openToggleContainerOpened]: isOpen,\n })}\n >\n <IconButton\n data-testid={`${PAGE_NAME}_toggle`}\n aria-label=\"toggle sidebar\"\n className={classes.openToggleIconButton}\n onClick={toggleIsOpen}\n >\n <ChevroneIcon\n className={classnames(classes.openToggleIcon, {\n [classes.openToggleIconClosed]: !isOpen,\n })}\n />\n </IconButton>\n </Box>\n </SideBar>\n );\n};\n\nCollapsableSidebar.propTypes = {\n children: PropTypes.node.isRequired,\n onStateChange: PropTypes.func,\n initialState: PropTypes.bool,\n drawerPaperClassName: PropTypes.string,\n isToolbarGutterShown: PropTypes.bool,\n openedDrawerWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n anchor: PropTypes.oneOf(['left', 'right']),\n // eslint-disable-next-line react/no-unused-prop-types\n closedWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nCollapsableSidebar.defaultProps = {\n onStateChange: noop,\n initialState: true,\n closedWidth: 48,\n drawerPaperClassName: null,\n isToolbarGutterShown: undefined,\n openedDrawerWidth: undefined,\n anchor: undefined,\n};\n\nexport default withStyles(muiStyles)(CollapsableSidebar);\n"],"names":["CollapsableSidebar","_ref3","_classnames","classes","children","onStateChange","initialState","drawerPaperClassName","isToolbarGutterShown","openedDrawerWidth","anchor","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","toggleIsOpen","ChevroneIcon","ChevronLeftRoundedIcon","ChevronRightRoundedIcon","_jsxs","SideBar","drawerWidth","drawerClassName","classnames","drawer","drawerClosed","drawerPaper","listClassName","list","onClick","_jsx","jsx","Box","className","openToggleContainer","openToggleContainerCollapsed","openToggleContainerOpened","IconButton","concat","openToggleIconButton","openToggleIcon","openToggleIconClosed","propTypes","PropTypes","node","isRequired","func","bool","string","oneOfType","number","oneOf","closedWidth","defaultProps","noop","undefined","CollapsableSidebar$1","withStyles","theme","display","flexDirection","height","cursor","content","position","top","right","bottom","left","background","palette","b7","width","_ref","fontSize","color","primary","text7","transform","padding","flex","spacing","paddingRight","paddingLeft","justifyContent","_ref2","flexGrow","overflow","paddingBottom"],"mappings":"ssYAsEMA,EAAqB,SASrBC,GAAA,IAAAC,EARJC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,cACAC,IAAAA,aACAC,IAAAA,qBACAC,IAAAA,qBACAC,IAAAA,kBACAC,IAAAA,OAE4BC,EAAAA,EAAQA,SAACL,GAAaM,EAAAC,EAAAA,QAAAC,EAAA,GAA3CC,EAAMH,EAAA,GAAEI,EAASJ,EAAA,GAElBK,EAAe,WACnBD,GAAWD,GACXV,GAAeU,IASXG,EAA0B,SAAXR,EAAoBS,EAAAA,QAAyBC,EAAAA,QAElE,OACEC,EAAAA,KAACC,EAAO,CACNd,qBAAsBA,EACtBe,YAAad,EACbe,gBAAiBC,EAAU,QAACtB,EAAQuB,QAASX,GAAUZ,EAAQwB,cAC/DpB,qBAAsBkB,EAAU,QAC9BtB,EAAQuB,OACRvB,EAAQyB,YACRrB,GACCQ,GAAUZ,EAAQwB,cAErBjB,OAAQA,EACRmB,cAAe1B,EAAQ2B,KACvBC,QArBmB,WAChBhB,GACHE,KAmBwBb,SAEvBA,CAAAA,EACD4B,EAAAC,IAACC,MAAG,CACFC,UAAWV,EAAAA,QAAWtB,EAAQiC,sCAC3BjC,EAAQkC,8BAAgCtB,GACxCZ,EAAAA,QAAAA,EAAAA,EAAQmC,0BAA4BvB,GACpCb,IAAAE,SAEH4B,MAACO,aAAU,CACT,cAAA,GAAAC,OA5GQ,qBA4G2B,WACnC,aAAW,iBACXL,UAAWhC,EAAQsC,qBACnBV,QAASd,EAAab,SAEtB4B,MAACd,EAAY,CACXiB,UAA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cxB,EAAMuB,QAAQ,GAC5BE,YAAazB,EAAMuB,QAAQ,GAC3BG,eAAgB,UAElBhD,0BAA2B,CACzBgD,eAAgB,SAAAC,GAAS,MAAmB,WAAzB7E,OAAkC,WAAa,YAAY,GAEhFoB,KAAM,CACJ+B,QAAS,OACTC,cAAe,SACf0B,SAAU,EACVC,SAAU,SACVC,cAAe,IAElB,GAwFc/B,CAAsB3D"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),s=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),u=require("react"),c=require("prop-types"),d=require("moment"),m=require("lodash"),p=require("classnames"),h=require("@material-ui/core/styles"),f=require("@material-ui/core/Typography"),v=require("@material-ui/core/Menu"),y=require("@material-ui/core/MenuItem"),g=require("@material-ui/icons/MoreVert"),b=require("../../clients/jsonApi/index.js"),C=require("./styles.css.js"),j=require("../CommentWrapper.js"),x=require("../CommentLoader.js"),M=require("../CommentInput/index.js"),q=require("../Avatar/index.js"),D=require("../Attachment/index.js"),w=require("../IconButton/index.js"),E=require("../ConfirmationDialog.js"),O=require("../UserCardPopover.js"),I=require("../UserMention/utils/index.js"),A=require("../../utils/mobileDetect.js"),k=require("../../utils/main.js"),N=require("react/jsx-runtime");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var S=_(e),R=_(t),P=_(n),U=_(r),z=_(i),L=_(a),T=_(o),W=_(s),B=_(l),F=_(c),H=_(d),V=_(p),K=_(f),Y=_(v),G=_(y),J=_(g);function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T.default(e);if(t){var i=T.default(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return L.default(this,n)}}var Z={chatAvatarWrapper:{paddingTop:2,position:"absolute",top:6,left:0},commentInfoContainer:{display:"inline-flex",alignItems:"center",width:"100%",paddingTop:5},userNameWrapper:{overflow:"hidden"},infoContainer:{display:"inline-block",verticalAlign:"top",width:"100%",paddingLeft:33}},$=function(e){z.default(n,e);var t=X(n);function n(e){var r,i;return R.default(this,n),r=t.call(this,e),W.default(U.default(r),"deleteComment",(i=S.default(B.default.mark((function e(t,n){var r;return B.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.deleteFeedItemComment(t,n);case 3:r=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,t){return i.apply(this,arguments)})),W.default(U.default(r),"showIntoView",(function(){r.props.handleShowOnMount(),r.commentEl.current.scrollIntoView({block:"end"})})),W.default(U.default(r),"handleOpenActionsMenu",(function(e){e.stopPropagation(),r.setState({actionsMenuAnchorEl:e.currentTarget})})),W.default(U.default(r),"handleCloseActionsMenu",(function(e){e.stopPropagation(),r.setState({actionsMenuAnchorEl:null})})),W.default(U.default(r),"handleKeyDown",(function(e){27===e.keyCode&&r.setState({isEditing:!1}),document.removeEventListener("keydown",r.handleKeyDown,!1)})),W.default(U.default(r),"handleEditMenuItem",(function(){document.addEventListener("keydown",r.handleKeyDown,!1),r.setState({isEditing:!0},(function(){r.inputEl.current&&r.inputEl.current.focus()}))})),W.default(U.default(r),"getEditCommentProps",(function(){var e=r.props.comment,t=e.id,n=e.body,i=e.attachment;return{editFeedItemId:e.feed_activity_id,editCommentId:t,editComment:n,editAttachment:i}})),W.default(U.default(r),"onEditFinish",(function(){r.setState({isEditing:!1,isLoading:!1})})),W.default(U.default(r),"handleDeleteMenuItem",(function(){r.setState({openDeleteDialog:!0})})),W.default(U.default(r),"handleDelete",S.default(B.default.mark((function e(){var t,n,i;return B.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.props.comment.id,n=r.props.comment.feed_activity_id,r.setState({isLoading:!0}),e.next=5,r.deleteComment(n,t);case 5:i=e.sent,r.setState({isLoading:!1,openDeleteDialog:!1}),i&&r.props.handleDeleteCallback(t);case 8:case"end":return e.stop()}}),e)})))),r.state={actionsMenuAnchorEl:null,isLoading:!1,isEditing:!1,openDeleteDialog:!1},r.inputEl=u.createRef(),r.commentEl=u.createRef(),r}return P.default(n,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"isCurrentUserCommentCreator",get:function(){return Number(m.get(this.props.comment,["user","id"]))===Number(this.props.currentUser.id)}},{key:"renderMenuIcon",value:function(){var e=this.isCurrentUserCommentCreator,t=this.isCurrentUserCommentCreator||m.includes(this.props.comment.allowed_actions,"destroy");return t||e?N.jsxs("div",{className:C.cCommentMenu,children:[N.jsx(w,{"data-testid":"".concat("comment","_menuButton"),"aria-label":"Actions","aria-owns":this.state.actionsMenuAnchorEl?"c-comment__actions-menu":void 0,"aria-haspopup":"true",className:this.props.classes.iconButtonRoot,size:"small",onClick:this.handleOpenActionsMenu,children:N.jsx(J.default,{})}),N.jsxs(Y.default,{id:"c-comment__actions-menu",anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:this.state.actionsMenuAnchorEl,open:!!this.state.actionsMenuAnchorEl,onClick:this.handleCloseActionsMenu,onClose:this.handleCloseActionsMenu,children:[e&&N.jsx(G.default,{"data-testid":"".concat("comment","_editMenuItem"),onClick:this.handleEditMenuItem,children:"Edit"}),t&&N.jsx(G.default,{"data-testid":"".concat("comment","_deleteMenuItem"),onClick:this.handleDeleteMenuItem,children:"Delete"})]})]}):null}},{key:"render",value:function(){var e,t,n=this,r=this.state,i=r.isLoading,a=r.isEditing;if(i){var o=this.props.spaceAround;return N.jsx(x,{spaceAround:o})}var s=this.props,l=s.comment,u=s.classes,c=s.spaceAround,d=s.isNative,p=s.patchCommentCallback,h=s.companyId;if(a)return N.jsx(M,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){W.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({inputRef:this.inputEl,postComment:m.noop,exitEditMode:this.onEditFinish,setIsEditting:function(){return n.setState({isLoading:!0})},patchCommentCallback:p,companyId:h,currentUser:this.props.currentUser},this.getEditCommentProps()));var f=k.getUserFullName(l.user),v=d?"MM/DD HH:mm":"MM/DD/YY HH:mm",y=H.default(l.created_at).format(v),g=(null==l||null===(e=l.attachment)||void 0===e?void 0:e.signed_url)||(null==l||null===(t=l.attachment)||void 0===t?void 0:t.url),b=m.get(l,["attachment","size"]),w=m.get(l,["attachment","file_name"]);return N.jsxs("div",{"data-testid":"".concat("comment","_commentItem_").concat(l.body),className:V.default(C.cComment,W.default({},C.cCommentNative,d)),ref:this.commentEl,children:[N.jsxs(j,{spaceAround:c,className:this.props.classes.commentWrapper,children:[N.jsx("div",{style:Z.chatAvatarWrapper,children:d?N.jsx(q.AvatarComponent,{size:24,displayName:f,imgSrc:m.get(l,["user","profile_photo"]),className:this.props.classes.avatar}):N.jsx(O,{user:l.user,currentUser:this.props.currentUser,children:N.jsx(q.AvatarComponent,{size:24,displayName:f,imgSrc:m.get(l,["user","profile_photo"]),className:this.props.classes.avatar})})}),N.jsxs("div",{style:Z.infoContainer,children:[N.jsx("div",{children:N.jsxs("div",{style:Z.commentInfoContainer,children:[N.jsx("div",{style:Z.userNameWrapper,children:N.jsx(K.default,{"data-testid":"".concat("comment","_userName"),variant:"subtitle2",noWrap:!0,className:u.userName,children:f})}),N.jsx("div",{style:Z.timeWrapper,children:N.jsx(K.default,{"data-testid":"".concat("comment","_addTime"),variant:"caption",classes:{root:u.timeRoot},children:y})})]})}),N.jsxs("div",{className:C.cCommentBody,children:[this.renderMenuIcon(),N.jsx(K.default,{"data-testid":"".concat("comment","_commentMessage"),variant:"body1",classes:{root:u.textRoot},children:I.formatMentionText(l.body,l.mentioned_users,d,"#00bcd4",this.props.currentUser)}),g&&N.jsx(D,{attachmentUrl:g,attachmentSize:b,size:"small",fileName:w})]})]})]}),this.state.openDeleteDialog&&N.jsx(E,{open:this.state.openDeleteDialog,text:"Do you really want to delete comment?",handleClose:function(){return n.setState({openDeleteDialog:!1})},handleOk:this.handleDelete,okText:"Delete"})]})}}]),n}(u.PureComponent);$.propTypes={comment:F.default.shape({}).isRequired,showOnMount:F.default.bool,spaceAround:F.default.bool,handleShowOnMount:F.default.func,handleEdit:F.default.func,handleDeleteCallback:F.default.func.isRequired,patchCommentCallback:F.default.func.isRequired,companyId:F.default.number,currentUser:F.default.shape(),classes:F.default.shape({}).isRequired,isNative:F.default.bool},$.defaultProps={showOnMount:!1,spaceAround:!1,handleShowOnMount:m.noop,handleEdit:m.noop,companyId:null,isNative:A.isNativeDetected,currentUser:{}};var ee=h.withStyles((function(e){return{commentWrapper:{width:"100%"},timeRoot:{color:e.palette.primary.text7,float:"right",marginRight:5,marginLeft:8,fontSize:"12px"},textRoot:{marginTop:5,color:"#CCC",fontWeight:"normal",fontSize:"14px"},iconButtonRoot:{float:"right",visibility:"hidden",color:e.palette.primary.text7},userName:{fontSize:"12px",fontWeight:"bold"}}}))($);module.exports=ee;
1
+ "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),s=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),u=require("react"),c=require("prop-types"),d=require("moment"),m=require("lodash"),p=require("classnames"),h=require("@material-ui/core/styles"),f=require("@material-ui/core/Typography"),v=require("@material-ui/core/Menu"),y=require("@material-ui/core/MenuItem"),g=require("@material-ui/icons/MoreVert"),b=require("../../clients/jsonApi/index.js"),C=require("./styles.css.js"),j=require("../CommentWrapper.js"),x=require("../CommentLoader.js"),M=require("../CommentInput/index.js"),q=require("../Avatar/index.js"),D=require("../Attachment/index.js"),w=require("../IconButton/index.js"),E=require("../ConfirmationDialog.js"),O=require("../UserCardPopover.js"),I=require("../UserMention/utils/index.js"),A=require("../../utils/mobileDetect.js"),k=require("../../utils/main.js"),N=require("react/jsx-runtime");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var S=_(e),R=_(t),P=_(n),U=_(r),z=_(i),L=_(a),T=_(o),W=_(s),B=_(l),F=_(c),H=_(d),V=_(p),K=_(f),Y=_(v),G=_(y),J=_(g);function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T.default(e);if(t){var i=T.default(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return L.default(this,n)}}var Z={chatAvatarWrapper:{paddingTop:2,position:"absolute",top:6,left:0},commentInfoContainer:{display:"inline-flex",alignItems:"center",width:"100%",paddingTop:5},userNameWrapper:{overflow:"hidden"},infoContainer:{display:"inline-block",verticalAlign:"top",width:"100%",paddingLeft:33}},$=function(e){z.default(n,e);var t=X(n);function n(e){var r,i;return R.default(this,n),r=t.call(this,e),W.default(U.default(r),"deleteComment",(i=S.default(B.default.mark((function e(t,n){var r;return B.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.deleteFeedItemComment(t,n);case 3:r=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,t){return i.apply(this,arguments)})),W.default(U.default(r),"showIntoView",(function(){r.props.handleShowOnMount(),r.commentEl.current.scrollIntoView({block:"end"})})),W.default(U.default(r),"handleOpenActionsMenu",(function(e){e.stopPropagation(),r.setState({actionsMenuAnchorEl:e.currentTarget})})),W.default(U.default(r),"handleCloseActionsMenu",(function(e){e.stopPropagation(),r.setState({actionsMenuAnchorEl:null})})),W.default(U.default(r),"handleKeyDown",(function(e){27===e.keyCode&&r.setState({isEditing:!1}),document.removeEventListener("keydown",r.handleKeyDown,!1)})),W.default(U.default(r),"handleEditMenuItem",(function(){document.addEventListener("keydown",r.handleKeyDown,!1),r.setState({isEditing:!0},(function(){r.inputEl.current&&r.inputEl.current.focus()}))})),W.default(U.default(r),"getEditCommentProps",(function(){var e=r.props.comment,t=e.id,n=e.body,i=e.attachment;return{editFeedItemId:e.feed_activity_id,editCommentId:t,editComment:n,editAttachment:i}})),W.default(U.default(r),"onEditFinish",(function(){r.setState({isEditing:!1,isLoading:!1})})),W.default(U.default(r),"handleDeleteMenuItem",(function(){r.setState({openDeleteDialog:!0})})),W.default(U.default(r),"handleDelete",S.default(B.default.mark((function e(){var t,n,i;return B.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.props.comment.id,n=r.props.comment.feed_activity_id,r.setState({isLoading:!0}),e.next=5,r.deleteComment(n,t);case 5:i=e.sent,r.setState({isLoading:!1,openDeleteDialog:!1}),i&&r.props.handleDeleteCallback(t);case 8:case"end":return e.stop()}}),e)})))),r.state={actionsMenuAnchorEl:null,isLoading:!1,isEditing:!1,openDeleteDialog:!1},r.inputEl=u.createRef(),r.commentEl=u.createRef(),r}return P.default(n,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"isCurrentUserCommentCreator",get:function(){return Number(m.get(this.props.comment,["user","id"]))===Number(this.props.currentUser.id)}},{key:"renderMenuIcon",value:function(){var e=this.isCurrentUserCommentCreator,t=this.isCurrentUserCommentCreator||m.includes(this.props.comment.allowed_actions,"destroy");return t||e?N.jsxs("div",{className:C.cCommentMenu,children:[N.jsx(w,{"data-testid":"".concat("comment","_menuButton"),"aria-label":"Actions","aria-owns":this.state.actionsMenuAnchorEl?"c-comment__actions-menu":void 0,"aria-haspopup":"true",className:this.props.classes.iconButtonRoot,size:"small",onClick:this.handleOpenActionsMenu,children:N.jsx(J.default,{})}),N.jsxs(Y.default,{id:"c-comment__actions-menu",anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:this.state.actionsMenuAnchorEl,open:!!this.state.actionsMenuAnchorEl,onClick:this.handleCloseActionsMenu,onClose:this.handleCloseActionsMenu,children:[e&&N.jsx(G.default,{"data-testid":"".concat("comment","_editMenuItem"),onClick:this.handleEditMenuItem,children:"Edit"}),t&&N.jsx(G.default,{"data-testid":"".concat("comment","_deleteMenuItem"),onClick:this.handleDeleteMenuItem,children:"Delete"})]})]}):null}},{key:"render",value:function(){var e,t,n=this,r=this.state,i=r.isLoading,a=r.isEditing;if(i){var o=this.props.spaceAround;return N.jsx(x,{spaceAround:o})}var s=this.props,l=s.comment,u=s.classes,c=s.spaceAround,d=s.isNative,p=s.patchCommentCallback,h=s.companyId;if(a)return N.jsx(M,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){W.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({inputRef:this.inputEl,postComment:m.noop,exitEditMode:this.onEditFinish,setIsEditting:function(){return n.setState({isLoading:!0})},patchCommentCallback:p,companyId:h,currentUser:this.props.currentUser},this.getEditCommentProps()));var f=k.default.getUserFullName(l.user),v=d?"MM/DD HH:mm":"MM/DD/YY HH:mm",y=H.default(l.created_at).format(v),g=(null==l||null===(e=l.attachment)||void 0===e?void 0:e.signed_url)||(null==l||null===(t=l.attachment)||void 0===t?void 0:t.url),b=m.get(l,["attachment","size"]),w=m.get(l,["attachment","file_name"]);return N.jsxs("div",{"data-testid":"".concat("comment","_commentItem_").concat(l.body),className:V.default(C.cComment,W.default({},C.cCommentNative,d)),ref:this.commentEl,children:[N.jsxs(j,{spaceAround:c,className:this.props.classes.commentWrapper,children:[N.jsx("div",{style:Z.chatAvatarWrapper,children:d?N.jsx(q.AvatarComponent,{size:24,displayName:f,imgSrc:m.get(l,["user","profile_photo"]),className:this.props.classes.avatar}):N.jsx(O,{user:l.user,currentUser:this.props.currentUser,children:N.jsx(q.AvatarComponent,{size:24,displayName:f,imgSrc:m.get(l,["user","profile_photo"]),className:this.props.classes.avatar})})}),N.jsxs("div",{style:Z.infoContainer,children:[N.jsx("div",{children:N.jsxs("div",{style:Z.commentInfoContainer,children:[N.jsx("div",{style:Z.userNameWrapper,children:N.jsx(K.default,{"data-testid":"".concat("comment","_userName"),variant:"subtitle2",noWrap:!0,className:u.userName,children:f})}),N.jsx("div",{style:Z.timeWrapper,children:N.jsx(K.default,{"data-testid":"".concat("comment","_addTime"),variant:"caption",classes:{root:u.timeRoot},children:y})})]})}),N.jsxs("div",{className:C.cCommentBody,children:[this.renderMenuIcon(),N.jsx(K.default,{"data-testid":"".concat("comment","_commentMessage"),variant:"body1",classes:{root:u.textRoot},children:I.formatMentionText(l.body,l.mentioned_users,d,"#00bcd4",this.props.currentUser)}),g&&N.jsx(D,{attachmentUrl:g,attachmentSize:b,size:"small",fileName:w})]})]})]}),this.state.openDeleteDialog&&N.jsx(E,{open:this.state.openDeleteDialog,text:"Do you really want to delete comment?",handleClose:function(){return n.setState({openDeleteDialog:!1})},handleOk:this.handleDelete,okText:"Delete"})]})}}]),n}(u.PureComponent);$.propTypes={comment:F.default.shape({}).isRequired,showOnMount:F.default.bool,spaceAround:F.default.bool,handleShowOnMount:F.default.func,handleEdit:F.default.func,handleDeleteCallback:F.default.func.isRequired,patchCommentCallback:F.default.func.isRequired,companyId:F.default.number,currentUser:F.default.shape(),classes:F.default.shape({}).isRequired,isNative:F.default.bool},$.defaultProps={showOnMount:!1,spaceAround:!1,handleShowOnMount:m.noop,handleEdit:m.noop,companyId:null,isNative:A.isNativeDetected,currentUser:{}};var ee=h.withStyles((function(e){return{commentWrapper:{width:"100%"},timeRoot:{color:e.palette.primary.text7,float:"right",marginRight:5,marginLeft:8,fontSize:"12px"},textRoot:{marginTop:5,color:"#CCC",fontWeight:"normal",fontSize:"14px"},iconButtonRoot:{float:"right",visibility:"hidden",color:e.palette.primary.text7},userName:{fontSize:"12px",fontWeight:"bold"}}}))($);module.exports=ee;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Comment/index.js"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport { get, noop, includes } from 'lodash';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport { deleteFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport CommentWrapper from '~components/CommentWrapper';\nimport CommentLoader from '~components/CommentLoader';\nimport CommentInput from '~components/CommentInput';\nimport Avatar from '~components/Avatar';\nimport Attachment from '~components/Attachment';\nimport IconButton from '~components/IconButton';\nimport ConfirmationDialog from '~components/ConfirmationDialog';\nimport UserCardPopover from '~components/UserCardPopover';\nimport { formatMentionText } from '~components/UserMention/utils';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'comment';\n\nconst CREATED_AT_FORMAT = 'MM/DD/YY HH:mm';\nconst CREATED_AT_FORMAT_NATIVE = 'MM/DD HH:mm';\n\nconst style = {\n chatAvatarWrapper: {\n paddingTop: 2,\n position: 'absolute',\n top: 6,\n left: 0,\n },\n commentInfoContainer: {\n display: 'inline-flex',\n alignItems: 'center',\n width: '100%',\n paddingTop: 5,\n },\n userNameWrapper: { overflow: 'hidden' },\n infoContainer: {\n display: 'inline-block',\n verticalAlign: 'top',\n width: '100%',\n paddingLeft: 33,\n },\n};\n\nconst muiStyles = theme => ({\n commentWrapper: { width: '100%' },\n timeRoot: {\n color: theme.palette.primary.text7,\n float: 'right',\n marginRight: 5,\n marginLeft: 8,\n fontSize: '12px',\n },\n textRoot: {\n marginTop: 5,\n color: '#CCC',\n fontWeight: 'normal',\n fontSize: '14px',\n },\n iconButtonRoot: {\n float: 'right',\n visibility: 'hidden',\n color: theme.palette.primary.text7,\n },\n userName: {\n fontSize: '12px',\n fontWeight: 'bold',\n },\n});\n\nclass Comment extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n actionsMenuAnchorEl: null,\n isLoading: false,\n isEditing: false,\n openDeleteDialog: false,\n };\n this.inputEl = createRef();\n this.commentEl = createRef();\n }\n\n componentDidMount() {\n if (this.props.showOnMount) {\n this.showIntoView();\n }\n }\n\n get isCurrentUserCommentCreator() {\n return Number(get(this.props.comment, ['user', 'id'])) === Number(this.props.currentUser.id);\n }\n\n deleteComment = async (feedItemId, commentId) => {\n let commentResponse;\n\n try {\n commentResponse = await deleteFeedItemComment(feedItemId, commentId);\n } catch (e) {\n console.error(e);\n }\n\n return commentResponse;\n };\n\n showIntoView = () => {\n this.props.handleShowOnMount();\n this.commentEl.current.scrollIntoView({ block: 'end' });\n };\n\n handleOpenActionsMenu = event => {\n event.stopPropagation();\n this.setState({ actionsMenuAnchorEl: event.currentTarget });\n };\n\n handleCloseActionsMenu = event => {\n event.stopPropagation();\n this.setState({ actionsMenuAnchorEl: null });\n };\n\n handleKeyDown = event => {\n if (event.keyCode === 27) {\n this.setState({\n isEditing: false,\n });\n }\n document.removeEventListener('keydown', this.handleKeyDown, false);\n };\n\n handleEditMenuItem = () => {\n document.addEventListener('keydown', this.handleKeyDown, false);\n this.setState(\n {\n isEditing: true,\n },\n () => {\n if (this.inputEl.current) this.inputEl.current.focus();\n }\n );\n };\n\n // TODO: move to one prop, not multiple\n getEditCommentProps = () => {\n const { comment } = this.props;\n const editCommentId = comment.id;\n const editComment = comment.body;\n const editAttachment = comment.attachment;\n const editFeedItemId = comment.feed_activity_id;\n return {\n editFeedItemId,\n editCommentId,\n editComment,\n editAttachment,\n };\n };\n\n onEditFinish = () => {\n this.setState({ isEditing: false, isLoading: false });\n };\n\n handleDeleteMenuItem = () => {\n this.setState({ openDeleteDialog: true });\n };\n\n handleDelete = async () => {\n const { id } = this.props.comment;\n const feedItemId = this.props.comment.feed_activity_id;\n\n this.setState({ isLoading: true });\n\n const response = await this.deleteComment(feedItemId, id);\n\n this.setState({ isLoading: false, openDeleteDialog: false });\n if (response) this.props.handleDeleteCallback(id);\n };\n\n renderMenuIcon() {\n const showEdit = this.isCurrentUserCommentCreator;\n\n const showDelete =\n this.isCurrentUserCommentCreator || includes(this.props.comment.allowed_actions, 'destroy');\n\n if (!(showDelete || showEdit)) return null;\n\n return (\n <div className={styles.cCommentMenu}>\n <IconButton\n data-testid={`${PAGE_NAME}_menuButton`}\n aria-label=\"Actions\"\n aria-owns={this.state.actionsMenuAnchorEl ? 'c-comment__actions-menu' : undefined}\n aria-haspopup=\"true\"\n className={this.props.classes.iconButtonRoot}\n size=\"small\"\n onClick={this.handleOpenActionsMenu}\n >\n <MoreVertIcon />\n </IconButton>\n\n <Menu\n id=\"c-comment__actions-menu\"\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n anchorEl={this.state.actionsMenuAnchorEl}\n open={!!this.state.actionsMenuAnchorEl}\n onClick={this.handleCloseActionsMenu}\n onClose={this.handleCloseActionsMenu}\n >\n {showEdit && (\n <MenuItem data-testid={`${PAGE_NAME}_editMenuItem`} onClick={this.handleEditMenuItem}>\n Edit\n </MenuItem>\n )}\n\n {showDelete && (\n <MenuItem\n data-testid={`${PAGE_NAME}_deleteMenuItem`}\n onClick={this.handleDeleteMenuItem}\n >\n Delete\n </MenuItem>\n )}\n </Menu>\n </div>\n );\n }\n\n render() {\n const { isLoading, isEditing } = this.state;\n\n if (isLoading) {\n const { spaceAround } = this.props;\n return <CommentLoader spaceAround={spaceAround} />;\n }\n\n const { comment, classes, spaceAround, isNative, patchCommentCallback, companyId } = this.props;\n\n if (isEditing) {\n return (\n <CommentInput\n inputRef={this.inputEl}\n postComment={noop}\n exitEditMode={this.onEditFinish}\n setIsEditting={() => this.setState({ isLoading: true })}\n patchCommentCallback={patchCommentCallback}\n companyId={companyId}\n currentUser={this.props.currentUser}\n {...this.getEditCommentProps()}\n />\n );\n }\n\n const userFullName = utils.getUserFullName(comment.user);\n\n const format = isNative ? CREATED_AT_FORMAT_NATIVE : CREATED_AT_FORMAT;\n const time = moment(comment.created_at).format(format);\n\n const attachmentUrl = comment?.attachment?.signed_url || comment?.attachment?.url;\n const attachmentSize = get(comment, ['attachment', 'size']);\n const attachmentFileName = get(comment, ['attachment', 'file_name']);\n\n return (\n <div\n data-testid={`${PAGE_NAME}_commentItem_${comment.body}`}\n className={classNames(styles.cComment, { [styles.cCommentNative]: isNative })}\n ref={this.commentEl}\n >\n <CommentWrapper spaceAround={spaceAround} className={this.props.classes.commentWrapper}>\n <div style={style.chatAvatarWrapper}>\n {isNative ? (\n <Avatar\n size={24}\n displayName={userFullName}\n imgSrc={get(comment, ['user', 'profile_photo'])}\n className={this.props.classes.avatar}\n />\n ) : (\n <UserCardPopover user={comment.user} currentUser={this.props.currentUser}>\n <Avatar\n size={24}\n displayName={userFullName}\n imgSrc={get(comment, ['user', 'profile_photo'])}\n className={this.props.classes.avatar}\n />\n </UserCardPopover>\n )}\n </div>\n\n <div style={style.infoContainer}>\n <div>\n <div style={style.commentInfoContainer}>\n <div style={style.userNameWrapper}>\n <Typography\n data-testid={`${PAGE_NAME}_userName`}\n variant=\"subtitle2\"\n noWrap\n className={classes.userName}\n >\n {userFullName}\n </Typography>\n </div>\n\n <div style={style.timeWrapper}>\n <Typography\n data-testid={`${PAGE_NAME}_addTime`}\n variant=\"caption\"\n classes={{ root: classes.timeRoot }}\n >\n {time}\n </Typography>\n </div>\n </div>\n </div>\n\n <div className={styles.cCommentBody}>\n {this.renderMenuIcon()}\n <Typography\n data-testid={`${PAGE_NAME}_commentMessage`}\n variant=\"body1\"\n classes={{ root: classes.textRoot }}\n >\n {formatMentionText(\n comment.body,\n comment.mentioned_users,\n isNative,\n '#00bcd4',\n this.props.currentUser\n )}\n </Typography>\n\n {attachmentUrl && (\n <Attachment\n attachmentUrl={attachmentUrl}\n attachmentSize={attachmentSize}\n size=\"small\"\n fileName={attachmentFileName}\n />\n )}\n </div>\n </div>\n </CommentWrapper>\n\n {this.state.openDeleteDialog && (\n <ConfirmationDialog\n open={this.state.openDeleteDialog}\n text=\"Do you really want to delete comment?\"\n handleClose={() => this.setState({ openDeleteDialog: false })}\n handleOk={this.handleDelete}\n okText=\"Delete\"\n />\n )}\n </div>\n );\n }\n}\n\nComment.propTypes = {\n comment: PropTypes.shape({}).isRequired,\n showOnMount: PropTypes.bool,\n spaceAround: PropTypes.bool,\n handleShowOnMount: PropTypes.func,\n handleEdit: PropTypes.func,\n handleDeleteCallback: PropTypes.func.isRequired,\n patchCommentCallback: PropTypes.func.isRequired,\n companyId: PropTypes.number,\n currentUser: PropTypes.shape(),\n\n classes: PropTypes.shape({}).isRequired,\n isNative: PropTypes.bool,\n};\n\nComment.defaultProps = {\n showOnMount: false,\n spaceAround: false,\n handleShowOnMount: noop,\n handleEdit: noop,\n companyId: null,\n\n isNative: isNativeDetected,\n\n currentUser: {},\n};\n\nexport default withStyles(muiStyles)(Comment);\n"],"names":["style","chatAvatarWrapper","paddingTop","position","top","left","commentInfoContainer","display","alignItems","width","userNameWrapper","overflow","infoContainer","verticalAlign","paddingLeft","Comment","_PureComponent","_inherits","_super","_createSuper","props","_this","_ref","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","_asyncToGenerator","_regeneratorRuntime","mark","_callee","feedItemId","commentId","commentResponse","wrap","_context","prev","next","deleteFeedItemComment","sent","t0","console","error","abrupt","stop","_x","_x2","apply","arguments","handleShowOnMount","commentEl","current","scrollIntoView","block","event","stopPropagation","setState","actionsMenuAnchorEl","currentTarget","keyCode","isEditing","document","removeEventListener","handleKeyDown","addEventListener","inputEl","focus","comment","editCommentId","id","editComment","body","editAttachment","attachment","editFeedItemId","feed_activity_id","isLoading","openDeleteDialog","_callee2","response","_context2","deleteComment","handleDeleteCallback","state","createRef","_createClass","key","value","showOnMount","showIntoView","get","Number","currentUser","showEdit","isCurrentUserCommentCreator","showDelete","includes","allowed_actions","_jsxs","className","styles","cCommentMenu","children","_jsx","IconButton","concat","undefined","classes","iconButtonRoot","size","onClick","handleOpenActionsMenu","MoreVertIcon","Menu","anchorOrigin","vertical","horizontal","transformOrigin","anchorEl","open","handleCloseActionsMenu","onClose","jsx","MenuItem","handleEditMenuItem","handleDeleteMenuItem","_comment$attachment","_comment$attachment2","_this2","_this$state","spaceAround","CommentLoader","_this$props","isNative","patchCommentCallback","companyId","CommentInput","_objectSpread","inputRef","postComment","noop","exitEditMode","onEditFinish","setIsEditting","getEditCommentProps","userFullName","utils","getUserFullName","user","format","time","moment","created_at","attachmentUrl","signed_url","url","attachmentSize","attachmentFileName","classNames","cComment","cCommentNative","ref","CommentWrapper","commentWrapper","Avatar","displayName","imgSrc","avatar","UserCardPopover","jsxs","Typography","variant","noWrap","userName","timeWrapper","root","timeRoot","cCommentBody","renderMenuIcon","textRoot","formatMentionText","mentioned_users","Attachment","fileName","ConfirmationDialog","text","handleClose","handleOk","handleDelete","okText","PureComponent","propTypes","PropTypes","shape","isRequired","bool","func","handleEdit","number","defaultProps","isNativeDetected","Comment$1","withStyles","theme","color","palette","primary","text7","float","marginRight","marginLeft","fontSize","marginTop","fontWeight","visibility"],"mappings":"4lEA4BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,WAAY,EACZC,SAAU,WACVC,IAAK,EACLC,KAAM,GAERC,qBAAsB,CACpBC,QAAS,cACTC,WAAY,SACZC,MAAO,OACPP,WAAY,GAEdQ,gBAAiB,CAAEC,SAAU,UAC7BC,cAAe,CACbL,QAAS,eACTM,cAAe,MACfJ,MAAO,OACPK,YAAa,KA8BXC,EAAO,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GACX,SAAAA,EAAYK,GAAO,IAAAC,EAuBHC,EAbe,OAVZC,UAAAC,KAAAT,GACjBM,EAAAH,EAAAO,KAAAD,KAAMJ,GAAOM,EAAAA,QAAAC,EAAA,QAAAN,GAAA,iBAsBCC,EAAAM,EAAAA,QAAAC,EAAA,QAAAC,MAAA,SAAAC,EAAOC,EAAYC,GAAS,IAAAC,EAAA,OAAAL,UAAAM,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAIhBC,EAAqBA,sBAACP,EAAYC,GAAU,KAAA,EAApEC,EAAeE,EAAAI,KAAAJ,EAAAE,KAAA,EAAA,MAAA,KAAA,EAAAF,EAAAC,KAAA,EAAAD,EAAA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"sourcesContent":["/* eslint-disable react/prop-types */\nimport { createRef, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport { get, noop, includes } from 'lodash';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport { deleteFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport CommentWrapper from '~components/CommentWrapper';\nimport CommentLoader from '~components/CommentLoader';\nimport CommentInput from '~components/CommentInput';\nimport Avatar from '~components/Avatar';\nimport Attachment from '~components/Attachment';\nimport IconButton from '~components/IconButton';\nimport ConfirmationDialog from '~components/ConfirmationDialog';\nimport UserCardPopover from '~components/UserCardPopover';\nimport { formatMentionText } from '~components/UserMention/utils';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport utils from '~utils/main';\n\nconst PAGE_NAME = 'comment';\n\nconst CREATED_AT_FORMAT = 'MM/DD/YY HH:mm';\nconst CREATED_AT_FORMAT_NATIVE = 'MM/DD HH:mm';\n\nconst style = {\n chatAvatarWrapper: {\n paddingTop: 2,\n position: 'absolute',\n top: 6,\n left: 0,\n },\n commentInfoContainer: {\n display: 'inline-flex',\n alignItems: 'center',\n width: '100%',\n paddingTop: 5,\n },\n userNameWrapper: { overflow: 'hidden' },\n infoContainer: {\n display: 'inline-block',\n verticalAlign: 'top',\n width: '100%',\n paddingLeft: 33,\n },\n};\n\nconst muiStyles = theme => ({\n commentWrapper: { width: '100%' },\n timeRoot: {\n color: theme.palette.primary.text7,\n float: 'right',\n marginRight: 5,\n marginLeft: 8,\n fontSize: '12px',\n },\n textRoot: {\n marginTop: 5,\n color: '#CCC',\n fontWeight: 'normal',\n fontSize: '14px',\n },\n iconButtonRoot: {\n float: 'right',\n visibility: 'hidden',\n color: theme.palette.primary.text7,\n },\n userName: {\n fontSize: '12px',\n fontWeight: 'bold',\n },\n});\n\nclass Comment extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n actionsMenuAnchorEl: null,\n isLoading: false,\n isEditing: false,\n openDeleteDialog: false,\n };\n this.inputEl = createRef();\n this.commentEl = createRef();\n }\n\n componentDidMount() {\n if (this.props.showOnMount) {\n this.showIntoView();\n }\n }\n\n get isCurrentUserCommentCreator() {\n return Number(get(this.props.comment, ['user', 'id'])) === Number(this.props.currentUser.id);\n }\n\n deleteComment = async (feedItemId, commentId) => {\n let commentResponse;\n\n try {\n commentResponse = await deleteFeedItemComment(feedItemId, commentId);\n } catch (e) {\n console.error(e);\n }\n\n return commentResponse;\n };\n\n showIntoView = () => {\n this.props.handleShowOnMount();\n this.commentEl.current.scrollIntoView({ block: 'end' });\n };\n\n handleOpenActionsMenu = event => {\n event.stopPropagation();\n this.setState({ actionsMenuAnchorEl: event.currentTarget });\n };\n\n handleCloseActionsMenu = event => {\n event.stopPropagation();\n this.setState({ actionsMenuAnchorEl: null });\n };\n\n handleKeyDown = event => {\n if (event.keyCode === 27) {\n this.setState({\n isEditing: false,\n });\n }\n document.removeEventListener('keydown', this.handleKeyDown, false);\n };\n\n handleEditMenuItem = () => {\n document.addEventListener('keydown', this.handleKeyDown, false);\n this.setState(\n {\n isEditing: true,\n },\n () => {\n if (this.inputEl.current) this.inputEl.current.focus();\n }\n );\n };\n\n // TODO: move to one prop, not multiple\n getEditCommentProps = () => {\n const { comment } = this.props;\n const editCommentId = comment.id;\n const editComment = comment.body;\n const editAttachment = comment.attachment;\n const editFeedItemId = comment.feed_activity_id;\n return {\n editFeedItemId,\n editCommentId,\n editComment,\n editAttachment,\n };\n };\n\n onEditFinish = () => {\n this.setState({ isEditing: false, isLoading: false });\n };\n\n handleDeleteMenuItem = () => {\n this.setState({ openDeleteDialog: true });\n };\n\n handleDelete = async () => {\n const { id } = this.props.comment;\n const feedItemId = this.props.comment.feed_activity_id;\n\n this.setState({ isLoading: true });\n\n const response = await this.deleteComment(feedItemId, id);\n\n this.setState({ isLoading: false, openDeleteDialog: false });\n if (response) this.props.handleDeleteCallback(id);\n };\n\n renderMenuIcon() {\n const showEdit = this.isCurrentUserCommentCreator;\n\n const showDelete =\n this.isCurrentUserCommentCreator || includes(this.props.comment.allowed_actions, 'destroy');\n\n if (!(showDelete || showEdit)) return null;\n\n return (\n <div className={styles.cCommentMenu}>\n <IconButton\n data-testid={`${PAGE_NAME}_menuButton`}\n aria-label=\"Actions\"\n aria-owns={this.state.actionsMenuAnchorEl ? 'c-comment__actions-menu' : undefined}\n aria-haspopup=\"true\"\n className={this.props.classes.iconButtonRoot}\n size=\"small\"\n onClick={this.handleOpenActionsMenu}\n >\n <MoreVertIcon />\n </IconButton>\n\n <Menu\n id=\"c-comment__actions-menu\"\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n anchorEl={this.state.actionsMenuAnchorEl}\n open={!!this.state.actionsMenuAnchorEl}\n onClick={this.handleCloseActionsMenu}\n onClose={this.handleCloseActionsMenu}\n >\n {showEdit && (\n <MenuItem data-testid={`${PAGE_NAME}_editMenuItem`} onClick={this.handleEditMenuItem}>\n Edit\n </MenuItem>\n )}\n\n {showDelete && (\n <MenuItem\n data-testid={`${PAGE_NAME}_deleteMenuItem`}\n onClick={this.handleDeleteMenuItem}\n >\n Delete\n </MenuItem>\n )}\n </Menu>\n </div>\n );\n }\n\n render() {\n const { isLoading, isEditing } = this.state;\n\n if (isLoading) {\n const { spaceAround } = this.props;\n return <CommentLoader spaceAround={spaceAround} />;\n }\n\n const { comment, classes, spaceAround, isNative, patchCommentCallback, companyId } = this.props;\n\n if (isEditing) {\n return (\n <CommentInput\n inputRef={this.inputEl}\n postComment={noop}\n exitEditMode={this.onEditFinish}\n setIsEditting={() => this.setState({ isLoading: true })}\n patchCommentCallback={patchCommentCallback}\n companyId={companyId}\n currentUser={this.props.currentUser}\n {...this.getEditCommentProps()}\n />\n );\n }\n\n const userFullName = utils.getUserFullName(comment.user);\n\n const format = isNative ? CREATED_AT_FORMAT_NATIVE : CREATED_AT_FORMAT;\n const time = moment(comment.created_at).format(format);\n\n const attachmentUrl = comment?.attachment?.signed_url || comment?.attachment?.url;\n const attachmentSize = get(comment, ['attachment', 'size']);\n const attachmentFileName = get(comment, ['attachment', 'file_name']);\n\n return (\n <div\n data-testid={`${PAGE_NAME}_commentItem_${comment.body}`}\n className={classNames(styles.cComment, { [styles.cCommentNative]: isNative })}\n ref={this.commentEl}\n >\n <CommentWrapper spaceAround={spaceAround} className={this.props.classes.commentWrapper}>\n <div style={style.chatAvatarWrapper}>\n {isNative ? (\n <Avatar\n size={24}\n displayName={userFullName}\n imgSrc={get(comment, ['user', 'profile_photo'])}\n className={this.props.classes.avatar}\n />\n ) : (\n <UserCardPopover user={comment.user} currentUser={this.props.currentUser}>\n <Avatar\n size={24}\n displayName={userFullName}\n imgSrc={get(comment, ['user', 'profile_photo'])}\n className={this.props.classes.avatar}\n />\n </UserCardPopover>\n )}\n </div>\n\n <div style={style.infoContainer}>\n <div>\n <div style={style.commentInfoContainer}>\n <div style={style.userNameWrapper}>\n <Typography\n data-testid={`${PAGE_NAME}_userName`}\n variant=\"subtitle2\"\n noWrap\n className={classes.userName}\n >\n {userFullName}\n </Typography>\n </div>\n\n <div style={style.timeWrapper}>\n <Typography\n data-testid={`${PAGE_NAME}_addTime`}\n variant=\"caption\"\n classes={{ root: classes.timeRoot }}\n >\n {time}\n </Typography>\n </div>\n </div>\n </div>\n\n <div className={styles.cCommentBody}>\n {this.renderMenuIcon()}\n <Typography\n data-testid={`${PAGE_NAME}_commentMessage`}\n variant=\"body1\"\n classes={{ root: classes.textRoot }}\n >\n {formatMentionText(\n comment.body,\n comment.mentioned_users,\n isNative,\n '#00bcd4',\n this.props.currentUser\n )}\n </Typography>\n\n {attachmentUrl && (\n <Attachment\n attachmentUrl={attachmentUrl}\n attachmentSize={attachmentSize}\n size=\"small\"\n fileName={attachmentFileName}\n />\n )}\n </div>\n </div>\n </CommentWrapper>\n\n {this.state.openDeleteDialog && (\n <ConfirmationDialog\n open={this.state.openDeleteDialog}\n text=\"Do you really want to delete comment?\"\n handleClose={() => this.setState({ openDeleteDialog: false })}\n handleOk={this.handleDelete}\n okText=\"Delete\"\n />\n )}\n </div>\n );\n }\n}\n\nComment.propTypes = {\n comment: PropTypes.shape({}).isRequired,\n showOnMount: PropTypes.bool,\n spaceAround: PropTypes.bool,\n handleShowOnMount: PropTypes.func,\n handleEdit: PropTypes.func,\n handleDeleteCallback: PropTypes.func.isRequired,\n patchCommentCallback: PropTypes.func.isRequired,\n companyId: PropTypes.number,\n currentUser: PropTypes.shape(),\n\n classes: PropTypes.shape({}).isRequired,\n isNative: PropTypes.bool,\n};\n\nComment.defaultProps = {\n showOnMount: false,\n spaceAround: false,\n handleShowOnMount: noop,\n handleEdit: noop,\n companyId: null,\n\n isNative: isNativeDetected,\n\n currentUser: {},\n};\n\nexport default withStyles(muiStyles)(Comment);\n"],"names":["style","chatAvatarWrapper","paddingTop","position","top","left","commentInfoContainer","display","alignItems","width","userNameWrapper","overflow","infoContainer","verticalAlign","paddingLeft","Comment","_PureComponent","_inherits","_super","_createSuper","props","_this","_ref","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","_asyncToGenerator","_regeneratorRuntime","mark","_callee","feedItemId","commentId","commentResponse","wrap","_context","prev","next","deleteFeedItemComment","sent","t0","console","error","abrupt","stop","_x","_x2","apply","arguments","handleShowOnMount","commentEl","current","scrollIntoView","block","event","stopPropagation","setState","actionsMenuAnchorEl","currentTarget","keyCode","isEditing","document","removeEventListener","handleKeyDown","addEventListener","inputEl","focus","comment","editCommentId","id","editComment","body","editAttachment","attachment","editFeedItemId","feed_activity_id","isLoading","openDeleteDialog","_callee2","response","_context2","deleteComment","handleDeleteCallback","state","createRef","_createClass","key","value","showOnMount","showIntoView","get","Number","currentUser","showEdit","isCurrentUserCommentCreator","showDelete","includes","allowed_actions","_jsxs","className","styles","cCommentMenu","children","_jsx","IconButton","concat","undefined","classes","iconButtonRoot","size","onClick","handleOpenActionsMenu","MoreVertIcon","Menu","anchorOrigin","vertical","horizontal","transformOrigin","anchorEl","open","handleCloseActionsMenu","onClose","jsx","MenuItem","handleEditMenuItem","handleDeleteMenuItem","_comment$attachment","_comment$attachment2","_this2","_this$state","spaceAround","CommentLoader","_this$props","isNative","patchCommentCallback","companyId","CommentInput","_objectSpread","inputRef","postComment","noop","exitEditMode","onEditFinish","setIsEditting","getEditCommentProps","userFullName","utils","getUserFullName","user","format","time","moment","created_at","attachmentUrl","signed_url","url","attachmentSize","attachmentFileName","classNames","cComment","cCommentNative","ref","CommentWrapper","commentWrapper","Avatar","displayName","imgSrc","avatar","UserCardPopover","jsxs","Typography","variant","noWrap","userName","timeWrapper","root","timeRoot","cCommentBody","renderMenuIcon","textRoot","formatMentionText","mentioned_users","Attachment","fileName","ConfirmationDialog","text","handleClose","handleOk","handleDelete","okText","PureComponent","propTypes","PropTypes","shape","isRequired","bool","func","handleEdit","number","defaultProps","isNativeDetected","Comment$1","withStyles","theme","color","palette","primary","text7","float","marginRight","marginLeft","fontSize","marginTop","fontWeight","visibility"],"mappings":"4lEA4BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,WAAY,EACZC,SAAU,WACVC,IAAK,EACLC,KAAM,GAERC,qBAAsB,CACpBC,QAAS,cACTC,WAAY,SACZC,MAAO,OACPP,WAAY,GAEdQ,gBAAiB,CAAEC,SAAU,UAC7BC,cAAe,CACbL,QAAS,eACTM,cAAe,MACfJ,MAAO,OACPK,YAAa,KA8BXC,EAAO,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GACX,SAAAA,EAAYK,GAAO,IAAAC,EAuBHC,EAbe,OAVZC,UAAAC,KAAAT,GACjBM,EAAAH,EAAAO,KAAAD,KAAMJ,GAAOM,EAAAA,QAAAC,EAAA,QAAAN,GAAA,iBAsBCC,EAAAM,EAAAA,QAAAC,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AAOD,EAAME,QAAQC,QAAQC,MAC7BC,MAAO,QACPC,YAAa,EACbC,WAAY,EACZC,SAAU,QAEZhC,SAAU,CACRiC,UAAW,EACXR,MAAO,OACPS,WAAY,SACZF,SAAU,QAEZvG,eAAgB,CACdoG,MAAO,QACPM,WAAY,SACZV,MAAOD,EAAME,QAAQC,QAAQC,OAE/BlC,SAAU,CACRsC,SAAU,OACVE,WAAY,QAEf,GA2TcX,CAAsB5L"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("@babel/runtime/helpers/asyncToGenerator"),e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),u=require("react"),c=require("prop-types"),p=require("lodash/noop"),d=require("@material-ui/core/styles"),m=require("@material-ui/core"),h=require("classnames"),f=require("lodash"),g=require("@material-ui/core/colors/grey"),C=require("../../clients/jsonApi/index.js"),x=require("./styles.css.js"),v=require("../Avatar/index.js"),b=require("../FileUploadIconButton.js"),I=require("../EmojiIconButton.js"),y=require("../FailedFileUploading.js"),j=require("../UserMention/index.js"),F=require("../FilePreview/index.js"),E=require("../IconButton/index.js"),S=require("../Icons/SendIcon.js"),q=require("../UserMention/utils/index.js"),U=require("../../utils/main.js"),A=require("../../utils/mobileDetect.js"),N=require("../../utils/nativeMessages.js"),k=require("react/jsx-runtime");function M(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var R=M(t),P=M(e),T=M(n),B=M(a),w=M(i),L=M(s),z=M(r),D=M(o),_=M(l),O=M(c),H=M(p),K=M(h),V=M(g);function W(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=z.default(t);if(e){var i=z.default(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return L.default(this,n)}}var G={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},J=function(t){w.default(n,t);var e=W(n);function n(t){var a,i,s;return P.default(this,n),a=e.call(this,t),D.default(B.default(a),"handleSelectEmoji",(function(t){return a.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),D.default(B.default(a),"postComment",(i=R.default(_.default.mark((function t(e){var n;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return i.apply(this,arguments)})),D.default(B.default(a),"patchComment",(s=R.default(_.default.mark((function t(e){var n,i,s,r;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.props,i=n.editFeedItemId,s=n.editCommentId,t.prev=1,t.next=4,C.patchFeedItemComment(i,s,e);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return s.apply(this,arguments)})),D.default(B.default(a),"clearCommentField",(function(t){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){a.focusOnRef(),t&&"function"==typeof t&&t()}))})),D.default(B.default(a),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&a.props.exitEditMode(),"Enter"===e&&(q.isSuggestionsListOpened()||(t.preventDefault(),a.handleSendComment()))})),D.default(B.default(a),"handleAttachmentLoadingError",(function(t){a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),D.default(B.default(a),"handleFileUpload",(function(t,e,n){a.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),D.default(B.default(a),"handleNativeFileUpload",(function(){var t=a.state.comment;a.isEditMode?(N.notifyCommentEdit(t),a.clearCommentField(a.props.exitEditMode)):(N.notifyCommentPost(t),a.clearCommentField())})),D.default(B.default(a),"handleFileDelete",(function(){return a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),D.default(B.default(a),"handleSendComment",R.default(_.default.mark((function t(){var e,n,i;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=a.state.comment?a.state.comment.trim():null)||a.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:a.state.attachmentUrl,size:a.state.attachmentSize,file_name:a.state.attachmentName}}},!a.isEditMode){t.next=16;break}return a.props.setIsEditting(!0),t.next=8,a.patchComment(n);case 8:return i=t.sent,t.next=11,a.props.patchCommentCallback(i);case 11:a.props.setIsEditting(!1),a.clearCommentField(),a.props.exitEditMode(),t.next=24;break;case 16:return a.props.setIsPosting(!0),t.next=19,a.postComment(n);case 19:return i=t.sent,t.next=22,a.props.postCommentCallback(i);case 22:a.props.setIsPosting(!1),a.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),D.default(B.default(a),"handleCancelClick",(function(){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},a.props.exitEditMode())})),a.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},a}return T.default(n,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?this.props.editAttachment.file_name||U.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.size:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t,e=this,n=this.props,a=n.classes,i=n.currentUser,s="".concat(f.get(i,["attributes","first_name"])||f.get(i,"first_name")," ").concat(f.get(i,["attributes","last_name"])||f.get(i,"last_name")),r=this.state.isInputFocused||this.state.attachmentUrl||this.state.comment||this.props.editComment||(null===(t=this.props.editAttachment)||void 0===t?void 0:t.url);return k.jsxs("div",{style:this.props.spaceAround?G.commentTextFieldContainerSpaceAround:G.commentTextFieldContainer,children:[k.jsx("div",{style:G.chatAvatarWrapper,children:k.jsx(v.AvatarComponent,{displayName:s,size:32,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),k.jsx(m.Paper,{className:this.props.classes.paperRoot,children:k.jsx(m.TextField,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:j,inputProps:{onChange:function(t){return e.setState({comment:t})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return e.setState({isInputFocused:!0})},onBlur:function(){return e.setState({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!this.props.isNative&&k.jsxs(m.InputAdornment,{position:"end",className:this.props.classes.inputAdornment,children:[!this.state.attachmentUrl&&k.jsx("div",{className:K.default(x.cCommentInputIconContainer,x.cCommentInputIconUpload),children:k.jsx(b.default,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId),tooltipProps:{title:"Attach File",classes:{tooltip:a.iconTooltip},placement:"top"}})}),k.jsx("div",{className:x.cCommentInputIconContainer,children:k.jsx(I,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:a.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&k.jsx(y,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&k.jsx(F,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),k.jsx(m.Collapse,{in:r,mountOnEnter:!0,unmountOnExit:!0,children:k.jsxs("div",{className:x.cCommentInputSendContainer,children:[k.jsx("div",{className:x.cCommentInputSendContainerCancel,children:k.jsx(m.Typography,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),k.jsxs("div",{className:x.cCommentInputSendContainerSend,children:[k.jsxs(m.Typography,{variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",k.jsx(m.Typography,{variant:"caption",color:"primary",className:K.default(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),k.jsx(E,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:k.jsx(S,{})})]})]})})]})}}]),n}(u.PureComponent);J.propTypes={inputRef:O.default.shape({current:O.default.shape({focus:O.default.shape({})})}),editFeedItemId:O.default.number,editCommentId:O.default.number,editComment:O.default.string,editAttachment:O.default.shape({url:O.default.string,size:O.default.number,file_name:O.default.string}),spaceAround:O.default.bool,postComment:O.default.func.isRequired,postCommentCallback:O.default.func,patchCommentCallback:O.default.func,exitEditMode:O.default.func,setIsPosting:O.default.func,setIsEditting:O.default.func,onMount:O.default.func,autoFocus:O.default.bool,disabled:O.default.bool,classes:O.default.shape({}).isRequired,currentUser:O.default.shape(),isNative:O.default.bool,companyId:O.default.number,parentId:O.default.string},J.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:H.default,setIsEditting:H.default,onMount:H.default,autoFocus:void 0,disabled:!1,patchCommentCallback:H.default,postCommentCallback:H.default,exitEditMode:H.default,companyId:null,currentUser:{},isNative:A.isNativeDetected};var Q=d.withStyles((function(t){return{paperRoot:{width:"calc(100% - 48px)",marginLeft:48,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none",background:"#4D4D4D"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"8px",lineHeight:"29px",paddingLeft:"8px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"6px"},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:t.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}},inputAdornment:{marginBottom:"0!important",height:"100%"}}}))(J);module.exports=Q;
1
+ "use strict";var t=require("@babel/runtime/helpers/asyncToGenerator"),e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),u=require("react"),c=require("prop-types"),d=require("lodash/noop"),p=require("@material-ui/core/styles"),m=require("@material-ui/core"),h=require("classnames"),f=require("lodash"),g=require("@material-ui/core/colors/grey"),C=require("../../clients/jsonApi/index.js"),x=require("./styles.css.js"),v=require("../Avatar/index.js"),b=require("../FileUploadIconButton.js"),I=require("../EmojiIconButton.js"),y=require("../FailedFileUploading.js"),j=require("../UserMention/index.js"),F=require("../FilePreview/index.js"),E=require("../IconButton/index.js"),S=require("../Icons/SendIcon.js"),q=require("../UserMention/utils/index.js"),U=require("../../utils/main.js"),A=require("../../utils/mobileDetect.js"),N=require("../../utils/nativeMessages.js"),k=require("react/jsx-runtime");function M(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var R=M(t),P=M(e),T=M(n),B=M(a),w=M(i),L=M(s),z=M(r),D=M(o),_=M(l),O=M(c),H=M(d),K=M(h),V=M(g);function W(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=z.default(t);if(e){var i=z.default(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return L.default(this,n)}}var G={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},J=function(t){w.default(n,t);var e=W(n);function n(t){var a,i,s;return P.default(this,n),a=e.call(this,t),D.default(B.default(a),"handleSelectEmoji",(function(t){return a.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),D.default(B.default(a),"postComment",(i=R.default(_.default.mark((function t(e){var n;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return i.apply(this,arguments)})),D.default(B.default(a),"patchComment",(s=R.default(_.default.mark((function t(e){var n,i,s,r;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.props,i=n.editFeedItemId,s=n.editCommentId,t.prev=1,t.next=4,C.patchFeedItemComment(i,s,e);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return s.apply(this,arguments)})),D.default(B.default(a),"clearCommentField",(function(t){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){a.focusOnRef(),t&&"function"==typeof t&&t()}))})),D.default(B.default(a),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&a.props.exitEditMode(),"Enter"===e&&(q.isSuggestionsListOpened()||(t.preventDefault(),a.handleSendComment()))})),D.default(B.default(a),"handleAttachmentLoadingError",(function(t){a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),D.default(B.default(a),"handleFileUpload",(function(t,e,n){a.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),D.default(B.default(a),"handleNativeFileUpload",(function(){var t=a.state.comment;a.isEditMode?(N.notifyCommentEdit(t),a.clearCommentField(a.props.exitEditMode)):(N.notifyCommentPost(t),a.clearCommentField())})),D.default(B.default(a),"handleFileDelete",(function(){return a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),D.default(B.default(a),"handleSendComment",R.default(_.default.mark((function t(){var e,n,i;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=a.state.comment?a.state.comment.trim():null)||a.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:a.state.attachmentUrl,size:a.state.attachmentSize,file_name:a.state.attachmentName}}},!a.isEditMode){t.next=16;break}return a.props.setIsEditting(!0),t.next=8,a.patchComment(n);case 8:return i=t.sent,t.next=11,a.props.patchCommentCallback(i);case 11:a.props.setIsEditting(!1),a.clearCommentField(),a.props.exitEditMode(),t.next=24;break;case 16:return a.props.setIsPosting(!0),t.next=19,a.postComment(n);case 19:return i=t.sent,t.next=22,a.props.postCommentCallback(i);case 22:a.props.setIsPosting(!1),a.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),D.default(B.default(a),"handleCancelClick",(function(){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},a.props.exitEditMode())})),a.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},a}return T.default(n,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?this.props.editAttachment.file_name||U.default.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.size:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t,e=this,n=this.props,a=n.classes,i=n.currentUser,s="".concat(f.get(i,["attributes","first_name"])||f.get(i,"first_name")," ").concat(f.get(i,["attributes","last_name"])||f.get(i,"last_name")),r=this.state.isInputFocused||this.state.attachmentUrl||this.state.comment||this.props.editComment||(null===(t=this.props.editAttachment)||void 0===t?void 0:t.url);return k.jsxs("div",{style:this.props.spaceAround?G.commentTextFieldContainerSpaceAround:G.commentTextFieldContainer,children:[k.jsx("div",{style:G.chatAvatarWrapper,children:k.jsx(v.AvatarComponent,{displayName:s,size:32,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),k.jsx(m.Paper,{className:this.props.classes.paperRoot,children:k.jsx(m.TextField,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:j,inputProps:{onChange:function(t){return e.setState({comment:t})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return e.setState({isInputFocused:!0})},onBlur:function(){return e.setState({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!this.props.isNative&&k.jsxs(m.InputAdornment,{position:"end",className:this.props.classes.inputAdornment,children:[!this.state.attachmentUrl&&k.jsx("div",{className:K.default(x.cCommentInputIconContainer,x.cCommentInputIconUpload),children:k.jsx(b.default,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId),tooltipProps:{title:"Attach File",classes:{tooltip:a.iconTooltip},placement:"top"}})}),k.jsx("div",{className:x.cCommentInputIconContainer,children:k.jsx(I,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:a.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&k.jsx(y,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&k.jsx(F,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),k.jsx(m.Collapse,{in:r,mountOnEnter:!0,unmountOnExit:!0,children:k.jsxs("div",{className:x.cCommentInputSendContainer,children:[k.jsx("div",{className:x.cCommentInputSendContainerCancel,children:k.jsx(m.Typography,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),k.jsxs("div",{className:x.cCommentInputSendContainerSend,children:[k.jsxs(m.Typography,{variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",k.jsx(m.Typography,{variant:"caption",color:"primary",className:K.default(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),k.jsx(E,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:k.jsx(S,{})})]})]})})]})}}]),n}(u.PureComponent);J.propTypes={inputRef:O.default.shape({current:O.default.shape({focus:O.default.shape({})})}),editFeedItemId:O.default.number,editCommentId:O.default.number,editComment:O.default.string,editAttachment:O.default.shape({url:O.default.string,size:O.default.number,file_name:O.default.string}),spaceAround:O.default.bool,postComment:O.default.func.isRequired,postCommentCallback:O.default.func,patchCommentCallback:O.default.func,exitEditMode:O.default.func,setIsPosting:O.default.func,setIsEditting:O.default.func,onMount:O.default.func,autoFocus:O.default.bool,disabled:O.default.bool,classes:O.default.shape({}).isRequired,currentUser:O.default.shape(),isNative:O.default.bool,companyId:O.default.number,parentId:O.default.string},J.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:H.default,setIsEditting:H.default,onMount:H.default,autoFocus:void 0,disabled:!1,patchCommentCallback:H.default,postCommentCallback:H.default,exitEditMode:H.default,companyId:null,currentUser:{},isNative:A.isNativeDetected};var Q=p.withStyles((function(t){return{paperRoot:{width:"calc(100% - 48px)",marginLeft:48,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none",background:"#4D4D4D"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"8px",lineHeight:"29px",paddingLeft:"8px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"6px"},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:t.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}},inputAdornment:{marginBottom:"0!important",height:"100%"}}}))(J);module.exports=Q;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/CommentInput/index.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { patchFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isSuggestionsListOpened } from '~components/UserMention/utils';\nimport utils from '~utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { notifyCommentEdit, notifyCommentPost } from '~utils/nativeMessages'; // question here\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nclass CommentInput extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n\n attachmentLoadingError: null,\n isInputFocused: false,\n };\n }\n\n componentDidMount() {\n if (this.isEditMode) {\n this.setInitialCommentValue();\n }\n }\n\n componentDidUpdate(prevProps) {\n const enteredEditMode = this.isEditMode && !prevProps.editFeedItemId;\n if (\n enteredEditMode ||\n (this.props.editCommentId && this.props.editCommentId !== prevProps.editCommentId)\n ) {\n this.setInitialCommentValue();\n }\n }\n\n get isEditMode() {\n return !!this.props.editFeedItemId;\n }\n\n setInitialCommentValue() {\n const attachmentUrl = this.props.editAttachment ? this.props.editAttachment.url : null;\n\n this.setState({\n comment: this.props.editComment,\n attachmentUrl,\n attachmentName: attachmentUrl\n ? this.props.editAttachment.file_name ||\n utils.getFileNameWithExtensionFromPath(attachmentUrl)\n : null,\n attachmentSize: this.props.editAttachment ? this.props.editAttachment.size : null,\n });\n }\n\n handleSelectEmoji = emoji =>\n this.setState(({ comment }) => ({ comment: `${comment}${emoji.native}` }));\n\n postComment = async comment => {\n let commentResponse;\n try {\n commentResponse = await this.props.postComment(comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n patchComment = async comment => {\n const { editFeedItemId, editCommentId } = this.props;\n\n let commentResponse;\n\n try {\n commentResponse = await patchFeedItemComment(editFeedItemId, editCommentId, comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n focusOnRef() {\n if (this.props.inputRef) this.props.inputRef.current.focus();\n }\n\n clearCommentField = callback => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n () => {\n this.focusOnRef();\n if (callback && typeof callback === 'function') callback();\n }\n );\n };\n\n handleKeyDown = event => {\n const { key } = event;\n\n if (key === 'Escape') this.props.exitEditMode();\n\n if (key === 'Enter') {\n if (!isSuggestionsListOpened()) {\n event.preventDefault();\n this.handleSendComment();\n }\n }\n };\n\n handleAttachmentLoadingError = attachmentLoadingError => {\n this.setState({\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n attachmentLoadingError,\n });\n };\n\n handleFileUpload = (attachmentUrl, attachmentName, attachmentSize) => {\n this.setState({\n attachmentUrl,\n attachmentName,\n attachmentSize,\n attachmentLoadingError: null,\n });\n };\n\n handleNativeFileUpload = () => {\n const { comment } = this.state;\n\n if (this.isEditMode) {\n notifyCommentEdit(comment);\n this.clearCommentField(this.props.exitEditMode);\n } else {\n notifyCommentPost(comment);\n this.clearCommentField();\n }\n };\n\n handleFileDelete = () =>\n this.setState({ attachmentUrl: null, attachmentName: null, attachmentSize: null });\n\n handleSendComment = async () => {\n const textComment = this.state.comment ? this.state.comment.trim() : null;\n if (!textComment && !this.state.attachmentUrl) return;\n\n const comment = {\n comment: {\n body: textComment,\n attachment: {\n url: this.state.attachmentUrl,\n size: this.state.attachmentSize,\n file_name: this.state.attachmentName,\n },\n },\n };\n\n let commentResponse;\n\n if (this.isEditMode) {\n this.props.setIsEditting(true);\n\n commentResponse = await this.patchComment(comment);\n await this.props.patchCommentCallback(commentResponse);\n\n this.props.setIsEditting(false);\n this.clearCommentField();\n this.props.exitEditMode();\n } else {\n this.props.setIsPosting(true);\n\n commentResponse = await this.postComment(comment);\n await this.props.postCommentCallback(commentResponse);\n\n this.props.setIsPosting(false);\n this.clearCommentField();\n }\n };\n\n handleCancelClick = () => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n this.props.exitEditMode()\n );\n };\n\n render() {\n const { classes, currentUser } = this.props;\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n this.state.isInputFocused ||\n this.state.attachmentUrl ||\n this.state.comment ||\n this.props.editComment ||\n this.props.editAttachment?.url;\n\n return (\n <div\n style={\n this.props.spaceAround\n ? style.commentTextFieldContainerSpaceAround\n : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={this.props.currentUser && this.props.currentUser.profile_photo}\n />\n </div>\n <Paper className={this.props.classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => this.setState({ comment }),\n singleLine: true,\n value: this.state.comment || '',\n inputRef: this.props.inputRef,\n withLightTheme: false,\n onMount: this.props.onMount,\n companyId: this.props.companyId,\n autoFocus: this.props.autoFocus,\n disabled: this.props.disabled,\n onFocus: () => this.setState({ isInputFocused: true }),\n onBlur: () => this.setState({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !this.props.isNative && (\n <InputAdornment position=\"end\" className={this.props.classes.inputAdornment}>\n {!this.state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={this.handleFileUpload}\n onError={this.handleAttachmentLoadingError}\n fileUploadIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${\n this.props.editCommentId || this.props.parentId\n }`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={this.handleSelectEmoji}\n emojiIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: this.props.classes.inputRoot,\n input: this.props.classes.inputEl,\n },\n }}\n className={this.props.classes.input}\n onKeyDown={this.handleKeyDown}\n />\n </Paper>\n\n {this.state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={this.state.attachmentLoadingError}\n className={this.props.classes.fileUploadingError}\n />\n )}\n\n {this.state.attachmentUrl && (\n <FilePreview\n fileName={this.state.attachmentName}\n fileUrl={this.state.attachmentUrl}\n handleFileDelete={this.handleFileDelete}\n classes={this.props.classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.cancelText,\n this.props.classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={this.handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(this.props.classes.inputMain, this.props.classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press&nbsp;\n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.highlightedLabel\n )}\n >\n Enter\n </Typography>\n &nbsp;to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={this.handleSendComment}\n classes={{ root: this.props.classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n}\n\nCommentInput.propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.defaultProps = {\n inputRef: null,\n editFeedItemId: null,\n editCommentId: null,\n parentId: null,\n editComment: null,\n editAttachment: {},\n spaceAround: false,\n setIsPosting: noop,\n setIsEditting: noop,\n onMount: noop,\n autoFocus: undefined,\n disabled: false,\n patchCommentCallback: noop,\n postCommentCallback: noop,\n exitEditMode: noop,\n companyId: null,\n currentUser: {},\n\n isNative: isNativeDetected,\n};\n\nexport default withStyles(muiStyles)(CommentInput);\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","CommentInput","_PureComponent","_inherits","_super","_createSuper","props","_this","_ref2","_ref3","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","setState","_ref","comment","native","_asyncToGenerator","_regeneratorRuntime","mark","commentResponse","wrap","_context","prev","next","postComment","sent","t0","console","error","message","abrupt","stop","_callee","_x","apply","arguments","_this$props","editFeedItemId","editCommentId","_context2","patchFeedItemComment","_callee2","_x2","callback","attachmentUrl","attachmentName","attachmentSize","focusOnRef","event","key","exitEditMode","isSuggestionsListOpened","preventDefault","handleSendComment","attachmentLoadingError","state","isEditMode","notifyCommentEdit","clearCommentField","notifyCommentPost","_callee3","textComment","_context3","trim","body","attachment","url","size","file_name","setIsEditting","patchComment","patchCommentCallback","setIsPosting","postCommentCallback","isInputFocused","_createClass","value","setInitialCommentValue","prevProps","get","editAttachment","editComment","utils","getFileNameWithExtensionFromPath","inputRef","current","focus","_this$props$editAttac","_this2","_this$props2","classes","currentUser","currentUserFullName","concat","isVisibleActionBar","_jsxs","spaceAround","children","_jsx","jsx","Avatar","displayName","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","withLightTheme","onMount","companyId","autoFocus","disabled","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","isNative","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","handleFileUpload","onError","handleAttachmentLoadingError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","parentId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","handleSelectEmoji","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","handleKeyDown","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","fileUrl","handleFileDelete","Collapse","in","mountOnEnter","unmountOnExit","jsxs","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","handleCancelClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","PureComponent","propTypes","PropTypes","shape","number","string","bool","func","isRequired","defaultProps","noop","undefined","isNativeDetected","CommentInput$1","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor"],"mappings":"40DA0BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,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hE,YAAa,KACbD,eAAgB,CAAE,EAClBgB,aAAa,EACbxB,aAAc+H,EAAI,QAClBlI,cAAekI,EAAI,QACnBjF,QAASiF,EAAI,QACb/E,eAAWgF,EACX/E,UAAU,EACVlD,qBAAsBgI,EAAI,QAC1B9H,oBAAqB8H,EAAI,QACzBrJ,aAAcqJ,EAAI,QAClBhF,UAAW,KACX5B,YAAa,CAAE,EAEfmC,SAAU2E,EAAAA,kBAGZ,IAAAC,EAAeC,cAteG,SAAAC,GAAK,MAAK,CAC1BlG,UAAW,CACTmG,MAAO,oBACPC,WAAYC,GACZ1N,QAAS,eACTI,OApBiB,GAqBjBuN,OAAQ,IACR,iBAAkB,CAChBC,oCAA8BL,EAAMM,QAAQC,QAAQC,OAEtDH,UAAW,OACXI,WAAY,WAEdxD,MAAO,CACLyD,YAAa,EACbT,MAAO,QAETjD,UAAW,CACTnK,OAjCiB,GAkCjB8N,aAAc,MACdC,WAAY,OACZF,YAAa,OAEfxD,QAAS,CAAE2D,QAAS,YAAahO,OAAQ,QACzCoJ,uBAAwB,CACtB4E,QAAS,OAEXC,mBAAoB,CAClB/N,OAAQ,WACRgO,OAAQ,WAEVxD,mBAAoB,CAClByD,UAAW,GACXd,WAAY,IAEd7B,UAAW,CACT4C,aAAc,EACdC,SAAU,OACVrC,MAAOmB,EAAMM,QAAQC,QAAQY,OAE/BvC,YAAa,CACXnM,QAAS,OACTkO,aAAc,GAEhBrC,WAAY,CACVyC,OAAQ,WAEVxC,iBAAkB,CAChBM,MAAOmB,EAAMM,QAAQC,QAAQC,MAE/B/D,YAAa,CACXuE,UAAW,OAEbjC,WAAY,CACV,UAAW,CACTqC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbzF,eAAgB,CACd6F,aAAc,cACdpO,OAAQ,QAEX,GAqackN,CAAsB9M"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/CommentInput/index.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { patchFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isSuggestionsListOpened } from '~components/UserMention/utils';\nimport utils from '~utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { notifyCommentEdit, notifyCommentPost } from '~utils/nativeMessages'; // question here\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nclass CommentInput extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n\n attachmentLoadingError: null,\n isInputFocused: false,\n };\n }\n\n componentDidMount() {\n if (this.isEditMode) {\n this.setInitialCommentValue();\n }\n }\n\n componentDidUpdate(prevProps) {\n const enteredEditMode = this.isEditMode && !prevProps.editFeedItemId;\n if (\n enteredEditMode ||\n (this.props.editCommentId && this.props.editCommentId !== prevProps.editCommentId)\n ) {\n this.setInitialCommentValue();\n }\n }\n\n get isEditMode() {\n return !!this.props.editFeedItemId;\n }\n\n setInitialCommentValue() {\n const attachmentUrl = this.props.editAttachment ? this.props.editAttachment.url : null;\n\n this.setState({\n comment: this.props.editComment,\n attachmentUrl,\n attachmentName: attachmentUrl\n ? this.props.editAttachment.file_name ||\n utils.getFileNameWithExtensionFromPath(attachmentUrl)\n : null,\n attachmentSize: this.props.editAttachment ? this.props.editAttachment.size : null,\n });\n }\n\n handleSelectEmoji = emoji =>\n this.setState(({ comment }) => ({ comment: `${comment}${emoji.native}` }));\n\n postComment = async comment => {\n let commentResponse;\n try {\n commentResponse = await this.props.postComment(comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n patchComment = async comment => {\n const { editFeedItemId, editCommentId } = this.props;\n\n let commentResponse;\n\n try {\n commentResponse = await patchFeedItemComment(editFeedItemId, editCommentId, comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n focusOnRef() {\n if (this.props.inputRef) this.props.inputRef.current.focus();\n }\n\n clearCommentField = callback => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n () => {\n this.focusOnRef();\n if (callback && typeof callback === 'function') callback();\n }\n );\n };\n\n handleKeyDown = event => {\n const { key } = event;\n\n if (key === 'Escape') this.props.exitEditMode();\n\n if (key === 'Enter') {\n if (!isSuggestionsListOpened()) {\n event.preventDefault();\n this.handleSendComment();\n }\n }\n };\n\n handleAttachmentLoadingError = attachmentLoadingError => {\n this.setState({\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n attachmentLoadingError,\n });\n };\n\n handleFileUpload = (attachmentUrl, attachmentName, attachmentSize) => {\n this.setState({\n attachmentUrl,\n attachmentName,\n attachmentSize,\n attachmentLoadingError: null,\n });\n };\n\n handleNativeFileUpload = () => {\n const { comment } = this.state;\n\n if (this.isEditMode) {\n notifyCommentEdit(comment);\n this.clearCommentField(this.props.exitEditMode);\n } else {\n notifyCommentPost(comment);\n this.clearCommentField();\n }\n };\n\n handleFileDelete = () =>\n this.setState({ attachmentUrl: null, attachmentName: null, attachmentSize: null });\n\n handleSendComment = async () => {\n const textComment = this.state.comment ? this.state.comment.trim() : null;\n if (!textComment && !this.state.attachmentUrl) return;\n\n const comment = {\n comment: {\n body: textComment,\n attachment: {\n url: this.state.attachmentUrl,\n size: this.state.attachmentSize,\n file_name: this.state.attachmentName,\n },\n },\n };\n\n let commentResponse;\n\n if (this.isEditMode) {\n this.props.setIsEditting(true);\n\n commentResponse = await this.patchComment(comment);\n await this.props.patchCommentCallback(commentResponse);\n\n this.props.setIsEditting(false);\n this.clearCommentField();\n this.props.exitEditMode();\n } else {\n this.props.setIsPosting(true);\n\n commentResponse = await this.postComment(comment);\n await this.props.postCommentCallback(commentResponse);\n\n this.props.setIsPosting(false);\n this.clearCommentField();\n }\n };\n\n handleCancelClick = () => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n this.props.exitEditMode()\n );\n };\n\n render() {\n const { classes, currentUser } = this.props;\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n this.state.isInputFocused ||\n this.state.attachmentUrl ||\n this.state.comment ||\n this.props.editComment ||\n this.props.editAttachment?.url;\n\n return (\n <div\n style={\n this.props.spaceAround\n ? style.commentTextFieldContainerSpaceAround\n : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={this.props.currentUser && this.props.currentUser.profile_photo}\n />\n </div>\n <Paper className={this.props.classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => this.setState({ comment }),\n singleLine: true,\n value: this.state.comment || '',\n inputRef: this.props.inputRef,\n withLightTheme: false,\n onMount: this.props.onMount,\n companyId: this.props.companyId,\n autoFocus: this.props.autoFocus,\n disabled: this.props.disabled,\n onFocus: () => this.setState({ isInputFocused: true }),\n onBlur: () => this.setState({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !this.props.isNative && (\n <InputAdornment position=\"end\" className={this.props.classes.inputAdornment}>\n {!this.state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={this.handleFileUpload}\n onError={this.handleAttachmentLoadingError}\n fileUploadIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${\n this.props.editCommentId || this.props.parentId\n }`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={this.handleSelectEmoji}\n emojiIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: this.props.classes.inputRoot,\n input: this.props.classes.inputEl,\n },\n }}\n className={this.props.classes.input}\n onKeyDown={this.handleKeyDown}\n />\n </Paper>\n\n {this.state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={this.state.attachmentLoadingError}\n className={this.props.classes.fileUploadingError}\n />\n )}\n\n {this.state.attachmentUrl && (\n <FilePreview\n fileName={this.state.attachmentName}\n fileUrl={this.state.attachmentUrl}\n handleFileDelete={this.handleFileDelete}\n classes={this.props.classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.cancelText,\n this.props.classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={this.handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(this.props.classes.inputMain, this.props.classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press&nbsp;\n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.highlightedLabel\n )}\n >\n Enter\n </Typography>\n &nbsp;to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={this.handleSendComment}\n classes={{ root: this.props.classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n}\n\nCommentInput.propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.defaultProps = {\n inputRef: null,\n editFeedItemId: null,\n editCommentId: null,\n parentId: null,\n editComment: null,\n editAttachment: {},\n spaceAround: false,\n setIsPosting: noop,\n setIsEditting: noop,\n onMount: noop,\n autoFocus: undefined,\n disabled: false,\n patchCommentCallback: noop,\n postCommentCallback: noop,\n exitEditMode: noop,\n companyId: null,\n currentUser: {},\n\n isNative: isNativeDetected,\n};\n\nexport default withStyles(muiStyles)(CommentInput);\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","CommentInput","_PureComponent","_inherits","_super","_createSuper","props","_this","_ref2","_ref3","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","setState","_ref","comment","native","_asyncToGenerator","_regeneratorRuntime","mark","commentResponse","wrap","_context","prev","next","postComment","sent","t0","console","error","message","abrupt","stop","_callee","_x","apply","arguments","_this$props","editFeedItemId","editCommentId","_context2","patchFeedItemComment","_callee2","_x2","callback","attachmentUrl","attachmentName","attachmentSize","focusOnRef","event","key","exitEditMode","isSuggestionsListOpened","preventDefault","handleSendComment","attachmentLoadingError","state","isEditMode","notifyCommentEdit","clearCommentField","notifyCommentPost","_callee3","textComment","_context3","trim","body","attachment","url","size","file_name","setIsEditting","patchComment","patchCommentCallback","setIsPosting","postCommentCallback","isInputFocused","_createClass","value","setInitialCommentValue","prevProps","get","editAttachment","editComment","utils","getFileNameWithExtensionFromPath","inputRef","current","focus","_this$props$editAttac","_this2","_this$props2","classes","currentUser","currentUserFullName","concat","isVisibleActionBar","_jsxs","spaceAround","children","_jsx","jsx","Avatar","displayName","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","withLightTheme","onMount","companyId","autoFocus","disabled","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","isNative","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","handleFileUpload","onError","handleAttachmentLoadingError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","parentId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","handleSelectEmoji","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","handleKeyDown","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","fileUrl","handleFileDelete","Collapse","in","mountOnEnter","unmountOnExit","jsxs","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","handleCancelClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","PureComponent","propTypes","PropTypes","shape","number","string","bool","func","isRequired","defaultProps","noop","undefined","isNativeDetected","CommentInput$1","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor"],"mappings":"40DA0BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,cAsElEE,EAAY,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GAChB,SAAAA,EAAYK,GAAO,IAAAC,EAiDyDC,EAW3EC,EAjDG,OAXeC,UAAAC,KAAAV,GACjBM,EAAAH,EAAAQ,KAAAD,KAAML,GAAOO,EAAAA,QAAAC,EAAAA,QAAAP,GAAA,qBA+CK,SAAAQ,GAAK,OACvBR,EAAKS,UAAS,SAAAC,GAAA,IAAGC,IAAAA,QAAO,MAAQ,CAAEA,QAAYA,GAAAA,OAAAA,GAAUH,OAAAA,EAAMI,QAAU,GAAE,IAAAN,EAAAA,QAAAC,EAAA,QAAAP,GAAA,eAAAC,EAAAY,EAAAA,QAAAC,EAAAA,QAAAC,MAE9D,WAAMJ,GAAO,IAAAK,EAAA,OAAAF,UAAAG,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAGCpB,EAAKD,MAAMsB,YAAYV,GAAQ,KAAA,EAAvDK,EAAeE,EAAAI,KAAAJ,EAAAE,KAAA,EAAA,MAAA,KAAA,EAAAF,EAAAC,KAAA,EAAAD,EAAAK,GAAAL,EAAA,MAAA,GAEfM,QAAQC,MAAMP,EAAAK,GAAEG,SAAS,KAAA,EAAA,OAAAR,EAAAS,OAAA,SAGpBX,GAAe,KAAA,GAAA,IAAA,MAAA,OAAAE,EAAA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EVxC,iBAAkB,CAChBM,MAAOmB,EAAMM,QAAQC,QAAQC,MAE/B/D,YAAa,CACXuE,UAAW,OAEbjC,WAAY,CACV,UAAW,CACTqC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbzF,eAAgB,CACd6F,aAAc,cACdpO,OAAQ,QAEX,GAqackN,CAAsB9M"}
@@ -1,2 +1,2 @@
1
- "use strict";var s=require("react/jsx-runtime"),o=require("react"),e=require("classnames"),c=require("@material-ui/core"),i=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js");var n=require("../../utils/main.js");function r(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var t=r(e),u=c.makeStyles((function(s){return{iconWrapper:{color:s.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:s.palette.primary.contrastText}},tooltip:{color:s.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}}));module.exports=function(e){var r=e.children,l=e.classes,a=void 0===l?{}:l,m=e.dataTestId,p=e.IconComponent,d=void 0===p?function(){return s.jsx(i.CopyIcon,{size:16})}:p,j=e.tooltipProps,q=void 0===j?{title:"Copied",placement:"bottom",delay:1500}:j,I=o.useState(!1),C=I[0],f=I[1],h=u();return o.useEffect((function(){var s=setTimeout((function(){f(!1)}),q.delay);return function(){return clearTimeout(s)}}),[C]),s.jsx(c.Tooltip,{classes:{tooltip:t.default(h.tooltip,a.tooltip),popper:a.tooltipPopper},title:q.title,open:C,disableFocusListener:!0,disableHoverListener:!0,placement:q.placement,children:s.jsx("span",{className:t.default(h.iconWrapper,a.iconWrapper),onClick:function(){f(!0),n.copyToClipboard(r)},children:s.jsx(d,{className:a.icon,"data-testid":m})})})};
1
+ "use strict";var s=require("react/jsx-runtime"),o=require("react"),e=require("classnames"),c=require("@material-ui/core"),i=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js");var n=require("../../utils/main.js");function r(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var t=r(e),u=c.makeStyles((function(s){return{iconWrapper:{color:s.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:s.palette.primary.contrastText}},tooltip:{color:s.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}}));module.exports=function(e){var r=e.children,l=e.classes,a=void 0===l?{}:l,m=e.dataTestId,d=e.IconComponent,p=void 0===d?function(){return s.jsx(i.CopyIcon,{size:16})}:d,j=e.tooltipProps,q=void 0===j?{title:"Copied",placement:"bottom",delay:1500}:j,I=o.useState(!1),f=I[0],C=I[1],h=u();return o.useEffect((function(){var s=setTimeout((function(){C(!1)}),q.delay);return function(){return clearTimeout(s)}}),[f]),s.jsx(c.Tooltip,{classes:{tooltip:t.default(h.tooltip,a.tooltip),popper:a.tooltipPopper},title:q.title,open:f,disableFocusListener:!0,disableHoverListener:!0,placement:q.placement,children:s.jsx("span",{className:t.default(h.iconWrapper,a.iconWrapper),onClick:function(){C(!0),n.default.copyToClipboard(r)},children:s.jsx(p,{className:a.icon,"data-testid":m})})})};
2
2
  //# sourceMappingURL=CopyToClipboard.js.map