@corva/ui 3.76.0-1 → 3.76.0-10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
  2. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  3. package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  4. package/cjs-bundle/components/AttachmentPreview/useScrollOverflow.js +2 -0
  5. package/cjs-bundle/components/AttachmentPreview/useScrollOverflow.js.map +1 -0
  6. package/cjs-bundle/components/Comment/index.js +1 -1
  7. package/cjs-bundle/components/Comment/index.js.map +1 -1
  8. package/cjs-bundle/components/Comment/useComment.js +2 -0
  9. package/cjs-bundle/components/Comment/useComment.js.map +1 -0
  10. package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
  11. package/cjs-bundle/components/CommentInput/index.js +1 -1
  12. package/cjs-bundle/components/CommentInput/index.js.map +1 -1
  13. package/cjs-bundle/components/CommentInput/useCommentInput.js +2 -0
  14. package/cjs-bundle/components/CommentInput/useCommentInput.js.map +1 -0
  15. package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
  16. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  17. package/cjs-bundle/components/FeedCard/FeedCard.scss.js +1 -1
  18. package/cjs-bundle/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
  19. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
  20. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
  21. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
  22. package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
  23. package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
  24. package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
  25. package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
  26. package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
  27. package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
  28. package/components/AttachmentPreview/AttachmentPreview.d.ts +1 -0
  29. package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
  30. package/components/AttachmentPreview/AttachmentPreview.js +1 -1
  31. package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
  32. package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
  33. package/components/AttachmentPreview/__tests__/AttachmentPreview.overflow.test.d.ts +2 -0
  34. package/components/AttachmentPreview/__tests__/AttachmentPreview.overflow.test.d.ts.map +1 -0
  35. package/components/AttachmentPreview/useScrollOverflow.d.ts +16 -0
  36. package/components/AttachmentPreview/useScrollOverflow.d.ts.map +1 -0
  37. package/components/AttachmentPreview/useScrollOverflow.js +2 -0
  38. package/components/AttachmentPreview/useScrollOverflow.js.map +1 -0
  39. package/components/Comment/__tests__/useComment.test.d.ts +2 -0
  40. package/components/Comment/__tests__/useComment.test.d.ts.map +1 -0
  41. package/components/Comment/index.d.ts +2 -22
  42. package/components/Comment/index.js +1 -1
  43. package/components/Comment/index.js.map +1 -1
  44. package/components/Comment/useComment.d.ts +22 -0
  45. package/components/Comment/useComment.d.ts.map +1 -0
  46. package/components/Comment/useComment.js +2 -0
  47. package/components/Comment/useComment.js.map +1 -0
  48. package/components/CommentCard/CommentCard.scss.js +1 -1
  49. package/components/CommentInput/__tests__/useCommentInput.test.d.ts +2 -0
  50. package/components/CommentInput/__tests__/useCommentInput.test.d.ts.map +1 -0
  51. package/components/CommentInput/index.d.ts +26 -24
  52. package/components/CommentInput/index.js +1 -1
  53. package/components/CommentInput/index.js.map +1 -1
  54. package/components/CommentInput/useCommentInput.d.ts +26 -0
  55. package/components/CommentInput/useCommentInput.d.ts.map +1 -0
  56. package/components/CommentInput/useCommentInput.js +2 -0
  57. package/components/CommentInput/useCommentInput.js.map +1 -0
  58. package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
  59. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts +2 -9
  60. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
  61. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  62. package/components/FeedCard/FeedCard.scss.js +1 -1
  63. package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts +19 -6
  64. package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts.map +1 -1
  65. package/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
  66. package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts +1 -0
  67. package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts.map +1 -1
  68. package/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
  69. package/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
  70. package/componentsV2/AppHeader/V3/Actions/Actions.d.ts.map +1 -1
  71. package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
  72. package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
  73. package/componentsV2/AppHeader/V3/AppHeaderV3.d.ts.map +1 -1
  74. package/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
  75. package/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
  76. package/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
  77. package/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
  78. package/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
  79. package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts +2 -0
  80. package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts.map +1 -0
  81. package/mcp-server/server.mjs +7 -3
  82. package/package.json +1 -1
  83. package/styles/common.scss +14 -0
  84. package/styles/mixins.scss +14 -0
  85. package/tsconfig.tsbuildinfo +1 -1
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferProps<{
2
+ declare const _default: import("react").ComponentType<Pick<PropTypes.InferPropsInner<Pick<{
3
3
  inputRef: PropTypes.Requireable<PropTypes.InferProps<{
4
4
  current: PropTypes.Requireable<PropTypes.InferProps<{
5
5
  focus: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -28,7 +28,7 @@ declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferP
28
28
  isNative: PropTypes.Requireable<boolean>;
29
29
  companyId: PropTypes.Requireable<number>;
30
30
  parentId: PropTypes.Requireable<string>;
31
- }>, PropTypes.RequiredKeys<{
31
+ }, PropTypes.RequiredKeys<{
32
32
  inputRef: PropTypes.Requireable<PropTypes.InferProps<{
33
33
  current: PropTypes.Requireable<PropTypes.InferProps<{
34
34
  focus: PropTypes.Requireable<PropTypes.InferProps<{}>>;
@@ -57,33 +57,35 @@ declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferP
57
57
  isNative: PropTypes.Requireable<boolean>;
58
58
  companyId: PropTypes.Requireable<number>;
59
59
  parentId: PropTypes.Requireable<string>;
60
- }>> & {
61
- inputRef?: PropTypes.InferProps<{
60
+ }>>> & Partial<PropTypes.InferPropsInner<Pick<{
61
+ inputRef: PropTypes.Requireable<PropTypes.InferProps<{
62
62
  current: PropTypes.Requireable<PropTypes.InferProps<{
63
63
  focus: PropTypes.Requireable<PropTypes.InferProps<{}>>;
64
64
  }>>;
65
- }> | null | undefined;
66
- editFeedItemId?: number | null | undefined;
67
- editCommentId?: number | null | undefined;
68
- editComment?: string | null | undefined;
69
- editAttachment?: PropTypes.InferProps<{
65
+ }>>;
66
+ editFeedItemId: PropTypes.Requireable<number>;
67
+ editCommentId: PropTypes.Requireable<number>;
68
+ editComment: PropTypes.Requireable<string>;
69
+ editAttachment: PropTypes.Requireable<PropTypes.InferProps<{
70
70
  url: PropTypes.Requireable<string>;
71
71
  size: PropTypes.Requireable<number>;
72
72
  file_name: PropTypes.Requireable<string>;
73
- }> | null | undefined;
74
- spaceAround?: boolean | null | undefined;
75
- postCommentCallback?: ((...args: any[]) => any) | null | undefined;
76
- patchCommentCallback?: ((...args: any[]) => any) | null | undefined;
77
- exitEditMode?: ((...args: any[]) => any) | null | undefined;
78
- setIsPosting?: ((...args: any[]) => any) | null | undefined;
79
- setIsEditting?: ((...args: any[]) => any) | null | undefined;
80
- onMount?: ((...args: any[]) => any) | null | undefined;
81
- autoFocus?: boolean | null | undefined;
82
- disabled?: boolean | null | undefined;
83
- currentUser?: PropTypes.InferProps<PropTypes.ValidationMap<any>> | null | undefined;
84
- isNative?: boolean | null | undefined;
85
- companyId?: number | null | undefined;
86
- parentId?: string | null | undefined;
87
- } & {}, "autoFocus" | "companyId" | "currentUser" | "disabled" | "editAttachment" | "editComment" | "editCommentId" | "editFeedItemId" | "exitEditMode" | "inputRef" | "isNative" | "onMount" | "parentId" | "patchCommentCallback" | "postComment" | "postCommentCallback" | "setIsEditting" | "setIsPosting" | "spaceAround"> & import("@material-ui/styles").StyledComponentProps<"additionalActionButton" | "cancelText" | "fileUploadingError" | "highlightedLabel" | "iconTooltip" | "input" | "inputAdornment" | "inputEl" | "inputHelper" | "inputMain" | "inputRoot" | "nativeActionButton" | "paperRoot" | "sendButton">>;
73
+ }>>;
74
+ spaceAround: PropTypes.Requireable<boolean>;
75
+ postComment: PropTypes.Validator<(...args: any[]) => any>;
76
+ postCommentCallback: PropTypes.Requireable<(...args: any[]) => any>;
77
+ patchCommentCallback: PropTypes.Requireable<(...args: any[]) => any>;
78
+ exitEditMode: PropTypes.Requireable<(...args: any[]) => any>;
79
+ setIsPosting: PropTypes.Requireable<(...args: any[]) => any>;
80
+ setIsEditting: PropTypes.Requireable<(...args: any[]) => any>;
81
+ onMount: PropTypes.Requireable<(...args: any[]) => any>;
82
+ autoFocus: PropTypes.Requireable<boolean>;
83
+ disabled: PropTypes.Requireable<boolean>;
84
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
85
+ currentUser: PropTypes.Requireable<PropTypes.InferProps<PropTypes.ValidationMap<any>>>;
86
+ isNative: PropTypes.Requireable<boolean>;
87
+ companyId: PropTypes.Requireable<number>;
88
+ parentId: PropTypes.Requireable<string>;
89
+ }, "autoFocus" | "companyId" | "currentUser" | "disabled" | "editAttachment" | "editComment" | "editCommentId" | "editFeedItemId" | "exitEditMode" | "inputRef" | "isNative" | "onMount" | "parentId" | "patchCommentCallback" | "postCommentCallback" | "setIsEditting" | "setIsPosting" | "spaceAround">>> & import("react").RefAttributes<any>, "autoFocus" | "companyId" | "currentUser" | "disabled" | "editAttachment" | "editComment" | "editCommentId" | "editFeedItemId" | "exitEditMode" | "inputRef" | "isNative" | "onMount" | "parentId" | "patchCommentCallback" | "postComment" | "postCommentCallback" | "setIsEditting" | "setIsPosting" | "spaceAround" | keyof import("react").RefAttributes<any>> & import("@material-ui/styles").StyledComponentProps<"additionalActionButton" | "cancelText" | "fileUploadingError" | "highlightedLabel" | "iconTooltip" | "input" | "inputAdornment" | "inputEl" | "inputHelper" | "inputMain" | "inputRoot" | "nativeActionButton" | "paperRoot" | "sendButton">>;
88
90
  export default _default;
89
91
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
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{Paper as d,TextField as h,InputAdornment as f,Collapse as g,Typography as C}from"@material-ui/core";import b from"classnames";import{get as I}from"lodash";import v from"@material-ui/core/colors/grey";import{patchFeedItemComment as x}from"../../clients/jsonApi/index.js";import y from"./styles.css.js";import{AvatarComponent as E}from"../Avatar/index.js";import F from"../FileUploadIconButton.js";import S from"../EmojiIconButton.js";import U from"../FailedFileUploading.js";import N from"../UserMention/index.js";import k from"../FilePreview/index.js";import A from"../IconButton/index.js";import M from"../Icons/SendIcon.js";import{isSuggestionsListOpened as R}from"../UserMention/utils/index.js";import j from"../../utils/main.js";import{isNativeDetected as B}from"../../utils/mobileDetect.js";import{notifyCommentEdit as w,notifyCommentPost as P}from"../../utils/nativeMessages.js";import{jsxs as T,jsx as L}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,x(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&&(R()||(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?(w(t),i.clearCommentField(i.props.exitEditMode)):(P(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||j.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.size:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t,e=this,n=this.props,o=n.classes,i=n.currentUser,a="".concat(I(i,["attributes","first_name"])||I(i,"first_name")," ").concat(I(i,["attributes","last_name"])||I(i,"last_name")),r=this.state.isInputFocused||this.state.attachmentUrl||this.state.comment||this.props.editComment||(null===(t=this.props.editAttachment)||void 0===t?void 0:t.url);return T("div",{style:this.props.spaceAround?D.commentTextFieldContainerSpaceAround:D.commentTextFieldContainer,children:[L("div",{style:D.chatAvatarWrapper,children:L(E,{displayName:a,size:32,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),L(d,{className:this.props.classes.paperRoot,children:L(h,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:N,inputProps:{onChange:function(t){return e.setState({comment:t})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return e.setState({isInputFocused:!0})},onBlur:function(){return e.setState({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!this.props.isNative&&T(f,{position:"end",className:this.props.classes.inputAdornment,children:[!this.state.attachmentUrl&&L("div",{className:b(y.cCommentInputIconContainer,y.cCommentInputIconUpload),children:L(F,{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),tooltipProps:{title:"Attach File",classes:{tooltip:o.iconTooltip},placement:"top"}})}),L("div",{className:y.cCommentInputIconContainer,children:L(S,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:v[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:o.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&L(U,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&L(k,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),L(g,{in:r,mountOnEnter:!0,unmountOnExit:!0,children:T("div",{className:y.cCommentInputSendContainer,children:[L("div",{className:y.cCommentInputSendContainerCancel,children:L(C,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:b(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),T("div",{className:y.cCommentInputSendContainerSend,children:[T(C,{variant:"caption",className:b(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",L(C,{variant:"caption",color:"primary",className:b(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),L(A,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:L(M,{})})]})]})})]})}}]),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:B};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
+ import{forwardRef as t,useImperativeHandle as e,memo as n}from"react";import o from"prop-types";import i from"lodash/noop";import{withStyles as a}from"@material-ui/core/styles";import{Paper as r,TextField as l,InputAdornment as m,Collapse as d,Typography as s}from"@material-ui/core";import p from"classnames";import{get as c}from"lodash";import u from"@material-ui/core/colors/grey";import h from"./useCommentInput.js";import g from"./styles.css.js";import{AvatarComponent as f}from"../Avatar/index.js";import C from"../FileUploadIconButton.js";import v from"../EmojiIconButton.js";import I from"../FailedFileUploading.js";import b from"../UserMention/index.js";import x from"../FilePreview/index.js";import F from"../IconButton/index.js";import y from"../Icons/SendIcon.js";import{isNativeDetected as A}from"../../utils/mobileDetect.js";import{jsxs as E,jsx as N}from"react/jsx-runtime";var j={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},B={},U=t((function(t,n){var o=t.inputRef,a=void 0===o?null:o,U=t.editFeedItemId,S=void 0===U?null:U,T=t.editCommentId,R=void 0===T?null:T,M=t.parentId,k=void 0===M?null:M,L=t.editComment,P=void 0===L?null:L,w=t.editAttachment,_=void 0===w?B:w,D=t.spaceAround,H=void 0!==D&&D,z=t.postComment,O=t.setIsPosting,q=void 0===O?i:O,K=t.setIsEditting,W=void 0===K?i:K,G=t.onMount,J=void 0===G?i:G,Q=t.autoFocus,V=t.disabled,X=void 0!==V&&V,Y=t.patchCommentCallback,Z=void 0===Y?i:Y,$=t.postCommentCallback,tt=void 0===$?i:$,et=t.exitEditMode,nt=void 0===et?i:et,ot=t.companyId,it=void 0===ot?null:ot,at=t.currentUser,rt=void 0===at?B:at,lt=t.isNative,mt=void 0===lt?A:lt,dt=t.classes,st=h({inputRef:a,editFeedItemId:S,editCommentId:R,editComment:P,editAttachment:_,postComment:z,setIsPosting:q,setIsEditting:W,patchCommentCallback:Z,postCommentCallback:tt,exitEditMode:nt}),pt=st.state,ct=st.update,ut=st.imperativeHandle,ht=st.handleSendComment,gt=st.handleKeyDown,ft=st.handleSelectEmoji,Ct=st.handleAttachmentLoadingError,vt=st.handleFileUpload,It=st.handleFileDelete,bt=st.handleCancelClick;e(n,(function(){return ut}),[ut]);var xt="".concat(c(rt,["attributes","first_name"])||c(rt,"first_name")," ").concat(c(rt,["attributes","last_name"])||c(rt,"last_name")),Ft=pt.isInputFocused||pt.attachmentUrl||pt.comment||P||(null==_?void 0:_.url);return E("div",{style:H?j.commentTextFieldContainerSpaceAround:j.commentTextFieldContainer,children:[N("div",{style:j.chatAvatarWrapper,children:N(f,{displayName:xt,size:32,imgSrc:rt&&rt.profile_photo})}),N(r,{className:dt.paperRoot,children:N(l,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:b,inputProps:{onChange:function(t){return ct({comment:t})},singleLine:!0,value:pt.comment||"",inputRef:a,withLightTheme:!1,onMount:J,companyId:it,autoFocus:Q,disabled:X,onFocus:function(){return ct({isInputFocused:!0})},onBlur:function(){return ct({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!mt&&E(m,{position:"end",className:dt.inputAdornment,children:[!pt.attachmentUrl&&N("div",{className:p(g.cCommentInputIconContainer,g.cCommentInputIconUpload),children:N(C,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:vt,onError:Ct,fileUploadIconClassName:dt.additionalActionButton,htmlColor:u[400],inputId:"comment-attachment-".concat(R||k),tooltipProps:{title:"Attach File",classes:{tooltip:dt.iconTooltip},placement:"top"}})}),N("div",{className:g.cCommentInputIconContainer,children:N(v,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:ft,emojiIconClassName:dt.additionalActionButton,htmlColor:u[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:dt.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:dt.inputRoot,input:dt.inputEl}},className:dt.input,onKeyDown:gt})}),pt.attachmentLoadingError&&N(I,{errorMessage:pt.attachmentLoadingError,className:dt.fileUploadingError}),pt.attachmentUrl&&N(x,{fileName:pt.attachmentName,fileUrl:pt.attachmentUrl,handleFileDelete:It,classes:dt}),N(d,{in:Ft,mountOnEnter:!0,unmountOnExit:!0,children:E("div",{className:g.cCommentInputSendContainer,children:[N("div",{className:g.cCommentInputSendContainerCancel,children:N(s,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:p(dt.inputMain,dt.cancelText,dt.highlightedLabel),component:"div",gutterBottom:!0,onClick:bt,children:"Cancel"})}),E("div",{className:g.cCommentInputSendContainerSend,children:[E(s,{variant:"caption",className:p(dt.inputMain,dt.inputHelper),component:"div",gutterBottom:!0,children:["Press ",N(s,{variant:"caption",color:"primary",className:p(dt.inputMain,dt.highlightedLabel),children:"Enter"})," to send"]}),N(F,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:ht,classes:{root:dt.sendButton},children:N(y,{})})]})]})})]})})),S={inputRef:o.shape({current:o.shape({focus:o.shape({})})}),editFeedItemId:o.number,editCommentId:o.number,editComment:o.string,editAttachment:o.shape({url:o.string,size:o.number,file_name:o.string}),spaceAround:o.bool,postComment:o.func.isRequired,postCommentCallback:o.func,patchCommentCallback:o.func,exitEditMode:o.func,setIsPosting:o.func,setIsEditting:o.func,onMount:o.func,autoFocus:o.bool,disabled:o.bool,classes:o.shape({}).isRequired,currentUser:o.shape(),isNative:o.bool,companyId:o.number,parentId:o.string};U.propTypes=S;var T=a((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%"}}}))(n(U));export{T as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/CommentInput/index.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { patchFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isSuggestionsListOpened } from '~components/UserMention/utils';\nimport utils from '~utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { notifyCommentEdit, notifyCommentPost } from '~utils/nativeMessages'; // question here\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nclass CommentInput extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n\n attachmentLoadingError: null,\n isInputFocused: false,\n };\n }\n\n componentDidMount() {\n if (this.isEditMode) {\n this.setInitialCommentValue();\n }\n }\n\n componentDidUpdate(prevProps) {\n const enteredEditMode = this.isEditMode && !prevProps.editFeedItemId;\n if (\n enteredEditMode ||\n (this.props.editCommentId && this.props.editCommentId !== prevProps.editCommentId)\n ) {\n this.setInitialCommentValue();\n }\n }\n\n get isEditMode() {\n return !!this.props.editFeedItemId;\n }\n\n setInitialCommentValue() {\n const attachmentUrl = this.props.editAttachment ? this.props.editAttachment.url : null;\n\n this.setState({\n comment: this.props.editComment,\n attachmentUrl,\n attachmentName: attachmentUrl\n ? this.props.editAttachment.file_name ||\n utils.getFileNameWithExtensionFromPath(attachmentUrl)\n : null,\n attachmentSize: this.props.editAttachment ? this.props.editAttachment.size : null,\n });\n }\n\n handleSelectEmoji = emoji =>\n this.setState(({ comment }) => ({ comment: `${comment}${emoji.native}` }));\n\n postComment = async comment => {\n let commentResponse;\n try {\n commentResponse = await this.props.postComment(comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n patchComment = async comment => {\n const { editFeedItemId, editCommentId } = this.props;\n\n let commentResponse;\n\n try {\n commentResponse = await patchFeedItemComment(editFeedItemId, editCommentId, comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n focusOnRef() {\n if (this.props.inputRef) this.props.inputRef.current.focus();\n }\n\n clearCommentField = callback => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n () => {\n this.focusOnRef();\n if (callback && typeof callback === 'function') callback();\n }\n );\n };\n\n handleKeyDown = event => {\n const { key } = event;\n\n if (key === 'Escape') this.props.exitEditMode();\n\n if (key === 'Enter') {\n if (!isSuggestionsListOpened()) {\n event.preventDefault();\n this.handleSendComment();\n }\n }\n };\n\n handleAttachmentLoadingError = attachmentLoadingError => {\n this.setState({\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n attachmentLoadingError,\n });\n };\n\n handleFileUpload = (attachmentUrl, attachmentName, attachmentSize) => {\n this.setState({\n attachmentUrl,\n attachmentName,\n attachmentSize,\n attachmentLoadingError: null,\n });\n };\n\n handleNativeFileUpload = () => {\n const { comment } = this.state;\n\n if (this.isEditMode) {\n notifyCommentEdit(comment);\n this.clearCommentField(this.props.exitEditMode);\n } else {\n notifyCommentPost(comment);\n this.clearCommentField();\n }\n };\n\n handleFileDelete = () =>\n this.setState({ attachmentUrl: null, attachmentName: null, attachmentSize: null });\n\n handleSendComment = async () => {\n const textComment = this.state.comment ? this.state.comment.trim() : null;\n if (!textComment && !this.state.attachmentUrl) return;\n\n const comment = {\n comment: {\n body: textComment,\n attachment: {\n url: this.state.attachmentUrl,\n size: this.state.attachmentSize,\n file_name: this.state.attachmentName,\n },\n },\n };\n\n let commentResponse;\n\n if (this.isEditMode) {\n this.props.setIsEditting(true);\n\n commentResponse = await this.patchComment(comment);\n await this.props.patchCommentCallback(commentResponse);\n\n this.props.setIsEditting(false);\n this.clearCommentField();\n this.props.exitEditMode();\n } else {\n this.props.setIsPosting(true);\n\n commentResponse = await this.postComment(comment);\n await this.props.postCommentCallback(commentResponse);\n\n this.props.setIsPosting(false);\n this.clearCommentField();\n }\n };\n\n handleCancelClick = () => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n this.props.exitEditMode()\n );\n };\n\n render() {\n const { classes, currentUser } = this.props;\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n this.state.isInputFocused ||\n this.state.attachmentUrl ||\n this.state.comment ||\n this.props.editComment ||\n this.props.editAttachment?.url;\n\n return (\n <div\n style={\n this.props.spaceAround\n ? style.commentTextFieldContainerSpaceAround\n : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={this.props.currentUser && this.props.currentUser.profile_photo}\n />\n </div>\n <Paper className={this.props.classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => this.setState({ comment }),\n singleLine: true,\n value: this.state.comment || '',\n inputRef: this.props.inputRef,\n withLightTheme: false,\n onMount: this.props.onMount,\n companyId: this.props.companyId,\n autoFocus: this.props.autoFocus,\n disabled: this.props.disabled,\n onFocus: () => this.setState({ isInputFocused: true }),\n onBlur: () => this.setState({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !this.props.isNative && (\n <InputAdornment position=\"end\" className={this.props.classes.inputAdornment}>\n {!this.state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={this.handleFileUpload}\n onError={this.handleAttachmentLoadingError}\n fileUploadIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${\n this.props.editCommentId || this.props.parentId\n }`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={this.handleSelectEmoji}\n emojiIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: this.props.classes.inputRoot,\n input: this.props.classes.inputEl,\n },\n }}\n className={this.props.classes.input}\n onKeyDown={this.handleKeyDown}\n />\n </Paper>\n\n {this.state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={this.state.attachmentLoadingError}\n className={this.props.classes.fileUploadingError}\n />\n )}\n\n {this.state.attachmentUrl && (\n <FilePreview\n fileName={this.state.attachmentName}\n fileUrl={this.state.attachmentUrl}\n handleFileDelete={this.handleFileDelete}\n classes={this.props.classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.cancelText,\n this.props.classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={this.handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(this.props.classes.inputMain, this.props.classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press&nbsp;\n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.highlightedLabel\n )}\n >\n Enter\n </Typography>\n &nbsp;to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={this.handleSendComment}\n classes={{ root: this.props.classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n}\n\nCommentInput.propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.defaultProps = {\n inputRef: null,\n editFeedItemId: null,\n editCommentId: null,\n parentId: null,\n editComment: null,\n editAttachment: {},\n spaceAround: false,\n setIsPosting: noop,\n setIsEditting: noop,\n onMount: noop,\n autoFocus: undefined,\n disabled: false,\n patchCommentCallback: noop,\n postCommentCallback: noop,\n exitEditMode: noop,\n companyId: null,\n currentUser: {},\n\n isNative: isNativeDetected,\n};\n\nexport default withStyles(muiStyles)(CommentInput);\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","CommentInput","_PureComponent","_inherits","PureComponent","_super","_createSuper","props","_this","_ref2","_ref3","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","setState","_ref","comment","native","_asyncToGenerator","_regeneratorRuntime","mark","commentResponse","wrap","_context","prev","next","postComment","sent","t0","console","error","message","abrupt","stop","_callee","_x","apply","arguments","_this$props","editFeedItemId","editCommentId","_context2","patchFeedItemComment","_callee2","_x2","callback","attachmentUrl","attachmentName","attachmentSize","focusOnRef","event","key","exitEditMode","isSuggestionsListOpened","preventDefault","handleSendComment","attachmentLoadingError","state","isEditMode","notifyCommentEdit","clearCommentField","notifyCommentPost","_callee3","textComment","_context3","trim","body","attachment","url","size","file_name","setIsEditting","patchComment","patchCommentCallback","setIsPosting","postCommentCallback","isInputFocused","_createClass","value","setInitialCommentValue","prevProps","get","editAttachment","editComment","utils","getFileNameWithExtensionFromPath","inputRef","current","focus","_this$props$editAttac","_this2","_this$props2","classes","currentUser","currentUserFullName","concat","isVisibleActionBar","_jsxs","spaceAround","children","_jsx","Avatar","displayName","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","withLightTheme","onMount","companyId","autoFocus","disabled","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","isNative","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","handleFileUpload","onError","handleAttachmentLoadingError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","parentId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","handleSelectEmoji","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","handleKeyDown","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","fileUrl","handleFileDelete","Collapse","in","mountOnEnter","unmountOnExit","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","handleCancelClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","propTypes","PropTypes","shape","number","string","bool","func","isRequired","defaultProps","noop","undefined","isNativeDetected","CommentInput$1","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor"],"mappings":"m8DA0BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,cAsElEE,EAAY,SAAAC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GAChB,SAAAA,EAAYM,GAAO,IAAAC,EAiDyDC,EAW3EC,EAjDG,OAXeC,EAAAC,KAAAX,GACjBO,EAAAH,EAAAQ,KAAAD,KAAML,GAAOO,EAAAC,EAAAP,GAAA,qBA+CK,SAAAQ,GAAK,OACvBR,EAAKS,UAAS,SAAAC,GAAA,IAAGC,IAAAA,QAAO,MAAQ,CAAEA,QAAYA,GAAAA,OAAAA,GAAUH,OAAAA,EAAMI,QAAU,GAAE,IAAAN,EAAAC,EAAAP,GAAA,eAAAC,EAAAY,EAAAC,EAAAC,MAE9D,WAAMJ,G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bhC,WAAY,CACV,UAAW,CACToC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbvF,eAAgB,CACd2F,aAAc,cACdlO,OAAQ,QAEX,GAqacgN,CAAsB5M"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/CommentInput/index.js"],"sourcesContent":["import { forwardRef, memo, useImperativeHandle } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport useCommentInput from './useCommentInput';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nconst emptyObject = {};\n\nconst CommentInput = forwardRef(\n /** @param {PropTypes.InferProps<typeof propTypes>} props */ function CommentInput(\n {\n inputRef = null,\n editFeedItemId = null,\n editCommentId = null,\n parentId = null,\n editComment = null,\n editAttachment = emptyObject,\n spaceAround = false,\n postComment,\n setIsPosting = noop,\n setIsEditting = noop,\n onMount = noop,\n autoFocus,\n disabled = false,\n patchCommentCallback = noop,\n postCommentCallback = noop,\n exitEditMode = noop,\n companyId = null,\n currentUser = emptyObject,\n isNative = isNativeDetected,\n classes,\n },\n ref\n ) {\n const {\n state,\n update,\n imperativeHandle,\n handleSendComment,\n handleKeyDown,\n handleSelectEmoji,\n handleAttachmentLoadingError,\n handleFileUpload,\n handleFileDelete,\n handleCancelClick,\n } = useCommentInput({\n inputRef,\n editFeedItemId,\n editCommentId,\n editComment,\n editAttachment,\n postComment,\n setIsPosting,\n setIsEditting,\n patchCommentCallback,\n postCommentCallback,\n exitEditMode,\n });\n useImperativeHandle(ref, () => imperativeHandle, [imperativeHandle]);\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n state.isInputFocused ||\n state.attachmentUrl ||\n state.comment ||\n editComment ||\n editAttachment?.url;\n\n return (\n <div\n style={\n spaceAround ? style.commentTextFieldContainerSpaceAround : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={currentUser && currentUser.profile_photo}\n />\n </div>\n <Paper className={classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => update({ comment }),\n singleLine: true,\n value: state.comment || '',\n inputRef: inputRef,\n withLightTheme: false,\n onMount: onMount,\n companyId: companyId,\n autoFocus: autoFocus,\n disabled: disabled,\n onFocus: () => update({ isInputFocused: true }),\n onBlur: () => update({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !isNative && (\n <InputAdornment position=\"end\" className={classes.inputAdornment}>\n {!state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={handleFileUpload}\n onError={handleAttachmentLoadingError}\n fileUploadIconClassName={classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${editCommentId || parentId}`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={handleSelectEmoji}\n emojiIconClassName={classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: classes.inputRoot,\n input: classes.inputEl,\n },\n }}\n className={classes.input}\n onKeyDown={handleKeyDown}\n />\n </Paper>\n\n {state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={state.attachmentLoadingError}\n className={classes.fileUploadingError}\n />\n )}\n\n {state.attachmentUrl && (\n <FilePreview\n fileName={state.attachmentName}\n fileUrl={state.attachmentUrl}\n handleFileDelete={handleFileDelete}\n classes={classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n classes.inputMain,\n classes.cancelText,\n classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(classes.inputMain, classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press&nbsp;\n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(classes.inputMain, classes.highlightedLabel)}\n >\n Enter\n </Typography>\n &nbsp;to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={handleSendComment}\n classes={{ root: classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n);\n\nconst propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.propTypes = propTypes;\n\nexport default withStyles(muiStyles)(memo(CommentInput));\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","emptyObject","CommentInput","forwardRef","ref","_ref$inputRef","_ref","inputRef","_ref$editFeedItemId","editFeedItemId","_ref$editCommentId","editCommentId","_ref$parentId","parentId","_ref$editComment","editComment","_ref$editAttachment","editAttachment","_ref$spaceAround","spaceAround","postComment","_ref$setIsPosting","setIsPosting","noop","_ref$setIsEditting","setIsEditting","_ref$onMount","onMount","autoFocus","_ref$disabled","disabled","_ref$patchCommentCall","patchCommentCallback","_ref$postCommentCallb","postCommentCallback","_ref$exitEditMode","exitEditMode","_ref$companyId","companyId","_ref$currentUser","currentUser","_ref$isNative","isNative","isNativeDetected","classes","_useCommentInput","useCommentInput","state","update","imperativeHandle","handleSendComment","handleKeyDown","handleSelectEmoji","handleAttachmentLoadingError","handleFileUpload","handleFileDelete","handleCancelClick","useImperativeHandle","currentUserFullName","get","concat","isVisibleActionBar","isInputFocused","attachmentUrl","comment","url","_jsxs","children","_jsx","Avatar","displayName","size","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","value","withLightTheme","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","onError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","attachmentLoadingError","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","attachmentName","fileUrl","Collapse","in","mountOnEnter","unmountOnExit","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","propTypes","PropTypes","shape","current","focus","number","string","file_name","bool","func","isRequired","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor","memo"],"mappings":"y3BAuBA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,cAsElEE,EAAc,CAAA,EAEdC,EAAeC,GAC0C,SAuB3DC,EAAAA,GACA,IAAAC,EAAAC,EAtBEC,SAAAA,aAAW,KAAIF,EAAAG,EAAAF,EACfG,eAAAA,aAAiB,KAAID,EAAAE,EAAAJ,EACrBK,cAAAA,aAAgB,KAAID,EAAAE,EAAAN,EACpBO,SAAAA,aAAW,KAAID,EAAAE,EAAAR,EACfS,YAAAA,aAAc,KAAID,EAAAE,EAAAV,EAClBW,eAAAA,aAAiBhB,EAAWe,EAAAE,EAAAZ,EAC5Ba,YAAAA,cAAmBD,EACnBE,IAAAA,YAAWC,EAAAf,EACXgB,aAAAA,aAAeC,EAAIF,EAAAG,EAAAlB,EACnBmB,cAAAA,aAAgBF,EAAIC,EAAAE,EAAApB,EACpBqB,QAAAA,aAAUJ,EAAIG,EACdE,IAAAA,UAASC,EAAAvB,EACTwB,SAAA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AAkB,CAChBK,MAAOgB,EAAMM,QAAQC,QAAQC,MAE/BzD,YAAa,CACXiE,UAAW,OAEb9B,WAAY,CACV,UAAW,CACTkC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbhF,eAAgB,CACdoF,aAAc,cACdrL,OAAQ,QAEX,GA8PcmK,CAAsBsB,EAAKpL"}
@@ -0,0 +1,26 @@
1
+ export default function useCommentInput(props: any): {
2
+ state: {
3
+ comment: string;
4
+ attachmentUrl: null;
5
+ attachmentName: null;
6
+ attachmentSize: null;
7
+ attachmentLoadingError: null;
8
+ isInputFocused: boolean;
9
+ };
10
+ update: (patch: any) => void;
11
+ imperativeHandle: {
12
+ clearCommentField: (callback: any) => void;
13
+ focusOnRef: () => void;
14
+ setInitialCommentValue: () => void;
15
+ handleNativeFileUpload: () => void;
16
+ handleSendComment: () => Promise<void>;
17
+ };
18
+ handleSendComment: () => Promise<void>;
19
+ handleKeyDown: (event: any) => void;
20
+ handleSelectEmoji: (emoji: any) => void;
21
+ handleAttachmentLoadingError: (attachmentLoadingError: any) => void;
22
+ handleFileUpload: (attachmentUrl: any, attachmentName: any, attachmentSize: any) => void;
23
+ handleFileDelete: () => void;
24
+ handleCancelClick: () => void;
25
+ };
26
+ //# sourceMappingURL=useCommentInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommentInput.d.ts","sourceRoot":"","sources":["../../../src/components/CommentInput/useCommentInput.js"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,KAAA;;;;;;;;;;;;;;;;;;;;;;;;EAuJ5C"}
@@ -0,0 +1,2 @@
1
+ import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as a,useRef as c,useCallback as o,useLayoutEffect as i}from"react";import{patchFeedItemComment as m}from"../../clients/jsonApi/index.js";import{isSuggestionsListOpened as u}from"../UserMention/utils/index.js";import s from"../../utils/main.js";import{notifyCommentEdit as l,notifyCommentPost as p}from"../../utils/nativeMessages.js";function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?d(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var h={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null};function b(e){var d=a(f(f({},h),{},{attachmentLoadingError:null,isInputFocused:!1})),b=n(d,2),v=b[0],I=b[1],y=c({props:e,state:v}),g=c(null),x=c([]),O=o((function(t){return I((function(e){return f(f({},e),t)}))}),[]),j=function(){y.current.props.inputRef&&y.current.props.inputRef.current.focus()},E=function(){var t=y.current.props,e=t.editAttachment?t.editAttachment.url:null;O({comment:t.editComment,attachmentUrl:e,attachmentName:e?t.editAttachment.file_name||s.getFileNameWithExtensionFromPath(e):null,attachmentSize:t.editAttachment?t.editAttachment.size:null})};i((function(){y.current={props:e,state:v};var t=g.current;g.current=e,(!t&&e.editFeedItemId||e.editFeedItemId&&t&&!t.editFeedItemId||t&&e.editCommentId&&e.editCommentId!==t.editCommentId)&&E();var n=x.current;x.current=[],n.forEach((function(t){var e=t.focus,n=t.callback;e&&j(),"function"==typeof n&&n()}))}));var C,k=function(t){x.current.push({focus:!0,callback:t}),O(h)},F=(C=t(r.mark((function t(){var e,n,a,c,o,i,u;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.current,(n=e.state.comment?e.state.comment.trim():null)||e.state.attachmentUrl){t.next=4;break}return t.abrupt("return");case 4:if(a={comment:{body:n,attachment:{url:e.state.attachmentUrl,size:e.state.attachmentSize,file_name:e.state.attachmentName}}},!e.props.editFeedItemId){t.next=24;break}return e.props.setIsEditting(!0),t.prev=7,o=y.current.props,i=o.editFeedItemId,u=o.editCommentId,t.next=11,m(i,u,a);case 11:c=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.error(t.t0.message);case 17:return t.next=19,y.current.props.patchCommentCallback(c);case 19:y.current.props.setIsEditting(!1),k(),y.current.props.exitEditMode(),t.next=38;break;case 24:return e.props.setIsPosting(!0),t.prev=25,t.next=28,y.current.props.postComment(a);case 28:c=t.sent,t.next=34;break;case 31:t.prev=31,t.t1=t.catch(25),console.error(t.t1.message);case 34:return t.next=36,y.current.props.postCommentCallback(c);case 36:y.current.props.setIsPosting(!1),k();case 38:case"end":return t.stop()}}),t,null,[[7,14],[25,31]])}))),function(){return C.apply(this,arguments)}),P=c({clearCommentField:k,focusOnRef:j,setInitialCommentValue:E,handleNativeFileUpload:function(){var t=y.current;t.props.editFeedItemId?(l(t.state.comment),k(y.current.props.exitEditMode)):(p(t.state.comment),k())},handleSendComment:F}),S=o((function(t){return I((function(e){return f(f({},e),{},{comment:"".concat(e.comment).concat(t.native)})}))}),[]),U=o((function(t){return O({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})}),[O]),w=o((function(t,e,n){return O({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})}),[O]);return{state:v,update:O,imperativeHandle:P.current,handleSendComment:F,handleKeyDown:function(t){"Escape"===t.key&&y.current.props.exitEditMode(),"Enter"!==t.key||u()||(t.preventDefault(),F())},handleSelectEmoji:S,handleAttachmentLoadingError:U,handleFileUpload:w,handleFileDelete:function(){return O({attachmentUrl:null,attachmentName:null,attachmentSize:null})},handleCancelClick:function(){var t=y.current.props.exitEditMode();"function"==typeof t&&x.current.push({callback:t}),O(h)}}}export{b as default};
2
+ //# sourceMappingURL=useCommentInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommentInput.js","sources":["../../../src/components/CommentInput/useCommentInput.js"],"sourcesContent":["import { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport { patchFeedItemComment } from '../../clients/jsonApi';\nimport { isSuggestionsListOpened } from '~components/UserMention/utils';\nimport utils from '~utils/main';\nimport { notifyCommentEdit, notifyCommentPost } from '~utils/nativeMessages';\n\nconst clearedComment = {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n};\n\nexport default function useCommentInput(props) {\n const [state, setState] = useState({\n ...clearedComment,\n attachmentLoadingError: null,\n isInputFocused: false,\n });\n const latest = useRef({ props, state });\n const previousProps = useRef(null);\n const afterCommit = useRef([]);\n const update = useCallback(patch => setState(current => ({ ...current, ...patch })), []);\n const focusOnRef = () => {\n if (latest.current.props.inputRef) latest.current.props.inputRef.current.focus();\n };\n const setInitialCommentValue = () => {\n const current = latest.current.props;\n const attachmentUrl = current.editAttachment ? current.editAttachment.url : null;\n update({\n comment: current.editComment,\n attachmentUrl,\n attachmentName: attachmentUrl\n ? current.editAttachment.file_name || utils.getFileNameWithExtensionFromPath(attachmentUrl)\n : null,\n attachmentSize: current.editAttachment ? current.editAttachment.size : null,\n });\n };\n\n useLayoutEffect(() => {\n latest.current = { props, state };\n const previous = previousProps.current;\n previousProps.current = props;\n if (\n (!previous && props.editFeedItemId) ||\n (props.editFeedItemId && previous && !previous.editFeedItemId) ||\n (previous && props.editCommentId && props.editCommentId !== previous.editCommentId)\n ) {\n setInitialCommentValue();\n }\n const pending = afterCommit.current;\n afterCommit.current = [];\n pending.forEach(({ focus, callback }) => {\n if (focus) focusOnRef();\n if (typeof callback === 'function') callback();\n });\n });\n\n const clearCommentField = callback => {\n afterCommit.current.push({ focus: true, callback });\n update(clearedComment);\n };\n const handleNativeFileUpload = () => {\n const current = latest.current;\n if (current.props.editFeedItemId) {\n notifyCommentEdit(current.state.comment);\n clearCommentField(latest.current.props.exitEditMode);\n } else {\n notifyCommentPost(current.state.comment);\n clearCommentField();\n }\n };\n const handleSendComment = async () => {\n const current = latest.current;\n const textComment = current.state.comment ? current.state.comment.trim() : null;\n if (!textComment && !current.state.attachmentUrl) return;\n const payload = {\n comment: {\n body: textComment,\n attachment: {\n url: current.state.attachmentUrl,\n size: current.state.attachmentSize,\n file_name: current.state.attachmentName,\n },\n },\n };\n let response;\n if (current.props.editFeedItemId) {\n current.props.setIsEditting(true);\n try {\n const { editFeedItemId, editCommentId } = latest.current.props;\n response = await patchFeedItemComment(editFeedItemId, editCommentId, payload);\n } catch (error) {\n console.error(error.message);\n }\n await latest.current.props.patchCommentCallback(response);\n latest.current.props.setIsEditting(false);\n clearCommentField();\n latest.current.props.exitEditMode();\n } else {\n current.props.setIsPosting(true);\n try {\n response = await latest.current.props.postComment(payload);\n } catch (error) {\n console.error(error.message);\n }\n await latest.current.props.postCommentCallback(response);\n latest.current.props.setIsPosting(false);\n clearCommentField();\n }\n };\n\n const imperativeHandle = useRef({\n clearCommentField,\n focusOnRef,\n setInitialCommentValue,\n handleNativeFileUpload,\n handleSendComment,\n });\n\n const handleSelectEmoji = useCallback(\n emoji => setState(current => ({ ...current, comment: `${current.comment}${emoji.native}` })),\n []\n );\n const handleAttachmentLoadingError = useCallback(\n attachmentLoadingError =>\n update({\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n attachmentLoadingError,\n }),\n [update]\n );\n const handleFileUpload = useCallback(\n (attachmentUrl, attachmentName, attachmentSize) =>\n update({ attachmentUrl, attachmentName, attachmentSize, attachmentLoadingError: null }),\n [update]\n );\n\n return {\n state,\n update,\n imperativeHandle: imperativeHandle.current,\n handleSendComment,\n handleKeyDown: event => {\n if (event.key === 'Escape') latest.current.props.exitEditMode();\n if (event.key === 'Enter' && !isSuggestionsListOpened()) {\n event.preventDefault();\n handleSendComment();\n }\n },\n handleSelectEmoji,\n handleAttachmentLoadingError,\n handleFileUpload,\n handleFileDelete: () =>\n update({ attachmentUrl: null, attachmentName: null, attachmentSize: null }),\n handleCancelClick: () => {\n // The legacy cancel handler exits synchronously, before clearing commits.\n const callback = latest.current.props.exitEditMode();\n if (typeof callback === 'function') afterCommit.current.push({ callback });\n update(clearedComment);\n },\n };\n}\n"],"names":["clearedComment","comment","attachmentUrl","attachmentName","attachmentSize","useCommentInput","props","useState","attachmentLoadingError","isInputFocused","_useState2","_slicedToArray","_useState","state","setState","latest","useRef","previousProps","afterCommit","update","useCallback","patch","current","focusOnRef","inputRef","focus","setInitialCommentValue","editAttachment","url","editComment","file_name","utils","getFileNameWithExtensionFromPath","size","useLayoutEffect","previous","editFeedItemId","editCommentId","pending","forEach","_ref","callback","_ref2","clearCommentField","push","handleSendComment","_asyncToGenerator","_regeneratorRuntime","mark","_callee","textComment","payload","response","_latest$current$props","wrap","_context","prev","next","trim","abrupt","body","attachment","setIsEditting","patchFeedItemComment","sent","t0","console","error","message","patchCommentCallback","exitEditMode","setIsPosting","postComment","t1","postCommentCallback","stop","apply","this","arguments","imperativeHandle","handleNativeFileUpload","notifyCommentEdit","notifyCommentPost","handleSelectEmoji","emoji","_objectSpread","native","handleAttachmentLoadingError","handleFileUpload","handleKeyDown","event","key","isSuggestionsListOpened","preventDefault","handleFileDelete","handleCancelClick"],"mappings":"smCAMA,IAAMA,EAAiB,CACrBC,QAAS,GACTC,cAAe,KACfC,eAAgB,KAChBC,eAAgB,MAGH,SAASC,EAAgBC,GACtC,IAA0BC,EAAAA,SACrBP,GAAc,GAAA,CACjBQ,uBAAwB,KACxBC,gBAAgB,KAChBC,EAAAC,EAAAC,EAAA,GAJKC,EAAKH,EAAA,GAAEI,EAAQJ,EAAA,GAKhBK,EAASC,EAAO,CAAEV,MAAAA,EAAOO,MAAAA,IACzBI,EAAgBD,EAAO,MACvBE,EAAcF,EAAO,IACrBG,EAASC,GAAY,SAAAC,GAAK,OAAIP,GAAS,SAAAQ,GAAO,OAAUA,EAAAA,EAAAA,CAAAA,EAAAA,GAAYD,EAAK,GAAI,GAAE,IAC/EE,EAAa,WACbR,EAAOO,QA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cAAe,KAAMC,eAAgB,KAAMC,eAAgB,MAAO,EAC7E2F,kBAAmB,WAEjB,IAAMtD,EAAW1B,EAAOO,QAAQhB,MAAMgE,eACd,mBAAb7B,GAAyBvB,EAAYI,QAAQsB,KAAK,CAAEH,SAAAA,IAC/DtB,EAAOnB,EACT,EAEJ"}
@@ -1,2 +1,2 @@
1
- import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={spacing:"8",root:"CommentInputNext_root__5uxKl",dropOverlay:"CommentInputNext_dropOverlay__E5Riv",inputPanel:"CommentInputNext_inputPanel__4KOFc",rootEmbedded:"CommentInputNext_rootEmbedded__-LyQl",toolbarRow:"CommentInputNext_toolbarRow__L8xXu",divider:"CommentInputNext_divider__LWp-3",metaShare:"CommentInputNext_metaShare__yJ8GZ",rootBare:"CommentInputNext_rootBare__lxyYY",fieldRow:"CommentInputNext_fieldRow__Rqcbr",leading:"CommentInputNext_leading__yDBbV",field:"CommentInputNext_field__OpnOp",fieldExpanded:"CommentInputNext_fieldExpanded__w1omA",fieldDisabled:"CommentInputNext_fieldDisabled__g3aIT",bareToolbar:"CommentInputNext_bareToolbar__nFQP-",fieldMain:"CommentInputNext_fieldMain__Rs8-Y",attachment:"CommentInputNext_attachment__2EDgL",input:"CommentInputNext_input__w6b1c",toolbar:"CommentInputNext_toolbar__Zs2OG",send:"CommentInputNext_send__p248I"};e(".CommentInputNext_root__5uxKl{background:var(--palette-background-b-6);border-radius:12px;display:flex;flex-direction:column;overflow:hidden;position:relative}.CommentInputNext_dropOverlay__E5Riv{align-items:center;background:rgb(from var(--palette-primary-main) r g b/.1);border:1px dashed var(--palette-primary-main);border-radius:inherit;color:var(--palette-primary-main);display:flex;font-size:14px;inset:0;justify-content:center;line-height:20px;pointer-events:none;position:absolute;z-index:5}.CommentInputNext_inputPanel__4KOFc{display:flex;flex-direction:column;gap:8px;padding:12px 12px 8px}.CommentInputNext_rootEmbedded__-LyQl{background:transparent;border-radius:0;overflow:visible}.CommentInputNext_toolbarRow__L8xXu{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentInputNext_divider__LWp-3{background:var(--palette-background-b-4);height:1px}.CommentInputNext_metaShare__yJ8GZ{color:var(--palette-primary-text-6);display:flex;flex-direction:column;gap:8px;padding:8px 12px}.CommentInputNext_rootBare__lxyYY{display:flex;flex-direction:column;gap:8px;position:relative}.CommentInputNext_fieldRow__Rqcbr{align-items:flex-start;display:flex;gap:8px}.CommentInputNext_leading__yDBbV{flex-shrink:0}.CommentInputNext_field__OpnOp{align-items:flex-end;background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px solid rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;display:flex;flex:1 0 0;gap:8px;max-height:256px;min-height:36px;min-width:0;overflow:hidden;padding:6px 8px}.CommentInputNext_field__OpnOp:focus-within{border-color:var(--palette-primary-main)}.CommentInputNext_fieldExpanded__w1omA{max-height:none;overflow:visible}.CommentInputNext_fieldDisabled__g3aIT{opacity:.6}.CommentInputNext_bareToolbar__nFQP-{align-items:center;color:var(--palette-primary-text-6);display:flex;flex-shrink:0}.CommentInputNext_fieldMain__Rs8-Y{flex:1 0 0;min-width:0}.CommentInputNext_attachment__2EDgL,.CommentInputNext_fieldMain__Rs8-Y{display:flex;flex-direction:column;gap:8px}.CommentInputNext_input__w6b1c{background:transparent;border:none;color:var(--palette-primary-text-1);font:inherit;font-size:14px;line-height:20px;outline:none;resize:none;width:100%}.CommentInputNext_input__w6b1c::placeholder{color:var(--palette-primary-text-9)}.CommentInputNext_input__w6b1c:disabled{cursor:not-allowed}.CommentInputNext_toolbar__Zs2OG{align-items:center;color:var(--palette-primary-text-6);display:flex;gap:4px;margin-left:-4px}.CommentInputNext_send__p248I{flex-shrink:0}");export{t as default};
1
+ import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={spacing:"8",root:"CommentInputNext_root__5uxKl",dropOverlay:"CommentInputNext_dropOverlay__E5Riv",inputPanel:"CommentInputNext_inputPanel__4KOFc",rootEmbedded:"CommentInputNext_rootEmbedded__-LyQl",toolbarRow:"CommentInputNext_toolbarRow__L8xXu",divider:"CommentInputNext_divider__LWp-3",metaShare:"CommentInputNext_metaShare__yJ8GZ",rootBare:"CommentInputNext_rootBare__lxyYY",fieldRow:"CommentInputNext_fieldRow__Rqcbr",leading:"CommentInputNext_leading__yDBbV",field:"CommentInputNext_field__OpnOp",fieldExpanded:"CommentInputNext_fieldExpanded__w1omA",fieldDisabled:"CommentInputNext_fieldDisabled__g3aIT",bareToolbar:"CommentInputNext_bareToolbar__nFQP-",fieldMain:"CommentInputNext_fieldMain__Rs8-Y",attachment:"CommentInputNext_attachment__2EDgL",input:"CommentInputNext_input__w6b1c",toolbar:"CommentInputNext_toolbar__Zs2OG",send:"CommentInputNext_send__p248I"};e(".CommentInputNext_root__5uxKl{overflow-clip-margin:12px;background:var(--palette-background-b-6);border-radius:12px;display:flex;flex-direction:column;overflow:hidden;overflow:clip;position:relative}.CommentInputNext_dropOverlay__E5Riv{align-items:center;background:rgb(from var(--palette-primary-main) r g b/.1);border:1px dashed var(--palette-primary-main);border-radius:inherit;color:var(--palette-primary-main);display:flex;font-size:14px;inset:0;justify-content:center;line-height:20px;pointer-events:none;position:absolute;z-index:5}.CommentInputNext_inputPanel__4KOFc{--attachment-arrow-outset:12px;display:flex;flex-direction:column;gap:8px;padding:12px 12px 8px}.CommentInputNext_rootEmbedded__-LyQl{background:transparent;border-radius:0;overflow:visible}.CommentInputNext_toolbarRow__L8xXu{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentInputNext_divider__LWp-3{background:var(--palette-background-b-4);height:1px}.CommentInputNext_metaShare__yJ8GZ{color:var(--palette-primary-text-6);display:flex;flex-direction:column;gap:8px;padding:8px 12px}.CommentInputNext_rootBare__lxyYY{display:flex;flex-direction:column;gap:8px;position:relative}.CommentInputNext_fieldRow__Rqcbr{align-items:flex-start;display:flex;gap:8px}.CommentInputNext_leading__yDBbV{flex-shrink:0}.CommentInputNext_field__OpnOp{--attachment-arrow-outset:8px;align-items:flex-end;background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px solid rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;display:flex;flex:1 0 0;gap:8px;max-height:256px;min-height:36px;min-width:0;overflow:hidden;padding:6px 8px}.CommentInputNext_field__OpnOp:focus-within{border-color:var(--palette-primary-main)}.CommentInputNext_fieldExpanded__w1omA{max-height:none;overflow:visible}.CommentInputNext_fieldDisabled__g3aIT{opacity:.6}.CommentInputNext_bareToolbar__nFQP-{align-items:center;color:var(--palette-primary-text-6);display:flex;flex-shrink:0}.CommentInputNext_fieldMain__Rs8-Y{flex:1 0 0;min-width:0}.CommentInputNext_attachment__2EDgL,.CommentInputNext_fieldMain__Rs8-Y{display:flex;flex-direction:column;gap:8px}.CommentInputNext_input__w6b1c{background:transparent;border:none;color:var(--palette-primary-text-1);font:inherit;font-size:14px;line-height:20px;outline:none;resize:none;width:100%}.CommentInputNext_input__w6b1c::placeholder{color:var(--palette-primary-text-9)}.CommentInputNext_input__w6b1c:disabled{cursor:not-allowed}.CommentInputNext_toolbar__Zs2OG{align-items:center;color:var(--palette-primary-text-6);display:flex;gap:4px;margin-left:-4px}.CommentInputNext_send__p248I{flex-shrink:0}");export{t as default};
2
2
  //# sourceMappingURL=CommentInputNext.scss.js.map
@@ -1,7 +1,7 @@
1
1
  import type { ComponentType, FC } from 'react';
2
2
  import type { AppCoordinates, ChatActions, DashboardAppLastAnnotation, DevCenterAppResource, DevCenterCurrentUser, DevCenterRouter, LayoutEnvironment, RegisterAITools, SetIsFullscreenModalMode, UpdateDashboardAppLastAnnotation } from './types';
3
3
  import type { FullscreenModes } from '../../../types';
4
- import type { GlobalOffsetWell } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';
4
+ import type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';
5
5
  /**
6
6
  * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.
7
7
  * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,
@@ -26,14 +26,7 @@ export type DevCenterAppContainerProps = Partial<FullscreenModes> & {
26
26
  chatActions?: ChatActions | null;
27
27
  coordinates?: AppCoordinates | null;
28
28
  currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;
29
- dashboardMeta?: {
30
- isMultiAsset?: boolean;
31
- isMultiWell?: boolean;
32
- isChiplessDashboard?: boolean;
33
- globalOffsetWells?: GlobalOffsetWell[];
34
- globalOffsetWellsVersion?: number;
35
- globalOffsetWellsToken?: number;
36
- };
29
+ dashboardMeta?: AppDashboardMeta;
37
30
  disableAppAssetSelection?: boolean;
38
31
  isActionsDisabled?: boolean;
39
32
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DevCenterAppContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA2B/C,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EAEpB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAiBnG;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG;IAClE,GAAG,EAAE,oBAAoB,CAAC;IAC1B,WAAW,EAAE,oBAAoB,CAAC;IAClC,yEAAyE;IACzE,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;OAIG;IAEH,eAAe,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAE5C,cAAc,CAAC,EAAE,aAAa,CAAC,GA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,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uCAAuC,CAAC,EAAE,gCAAgC,CAAC;CAC5E,CAAC;AAKF,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAkSzD,CAAC;eAEa,qBAAqB"}
1
+ {"version":3,"file":"DevCenterAppContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA2B/C,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EAEpB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,gCAAgC,EACjC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAiBnG;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG;IAClE,GAAG,EAAE,oBAAoB,CAAC;IAC1B,WAAW,EAAE,oBAAoB,CAAC;IAClC,yEAAyE;IACzE,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;OAIG;IAEH,eAAe,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAE5C,cAAc,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3C,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,C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BAAqB,EAAE,EAAE,CAAC,0BAA0B,CAkSzD,CAAC;eAEa,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { GlobalOffsetWell } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: {\n isMultiAsset?: boolean;\n isMultiWell?: boolean;\n isChiplessDashboard?: boolean;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n };\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["DevCenterAppContainer","_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"yogBAyHA,IAGMA,EAAwD,SAsCxDC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,KAAAA,MACAC,KAAAA,UACAC,KAAAA,YACAC,KAAAA,oCACAC,KAAAA,YACAC,KAAAA,gBACAC,KAAAA,yBACAC,KAAAA,kBACAC,KAAAA,oBACAC,KAAAA,uBACAC,KAAAA,sBACAC,KAAAA,iBACAC,KAAAA,mBACAC,KAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,EACnBuC,gBAAAA,eAAkBP,EAAIM,GAAAE,GAAAxC,EACtByC,iBAAAA,eAAmBT,EAAIQ,GAAAE,GAAA1C,EACvB2C,aAAAA,eAAeX,EAAIU,GACnBE,KAAAA,gBAAeC,GAAA7C,EACf8C,yBAAAA,eAA2Bd,EAAIa,GAC/BE,KAAAA,UACAC,KAAAA,wCACAC,KAAAA,cACAC,KAAAA,UACAC,KAAAA,YAKMC,GAAqDC,EAAWC,GAChEC,GAAQC,IACRC,GAAeC,GAAoBC,EACCC,GAAAA,EAA8B,IAAGC,GAAAC,EAAAC,GAAA,GAApEC,GAAaH,GAAA,GAAEI,GAAgBJ,GAAA,GACcD,GAAAA,EAA8B,IAAGM,GAAAJ,EAAAK,GAAA,GAA9EC,GAAkBF,GAAA,GAAEG,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A,EACL8D,QAASA,GACTe,QAASA,GACTwE,qBAAsBlD,GACtBa,eAAgBA,GAChBC,qBAAsBA,GACtB5G,YAAaA,GACbE,yBAA0BA,GAC1BoG,wBAAyBA,GACzBJ,0BAA2BA,GAC3BhC,WAAYA,GACZrD,uBAAwBA,GACxBC,kBAAmBA,GACnBI,YAAaA,GACbE,iBAAkBA,GAClBM,iBAAkBA,GAClBE,aAAcA,GACd2E,sBAAuBA,GACvBJ,wBAAyBA,KAE1BvB,KAAgBgD,IACfQ,EAACiC,EAAoB,CAACxF,eAAgBA,MAGtC1E,MAAuByH,IAAyBjE,KAChDyE,EAACkC,EAAgB,CACf3K,IAAKA,EACLK,YAAaA,GACbC,gBAAiBA,GACjB4G,uBAAwBA,GACxB3B,SAAUA,GACVZ,kBAAmBA,GACnB2E,qBAAsBA,EACtBrE,YAAaA,GACblC,aAAcA,GACdO,cAAeA,GACfI,mBAAoBA,GACpBhC,kBAAmBA,GACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B8C,eAAgBA,GAChB0B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
1
+ {"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: AppDashboardMeta;\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["DevCenterAppContainer","_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"yogBAkHA,IAGMA,EAAwD,SAsCxDC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,KAAAA,MACAC,KAAAA,UACAC,KAAAA,YACAC,KAAAA,oCACAC,KAAAA,YACAC,KAAAA,gBACAC,KAAAA,yBACAC,KAAAA,kBACAC,KAAAA,oBACAC,KAAAA,uBACAC,KAAAA,sBACAC,KAAAA,iBACAC,KAAAA,mBACAC,KAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,E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js';var e={spacing:"8",root:"FeedCard_root__3hrMo"};r(".FeedCard_root__3hrMo{backdrop-filter:blur(2px);background:rgb(from var(--palette-background-b-6) r g b/.9);border-radius:16px;display:flex;flex-direction:column;overflow:hidden}");export{e as default};
1
+ import r from'./../../ext-esm/style-inject/dist/style-inject.es.js';var o={spacing:"8",root:"FeedCard_root__3hrMo"};r(".FeedCard_root__3hrMo{overflow-clip-margin:12px;backdrop-filter:blur(2px);background:rgb(from var(--palette-background-b-6) r g b/.9);border-radius:16px;display:flex;flex-direction:column;overflow:hidden;overflow:clip}");export{o as default};
2
2
  //# sourceMappingURL=FeedCard.scss.js.map
@@ -4,6 +4,24 @@ export type GlobalOffsetWell = {
4
4
  id: number;
5
5
  [key: string]: unknown;
6
6
  };
7
+ /** Host-owned planning scope. Presence identifies a Well Planning dashboard. */
8
+ export type WellPlanningDashboardMeta = {
9
+ assetId: number | null;
10
+ dashboardId: string;
11
+ defaultDashboardKind?: string;
12
+ segment: string | null;
13
+ };
14
+ export type AppDashboardMeta = {
15
+ /** The host owns app identity and maximization controls. */
16
+ isEmbedded?: boolean;
17
+ isMultiAsset?: boolean;
18
+ isMultiWell?: boolean;
19
+ isChiplessDashboard?: boolean;
20
+ globalOffsetWells?: GlobalOffsetWell[];
21
+ globalOffsetWellsVersion?: number;
22
+ globalOffsetWellsToken?: number;
23
+ wellPlanning?: WellPlanningDashboardMeta;
24
+ };
7
25
  export type AppCommonsContextType = {
8
26
  maximized: boolean;
9
27
  appId: number;
@@ -18,12 +36,7 @@ export type AppCommonsContextType = {
18
36
  fracFleet?: FracFleet;
19
37
  interventionUnit?: InterventionUnit;
20
38
  wells?: Well[];
21
- dashboardMeta?: {
22
- isMultiAsset?: boolean;
23
- isMultiWell?: boolean;
24
- isChiplessDashboard?: boolean;
25
- globalOffsetWellsToken?: number;
26
- };
39
+ dashboardMeta?: AppDashboardMeta;
27
40
  appHeadersV3Enabled?: boolean;
28
41
  isNonIsolatedApp?: boolean;
29
42
  disableAppAssetSelection?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AppCommonsContext.d.ts","sourceRoot":"","sources":["../../../src/componentsV2/AppCommonsProvider/AppCommonsContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AAE5E,OAAO,EACL,GAAG,EACH,WAAW,EACX,KAAK,EACL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACL,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAIF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE3C,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IAGf,aAAa,CAAC,EAAE;QACd,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAG9B,gBAA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