@corva/ui 3.79.0-13 → 3.79.0-15
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.
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.js +2 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.js.map +1 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js +2 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
- package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js +1 -1
- package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
- package/cjs-bundle/config/highcharts/highcharts.js +1 -1
- package/cjs-bundle/config/highcharts/highcharts.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.js.map +1 -1
- package/components/CommentCard/CommentCard.scss.js +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +3 -0
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CurveTooltip/CurveTooltip.d.ts +24 -0
- package/components/CurveTooltip/CurveTooltip.d.ts.map +1 -0
- package/components/CurveTooltip/CurveTooltip.js +2 -0
- package/components/CurveTooltip/CurveTooltip.js.map +1 -0
- package/components/CurveTooltip/CurveTooltip.scss.js +2 -0
- package/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
- package/components/CurveTooltip/index.d.ts +2 -0
- package/components/CurveTooltip/index.d.ts.map +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
- package/components/NewCommentCursor/NewCommentCursor.d.ts +2 -0
- package/components/NewCommentCursor/NewCommentCursor.d.ts.map +1 -1
- package/components/NewCommentCursor/NewCommentCursor.js +1 -1
- package/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
- package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts +2 -0
- package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts.map +1 -0
- package/config/highcharts/highcharts.d.ts.map +1 -1
- package/config/highcharts/highcharts.js +1 -1
- package/config/highcharts/highcharts.js.map +1 -1
- package/mcp-server/server.mjs +70 -4
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/toConsumableArray"),o=require("react"),n=require("@material-ui/core"),i=require("classnames"),c=require("../FeedCard/FeedCard.js"),r=require("../AttachmentPreview/useStoredAttachments.js"),t=require("../FeedCard/useFeedActivity.js"),a=require("../AttachmentPreview/AttachmentPreview.js");require("../../componentsV2/FileIcon/FileIcon.js"),require("../../componentsV2/ButtonIcon/ButtonIcon.js");var u=require("../../componentsV2/Tooltip/Tooltip.js"),l=require("react/jsx-runtime"),m=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/InfoRounded.js"),require("../../icons/customIcons/icons/FlameFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/PinOne.js"),require("../../icons/customIcons/icons/PinOneCrossed.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js"),require("@babel/runtime/helpers/slicedToArray"),require("../../componentsV2/Menu/Menu.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("../../utils/main.js"),require("../AttachmentPreview/AttachmentImage.js"),require("../AttachmentPreview/AttachmentPreview.scss.js"),require("file-extension"),require("image-extensions"),require("video-extensions");var d=require("../../componentsV2/Avatar/Avatar.js"),j=require("../LinkedText/LinkedText.js"),p=require("./CommentCardReactions.js"),q=require("./CommentCardReplies.js"),h=require("./CommentCard.scss.js");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=I(e),x=I(s),C=I(i);function b(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,n)}return o}function f(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?b(Object(o),!0).forEach((function(s){v.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var y=function(e){var s=e.rows;return l.jsx("div",{className:h.metadataRows,children:s.map((function(e){var s=e.label,o=e.value,n=e.unit;return l.jsxs("div",{className:h.metadataRow,children:[l.jsx("span",{className:h.metadataLabel,children:s}),l.jsx("span",{className:h.metadataValue,children:o}),n&&l.jsx("span",{className:h.metadataUnit,children:n})]},s)}))})},O=o.forwardRef((function(e,s){var i=e.activity,I=e.variant,v=void 0===I?"expanded":I,b=e.author,O=e.timestamp,A=e.subtitle,F=e.body,N=e.contextRows,g=e.attachment,R=e.storedAttachments,P=e.isLiked,w=e.likesCount,M=e.commentsCount,k=e.replies,T=e.hasMoreReplies,S=e.moreRepliesCount,D=e.attachments,E=e.onAttachmentClick,L=e.onAttachmentShare,_=e.attachmentSlot,B=e.chip,G=e.chipColor,H=e.onLike,U=e.onReplyToggle,V=e.onForward,z=e.onShowMoreReplies,X=e.menuItems,W=e.isReplyOpen,K=e.replyInput,Z=e.editForm,J=e.width,Q=e.onMouseEnter,Y=e.onMouseLeave,$=e.className,ee=e.testId,se=t.useFeedActivity(i,"comment"),oe=se?[].concat(x.default(null!=X?X:[]),x.default(se.menuItems)):X,ne=se?se.replyInput:K,ie=se?se.isReplyOpen:W,ce=se?se.replies:k,re=!(null==N||!N.length),te=re&&!B,ae=!!(se||H||U||V||null!=oe&&oe.length||te),ue=te&&l.jsx(u.Tooltip,{placement:"top",className:h.metadataTooltip,title:l.jsx(y,{rows:N}),children:l.jsx("span",{className:h.infoButton,"data-testid":"comment-card-info",children:l.jsx(m.InfoIcon,{size:12,strokeWidth:2})})}),le=l.jsx(p.CommentCardReactions,{info:ue,commentsCount:se?se.commentsCount:M,likesCount:se?se.likesCount:w,isLiked:se?se.isLiked:P,menuItems:oe,onLike:se?se.onLike:H,onReplyToggle:se?se.onReplyToggle:U,onForward:V}),me=l.jsxs("div",{className:h.text,children:[B&&l.jsx(u.Tooltip,{placement:"top",className:h.metadataTooltip,title:re?l.jsx(y,{rows:N}):"",children:l.jsxs("span",{className:C.default(h.chip,!!G&&h.chipAccented),style:G?{"--chip-color":G}:void 0,children:[G&&l.jsx("span",{className:h.chipDot}),B]})}),l.jsx(j.LinkedText,{children:F})]}),de=o.useMemo((function(){return null!=R?R:[g].filter(Boolean)}),[R,g]),je=r.useStoredAttachments(de),pe=je.length?je:D,qe=null!=pe&&pe.length?l.jsx(a.AttachmentPreview,{items:pe,onItemClick:E,onShare:L}):null,he={ref:s,width:J,radius:12,onMouseEnter:Q,onMouseLeave:Y,testId:ee,className:$};if(null!=se&&se.isDeleted)return null;var Ie=function(e){return l.jsxs(l.Fragment,{children:[e,null==se?void 0:se.deleteDialog]})};if("preview"===v)return Ie(l.jsxs(c.FeedCard,f(f({},he),{},{maxHeight:c.FEED_CARD_MAX_HEIGHT_PX,children:[l.jsxs("div",{className:h.compactBody,children:[l.jsxs("div",{className:h.compactTop,children:[l.jsx(d.Avatar,{size:24,name:b.name,imageSrc:b.avatarUrl,className:h.avatar}),l.jsx("span",{className:h.name,children:b.name}),l.jsx("span",{className:h.compactTime,children:O})]}),l.jsx("div",{className:h.scrollBody,children:me})]}),ae&&l.jsx("div",{className:h.compactFooter,children:le})]})));var ve=!!Z,xe=l.jsxs("div",{className:h.header,children:[l.jsx(d.Avatar,{size:24,name:b.name,imageSrc:b.avatarUrl,className:h.avatar}),l.jsxs("div",{className:h.headerText,children:[l.jsxs("div",{className:h.nameRow,children:[l.jsx("span",{className:h.name,children:b.name}),O&&l.jsx("span",{className:h.timestamp,children:O})]}),A&&l.jsx("span",{className:h.subtitle,children:A})]})]});return Ie(ve?l.jsxs(c.FeedCard,f(f({},he),{},{children:[l.jsx("div",{className:h.editHeader,children:xe}),Z]})):l.jsxs(c.FeedCard,f(f({},he),{},{children:[l.jsxs("div",{className:h.capped,style:{maxHeight:c.FEED_CARD_MAX_HEIGHT_PX},children:[l.jsxs("div",{className:h.bodySurface,children:[xe,l.jsxs("div",{className:h.scrollBody,children:[me,(qe||_)&&l.jsxs("div",{className:h.attachment,children:[qe,_]})]})]}),ae&&l.jsx("div",{className:h.footer,children:le})]}),ae&&l.jsx(n.Collapse,{in:ie,timeout:250,unmountOnExit:!0,children:l.jsx("div",{className:h.repliesSection,children:l.jsx(q.CommentCardReplies,{replies:ce,hasMoreReplies:se?se.hasMoreReplies:T,moreRepliesCount:se?se.moreRepliesCount:S,isReplyOpen:ie,replyInput:ne,onShowMoreReplies:se?se.onShowMoreReplies:z})})})]})))}));exports.CommentCard=O;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("@babel/runtime/helpers/toConsumableArray"),o=require("react"),n=require("@material-ui/core"),i=require("classnames"),r=require("../FeedCard/FeedCard.js"),c=require("../AttachmentPreview/useStoredAttachments.js"),t=require("../FeedCard/useFeedActivity.js"),u=require("../AttachmentPreview/AttachmentPreview.js");require("../../componentsV2/FileIcon/FileIcon.js"),require("../../componentsV2/ButtonIcon/ButtonIcon.js"),require("@babel/runtime/helpers/objectWithoutProperties"),require("../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js"),require("../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js"),require("../../componentsV2/Text/Text.js"),require("../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js"),require("@babel/runtime/helpers/slicedToArray"),require("uuid");var a=require("react/jsx-runtime");require("../../componentsV2/Tooltip/Tooltip.scss.js");var l=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/DragOne.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/SearchOne.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/InfoRounded.js"),require("../../icons/customIcons/icons/FlameFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../../icons/customIcons/icons/Pad.js"),require("../../icons/customIcons/icons/DrilloutUnit.js"),require("../../icons/customIcons/icons/FracFleet.js"),require("../../icons/customIcons/icons/Global.js"),require("../../icons/customIcons/icons/Program.js"),require("../../icons/customIcons/icons/Rig.js"),require("../../icons/customIcons/icons/Well.js"),require("../../icons/customIcons/icons/Gap.js"),require("../../icons/customIcons/icons/Pin.js"),require("../../icons/customIcons/icons/PinOne.js"),require("../../icons/customIcons/icons/PinOneCrossed.js"),require("../../icons/customIcons/icons/CloseOneFilled.js"),require("../../icons/customIcons/icons/AttentionFilled.js"),require("../../icons/customIcons/icons/CheckOneFilled.js"),require("../../icons/customIcons/icons/Archive.js"),require("../../icons/customIcons/icons/ArchiveCancel.js"),require("../../icons/customIcons/icons/Unarchive.js"),require("../../icons/customIcons/icons/Archived.js"),require("../../icons/customIcons/icons/InterventionUnit.js"),require("../../icons/customIcons/icons/CloudDelete.js"),require("../../icons/customIcons/icons/Lasso.js"),require("../../icons/customIcons/icons/Radius.js"),require("../../icons/customIcons/icons/ErrorOps.js"),require("../../icons/customIcons/icons/DataTypeOps.js"),require("../../icons/customIcons/icons/FalsePositiveOps.js"),require("../../icons/customIcons/icons/CalibrationOps.js"),require("../../icons/customIcons/icons/CriticalOps.js"),require("../../icons/customIcons/icons/Company.js"),require("../../icons/customIcons/icons/ArchiveOne.js"),require("../../icons/customIcons/icons/ParseBotFusion.js"),require("../../icons/customIcons/icons/Connect.js"),require("../../icons/customIcons/icons/PuzzleOne.js"),require("../../icons/customIcons/icons/Feed.js"),require("../../icons/customIcons/icons/Prompt.js"),require("../../icons/customIcons/icons/Companies.js"),require("../../icons/customIcons/icons/ClipboardAi.js"),require("../../icons/customIcons/icons/Key.js"),require("../../icons/customIcons/icons/AtSignCrossed.js"),require("../../icons/customIcons/icons/MappingManual.js"),require("../../icons/customIcons/icons/Mapping.js"),require("../../icons/customIcons/icons/Metrics.js"),require("../../icons/customIcons/icons/Drops.js"),require("../../icons/customIcons/icons/ClipboardSearch.js"),require("../../icons/customIcons/icons/Template.js"),require("../../icons/customIcons/icons/ClipboardMetrics.js"),require("../../icons/customIcons/icons/ClipboardBuilder.js"),require("../../icons/customIcons/icons/UnitConversion.js"),require("../../icons/customIcons/icons/NPT.js"),require("../../icons/customIcons/icons/GuidedFrac.js"),require("../../componentsV2/Menu/Menu.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("../../clients/jsonApi/index.js"),require("../../utils/main.js"),require("../AttachmentPreview/AttachmentImage.js"),require("../AttachmentPreview/AttachmentPreview.scss.js"),require("file-extension"),require("image-extensions"),require("video-extensions");var m=require("../../componentsV2/Avatar/Avatar.js"),d=require("../CurveTooltip/CurveTooltip.js"),j=require("../LinkedText/LinkedText.js"),p=require("./CommentCardReactions.js"),q=require("./CommentCardReplies.js"),I=require("./CommentCard.scss.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=h(e),C=h(s),x=h(i);function b(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,n)}return o}function A(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?b(Object(o),!0).forEach((function(s){v.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var f=o.forwardRef((function(e,s){var i=e.activity,h=e.variant,v=void 0===h?"expanded":h,b=e.author,f=e.timestamp,y=e.subtitle,F=e.body,O=e.contextRows,P=e.attachment,g=e.storedAttachments,R=e.isLiked,D=e.likesCount,N=e.commentsCount,w=e.replies,M=e.hasMoreReplies,T=e.moreRepliesCount,k=e.attachments,E=e.onAttachmentClick,S=e.onAttachmentShare,L=e.attachmentSlot,_=e.chip,B=e.chipColor,G=e.chipValue,H=e.chipUnit,U=e.onLike,V=e.onReplyToggle,z=e.onForward,W=e.onShowMoreReplies,X=e.menuItems,K=e.isReplyOpen,Z=e.replyInput,J=e.editForm,Q=e.width,Y=e.onMouseEnter,$=e.onMouseLeave,ee=e.className,se=e.testId,oe=t.useFeedActivity(i,"comment"),ne=oe?[].concat(C.default(null!=X?X:[]),C.default(oe.menuItems)):X,ie=oe?oe.replyInput:Z,re=oe?oe.isReplyOpen:K,ce=oe?oe.replies:w,te=!(null==O||!O.length),ue=te&&!_,ae=!!(oe||U||V||z||null!=ne&&ne.length||ue),le=ue&&a.jsx(d.CurveTooltip,{data:{rows:null!=O?O:[]},children:a.jsx("span",{className:I.infoButton,"data-testid":"comment-card-info",children:a.jsx(l.InfoIcon,{size:12,strokeWidth:2})})}),me=a.jsx(p.CommentCardReactions,{info:le,commentsCount:oe?oe.commentsCount:N,likesCount:oe?oe.likesCount:D,isLiked:oe?oe.isLiked:R,menuItems:ne,onLike:oe?oe.onLike:U,onReplyToggle:oe?oe.onReplyToggle:V,onForward:z}),de=a.jsxs("div",{className:I.text,children:[_&&a.jsx(d.CurveTooltip,{data:te||null!=G?{title:_,value:G,unit:H,color:B,rows:null!=O?O:[]}:{rows:[]},children:a.jsxs("span",{className:x.default(I.chip,!!B&&I.chipAccented),style:B?{"--chip-color":B}:void 0,children:[B&&a.jsx("span",{className:I.chipDot}),_]})}),a.jsx(j.LinkedText,{children:F})]}),je=o.useMemo((function(){return null!=g?g:[P].filter(Boolean)}),[g,P]),pe=c.useStoredAttachments(je),qe=pe.length?pe:k,Ie=null!=qe&&qe.length?a.jsx(u.AttachmentPreview,{items:qe,onItemClick:E,onShare:S}):null,he={ref:s,width:Q,radius:12,onMouseEnter:Y,onMouseLeave:$,testId:se,className:ee};if(null!=oe&&oe.isDeleted)return null;var ve=function(e){return a.jsxs(a.Fragment,{children:[e,null==oe?void 0:oe.deleteDialog]})};if("preview"===v)return ve(a.jsxs(r.FeedCard,A(A({},he),{},{maxHeight:r.FEED_CARD_MAX_HEIGHT_PX,children:[a.jsxs("div",{className:I.compactBody,children:[a.jsxs("div",{className:I.compactTop,children:[a.jsx(m.Avatar,{size:24,name:b.name,imageSrc:b.avatarUrl,className:I.avatar}),a.jsx("span",{className:I.name,children:b.name}),a.jsx("span",{className:I.compactTime,children:f})]}),a.jsx("div",{className:I.scrollBody,children:de})]}),ae&&a.jsx("div",{className:I.compactFooter,children:me})]})));var Ce=!!J,xe=a.jsxs("div",{className:I.header,children:[a.jsx(m.Avatar,{size:24,name:b.name,imageSrc:b.avatarUrl,className:I.avatar}),a.jsxs("div",{className:I.headerText,children:[a.jsxs("div",{className:I.nameRow,children:[a.jsx("span",{className:I.name,children:b.name}),f&&a.jsx("span",{className:I.timestamp,children:f})]}),y&&a.jsx("span",{className:I.subtitle,children:y})]})]});return ve(Ce?a.jsxs(r.FeedCard,A(A({},he),{},{children:[a.jsx("div",{className:I.editHeader,children:xe}),J]})):a.jsxs(r.FeedCard,A(A({},he),{},{children:[a.jsxs("div",{className:I.capped,style:{maxHeight:r.FEED_CARD_MAX_HEIGHT_PX},children:[a.jsxs("div",{className:I.bodySurface,children:[xe,a.jsxs("div",{className:I.scrollBody,children:[de,(Ie||L)&&a.jsxs("div",{className:I.attachment,children:[Ie,L]})]})]}),ae&&a.jsx("div",{className:I.footer,children:me})]}),ae&&a.jsx(n.Collapse,{in:re,timeout:250,unmountOnExit:!0,children:a.jsx("div",{className:I.repliesSection,children:a.jsx(q.CommentCardReplies,{replies:ce,hasMoreReplies:oe?oe.hasMoreReplies:M,moreRepliesCount:oe?oe.moreRepliesCount:T,isReplyOpen:re,replyInput:ie,onShowMoreReplies:oe?oe.onShowMoreReplies:W})})})]})))}));exports.CommentCard=f;
|
|
2
2
|
//# sourceMappingURL=CommentCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.js","sources":["../../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps, CommentContextRow } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nconst MetadataTooltip = ({ rows }: { rows: CommentContextRow[] }) => (\n <div className={styles.metadataRows}>\n {rows.map(({ label, value, unit }) => (\n <div key={label} className={styles.metadataRow}>\n <span className={styles.metadataLabel}>{label}</span>\n <span className={styles.metadataValue}>{value}</span>\n {unit && <span className={styles.metadataUnit}>{unit}</span>}\n </div>\n ))}\n </div>\n);\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={<MetadataTooltip rows={contextRows} />}\n >\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </Tooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={hasMetadata ? <MetadataTooltip rows={contextRows} /> : ''}\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </Tooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["MetadataTooltip","_ref","rows","_jsx","className","styles","metadataRows","children","map","_ref2","label","value","unit","_jsxs","metadataRow","jsx","metadataLabel","metadataValue","metadataUnit","CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","Tooltip","placement","metadataTooltip","title","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","jsxs","text","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"29LAoBA,IAAMA,EAAkB,SAAHC,GAAA,IAAMC,IAAAA,KAAI,OAC7BC,EAAAA,IAAA,MAAA,CAAKC,UAAWC,EAAOC,aAAaC,SACjCL,EAAKM,KAAI,SAAAC,GAAA,IAAGC,IAAAA,MAAOC,IAAAA,MAAOC,IAAAA,KAAI,OAC7BC,EAAAA,KAAA,MAAA,CAAiBT,UAAWC,EAAOS,YAAYP,SAC7C,CAAAJ,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOW,cAAcT,SAAEG,IACxCP,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOY,cAAcV,SAAEI,IACvCC,GAAQT,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOa,aAAaX,SAAEK,MAHxCF,OAMR,EAGKS,EAAcC,EAAUA,YAAmC,SAACC,EAAOC,GAC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,WAAYS,GACZZ,kBACES,GAAkBA,GAAgBT,kBAAoBA,YAQtE"}
|
|
1
|
+
{"version":3,"file":"CommentCard.js","sources":["../../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { CurveTooltip } from '../CurveTooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n chipValue,\n chipUnit,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <CurveTooltip data={{ rows: contextRows ?? [] }}>\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </CurveTooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <CurveTooltip\n data={\n hasMetadata || chipValue != null\n ? {\n title: chip,\n value: chipValue,\n unit: chipUnit,\n color: chipColor,\n rows: contextRows ?? [],\n }\n : { rows: [] }\n }\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </CurveTooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","chipValue","chipUnit","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","className","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","_jsx","CurveTooltip","data","rows","children","jsx","styles","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","_jsxs","jsxs","text","title","value","unit","color","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"s+MAoBO,IAAMA,EAAcC,EAAUA,YAAmC,SAACC,EAAOC,GAC9E,IACEC,EAoCEF,EApCFE,SAAQC,EAoCNH,EAnCFI,QAAAA,aAAU,WAAUD,EACpBE,EAkCEL,EAlCFK,OACAC,EAiCEN,EAjCFM,UACAC,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-1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentCard_capped__izWBZ{flex-direction:column}.CommentCard_bodySurface__scobR,.CommentCard_capped__izWBZ{overflow-clip-margin:12px;display:flex;overflow:hidden;overflow:clip}.CommentCard_bodySurface__scobR{flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;padding:8px 12px}.CommentCard_editHeader__8aUBt{padding:8px 12px 0}.CommentCard_scrollBody__CIun9{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;margin:0 -24px;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 24px}.CommentCard_footer__z3-CY{border-top:1px solid var(--palette-background-b-4);display:flex;flex-direction:column;flex-shrink:0;padding:4px 12px 8px}.CommentCard_repliesSection__iE7QO{padding:8px 12px 12px}.CommentCard_compactBody__zM10O{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow:hidden;padding:8px 12px}.CommentCard_compactTop__LpiQi{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_compactTime__JzVQR{color:var(--palette-primary-text-7);font-size:12px;line-height:16px;margin-left:auto;white-space:nowrap}.CommentCard_compactFooter__rgB4D{border-top:1px solid var(--palette-background-b-4);flex-shrink:0;padding:4px 12px 8px}.CommentCard_header__T1SH8{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_headerText__DRsQG{display:flex;flex:1 0 0;flex-direction:column;min-width:0;word-break:break-word}.CommentCard_nameRow__Or1c0{align-items:center;display:flex;gap:8px;width:100%}.CommentCard_nameRow__Or1c0 .CommentCard_timestamp__EbJCO{margin-left:auto}.CommentCard_subtitle__d-XRe{color:var(--palette-primary-main);font-size:12px;line-height:16px}.CommentCard_avatar__NA2ZA{flex-shrink:0}.CommentCard_name__9-e7A{color:var(--palette-primary-text-1);flex:0 1 auto;font-size:14px;line-height:20px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CommentCard_timestamp__EbJCO{color:var(--palette-primary-text-7);flex-shrink:0;font-size:12px;line-height:16px;white-space:nowrap}.CommentCard_chip__4NUrf{align-items:center;background:rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;box-sizing:border-box;color:var(--palette-primary-text-1);cursor:pointer;display:flex;float:right;font-size:12px;gap:4px;height:24px;line-height:16px;margin:4px 0 0 8px;padding:6px;white-space:nowrap}.CommentCard_chipAccented__Xl8ek{background:linear-gradient(94deg,rgb(from var(--chip-color) r g b/.16) 1%,transparent 35%),rgb(from var(--palette-primary-text-1) r g b/.04);border:.5px solid rgb(from var(--chip-color) r g b/.5)}.CommentCard_chipDot__P-usA{background:var(--chip-color);border-radius:50%;flex-shrink:0;height:6px;width:6px}.CommentCard_text__eAIZM{color:var(--palette-primary-text-1);font-size:12px;line-height:16px;white-space:pre-wrap;word-break:break-word}.CommentCard_text__eAIZM a,.CommentCard_text__eAIZM button{font:inherit;padding:0;vertical-align:baseline}.CommentCard_attachment__KktIn{--attachment-arrow-outset:12px;display:flex;flex-direction:column;gap:8px}.CommentCard_infoButton__gqcvK{align-items:center;color:var(--palette-primary-text-6);cursor:default;display:inline-flex}.CommentCard_infoButton__gqcvK:hover{color:var(--palette-primary-text-1)}.
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentCard_capped__izWBZ{flex-direction:column}.CommentCard_bodySurface__scobR,.CommentCard_capped__izWBZ{overflow-clip-margin:12px;display:flex;overflow:hidden;overflow:clip}.CommentCard_bodySurface__scobR{flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;padding:8px 12px}.CommentCard_editHeader__8aUBt{padding:8px 12px 0}.CommentCard_scrollBody__CIun9{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;margin:0 -24px;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 24px}.CommentCard_footer__z3-CY{border-top:1px solid var(--palette-background-b-4);display:flex;flex-direction:column;flex-shrink:0;padding:4px 12px 8px}.CommentCard_repliesSection__iE7QO{padding:8px 12px 12px}.CommentCard_compactBody__zM10O{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow:hidden;padding:8px 12px}.CommentCard_compactTop__LpiQi{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_compactTime__JzVQR{color:var(--palette-primary-text-7);font-size:12px;line-height:16px;margin-left:auto;white-space:nowrap}.CommentCard_compactFooter__rgB4D{border-top:1px solid var(--palette-background-b-4);flex-shrink:0;padding:4px 12px 8px}.CommentCard_header__T1SH8{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_headerText__DRsQG{display:flex;flex:1 0 0;flex-direction:column;min-width:0;word-break:break-word}.CommentCard_nameRow__Or1c0{align-items:center;display:flex;gap:8px;width:100%}.CommentCard_nameRow__Or1c0 .CommentCard_timestamp__EbJCO{margin-left:auto}.CommentCard_subtitle__d-XRe{color:var(--palette-primary-main);font-size:12px;line-height:16px}.CommentCard_avatar__NA2ZA{flex-shrink:0}.CommentCard_name__9-e7A{color:var(--palette-primary-text-1);flex:0 1 auto;font-size:14px;line-height:20px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CommentCard_timestamp__EbJCO{color:var(--palette-primary-text-7);flex-shrink:0;font-size:12px;line-height:16px;white-space:nowrap}.CommentCard_chip__4NUrf{align-items:center;background:rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;box-sizing:border-box;color:var(--palette-primary-text-1);cursor:pointer;display:flex;float:right;font-size:12px;gap:4px;height:24px;line-height:16px;margin:4px 0 0 8px;padding:6px;white-space:nowrap}.CommentCard_chipAccented__Xl8ek{background:linear-gradient(94deg,rgb(from var(--chip-color) r g b/.16) 1%,transparent 35%),rgb(from var(--palette-primary-text-1) r g b/.04);border:.5px solid rgb(from var(--chip-color) r g b/.5)}.CommentCard_chipDot__P-usA{background:var(--chip-color);border-radius:50%;flex-shrink:0;height:6px;width:6px}.CommentCard_text__eAIZM{color:var(--palette-primary-text-1);font-size:12px;line-height:16px;white-space:pre-wrap;word-break:break-word}.CommentCard_text__eAIZM a,.CommentCard_text__eAIZM button{font:inherit;padding:0;vertical-align:baseline}.CommentCard_attachment__KktIn{--attachment-arrow-outset:12px;display:flex;flex-direction:column;gap:8px}.CommentCard_infoButton__gqcvK{align-items:center;color:var(--palette-primary-text-6);cursor:default;display:inline-flex}.CommentCard_infoButton__gqcvK:hover{color:var(--palette-primary-text-1)}.CommentCard_contextLine__Jyoui{align-items:center;color:var(--palette-primary-text-7);column-gap:16px;display:flex;flex-wrap:wrap;font-size:12px;line-height:16px;row-gap:4px}.CommentCard_contextItem__2Xmql{white-space:nowrap}.CommentCard_actionsRow__1Ftxn{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentCard_actions__mUmsV{align-items:center;display:flex;gap:8px}.CommentCard_trailingActions__uGt-3{align-items:center;display:flex;gap:4px}.CommentCard_action__ZfyBP{align-items:center;display:flex;gap:2px}.CommentCard_count__stfpY{color:var(--palette-primary-text-6);font-size:12px;line-height:16px}.CommentCard_liked__zsBqe svg{color:var(--palette-primary-main)}.CommentCard_replies__nRRYo{display:flex;flex-direction:column;gap:8px}.CommentCard_reply__7-U7Q{display:flex;flex-direction:column;gap:4px}.CommentCard_replyHeader__sWnLA{align-items:center;display:flex;gap:8px}.CommentCard_replyNameRow__bs7h2{align-items:center;display:flex;flex:1 0 0;gap:12px;min-width:0}.CommentCard_replyName__C8tst{color:var(--palette-primary-text-1);font-size:14px;line-height:20px;white-space:nowrap}.CommentCard_replyTimestamp__YzuW1{color:var(--palette-primary-text-7);flex:1 0 0;font-size:12px;line-height:16px;min-width:0}.CommentCard_replyText__8JPKK{color:var(--palette-primary-text-1);font-size:12px;line-height:16px;padding-left:40px;white-space:pre-wrap;word-break:break-word}.CommentCard_replyText__8JPKK a,.CommentCard_replyText__8JPKK button{font:inherit;padding:0;vertical-align:baseline}"),module.exports={spacing:"8",capped:"CommentCard_capped__izWBZ",bodySurface:"CommentCard_bodySurface__scobR",editHeader:"CommentCard_editHeader__8aUBt",scrollBody:"CommentCard_scrollBody__CIun9",footer:"CommentCard_footer__z3-CY",repliesSection:"CommentCard_repliesSection__iE7QO",compactBody:"CommentCard_compactBody__zM10O",compactTop:"CommentCard_compactTop__LpiQi",compactTime:"CommentCard_compactTime__JzVQR",compactFooter:"CommentCard_compactFooter__rgB4D",header:"CommentCard_header__T1SH8",headerText:"CommentCard_headerText__DRsQG",nameRow:"CommentCard_nameRow__Or1c0",timestamp:"CommentCard_timestamp__EbJCO",subtitle:"CommentCard_subtitle__d-XRe",avatar:"CommentCard_avatar__NA2ZA",name:"CommentCard_name__9-e7A",chip:"CommentCard_chip__4NUrf",chipAccented:"CommentCard_chipAccented__Xl8ek",chipDot:"CommentCard_chipDot__P-usA",text:"CommentCard_text__eAIZM",attachment:"CommentCard_attachment__KktIn",infoButton:"CommentCard_infoButton__gqcvK",contextLine:"CommentCard_contextLine__Jyoui",contextItem:"CommentCard_contextItem__2Xmql",actionsRow:"CommentCard_actionsRow__1Ftxn",actions:"CommentCard_actions__mUmsV",trailingActions:"CommentCard_trailingActions__uGt-3",action:"CommentCard_action__ZfyBP",count:"CommentCard_count__stfpY",liked:"CommentCard_liked__zsBqe",replies:"CommentCard_replies__nRRYo",reply:"CommentCard_reply__7-U7Q",replyHeader:"CommentCard_replyHeader__sWnLA",replyNameRow:"CommentCard_replyNameRow__bs7h2",replyName:"CommentCard_replyName__C8tst",replyTimestamp:"CommentCard_replyTimestamp__YzuW1",replyText:"CommentCard_replyText__8JPKK"};
|
|
2
2
|
//# sourceMappingURL=CommentCard.scss.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../componentsV2/Text/Text.js"),l=require("../Tooltip/Tooltip.js"),t=require("./CurveTooltip.scss.js"),r=require("react/jsx-runtime"),s={popperOptions:{modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}}}},i={popper:t.popper,tooltip:t.tooltip};exports.CurveTooltip=function(o){var n=o.data,a=o.children,c=o.open,p=o.isFullScreen,u=o.placement,d=void 0===u?"top":u;return null!=n.title||n.rows.length?r.jsx(l.Tooltip,{open:c,isFullScreen:p,placement:d,PopperProps:s,classes:i,title:r.jsxs("div",{className:t.content,"data-testid":"curveTooltip",children:[null!=n.title&&r.jsxs(e.Text,{size:12,tagName:"div",className:t.title,children:[r.jsx("span",{className:t.titleBar,style:{backgroundColor:n.color}}),r.jsxs("span",{children:[n.title,null!=n.value&&r.jsxs(r.Fragment,{children:[": ",n.value]})]}),null!=n.unit&&r.jsx(e.Text,{size:12,color:"T6",children:n.unit})]}),n.rows.map((function(l){return r.jsxs("div",{className:t.row,children:[r.jsx(e.Text,{size:14,color:"T6",children:l.label}),r.jsx(e.Text,{size:14,color:"T1",children:l.value}),null!=l.unit&&r.jsx(e.Text,{size:12,color:"T6",className:t.rowUnit,children:l.unit})]},l.label)}))]}),children:a}):a};
|
|
2
|
+
//# sourceMappingURL=CurveTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveTooltip.js","sources":["../../../../src/components/CurveTooltip/CurveTooltip.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\n\nimport { Text } from '../../componentsV2/Text';\nimport { Tooltip, TooltipProps } from '../Tooltip/Tooltip';\n\nimport styles from './CurveTooltip.scss';\n\nexport type CurveTooltipRow = {\n label: string;\n value: ReactNode;\n unit?: ReactNode;\n};\n\nexport type CurveTooltipData = {\n title?: ReactNode;\n value?: ReactNode;\n unit?: ReactNode;\n color?: string;\n rows: CurveTooltipRow[];\n};\n\ntype Props = {\n data: CurveTooltipData;\n children: ReactElement;\n open?: boolean;\n isFullScreen?: boolean;\n placement?: TooltipProps['placement'];\n};\n\nconst POPPER_PROPS = {\n popperOptions: {\n modifiers: { preventOverflow: { enabled: true, boundariesElement: 'viewport' } },\n },\n};\n\nconst TOOLTIP_CLASSES = { popper: styles.popper, tooltip: styles.tooltip };\n\nexport const CurveTooltip = ({ data, children, open, isFullScreen, placement = 'top' }: Props) => {\n if (data.title == null && !data.rows.length) return children;\n\n return (\n <Tooltip\n open={open}\n isFullScreen={isFullScreen}\n placement={placement}\n PopperProps={POPPER_PROPS}\n classes={TOOLTIP_CLASSES}\n title={\n <div className={styles.content} data-testid=\"curveTooltip\">\n {data.title != null && (\n <Text size={12} tagName=\"div\" className={styles.title}>\n <span className={styles.titleBar} style={{ backgroundColor: data.color }} />\n <span>\n {data.title}\n {data.value != null && <>: {data.value}</>}\n </span>\n {data.unit != null && (\n <Text size={12} color=\"T6\">\n {data.unit}\n </Text>\n )}\n </Text>\n )}\n {data.rows.map(row => (\n <div key={row.label} className={styles.row}>\n <Text size={14} color=\"T6\">\n {row.label}\n </Text>\n <Text size={14} color=\"T1\">\n {row.value}\n </Text>\n {row.unit != null && (\n <Text size={12} color=\"T6\" className={styles.rowUnit}>\n {row.unit}\n </Text>\n )}\n </div>\n ))}\n </div>\n }\n >\n {children}\n </Tooltip>\n );\n};\n"],"names":["POPPER_PROPS","popperOptions","modifiers","preventOverflow","enabled","boundariesElement","TOOLTIP_CLASSES","popper","styles","tooltip","_ref","data","children","open","isFullScreen","_ref$placement","placement","title","rows","length","_jsx","Tooltip","PopperProps","classes","_jsxs","jsxs","className","content","Text","size","tagName","jsx","titleBar","style","backgroundColor","color","value","_Fragment","unit","map","row","label","rowUnit"],"mappings":"2NA6BMA,EAAe,CACnBC,cAAe,CACbC,UAAW,CAAEC,gBAAiB,CAAEC,SAAS,EAAMC,kBAAmB,eAIhEC,EAAkB,CAAEC,OAAQC,EAAOD,OAAQE,QAASD,EAAOC,8BAErC,SAAsEC,GAAA,IAAnEC,IAAAA,KAAMC,IAAAA,SAAUC,IAAAA,KAAMC,IAAAA,aAAYC,EAAAL,EAAEM,UAAAA,aAAY,MAAKD,EAClF,OAAkB,MAAdJ,EAAKM,OAAkBN,EAAKO,KAAKC,OAGnCC,EAAAA,IAACC,EAAAA,QAAO,CACNR,KAAMA,EACNC,aAAcA,EACdE,UAAWA,EACXM,YAAatB,EACbuB,QAASjB,EACTW,MACEO,EAAAC,KAAA,MAAA,CAAKC,UAAWlB,EAAOmB,QAAS,cAAY,eAAcf,SAAA,CACzC,MAAdD,EAAKM,OACJO,EAAAA,KAACI,EAAAA,KAAI,CAACC,KAAM,GAAIC,QAAQ,MAAMJ,UAAWlB,EAAOS,MAAML,SACpD,CAAAQ,EAAAW,IAAA,OAAA,CAAML,UAAWlB,EAAOwB,SAAUC,MAAO,CAAEC,gBAAiBvB,EAAKwB,SACjEX,EAAAC,KAAA,OAAA,CAAAb,SACGD,CAAAA,EAAKM,MACS,MAAdN,EAAKyB,OAAiBZ,EAAAC,KAAAY,WAAA,CAAAzB,SAAKD,CAAAA,KAAAA,EAAKyB,YAErB,MAAbzB,EAAK2B,MACJlB,EAAAA,IAACQ,EAAAA,KAAI,CAACC,KAAM,GAAIM,MAAM,KAAIvB,SACvBD,EAAK2B,UAKb3B,EAAKO,KAAKqB,KAAI,SAAAC,GAAG,OAChBhB,EAAAA,KAAA,MAAA,CAAqBE,UAAWlB,EAAOgC,IAAI5B,SAAA,CACzCQ,MAACQ,OAAI,CAACC,KAAM,GAAIM,MAAM,KAAIvB,SACvB4B,EAAIC,QAEPrB,MAACQ,OAAI,CAACC,KAAM,GAAIM,MAAM,KAAIvB,SACvB4B,EAAIJ,QAEM,MAAZI,EAAIF,MACHlB,EAAAA,IAACQ,EAAAA,KAAI,CAACC,KAAM,GAAIM,MAAM,KAAKT,UAAWlB,EAAOkC,QAAQ9B,SAClD4B,EAAIF,SATDE,EAAIC,MAYR,OAGX7B,SAEAA,IA3C+CA,CA8CtD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C{background:rgb(from var(--palette-background-b-9) r g b/.9);max-width:none}.CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C.MuiTooltip-tooltipPlacementBottom{margin-top:4px}.CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C.MuiTooltip-tooltipPlacementTop{margin-bottom:4px}.CurveTooltip_content__OY7AI{display:flex;flex-direction:column;gap:4px;padding:4px 0;white-space:nowrap}.CurveTooltip_title__dzymJ{align-items:center;display:flex;gap:4px;margin-bottom:4px}.CurveTooltip_titleBar__XcI5e{background:var(--palette-primary-text-6);border-radius:1px;flex-shrink:0;height:14px;width:2px}.CurveTooltip_row__2zHX2{align-items:baseline;display:flex;gap:4px}.CurveTooltip_row__2zHX2 .CurveTooltip_rowUnit__MCGr4{line-height:18px}"),module.exports={spacing:"8",popper:"CurveTooltip_popper__inKjq",tooltip:"CurveTooltip_tooltip__8f67C",content:"CurveTooltip_content__OY7AI",title:"CurveTooltip_title__dzymJ",titleBar:"CurveTooltip_titleBar__XcI5e",row:"CurveTooltip_row__2zHX2",rowUnit:"CurveTooltip_rowUnit__MCGr4"};
|
|
2
|
+
//# sourceMappingURL=CurveTooltip.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,qBAAqB,sDAAyD;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/defineProperty"),n=require("react"),o=require("lodash"),a=require("../../LoadingIndicator/LoadingIndicator.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/defineProperty"),n=require("react"),o=require("lodash"),a=require("../../LoadingIndicator/LoadingIndicator.js"),i=require("./IsolatedPage.module.css.js"),u=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,l=c(e),p=c(r),f=c(t);function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function v(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){f.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var b=/(^|[\^~>=\s])18\./,y=function(e){var r,t,n=null==e?void 0:e.package;if(!n)return!0;var o=null===(r=n.package_json)||void 0===r||null===(t=r.dependencies)||void 0===t?void 0:t.react;return!("string"==typeof o&&b.test(o))},O=(s={},f.default(s,"data-corva-app-iframe",!0),f.default(s,"data-testid","isolatedAppContainer"),s);exports.APP_IFRAME_ATTRIBUTE="data-corva-app-iframe",exports.IsolatedPage=function(e){var r,t,c=p.default({},e),s=n.useRef(null),f=n.useRef(null),d=n.useState(!0),b=l.default(d,2),g=b[0],P=b[1],j=n.useCallback((function(){P(!1)}),[]),x=function(e,r){if(e){var t=!e.xprops,n=!function(e,r){if(e===r)return!0;if(!e)return!1;var t,n,a=Object.keys(e),i=Object.keys(r);if(a.length!==i.length)return!1;for(var u=0,c=i;u<c.length;u++){var s=c[u];if(!Object.prototype.hasOwnProperty.call(e,s))return!1;if(!((t=e[s])===(n=r[s])||"function"==typeof t&&"function"==typeof n||o.isEqual(t,n)))return!1}return!0}(f.current||{},r);if(e.xprops=v({},r),f.current=r,(t||n)&&e.xpropsOnProps)try{e.xpropsOnProps(r)}catch(e){console.debug("[IsolatedPage] xpropsOnProps was not set yet:",e)}}};return n.useEffect((function(){try{var e,r=null===(e=s.current)||void 0===e?void 0:e.contentWindow;x(r,c)}catch(e){console.error("[IsolatedPage] Error accessing iframe contentWindow:",e)}})),n.useLayoutEffect((function(){return function(){try{var e,r,t=null===(e=s.current)||void 0===e?void 0:e.contentWindow;null==t||null===(r=t.xpropsOnUnmount)||void 0===r||r.call(t),t&&t.xprops&&delete t.xprops}catch(e){console.error("[IsolatedPage] Error cleaning up xprops:",e)}f.current=null,s.current=null}}),[]),u.jsxs("div",{className:i.container,children:[g&&u.jsx(a,{}),u.jsx("iframe",v({ref:s,src:(r=c.app,t=window.__DC_REACT17_ISOLATED_PAGE_PATH__,t&&y(r)?t:"/DevCenterIsolatedAppPage.html"),onLoad:j,className:i.iframe},O))]})},exports.isReact17App=y;
|
|
2
2
|
//# sourceMappingURL=IsolatedPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsolatedPage.js","sources":["../../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"sourcesContent":["// Ultra-minimal, same-origin isolation helper. Used to isolate DC apps from the parent page.\n//\n// Usage:\n// <IsolatedPage currentUser={user} onSettingsChange={fn} isFeatEnabled={false} />\n//\n// Inside isolated page:\n// window.xpropsOnProps = (props) => { /* handle updates */ };\n// window.xprops.onSettingsChange(payload);\n//\n// Notes:\n// - Path is hardcoded to `/DevCenterIsolatedAppPage.html`.\n// - Client sets `window.xpropsOnProps` function directly (separate from xprops data).\n// - `IsolatedPage` calls `window.xpropsOnProps` when props change (if it exists).\n// - On unmount: xprops deleted, iframe set to about:blank.\n// - Uses a callback-identity-aware deep equality check (see `areXPropsEqual` below) to avoid\n// unnecessary `xpropsOnProps` fires.\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { isEqual } from 'lodash';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport styles from './IsolatedPage.module.css';\n\n// Callbacks arrive with a new identity every parent render, so comparing them would fire\n// `xpropsOnProps` into the iframe on every benign re-render. They are safe to treat as equal\n// because the iframe always reads the latest function from `window.xprops`, which `publishProps`\n// replaces unconditionally and `useXProps` dereferences at call time.\nconst isXPropEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n if (typeof a === 'function' && typeof b === 'function') return true;\n return isEqual(a, b);\n};\n\nconst areXPropsEqual = (\n prev: Record<string, unknown> | null,\n next: Record<string, unknown>\n): boolean => {\n if (prev === next) return true;\n if (!prev) return false;\n const prevKeys = Object.keys(prev);\n const nextKeys = Object.keys(next);\n if (prevKeys.length !== nextKeys.length) return false;\n for (const key of nextKeys) {\n if (!Object.prototype.hasOwnProperty.call(prev, key)) return false;\n if (!isXPropEqual(prev[key], next[key])) return false;\n }\n return true;\n};\n\nconst ISOLATED_PAGE_PATH = '/DevCenterIsolatedAppPage.html';\n\n// [REACT-18-MIGRATION-TAG] Per-app React version (PLT-3099): under a React-18 host an isolated app\n// must run in a React-17 iframe realm unless it is known to be React-18-ready. Legacy builds carry\n// no `package.package_json.dependencies.react` at all (the field predates the migration and is\n// absent even in the packages API), so React-17-ness cannot be positively detected — everything\n// before the migration is React 17. Therefore treat \"does not explicitly declare React 18\" as\n// React 17 and route it to `/r17/`; only an explicit React-18 declaration (present on new builds,\n// filled in by the host's package_json enrichment) keeps the app on the default React-18 iframe.\n// The host opts in by setting `window.__DC_REACT17_ISOLATED_PAGE_PATH__` to a SAME-ORIGIN path that\n// serves a React-17 build of the iframe entry (same-origin is required — the xprops bridge below\n// uses direct `contentWindow.xprops`, which the browser blocks cross-origin). Remove once all apps\n// are on React 18.\nconst REACT_18_DECLARATION_REGEX = /(^|[\\^~>=\\s])18\\./;\n\nexport const isReact17App = (app: unknown): boolean => {\n const pkg = (app as { package?: { package_json?: { dependencies?: Record<string, string> } } })\n ?.package;\n // No package at all = a legacy build with no React-18 declaration → route to /r17/. A React-18\n // app always carries a package_json declaring react 18 (host package_json enrichment), so a\n // missing package can never be a detectable React-18 app; default unknown/legacy to React 17.\n if (!pkg) return true;\n\n const declared = pkg.package_json?.dependencies?.react;\n return !(typeof declared === 'string' && REACT_18_DECLARATION_REGEX.test(declared));\n};\n\nconst getIsolatedPagePath = (app: unknown): string => {\n const react17Path = (window as any).__DC_REACT17_ISOLATED_PAGE_PATH__;\n if (react17Path && isReact17App(app)) return react17Path;\n return ISOLATED_PAGE_PATH;\n};\n\nexport const APP_IFRAME_ATTRIBUTE = 'data-corva-app-iframe';\n\nconst IFRAME_ATTRIBUTES = {\n [APP_IFRAME_ATTRIBUTE]: true,\n 'data-testid': 'isolatedAppContainer',\n} as Record<string, boolean | string>;\n\nexport type IsolatedPageProps = {\n [key: string]: any; // forwarded as xprops\n};\n\ndeclare global {\n interface Window {\n xprops?: Record<string, any>;\n xpropsOnProps?: (props: any) => void;\n }\n}\n\nexport function IsolatedPage({ ...restProps }: IsolatedPageProps) {\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const lastPropsSnapshotRef = useRef<Record<string, any> | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const handleIframeLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n /**\n * Inject or update props into iframe window.xprops.\n * Calls window.xpropsOnProps callback only if props changed (deep check).\n */\n const publishProps = (\n targetWindow: (Window & { xprops?: any; xpropsOnProps?: (props: any) => void }) | null,\n newProps: Record<string, any>\n ) => {\n if (!targetWindow) return;\n\n const isInitialSet = !targetWindow.xprops;\n const previousSnapshot = lastPropsSnapshotRef.current || {};\n const propsChanged = !areXPropsEqual(previousSnapshot, newProps);\n\n // Unconditional, and outside the fire check below: suppressing the iframe re-render must not\n // leave stale callbacks on the object the DC app dereferences on every user action.\n targetWindow.xprops = { ...newProps };\n lastPropsSnapshotRef.current = newProps;\n\n // Call xpropsOnProps callback if it exists (on initial set or when props changed)\n if ((isInitialSet || propsChanged) && targetWindow.xpropsOnProps) {\n try {\n targetWindow.xpropsOnProps(newProps);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.debug('[IsolatedPage] xpropsOnProps was not set yet:', error);\n }\n }\n };\n\n // Try to set/update xprops whenever props change (including initial mount)\n useEffect(() => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnProps?: (props: any) => void })\n | null;\n publishProps(win, restProps);\n } catch (error) {\n // contentWindow might not be accessible yet, will retry on next prop change\n console.error('[IsolatedPage] Error accessing iframe contentWindow:', error);\n }\n });\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n try {\n const win = iframeRef.current?.contentWindow as (Window & { xprops?: any }) | null;\n if (win && win.xprops) delete (win as any).xprops;\n } catch (error) {\n console.error('[IsolatedPage] Error cleaning up xprops:', error);\n }\n lastPropsSnapshotRef.current = null;\n const iframeElement = iframeRef.current;\n if (iframeElement) {\n try {\n iframeElement.src = 'about:blank';\n } catch (error) {\n console.error('[IsolatedPage] Error setting iframe src to about:blank:', error);\n }\n }\n iframeRef.current = null;\n };\n }, []);\n\n return (\n <div className={styles.container}>\n {isLoading && <LoadingIndicator />}\n <iframe\n ref={iframeRef}\n src={getIsolatedPagePath(restProps.app)}\n onLoad={handleIframeLoad}\n className={styles.iframe}\n {...IFRAME_ATTRIBUTES}\n />\n </div>\n );\n}\n"],"names":["REACT_18_DECLARATION_REGEX","isReact17App","app","_pkg$package_json","_pkg$package_json$dep","pkg","package","declared","package_json","dependencies","react","test","IFRAME_ATTRIBUTES","_defineProperty","_IFRAME_ATTRIBUTES","_ref","react17Path","restProps","_extends","iframeRef","useRef","lastPropsSnapshotRef","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","handleIframeLoad","useCallback","publishProps","targetWindow","newProps","isInitialSet","xprops","propsChanged","prev","next","a","b","prevKeys","Object","keys","nextKeys","length","_i","_nextKeys","key","prototype","hasOwnProperty","call","isEqual","areXPropsEqual","current","xpropsOnProps","error","console","debug","useEffect","_iframeRef$current","win","contentWindow","_iframeRef$current2","iframeElement","src","_jsxs","className","styles","container","children","_jsx","LoadingIndicator","_objectSpread","ref","window","__DC_REACT17_ISOLATED_PAGE_PATH__","onLoad","iframe"],"mappings":"2iCA0BA,IAmCMA,EAA6B,oBAEtBC,EAAe,SAACC,GAA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,GAJAD,EAAaG,OAAcF,EAAAA,CAAAA,EAAAA,GAC3BX,EAAqBgC,QAAUrB,GAG1BC,GAAgBE,IAAiBJ,EAAauB,cACjD,IACEvB,EAAauB,cAActB,EAI7B,CAHE,MAAOuB,GAEPC,QAAQC,MAAM,gDAAiDF,EACjE,CAlBiB,GAyDrB,OAlCAG,EAAAA,WAAU,WACR,IAAI,IAAAC,EACIC,EAAuB,QAAjBzC,EAAAA,EAAUkC,eAAO,IAAAM,OAAA,EAAjBA,EAAmBE,cAG/B/B,EAAa8B,EAAK3C,EAIpB,CAHE,MAAOsC,GAEPC,QAAQD,MAAM,uDAAwDA,EACxE,CACF,IAGAG,EAAAA,WAAU,WACR,OAAO,WACL,IAAI,IAAAI,EACIF,EAAuB,QAAjBzC,EAAAA,EAAUkC,eAAO,IAAAS,OAAA,EAAjBA,EAAmBD,cAC3BD,GAAOA,EAAI1B,eAAgB0B,EAAY1B,MAG7C,CAFE,MAAOqB,GACPC,QAAQD,MAAM,2CAA4CA,EAC5D,CACAlC,EAAqBgC,QAAU,KAC/B,IAAMU,EAAgB5C,EAAUkC,QAChC,GAAIU,EACF,IACEA,EAAcC,IAAM,aAGtB,CAFE,MAAOT,GACPC,QAAQD,MAAM,0DAA2DA,EAC3E,CAEFpC,EAAUkC,QAAU,KAEvB,GAAE,IAGDY,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,UAAUC,SAAA,CAC9B3C,GAAa4C,MAACC,MACfD,EAAAA,IAAA,SAAAE,EAAA,CACEC,IAAKtD,EACL6C,KAvGqB9D,EAuGIe,EAAUf,IAtGnCc,EAAe0D,OAAeC,kCAChC3D,GAAef,EAAaC,GAAac,EA7BpB,kCAmInB4D,OAAQhD,EACRsC,UAAWC,EAAOU,QACdjE,MAIZ"}
|
|
1
|
+
{"version":3,"file":"IsolatedPage.js","sources":["../../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"sourcesContent":["// Ultra-minimal, same-origin isolation helper. Used to isolate DC apps from the parent page.\n//\n// Usage:\n// <IsolatedPage currentUser={user} onSettingsChange={fn} isFeatEnabled={false} />\n//\n// Inside isolated page:\n// window.xpropsOnProps = (props) => { /* handle updates */ };\n// window.xprops.onSettingsChange(payload);\n//\n// Notes:\n// - Path is hardcoded to `/DevCenterIsolatedAppPage.html`.\n// - Client sets `window.xpropsOnProps` function directly (separate from xprops data).\n// - `IsolatedPage` calls `window.xpropsOnProps` when props change (if it exists).\n// - Client sets `window.xpropsOnUnmount` to unmount its React root; `IsolatedPage` calls it\n// while the iframe is still in the document, then deletes xprops.\n// - Uses a callback-identity-aware deep equality check (see `areXPropsEqual` below) to avoid\n// unnecessary `xpropsOnProps` fires.\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { isEqual } from 'lodash';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport styles from './IsolatedPage.module.css';\n\n// Callbacks arrive with a new identity every parent render, so comparing them would fire\n// `xpropsOnProps` into the iframe on every benign re-render. They are safe to treat as equal\n// because the iframe always reads the latest function from `window.xprops`, which `publishProps`\n// replaces unconditionally and `useXProps` dereferences at call time.\nconst isXPropEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n if (typeof a === 'function' && typeof b === 'function') return true;\n return isEqual(a, b);\n};\n\nconst areXPropsEqual = (\n prev: Record<string, unknown> | null,\n next: Record<string, unknown>\n): boolean => {\n if (prev === next) return true;\n if (!prev) return false;\n const prevKeys = Object.keys(prev);\n const nextKeys = Object.keys(next);\n if (prevKeys.length !== nextKeys.length) return false;\n for (const key of nextKeys) {\n if (!Object.prototype.hasOwnProperty.call(prev, key)) return false;\n if (!isXPropEqual(prev[key], next[key])) return false;\n }\n return true;\n};\n\nconst ISOLATED_PAGE_PATH = '/DevCenterIsolatedAppPage.html';\n\n// [REACT-18-MIGRATION-TAG] Per-app React version (PLT-3099): under a React-18 host an isolated app\n// must run in a React-17 iframe realm unless it is known to be React-18-ready. Legacy builds carry\n// no `package.package_json.dependencies.react` at all (the field predates the migration and is\n// absent even in the packages API), so React-17-ness cannot be positively detected — everything\n// before the migration is React 17. Therefore treat \"does not explicitly declare React 18\" as\n// React 17 and route it to `/r17/`; only an explicit React-18 declaration (present on new builds,\n// filled in by the host's package_json enrichment) keeps the app on the default React-18 iframe.\n// The host opts in by setting `window.__DC_REACT17_ISOLATED_PAGE_PATH__` to a SAME-ORIGIN path that\n// serves a React-17 build of the iframe entry (same-origin is required — the xprops bridge below\n// uses direct `contentWindow.xprops`, which the browser blocks cross-origin). Remove once all apps\n// are on React 18.\nconst REACT_18_DECLARATION_REGEX = /(^|[\\^~>=\\s])18\\./;\n\nexport const isReact17App = (app: unknown): boolean => {\n const pkg = (app as { package?: { package_json?: { dependencies?: Record<string, string> } } })\n ?.package;\n // No package at all = a legacy build with no React-18 declaration → route to /r17/. A React-18\n // app always carries a package_json declaring react 18 (host package_json enrichment), so a\n // missing package can never be a detectable React-18 app; default unknown/legacy to React 17.\n if (!pkg) return true;\n\n const declared = pkg.package_json?.dependencies?.react;\n return !(typeof declared === 'string' && REACT_18_DECLARATION_REGEX.test(declared));\n};\n\nconst getIsolatedPagePath = (app: unknown): string => {\n const react17Path = (window as any).__DC_REACT17_ISOLATED_PAGE_PATH__;\n if (react17Path && isReact17App(app)) return react17Path;\n return ISOLATED_PAGE_PATH;\n};\n\nexport const APP_IFRAME_ATTRIBUTE = 'data-corva-app-iframe';\n\nconst IFRAME_ATTRIBUTES = {\n [APP_IFRAME_ATTRIBUTE]: true,\n 'data-testid': 'isolatedAppContainer',\n} as Record<string, boolean | string>;\n\nexport type IsolatedPageProps = {\n [key: string]: any; // forwarded as xprops\n};\n\ndeclare global {\n interface Window {\n xprops?: Record<string, any>;\n xpropsOnProps?: (props: any) => void;\n xpropsOnUnmount?: () => void;\n }\n}\n\nexport function IsolatedPage({ ...restProps }: IsolatedPageProps) {\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const lastPropsSnapshotRef = useRef<Record<string, any> | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const handleIframeLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n /**\n * Inject or update props into iframe window.xprops.\n * Calls window.xpropsOnProps callback only if props changed (deep check).\n */\n const publishProps = (\n targetWindow: (Window & { xprops?: any; xpropsOnProps?: (props: any) => void }) | null,\n newProps: Record<string, any>\n ) => {\n if (!targetWindow) return;\n\n const isInitialSet = !targetWindow.xprops;\n const previousSnapshot = lastPropsSnapshotRef.current || {};\n const propsChanged = !areXPropsEqual(previousSnapshot, newProps);\n\n // Unconditional, and outside the fire check below: suppressing the iframe re-render must not\n // leave stale callbacks on the object the DC app dereferences on every user action.\n targetWindow.xprops = { ...newProps };\n lastPropsSnapshotRef.current = newProps;\n\n // Call xpropsOnProps callback if it exists (on initial set or when props changed)\n if ((isInitialSet || propsChanged) && targetWindow.xpropsOnProps) {\n try {\n targetWindow.xpropsOnProps(newProps);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.debug('[IsolatedPage] xpropsOnProps was not set yet:', error);\n }\n }\n };\n\n // Try to set/update xprops whenever props change (including initial mount)\n useEffect(() => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnProps?: (props: any) => void })\n | null;\n publishProps(win, restProps);\n } catch (error) {\n // contentWindow might not be accessible yet, will retry on next prop change\n console.error('[IsolatedPage] Error accessing iframe contentWindow:', error);\n }\n });\n\n // Cleanup on unmount. A layout effect: React detaches the iframe ref before passive cleanups\n // run, and the app's own unmount must happen while the iframe is still in the document — the\n // listeners an app attached to window.top otherwise outlive the iframe and keep its realm alive.\n useLayoutEffect(() => {\n return () => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnUnmount?: () => void })\n | null;\n win?.xpropsOnUnmount?.();\n if (win && win.xprops) delete (win as any).xprops;\n } catch (error) {\n console.error('[IsolatedPage] Error cleaning up xprops:', error);\n }\n lastPropsSnapshotRef.current = null;\n iframeRef.current = null;\n };\n }, []);\n\n return (\n <div className={styles.container}>\n {isLoading && <LoadingIndicator />}\n <iframe\n ref={iframeRef}\n src={getIsolatedPagePath(restProps.app)}\n onLoad={handleIframeLoad}\n className={styles.iframe}\n {...IFRAME_ATTRIBUTES}\n />\n </div>\n );\n}\n"],"names":["REACT_18_DECLARATION_REGEX","isReact17App","app","_pkg$package_json","_pkg$package_json$dep","pkg","package","declared","package_json","dependencies","react","test","IFRAME_ATTRIBUTES","_defineProperty","_IFRAME_ATTRIBUTES","_ref","react17Path","restProps","_extends","iframeRef","useRef","lastPropsSnapshotRef","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","handleIframeLoad","useCallback","publishProps","targetWindow","newProps","isInitialSet","xprops","propsChanged","prev","next","a","b","prevKeys","Object","keys","nextKeys","length","_i","_nextKeys","key","prototype","hasOwnProperty","call","isEqual","areXPropsEqual","current","xpropsOnProps","error","console","debug","useEffect","_iframeRef$current","win","contentWindow","useLayoutEffect","_iframeRef$current2","_win$xpropsOnUnmount","xpropsOnUnmount","_jsxs","className","styles","container","children","_jsx","LoadingIndicator","_objectSpread","ref","src","window","__DC_REACT17_ISOLATED_PAGE_PATH__","onLoad","iframe"],"mappings":"2iCA2BA,IAmCMA,EAA6B,oBAEtBC,EAAe,SAACC,GAA0B,IAAAC,EAAAC,EAC/CC,EAAOH,aAAAA,EAAAA,EACTI,QAIJ,IAAKD,EAAK,OAAO,EAEjB,IAAME,UAAWF,EAAAA,EAAIG,2BAAJ,UAAAL,EAAkBM,oBAAlB,IAAAL,SAAAA,EAAgCM,MACjD,QAA6B,iBAAbH,GAAyBP,EAA2BW,KAAKJ,GAC3E,EAUMK,oBAF8B,yBAGV,GACxBC,EAAAA,QAAAC,EAAA,cAAe,wBACoBA,gCALD,6CAmB7B,SAA2DC,GAAA,IAzBrCb,EACrBc,EAwB0BC,EAASC,EAAAA,QAAA,CAAA,EAAAH,GACnCI,EAAYC,SAAiC,MAC7CC,EAAuBD,SAAmC,MAC9BE,EA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,OAAO,WACL,IAAI,IAAAC,EAAAC,EACIJ,EAAuB,QAAjBzC,EAAAA,EAAUkC,eAAO,IAAAU,OAAA,EAAjBA,EAAmBF,cAG/BD,SAAoB,QAApBA,EAAAA,EAAKK,uBAAe,IAAAD,GAApBA,EAAAJ,KAAAA,GACIA,GAAOA,EAAI1B,eAAgB0B,EAAY1B,MAG7C,CAFE,MAAOqB,GACPC,QAAQD,MAAM,2CAA4CA,EAC5D,CACAlC,EAAqBgC,QAAU,KAC/BlC,EAAUkC,QAAU,KAEvB,GAAE,IAGDa,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,UAAUC,SAAA,CAC9B5C,GAAa6C,MAACC,MACfD,EAAAA,IAAA,SAAAE,EAAA,CACEC,IAAKvD,EACLwD,KArGqBzE,EAqGIe,EAAUf,IApGnCc,EAAe4D,OAAeC,kCAChC7D,GAAef,EAAaC,GAAac,EA7BpB,kCAiInB8D,OAAQlD,EACRuC,UAAWC,EAAOW,QACdnE,MAIZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("classnames"),t=require("./NewCommentCursor.scss.js"),i=require("react/jsx-runtime");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("classnames"),t=require("./NewCommentCursor.scss.js"),i=require("../CurveTooltip/CurveTooltip.js"),l=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(r),d=e.forwardRef((function(e,r){var o=e.size,d=void 0===o?40:o,n=e.onClick,u=e.tooltip,a=e.className,c=e.testId,C=l.jsx("div",{ref:r,"data-testid":c,className:s.default(t.root,a),style:{width:d,height:d},onClick:n,children:l.jsxs("svg",{width:.48839026568430455*d,height:.48839026568430455*d,viewBox:"0 0 8.75 8.75",fill:"none","aria-hidden":!0,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 4.375C0 4.02982 0.279822 3.75 0.625 3.75H8.125C8.47018 3.75 8.75 4.02982 8.75 4.375C8.75 4.72018 8.47018 5 8.125 5H0.625C0.279822 5 0 4.72018 0 4.375Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 0C4.72018 0 5 0.279822 5 0.625V8.125C5 8.47018 4.72018 8.75 4.375 8.75C4.02982 8.75 3.75 8.47018 3.75 8.125V0.625C3.75 0.279822 4.02982 0 4.375 0Z",fill:"currentColor"})]})});return u?l.jsx(i.CurveTooltip,{data:u,open:!0,isFullScreen:!1,placement:"bottom-start",children:C}):C}));exports.NewCommentCursor=d;
|
|
2
2
|
//# sourceMappingURL=NewCommentCursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewCommentCursor.js","sources":["../../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport styles from './NewCommentCursor.scss';\n\nexport type NewCommentCursorProps = {\n size?: number;\n onClick?: () => void;\n\n className?: string;\n testId?: string;\n};\n\n// Figma's \"Vector\" plus glyph is sized relative to the pin (\"Union\", 17.916 units),\n// not the full 24px canvas the pin sits in (node 3119:21596, \"add-message-custom-fill\").\n// Our CSS-drawn pin fills the whole container, so the glyph scales off `size` directly\n// using that plus/pin ratio. Paths/viewBox below are exact Figma coordinates.\nconst GLYPH_RATIO = 8.75 / 17.916;\n\nexport const NewCommentCursor = forwardRef<HTMLDivElement, NewCommentCursorProps>(\n ({ size = 40, onClick, className, testId }, ref) => (\n
|
|
1
|
+
{"version":3,"file":"NewCommentCursor.js","sources":["../../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport styles from './NewCommentCursor.scss';\nimport { CurveTooltip, CurveTooltipData } from '../CurveTooltip';\n\nexport type NewCommentCursorProps = {\n size?: number;\n onClick?: () => void;\n tooltip?: CurveTooltipData;\n\n className?: string;\n testId?: string;\n};\n\n// Figma's \"Vector\" plus glyph is sized relative to the pin (\"Union\", 17.916 units),\n// not the full 24px canvas the pin sits in (node 3119:21596, \"add-message-custom-fill\").\n// Our CSS-drawn pin fills the whole container, so the glyph scales off `size` directly\n// using that plus/pin ratio. Paths/viewBox below are exact Figma coordinates.\nconst GLYPH_RATIO = 8.75 / 17.916;\n\nexport const NewCommentCursor = forwardRef<HTMLDivElement, NewCommentCursorProps>(\n ({ size = 40, onClick, tooltip, className, testId }, ref) => {\n const cursor = (\n <div\n ref={ref}\n data-testid={testId}\n className={classNames(styles.root, className)}\n style={{ width: size, height: size }}\n onClick={onClick}\n >\n <svg\n width={size * GLYPH_RATIO}\n height={size * GLYPH_RATIO}\n viewBox=\"0 0 8.75 8.75\"\n fill=\"none\"\n aria-hidden\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0 4.375C0 4.02982 0.279822 3.75 0.625 3.75H8.125C8.47018 3.75 8.75 4.02982 8.75 4.375C8.75 4.72018 8.47018 5 8.125 5H0.625C0.279822 5 0 4.72018 0 4.375Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M4.375 0C4.72018 0 5 0.279822 5 0.625V8.125C5 8.47018 4.72018 8.75 4.375 8.75C4.02982 8.75 3.75 8.47018 3.75 8.125V0.625C3.75 0.279822 4.02982 0 4.375 0Z\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n );\n\n // isFullScreen: the DC variant resizes the app iframe on open, making a cursor-following tooltip loop.\n return tooltip ? (\n <CurveTooltip data={tooltip} open isFullScreen={false} placement=\"bottom-start\">\n {cursor}\n </CurveTooltip>\n ) : (\n cursor\n );\n }\n);\n"],"names":["NewCommentCursor","forwardRef","_ref","ref","_ref$size","size","onClick","tooltip","className","testId","cursor","_jsx","jsx","classNames","styles","root","style","width","height","children","_jsxs","jsxs","viewBox","fill","fillRule","clipRule","d","CurveTooltip","data","open","isFullScreen","placement"],"mappings":"0TAqBaA,EAAmBC,EAAUA,YACxC,SAAAC,EAAqDC,GAAQ,IAAAC,EAAAF,EAA1DG,KAAAA,aAAO,GAAED,EAAEE,IAAAA,QAASC,IAAAA,QAASC,IAAAA,UAAWC,IAAAA,OACnCC,EACJC,EAAAC,IAAA,MAAA,CACET,IAAKA,EACL,cAAaM,EACbD,UAAWK,EAAU,QAACC,EAAOC,KAAMP,GACnCQ,MAAO,CAAEC,MAAOZ,EAAMa,OAAQb,GAC9BC,QAASA,EAAQa,SAEjBC,EAAAC,KAAA,MAAA,CACEJ,MAbU,mBAaHZ,EACPa,OAdU,mBAcFb,EACRiB,QAAQ,gBACRC,KAAK,OACL,eAAW,EAAAJ,SAEX,CAAAR,EAAAC,IAAA,OAAA,CACEY,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFH,KAAK,iBAEPZ,EAAAC,IAAA,OAAA,CACEY,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFH,KAAK,sBAOb,OAAOhB,EACLI,EAAAC,IAACe,eAAY,CAACC,KAAMrB,EAASsB,MAAI,EAACC,cAAc,EAAOC,UAAU,eAAcZ,SAC5ET,IAGHA,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/typeof"),a=require("@babel/runtime/regenerator"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/typeof"),a=require("@babel/runtime/regenerator"),n=require("./constants.js"),i=require("./highcharts-contour.js"),o=require("./getHighchartsV10.js"),s=require("dompurify");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(e),c=u(t),d=u(r),h=u(a),f=u(s),p=function e(t){return"string"==typeof t?f.default.sanitize(t):("object"===d.default(t)&&null!==t&&Object.entries(t).forEach((function(r){var a=c.default(r,2),n=a[0],i=a[1];"string"==typeof i?t[n]=f.default.sanitize(t[n]):Array.isArray(i)?i.forEach((function(r,a){t[n][a]=e(r)})):"object"===d.default(i)&&(t[n]=e(i))})),t)},g=function(){var e,t=document.createElement("canvas").getContext("webgl"),r=null==t?void 0:t.createShader(t.VERTEX_SHADER);if(!r)return!1;t.shaderSource(r,"void main(){gl_Position=vec4(0.0,0.0,0.0,1.0);}"),t.compileShader(r);var a=!!t.getShaderParameter(r,t.COMPILE_STATUS);return t.deleteShader(r),null===(e=t.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext(),a};function b(){return b=l.default(h.default.mark((function e(){var t,r,a,s,u,l,c,d,f,b,v,H,S,A,y,E,T,_=arguments;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.version,a=void 0===r?n.HIGHCHARTS_V10_VERSION:r,[n.HIGHCHARTS_V8_VERSION,n.HIGHCHARTS_V10_VERSION].includes(a)){e.next=3;break}throw new Error("Invalid highcharts version: ".concat(a));case 3:if(a!==n.HIGHCHARTS_V8_VERSION){e.next=9;break}return e.next=6,Promise.resolve().then((function(){return require("./getHighchartsV8.js")}));case 6:e.t0=e.sent.getHighchartsV8,e.next=10;break;case 9:e.t0=o.getHighchartsV10;case 10:s=e.t0,u=s(),l=u.Highcharts,c=u.highchartsMore,d=u.HighchartsMulticolorSeries,f=u.addSolidGauge,b=u.addHeatmap,v=u.addBoost,H=u.addExporting,S=u.addXrange,A=u.addDumbbell,y=u.addPatternFill,E=u.addAnnotations,window.Highcharts=l,l.AST&&(l.AST.bypassHTMLFiltering=!0,l.AST.allowedAttributes.push("viewBox"),l.AST.allowedAttributes.push("fill-rule"),l.AST.allowedAttributes.push("clip-rule")),d(l),c(l),f(l),b(l),v(l),H(l),S(l),A(l),y(l),i(l),E(l),T=l.chart,l.chart=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length,a=new Array(r>2?r-2:0),n=2;n<r;n++)a[n-2]=arguments[n];return T.apply(void 0,[e,p(t)].concat(a))},l.setOptions({boost:{enabled:g()},plotOptions:{series:{states:{inactive:{enabled:!1}}}}});case 28:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}exports.initHighcharts=function(){return b.apply(this,arguments)};
|
|
2
2
|
//# sourceMappingURL=highcharts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highcharts.js","sources":["../../../../src/config/highcharts/highcharts.js"],"sourcesContent":["/* eslint-disable */\n// TODO: all the plugins should be checked, legacy code\n\n// [HIGHCHARTS-10-MIGRATION-TAG]: Find and delete/clean all places like this once the migration ends\nimport { HIGHCHARTS_V10_VERSION, HIGHCHARTS_V8_VERSION } from './constants';\n\nimport addContour from './highcharts-contour';\nimport { getHighchartsV10 } from './getHighchartsV10';\n\nimport DOMPurify from 'dompurify';\n\nconst stripHTMLRecurse = o => {\n if (typeof o === 'string') {\n return DOMPurify.sanitize(o);\n }\n\n if (typeof o === 'object' && o !== null)\n Object.entries(o).forEach(([key, value]) => {\n if (typeof value === 'string') {\n o[key] = DOMPurify.sanitize(o[key]);\n } else if (Array.isArray(value)) {\n value.forEach((item, i) => {\n o[key][i] = stripHTMLRecurse(item);\n });\n } else if (typeof value === 'object') {\n o[key] = stripHTMLRecurse(value);\n }\n });\n\n return o;\n};\n\nexport async function initHighcharts({ version = HIGHCHARTS_V10_VERSION } = {}) {\n if (![HIGHCHARTS_V8_VERSION, HIGHCHARTS_V10_VERSION].includes(version)) {\n throw new Error(`Invalid highcharts version: ${version}`);\n }\n\n const highchartsGetter =\n version === HIGHCHARTS_V8_VERSION\n ? (await import('./getHighchartsV8')).getHighchartsV8\n : getHighchartsV10;\n\n const {\n Highcharts,\n highchartsMore,\n HighchartsMulticolorSeries,\n addSolidGauge,\n addHeatmap,\n addBoost,\n addExporting,\n addXrange,\n addDumbbell,\n addPatternFill,\n addAnnotations,\n } = highchartsGetter();\n\n /**\n * NOTE: Highchart has a bug for pie chart in v8.1.2\n * issue link: https://github.com/highcharts/highcharts/issues/13710\n * workaround:\n * import Highcharts from 'highcharts';\n * window.Highcharts = Highcharts;\n */\n window.Highcharts = Highcharts;\n\n // NOTE: Temporary disable HTML filtering for duration of migration to v10, as this is the main breaking change in v10, should be removed after migration\n if (Highcharts.AST) {\n Highcharts.AST.bypassHTMLFiltering = true;\n\n // Adding needed custom attributes for some SVG icons\n Highcharts.AST.allowedAttributes.push('viewBox');\n Highcharts.AST.allowedAttributes.push('fill-rule');\n Highcharts.AST.allowedAttributes.push('clip-rule');\n }\n\n HighchartsMulticolorSeries(Highcharts);\n // NOTE: Highcharts patching. It should be done in one place before any chart in rendered\n // in order to avoid conflicts\n highchartsMore(Highcharts);\n addSolidGauge(Highcharts); // https://www.highcharts.com/docs/chart-and-series-types/angular-gauges\n addHeatmap(Highcharts); // https://www.highcharts.com/docs/chart-and-series-types/heatmap\n addBoost(Highcharts); // https://www.highcharts.com/docs/advanced-chart-features/boost-module\n addExporting(Highcharts); // https://www.highcharts.com/docs/export-module/export-module-overview\n addXrange(Highcharts); // https://www.highcharts.com/docs/advanced-chart-features/boost-module\n addDumbbell(Highcharts);\n addPatternFill(Highcharts);\n addContour(Highcharts);\n addAnnotations(Highcharts);\n\n // fix security issue for Highcharts 8\n // https://github.com/highcharts/highcharts/security/advisories/GHSA-8j65-4pcq-xq95\n const originalChartFn = Highcharts.chart;\n Highcharts.chart = function (container, options = {}, ...restParams) {\n return originalChartFn(container, stripHTMLRecurse(options), ...restParams);\n };\n\n /**\n * Adjust default highcharts effects globally for better use in our apps\n *\n * 1. Stop animation for inactive series\n * ref: https://api.highcharts.com/highcharts/plotOptions.series.states.inactive.enabled\n *\n */\n Highcharts.setOptions({\n plotOptions: {\n series: {\n states: {\n inactive: {\n enabled: false,\n },\n },\n },\n },\n });\n}\n"],"names":["stripHTMLRecurse","o","DOMPurify","sanitize","_typeof","Object","entries","forEach","_ref","_ref2","_slicedToArray","key","value","Array","isArray","item","i","_initHighcharts","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref3","_ref3$version","version","highchartsGetter","_highchartsGetter","Highcharts","highchartsMore","HighchartsMulticolorSeries","addSolidGauge","addHeatmap","addBoost","addExporting","addXrange","addDumbbell","addPatternFill","addAnnotations","originalChartFn","_args","arguments","wrap","_context","prev","next","length","undefined","HIGHCHARTS_V10_VERSION","HIGHCHARTS_V8_VERSION","includes","Error","Promise","resolve","then","require","t0","sent","getHighchartsV8","getHighchartsV10","window","AST","bypassHTMLFiltering","allowedAttributes","push","addContour","chart","container","options","_len","restParams","_key","setOptions","plotOptions","series","states","inactive","
|
|
1
|
+
{"version":3,"file":"highcharts.js","sources":["../../../../src/config/highcharts/highcharts.js"],"sourcesContent":["/* eslint-disable */\n// TODO: all the plugins should be checked, legacy code\n\n// [HIGHCHARTS-10-MIGRATION-TAG]: Find and delete/clean all places like this once the migration ends\nimport { HIGHCHARTS_V10_VERSION, HIGHCHARTS_V8_VERSION } from './constants';\n\nimport addContour from './highcharts-contour';\nimport { getHighchartsV10 } from './getHighchartsV10';\n\nimport DOMPurify from 'dompurify';\n\nconst stripHTMLRecurse = o => {\n if (typeof o === 'string') {\n return DOMPurify.sanitize(o);\n }\n\n if (typeof o === 'object' && o !== null)\n Object.entries(o).forEach(([key, value]) => {\n if (typeof value === 'string') {\n o[key] = DOMPurify.sanitize(o[key]);\n } else if (Array.isArray(value)) {\n value.forEach((item, i) => {\n o[key][i] = stripHTMLRecurse(item);\n });\n } else if (typeof value === 'object') {\n o[key] = stripHTMLRecurse(value);\n }\n });\n\n return o;\n};\n\n// Highcharts' own hasWebGLSupport() only proves a context can be created, which the\n// drivers that fail here can do. Compiling one shader is what separates them.\nconst isBoostSupported = () => {\n const gl = document.createElement('canvas').getContext('webgl');\n const shader = gl?.createShader(gl.VERTEX_SHADER);\n if (!shader) return false;\n\n gl.shaderSource(shader, 'void main(){gl_Position=vec4(0.0,0.0,0.0,1.0);}');\n gl.compileShader(shader);\n const isCompiled = !!gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n\n gl.deleteShader(shader);\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return isCompiled;\n};\n\nexport async function initHighcharts({ version = HIGHCHARTS_V10_VERSION } = {}) {\n if (![HIGHCHARTS_V8_VERSION, HIGHCHARTS_V10_VERSION].includes(version)) {\n throw new Error(`Invalid highcharts version: ${version}`);\n }\n\n const highchartsGetter =\n version === HIGHCHARTS_V8_VERSION\n ? (await import('./getHighchartsV8')).getHighchartsV8\n : getHighchartsV10;\n\n const {\n Highcharts,\n highchartsMore,\n HighchartsMulticolorSeries,\n addSolidGauge,\n addHeatmap,\n addBoost,\n addExporting,\n addXrange,\n addDumbbell,\n addPatternFill,\n addAnnotations,\n } = highchartsGetter();\n\n /**\n * NOTE: Highchart has a bug for pie chart in v8.1.2\n * issue link: https://github.com/highcharts/highcharts/issues/13710\n * workaround:\n * import Highcharts from 'highcharts';\n * window.Highcharts = Highcharts;\n */\n window.Highcharts = Highcharts;\n\n // NOTE: Temporary disable HTML filtering for duration of migration to v10, as this is the main breaking change in v10, should be removed after migration\n if (Highcharts.AST) {\n Highcharts.AST.bypassHTMLFiltering = true;\n\n // Adding needed custom attributes for some SVG icons\n Highcharts.AST.allowedAttributes.push('viewBox');\n Highcharts.AST.allowedAttributes.push('fill-rule');\n Highcharts.AST.allowedAttributes.push('clip-rule');\n }\n\n HighchartsMulticolorSeries(Highcharts);\n // NOTE: Highcharts patching. It should be done in one place before any chart in rendered\n // in order to avoid conflicts\n highchartsMore(Highcharts);\n addSolidGauge(Highcharts); // https://www.highcharts.com/docs/chart-and-series-types/angular-gauges\n addHeatmap(Highcharts); // https://www.highcharts.com/docs/chart-and-series-types/heatmap\n addBoost(Highcharts); // https://www.highcharts.com/docs/advanced-chart-features/boost-module\n addExporting(Highcharts); // https://www.highcharts.com/docs/export-module/export-module-overview\n addXrange(Highcharts); // https://www.highcharts.com/docs/advanced-chart-features/boost-module\n addDumbbell(Highcharts);\n addPatternFill(Highcharts);\n addContour(Highcharts);\n addAnnotations(Highcharts);\n\n // fix security issue for Highcharts 8\n // https://github.com/highcharts/highcharts/security/advisories/GHSA-8j65-4pcq-xq95\n const originalChartFn = Highcharts.chart;\n Highcharts.chart = function (container, options = {}, ...restParams) {\n return originalChartFn(container, stripHTMLRecurse(options), ...restParams);\n };\n\n /**\n * Adjust default highcharts effects globally for better use in our apps\n *\n * 1. Stop animation for inactive series\n * ref: https://api.highcharts.com/highcharts/plotOptions.series.states.inactive.enabled\n *\n * 2. Keep boost off where its shaders will not compile. boost.enabled defaults to\n * true once addBoost has run, and on such drivers boost carries on with a null\n * program and throws out of getAttribLocation mid-render, taking the chart with\n * it. Charts keep GPU acceleration everywhere the driver works.\n *\n */\n Highcharts.setOptions({\n boost: {\n enabled: isBoostSupported(),\n },\n plotOptions: {\n series: {\n states: {\n inactive: {\n enabled: false,\n },\n },\n },\n },\n });\n}\n"],"names":["stripHTMLRecurse","o","DOMPurify","sanitize","_typeof","Object","entries","forEach","_ref","_ref2","_slicedToArray","key","value","Array","isArray","item","i","isBoostSupported","_gl$getExtension","gl","document","createElement","getContext","shader","createShader","VERTEX_SHADER","shaderSource","compileShader","isCompiled","getShaderParameter","COMPILE_STATUS","deleteShader","getExtension","loseContext","_initHighcharts","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref3","_ref3$version","version","highchartsGetter","_highchartsGetter","Highcharts","highchartsMore","HighchartsMulticolorSeries","addSolidGauge","addHeatmap","addBoost","addExporting","addXrange","addDumbbell","addPatternFill","addAnnotations","originalChartFn","_args","arguments","wrap","_context","prev","next","length","undefined","HIGHCHARTS_V10_VERSION","HIGHCHARTS_V8_VERSION","includes","Error","Promise","resolve","then","require","t0","sent","getHighchartsV8","getHighchartsV10","window","AST","bypassHTMLFiltering","allowedAttributes","push","addContour","chart","container","options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,UAAAK,OAAA,QAAAC,IAAAN,UAAA,GAAAA,UAAA,GAAA,CAAA,EAAE4B,EAAA5B,UAAAK,OAAKwB,EAAU,IAAAzE,MAAAwE,EAAA,EAAAA,EAAA,EAAA,GAAAE,EAAA,EAAAA,EAAAF,EAAAE,IAAVD,EAAUC,EAAA,GAAA9B,UAAA8B,GACjE,OAAOhC,EAAgB4B,WAAAA,EAAAA,CAAAA,EAAWnF,EAAiBoF,IAAaE,OAAAA,KAelE1C,EAAW4C,WAAW,CACpBC,MAAO,CACLC,QAASzE,KAEX0E,YAAa,CACXC,OAAQ,CACNC,OAAQ,CACNC,SAAU,CACRJ,SAAS,QAKhB,KAAA,GAAA,IAAA,MAAA,OAAA/B,EAAAoC,OAAA,GAAAzD,EACJ,KAAAJ,EAAA8D,MAAAC,KAAAxC,UAAA,wBA1FD,WAAoC,OAAAvB,EAAA8D,MAAAC,KAAAxC,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CommentCard.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,eAAO,MAAM,WAAW,6GAmOtB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/toConsumableArray";import{forwardRef as n,useMemo as i}from"react";import{Collapse as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/toConsumableArray";import{forwardRef as n,useMemo as i}from"react";import{Collapse as e}from"@material-ui/core";import c from"classnames";import{FeedCard as t,FEED_CARD_MAX_HEIGHT_PX as r}from"../FeedCard/FeedCard.js";import{useStoredAttachments as m}from"../AttachmentPreview/useStoredAttachments.js";import{useFeedActivity as a}from"../FeedCard/useFeedActivity.js";import{AttachmentPreview as p}from"../AttachmentPreview/AttachmentPreview.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"@babel/runtime/helpers/objectWithoutProperties";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../../componentsV2/Text/Text.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"@babel/runtime/helpers/slicedToArray";import"uuid";import{jsx as l,jsxs as u,Fragment as d}from"react/jsx-runtime";import"../../componentsV2/Tooltip/Tooltip.scss.js";import{InfoIcon as j}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/InfoRounded.js";import"../../icons/customIcons/icons/FlameFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/PinOne.js";import"../../icons/customIcons/icons/PinOneCrossed.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import"../../componentsV2/Menu/Menu.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../clients/jsonApi/index.js";import"../../utils/main.js";import"../AttachmentPreview/AttachmentImage.js";import"../AttachmentPreview/AttachmentPreview.scss.js";import"file-extension";import"image-extensions";import"video-extensions";import{Avatar as h}from"../../componentsV2/Avatar/Avatar.js";import{CurveTooltip as I}from"../CurveTooltip/CurveTooltip.js";import{LinkedText as v}from"../LinkedText/LinkedText.js";import{CommentCardReactions as C}from"./CommentCardReactions.js";import{CommentCardReplies as f}from"./CommentCardReplies.js";import b from"./CommentCard.scss.js";function O(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);s&&(i=i.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),n.push.apply(n,i)}return n}function y(s){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?O(Object(i),!0).forEach((function(n){o(s,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(i,o))}))}return s}var g=n((function(o,n){var O=o.activity,g=o.variant,A=void 0===g?"expanded":g,F=o.author,P=o.timestamp,N=o.subtitle,w=o.body,R=o.contextRows,D=o.attachment,k=o.storedAttachments,x=o.isLiked,M=o.likesCount,T=o.commentsCount,S=o.replies,E=o.hasMoreReplies,L=o.moreRepliesCount,B=o.attachments,U=o.onAttachmentClick,V=o.onAttachmentShare,z=o.attachmentSlot,G=o.chip,W=o.chipColor,H=o.chipValue,q=o.chipUnit,K=o.onLike,Z=o.onReplyToggle,J=o.onForward,Q=o.onShowMoreReplies,X=o.menuItems,Y=o.isReplyOpen,$=o.replyInput,_=o.editForm,oo=o.width,so=o.onMouseEnter,no=o.onMouseLeave,io=o.className,eo=o.testId,co=a(O,"comment"),to=co?[].concat(s(null!=X?X:[]),s(co.menuItems)):X,ro=co?co.replyInput:$,mo=co?co.isReplyOpen:Y,ao=co?co.replies:S,po=!(null==R||!R.length),lo=po&&!G,uo=!!(co||K||Z||J||null!=to&&to.length||lo),jo=lo&&l(I,{data:{rows:null!=R?R:[]},children:l("span",{className:b.infoButton,"data-testid":"comment-card-info",children:l(j,{size:12,strokeWidth:2})})}),ho=l(C,{info:jo,commentsCount:co?co.commentsCount:T,likesCount:co?co.likesCount:M,isLiked:co?co.isLiked:x,menuItems:to,onLike:co?co.onLike:K,onReplyToggle:co?co.onReplyToggle:Z,onForward:J}),Io=u("div",{className:b.text,children:[G&&l(I,{data:po||null!=H?{title:G,value:H,unit:q,color:W,rows:null!=R?R:[]}:{rows:[]},children:u("span",{className:c(b.chip,!!W&&b.chipAccented),style:W?{"--chip-color":W}:void 0,children:[W&&l("span",{className:b.chipDot}),G]})}),l(v,{children:w})]}),vo=i((function(){return null!=k?k:[D].filter(Boolean)}),[k,D]),Co=m(vo),fo=Co.length?Co:B,bo=null!=fo&&fo.length?l(p,{items:fo,onItemClick:U,onShare:V}):null,Oo={ref:n,width:oo,radius:12,onMouseEnter:so,onMouseLeave:no,testId:eo,className:io};if(null!=co&&co.isDeleted)return null;var yo=function(o){return u(d,{children:[o,null==co?void 0:co.deleteDialog]})};if("preview"===A)return yo(u(t,y(y({},Oo),{},{maxHeight:r,children:[u("div",{className:b.compactBody,children:[u("div",{className:b.compactTop,children:[l(h,{size:24,name:F.name,imageSrc:F.avatarUrl,className:b.avatar}),l("span",{className:b.name,children:F.name}),l("span",{className:b.compactTime,children:P})]}),l("div",{className:b.scrollBody,children:Io})]}),uo&&l("div",{className:b.compactFooter,children:ho})]})));var go=!!_,Ao=u("div",{className:b.header,children:[l(h,{size:24,name:F.name,imageSrc:F.avatarUrl,className:b.avatar}),u("div",{className:b.headerText,children:[u("div",{className:b.nameRow,children:[l("span",{className:b.name,children:F.name}),P&&l("span",{className:b.timestamp,children:P})]}),N&&l("span",{className:b.subtitle,children:N})]})]});return yo(u(t,y(y({},Oo),{},go?{children:[l("div",{className:b.editHeader,children:Ao}),_]}:{children:[u("div",{className:b.capped,style:{maxHeight:r},children:[u("div",{className:b.bodySurface,children:[Ao,u("div",{className:b.scrollBody,children:[Io,(bo||z)&&u("div",{className:b.attachment,children:[bo,z]})]})]}),uo&&l("div",{className:b.footer,children:ho})]}),uo&&l(e,{in:mo,timeout:250,unmountOnExit:!0,children:l("div",{className:b.repliesSection,children:l(f,{replies:ao,hasMoreReplies:co?co.hasMoreReplies:E,moreRepliesCount:co?co.moreRepliesCount:L,isReplyOpen:mo,replyInput:ro,onShowMoreReplies:co?co.onShowMoreReplies:Q})})})]})))}));export{g as CommentCard};
|
|
2
2
|
//# sourceMappingURL=CommentCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.js","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps, CommentContextRow } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nconst MetadataTooltip = ({ rows }: { rows: CommentContextRow[] }) => (\n <div className={styles.metadataRows}>\n {rows.map(({ label, value, unit }) => (\n <div key={label} className={styles.metadataRow}>\n <span className={styles.metadataLabel}>{label}</span>\n <span className={styles.metadataValue}>{value}</span>\n {unit && <span className={styles.metadataUnit}>{unit}</span>}\n </div>\n ))}\n </div>\n);\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={<MetadataTooltip rows={contextRows} />}\n >\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </Tooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={hasMetadata ? <MetadataTooltip rows={contextRows} /> : ''}\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </Tooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["MetadataTooltip","_ref","rows","_jsx","className","styles","metadataRows","children","map","_ref2","label","value","unit","_jsxs","metadataRow","metadataLabel","metadataValue","metadataUnit","CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","Tooltip","placement","metadataTooltip","title","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","text","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"w0LAoBA,IAAMA,EAAkB,SAAHC,GAAA,IAAMC,IAAAA,KAAI,OAC7BC,EAAA,MAAA,CAAKC,UAAWC,EAAOC,aAAaC,SACjCL,EAAKM,KAAI,SAAAC,GAAA,IAAGC,IAAAA,MAAOC,IAAAA,MAAOC,IAAAA,KAAI,OAC7BC,EAAA,MAAA,CAAiBT,UAAWC,EAAOS,YAAYP,SAC7C,CAAAJ,EAAA,OAAA,CAAMC,UAAWC,EAAOU,cAAcR,SAAEG,IACxCP,EAAA,OAAA,CAAMC,UAAWC,EAAOW,cAAcT,SAAEI,IACvCC,GAAQT,EAAA,OAAA,CAAMC,UAAWC,EAAOY,aAAaV,SAAEK,MAHxCF,OAMR,EAGKQ,EAAcC,GAA6C,SAACC,EAAOC,GAC9E,IACEC,EAkCEF,EAlCFE,SAAQC,EA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AAOsB,SAASpB,SAAEoB,UAKtD,OACSwE,GACLtF,EAAC0F,SAAaP,IAAY,GAF1BoB,GAE0B,CAAA7G,SACxB,CAAAJ,EAAA,MAAA,CAAKC,UAAWC,EAAOoH,WAAWlH,SAAE8G,KACnClE,IAMqB,CAAA5C,SACxB,CAAAM,EAAA,MAAA,CAAKT,UAAWC,EAAOqH,OAAQzC,MAAO,CAAEuB,UAAWC,GAA0BlG,SAC3E,CAAAM,EAAA,MAAA,CAAKT,UAAWC,EAAOsH,YAAYpH,SAAA,CAChC8G,GAEDxG,EAAA,MAAA,CAAKT,UAAWC,EAAO6G,WAAW3G,SAAA,CAC/BsE,IACCe,IAAqBnD,IACrB5B,EAAA,MAAA,CAAKT,UAAWC,EAAOyB,WAAWvB,SAC/BqF,CAAAA,GACAnD,WAMRwB,IAAa9D,EAAA,MAAA,CAAKC,UAAWC,EAAOuH,OAAOrH,SAAEoE,QAG/CV,IACC9D,EAAC0H,EAAQ,CAACC,GAAIlE,GAAiBmE,QAAS,IAAKC,eAAa,EAAAzH,SACxDJ,EAAA,MAAA,CAAKC,UAAWC,EAAO4H,eAAe1H,SACpCJ,EAAC+H,EAAkB,CACjB/F,QAAS0B,GACTzB,eAAgBoB,GAAkBA,GAAgBpB,eAAiBA,EACnEC,iBACEmB,GAAkBA,GAAgBnB,iBAAmBA,EAEvDY,YAAaW,GACbV,WAAYS,GACZZ,kBACES,GAAkBA,GAAgBT,kBAAoBA,YAQtE"}
|
|
1
|
+
{"version":3,"file":"CommentCard.js","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { CurveTooltip } from '../CurveTooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n chipValue,\n chipUnit,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <CurveTooltip data={{ rows: contextRows ?? [] }}>\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </CurveTooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <CurveTooltip\n data={\n hasMetadata || chipValue != null\n ? {\n title: chip,\n value: chipValue,\n unit: chipUnit,\n color: chipColor,\n rows: contextRows ?? [],\n }\n : { rows: [] }\n }\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </CurveTooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","chipValue","chipUnit","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","className","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","_jsx","CurveTooltip","data","rows","children","styles","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","_jsxs","text","title","value","unit","color","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"+zMAoBO,IAAMA,EAAcC,GAA6C,SAACC,EAAOC,GAC9E,IACEC,EAoCEF,EApCFE,SAAQC,EAoCNH,EAnCFI,QAAAA,aAAU,WAAUD,EACpBE,EAkCEL,EAlCFK,OACAC,EAiCEN,EAjCFM,UACAC,EAgCEP,EAhCFO,SACAC,EA+BER,EA/BFQ,KACAC,EA8BET,EA9BFS,YACAC,EA6BEV,EA7BFU,WACAC,EA4BEX,EA5BFW,kBACAC,EA2BEZ,EA3BFY,QACAC,EA0BEb,EA1BFa,WACAC,EAyBEd,EAzBFc,cACAC,EAwBEf,EAxBFe,QACAC,EAuBEhB,EAvBFgB,eACAC,EAsBEjB,EAtBFiB,iBACAC,EAqBElB,EArBFkB,YACAC,EAoBEnB,EApBFmB,kBACAC,EAmBEpB,EAnBFoB,kBACAC,EAkBErB,EAlBFqB,eACAC,EAiBEtB,EAjBFsB,KACAC,EAgBEvB,EAhBFuB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