@corva/ui 0.38.0-rc.0 → 0.39.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-cjs/@babel/runtime/helpers/defineProperty.js'),r=require('./../../../../ext-cjs/@babel/runtime/helpers/asyncToGenerator.js'),t=require('./../../../../ext-cjs/@babel/runtime/regenerator/index.js'),n=require("./serializeDotEnv.js");function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var c=require("fs").promises,i=require("path"),a=require("express"),u=require("dotenv");exports.onBeforeSetUpMiddleware=function(e,o){var p,l=o.APP_DIRECTORY;e.use(a.json()),e.patch("/dotenv",(p=r(t.mark((function e(r,o){var a,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={},e.prev=1,e.next=4,c.readFile(i.resolve(l,"./.env"));case 4:p=e.sent,a=u.parse(p),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:return e.prev=10,e.next=13,c.writeFile(i.resolve(l,"./.env"),n(s(s({},a),r.body)));case 13:e.next=19;break;case 15:e.prev=15,e.t1=e.catch(10),console.error("Could not write to .env file"),console.error(e.t1);case 19:o.sendStatus(200);case 20:case"end":return e.stop()}}),e,null,[[1,8],[10,15]])}))),function(e,r){return p.apply(this,arguments)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-cjs/@babel/runtime/helpers/asyncToGenerator.js'),r=require('./../../../../ext-cjs/@babel/runtime/regenerator/index.js'),t=require("./serializeDotEnv.js"),n=require("fs").promises,s=require("path"),o=require("express");exports.onBeforeSetUpMiddleware=function(a,u){var i,c=u.APP_DIRECTORY;a.use(o.json()),a.patch("/dotenv",(i=e(r.mark((function e(o,a){var u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u="",e.prev=1,e.next=4,n.readFile(s.resolve(c,"./.env"),"utf8");case 4:u=e.sent,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(1);case 9:return e.prev=9,e.next=12,n.writeFile(s.resolve(c,"./.env"),t.updateDotEnv(u,o.body));case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(9),console.error("Could not write to .env file"),console.error(e.t1);case 18:a.sendStatus(200);case 19:case"end":return e.stop()}}),e,null,[[1,7],[9,14]])}))),function(e,r){return i.apply(this,arguments)}))};
@@ -1 +1 @@
1
- "use strict";module.exports=function(n){return Object.keys(n).map((function(c){return function(n,c){return"".concat(n,"=").concat((((e=c.replace(/\n/g,"\\n")).includes(" ")||e.includes("\t"))&&(e='"'.concat(e.replace(/"/g,'\\"'),'"')),e));var e}(c,n[c])})).join("\n")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../ext-cjs/@babel/runtime/helpers/slicedToArray.js'),t=function(e,t){return"".concat(e,"=").concat((((n=t.replace(/\n/g,"\\n")).includes(" ")||n.includes("\t"))&&(n='"'.concat(n.replace(/"/g,'\\"'),'"')),n));var n};exports.updateDotEnv=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,c=r||{};return n.split("\n").map((function(n){if(!n.length||n.startsWith("#"))return n;var r=n.split("="),i=e(r,1)[0];if(Object.keys(c).includes(i)){var u=c[i];return delete c[i],t(i,u)}return n})).concat(Object.entries(c).map((function(n){var r=e(n,2),c=r[0],i=r[1];return t(c,i)}))).join("\n")};
@@ -1 +1 @@
1
- import{useRef as e}from"react";import{node as t,number as o,func as r,bool as i,shape as n}from"prop-types";import{debounce as s}from"lodash";import{makeStyles as p}from"@material-ui/core";import"@babel/runtime/helpers/defineProperty";import"../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsxs as m,jsx as a}from"react/jsx-runtime";import"../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../ErrorBoundary/ErrorBoundary.js";import"../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../LoadingIndicator/LoadingIndicator.js";import"../../../constants/segment.js";import"../../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../../DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../Modal/CorvaModal.js";import"@babel/runtime/helpers/objectWithoutProperties";import"@babel/runtime/helpers/slicedToArray";import"../../IconMenu/index.js";import"../../StyledMenuItem/index.js";import"../../DevCenter/AppHeader/AppHeader.js";import"../../DevCenter/AppSideBar/AppSideBar.js";import"../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"classnames";import"../../Icons/AnnotationIcon.js";import"../../Annotations/components/AnnotationsList/index.js";import"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import"../../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../utils/index.js";import"../../HelpCenter/HelpCenterIcon.js";import"../../DevCenter/AppContext.js";import"../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../../DevCenter/NavigationBar/NavigationBar.js";import"../../DevCenter/SideBar/SideBar.js";import"../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../../AssetEditor/index.js";import"../../AppVersionsSelect/AppVersionsSelect.js";import"../../Typography.js";import"../../CollapsableSidebar.js";import"../../DateTimePicker/index.js";import"../../DatePicker/index.js";import"../../SlateFormattedText/SlateFormattedText.js";import"../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../ParameterCharts/ParameterCharts.js";import"../../ParameterCharts/AddEditTrack.js";import"../../ChartActionsList/ChartActionsList.js";import"../../AssetEditor/AssetEditorAutocomplete.js";import"../../AssetEditor/SingleAssetEditor.js";import"../../SettingEditors/ColorEditor/index.js";import"../../SettingEditors/DropdownEditor/index.js";import"../../SettingEditors/RadioEditor/index.js";import"../../SwitchControl/index.js";import"../../ColorPicker/ColorPicker.js";import"../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../TruncatedText/index.js";import"../../RangeSlider/RangeSlider.js";import"../../GridLockButton/index.js";import"../../Login/components/Login.js";import"../../Login/components/PasswordField.js";import"../../Login/components/Chip.js";import"../../Login/components/StepFooter.js";import"../../Login/components/StepContent.js";import"../../Login/components/StepHeader.js";import"../../Login/components/Step.js";import"../../Login/components/OrDivider.js";import"../../Login/components/HiddenEmailField.js";import"../../Login/components/EmailField.js";import"../../Breadcrumbs/index.js";import"../../VirtualizedTable/index.js";import"../../EmptyView/EmptyView.js";import"../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../Button/index.js";import"../../ContextMenuItem/index.js";import"../../FolderMenuItem/index.js";import"../../EditableItem/EditableItem/index.js";import"../../EditableItem/EditableItemWithBadge/index.js";import"../../Checkbox/index.js";import"../../FolderMenuItemWithLinks/index.js";import"../../IconButton/index.js";import"../../TextField/index.js";import"../../Chip/index.js";import"../../Counter/index.js";import"../../AnchorsList/AnchorsList.js";import"../../Select/index.js";import"../../CustomSelect/index.js";import"../../Tabs/Tabs.js";import"../../Tabs/Tab.js";import"../../ResizableTable/ResizableTable.js";import"../../Drillstring/BHASchematic.js";import"../../Drillstring/BHATable/index.js";import"../../Drillstring/BHAComponentIcon.js";import"../../Drillstring/BHAComponentDetail/index.js";import"../../Drillstring/BHATileIcon.js";import"../../Drillstring/BHATile/BHATile.js";import"../../Drillstring/BHAList/BHAList.js";import"../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../Casing/CasingTable/index.js";import"../../Casing/CasingComponentIcon.js";import"../../Casing/CasingTileIcon.js";import"../../Casing/CasingTableV2/CasingTableV2.js";import"../../Casing/CasingTile/CasingTile.js";import"../../WellSummary/WellSummaryItemLabel.js";import"../../WellSummary/WellSummaryItemTitle.js";import"../../WellSummary/WellSummaryItemValue.js";import"../../WellSummary/ActivitySummaryChart.js";import"../../WellSummary/FracWirelineTimeChart.js";import"../../BICOffsetPickerDialog/index.js";import"../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../OffsetWellPickerV3/index.js";import"../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"../../ConfirmationDialog.js";import"../../TextLink/index.js";import"../../Avatar/index.js";import"../../Template/TemplatePopover/index.js";import"../../MenuItem/index.js";import"../../PadModeSelect/PadModeSelect.js";import"../../PinnableFilters/PinnableFilters.js";import"../../HeaderLayout/HeaderLayout.js";import"../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../PadOffsetsPicker/OffsetAssetChip.js";import"../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../PadOffsetsPicker/StagesSelector.js";import"../../Table/TableToolbar/TableToolbar.js";import"../../Tooltip/MuiTooltipDcWrapper.js";import"../../PriceInput/PriceInput.js";import"../../LabelsCounter/LabelsCounter.js";import"../../Stepper/Step.js";import"../../Stepper/StepsWrapper.js";import"../../Stepper/Stepper.js";import"../../Comment/CommentIcon/index.js";import"../../FilesLoader/FilesLoader.js";import"../../FilesLoader/Icons/FileIcon.js";import"../../SearchInput/index.js";import"../../FeedItem/FeedItem.js";import"../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import l from"../../PostInput/PostInput.js";import"../../KeyboardDateTimePicker.js";import"../Popover.js";import"../Popup.js";import"../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../StageDesignVActual/ComparisonHeader.js";import"../../StageDesignVActual/ComparisonRow.js";import"../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../EmbeddedApp/EmbeddedApp.js";import"../../Autocomplete/Autocomplete.js";import"../../DocumentViewer/DocumentViewer.js";import{isSuggestionsListOpened as d}from"../../UserMention/utils/index.js";var j=p({postInput:{paddingBottom:8},filePreviewWrapper:function(e){return{width:"100%",marginLeft:0,maxHeight:e.smallerView?127:251}}}),c={suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}};function C(t){var o=t.userCompanyId,r=t.startAdornment,i=t.endAdornment,n=t.customContent,p=t.setComment,C=t.smallerView,u=t.onSave,A=t.comment,D=j({smallerView:C}),g=e(),v=s(p,300);return m("div",{ref:g,children:[r,n||a(l,{userCompanyId:o,onChange:v,filePreviewWrapperClass:D.filePreviewWrapper,className:D.postInput,smallerView:C,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||d()||(e.preventDefault(),u(A))},mentionStyle:c,suggestionsPortalHost:g.current,allowSuggestionsAboveCursor:!0}),i]})}C.propTypes={startAdornment:t,endAdornment:t,customContent:t,userCompanyId:o.isRequired,setComment:r,onSave:r,smallerView:i,comment:n()},C.defaultProps={startAdornment:null,endAdornment:null,customContent:null,setComment:function(){},onSave:function(){},smallerView:!1,comment:void 0};export{C as default};
1
+ import{useRef as e}from"react";import{node as t,number as o,func as r,bool as i,shape as n}from"prop-types";import{debounce as s}from"lodash";import{makeStyles as p}from"@material-ui/core";import"@babel/runtime/helpers/defineProperty";import"../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsxs as m,jsx as a}from"react/jsx-runtime";import"../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../ErrorBoundary/ErrorBoundary.js";import"../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../LoadingIndicator/LoadingIndicator.js";import"../../../constants/segment.js";import"../../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../../DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../../Modal/CorvaModal.js";import"@babel/runtime/helpers/objectWithoutProperties";import"@babel/runtime/helpers/slicedToArray";import"../../IconMenu/index.js";import"../../StyledMenuItem/index.js";import"../../DevCenter/AppHeader/AppHeader.js";import"../../DevCenter/AppSideBar/AppSideBar.js";import"../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"classnames";import"../../Icons/AnnotationIcon.js";import"../../Annotations/components/AnnotationsList/index.js";import"../../Annotations/components/LastAnnotation/index.js";import"../../Annotations/AnnotationsContext.js";import"../../../utils/mobileDetect.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"querystring";import"uuid/v1";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions.js";import"../../../constants/goals.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import"../../../utils/index.js";import"../../HelpCenter/HelpCenterIcon.js";import"../../DevCenter/AppContext.js";import"../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../../DevCenter/NavigationBar/NavigationBar.js";import"../../DevCenter/SideBar/SideBar.js";import"../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../../AssetEditor/index.js";import"../../AppVersionsSelect/AppVersionsSelect.js";import"../../Typography.js";import"../../CollapsableSidebar.js";import"../../DateTimePicker/index.js";import"../../DatePicker/index.js";import"../../SlateFormattedText/SlateFormattedText.js";import"../../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../../ParameterCharts/ParameterCharts.js";import"../../ParameterCharts/AddEditTrack.js";import"../../ChartActionsList/ChartActionsList.js";import"../../AssetEditor/AssetEditorAutocomplete.js";import"../../AssetEditor/SingleAssetEditor.js";import"../../SettingEditors/ColorEditor/index.js";import"../../SettingEditors/DropdownEditor/index.js";import"../../SettingEditors/RadioEditor/index.js";import"../../SwitchControl/index.js";import"../../ColorPicker/ColorPicker.js";import"../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../TruncatedText/index.js";import"../../RangeSlider/RangeSlider.js";import"../../GridLockButton/index.js";import"../../Login/components/Login.js";import"../../Login/components/PasswordField.js";import"../../Login/components/Chip.js";import"../../Login/components/StepFooter.js";import"../../Login/components/StepContent.js";import"../../Login/components/StepHeader.js";import"../../Login/components/Step.js";import"../../Login/components/OrDivider.js";import"../../Login/components/HiddenEmailField.js";import"../../Login/components/EmailField.js";import"../../Breadcrumbs/index.js";import"../../VirtualizedTable/index.js";import"../../EmptyView/EmptyView.js";import"../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../Button/index.js";import"../../ContextMenuItem/index.js";import"../../FolderMenuItem/index.js";import"../../EditableItem/EditableItem/index.js";import"../../EditableItem/EditableItemWithBadge/index.js";import"../../Checkbox/index.js";import"../../FolderMenuItemWithLinks/index.js";import"../../IconButton/index.js";import"../../TextField/index.js";import"../../Chip/index.js";import"../../Counter/index.js";import"../../AnchorsList/AnchorsList.js";import"../../Select/index.js";import"../../CustomSelect/index.js";import"../../Tabs/Tabs.js";import"../../Tabs/Tab.js";import"../../ResizableTable/ResizableTable.js";import"../../Drillstring/BHASchematic.js";import"../../Drillstring/BHATable/index.js";import"../../Drillstring/BHAComponentIcon.js";import"../../Drillstring/BHAComponentDetail/index.js";import"../../Drillstring/BHATileIcon.js";import"../../Drillstring/BHATile/BHATile.js";import"../../Drillstring/BHAList/BHAList.js";import"../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../Casing/CasingTable/index.js";import"../../Casing/CasingComponentIcon.js";import"../../Casing/CasingTileIcon.js";import"../../Casing/CasingTableV2/CasingTableV2.js";import"../../Casing/CasingTile/CasingTile.js";import"../../WellSummary/WellSummaryItemLabel.js";import"../../WellSummary/WellSummaryItemTitle.js";import"../../WellSummary/WellSummaryItemValue.js";import"../../WellSummary/ActivitySummaryChart.js";import"../../WellSummary/FracWirelineTimeChart.js";import"../../BICOffsetPickerDialog/index.js";import"../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../OffsetWellPickerV3/index.js";import"../../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"../../ConfirmationDialog.js";import"../../TextLink/index.js";import"../../Avatar/index.js";import"../../Template/TemplatePopover/index.js";import"../../MenuItem/index.js";import"../../PadModeSelect/PadModeSelect.js";import"../../PinnableFilters/PinnableFilters.js";import"../../HeaderLayout/HeaderLayout.js";import"../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../PadOffsetsPicker/OffsetAssetChip.js";import"../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../PadOffsetsPicker/StagesSelector.js";import"../../Table/TableToolbar/TableToolbar.js";import"../../Tooltip/MuiTooltipDcWrapper.js";import"../../PriceInput/PriceInput.js";import"../../LabelsCounter/LabelsCounter.js";import"../../Stepper/Step.js";import"../../Stepper/StepsWrapper.js";import"../../Stepper/Stepper.js";import"../../Comment/CommentIcon/index.js";import"../../FilesLoader/FilesLoader.js";import"../../FilesLoader/Icons/FileIcon.js";import"../../SearchInput/index.js";import"../../FeedItem/FeedItem.js";import"../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import l from"../../PostInput/PostInput.js";import"../../KeyboardDateTimePicker.js";import"../Popover.js";import"../Popup.js";import"../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../StageDesignVActual/ComparisonHeader.js";import"../../StageDesignVActual/ComparisonRow.js";import"../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../EmbeddedApp/EmbeddedApp.js";import"../../Autocomplete/Autocomplete.js";import"../../DocumentViewer/DocumentViewer.js";import{isSuggestionsListOpened as d}from"../../UserMention/utils/index.js";var j=p({postInput:{paddingBottom:8},filePreviewWrapper:function(e){return{width:"100%",marginLeft:0,maxHeight:e.smallerView?127:251}}});function c(t){var o=t.userCompanyId,r=t.startAdornment,i=t.endAdornment,n=t.customContent,p=t.setComment,c=t.smallerView,C=t.onSave,u=t.comment,A=j({smallerView:c}),D=e(),v=s(p,300);return m("div",{ref:D,children:[r,n||a(l,{userCompanyId:o,onChange:v,filePreviewWrapperClass:A.filePreviewWrapper,className:A.postInput,smallerView:c,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||d()||(e.preventDefault(),C(u))},suggestionsPortalHost:D.current,allowSuggestionsAboveCursor:!0}),i]})}c.propTypes={startAdornment:t,endAdornment:t,customContent:t,userCompanyId:o.isRequired,setComment:r,onSave:r,smallerView:i,comment:n()},c.defaultProps={startAdornment:null,endAdornment:null,customContent:null,setComment:function(){},onSave:function(){},smallerView:!1,comment:void 0};export{c as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import c from"@babel/runtime/regenerator";import{createRef as m,PureComponent as l}from"react";import p from"prop-types";import u from"moment";import{get as d,includes as h,noop as f}from"lodash";import v from"classnames";import{withStyles as y}from"@material-ui/core/styles";import g from"@material-ui/core/Typography";import b from"@material-ui/core/Menu";import C from"@material-ui/core/MenuItem";import D from"@material-ui/icons/MoreVert";import M from"@material-ui/core/colors/grey";import E from"../CommentWrapper.js";import w from"../CommentLoader.js";import O from"../CommentInput/index.js";import I from"../Avatar/index.js";import j from"../Attachment/index.js";import k from"../IconButton/index.js";import x from"../ConfirmationDialog.js";import A from"../UserCardPopover.js";import{formatMentionText as N}from"../UserMention/utils/index.js";import{isNativeDetected as _}from"../../utils/mobileDetect.js";import{deleteFeedItemComment as S}from"../../clients/jsonApi/index.js";import R from"../../utils/main.js";import P from"./styles.css.js";import{jsxs as U,jsx as T}from"react/jsx-runtime";function z(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 L(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=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return i(this,n)}}var W={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}},B=function(i){o(p,l);var a=L(p);function p(n){var o,i;return t(this,p),o=a.call(this,n),s(r(o),"deleteComment",(i=e(c.mark((function e(t,n){var r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,S(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)})),s(r(o),"showIntoView",(function(){o.props.handleShowOnMount(),o.commentEl.current.scrollIntoView({block:"end"})})),s(r(o),"handleToggleActionsMenu",(function(e){var t=e.currentTarget;o.setState((function(e){return{actionsMenuAnchorEl:e.actionsMenuAnchorEl?null:t}}))})),s(r(o),"handleKeyDown",(function(e){27===e.keyCode&&o.setState({isEditing:!1}),document.removeEventListener("keydown",o.handleKeyDown,!1)})),s(r(o),"handleEditMenuItem",(function(){document.addEventListener("keydown",o.handleKeyDown,!1),o.setState({isEditing:!0},(function(){o.inputEl.current&&o.inputEl.current.focus()}))})),s(r(o),"getEditCommentProps",(function(){var e=o.props.comment,t=e.id,n=e.body,r=e.attachment;return{editFeedItemId:e.feed_activity_id,editCommentId:t,editComment:n,editAttachment:r}})),s(r(o),"onEditFinish",(function(){o.setState({isEditing:!1,isLoading:!1})})),s(r(o),"handleDeleteMenuItem",(function(){o.setState({openDeleteDialog:!0})})),s(r(o),"handleDelete",e(c.mark((function e(){var t,n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.props.comment.id,n=o.props.comment.feed_activity_id,o.setState({isLoading:!0}),e.next=5,o.deleteComment(n,t);case 5:r=e.sent,o.setState({isLoading:!1,openDeleteDialog:!1}),r&&o.props.handleDeleteCallback(t);case 8:case"end":return e.stop()}}),e)})))),o.state={actionsMenuAnchorEl:null,isLoading:!1,isEditing:!1,openDeleteDialog:!1},o.inputEl=m(),o.commentEl=m(),o}return n(p,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"isCurrentUserCommentCreator",get:function(){return Number(d(this.props.comment,["user","id"]))===Number(this.props.currentUser.id)}},{key:"renderMenuIcon",value:function(){var e=this.isCurrentUserCommentCreator,t=this.isCurrentUserCommentCreator||h(this.props.comment.allowed_actions,"destroy");return t||e?U("div",{className:P.cCommentMenu,children:[T(k,{"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.handleToggleActionsMenu,children:T(D,{})}),U(b,{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.handleToggleActionsMenu,children:[e&&T(C,{"data-testid":"".concat("comment","_editMenuItem"),onClick:this.handleEditMenuItem,children:"Edit"}),t&&T(C,{"data-testid":"".concat("comment","_deleteMenuItem"),onClick:this.handleDeleteMenuItem,children:"Delete"})]})]}):null}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r.isLoading,i=r.isEditing;if(o){var a=this.props.spaceAround;return T(w,{spaceAround:a})}var c=this.props,m=c.comment,l=c.classes,p=c.spaceAround,h=c.isNative,y=c.patchCommentCallback,b=c.companyId;if(i)return T(O,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({inputRef:this.inputEl,postComment:f,exitEditMode:this.onEditFinish,setIsEditting:function(){return n.setState({isLoading:!0})},patchCommentCallback:y,companyId:b,currentUser:this.props.currentUser},this.getEditCommentProps()));var C=R.getUserFullName(m.user),D=h?"MM/DD HH:mm":"MM/DD/YY HH:mm",M=u(m.created_at).format(D),k=(null==m||null===(e=m.attachment)||void 0===e?void 0:e.signed_url)||(null==m||null===(t=m.attachment)||void 0===t?void 0:t.url),_=d(m,["attachment","size"]);return U("div",{"data-testid":"".concat("comment","_commentItem_").concat(m.body),className:v(P.cComment,s({},P.cCommentNative,h)),ref:this.commentEl,children:[U(E,{spaceAround:p,className:this.props.classes.commentWrapper,children:[T("div",{style:W.chatAvatarWrapper,children:h?T(I,{size:24,displayName:C,imgSrc:d(m,["user","profile_photo"]),className:this.props.classes.avatar}):T(A,{user:m.user,currentUser:this.props.currentUser,children:T(I,{size:24,displayName:C,imgSrc:d(m,["user","profile_photo"]),className:this.props.classes.avatar})})}),U("div",{style:W.infoContainer,children:[T("div",{children:U("div",{style:W.commentInfoContainer,children:[T("div",{style:W.userNameWrapper,children:T(g,{"data-testid":"".concat("comment","_userName"),variant:"subtitle2",noWrap:!0,className:l.userName,children:C})}),T("div",{style:W.timeWrapper,children:T(g,{"data-testid":"".concat("comment","_addTime"),variant:"caption",classes:{root:l.timeRoot},children:M})})]})}),U("div",{className:P.cCommentBody,children:[this.renderMenuIcon(),T(g,{"data-testid":"".concat("comment","_commentMessage"),variant:"body1",classes:{root:l.textRoot},children:N(m.body,m.mentioned_users,h,"#00bcd4",this.props.currentUser)}),k&&T(j,{attachmentUrl:k,attachmentSize:_,size:"small"})]})]})]}),this.state.openDeleteDialog&&T(x,{open:this.state.openDeleteDialog,text:"Do you really want to delete comment?",handleClose:function(){return n.setState({openDeleteDialog:!1})},handleOk:this.handleDelete,okText:"Delete"})]})}}]),p}();B.propTypes={comment:p.shape({}).isRequired,showOnMount:p.bool,spaceAround:p.bool,handleShowOnMount:p.func,handleEdit:p.func,handleDeleteCallback:p.func.isRequired,patchCommentCallback:p.func.isRequired,companyId:p.number,currentUser:p.shape(),classes:p.shape({}).isRequired,isNative:p.bool},B.defaultProps={showOnMount:!1,spaceAround:!1,handleShowOnMount:f,handleEdit:f,companyId:null,isNative:_,currentUser:{}};var q=y((function(e){return{commentWrapper:{width:"calc(100% - 10px)"},timeRoot:{color:M[700],float:"right",marginRight:5,marginLeft:10,fontSize:"10px"},textRoot:{marginTop:5,color:"#CCC",fontWeight:"normal",fontSize:"14px"},iconButtonRoot:{float:"right",visibility:"hidden",color:e.palette.primary.text7},userName:{fontSize:"12px",fontWeight:"bold"}}}))(B);export{q as default};
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import c from"@babel/runtime/regenerator";import{createRef as m,PureComponent as l}from"react";import p from"prop-types";import u from"moment";import{get as d,includes as h,noop as f}from"lodash";import v from"classnames";import{withStyles as y}from"@material-ui/core/styles";import g from"@material-ui/core/Typography";import b from"@material-ui/core/Menu";import C from"@material-ui/core/MenuItem";import D from"@material-ui/icons/MoreVert";import M from"../CommentWrapper.js";import E from"../CommentLoader.js";import w from"../CommentInput/index.js";import O from"../Avatar/index.js";import I from"../Attachment/index.js";import j from"../IconButton/index.js";import k from"../ConfirmationDialog.js";import x from"../UserCardPopover.js";import{formatMentionText as A}from"../UserMention/utils/index.js";import{isNativeDetected as N}from"../../utils/mobileDetect.js";import{deleteFeedItemComment as _}from"../../clients/jsonApi/index.js";import S from"../../utils/main.js";import R from"./styles.css.js";import{jsxs as P,jsx as U}from"react/jsx-runtime";function T(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 z(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=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return i(this,n)}}var L={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}},W=function(i){o(p,l);var a=z(p);function p(n){var o,i;return t(this,p),o=a.call(this,n),s(r(o),"deleteComment",(i=e(c.mark((function e(t,n){var r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_(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)})),s(r(o),"showIntoView",(function(){o.props.handleShowOnMount(),o.commentEl.current.scrollIntoView({block:"end"})})),s(r(o),"handleToggleActionsMenu",(function(e){var t=e.currentTarget;o.setState((function(e){return{actionsMenuAnchorEl:e.actionsMenuAnchorEl?null:t}}))})),s(r(o),"handleKeyDown",(function(e){27===e.keyCode&&o.setState({isEditing:!1}),document.removeEventListener("keydown",o.handleKeyDown,!1)})),s(r(o),"handleEditMenuItem",(function(){document.addEventListener("keydown",o.handleKeyDown,!1),o.setState({isEditing:!0},(function(){o.inputEl.current&&o.inputEl.current.focus()}))})),s(r(o),"getEditCommentProps",(function(){var e=o.props.comment,t=e.id,n=e.body,r=e.attachment;return{editFeedItemId:e.feed_activity_id,editCommentId:t,editComment:n,editAttachment:r}})),s(r(o),"onEditFinish",(function(){o.setState({isEditing:!1,isLoading:!1})})),s(r(o),"handleDeleteMenuItem",(function(){o.setState({openDeleteDialog:!0})})),s(r(o),"handleDelete",e(c.mark((function e(){var t,n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.props.comment.id,n=o.props.comment.feed_activity_id,o.setState({isLoading:!0}),e.next=5,o.deleteComment(n,t);case 5:r=e.sent,o.setState({isLoading:!1,openDeleteDialog:!1}),r&&o.props.handleDeleteCallback(t);case 8:case"end":return e.stop()}}),e)})))),o.state={actionsMenuAnchorEl:null,isLoading:!1,isEditing:!1,openDeleteDialog:!1},o.inputEl=m(),o.commentEl=m(),o}return n(p,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"isCurrentUserCommentCreator",get:function(){return Number(d(this.props.comment,["user","id"]))===Number(this.props.currentUser.id)}},{key:"renderMenuIcon",value:function(){var e=this.isCurrentUserCommentCreator,t=this.isCurrentUserCommentCreator||h(this.props.comment.allowed_actions,"destroy");return t||e?P("div",{className:R.cCommentMenu,children:[U(j,{"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.handleToggleActionsMenu,children:U(D,{})}),P(b,{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.handleToggleActionsMenu,children:[e&&U(C,{"data-testid":"".concat("comment","_editMenuItem"),onClick:this.handleEditMenuItem,children:"Edit"}),t&&U(C,{"data-testid":"".concat("comment","_deleteMenuItem"),onClick:this.handleDeleteMenuItem,children:"Delete"})]})]}):null}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r.isLoading,i=r.isEditing;if(o){var a=this.props.spaceAround;return U(E,{spaceAround:a})}var c=this.props,m=c.comment,l=c.classes,p=c.spaceAround,h=c.isNative,y=c.patchCommentCallback,b=c.companyId;if(i)return U(w,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({inputRef:this.inputEl,postComment:f,exitEditMode:this.onEditFinish,setIsEditting:function(){return n.setState({isLoading:!0})},patchCommentCallback:y,companyId:b,currentUser:this.props.currentUser},this.getEditCommentProps()));var C=S.getUserFullName(m.user),D=h?"MM/DD HH:mm":"MM/DD/YY HH:mm",j=u(m.created_at).format(D),N=(null==m||null===(e=m.attachment)||void 0===e?void 0:e.signed_url)||(null==m||null===(t=m.attachment)||void 0===t?void 0:t.url),_=d(m,["attachment","size"]);return P("div",{"data-testid":"".concat("comment","_commentItem_").concat(m.body),className:v(R.cComment,s({},R.cCommentNative,h)),ref:this.commentEl,children:[P(M,{spaceAround:p,className:this.props.classes.commentWrapper,children:[U("div",{style:L.chatAvatarWrapper,children:h?U(O,{size:24,displayName:C,imgSrc:d(m,["user","profile_photo"]),className:this.props.classes.avatar}):U(x,{user:m.user,currentUser:this.props.currentUser,children:U(O,{size:24,displayName:C,imgSrc:d(m,["user","profile_photo"]),className:this.props.classes.avatar})})}),P("div",{style:L.infoContainer,children:[U("div",{children:P("div",{style:L.commentInfoContainer,children:[U("div",{style:L.userNameWrapper,children:U(g,{"data-testid":"".concat("comment","_userName"),variant:"subtitle2",noWrap:!0,className:l.userName,children:C})}),U("div",{style:L.timeWrapper,children:U(g,{"data-testid":"".concat("comment","_addTime"),variant:"caption",classes:{root:l.timeRoot},children:j})})]})}),P("div",{className:R.cCommentBody,children:[this.renderMenuIcon(),U(g,{"data-testid":"".concat("comment","_commentMessage"),variant:"body1",classes:{root:l.textRoot},children:A(m.body,m.mentioned_users,h,"#00bcd4",this.props.currentUser)}),N&&U(I,{attachmentUrl:N,attachmentSize:_,size:"small"})]})]})]}),this.state.openDeleteDialog&&U(k,{open:this.state.openDeleteDialog,text:"Do you really want to delete comment?",handleClose:function(){return n.setState({openDeleteDialog:!1})},handleOk:this.handleDelete,okText:"Delete"})]})}}]),p}();W.propTypes={comment:p.shape({}).isRequired,showOnMount:p.bool,spaceAround:p.bool,handleShowOnMount:p.func,handleEdit:p.func,handleDeleteCallback:p.func.isRequired,patchCommentCallback:p.func.isRequired,companyId:p.number,currentUser:p.shape(),classes:p.shape({}).isRequired,isNative:p.bool},W.defaultProps={showOnMount:!1,spaceAround:!1,handleShowOnMount:f,handleEdit:f,companyId:null,isNative:N,currentUser:{}};var B=y((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"}}}))(W);export{B as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={cComment:"styles_cComment__YNkXC",cCommentBody:"styles_cCommentBody__9DkEd",cCommentNative:"styles_cCommentNative__lh-sb",cCommentMenu:"styles_cCommentMenu__XRA2A"};e(".styles_cComment__YNkXC{align-items:flex-start;display:flex}.styles_cCommentBody__9DkEd{position:relative}.styles_cCommentNative__lh-sb .styles_cCommentMenu__XRA2A button,.styles_cComment__YNkXC:hover .styles_cCommentMenu__XRA2A button{visibility:visible}.styles_cCommentMenu__XRA2A{position:absolute;right:-30px;top:-12px}");export{t as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={cComment:"styles_cComment__YNkXC",cCommentBody:"styles_cCommentBody__9DkEd",cCommentNative:"styles_cCommentNative__lh-sb",cCommentMenu:"styles_cCommentMenu__XRA2A"};e(".styles_cComment__YNkXC{align-items:flex-start;display:flex}.styles_cCommentBody__9DkEd{position:relative}.styles_cCommentNative__lh-sb .styles_cCommentMenu__XRA2A button,.styles_cComment__YNkXC:hover .styles_cCommentMenu__XRA2A button{visibility:visible}.styles_cCommentMenu__XRA2A{position:absolute;right:8px;top:-28px}");export{t as default};
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import{PureComponent as c}from"react";import p from"prop-types";import m from"lodash/noop";import{withStyles as u}from"@material-ui/core/styles";import d from"classnames";import{get as h}from"lodash";import{Paper as f,TextField as C,InputAdornment as g,Tooltip as b,Typography as I}from"@material-ui/core";import v from"@material-ui/core/colors/grey";import x from"../Avatar/index.js";import y from"../FileUploadIconButton.js";import F from"../EmojiIconButton.js";import E from"../FailedFileUploading.js";import S from"../UserMention/index.js";import U from"../FilePreview/index.js";import N from"../IconButton/index.js";import k from"../Icons/SendIcon.js";import{isSuggestionsListOpened as A}from"../UserMention/utils/index.js";import M from"../../utils/main.js";import{isNativeDetected as R}from"../../utils/mobileDetect.js";import{notifyCommentEdit as j,notifyCommentPost as B}from"../../utils/nativeMessages.js";import{patchFeedItemComment as w}from"../../clients/jsonApi/index.js";import L from"./styles.css.js";import{jsxs as P,jsx as T}from"react/jsx-runtime";function z(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,o=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}var D={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(a){i(p,c);var r=z(p);function p(n){var i,a,c;return e(this,p),i=r.call(this,n),s(o(i),"handleSelectEmoji",(function(t){return i.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),s(o(i),"postComment",(a=t(l.mark((function t(e){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.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 a.apply(this,arguments)})),s(o(i),"patchComment",(c=t(l.mark((function t(e){var n,o,a,r;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.props,o=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,w(o,a,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 c.apply(this,arguments)})),s(o(i),"clearCommentField",(function(t){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){i.focusOnRef(),t&&"function"==typeof t&&t()}))})),s(o(i),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&i.props.exitEditMode(),"Enter"===e&&(A()||(t.preventDefault(),i.handleSendComment()))})),s(o(i),"handleAttachmentLoadingError",(function(t){i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),s(o(i),"handleFileUpload",(function(t,e,n){i.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),s(o(i),"handleNativeFileUpload",(function(){var t=i.state.comment;i.isEditMode?(j(t),i.clearCommentField(i.props.exitEditMode)):(B(t),i.clearCommentField())})),s(o(i),"handleFileDelete",(function(){return i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),s(o(i),"handleSendComment",t(l.mark((function t(){var e,n,o;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=i.state.comment?i.state.comment.trim():null)||i.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:i.state.attachmentUrl,size:i.state.attachmentSize,file_name:i.state.attachmentName}}},!i.isEditMode){t.next=16;break}return i.props.setIsEditting(!0),t.next=8,i.patchComment(n);case 8:return o=t.sent,t.next=11,i.props.patchCommentCallback(o);case 11:i.props.setIsEditting(!1),i.clearCommentField(),i.props.exitEditMode(),t.next=24;break;case 16:return i.props.setIsPosting(!0),t.next=19,i.postComment(n);case 19:return o=t.sent,t.next=22,i.props.postCommentCallback(o);case 22:i.props.setIsPosting(!1),i.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),s(o(i),"handleCancelClick",(function(){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},i.props.exitEditMode())})),i.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},i}return n(p,[{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||M.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=this,e=this.props,n=e.classes,o=e.currentUser,i="".concat(h(o,["attributes","first_name"])," ").concat(h(o,["attributes","last_name"]));return P("div",{style:this.props.spaceAround?D.commentTextFieldContainerSpaceAround:D.commentTextFieldContainer,children:[T("div",{style:D.chatAvatarWrapper,children:T(x,{displayName:i,size:24,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),T(f,{className:this.props.classes.paperRoot,children:T(C,{"data-testid":"".concat("commentInput","_input"),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:S,inputProps:{onChange:function(e){return t.setState({comment:e})},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 t.setState({isInputFocused:!0})},onBlur:function(){return t.setState({isInputFocused:!1})}},endAdornment:!this.props.isNative&&P(g,{position:"end",className:this.props.classes.iconsContainer,children:[!this.state.attachmentUrl&&T(b,{title:"Attach File",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:d(L.cCommentInputIconContainer,L.cCommentInputIconUpload),children:T(y,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId)})})}),T(b,{title:"Add Emoji",placement:"bottom",classes:{tooltip:n.iconTooltip},children:T("div",{className:L.cCommentInputIconContainer,children:T(F,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&T(E,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&T(U,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),(this.state.isInputFocused||this.state.attachmentUrl||this.state.comment)&&P("div",{className:L.cCommentInputSendContainer,children:[T("div",{className:L.cCommentInputSendContainerCancel,children:T(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),P("div",{className:L.cCommentInputSendContainerSend,children:[P(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",T(I,{variant:"caption",color:"primary",className:d(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),T(N,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:T(k,{})})]})]})]})}}]),p}();_.propTypes={inputRef:p.shape({current:p.shape({focus:p.shape({})})}),editFeedItemId:p.number,editCommentId:p.number,editComment:p.string,editAttachment:p.shape({url:p.string,size:p.number,file_name:p.string}),spaceAround:p.bool,postComment:p.func.isRequired,postCommentCallback:p.func,patchCommentCallback:p.func,exitEditMode:p.func,setIsPosting:p.func,setIsEditting:p.func,onMount:p.func,autoFocus:p.bool,disabled:p.bool,classes:p.shape({}).isRequired,currentUser:p.shape(),isNative:p.bool,companyId:p.number,parentId:p.string},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:m,setIsEditting:m,onMount:m,autoFocus:void 0,disabled:!1,patchCommentCallback:m,postCommentCallback:m,exitEditMode:m,companyId:null,currentUser:{},isNative:R};var O=u((function(t){return{paperRoot:{width:"calc(100% - 40px)",marginLeft:40,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"10px",lineHeight:"29px",paddingLeft:"10px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"8px","&:hover":{backgroundColor:"transparent"}},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},iconsContainer:{marginRight:"8px"},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}}}}))(_);export{O as default};
1
+ import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import l from"@babel/runtime/regenerator";import{PureComponent as c}from"react";import p from"prop-types";import m from"lodash/noop";import{withStyles as u}from"@material-ui/core/styles";import d from"classnames";import{get as h}from"lodash";import{Paper as f,TextField as g,InputAdornment as C,Tooltip as b,Typography as I}from"@material-ui/core";import v from"@material-ui/core/colors/grey";import x from"../Avatar/index.js";import y from"../FileUploadIconButton.js";import F from"../EmojiIconButton.js";import S from"../FailedFileUploading.js";import E from"../UserMention/index.js";import U from"../FilePreview/index.js";import N from"../IconButton/index.js";import k from"../Icons/SendIcon.js";import{isSuggestionsListOpened as A}from"../UserMention/utils/index.js";import M from"../../utils/main.js";import{isNativeDetected as R}from"../../utils/mobileDetect.js";import{notifyCommentEdit as j,notifyCommentPost as B}from"../../utils/nativeMessages.js";import{patchFeedItemComment as w}from"../../clients/jsonApi/index.js";import T from"./styles.css.js";import{jsxs as L,jsx as P}from"react/jsx-runtime";function z(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,o=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}var D={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},_=function(a){i(p,c);var r=z(p);function p(n){var i,a,c;return e(this,p),i=r.call(this,n),s(o(i),"handleSelectEmoji",(function(t){return i.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),s(o(i),"postComment",(a=t(l.mark((function t(e){var n;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.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 a.apply(this,arguments)})),s(o(i),"patchComment",(c=t(l.mark((function t(e){var n,o,a,r;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.props,o=n.editFeedItemId,a=n.editCommentId,t.prev=1,t.next=4,w(o,a,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 c.apply(this,arguments)})),s(o(i),"clearCommentField",(function(t){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){i.focusOnRef(),t&&"function"==typeof t&&t()}))})),s(o(i),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&i.props.exitEditMode(),"Enter"===e&&(A()||(t.preventDefault(),i.handleSendComment()))})),s(o(i),"handleAttachmentLoadingError",(function(t){i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),s(o(i),"handleFileUpload",(function(t,e,n){i.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),s(o(i),"handleNativeFileUpload",(function(){var t=i.state.comment;i.isEditMode?(j(t),i.clearCommentField(i.props.exitEditMode)):(B(t),i.clearCommentField())})),s(o(i),"handleFileDelete",(function(){return i.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),s(o(i),"handleSendComment",t(l.mark((function t(){var e,n,o;return l.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=i.state.comment?i.state.comment.trim():null)||i.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:i.state.attachmentUrl,size:i.state.attachmentSize,file_name:i.state.attachmentName}}},!i.isEditMode){t.next=16;break}return i.props.setIsEditting(!0),t.next=8,i.patchComment(n);case 8:return o=t.sent,t.next=11,i.props.patchCommentCallback(o);case 11:i.props.setIsEditting(!1),i.clearCommentField(),i.props.exitEditMode(),t.next=24;break;case 16:return i.props.setIsPosting(!0),t.next=19,i.postComment(n);case 19:return o=t.sent,t.next=22,i.props.postCommentCallback(o);case 22:i.props.setIsPosting(!1),i.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),s(o(i),"handleCancelClick",(function(){i.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},i.props.exitEditMode())})),i.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},i}return n(p,[{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||M.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=this,e=this.props,n=e.classes,o=e.currentUser,i="".concat(h(o,["attributes","first_name"])," ").concat(h(o,["attributes","last_name"]));return L("div",{style:this.props.spaceAround?D.commentTextFieldContainerSpaceAround:D.commentTextFieldContainer,children:[P("div",{style:D.chatAvatarWrapper,children:P(x,{displayName:i,size:32,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),P(f,{className:this.props.classes.paperRoot,children:P(g,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type here",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:E,inputProps:{onChange:function(e){return t.setState({comment:e})},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 t.setState({isInputFocused:!0})},onBlur:function(){return t.setState({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!this.props.isNative&&L(C,{position:"end",className:this.props.classes.inputAdornment,children:[!this.state.attachmentUrl&&P(b,{title:"Attach File",placement:"bottom",classes:{tooltip:n.iconTooltip},children:P("div",{className:d(T.cCommentInputIconContainer,T.cCommentInputIconUpload),children:P(y,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId)})})}),P(b,{title:"Add Emoji",placement:"bottom",classes:{tooltip:n.iconTooltip},children:P("div",{className:T.cCommentInputIconContainer,children:P(F,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],disableRipple:!0})})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&P(S,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&P(U,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),(this.state.isInputFocused||this.state.attachmentUrl||this.state.comment)&&L("div",{className:T.cCommentInputSendContainer,children:[P("div",{className:T.cCommentInputSendContainerCancel,children:P(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),L("div",{className:T.cCommentInputSendContainerSend,children:[L(I,{variant:"caption",className:d(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",P(I,{variant:"caption",color:"primary",className:d(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),P(N,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:P(k,{})})]})]})]})}}]),p}();_.propTypes={inputRef:p.shape({current:p.shape({focus:p.shape({})})}),editFeedItemId:p.number,editCommentId:p.number,editComment:p.string,editAttachment:p.shape({url:p.string,size:p.number,file_name:p.string}),spaceAround:p.bool,postComment:p.func.isRequired,postCommentCallback:p.func,patchCommentCallback:p.func,exitEditMode:p.func,setIsPosting:p.func,setIsEditting:p.func,onMount:p.func,autoFocus:p.bool,disabled:p.bool,classes:p.shape({}).isRequired,currentUser:p.shape(),isNative:p.bool,companyId:p.number,parentId:p.string},_.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:m,setIsEditting:m,onMount:m,autoFocus:void 0,disabled:!1,patchCommentCallback:m,postCommentCallback:m,exitEditMode:m,companyId:null,currentUser:{},isNative:R};var O=u((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%"}}}))(_);export{O as default};
@@ -1 +1 @@
1
- import n from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={cCommentInputSendContainer:"styles_cCommentInputSendContainer__YGdyj",cCommentInputSendContainerSend:"styles_cCommentInputSendContainerSend__v2QuS",cCommentInputSendContainerCancel:"styles_cCommentInputSendContainerCancel__ihM5z",cCommentInputIconContainer:"styles_cCommentInputIconContainer__GI8uz",cCommentInputIconUpload:"styles_cCommentInputIconUpload__-4I0T"};n(".styles_cCommentInputSendContainer__YGdyj{display:flex;justify-content:space-between;margin-left:40px;margin-top:4px}.styles_cCommentInputSendContainerCancel__ihM5z,.styles_cCommentInputSendContainerSend__v2QuS{align-items:center;display:flex;height:36px}.styles_cCommentInputIconContainer__GI8uz{border-radius:20px;height:40px;margin-right:-10px;padding:5px;text-align:center}.styles_cCommentInputIconContainer__GI8uz:hover{background:hsla(0,0%,100%,.1)}.styles_cCommentInputIconUpload__-4I0T{align-items:center;display:flex}");export{e as default};
1
+ import n from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={cCommentInputSendContainer:"styles_cCommentInputSendContainer__YGdyj",cCommentInputSendContainerSend:"styles_cCommentInputSendContainerSend__v2QuS",cCommentInputSendContainerCancel:"styles_cCommentInputSendContainerCancel__ihM5z",cCommentInputIconContainer:"styles_cCommentInputIconContainer__GI8uz",cCommentInputIconUpload:"styles_cCommentInputIconUpload__-4I0T"};n(".styles_cCommentInputSendContainer__YGdyj{display:flex;justify-content:space-between;margin-left:48px;margin-top:4px}.styles_cCommentInputSendContainerCancel__ihM5z,.styles_cCommentInputSendContainerSend__v2QuS{align-items:center;display:flex;height:36px}.styles_cCommentInputIconContainer__GI8uz{border-radius:20px}.styles_cCommentInputIconContainer__GI8uz:hover{background:#414141}.styles_cCommentInputIconUpload__-4I0T{align-items:center;display:flex}");export{e as default};
@@ -1 +1 @@
1
- import r from"prop-types";import e from"classnames";import{withStyles as a}from"@material-ui/core/styles";import o from"@material-ui/core/Paper";import{jsx as p}from"react/jsx-runtime";var i=function(r,e,a){return a&&e?r.paperRootLoaderSpaceAround:a&&!e?r.paperRootLoader:!a&&e?r.paperRootSpaceAround:a||e?null:r.paperRoot},s=function(r){var a=r.spaceAround,s=r.isLoader,n=r.children,t=r.classes,d=r.className;return p(o,{className:e(i(t,a,s),t.paperBase,d),elevation:0,children:n})};s.propTypes={spaceAround:r.bool,isLoader:r.bool,children:r.node.isRequired,className:r.string,classes:r.shape({}).isRequired},s.defaultProps={spaceAround:!1,isLoader:!1,className:void 0};var n=a({paperBase:{backgroundColor:"transparent",position:"relative"},paperRoot:{margin:"5px 0",padding:"6px 5px",minHeight:60},paperRootSpaceAround:{margin:"5px 0 10px",padding:11},paperRootLoader:{margin:"5px 0",minHeight:60},paperRootLoaderSpaceAround:{margin:"5px 0 10px",padding:"4px 0 6px"}})(s);export{n as default};
1
+ import r from"prop-types";import e from"classnames";import{withStyles as a}from"@material-ui/core/styles";import o from"@material-ui/core/Paper";import{jsx as p}from"react/jsx-runtime";var s=function(r,e,a){return a&&e?r.paperRootLoaderSpaceAround:a&&!e?r.paperRootLoader:!a&&e?r.paperRootSpaceAround:a||e?null:r.paperRoot},i=function(r){var a=r.spaceAround,i=r.isLoader,t=r.children,n=r.classes,d=r.className;return p(o,{className:e(s(n,a,i),n.paperBase,d),elevation:0,children:t})};i.propTypes={spaceAround:r.bool,isLoader:r.bool,children:r.node.isRequired,className:r.string,classes:r.shape({}).isRequired},i.defaultProps={spaceAround:!1,isLoader:!1,className:void 0};var t=a({paperBase:{backgroundColor:"transparent",position:"relative"},paperRoot:{marginBottom:8},paperRootSpaceAround:{margin:"5px 0 10px",padding:11},paperRootLoader:{margin:"5px 0",minHeight:60},paperRootLoaderSpaceAround:{margin:"5px 0 10px",padding:"4px 0 6px"}})(i);export{t as default};
@@ -1 +1 @@
1
- import e from"prop-types";import t from"classnames";import{withStyles as r}from"@material-ui/core/styles";import{Tooltip as o,Typography as s}from"@material-ui/core";import a from"@material-ui/core/colors/grey";import{isNativeDetected as i}from"../../utils/mobileDetect.js";import n from"../Avatar/index.js";import c from"../UserCardPopover.js";import m from"./styles.css.js";import{jsxs as l,Fragment as u,jsx as p}from"react/jsx-runtime";var d=function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},h=function(e){var t=e.users,r=e.noReactionsText,o=t.length;if(!o)return r;var s="";o>19&&(s="\nand ".concat(o-19," more..."));var a=t.slice(0,19).join("\n");return"".concat(a).concat(s)},f=function(e){var r=e.likesCount,a=e.usersWhoLike,i=e.commentsCount,f=e.usersWhoCommented,v=e.onCommentsClick,y=e.currentUser,C=e.activeUsersList,k=e.classes,g=e.isNative,N=e.small;return l(u,{children:[!!r&&p(o,{title:p(h,{users:a,noReactionsText:"Nobody likes this yet..."}),enterTouchDelay:0,children:l(s,{"data-testid":"".concat("FeedPo","_likesCounter_").concat(r),className:k.reactionTypographyRoot,variant:"caption",children:["Likes ",r]})}),!!i&&p("span",{onClick:v,children:p(o,{title:p(h,{users:f,noReactionsText:"Nobody commented this yet..."}),enterTouchDelay:0,children:l(s,{"data-testid":"".concat("FeedPo","_commentsCounter_").concat(i),className:k.reactionTypographyRoot,variant:"caption",children:["Comments ",i]})})}),p("div",{"data-testid":"".concat("FeedPo","_activeUsersCounter_").concat(C&&C.length),className:m.cCommentsInfoActiveUsersList,children:C.map((function(e){return g?p(n,{displayName:d(e),imgSrc:e.profile_photo,className:t(k.avatar,k.avatarInList),size:N?25:35},e.id):p(c,{user:e,currentUser:y,children:p(n,{displayName:d(e),imgSrc:e.profile_photo,size:N?25:35,className:t(k.avatar,k.avatarInList)})},e.id)}))})]})},v={reactionTypographyRoot:{color:a[400],margin:"0 8px",cursor:"pointer","&:hover":{textDecoration:"underline"}},avatar:{border:"1px solid #909090"},avatarInList:{marginRight:3,borderWidth:1}};f.propTypes={likesCount:e.number,usersWhoLike:e.arrayOf(e.shape({})),commentsCount:e.number,usersWhoCommented:e.arrayOf(e.string).isRequired,onCommentsClick:e.func,activeUsersList:e.arrayOf(e.shape({})).isRequired,classes:e.shape({}).isRequired,isNative:e.bool,small:e.bool,currentUser:e.shape({})},f.defaultProps={likesCount:0,usersWhoLike:[],commentsCount:0,onCommentsClick:function(){},small:!1,isNative:i,currentUser:{}};var y=r(v)(f);export{y as default};
1
+ import e from"prop-types";import{withStyles as t}from"@material-ui/core/styles";import{Tooltip as o,Typography as r}from"@material-ui/core";import s from"@material-ui/core/colors/grey";import{isNativeDetected as i}from"../../utils/mobileDetect.js";import a from"../Avatar/index.js";import n from"../UserCardPopover.js";import c from"./styles.css.js";import{jsxs as m,Fragment as l,jsx as p}from"react/jsx-runtime";var u=function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},d=function(e){var t=e.users,o=e.noReactionsText,r=t.length;if(!r)return o;var s="";r>19&&(s="\nand ".concat(r-19," more..."));var i=t.slice(0,19).join("\n");return"".concat(i).concat(s)},h=function(e){var t=e.likesCount,s=e.usersWhoLike,i=e.commentsCount,h=e.usersWhoCommented,f=e.onCommentsClick,v=e.currentUser,y=e.activeUsersList,C=e.classes,k=e.isNative,g=e.small;return m(l,{children:[!!t&&p(o,{title:p(d,{users:s,noReactionsText:"Nobody likes this yet..."}),enterTouchDelay:0,classes:{popper:C.tooltip},placement:"top",children:m(r,{"data-testid":"".concat("FeedPo","_likesCounter_").concat(t),className:C.reactionTypographyRoot,variant:"caption",children:["Likes ",t]})}),!!i&&p("span",{onClick:f,children:p(o,{title:p(d,{users:h,noReactionsText:"Nobody commented this yet..."}),enterTouchDelay:0,classes:{popper:C.tooltip},placement:"top",children:m(r,{"data-testid":"".concat("FeedPo","_commentsCounter_").concat(i),className:C.reactionTypographyRoot,variant:"caption",children:["Comments ",i]})})}),p("div",{"data-testid":"".concat("FeedPo","_activeUsersCounter_").concat(y&&y.length),className:c.cCommentsInfoActiveUsersList,children:y.map((function(e){return k?p(a,{displayName:u(e),imgSrc:e.profile_photo,className:C.avatarInList,size:g?24:32},e.id):p(n,{user:e,currentUser:v,children:p(a,{displayName:u(e),imgSrc:e.profile_photo,size:g?24:32,className:C.avatarInList})},e.id)}))})]})},f={reactionTypographyRoot:{color:s[400],margin:"0 8px",cursor:"pointer","&:hover":{textDecoration:"underline",textUnderlineOffset:"4px",color:"#fff"}},avatarInList:{marginRight:3,borderWidth:1},tooltip:{whiteSpace:"pre-line"}};h.propTypes={likesCount:e.number,usersWhoLike:e.arrayOf(e.shape({})),commentsCount:e.number,usersWhoCommented:e.arrayOf(e.string).isRequired,onCommentsClick:e.func,activeUsersList:e.arrayOf(e.shape({})).isRequired,classes:e.shape({}).isRequired,isNative:e.bool,small:e.bool,currentUser:e.shape({})},h.defaultProps={likesCount:0,usersWhoLike:[],commentsCount:0,onCommentsClick:function(){},small:!1,isNative:i,currentUser:{}};var v=t(f)(h);export{v as default};
@@ -1 +1 @@
1
- import r from"prop-types";import e from"classnames";import{withStyles as s}from"@material-ui/core/styles";import a from"@material-ui/core/Typography";import o from"@material-ui/icons/Error";import{jsxs as i,jsx as t}from"react/jsx-runtime";var l=function(r){return i(a,{variant:"body1",className:e(r.className,r.classes.errorMessage),children:[t(o,{color:"error",className:r.classes.errorIcon}),i("span",{children:["Upload failed. ",r.errorMessage]})]})};l.propTypes={errorMessage:r.string,className:r.string,classes:r.shape({}).isRequired},l.defaultProps={errorMessage:void 0,className:void 0};var m=s((function(r){return{errorIcon:{marginRight:10},errorMessage:{color:r.palette.grey[400],display:"flex",alignItems:"center"}}}))(l);export{m as default};
1
+ import r from"prop-types";import e from"classnames";import{withStyles as s}from"@material-ui/core/styles";import a from"@material-ui/core/Typography";import o from"@material-ui/icons/Warning";import{jsxs as i,jsx as m}from"react/jsx-runtime";var t=function(r){return i(a,{variant:"body1",className:e(r.className,r.classes.errorMessage),children:[m(o,{color:"error",className:r.classes.errorIcon}),i("span",{children:["Upload failed. ",r.errorMessage]})]})};t.propTypes={errorMessage:r.string,className:r.string,classes:r.shape({}).isRequired},t.defaultProps={errorMessage:void 0,className:void 0};var l=s({errorIcon:{marginRight:8},errorMessage:{display:"flex",alignItems:"center",fontSize:12,marginTop:8}})(t);export{l as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var n={hideOverflow:"FeedItem_hideOverflow__VxJHT",downloadLink:"FeedItem_downloadLink__60HIj",mainContainer:"FeedItem_mainContainer__Y9I2W",mainContainerNative:"FeedItem_mainContainerNative__chnEh",mainContainerClickable:"FeedItem_mainContainerClickable__jG6kG",mainContainerTop:"FeedItem_mainContainerTop__SqKjI",mainContainerTopNative:"FeedItem_mainContainerTopNative__i-JrG",mainContainerTopMenu:"FeedItem_mainContainerTopMenu__QE3-N",loadingContainer:"FeedItem_loadingContainer__B9lMF"};e(".FeedItem_hideOverflow__VxJHT{overflow:hidden}.FeedItem_downloadLink__60HIj{color:inherit;outline:0}.FeedItem_mainContainer__Y9I2W{padding:16px 24px 0 32px}.FeedItem_mainContainerNative__chnEh{padding:15px 16px 0}.FeedItem_mainContainerClickable__jG6kG{cursor:pointer}.FeedItem_mainContainerTop__SqKjI{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FeedItem_mainContainerTopNative__i-JrG{padding-left:55px}.FeedItem_mainContainerTopMenu__QE3-N{align-items:center;display:flex;margin-left:auto}.FeedItem_loadingContainer__B9lMF{height:100%;left:0;position:absolute;top:0;width:100%}");export{n as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var n={hideOverflow:"FeedItem_hideOverflow__VxJHT",downloadLink:"FeedItem_downloadLink__60HIj",mainContainer:"FeedItem_mainContainer__Y9I2W",mainContainerNative:"FeedItem_mainContainerNative__chnEh",mainContainerClickable:"FeedItem_mainContainerClickable__jG6kG",mainContainerTop:"FeedItem_mainContainerTop__SqKjI",mainContainerTopNative:"FeedItem_mainContainerTopNative__i-JrG",mainContainerTopLine:"FeedItem_mainContainerTopLine__orRjp",mainContainerTopMenu:"FeedItem_mainContainerTopMenu__QE3-N",loadingContainer:"FeedItem_loadingContainer__B9lMF"};e(".FeedItem_hideOverflow__VxJHT{overflow:hidden}.FeedItem_downloadLink__60HIj{color:inherit;outline:0}.FeedItem_mainContainer__Y9I2W{padding:16px 16px 0 24px}.FeedItem_mainContainerNative__chnEh{padding:15px 16px 0}.FeedItem_mainContainerClickable__jG6kG{cursor:pointer}.FeedItem_mainContainerTop__SqKjI{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.FeedItem_mainContainerTopNative__i-JrG{padding-left:55px}.FeedItem_mainContainerTopLine__orRjp{align-items:center;display:flex;width:100%}.FeedItem_mainContainerTopMenu__QE3-N{align-items:center;display:flex;flex:1;justify-content:flex-end;margin-left:auto}.FeedItem_loadingContainer__B9lMF{height:100%;left:0;position:absolute;top:0;width:100%}");export{n as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/slicedToArray";import o from"@babel/runtime/helpers/objectWithoutProperties";import n from"@babel/runtime/regenerator";import{useState as i}from"react";import a from"prop-types";import s from"classnames";import{makeStyles as m,Paper as p,Divider as c,Typography as l}from"@material-ui/core";import{includes as d,noop as u}from"lodash";import f from"@material-ui/core/colors/grey";import{isNativeDetected as y}from"../../utils/mobileDetect.js";import v from"../ConfirmationDialog.js";import b from"../LoadingIndicator/LoadingIndicator.js";import h from"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import{FEED_ITEM_TYPES as I,FEED_ITEM_TYPES_BY_KEY as g}from"../../constants/feed.js";import{deleteFeedItem as j,toggleFeedItemLike as T}from"../../clients/jsonApi/index.js";import"../../utils/index.js";import C from"../../utils/main.js";import O from"./components/Actions.js";import F from"./components/FeedComments.js";import w from"./components/Content.js";import P from"./components/CreatedAt.js";import D from"./components/Icon.js";import k from"./components/Reactions.js";import x from"./components/RigAndWell.js";import E from"./components/TypeAndAssetTitle.js";import R from"./FeedItem.css.js";import{jsxs as N,jsx as A}from"react/jsx-runtime";import{showSuccessNotification as _}from"../../utils/notificationToasts.js";var M=["feedItem","editableFeedItemTypes","removeFeedItem","enterEditMode","router","currentUser","appData","customFeedItemTypeTemplates"];function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function B(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?U(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):U(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var L=m((function(e){return{paperRoot:{position:"relative",marginBottom:10,paddingBottom:16,backgroundColor:e.palette.background.b8},clickablePaperRoot:{"&:hover":{filter:"brightness(90%)",transition:"filter 0.3s"}},headerDividerRoot:{margin:"12px 0 20px 0",backgroundColor:"#595959"}}}));function S(a){var m,u,I,U,S,q,V,W,G,z,H,J=a.feedItem,K=a.editableFeedItemTypes,Q=a.removeFeedItem,X=a.enterEditMode,Y=a.router,Z=a.currentUser,$=a.appData,ee=a.customFeedItemTypeTemplates,te=o(a,M),re=d(J.allowed_actions,"destroy"),oe=L(),ne=i(!1),ie=r(ne,2),ae=ie[0],se=ie[1],me=i(!0),pe=r(me,2),ce=pe[0],le=pe[1],de=i(!1),ue=r(de,2),fe=ue[0],ye=ue[1],ve=J.type===g.post.type,be=K.includes(J.type),he=J.type===g.geosteering_comments.type&&(null===(m=J.context)||void 0===m||null===(u=m.geosteering_comments)||void 0===u||null===(I=u.data)||void 0===I?void 0:I.isRecommendation),Ie=g[J.type].label,ge=C.getUserFullName(J.user),je=J.type===g.alert.type&&"/alerts/".concat(null===(U=J.context)||void 0===U||null===(S=U.alert)||void 0===S?void 0:S.id),Te=J.type===g.alert.type&&je,Ce=(z=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return se(!0),e.prev=1,e.next=4,j(J.id);case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return");case 9:return e.prev=9,se(!1),e.finish(9);case 12:_("Item was deleted"),Q(J.id);case 14:case"end":return e.stop()}}),e,null,[[1,6,9,12]])}))),function(){return z.apply(this,arguments)}),Oe=(H=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=J.id,e.prev=1,e.next=4,T(t);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])}))),function(){return H.apply(this,arguments)});return N(p,{"data-testid":"".concat("FeedPo","_post_").concat(null===(q=J.context)||void 0===q||null===(V=q.post)||void 0===V?void 0:V.body,"_rigName_").concat(function(e){var t,r,o;return!!e.rig?null===(t=e.rig)||void 0===t?void 0:t.name:null===(r=e.well)||void 0===r||null===(o=r.parent_asset)||void 0===o?void 0:o.name}(J)),className:s(oe.paperRoot,(W={},e(W,oe.clickablePaperRoot,Te),e(W,R.hideOverflow,ae),W)),elevation:0,children:[N("div",{onClick:function(){Te&&Y.push(je)},className:s(R.mainContainer,(G={},e(G,R.mainContainerClickable,Te),e(G,R.mainContainerNative,y),G)),children:[A(D,{feedItem:J,classes:oe,displayName:ge,isRecommended:he}),N("div",{className:s(R.mainContainerTop,e({},R.mainContainerTopNative,y)),children:[A(E,{feedItem:J,userFullName:ge,typeLabel:Ie,classes:oe,isPost:ve}),N("div",{className:R.mainContainerTopMenu,children:[A(P,{feedItem:J,classes:oe}),A(O,{"data-testid":"".concat("FeedPo","_actionsDropdown"),isPost:ve,isEditableItem:be,canDeleteFeedItem:re,handleEditMenuItem:function(){X(J)},handleDeleteMenuItem:function(){ye(!0)},copyFeedItemLink:function(){var e=J.id,t="".concat(window.location.host,"/feed/").concat(e);C.copyToClipboard(t)},feedItem:J,currentUser:Z})]}),A(x,{feedItem:J,isPost:ve})]}),A(c,{className:oe.headerDividerRoot}),A(h,{ErrorView:function(){return A(l,{children:"Feed Item loading failed"})},children:A(w,B({feedItem:J,appData:$,customFeedItemTypeTemplates:ee,currentUser:Z},te))})]}),A(k,{feedItem:J,handleToggleLike:Oe,setOpenCommentInput:le,openCommentInput:ce,currentUser:Z}),A(F,{openCommentInput:ce,feedItem:J,currentUser:Z}),ae&&A("div",{className:R.loadingContainer,style:{backgroundColor:f[800]},children:A(b,{})}),fe&&A(v,{open:fe,title:"Delete post",text:"Are you sure you want to delete post and all attachments?",handleClose:function(){return ye(!1)},handleOk:function(){Ce()},okText:"Delete"})]})}S.propTypes={feedItem:a.shape().isRequired,enterEditMode:a.func,removeFeedItem:a.func,editableFeedItemTypes:a.oneOf([I.TRACES_MEMO,I.POST]),currentUser:a.shape().isRequired,appData:a.shape().isRequired,customFeedItemTypeTemplates:a.shape()},S.defaultProps={enterEditMode:u,removeFeedItem:u,editableFeedItemTypes:[I.POST],customFeedItemTypeTemplates:{}};export{S as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import i from"@babel/runtime/regenerator";import{useState as n}from"react";import s from"prop-types";import p from"classnames";import{makeStyles as m,Paper as a,Divider as l,Typography as d}from"@material-ui/core";import{includes as c,noop as u}from"lodash";import j from"@material-ui/core/colors/grey";import{isNativeDetected as C}from"../../utils/mobileDetect.js";import v from"../ConfirmationDialog.js";import f from"../LoadingIndicator/LoadingIndicator.js";import A from"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsxs as D,jsx as g}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../../constants/segment.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../Modal/CorvaModal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"querystring";import"uuid/v1";import{deleteFeedItem as b,toggleFeedItemLike as I}from"../../clients/jsonApi/index.js";import"../../clients/subscriptions.js";import"../../constants/goals.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/notifications.js";import{FEED_ITEM_TYPES as x,FEED_ITEM_TYPES_BY_KEY as y}from"../../constants/feed.js";import"../../constants/bha.js";import"../../utils/index.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"../DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../DevCenter/IsolatedDevCenterAppContainer/AppsGridDragHandle.js";import"../AssetEditor/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import"../Typography.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"@babel/runtime/helpers/typeof";import"slate";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"../SettingEditors/ColorEditor/index.js";import"../SettingEditors/DropdownEditor/index.js";import"../SettingEditors/RadioEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../RangeSlider/RangeSlider.js";import"../GridLockButton/index.js";import"../Login/components/Login.js";import"../Login/components/PasswordField.js";import"../Login/components/Chip.js";import"../Login/components/StepFooter.js";import"../Login/components/StepContent.js";import"../Login/components/StepHeader.js";import"../Login/components/Step.js";import"../Login/components/OrDivider.js";import"../Login/components/HiddenEmailField.js";import"../Login/components/EmailField.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import"../Button/index.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../Notifications/Notifications.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../MenuItem/index.js";import"../PadModeSelect/PadModeSelect.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../Table/TableToolbar/TableToolbar.js";import{useIsInsideDcApp as P}from"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import"../Tooltip/MuiTooltipDcWrapper.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Step.js";import"../Stepper/StepsWrapper.js";import"../Stepper/Stepper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../FilesLoader/Icons/FileIcon.js";import"../SearchInput/index.js";import"./FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../EmptyView/EmptyAppView/components/ErrorSubtitleWithIntercomLink.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton/index.js";import"../DevCenter/DevCenterAppContainer/components/DisabledSettingsMessage/DisabledSettingsMessage.js";import T from"../../utils/main.js";import h from"./components/Actions.js";import S from"./components/FeedComments.js";import E from"./components/Content.js";import F from"./components/CreatedAt.js";import L from"./components/Icon.js";import k from"./components/Reactions.js";import w from"./components/RigAndWell.js";import O from"./components/TypeAndAssetTitle.js";import B from"./FeedItem.css.js";import{showSuccessNotification as M}from"../../utils/notificationToasts.js";var R=["feedItem","editableFeedItemTypes","removeFeedItem","enterEditMode","router","currentUser","appData","customFeedItemTypeTemplates","paperClassName"];function V(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function N(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?V(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var H=m((function(e){return{paperRoot:{position:"relative",marginBottom:10,paddingBottom:16,backgroundColor:function(t){return t.isInsideDcApp?"rgba(65, 65, 65, 0.9)":e.palette.background.b8},width:function(e){return e.isInsideDcApp?360:"100%"},boxShadow:function(e){return e.isInsideDcApp&&"0px 8px 10px rgba(0, 0, 0, 0.14), 0px 3px 14px rgba(0, 0, 0, 0.12), 0px 5px 5px rgba(0, 0, 0, 0.2)"}},clickablePaperRoot:{"&:hover":{filter:"brightness(90%)",transition:"filter 0.3s"}},headerDividerRoot:{margin:"8px 0 8px 0",backgroundColor:"#595959"}}}));function W(s){var m,u,x,V,W,U,_,q,z,G,K,J=s.feedItem,Q=s.editableFeedItemTypes,X=s.removeFeedItem,Y=s.enterEditMode,Z=s.router,$=s.currentUser,ee=s.appData,te=s.customFeedItemTypeTemplates,oe=s.paperClassName,re=r(s,R),ie=c(J.allowed_actions,"destroy"),ne=P(),se=H({isInsideDcApp:ne}),pe=n(!1),me=o(pe,2),ae=me[0],le=me[1],de=n(!0),ce=o(de,2),ue=ce[0],je=ce[1],Ce=n(!0),ve=o(Ce,2),fe=ve[0],Ae=ve[1],De=n(!1),ge=o(De,2),be=ge[0],Ie=ge[1],xe=J.type===y.post.type,ye=Q.includes(J.type),Pe=J.type===y.geosteering_comments.type&&(null===(m=J.context)||void 0===m||null===(u=m.geosteering_comments)||void 0===u||null===(x=u.data)||void 0===x?void 0:x.isRecommendation),Te=y[J.type].label,he=T.getUserFullName(J.user),Se=J.type===y.alert.type&&"/alerts/".concat(null===(V=J.context)||void 0===V||null===(W=V.alert)||void 0===W?void 0:W.id),Ee=J.type===y.alert.type&&Se,Fe=(G=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.prev=1,e.next=4,b(J.id);case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return");case 9:return e.prev=9,le(!1),e.finish(9);case 12:M("Item was deleted"),X(J.id);case 14:case"end":return e.stop()}}),e,null,[[1,6,9,12]])}))),function(){return G.apply(this,arguments)}),Le=(K=t(i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=J.id,e.prev=1,e.next=4,I(t);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])}))),function(){return K.apply(this,arguments)});return D(a,{"data-testid":"".concat("FeedPo","_post_").concat(null===(U=J.context)||void 0===U||null===(_=U.post)||void 0===_?void 0:_.body,"_rigName_").concat(function(e){var t,o,r;return!!e.rig?null===(t=e.rig)||void 0===t?void 0:t.name:null===(o=e.well)||void 0===o||null===(r=o.parent_asset)||void 0===r?void 0:r.name}(J)),className:p(se.paperRoot,oe,(q={},e(q,se.clickablePaperRoot,Ee),e(q,B.hideOverflow,ae),q)),elevation:0,children:[D("div",{onClick:function(){Ee&&Z.push(Se)},className:p(B.mainContainer,(z={},e(z,B.mainContainerClickable,Ee),e(z,B.mainContainerNative,C),z)),children:[g(L,{feedItem:J,classes:se,displayName:he,isRecommended:Pe}),D("div",{className:p(B.mainContainerTop,e({},B.mainContainerTopNative,C)),children:[D("div",{className:B.mainContainerTopLine,children:[g(O,{feedItem:J,userFullName:he,typeLabel:Te,classes:se,isPost:xe}),D("div",{className:B.mainContainerTopMenu,children:[g(F,{feedItem:J,classes:se}),g(h,{"data-testid":"".concat("FeedPo","_actionsDropdown"),isPost:xe,isEditableItem:ye,canDeleteFeedItem:ie,handleEditMenuItem:function(){Y(J)},handleDeleteMenuItem:function(){Ie(!0)},copyFeedItemLink:function(){var e=J.id,t="".concat(window.location.host,"/feed/").concat(e);T.copyToClipboard(t)},feedItem:J,currentUser:$})]})]}),g(w,{feedItem:J,isPost:xe})]}),g(l,{className:se.headerDividerRoot}),g(A,{ErrorView:function(){return g(d,{children:"Feed Item loading failed"})},children:g(E,N({feedItem:J,appData:ee,customFeedItemTypeTemplates:te,currentUser:$},re))})]}),g(k,{feedItem:J,handleToggleLike:Le,setOpenCommentInput:je,setOpenCommentList:Ae,openCommentInput:ue,openCommentList:fe,currentUser:$}),g(S,{openCommentInput:ue,openCommentList:fe,feedItem:J,currentUser:$}),ae&&g("div",{className:B.loadingContainer,style:{backgroundColor:j[800]},children:g(f,{})}),be&&g(v,{open:be,title:"Delete post",text:"Are you sure you want to delete post and all attachments?",handleClose:function(){return Ie(!1)},handleOk:function(){Fe()},okText:"Delete"})]})}W.propTypes={feedItem:s.shape().isRequired,enterEditMode:s.func,removeFeedItem:s.func,editableFeedItemTypes:s.oneOf([x.TRACES_MEMO,x.POST]),currentUser:s.shape().isRequired,appData:s.shape().isRequired,paperClassName:s.string,customFeedItemTypeTemplates:s.shape()},W.defaultProps={enterEditMode:u,removeFeedItem:u,paperClassName:void 0,editableFeedItemTypes:[x.POST],customFeedItemTypeTemplates:{}};export{W as default};
@@ -1 +1 @@
1
- import r from"@babel/runtime/helpers/defineProperty";import e from"classnames";import{makeStyles as a}from"@material-ui/core";import o from"../../Avatar/index.js";import i from"../../UserCardPopover.js";import{isNativeDetected as t}from"../../../utils/mobileDetect.js";import m from"../../Icons/RecommendationIcon.js";import{jsxs as p,jsx as s}from"react/jsx-runtime";var l=a({avatarWrapper:{width:32,height:32,backgroundColor:"grey",borderRadius:"100%",position:"absolute",top:18,left:-21},avatarWrapperNative:{left:"auto"},recommendationWrapper:{position:"absolute",bottom:-8,right:-6}}),d=function(a){var d,n,c=a.displayName,u=a.feedItem,v=a.isRecommended,f=l();return p("div",{className:e(f.avatarWrapper,r({},f.avatarWrapperNative,t)),children:[t?s(o,{displayName:c,imgSrc:null===(d=u.user)||void 0===d?void 0:d.profile_photo,size:32}):s(i,{user:u.user,children:s(o,{displayName:c,imgSrc:null===(n=u.user)||void 0===n?void 0:n.profile_photo,size:32,className:f.avatar})}),v&&s("div",{className:f.recommendationWrapper,children:s(m,{})})]})};export{d as default};
1
+ import r from"@babel/runtime/helpers/defineProperty";import e from"classnames";import{makeStyles as a}from"@material-ui/core";import o from"../../Avatar/index.js";import i from"../../UserCardPopover.js";import{isNativeDetected as t}from"../../../utils/mobileDetect.js";import m from"../../Icons/RecommendationIcon.js";import{jsxs as p,jsx as s}from"react/jsx-runtime";var l=a({avatarWrapper:{width:32,height:32,backgroundColor:"grey",borderRadius:"100%",position:"absolute",top:22,left:-16},avatarWrapperNative:{left:"auto"},recommendationWrapper:{position:"absolute",bottom:-8,right:-6}}),d=function(a){var d,n,c=a.displayName,u=a.feedItem,v=a.isRecommended,f=l();return p("div",{className:e(f.avatarWrapper,r({},f.avatarWrapperNative,t)),children:[t?s(o,{displayName:c,imgSrc:null===(d=u.user)||void 0===d?void 0:d.profile_photo,size:32}):s(i,{user:u.user,children:s(o,{displayName:c,imgSrc:null===(n=u.user)||void 0===n?void 0:n.profile_photo,size:32,className:f.avatar})}),v&&s("div",{className:f.recommendationWrapper,children:s(m,{})})]})};export{d as default};
@@ -1 +1 @@
1
- import t from"moment";import{makeStyles as e,Typography as r}from"@material-ui/core";import{jsx as a}from"react/jsx-runtime";var o=e((function(t){return{createdAtRoot:{color:t.palette.primary.text6}}})),m=function(e){var m=e.feedItem,c=o();return a(r,{variant:"body2","data-testid":"".concat("FeedPo","_createdPostDate"),className:c.createdAtRoot,children:t(m.created_at).format("MM/DD/YY H:mm")})};export{m as default};
1
+ import t from"moment";import{makeStyles as e,Typography as r}from"@material-ui/core";import{jsx as a}from"react/jsx-runtime";var o=e((function(t){return{createdAtRoot:{color:t.palette.primary.text6,minWidth:"100px"}}})),m=function(e){var m=e.feedItem,i=o();return a(r,{variant:"body2","data-testid":"".concat("FeedPo","_createdPostDate"),className:i.createdAtRoot,children:t(m.created_at).format("MM/DD/YY H:mm")})};export{m as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import{useState as o,useRef as t}from"react";import r from"prop-types";import n from"lodash/noop";import m from"moment";import{makeStyles as i,Button as s,Typography as a}from"@material-ui/core";import c from"../../Comment/index.js";import p from"../../CommentLoader.js";import d from"../../CommentInput/index.js";import{postFeedItemComment as u}from"../../../clients/jsonApi/index.js";import{isNativeDetected as l}from"../../../utils/mobileDetect.js";import{jsxs as f,jsx as C}from"react/jsx-runtime";var h=i({showMoreButtonRoot:{textTransform:"none",backgroundColor:"transparent!important"},feedCommentsContainer:{padding:"0 24px 0 32px"}});function x(r){var i,x=r.openCommentInput,I=r.feedItem,v=r.currentUser,y=o(!1),b=e(y,2),j=b[0],R=b[1],g=o(3),k=e(g,2),w=k[0],U=k[1],_=t(),q=h(),M=I.comments.length,T=M>w;return f("div",{className:(x||!!M)&&q.feedCommentsContainer,children:[x&&!l&&C(d,{inputRef:_,postComment:function(e){u(I.id,e)},setIsPosting:R,companyId:I.company_id,autoFocus:!1,currentUser:v,parentId:"".concat(I.id,"-").concat(null===(i=I.comments)||void 0===i?void 0:i.size)}),T&&C(s,{"data-testid":"".concat("FeedComments","_viewMoreComments"),classes:q.showMoreButtonRoot,onClick:function(){U((function(e){return 3===e?e+7:e+10}))},children:C(a,{variant:"caption",color:"primary",children:"View more comments"})}),I.comments.sort((function(e){return-m(e.created_at).unix()})).slice(0,w).reverse().map((function(e){return C(c,{comment:e,handleDeleteCallback:n,patchCommentCallback:n,companyId:I.company_id,currentUser:v},e.id)})),j&&C(p,{})]})}x.propTypes={openCommentInput:r.bool.isRequired,feedItem:r.shape().isRequired,currentUser:r.shape().isRequired};export{x as default};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useRef as n,useMemo as o,useEffect as r}from"react";import i from"prop-types";import{sortBy as m,noop as s}from"lodash";import a from"moment";import{makeStyles as c,Typography as d}from"@material-ui/core";import l from"../../Comment/index.js";import p from"../../CommentLoader.js";import u from"../../CommentInput/index.js";import{postFeedItemComment as f}from"../../../clients/jsonApi/index.js";import{isNativeDetected as C}from"../../../utils/mobileDetect.js";import{jsxs as h,jsx as g}from"react/jsx-runtime";var v=c({showMore:{cursor:"pointer"},feedCommentsContainer:{padding:"0 16px 0 24px"},feedCommentsList:{marginTop:24},feedCommentsListContent:{height:function(e){var t=e.commentsListHeight;return t&&t-8},overflow:function(e){return e.commentsListHeight&&"scroll"}},feedCommentsListContentWrapper:{position:"relative"},gradient:{position:"absolute",bottom:0,left:0,width:"100%",height:16,background:"linear-gradient(180deg, rgba(61, 61, 61, 0) 0%, #414141 100%)"}});function b(i){var c,b=i.openCommentInput,L=i.openCommentList,y=i.feedItem,I=i.currentUser,x=y.comments,j=x.length,N=j>3,w=t(!1),H=e(w,2),k=H[0],R=H[1],U=t(!1),_=e(U,2),q=_[0],A=_[1],M=t(!1),T=e(M,2),D=T[0],F=T[1],P=t(null),W=e(P,2),z=W[0],K=W[1],S=n(),V=n(),B=o((function(){var e=m(y.comments,(function(e){return-a(e.created_at).unix()}));return D?D&&!q?e.slice(0,5):D&&q?e:[]:e.slice(0,3)}),[x,q,D]);r((function(){if(5===B.length&&!z){var e=V.current.clientHeight;K(e),A(!0)}z&&!D&&(K(null),A(!1))}),[B.length,z,D]);var E=v({commentsListHeight:z,isAllCommentsVisibleKeyPressed:D});return h("div",{className:(b||!!j)&&E.feedCommentsContainer,children:[b&&!C&&g(u,{inputRef:S,postComment:function(e){f(y.id,e)},setIsPosting:R,companyId:y.company_id,autoFocus:!1,currentUser:I,parentId:"".concat(y.id,"-").concat(null===(c=y.comments)||void 0===c?void 0:c.size)}),L&&h("div",{className:E.feedCommentsList,children:[g("div",{className:E.feedCommentsListContentWrapper,children:h("div",{className:E.feedCommentsListContent,ref:V,children:[B.map((function(e){return g(l,{comment:e,handleDeleteCallback:s,patchCommentCallback:s,companyId:y.company_id,currentUser:I},e.id)})),z&&g("div",{className:E.gradient})]})}),N&&g(d,{variant:"caption",color:"primary","data-testid":"".concat("FeedComments","_viewMoreComments"),className:E.showMore,onClick:function(){F(!D)},children:D?"Hide older comments":"See all comments"})]}),k&&g(p,{})]})}b.propTypes={openCommentInput:i.bool.isRequired,feedItem:i.shape().isRequired,currentUser:i.shape().isRequired};export{b as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import o from"classnames";import{makeStyles as t}from"@material-ui/core";import{isNativeDetected as i}from"../../../utils/mobileDetect.js";import{getIconForFeedItemType as r,AVATAR_ICON as a}from"../../../utils/feed.js";import{FEED_ITEM_TYPES_BY_KEY as m}from"../../../constants/feed.js";import{ALERT_LEVEL_COLOR as n}from"../../../constants/alerts.js";import l from"./AvatarIcon.js";import{jsx as d}from"react/jsx-runtime";var c=t({icon:{width:32,height:32,backgroundColor:"grey",borderRadius:23,position:"absolute",top:18,left:-21,padding:6},iconWrapper:{display:"inline-block",height:20,width:20,overflow:"hidden"},iconImg:{height:20,width:20},iconNative:{left:"auto"}}),s=function(t){var r,a=t.feedItem,l=t.feedItemType,s=t.icon,p=c(),f=m[l]?m[l].label:"Other";if(l===m.alert.type){var u,h,v=null===(u=a.context)||void 0===u||null===(h=u.alert)||void 0===h?void 0:h.level;r={backgroundColor:n[v]}}return d("div",{className:o(p.icon,e({},p.iconNative,i)),style:r,children:d("div",{className:p.iconWrapper,children:d("img",{src:s,alt:"".concat(f," icon"),className:p.iconImg})})})},p=function(e){var o=e.feedItem,t=e.displayName,i=e.isRecommended,m=o.type,n=r(m);return n===a?d(l,{displayName:t,feedItem:o,isRecommended:i}):d(s,{icon:n,feedItem:o,feedItemType:m})};export{p as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import o from"classnames";import{makeStyles as t}from"@material-ui/core";import{isNativeDetected as i}from"../../../utils/mobileDetect.js";import{getIconForFeedItemType as r,AVATAR_ICON as a}from"../../../utils/feed.js";import{FEED_ITEM_TYPES_BY_KEY as m}from"../../../constants/feed.js";import{ALERT_LEVEL_COLOR as n}from"../../../constants/alerts.js";import l from"./AvatarIcon.js";import{jsx as d}from"react/jsx-runtime";var c=t({icon:{width:32,height:32,backgroundColor:"grey",borderRadius:23,position:"absolute",top:18,left:-16,padding:6},iconWrapper:{display:"inline-block",height:20,width:20,overflow:"hidden"},iconImg:{height:20,width:20},iconNative:{left:"auto"}}),s=function(t){var r,a=t.feedItem,l=t.feedItemType,s=t.icon,p=c(),f=m[l]?m[l].label:"Other";if(l===m.alert.type){var u,h,v=null===(u=a.context)||void 0===u||null===(h=u.alert)||void 0===h?void 0:h.level;r={backgroundColor:n[v]}}return d("div",{className:o(p.icon,e({},p.iconNative,i)),style:r,children:d("div",{className:p.iconWrapper,children:d("img",{src:s,alt:"".concat(f," icon"),className:p.iconImg})})})},p=function(e){var o=e.feedItem,t=e.displayName,i=e.isRecommended,m=o.type,n=r(m);return n===a?d(l,{displayName:t,feedItem:o,isRecommended:i}):d(s,{icon:n,feedItem:o,feedItemType:m})};export{p as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"classnames";import i from"moment";import{uniq as n}from"lodash";import{makeStyles as r,useTheme as o,IconButton as m}from"@material-ui/core";import a from"@material-ui/icons/ThumbUp";import s from"@material-ui/icons/Comment";import{notifyOpenFeedCommentInput as l}from"../../../utils/nativeMessages.js";import{isNativeDetected as c}from"../../../utils/mobileDetect.js";import u from"../../CommentsInfo/index.js";import p from"../../../utils/main.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";var g=r({reactionButton:{padding:8},reactions:{minHeight:48,marginTop:5,display:"flex",alignItems:"center",padding:"0 24px 16px 32px",flexWrap:"wrap"},reactionsNative:{padding:"0 16px"},actions:{display:"flex",marginRight:30,alignItems:"center"}}),h=c?2:4,C=function(r){var C=r.feedItem,k=r.currentUser,v=r.setOpenCommentInput,x=r.openCommentInput,N=r.handleToggleLike,b=o(),y=g(),I=C.likes_count,j=C.comments.length,B=(C.likes||[]).find((function(e){var t;return(null===(t=e.user)||void 0===t?void 0:t.id)===k.id})),U=(C.likes||[]).map((function(e){return p.getUserFullName(e.user)})),F=n((C.comments||[]).map((function(e){return p.getUserFullName(e.user)}))),L=n((C.comments||[]).concat(C.likes||[]).sort((function(e){return i(e.created_at).unix()})).map((function(e){return e.user}))).slice(0,h);return d("div",{className:t(y.reactions,e({},y.reactionsNative,c)),children:f("div",{className:y.actions,children:[d(m,{"data-testid":"".concat("FeedPo","_likeButton"),"aria-label":"Like",onClick:N,className:y.reactionButton,children:d(a,{htmlColor:B?b.palette.primary.main:b.palette.grey[400]})}),d(m,{"data-testid":"".concat("FeedPo","_commentButton"),"aria-label":"Comment",onClick:function(){c?l(C.id):v(!x)},className:y.reactionButton,children:d(s,{htmlColor:b.palette.grey[400]})}),d(u,{likesCount:I,usersWhoLike:U,commentsCount:j,usersWhoCommented:F,activeUsersList:L,onCommentsClick:function(){return v(!x)},small:!0})]})})};export{C as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"classnames";import i from"moment";import{uniq as n,uniqBy as o}from"lodash";import{makeStyles as r,useTheme as m,IconButton as a}from"@material-ui/core";import s from"@material-ui/icons/ThumbUp";import l from"@material-ui/icons/Comment";import{notifyOpenFeedCommentInput as c}from"../../../utils/nativeMessages.js";import{isNativeDetected as u}from"../../../utils/mobileDetect.js";import p from"../../CommentsInfo/index.js";import d from"../../../utils/main.js";import{jsx as f,jsxs as g}from"react/jsx-runtime";var C=r({reactionButton:{padding:8},reactions:{minHeight:48,marginTop:5,display:"flex",alignItems:"center",padding:"8px 16px 8px 24px",flexWrap:"wrap"},reactionsNative:{padding:"0 16px"},actions:{display:"flex",marginRight:30,alignItems:"center"}}),h=u?2:3,k=function(r){var k=r.feedItem,x=r.currentUser,v=r.setOpenCommentInput,N=r.setOpenCommentList,b=r.openCommentInput,y=r.openCommentList,I=r.handleToggleLike,L=m(),j=C(),B=k.likes_count,U=k.comments.length,F=(k.likes||[]).find((function(e){var t;return(null===(t=e.user)||void 0===t?void 0:t.id)===x.id})),_=(k.likes||[]).map((function(e){return d.getUserFullName(e.user)})),P=n((k.comments||[]).map((function(e){return d.getUserFullName(e.user)}))),T=o((k.comments||[]).concat(k.likes||[]).map((function(e){return e.user})).sort((function(e){return i(e.created_at).unix()})),"id").slice(0,h),W=!b||!y;return f("div",{className:t(j.reactions,e({},j.reactionsNative,u)),children:g("div",{className:j.actions,children:[f(a,{"data-testid":"".concat("FeedPo","_likeButton"),"aria-label":"Like",onClick:I,className:j.reactionButton,children:f(s,{htmlColor:F?L.palette.primary.main:L.palette.grey[400]})}),f(a,{"data-testid":"".concat("FeedPo","_commentButton"),"aria-label":"Comment",onClick:function(){u?c(k.id):(v(W),N(W))},className:j.reactionButton,children:f(l,{htmlColor:L.palette.grey[400]})}),f(p,{likesCount:B,usersWhoLike:_,commentsCount:U,usersWhoCommented:P,activeUsersList:T,onCommentsClick:function(){return N(!y)},small:!0})]})})};export{k as default};
@@ -1 +1 @@
1
- import{Link as e}from"react-router";import{makeStyles as t,Typography as i}from"@material-ui/core";import{jsx as n,jsxs as o}from"react/jsx-runtime";var l=t((function(e){return{contentAssetInfo:{color:e.palette.primary.text6,width:"100%",fontSize:12},assetLink:{cursor:"pointer",display:"block",width:"100%",padding:"2px 0",fontSize:"12px"}}})),r=function(t){var r,a,d,c,s,v,u=t.feedItem,m=l(),f=!!u.rig,p=function(e){var t,i,n;return e.rig?null===(t=e.rig)||void 0===t?void 0:t.name:null===(i=e.well)||void 0===i||null===(n=i.parent_asset)||void 0===n?void 0:n.name}(u),w=f?null===(r=u.rig)||void 0===r||null===(a=r.active_well)||void 0===a?void 0:a.name:null===(d=u.well)||void 0===d?void 0:d.name,g=f?null===(c=u.rig)||void 0===c||null===(s=c.active_well)||void 0===s?void 0:s.id:null===(v=u.well)||void 0===v?void 0:v.id;return g?n(e,{"data-testid":"".concat("FeedPo","_wellLink"),className:m.assetLink,onClick:function(e){return e.stopPropagation()},to:"/assets/".concat(g,"/"),children:o(i,{variant:"body2",className:m.contentAssetInfo,children:[p," - ",w]})}):o(i,{variant:"body2",className:m.contentAssetInfo,children:[p," - No Active Well"]})};export{r as default};
1
+ import{Link as i}from"react-router";import{makeStyles as e,Typography as n}from"@material-ui/core";import{jsx as t,jsxs as o}from"react/jsx-runtime";var l=e((function(i){return{contentAssetInfo:{color:i.palette.primary.main,width:"100%",fontSize:12},assetLink:{cursor:"pointer",display:"block",width:"100%",padding:"4px 0 0 0",fontSize:"12px"}}})),r=function(e){var r,a,d,c,s,v,u=e.feedItem,m=l(),f=!!u.rig,p=function(i){var e,n,t;return i.rig?null===(e=i.rig)||void 0===e?void 0:e.name:null===(n=i.well)||void 0===n||null===(t=n.parent_asset)||void 0===t?void 0:t.name}(u),w=f?null===(r=u.rig)||void 0===r||null===(a=r.active_well)||void 0===a?void 0:a.name:null===(d=u.well)||void 0===d?void 0:d.name,g=f?null===(c=u.rig)||void 0===c||null===(s=c.active_well)||void 0===s?void 0:s.id:null===(v=u.well)||void 0===v?void 0:v.id;return g?t(i,{"data-testid":"".concat("FeedPo","_wellLink"),className:m.assetLink,onClick:function(i){return i.stopPropagation()},to:"/assets/".concat(g,"/"),children:o(n,{variant:"body2",className:m.contentAssetInfo,children:[p," - ",w]})}):o(n,{variant:"body2",className:m.contentAssetInfo,children:[p," - No Active Well"]})};export{r as default};
@@ -1 +1 @@
1
- import{makeStyles as e,Typography as t}from"@material-ui/core";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as a}from"../../../constants/feed.js";import{jsx as r}from"react/jsx-runtime";var i=[o.post.type,o.app_annotation.type,o.geosteering_comments.type,a.TRACES_MEMO,a.DEPTH_COMMENTS],n=e((function(e){return{assetRoot:{color:e.palette.grey[400],whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",marginRight:10,fontWeight:700,letterSpacing:.25},postTitle:{color:"#fff"}}})),s=function(e){var o=e.feedItem,a=e.userFullName,s=e.typeLabel,l=n(),p=i.includes(o.type)?a:s;return r(t,{variant:"body2",className:l.assetRoot,children:r("span",{"data-testid":"".concat("FeedPo","_postTitle"),className:l.postTitle,children:p})})};export{s as default};
1
+ import{makeStyles as e,Typography as t}from"@material-ui/core";import{FEED_ITEM_TYPES_BY_KEY as o,FEED_ITEM_TYPES as a}from"../../../constants/feed.js";import{jsx as r}from"react/jsx-runtime";var i=[o.post.type,o.app_annotation.type,o.geosteering_comments.type,a.TRACES_MEMO,a.DEPTH_COMMENTS],n=e((function(e){return{assetRoot:{color:e.palette.grey[400],whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",marginRight:4,fontWeight:700,letterSpacing:.25},postTitle:{color:"#fff"}}})),s=function(e){var o=e.feedItem,a=e.userFullName,s=e.typeLabel,l=n(),p=i.includes(o.type)?a:s;return r(t,{variant:"body2",className:l.assetRoot,children:r("span",{"data-testid":"".concat("FeedPo","_postTitle"),className:l.postTitle,children:p})})};export{s as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useRef as o,useState as r}from"react";import n from"moment";import{debounce as a}from"lodash";import i from"classnames";import{makeStyles as s,Grid as c,Typography as l}from"@material-ui/core";import m from"../../../Modal/Modal.js";import p from"../../../PostInput/PostInput.js";import d from"../../../IconButton/index.js";import{Regular14 as u}from"../../../Typography.js";import h from"../../../Icons/SendIcon.js";import{isSuggestionsListOpened as f}from"../../../UserMention/utils/index.js";import{jsxs as g,jsx as b}from"react/jsx-runtime";function y(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function v(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?y(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var w=s((function(e){return{postInput:{paddingBottom:8},filePreviewWrapper:{width:"100%",marginLeft:0,maxHeight:251},modal:{maxWidth:450,width:"100vw"},actionsAdornment:{flex:1},info:{marginTop:16},text:{color:e.palette.primary.text6},value:{color:"#fff"},inputMain:{marginBottom:0,fontSize:"11px",color:e.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:e.palette.primary.main},modalActions:{paddingTop:16},actions:{height:36},sendRow:{display:"flex"},sendIcon:{"&.Mui-disabled":{cursor:"not-allowed!important"}}}})),x={suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}};function j(e){var s,y=e.feedItem.context.dvd_comment,j=y.body,N=y.attachment,O=y.data,P=y.data,C=P.bitDepth,I=P.holeDepth,D=P.cost,B=P.timestamp,M=e.onClose,S=e.onSave,H=e.userCompanyId,T=w(),k=o(),A=r({body:j,attachment:N}),E=t(A,2),L=E[0],W=E[1],R=a(W,300),K=function(){S({context:{dvd_comment:v(v({},L),{},{data:O})}})};return g(m,{open:!0,onClose:M,title:"Edit Comment",contentClassName:T.modal,actionsClassName:T.modalActions,actions:g(c,{container:!0,direction:"row",justify:"space-between",alignItems:"center",className:T.actions,children:[b(c,{item:!0,children:b(l,{variant:"caption",className:i(T.inputMain,T.cancelText,T.highlightedLabel),component:"div",gutterBottom:!0,onClick:M,children:"Cancel"})}),g(c,{item:!0,direction:"row",alignItems:"center",className:T.sendRow,children:[g(l,{variant:"caption",className:i(T.inputMain,T.inputHelper),component:"div",gutterBottom:!0,children:["Press ",b(l,{variant:"caption",color:"primary",className:i(T.inputMain,T.highlightedLabel),children:"Enter"})," to send"]}),b(d,{onClick:K,className:T.sendIcon,disabled:!L||!L.body&&!L.attachment,children:b(h,{})})]})]}),ref:k,children:[b(p,{initialValue:{body:j,attachment:N},userCompanyId:H,onChange:R,filePreviewWrapperClass:T.filePreviewWrapper,className:T.postInput,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||f()||(e.preventDefault(),K())},mentionStyle:x,suggestionsPortalHost:k.current,allowSuggestionsAboveCursor:!0}),g("div",{className:T.info,children:[B&&g(u,{className:T.text,gutterBottom:!0,children:["Time:"," ",b("span",{className:T.value,children:n(B).format("MM/DD/YY, HH:mm")})," "]}),D&&g(u,{className:T.text,gutterBottom:!0,children:["Cost: ",g("span",{className:T.value,children:[" ",(s=D,s.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "))]})," ",b("span",{className:T.currency,children:"$"})]}),C&&g(u,{className:T.text,gutterBottom:!0,children:["Bit Depth: ",g("span",{className:T.value,children:[C,"'"]})]}),I&&g(u,{className:T.text,gutterBottom:!0,children:["Hole Depth: ",g("span",{className:T.value,children:[I,"'"]})]})]})]})}export{j as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useRef as o,useState as r}from"react";import n from"moment";import{debounce as i}from"lodash";import a from"classnames";import{makeStyles as s,Grid as c,Typography as l}from"@material-ui/core";import m from"../../../Modal/Modal.js";import p from"../../../PostInput/PostInput.js";import d from"../../../IconButton/index.js";import{Regular14 as u}from"../../../Typography.js";import h from"../../../Icons/SendIcon.js";import{isSuggestionsListOpened as f}from"../../../UserMention/utils/index.js";import{jsxs as g,jsx as b}from"react/jsx-runtime";function y(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function v(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?y(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var N=s((function(e){return{postInput:{paddingBottom:8},filePreviewWrapper:{width:"100%",marginLeft:0,maxHeight:251},modal:{maxWidth:450,width:"100vw"},actionsAdornment:{flex:1},info:{marginTop:16},text:{color:e.palette.primary.text6},value:{color:"#fff"},inputMain:{marginBottom:0,fontSize:"11px",color:e.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:e.palette.primary.main},modalActions:{paddingTop:16},actions:{height:36},sendRow:{display:"flex"},sendIcon:{"&.Mui-disabled":{cursor:"not-allowed!important"}}}})),w={suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}};function x(e){var s,y=e.feedItem.context.dvd_comment,x=y.body,j=y.attachment,O=y.data,P=y.data,C=P.bitDepth,I=P.holeDepth,D=P.cost,B=P.timestamp,M=e.onClose,S=e.onSave,H=e.userCompanyId,T=N(),k=o(),A=r({body:x,attachment:j}),E=t(A,2),L=E[0],W=E[1],F=i(W,300),R=function(){S({context:{dvd_comment:v(v({},L),{},{data:O})}})};return g(m,{open:!0,onClose:M,title:"Edit Comment",contentClassName:T.modal,actionsClassName:T.modalActions,actions:g(c,{container:!0,direction:"row",justify:"space-between",alignItems:"center",className:T.actions,children:[b(c,{item:!0,children:b(l,{variant:"caption",className:a(T.inputMain,T.cancelText,T.highlightedLabel),component:"div",gutterBottom:!0,onClick:M,children:"Cancel"})}),g(c,{item:!0,direction:"row",alignItems:"center",className:T.sendRow,children:[g(l,{variant:"caption",className:a(T.inputMain,T.inputHelper),component:"div",gutterBottom:!0,children:["Press ",b(l,{variant:"caption",color:"primary",className:a(T.inputMain,T.highlightedLabel),children:"Enter"})," to send"]}),b(d,{onClick:R,className:T.sendIcon,disabled:!L||!L.body&&!L.attachment,children:b(h,{})})]})]}),ref:k,children:[b(p,{initialValue:{body:x,attachment:j},userCompanyId:H,onChange:F,filePreviewWrapperClass:T.filePreviewWrapper,className:T.postInput,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||f()||(e.preventDefault(),R())},mentionStyle:w,suggestionsPortalHost:k.current,allowSuggestionsAboveCursor:!0}),g("div",{className:T.info,children:[B&&g(u,{className:T.text,gutterBottom:!0,children:["Time:"," ",b("span",{className:T.value,children:n(B).format("MM/DD/YY, HH:mm")})," "]}),Number.isFinite(D)&&g(u,{className:T.text,gutterBottom:!0,children:["Cost: ",g("span",{className:T.value,children:[" ",(s=D,s.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "))]})," ",b("span",{className:T.currency,children:"$"})]}),Number.isFinite(C)&&g(u,{className:T.text,gutterBottom:!0,children:["Bit Depth: ",g("span",{className:T.value,children:[C,"'"]})]}),Number.isFinite(I)&&g(u,{className:T.text,gutterBottom:!0,children:["Hole Depth: ",g("span",{className:T.value,children:[I,"'"]})]})]})]})}export{x as default};
@@ -1 +1 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var i={cComponentFilePreview:"styles_cComponentFilePreview__u5R6s",cComponentFilePreviewWrapper:"styles_cComponentFilePreviewWrapper__efPtx",cComponentFilePreviewDeleteFile:"styles_cComponentFilePreviewDeleteFile__I4343",cComponentFilePreviewDeleteFileCentered:"styles_cComponentFilePreviewDeleteFileCentered__6rfz6",cComponentFilePreviewImageFileWrapper:"styles_cComponentFilePreviewImageFileWrapper__BW-s-",cComponentFilePreviewName:"styles_cComponentFilePreviewName__x37wX",cComponentFilePreviewImage:"styles_cComponentFilePreviewImage__affFU",cComponentFilePreviewDownload:"styles_cComponentFilePreviewDownload__MlNlb",cComponentFilePreviewDownloadText:"styles_cComponentFilePreviewDownloadText__qoZzr"};e(".styles_cComponentFilePreview__u5R6s{background:#4d4d4d;border-radius:4px;display:flex;margin-left:40px;margin-top:10px;max-height:300px;padding:2px 0;position:relative}.styles_cComponentFilePreviewWrapper__efPtx{align-items:center;display:flex;margin-left:8px}.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewDeleteFile__I4343{margin-left:20px;position:relative;visibility:visible}.styles_cComponentFilePreviewDeleteFile__I4343{position:absolute!important;right:8px;top:0;visibility:hidden}.styles_cComponentFilePreviewDeleteFileCentered__6rfz6{top:50%;transform:translateY(-50%)}.styles_cComponentFilePreviewImageFileWrapper__BW-s-{border-radius:3px;margin-bottom:0;margin-top:0;overflow:hidden;text-align:center}.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewImageFileWrapper__BW-s-,.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewWrapper__efPtx{opacity:.7}.styles_cComponentFilePreviewImageFileWrapper__BW-s-:hover .styles_cComponentFilePreviewDeleteFile__I4343{visibility:visible}.styles_cComponentFilePreviewName__x37wX{align-items:center;display:flex;justify-content:space-between;margin:20px 0 0}.styles_cComponentFilePreviewImage__affFU{max-height:100%;max-width:100%;vertical-align:top}.styles_cComponentFilePreviewDownload__MlNlb{align-items:center;border-radius:3px;cursor:pointer;display:flex;margin:5px 0;padding:5px;width:150px}.styles_cComponentFilePreviewDownloadText__qoZzr{display:flex;justify-content:space-between;margin-left:10px;width:calc(100% - 60px)}");export{i as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var i={cComponentFilePreview:"styles_cComponentFilePreview__u5R6s",cComponentFilePreviewWrapper:"styles_cComponentFilePreviewWrapper__efPtx",cComponentFilePreviewDeleteFile:"styles_cComponentFilePreviewDeleteFile__I4343",cComponentFilePreviewDeleteFileCentered:"styles_cComponentFilePreviewDeleteFileCentered__6rfz6",cComponentFilePreviewImageFileWrapper:"styles_cComponentFilePreviewImageFileWrapper__BW-s-",cComponentFilePreviewName:"styles_cComponentFilePreviewName__x37wX",cComponentFilePreviewImage:"styles_cComponentFilePreviewImage__affFU",cComponentFilePreviewDownload:"styles_cComponentFilePreviewDownload__MlNlb",cComponentFilePreviewDownloadText:"styles_cComponentFilePreviewDownloadText__qoZzr"};e(".styles_cComponentFilePreview__u5R6s{background:#4d4d4d;border-radius:4px;display:flex;margin-left:48px;margin-top:10px;max-height:300px;padding:2px 0;position:relative}.styles_cComponentFilePreviewWrapper__efPtx{align-items:center;display:flex;margin-left:8px}.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewDeleteFile__I4343{margin-left:20px;position:relative;visibility:visible}.styles_cComponentFilePreviewDeleteFile__I4343{position:absolute!important;right:8px;top:0;visibility:hidden}.styles_cComponentFilePreviewDeleteFileCentered__6rfz6{top:50%;transform:translateY(-50%)}.styles_cComponentFilePreviewImageFileWrapper__BW-s-{border-radius:3px;margin-bottom:0;margin-top:0;overflow:hidden;text-align:center}.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewImageFileWrapper__BW-s-,.styles_cComponentFilePreview__u5R6s:hover .styles_cComponentFilePreviewWrapper__efPtx{opacity:.7}.styles_cComponentFilePreviewImageFileWrapper__BW-s-:hover .styles_cComponentFilePreviewDeleteFile__I4343{visibility:visible}.styles_cComponentFilePreviewName__x37wX{align-items:center;display:flex;justify-content:space-between;margin:20px 0 0}.styles_cComponentFilePreviewImage__affFU{max-height:100%;max-width:100%;vertical-align:top}.styles_cComponentFilePreviewDownload__MlNlb{align-items:center;border-radius:3px;cursor:pointer;display:flex;margin:5px 0;padding:5px;width:150px}.styles_cComponentFilePreviewDownloadText__qoZzr{display:flex;justify-content:space-between;margin-left:10px;width:calc(100% - 60px)}");export{i as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import n from"prop-types";import{useState as r,useEffect as t}from"react";import{TextField as i,InputAdornment as l}from"@material-ui/core";import s from"classnames";import{noop as a}from"lodash";import m from"../FilePreview/index.js";import p from"../FailedFileUploading.js";import u from"../UserMention/index.js";import d from"../FileUploadIconButton.js";import c from"../EmojiIconButton.js";import f from"./PostInput.css.js";import{jsxs as g,jsx as h}from"react/jsx-runtime";var y=function(n){var a=n.className,y=n.userCompanyId,v=n.onChange,w=n.onKeyDown,b=n.initialValue,C=n.filePreviewWrapperClass,P=n.smallerView,F=n.suggestionsPortalHost,S=n.mentionStyle,j=n.allowSuggestionsAboveCursor,A=r(b.body),I=o(A,2),N=I[0],T=I[1],x=r(b.attachment),D=o(x,2),U=D[0],V=D[1],H=r(null),K=o(H,2),E=K[0],W=K[1];return t((function(){v({body:N,attachment:U})}),[N,U]),g("div",{className:s(f.input,a),children:[h(i,{className:s(f.inputTextField,e({},f.inputTextFieldSmaller,P)),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:u,inputProps:{onChange:T,value:N,withLightTheme:!1,companyId:y,autoFocus:!0,className:f.inputInput,placeholder:"Type here...",suggestionsPortalHost:F,allowSuggestionsAboveCursor:j,style:S},endAdornment:g(l,{position:"end",className:s(f.inputAdornment,e({},f.inputAdornmentSmaller,P)),children:[!U&&h("div",{children:h(d,{openPreviewDialogOnUpload:!1,onFinish:function(e,o,n){V({url:e,name:o,size:n})},onError:W})}),h("div",{children:h(c,{handleSelectEmoji:function(e){return T((function(o){return"".concat(o).concat(e.native)}))}})})]}),disableUnderline:!0,classes:{}},onKeyDown:w}),U&&h(m,{fileName:U.name,fileUrl:U.url,handleFileDelete:function(){return V(null)},classes:{wrapper:C}}),E&&h(p,{errorMessage:E})]})};y.propTypes={userCompanyId:n.oneOfType([n.string,n.number]).isRequired,className:n.string,onKeyDown:n.func,onChange:n.func,initialValue:n.shape({body:n.string,attachment:n.shape({})}),filePreviewWrapperClass:n.string,suggestionsPortalHost:n.node,allowSuggestionsAboveCursor:n.bool,smallerView:n.bool,mentionStyle:n.shape},y.defaultProps={className:null,initialValue:{body:"",attachment:null},filePreviewWrapperClass:null,onKeyDown:a,onChange:a,smallerView:!1,suggestionsPortalHost:void 0,allowSuggestionsAboveCursor:!1,mentionStyle:void 0};export{y as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import n from"prop-types";import{useState as r,useEffect as i}from"react";import{TextField as t,InputAdornment as s}from"@material-ui/core";import l from"classnames";import{noop as a}from"lodash";import m from"../FilePreview/index.js";import p from"../FailedFileUploading.js";import u from"../UserMention/index.js";import d from"../FileUploadIconButton.js";import c from"../EmojiIconButton.js";import f from"./PostInput.css.js";import{jsxs as g,jsx as h}from"react/jsx-runtime";var v=function(n){var a=n.className,v=n.userCompanyId,w=n.onChange,y=n.onKeyDown,b=n.initialValue,C=n.filePreviewWrapperClass,P=n.smallerView,F=n.suggestionsPortalHost,j=n.allowSuggestionsAboveCursor,A=r(b.body),I=o(A,2),N=I[0],T=I[1],x=r(b.attachment),S=o(x,2),D=S[0],U=S[1],V=r(null),H=o(V,2),K=H[0],E=H[1];return i((function(){w({body:N,attachment:D})}),[N,D]),g("div",{className:l(f.input,a),children:[h(t,{className:l(f.inputTextField,e({},f.inputTextFieldSmaller,P)),placeholder:"Add Comment...",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:u,inputProps:{onChange:T,value:N,withLightTheme:!1,companyId:v,autoFocus:!0,className:f.inputInput,placeholder:"Type here...",suggestionsPortalHost:F,allowSuggestionsAboveCursor:j},endAdornment:g(s,{position:"end",className:l(f.inputAdornment,e({},f.inputAdornmentSmaller,P)),children:[!D&&h("div",{children:h(d,{openPreviewDialogOnUpload:!1,onFinish:function(e,o,n){U({url:e,name:o,size:n})},onError:E})}),h("div",{children:h(c,{handleSelectEmoji:function(e){return T((function(o){return"".concat(o).concat(e.native)}))}})})]}),disableUnderline:!0,classes:{}},onKeyDown:y}),D&&h(m,{fileName:D.name,fileUrl:D.url,handleFileDelete:function(){return U(null)},classes:{wrapper:C}}),K&&h(p,{errorMessage:K})]})};v.propTypes={userCompanyId:n.oneOfType([n.string,n.number]).isRequired,className:n.string,onKeyDown:n.func,onChange:n.func,initialValue:n.shape({body:n.string,attachment:n.shape({})}),filePreviewWrapperClass:n.string,suggestionsPortalHost:n.node,allowSuggestionsAboveCursor:n.bool,smallerView:n.bool},v.defaultProps={className:null,initialValue:{body:"",attachment:null},filePreviewWrapperClass:null,onKeyDown:a,onChange:a,smallerView:!1,suggestionsPortalHost:void 0,allowSuggestionsAboveCursor:!1};export{v as default};
@@ -1 +1 @@
1
- import e from"prop-types";import{withStyles as t}from"@material-ui/core/styles";import r from"@material-ui/core/Card";import a from"@material-ui/core/CardActions";import i from"@material-ui/core/CardContent";import o from"@material-ui/core/CardMedia";import c from"@material-ui/core/Chip";import n from"@material-ui/core/Button";import s from"@material-ui/core/Typography";import l from"@material-ui/core/colors/blue";import m from"@material-ui/icons/Email";import d from"@material-ui/icons/Phone";import p from"./style.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import{UniversalLink as u}from"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import{jsxs as h,jsx as f}from"react/jsx-runtime";var g="UserCardDialogPo";function b(e){var t=e.user,l=t.id,b=t.email,v=t.mobile,C=t.title,N=t.first_name,y=t.last_name,_=t.profile_photo,x=e.currentUser,B=e.classes;return h(r,{"data-testid":"".concat(g),className:B.card,children:[f(o,{"data-testid":"".concat(g,"_placeholder"),className:B.media,image:_||"https://cdn.corva.ai/app/images/user-placeholder.svg",title:"".concat(N," ").concat(y),children:Number(x.id)===Number(l)&&f("div",{className:p.cUserCardMediaBackdrop,children:f(u,{href:"/config/users/".concat(l),children:f(c,{"data-not-migrated-MuiChip":!0,"data-testid":"".concat(g,"_viewProfile"),className:p.cUserCardMediaBackdropToProfile,label:"View Profile"})})})}),h(i,{className:B.content,children:[f(s,{"data-testid":"".concat(g,"_name"),variant:"h5",className:B.userName,children:"".concat(N," ").concat(y)}),C&&f(s,{variant:"subtitle1",children:C}),f("br",{}),b&&f("a",{href:"mailto:".concat(b),target:"_top",children:h(s,{"data-testid":"".concat(g,"_email"),gutterBottom:!0,variant:"body1",className:B.contact,children:[f(m,{className:B.contactIcon}),b]})}),v&&f("a",{href:"tel:".concat(v),target:"_top",children:h(s,{"data-testid":"".concat(g,"_phone"),variant:"body1",className:B.contact,children:[f(d,{className:B.contactIcon}),v]})})]}),h(a,{className:B.actions,children:[b?f("a",{href:"mailto:".concat(b),target:"_top",children:f(n,{"data-testid":"".concat(g,"_emailButton"),className:B.actionButton,variant:"contained",color:"primary",children:"Email"})}):f(n,{disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Email"}),f(n,{"data-testid":"".concat(g,"_messageButton"),disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Message"})]})]})}b.propTypes={user:e.shape({id:e.number.isRequired,email:e.string,mobile:e.string,title:e.string,role:e.string,first_name:e.string.isRequired,last_name:e.string.isRequired,profile_photo:e.string}).isRequired,classes:e.shape({}).isRequired,currentUser:e.shape({id:e.oneOfType([e.number,e.string])})},b.defaultProps={currentUser:{}};var v=t((function(e){return{card:{width:352},media:{height:264,width:"100%"},content:{cursor:"auto",padding:"10px 28px 28px 28px"},userName:{fontWeight:"bold"},contact:{display:"flex",alignItems:"center",fontSize:12,color:l[900],cursor:"pointer"},contactIcon:{height:15,width:15,marginRight:10,color:e.palette.grey[300]},actions:{display:"flex",justifyContent:"space-between",padding:"0 28px 28px 28px"},actionButton:{width:139}}}))(b);export{v as default};
1
+ import e from"prop-types";import{withStyles as t}from"@material-ui/core/styles";import a from"@material-ui/core/Card";import r from"@material-ui/core/CardActions";import i from"@material-ui/core/CardContent";import o from"@material-ui/core/CardMedia";import n from"@material-ui/core/Chip";import c from"@material-ui/core/Button";import s from"@material-ui/core/Typography";import l from"@material-ui/icons/Email";import m from"@material-ui/icons/Phone";import d from"./style.css.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import{UniversalLink as p}from"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import{jsxs as u,jsx as h}from"react/jsx-runtime";var f="UserCardDialogPo";function g(e){var t=e.user,g=t.id,v=t.email,b=t.mobile,C=t.title,N=t.first_name,y=t.last_name,_=t.profile_photo,x=e.currentUser,B=e.classes;return u(a,{"data-testid":"".concat(f),className:B.card,children:[h(o,{"data-testid":"".concat(f,"_placeholder"),className:B.media,image:_||"https://cdn.corva.ai/app/images/user-placeholder.svg",title:"".concat(N," ").concat(y),children:Number(x.id)===Number(g)&&h("div",{className:d.cUserCardMediaBackdrop,children:h(p,{href:"/config/users/".concat(g),children:h(n,{"data-not-migrated-MuiChip":!0,"data-testid":"".concat(f,"_viewProfile"),className:d.cUserCardMediaBackdropToProfile,label:"View Profile"})})})}),u(i,{className:B.content,children:[h(s,{"data-testid":"".concat(f,"_name"),variant:"h5",className:B.userName,children:"".concat(N," ").concat(y)}),C&&h(s,{variant:"subtitle1",children:C}),h("br",{}),v&&h("a",{href:"mailto:".concat(v),target:"_top",children:u(s,{"data-testid":"".concat(f,"_email"),gutterBottom:!0,variant:"body1",className:B.contact,children:[h(l,{className:B.contactIcon}),v]})}),b&&h("a",{href:"tel:".concat(b),target:"_top",children:u(s,{"data-testid":"".concat(f,"_phone"),variant:"body1",className:B.contact,children:[h(m,{className:B.contactIcon}),b]})})]}),u(r,{className:B.actions,children:[v?h("a",{href:"mailto:".concat(v),target:"_top",children:h(c,{"data-testid":"".concat(f,"_emailButton"),className:B.actionButton,variant:"contained",color:"primary",children:"Email"})}):h(c,{disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Email"}),h(c,{"data-testid":"".concat(f,"_messageButton"),disabled:!0,className:B.actionButton,variant:"contained",color:"primary",children:"Message"})]})]})}g.propTypes={user:e.shape({id:e.number.isRequired,email:e.string,mobile:e.string,title:e.string,role:e.string,first_name:e.string.isRequired,last_name:e.string.isRequired,profile_photo:e.string}).isRequired,classes:e.shape({}).isRequired,currentUser:e.shape({id:e.oneOfType([e.number,e.string])})},g.defaultProps={currentUser:{}};var v=t((function(e){return{card:{width:352},media:{height:264,width:"100%"},content:{cursor:"auto",padding:"10px 28px 28px 28px"},userName:{fontWeight:"bold"},contact:{display:"flex",alignItems:"center",fontSize:12,cursor:"pointer"},contactIcon:{height:15,width:15,marginRight:10,color:e.palette.grey[300]},actions:{display:"flex",justifyContent:"space-between",padding:"0 28px 28px 28px"},actionButton:{width:139}}}))(g);export{v as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import{useEffect as o,useCallback as n}from"react";import{debounce as r}from"lodash";import t from"prop-types";import{withStyles as s}from"@material-ui/core/styles";import{MentionsInput as i,Mention as a}from"react-mentions";import l from"@material-ui/core/colors/blue";import"../../permissions/PermissionsContext.js";import{PERMISSIONS as u}from"../../permissions/constants/index.js";import"@babel/runtime/helpers/slicedToArray";import{withPermissionsHOC as c}from"../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import p from"../Avatar/index.js";import{handleFetchUsers as m}from"./utils/index.js";import{USER_MARKUP as f}from"./constants.js";import d from"./style.css.js";import{jsx as g,jsxs as b}from"react/jsx-runtime";function y(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,r)}return n}function h(o){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(o,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))}))}return o}var v={backgroundColor:l[100]},j={color:"#00bcd4"},_={suggestions:{item:{"&focused":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},w=h(h({},_),{},{input:{color:"transparent",caretColor:"#fff",zIndex:1},highlighter:{color:"#fff"}}),O=h(h({},_),{},{input:{color:"#000"}}),P=function(e){var t=e.onChange,s=e.singleLine,l=e.suggestionsPortalHost,u=e.value,c=e.inputRef,y=e.classes,_=e.style,P=e.withLightTheme,C=e.placeholder,S=e.onMount,x=e.onKeyDown,R=e.onKeyUp,A=e.onFocus,D=e.onBlur,F=e.autoFocus,K=e.disabled,L=e.companyId,N=e.currentUser,T=e.isCompanySelectVisible,U=e.mentionProps,q=e.allowSuggestionsAboveCursor;o(S,[]);var H=n(r((function(e,o){var n=T&&N&&N.company_id!==L?[N.company_id,L]:null;m(e,o,n)}),400),[L]),I=Object.assign(P?O:w,_);return g(i,{value:u,onChange:function(e,o){t(o)},singleLine:s,allowSpaceInQuery:!0,classNames:d,placeholder:C,suggestionsPortalHost:l,inputRef:c,style:I,onKeyDown:x,onKeyUp:R,autoFocus:F,onFocus:A,onBlur:D,disabled:K,allowSuggestionsAboveCursor:q,children:g(a,h({markup:f,renderSuggestion:function(e){return function(e,o){return b("div",{className:d.mention__suggestion,children:[g(p,{alt:e.display,displayName:e.display,className:o.avatar,imgSrc:e.photo}),b("div",{className:d.mention__suggestion__info,children:[g("span",{"data-testid":"".concat("userMention","_name_").concat(e.display),className:d.mention__suggestion__info__name,children:e.display}),e.title&&g("span",{className:d.mention__suggestion__info__group,children:e.title})]})]})}(e,y)},trigger:"@",data:H,displayTransform:function(e,o){return"@".concat(o)},style:P?v:j,appendSpaceOnAdd:!0},U))})};P.propTypes={onChange:t.func,singleLine:t.bool,suggestionsPortalHost:t.shape({current:t.instanceOf(Element)}),value:t.string,inputRef:t.shape({}),classes:t.shape({avatar:t.string.isRequired}).isRequired,withLightTheme:t.bool,placeholder:t.string,style:t.shape({}),mentionProps:t.shape({}),onMount:t.func,onKeyDown:t.func,onKeyUp:t.func,onFocus:t.func,onBlur:t.func,autoFocus:t.bool,disabled:t.bool,currentUser:t.shape({company_id:t.number.isRequired}).isRequired,companyId:t.number,isCompanySelectVisible:t.bool.isRequired,allowSuggestionsAboveCursor:t.bool},P.defaultProps={onChange:function(){},singleLine:!1,suggestionsPortalHost:null,value:"",inputRef:null,withLightTheme:!1,placeholder:"Mention people using '@'",style:{},mentionProps:{},onMount:function(){},onKeyDown:function(){},onKeyUp:function(){},onFocus:function(){},onBlur:function(){},autoFocus:!0,disabled:!1,allowSuggestionsAboveCursor:!1,companyId:null};var C=c({isCompanySelectVisible:u.companySelectorView})(s({avatar:{height:45,width:45,border:"1.5px solid #fff"}})(P));export{C as default};
1
+ import e from"@babel/runtime/helpers/defineProperty";import{useEffect as o,useCallback as n}from"react";import{debounce as r}from"lodash";import t from"prop-types";import{withStyles as s}from"@material-ui/core/styles";import{MentionsInput as i,Mention as a}from"react-mentions";import l from"@material-ui/core/colors/blue";import"../../permissions/PermissionsContext.js";import{PERMISSIONS as u}from"../../permissions/constants/index.js";import"@babel/runtime/helpers/slicedToArray";import{withPermissionsHOC as c}from"../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.js";import"../../permissions/ProvidePermissions.js";import p from"../Avatar/index.js";import{handleFetchUsers as m}from"./utils/index.js";import{USER_MARKUP as g}from"./constants.js";import f from"./style.css.js";import{jsx as d,jsxs as b}from"react/jsx-runtime";function y(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,r)}return n}function h(o){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){e(o,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))}))}return o}var v={backgroundColor:l[100]},j={color:"#00bcd4"},_={suggestions:{item:{"&focused":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},w=h(h({},_),{},{input:{color:"transparent",caretColor:"#fff",zIndex:1},highlighter:{color:"#fff"}}),O=h(h({},_),{},{input:{color:"#000"}}),P=function(e){var t=e.onChange,s=e.singleLine,l=e.suggestionsPortalHost,u=e.value,c=e.inputRef,y=e.classes,_=e.style,P=e.withLightTheme,C=e.placeholder,S=e.onMount,x=e.onKeyDown,R=e.onKeyUp,A=e.onFocus,D=e.onBlur,F=e.autoFocus,K=e.disabled,L=e.companyId,N=e.currentUser,T=e.isCompanySelectVisible,k=e.mentionProps,U=e.allowSuggestionsAboveCursor;o(S,[]);var q=n(r((function(e,o){var n=T&&N&&N.company_id!==L?[N.company_id,L]:null;m(e,o,n)}),400),[L]),H=Object.assign(P?O:w,_);return d(i,{value:u,onChange:function(e,o){t(o)},singleLine:s,allowSpaceInQuery:!0,classNames:f,placeholder:C,suggestionsPortalHost:l,inputRef:c,style:H,onKeyDown:x,onKeyUp:R,autoFocus:F,onFocus:A,onBlur:D,disabled:K,allowSuggestionsAboveCursor:U,children:d(a,h({markup:g,renderSuggestion:function(e){return function(e,o){return b("div",{className:f.mention__suggestion,children:[d(p,{alt:e.display,displayName:e.display,className:o.avatar,imgSrc:e.photo}),b("div",{className:f.mention__suggestion__info,children:[d("span",{"data-testid":"".concat("userMention","_name_").concat(e.display),className:f.mention__suggestion__info__name,children:e.display}),e.title&&d("span",{className:f.mention__suggestion__info__group,children:e.title})]})]})}(e,y)},trigger:"@",data:q,displayTransform:function(e,o){return"@".concat(o)},style:P?v:j,appendSpaceOnAdd:!0},k))})};P.propTypes={onChange:t.func,singleLine:t.bool,suggestionsPortalHost:t.shape({current:t.instanceOf(Element)}),value:t.string,inputRef:t.shape({}),classes:t.shape({avatar:t.string.isRequired}).isRequired,withLightTheme:t.bool,placeholder:t.string,style:t.shape({}),mentionProps:t.shape({}),onMount:t.func,onKeyDown:t.func,onKeyUp:t.func,onFocus:t.func,onBlur:t.func,autoFocus:t.bool,disabled:t.bool,currentUser:t.shape({company_id:t.number.isRequired}).isRequired,companyId:t.number,isCompanySelectVisible:t.bool.isRequired,allowSuggestionsAboveCursor:t.bool},P.defaultProps={onChange:function(){},singleLine:!1,suggestionsPortalHost:null,value:"",inputRef:null,withLightTheme:!1,placeholder:"Mention people using '@'",style:{suggestions:{list:{background:"#414141"},item:{color:"white",height:30,"&focused":{backgroundColor:"rgba(255, 255, 255, 0.08)"}}}},mentionProps:{},onMount:function(){},onKeyDown:function(){},onKeyUp:function(){},onFocus:function(){},onBlur:function(){},autoFocus:!0,disabled:!1,allowSuggestionsAboveCursor:!1,companyId:null};var C=c({isCompanySelectVisible:u.companySelectorView})(s({avatar:{height:45,width:45,border:"1.5px solid #fff"}})(P));export{C as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.38.0-rc.0",
3
+ "version": "0.39.0-2",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"