@corva/ui 3.79.0-9 → 3.79.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
  2. package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
  3. package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
  4. package/cjs-bundle/components/CurveTooltip/CurveTooltip.js +2 -0
  5. package/cjs-bundle/components/CurveTooltip/CurveTooltip.js.map +1 -0
  6. package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js +2 -0
  7. package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
  8. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
  9. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
  10. package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js +1 -1
  11. package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
  12. package/cjs-bundle/componentsV2/ColorPicker/Swatches/Swatches.js +1 -1
  13. package/cjs-bundle/componentsV2/ColorPicker/Swatches/Swatches.js.map +1 -1
  14. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js +1 -1
  15. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js.map +1 -1
  16. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js +1 -1
  17. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js.map +1 -1
  18. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js +1 -1
  19. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js.map +1 -1
  20. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
  21. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
  22. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js +1 -1
  23. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js.map +1 -1
  24. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js +1 -1
  25. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js.map +1 -1
  26. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
  27. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
  28. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js +1 -1
  29. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js.map +1 -1
  30. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js +1 -1
  31. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js.map +1 -1
  32. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js +1 -1
  33. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js.map +1 -1
  34. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
  35. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
  36. package/cjs-bundle/componentsV2/DragHandle/DragHandle.js +1 -1
  37. package/cjs-bundle/componentsV2/DragHandle/DragHandle.js.map +1 -1
  38. package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.js +1 -1
  39. package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.js.map +1 -1
  40. package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js +1 -1
  41. package/cjs-bundle/config/highcharts/highcharts.js +1 -1
  42. package/cjs-bundle/config/highcharts/highcharts.js.map +1 -1
  43. package/components/CommentCard/CommentCard.d.ts.map +1 -1
  44. package/components/CommentCard/CommentCard.js +1 -1
  45. package/components/CommentCard/CommentCard.js.map +1 -1
  46. package/components/CommentCard/CommentCard.scss.js +1 -1
  47. package/components/CommentCard/CommentCard.types.d.ts +3 -0
  48. package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
  49. package/components/CurveTooltip/CurveTooltip.d.ts +24 -0
  50. package/components/CurveTooltip/CurveTooltip.d.ts.map +1 -0
  51. package/components/CurveTooltip/CurveTooltip.js +2 -0
  52. package/components/CurveTooltip/CurveTooltip.js.map +1 -0
  53. package/components/CurveTooltip/CurveTooltip.scss.js +2 -0
  54. package/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
  55. package/components/CurveTooltip/index.d.ts +2 -0
  56. package/components/CurveTooltip/index.d.ts.map +1 -0
  57. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts +1 -0
  58. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts.map +1 -1
  59. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
  60. package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
  61. package/components/NewCommentCursor/NewCommentCursor.d.ts +2 -0
  62. package/components/NewCommentCursor/NewCommentCursor.d.ts.map +1 -1
  63. package/components/NewCommentCursor/NewCommentCursor.js +1 -1
  64. package/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
  65. package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts +2 -0
  66. package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts.map +1 -0
  67. package/componentsV2/ColorPicker/Swatches/Swatches.js +1 -1
  68. package/componentsV2/ColorPicker/Swatches/Swatches.js.map +1 -1
  69. package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.d.ts.map +1 -1
  70. package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js +1 -1
  71. package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js.map +1 -1
  72. package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.d.ts.map +1 -1
  73. package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js +1 -1
  74. package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js.map +1 -1
  75. package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.d.ts.map +1 -1
  76. package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js +1 -1
  77. package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js.map +1 -1
  78. package/componentsV2/CompletionsOffsetWellPicker/Map/Map.d.ts.map +1 -1
  79. package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
  80. package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
  81. package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.d.ts.map +1 -1
  82. package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js +1 -1
  83. package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js.map +1 -1
  84. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.d.ts.map +1 -1
  85. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js +1 -1
  86. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js.map +1 -1
  87. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
  88. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
  89. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.d.ts.map +1 -1
  90. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js +1 -1
  91. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js.map +1 -1
  92. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.d.ts.map +1 -1
  93. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js +1 -1
  94. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js.map +1 -1
  95. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.d.ts.map +1 -1
  96. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js +1 -1
  97. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js.map +1 -1
  98. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.d.ts +1 -0
  99. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.d.ts.map +1 -1
  100. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
  101. package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
  102. package/componentsV2/DragHandle/DragHandle.d.ts +1 -0
  103. package/componentsV2/DragHandle/DragHandle.d.ts.map +1 -1
  104. package/componentsV2/DragHandle/DragHandle.js +1 -1
  105. package/componentsV2/DragHandle/DragHandle.js.map +1 -1
  106. package/componentsV2/DragHandle/DragHandle.stories.d.ts +1 -0
  107. package/componentsV2/DragHandle/DragHandle.stories.d.ts.map +1 -1
  108. package/componentsV2/OffsetWellsButton/OffsetWellsButton.d.ts.map +1 -1
  109. package/componentsV2/OffsetWellsButton/OffsetWellsButton.js +1 -1
  110. package/componentsV2/OffsetWellsButton/OffsetWellsButton.js.map +1 -1
  111. package/componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js +1 -1
  112. package/config/highcharts/highcharts.d.ts.map +1 -1
  113. package/config/highcharts/highcharts.js +1 -1
  114. package/config/highcharts/highcharts.js.map +1 -1
  115. package/mcp-server/server.mjs +71 -5
  116. package/package.json +1 -1
  117. 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,GAC9E,IACEC,EAkCEF,EAlCFE,SAAQC,EAkCNH,EAjCFI,QAAAA,aAAU,WAAUD,EACpBE,EAgCEL,EAhCFK,OACAC,EA+BEN,EA/BFM,UACAC,EA8BEP,EA9BFO,SACAC,EA6BER,EA7BFQ,KACAC,EA4BET,EA5BFS,YACAC,EA2BEV,EA3BFU,WACAC,EA0BEX,EA1BFW,kBACAC,EAyBEZ,EAzBFY,QACAC,EAwBEb,EAxBFa,WACAC,EAuBEd,EAvBFc,cACAC,EAsBEf,EAtBFe,QACAC,EAqBEhB,EArBFgB,eACAC,EAoBEjB,EApBFiB,iBACAC,EAmBElB,EAnBFkB,YACAC,EAkBEnB,EAlBFmB,kBACAC,EAiBEpB,EAjBFoB,kBACAC,EAgBErB,EAhBFqB,eACAC,EAeEtB,EAfFsB,KACAC,EAcEvB,EAdFuB,UACAC,EAaExB,EAbFwB,OACAC,EAYE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,OAAQzC,MAAO,CAAEuB,UAAWC,EAAAA,yBAA0BpG,SAC3E,CAAAM,EAAAkE,KAAA,MAAA,CAAK3E,UAAWC,EAAOwH,YAAYtH,SAAA,CAChCgH,GAED1G,EAAAkE,KAAA,MAAA,CAAK3E,UAAWC,EAAO+G,WAAW7G,SAAA,CAC/BuE,IACCgB,IAAqBpD,IACrB7B,EAAAkE,KAAA,MAAA,CAAK3E,UAAWC,EAAO0B,WAAWxB,SAC/BuF,CAAAA,GACApD,WAMRwB,IAAa/D,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAOyH,OAAOvH,SAAEqE,QAG/CV,IACC/D,EAAAY,IAACgH,WAAQ,CAACC,GAAInE,GAAiBoE,QAAS,IAAKC,eAAa,EAAA3H,SACxDJ,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAO8H,eAAe5H,SACpCJ,MAACiI,qBAAkB,CACjBhG,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","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,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,UACAC,EAeExB,EAfFwB,UACAC,EAcEzB,EAdFyB,SACAC,EAaE1B,EAbF0B,OACAC,EAYE3B,EAZF2B,cACAC,EAWE5B,EAXF4B,UACAC,EAUE7B,EAVF6B,kBACAC,EASE9B,EATF8B,U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MAAA,CAAK5B,UAAWmB,EAAO2D,YAAY7D,SAAA,CAChCuD,GAED7C,EAAAC,KAAA,MAAA,CAAK5B,UAAWmB,EAAOkD,WAAWpD,SAAA,CAC/BS,IACCqB,IAAqB/D,IACrB2C,EAAAC,KAAA,MAAA,CAAK5B,UAAWmB,EAAO9C,WAAW4C,SAC/B8B,CAAAA,GACA/D,WAMR2B,IAAaE,EAAAK,IAAA,MAAA,CAAKlB,UAAWmB,EAAO4D,OAAO9D,SAAEO,QAG/Cb,IACCE,EAAAK,IAAC8D,WAAQ,CAACC,GAAI3E,GAAiB4E,QAAS,IAAKC,eAAa,EAAAlE,SACxDJ,EAAAK,IAAA,MAAA,CAAKlB,UAAWmB,EAAOiE,eAAenE,SACpCJ,MAACwE,qBAAkB,CACjB3G,QAAS6B,GACT5B,eAAgBuB,GAAkBA,GAAgBvB,eAAiBA,EACnEC,iBACEsB,GAAkBA,GAAgBtB,iBAAmBA,EAEvDc,YAAaY,GACbX,WAAYU,GACZb,kBACEU,GAAkBA,GAAgBV,kBAAoBA,YAQtE"}
@@ -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)}.CommentCard_metadataTooltip__AL0xt .MuiTooltip-tooltip{max-width:none!important}.CommentCard_metadataRows__c-kqf{display:flex;flex-direction:column;gap:4px;padding:4px 0}.CommentCard_metadataRow__BqcII{align-items:baseline;display:flex;font-size:14px;gap:4px;line-height:20px;white-space:nowrap}.CommentCard_metadataLabel__WRWl7{color:var(--palette-primary-text-6)}.CommentCard_metadataValue__Xwf7S{color:var(--palette-primary-text-1)}.CommentCard_metadataUnit__Bxeps{color:var(--palette-primary-text-6);font-size:12px}.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",metadataTooltip:"CommentCard_metadataTooltip__AL0xt",metadataRows:"CommentCard_metadataRows__c-kqf",metadataRow:"CommentCard_metadataRow__BqcII",metadataLabel:"CommentCard_metadataLabel__WRWl7",metadataValue:"CommentCard_metadataValue__Xwf7S",metadataUnit:"CommentCard_metadataUnit__Bxeps",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"};
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"),c=require("./IsolatedPage.module.css.js"),i=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u,l=s(e),p=s(r),f=s(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 b(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 v=/(^|[\^~>=\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&&v.test(o))},g=(u={},f.default(u,"data-corva-app-iframe",!0),f.default(u,"data-testid","isolatedAppContainer"),u);exports.APP_IFRAME_ATTRIBUTE="data-corva-app-iframe",exports.IsolatedPage=function(e){var r,t,s=p.default({},e),u=n.useRef(null),f=n.useRef(null),d=n.useState(!0),v=l.default(d,2),O=v[0],P=v[1],j=n.useCallback((function(){P(!1)}),[]),h=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),c=Object.keys(r);if(a.length!==c.length)return!1;for(var i=0,s=c;i<s.length;i++){var u=s[i];if(!Object.prototype.hasOwnProperty.call(e,u))return!1;if(!((t=e[u])===(n=r[u])||"function"==typeof t&&"function"==typeof n||o.isEqual(t,n)))return!1}return!0}(f.current||{},r);if(e.xprops=b({},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=u.current)||void 0===e?void 0:e.contentWindow;h(r,s)}catch(e){console.error("[IsolatedPage] Error accessing iframe contentWindow:",e)}})),n.useEffect((function(){return function(){try{var e,r=null===(e=u.current)||void 0===e?void 0:e.contentWindow;r&&r.xprops&&delete r.xprops}catch(e){console.error("[IsolatedPage] Error cleaning up xprops:",e)}f.current=null;var t=u.current;if(t)try{t.src="about:blank"}catch(e){console.error("[IsolatedPage] Error setting iframe src to about:blank:",e)}u.current=null}}),[]),i.jsxs("div",{className:c.container,children:[O&&i.jsx(a,{}),i.jsx("iframe",b({ref:u,src:(r=s.app,t=window.__DC_REACT17_ISOLATED_PAGE_PATH__,t&&y(r)?t:"/DevCenterIsolatedAppPage.html"),onLoad:j,className:c.iframe},g))]})},exports.isReact17App=y;
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,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,wB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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,EAAAA,EAAQA,UAAC,GAAKC,EAAAC,EAAAA,QAAAC,EAAA,GAAzCC,EAASH,EAAA,GAAEI,EAAYJ,EAAA,GAExBK,EAAmBC,EAAAA,aAAY,WACnCF,GAAa,EACd,GAAE,IAMGG,EAAe,SACnBC,EACAC,GAEA,GAAKD,EAAL,CAEA,IAAME,GAAgBF,EAAaG,OAE7BC,GAzFa,SACrBC,EACAC,GAEA,GAAID,IAASC,EAAM,OAAO,EAC1B,IAA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qBgC,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 l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r),o=e.forwardRef((function(e,r){var l=e.size,o=void 0===l?40:l,d=e.onClick,n=e.className,u=e.testId;return i.jsx("div",{ref:r,"data-testid":u,className:s.default(t.root,n),style:{width:o,height:o},onClick:d,children:i.jsxs("svg",{width:.48839026568430455*o,height:.48839026568430455*o,viewBox:"0 0 8.75 8.75",fill:"none","aria-hidden":!0,children:[i.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"}),i.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"})]})})}));exports.NewCommentCursor=o;
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 <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"],"names":["NewCommentCursor","forwardRef","ref","_ref$size","_ref","size","onClick","className","testId","_jsx","classNames","styles","root","style","width","height","children","_jsxs","jsxs","viewBox","fill","jsx","fillRule","clipRule","d"],"mappings":"6QAmBaA,EAAmBC,EAAUA,YACxC,WAA4CC,GAAG,IAAAC,EAAAC,EAA5CC,KAAAA,aAAO,GAAEF,EAAEG,IAAAA,QAASC,IAAAA,UAAWC,IAAAA,OAAM,OACtCC,EAAAA,IAAA,MAAA,CACEP,IAAKA,EACL,cAAaM,EACbD,UAAWG,EAAU,QAACC,EAAOC,KAAML,GACnCM,MAAO,CAAEC,MAAOT,EAAMU,OAAQV,GAC9BC,QAASA,EAAQU,SAEjBC,EAAAC,KAAA,MAAA,CACEJ,MAZY,mBAYLT,EACPU,OAbY,mBAaJV,EACRc,QAAQ,gBACRC,KAAK,OACL,eAAW,EAAAJ,SAEX,CAAAP,EAAAY,IAAA,OAAA,CACEC,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFJ,KAAK,iBAEPX,EAAAY,IAAA,OAAA,CACEC,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFJ,KAAK,qBAGL"}
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 s=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("@babel/runtime/helpers/defineProperty"),e=require("classnames"),c=require("lodash"),n=require("react"),r=require("../utils.js"),i=require("./constants.js"),t=require("./Swatches.scss.js"),u=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");var a=require("react/jsx-runtime");function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var m=l(s),j=l(o),q=l(e),I=["a"];function d(s,o){var e=Object.keys(s);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);o&&(c=c.filter((function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable}))),e.push.apply(e,c)}return e}function p(s){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?d(Object(e),!0).forEach((function(o){j.default(s,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(e)):d(Object(e)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(e,o))}))}return s}exports.Swatches=function(s){var o=s.value,e=s.onChange,l=s.addTransparent,j=s.autoFocus,d=s.onAutoFocus,b=n.useRef([]),f=p(p({},o),{},{a:1}),h=0===o.a,C=l?i.paletteColors.toSpliced(i.paletteColors.length-1,1,"#FFFFFF00"):i.paletteColors,O=function(s){var o=r.parseColor(s),e=o.a,n=p(p({},m.default(o,I)),{},{a:1}),i=0===e;return c.isEqual(f,n)&&!i&&!h||h&&i},v=C.findIndex(O);n.useEffect((function(){if(j){var s=-1===v?0:v,o=b.current[s];o&&(o.focus({preventScroll:!0}),null==d||d())}}),[j,d,v]);var g=function(s,o){var c;(e(r.parseColor(C[s])),o)&&(null===(c=b.current[s])||void 0===c||c.focus({preventScroll:!0}))},F=function(s){var o,e=Number(s.currentTarget.dataset.index);switch(s.key){case"ArrowRight":o=(e+1)%C.length;break;case"ArrowLeft":o=(e-1+C.length)%C.length;break;case"ArrowDown":o=(e+12)%C.length;break;case"ArrowUp":o=(e-12+C.length)%C.length;break;case"Home":o=0;break;case"End":o=C.length-1;break;case"Enter":case" ":return s.preventDefault(),void g(e,!1);default:return}"number"==typeof o&&(s.preventDefault(),g(o,!0))};return a.jsx("div",{className:t.root,role:"radiogroup","aria-label":"Color palette",children:C.map((function(s,o){var c=r.parseColor(s),n=r.getLuminance(s)>.97,i=0===c.a,l=O(s);return a.jsx("div",{ref:function(s){b.current[o]=s},className:q.default(t.swatch,l&&t.selected,i&&t.transparent,(n||i)&&t.darkAccent),onClick:function(){return e(c)},onKeyDown:F,style:i?void 0:{background:s},role:"radio","aria-checked":l,"aria-label":i?"Transparent":s.toUpperCase(),tabIndex:l||-1===v&&0===o?0:-1,"data-index":o,children:a.jsx(u.CheckSmallIcon,{size:14,className:t.icon})},s)}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("@babel/runtime/helpers/defineProperty"),e=require("classnames"),c=require("lodash"),n=require("react"),r=require("../utils.js"),i=require("./constants.js"),u=require("./Swatches.scss.js"),t=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");var a=require("react/jsx-runtime");function l(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var m=l(s),j=l(o),q=l(e),I=["a"];function d(s,o){var e=Object.keys(s);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);o&&(c=c.filter((function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable}))),e.push.apply(e,c)}return e}function p(s){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?d(Object(e),!0).forEach((function(o){j.default(s,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(e)):d(Object(e)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(e,o))}))}return s}exports.Swatches=function(s){var o=s.value,e=s.onChange,l=s.addTransparent,j=s.autoFocus,d=s.onAutoFocus,b=n.useRef([]),f=p(p({},o),{},{a:1}),h=0===o.a,C=l?i.paletteColors.toSpliced(11,1,"#FFFFFF00"):i.paletteColors,O=function(s){var o=r.parseColor(s),e=o.a,n=p(p({},m.default(o,I)),{},{a:1}),i=0===e;return c.isEqual(f,n)&&!i&&!h||h&&i},v=C.findIndex(O);n.useEffect((function(){if(j){var s=-1===v?0:v,o=b.current[s];o&&(o.focus({preventScroll:!0}),null==d||d())}}),[j,d,v]);var g=function(s,o){var c;(e(r.parseColor(C[s])),o)&&(null===(c=b.current[s])||void 0===c||c.focus({preventScroll:!0}))},F=function(s){var o,e=Number(s.currentTarget.dataset.index);switch(s.key){case"ArrowRight":o=(e+1)%C.length;break;case"ArrowLeft":o=(e-1+C.length)%C.length;break;case"ArrowDown":o=(e+12)%C.length;break;case"ArrowUp":o=(e-12+C.length)%C.length;break;case"Home":o=0;break;case"End":o=C.length-1;break;case"Enter":case" ":return s.preventDefault(),void g(e,!1);default:return}"number"==typeof o&&(s.preventDefault(),g(o,!0))};return a.jsx("div",{className:u.root,role:"radiogroup","aria-label":"Color palette",children:C.map((function(s,o){var c=r.parseColor(s),n=r.getLuminance(s)>.97,i=0===c.a,l=O(s);return a.jsx("div",{ref:function(s){b.current[o]=s},className:q.default(u.swatch,l&&u.selected,i&&u.transparent,(n||i)&&u.darkAccent),onClick:function(){return e(c)},onKeyDown:F,style:i?void 0:{background:s},role:"radio","aria-checked":l,"aria-label":i?"Transparent":s.toUpperCase(),tabIndex:l||-1===v&&0===o?0:-1,"data-index":o,children:a.jsx(t.CheckSmallIcon,{size:14,className:u.icon})},s)}))})};
2
2
  //# sourceMappingURL=Swatches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Swatches.js","sources":["../../../../../src/componentsV2/ColorPicker/Swatches/Swatches.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { isEqual } from 'lodash';\nimport { KeyboardEventHandler, useEffect, useRef } from 'react';\n\nimport { ColorChannels, getLuminance, parseColor } from '../utils';\n\nimport { paletteColors } from './constants';\n\nimport styles from './Swatches.scss';\n\nimport { CheckSmallIcon } from '~/icons';\n\nexport type SwatchesProps = {\n /**\n * Hex or rgba, with or without alpha\n */\n value: ColorChannels;\n onChange: (color: ColorChannels) => void;\n addTransparent?: boolean;\n autoFocus?: boolean;\n onAutoFocus?: () => void;\n};\n\nconst colorsPerRow = 12;\n\nexport const Swatches = ({\n value,\n onChange,\n addTransparent,\n autoFocus,\n onAutoFocus,\n}: SwatchesProps) => {\n const swatchRefs = useRef<Array<HTMLDivElement | null>>([]);\n const opaqueValue = { ...value, a: 1 };\n const isValueTransparent = value.a === 0;\n\n const colors = addTransparent\n ? paletteColors.toSpliced(paletteColors.length - 1, 1, '#FFFFFF00')\n : paletteColors;\n\n const isSelectedColor = (color: string) => {\n const { a, ...colorChannels } = parseColor(color);\n const opaqueColor = { ...colorChannels, a: 1 };\n const isTransparent = a === 0;\n\n return (\n (isEqual(opaqueValue, opaqueColor) && !isTransparent && !isValueTransparent) ||\n (isValueTransparent && isTransparent)\n );\n };\n\n const selectedIndex = colors.findIndex(isSelectedColor);\n\n useEffect(() => {\n if (!autoFocus) {\n return;\n }\n\n const focusIndex = selectedIndex === -1 ? 0 : selectedIndex;\n const swatch = swatchRefs.current[focusIndex];\n\n if (swatch) {\n swatch.focus({ preventScroll: true });\n onAutoFocus?.();\n }\n }, [autoFocus, onAutoFocus, selectedIndex]);\n\n const selectColor = (index: number, focus: boolean) => {\n onChange(parseColor(colors[index]));\n\n if (focus) {\n swatchRefs.current[index]?.focus({ preventScroll: true });\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = event => {\n const currentIndex = Number(event.currentTarget.dataset.index);\n let nextIndex: number | undefined;\n\n switch (event.key) {\n case 'ArrowRight':\n nextIndex = (currentIndex + 1) % colors.length;\n break;\n case 'ArrowLeft':\n nextIndex = (currentIndex - 1 + colors.length) % colors.length;\n break;\n case 'ArrowDown':\n nextIndex = (currentIndex + colorsPerRow) % colors.length;\n break;\n case 'ArrowUp':\n nextIndex = (currentIndex - colorsPerRow + colors.length) % colors.length;\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = colors.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n selectColor(currentIndex, false);\n return;\n default:\n return;\n }\n\n if (typeof nextIndex === 'number') {\n event.preventDefault();\n selectColor(nextIndex, true);\n }\n };\n\n return (\n <div className={styles.root} role=\"radiogroup\" aria-label=\"Color palette\">\n {colors.map((color, index) => {\n const channels = parseColor(color);\n const isLightColor = getLuminance(color) > 0.97;\n const isTransparent = channels.a === 0;\n const isSelected = isSelectedColor(color);\n\n return (\n <div\n key={color}\n ref={element => {\n swatchRefs.current[index] = element;\n }}\n className={classNames(\n styles.swatch,\n isSelected && styles.selected,\n isTransparent && styles.transparent,\n (isLightColor || isTransparent) && styles.darkAccent\n )}\n onClick={() => onChange(channels)}\n onKeyDown={handleKeyDown}\n style={isTransparent ? undefined : { background: color }}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={isTransparent ? 'Transparent' : color.toUpperCase()}\n tabIndex={isSelected || (selectedIndex === -1 && index === 0) ? 0 : -1}\n data-index={index}\n >\n <CheckSmallIcon size={14} className={styles.icon} />\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["_ref","value","onChange","addTransparent","autoFocus","onAutoFocus","swatchRefs","useRef","opaqueValue","a","isValueTransparent","colors","paletteColors","toSpliced","length","isSelectedColor","color","parseColor","opaqueColor","_objectWithoutProperties","_parseColor","_excluded","isTransparent","isEqual","selectedIndex","findIndex","useEffect","focusIndex","swatch","current","focus","preventScroll","selectColor","index","_swatchRefs$current$i","handleKeyDown","event","nextIndex","currentIndex","Number","currentTarget","dataset","key","preventDefault","_jsx","className","styles","root","role","children","map","channels","isLightColor","getLuminance","isSelected","ref","element","classNames","selected","transparent","darkAccent","onClick","onKeyDown","style","undefined","background","toUpperCase","tabIndex","CheckSmallIcon","size","icon"],"mappings":"g0KAyBwB,SAMHA,GAAA,IALnBC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,eACAC,IAAAA,UACAC,IAAAA,YAEMC,EAAaC,SAAqC,IAClDC,SAAmBP,GAAK,GAAA,CAAEQ,EAAG,IAC7BC,EAAiC,IAAZT,EAAMQ,EAE3BE,EAASR,EACXS,EAAaA,cAACC,UAAUD,EAAAA,cAAcE,OAAS,EAAG,EAAG,aACrDF,EAAAA,cAEEG,EAAkB,SAACC,GACvB,IAAgCC,EAAAA,EAAUA,WAACD,GAAnCP,IAAAA,EACFS,SADqBC,EAAA,QAAAC,EAAAC,IACW,GAAA,CAAEZ,EAAG,IACrCa,EAAsB,IAANb,EAEtB,OACGc,EAAOA,QAACf,EAAaU,K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ACzB6C,EAAavC,EAAgBC,GAEnC,OACE4B,EAAAA,IAAA,MAAA,CAEEW,IAAK,SAAAC,GACHlD,EAAWuB,QAAQI,GAASuB,CAC5B,EACFX,UAAWY,EAAU,QACnBX,EAAOlB,OACP0B,GAAcR,EAAOY,SACrBpC,GAAiBwB,EAAOa,aACvBP,GAAgB9B,IAAkBwB,EAAOc,YAE5CC,QAAS,WAAA,OAAM3D,EAASiD,EAAU,EAClCW,UAAW3B,EACX4B,MAAOzC,OAAgB0C,EAAY,CAAEC,WAAYjD,GACjDgC,KAAK,QACL,eAAcM,EACd,aAAYhC,EAAgB,cAAgBN,EAAMkD,cAClDC,SAAUb,IAAkC,IAAnB9B,GAAkC,IAAVS,EAAe,GAAK,EACrE,aAAYA,EAAMgB,SAElBL,MAACwB,iBAAc,CAACC,KAAM,GAAIxB,UAAWC,EAAOwB,QAnBvCtD,OAyBjB"}
1
+ {"version":3,"file":"Swatches.js","sources":["../../../../../src/componentsV2/ColorPicker/Swatches/Swatches.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { isEqual } from 'lodash';\nimport { KeyboardEventHandler, useEffect, useRef } from 'react';\n\nimport { ColorChannels, getLuminance, parseColor } from '../utils';\n\nimport { paletteColors } from './constants';\n\nimport styles from './Swatches.scss';\n\nimport { CheckSmallIcon } from '~/icons';\n\nexport type SwatchesProps = {\n /**\n * Hex or rgba, with or without alpha\n */\n value: ColorChannels;\n onChange: (color: ColorChannels) => void;\n addTransparent?: boolean;\n autoFocus?: boolean;\n onAutoFocus?: () => void;\n};\n\nconst colorsPerRow = 12;\n\nexport const Swatches = ({\n value,\n onChange,\n addTransparent,\n autoFocus,\n onAutoFocus,\n}: SwatchesProps) => {\n const swatchRefs = useRef<Array<HTMLDivElement | null>>([]);\n const opaqueValue = { ...value, a: 1 };\n const isValueTransparent = value.a === 0;\n\n const colors = addTransparent\n ? paletteColors.toSpliced(colorsPerRow - 1, 1, '#FFFFFF00')\n : paletteColors;\n\n const isSelectedColor = (color: string) => {\n const { a, ...colorChannels } = parseColor(color);\n const opaqueColor = { ...colorChannels, a: 1 };\n const isTransparent = a === 0;\n\n return (\n (isEqual(opaqueValue, opaqueColor) && !isTransparent && !isValueTransparent) ||\n (isValueTransparent && isTransparent)\n );\n };\n\n const selectedIndex = colors.findIndex(isSelectedColor);\n\n useEffect(() => {\n if (!autoFocus) {\n return;\n }\n\n const focusIndex = selectedIndex === -1 ? 0 : selectedIndex;\n const swatch = swatchRefs.current[focusIndex];\n\n if (swatch) {\n swatch.focus({ preventScroll: true });\n onAutoFocus?.();\n }\n }, [autoFocus, onAutoFocus, selectedIndex]);\n\n const selectColor = (index: number, focus: boolean) => {\n onChange(parseColor(colors[index]));\n\n if (focus) {\n swatchRefs.current[index]?.focus({ preventScroll: true });\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = event => {\n const currentIndex = Number(event.currentTarget.dataset.index);\n let nextIndex: number | undefined;\n\n switch (event.key) {\n case 'ArrowRight':\n nextIndex = (currentIndex + 1) % colors.length;\n break;\n case 'ArrowLeft':\n nextIndex = (currentIndex - 1 + colors.length) % colors.length;\n break;\n case 'ArrowDown':\n nextIndex = (currentIndex + colorsPerRow) % colors.length;\n break;\n case 'ArrowUp':\n nextIndex = (currentIndex - colorsPerRow + colors.length) % colors.length;\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = colors.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n selectColor(currentIndex, false);\n return;\n default:\n return;\n }\n\n if (typeof nextIndex === 'number') {\n event.preventDefault();\n selectColor(nextIndex, true);\n }\n };\n\n return (\n <div className={styles.root} role=\"radiogroup\" aria-label=\"Color palette\">\n {colors.map((color, index) => {\n const channels = parseColor(color);\n const isLightColor = getLuminance(color) > 0.97;\n const isTransparent = channels.a === 0;\n const isSelected = isSelectedColor(color);\n\n return (\n <div\n key={color}\n ref={element => {\n swatchRefs.current[index] = element;\n }}\n className={classNames(\n styles.swatch,\n isSelected && styles.selected,\n isTransparent && styles.transparent,\n (isLightColor || isTransparent) && styles.darkAccent\n )}\n onClick={() => onChange(channels)}\n onKeyDown={handleKeyDown}\n style={isTransparent ? undefined : { background: color }}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={isTransparent ? 'Transparent' : color.toUpperCase()}\n tabIndex={isSelected || (selectedIndex === -1 && index === 0) ? 0 : -1}\n data-index={index}\n >\n <CheckSmallIcon size={14} className={styles.icon} />\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["_ref","value","onChange","addTransparent","autoFocus","onAutoFocus","swatchRefs","useRef","opaqueValue","a","isValueTransparent","colors","paletteColors","toSpliced","colorsPerRow","isSelectedColor","color","parseColor","opaqueColor","_objectWithoutProperties","_parseColor","_excluded","isTransparent","isEqual","selectedIndex","findIndex","useEffect","focusIndex","swatch","current","focus","preventScroll","selectColor","index","_swatchRefs$current$i","handleKeyDown","event","nextIndex","currentIndex","Number","currentTarget","dataset","key","length","preventDefault","_jsx","className","styles","root","role","children","map","channels","isLightColor","getLuminance","isSelected","ref","element","classNames","selected","transparent","darkAccent","onClick","onKeyDown","style","undefined","background","toUpperCase","tabIndex","CheckSmallIcon","size","icon"],"mappings":"g0KAyBwB,SAMHA,GAAA,IALnBC,IAAAA,MACAC,IAAAA,SACAC,IAAAA,eACAC,IAAAA,UACAC,IAAAA,YAEMC,EAAaC,SAAqC,IAClDC,SAAmBP,GAAK,GAAA,CAAEQ,EAAG,IAC7BC,EAAiC,IAAZT,EAAMQ,EAE3BE,EAASR,EACXS,EAAAA,cAAcC,UAAUC,GAAkB,EAAG,aAC7CF,gBAEEG,EAAkB,SAACC,GACvB,IAAgCC,EAAAA,EAAUA,WAACD,GAAnCP,IAAAA,EACFS,SADqBC,EAAA,QAAAC,EAAAC,IACW,GAAA,CAAEZ,EAAG,IACrCa,EAAsB,IAANb,EAEtB,OACGc,EAAOA,QAACf,EAAaU,KAAiBI,IAAkBZ,GACxDA,GAAsBY,GAIrBE,EAAgBb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,EAAAA,IAAA,MAAA,CAEEW,IAAK,SAAAC,GACHnD,EAAWuB,QAAQI,GAASwB,CAC5B,EACFX,UAAWY,EAAU,QACnBX,EAAOnB,OACP2B,GAAcR,EAAOY,SACrBrC,GAAiByB,EAAOa,aACvBP,GAAgB/B,IAAkByB,EAAOc,YAE5CC,QAAS,WAAA,OAAM5D,EAASkD,EAAU,EAClCW,UAAW5B,EACX6B,MAAO1C,OAAgB2C,EAAY,CAAEC,WAAYlD,GACjDiC,KAAK,QACL,eAAcM,EACd,aAAYjC,EAAgB,cAAgBN,EAAMmD,cAClDC,SAAUb,IAAkC,IAAnB/B,GAAkC,IAAVS,EAAe,GAAK,EACrE,aAAYA,EAAMiB,SAElBL,MAACwB,iBAAc,CAACC,KAAM,GAAIxB,UAAWC,EAAOwB,QAnBvCvD,OAyBjB"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react"),t=require("../../TextInput/TextInput.js"),l=require("../../Autocomplete/Autocomplete.js"),a=require("./useOptions.js"),s=require("./useAssetFiltersHandlers.js"),n=require("./AssetFilters.scss.js"),r=require("react/jsx-runtime"),i=e.memo((function(e){var i=e.pads,o=e.selectedPadId,u=e.filters,d=e.setFilters,c=a.useOptions(i,o),p=c.fracFleetOptions,m=c.formationOptions,h=c.padOptions,x=s.useAssetFiltersHandlers(d),v=x.handlePadStatusChange,j=x.handleTvdMinChange,b=x.handleTvdMaxChange,F=x.handleFracFleetsSelect,A=x.handleFormationsSelect;return r.jsxs("div",{className:n.filters,children:[r.jsx("div",{children:r.jsx(l.Autocomplete,{clearable:!1,className:n.autocomplete,label:"Pad",value:u.padStatus,onChange:v,options:h})}),r.jsx("div",{children:r.jsx(l.Autocomplete,{clearable:!1,className:n.autocomplete,label:"Frac Fleet",value:u.selectedFracFleets,onChange:F,useAllOption:!0,dropdownClassName:n.dropdown,multiple:!0,options:p.map((function(e){return{id:e.value,title:e.label}}))})}),r.jsx("div",{children:r.jsx(l.Autocomplete,{clearable:!1,className:n.autocomplete,useAllOption:!0,label:"Formation",value:u.selectedFormations,onChange:A,multiple:!0,dropdownClassName:n.dropdown,options:m.map((function(e){return{id:e.value,title:e.label}}))})}),r.jsx("div",{children:r.jsx(t.TextInput,{className:n.input,label:"TVD (Min)",placeholder:"0",type:"number",htmlAttributes:{min:0},value:u.tvdMin,onChange:j})}),r.jsx("div",{children:r.jsx(t.TextInput,{className:n.input,label:"TVD (Max)",placeholder:"10000",type:"number",htmlAttributes:{min:0},value:u.tvdMax,onChange:b})})]})}));module.exports=i;
1
+ "use strict";var e=require("react"),t=require("../../TextInput/TextInput.js"),s=require("../../Autocomplete/Autocomplete.js"),l=require("./useOptions.js"),a=require("./useAssetFiltersHandlers.js"),n=require("./AssetFilters.scss.js"),r=require("react/jsx-runtime"),o=e.memo((function(e){var o=e.pads,i=e.selectedPadId,d=e.filters,u=e.setFilters,p=l.useOptions(o,i),c=p.fracFleetOptions,m=p.formationOptions,h=p.padOptions,v=a.useAssetFiltersHandlers(u),x=v.handlePadStatusChange,j=v.handleTvdMinChange,F=v.handleTvdMaxChange,b=v.handleFracFleetsSelect,A=v.handleFormationsSelect;return r.jsxs("div",{className:n.filters,"data-testid":"assetFilters",children:[r.jsx("div",{children:r.jsx(s.Autocomplete,{clearable:!1,className:n.autocomplete,label:"Pad",value:d.padStatus,onChange:x,options:h,testId:"padStatusDropdown"})}),r.jsx("div",{children:r.jsx(s.Autocomplete,{clearable:!1,className:n.autocomplete,label:"Frac Fleet",testId:"fracFleetDropdown",value:d.selectedFracFleets,onChange:b,useAllOption:!0,dropdownClassName:n.dropdown,multiple:!0,options:c.map((function(e){return{id:e.value,title:e.label}}))})}),r.jsx("div",{children:r.jsx(s.Autocomplete,{clearable:!1,className:n.autocomplete,useAllOption:!0,label:"Formation",testId:"formationDropdown",value:d.selectedFormations,onChange:A,multiple:!0,dropdownClassName:n.dropdown,options:m.map((function(e){return{id:e.value,title:e.label}}))})}),r.jsx("div",{children:r.jsx(t.TextInput,{className:n.input,label:"TVD (Min)",testId:"tvdMinInput",placeholder:"0",type:"number",htmlAttributes:{min:0},value:d.tvdMin,onChange:j})}),r.jsx("div",{children:r.jsx(t.TextInput,{className:n.input,label:"TVD (Max)",testId:"tvdMaxInput",placeholder:"10000",type:"number",htmlAttributes:{min:0},value:d.tvdMax,onChange:F})})]})}));module.exports=o;
2
2
  //# sourceMappingURL=AssetFilters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetFilters.js","sources":["../../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"sourcesContent":["import { FC, memo } from 'react';\n\nimport { TextInput } from '../../../componentsV2/TextInput';\nimport { Autocomplete } from '../../../componentsV2/Autocomplete';\nimport { Filters, MappedPad } from '../types';\n\nimport { useOptions } from './useOptions';\nimport { useAssetFiltersHandlers } from './useAssetFiltersHandlers';\n\nimport styles from './AssetFilters.scss';\n\ntype Props = {\n pads: MappedPad[];\n selectedPadId?: number;\n filters: Filters;\n setFilters: React.Dispatch<React.SetStateAction<Filters>>;\n};\n\nconst AssetFilters: FC<Props> = memo(({ pads, selectedPadId, filters, setFilters }) => {\n const { fracFleetOptions, formationOptions, padOptions } = useOptions(pads, selectedPadId);\n\n const {\n handlePadStatusChange,\n handleTvdMinChange,\n handleTvdMaxChange,\n handleFracFleetsSelect,\n handleFormationsSelect,\n } = useAssetFiltersHandlers(setFilters);\n\n return (\n <div className={styles.filters}>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Pad\"\n value={filters.padStatus}\n onChange={handlePadStatusChange}\n options={padOptions}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Frac Fleet\"\n value={filters.selectedFracFleets}\n onChange={handleFracFleetsSelect}\n useAllOption\n dropdownClassName={styles.dropdown}\n multiple\n options={fracFleetOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n useAllOption\n label=\"Formation\"\n value={filters.selectedFormations}\n onChange={handleFormationsSelect}\n multiple\n dropdownClassName={styles.dropdown}\n options={formationOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Min)\"\n placeholder=\"0\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMin}\n onChange={handleTvdMinChange}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Max)\"\n placeholder=\"10000\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMax}\n onChange={handleTvdMaxChange}\n />\n </div>\n </div>\n );\n});\n\nexport default AssetFilters;\n"],"names":["AssetFilters","memo","_ref","pads","selectedPadId","filters","setFilters","_useOptions","useOptions","fracFleetOptions","formationOptions","padOptions","useAssetFiltersHandlers","handlePadStatusChange","handleTvdMinChange","handleTvdMaxChange","handleFracFleetsSelect","handleFormationsSelect","_jsxs","className","styles","children","_jsx","jsx","Autocomplete","clearable","autocomplete","label","value","padStatus","onChange","options","selectedFracFleets","useAllOption","dropdownClassName","dropdown","multiple","map","option","id","title","selectedFormations","TextInput","input","placeholder","type","htmlAttributes","min","tvdMin","tvdMax"],"mappings":"wQAkBMA,EAA0BC,EAAAA,MAAK,SAAkDC,GAAA,IAA/CC,IAAAA,KAAMC,IAAAA,cAAeC,IAAAA,QAASC,IAAAA,WACpEC,EAA2DC,EAAAA,WAAWL,EAAMC,GAApEK,IAAAA,iBAAkBC,IAAAA,iBAAkBC,IAAAA,WAQxCC,EAAAA,EAAuBA,wBAACN,GAL1BO,IAAAA,sBACAC,IAAAA,mBACAC,IAAAA,mBACAC,IAAAA,uBACAC,IAAAA,uBAGF,OACEC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOf,QAAQgB,SAC7B,CAAAC,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBC,MAAM,MACNC,MAAOvB,EAAQwB,UACfC,SAAUjB,EACVkB,QAASpB,MAGbW,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBC,MAAM,aACNC,MAAOvB,EAAQ2B,mBACfF,SAAUd,EACViB,cAAY,EACZC,kBAAmBd,EAAOe,SAC1BC,UAAQ,EACRL,QAAStB,EAAiB4B,KAAI,SAAAC,GAAM,MAAK,CACvCC,GAAID,EAAOV,MACXY,MAAOF,EAAOX,cAIpBL,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBO,cAAY,EACZN,MAAM,YACNC,MAAOvB,EAAQoC,mBACfX,SAAUb,EACVmB,UAAQ,EACRF,kBAAmBd,EAAOe,SAC1BJ,QAASrB,EAAiB2B,KAAI,SAAAC,GAAM,MAAK,CACvCC,GAAID,EAAOV,MACXY,MAAOF,EAAOX,cAIpBL,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACoB,YAAS,CACRvB,UAAWC,EAAOuB,MAClBhB,MAAM,YACNiB,YAAY,IACZC,KAAK,SACLC,eAAgB,CACdC,IAAK,GAEPnB,MAAOvB,EAAQ2C,OACflB,SAAUhB,MAGdQ,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACoB,YAAS,CACRvB,UAAWC,EAAOuB,MAClBhB,MAAM,YACNiB,YAAY,QACZC,KAAK,SACLC,eAAgB,CACdC,IAAK,GAEPnB,MAAOvB,EAAQ4C,OACfnB,SAAUf,QAKpB"}
1
+ {"version":3,"file":"AssetFilters.js","sources":["../../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"sourcesContent":["import { FC, memo } from 'react';\n\nimport { TextInput } from '../../../componentsV2/TextInput';\nimport { Autocomplete } from '../../../componentsV2/Autocomplete';\nimport { Filters, MappedPad } from '../types';\n\nimport { useOptions } from './useOptions';\nimport { useAssetFiltersHandlers } from './useAssetFiltersHandlers';\n\nimport styles from './AssetFilters.scss';\n\ntype Props = {\n pads: MappedPad[];\n selectedPadId?: number;\n filters: Filters;\n setFilters: React.Dispatch<React.SetStateAction<Filters>>;\n};\n\nconst AssetFilters: FC<Props> = memo(({ pads, selectedPadId, filters, setFilters }) => {\n const { fracFleetOptions, formationOptions, padOptions } = useOptions(pads, selectedPadId);\n\n const {\n handlePadStatusChange,\n handleTvdMinChange,\n handleTvdMaxChange,\n handleFracFleetsSelect,\n handleFormationsSelect,\n } = useAssetFiltersHandlers(setFilters);\n\n return (\n <div className={styles.filters} data-testid=\"assetFilters\">\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Pad\"\n value={filters.padStatus}\n onChange={handlePadStatusChange}\n options={padOptions}\n testId=\"padStatusDropdown\"\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Frac Fleet\"\n testId=\"fracFleetDropdown\"\n value={filters.selectedFracFleets}\n onChange={handleFracFleetsSelect}\n useAllOption\n dropdownClassName={styles.dropdown}\n multiple\n options={fracFleetOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n useAllOption\n label=\"Formation\"\n testId=\"formationDropdown\"\n value={filters.selectedFormations}\n onChange={handleFormationsSelect}\n multiple\n dropdownClassName={styles.dropdown}\n options={formationOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Min)\"\n testId=\"tvdMinInput\"\n placeholder=\"0\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMin}\n onChange={handleTvdMinChange}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Max)\"\n testId=\"tvdMaxInput\"\n placeholder=\"10000\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMax}\n onChange={handleTvdMaxChange}\n />\n </div>\n </div>\n );\n});\n\nexport default AssetFilters;\n"],"names":["AssetFilters","memo","_ref","pads","selectedPadId","filters","setFilters","_useOptions","useOptions","fracFleetOptions","formationOptions","padOptions","useAssetFiltersHandlers","handlePadStatusChange","handleTvdMinChange","handleTvdMaxChange","handleFracFleetsSelect","handleFormationsSelect","_jsxs","className","styles","children","_jsx","jsx","Autocomplete","clearable","autocomplete","label","value","padStatus","onChange","options","testId","selectedFracFleets","useAllOption","dropdownClassName","dropdown","multiple","map","option","id","title","selectedFormations","TextInput","input","placeholder","type","htmlAttributes","min","tvdMin","tvdMax"],"mappings":"wQAkBMA,EAA0BC,EAAAA,MAAK,SAAkDC,GAAA,IAA/CC,IAAAA,KAAMC,IAAAA,cAAeC,IAAAA,QAASC,IAAAA,WACpEC,EAA2DC,EAAAA,WAAWL,EAAMC,GAApEK,IAAAA,iBAAkBC,IAAAA,iBAAkBC,IAAAA,WAQxCC,EAAAA,EAAuBA,wBAACN,GAL1BO,IAAAA,sBACAC,IAAAA,mBACAC,IAAAA,mBACAC,IAAAA,uBACAC,IAAAA,uBAGF,OACEC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOf,QAAS,cAAY,eAAcgB,SACxD,CAAAC,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBC,MAAM,MACNC,MAAOvB,EAAQwB,UACfC,SAAUjB,EACVkB,QAASpB,EACTqB,OAAO,wBAGXV,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBC,MAAM,aACNK,OAAO,oBACPJ,MAAOvB,EAAQ4B,mBACfH,SAAUd,EACVkB,cAAY,EACZC,kBAAmBf,EAAOgB,SAC1BC,UAAQ,EACRN,QAAStB,EAAiB6B,KAAI,SAAAC,GAAM,MAAK,CACvCC,GAAID,EAAOX,MACXa,MAAOF,EAAOZ,cAIpBL,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACE,eAAY,CACXC,WAAW,EACXN,UAAWC,EAAOM,aAClBQ,cAAY,EACZP,MAAM,YACNK,OAAO,oBACPJ,MAAOvB,EAAQqC,mBACfZ,SAAUb,EACVoB,UAAQ,EACRF,kBAAmBf,EAAOgB,SAC1BL,QAASrB,EAAiB4B,KAAI,SAAAC,GAAM,MAAK,CACvCC,GAAID,EAAOX,MACXa,MAAOF,EAAOZ,cAIpBL,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACqB,YAAS,CACRxB,UAAWC,EAAOwB,MAClBjB,MAAM,YACNK,OAAO,cACPa,YAAY,IACZC,KAAK,SACLC,eAAgB,CACdC,IAAK,GAEPpB,MAAOvB,EAAQ4C,OACfnB,SAAUhB,MAGdQ,EAAAC,IAAA,MAAA,CAAAF,SACEC,MAACqB,YAAS,CACRxB,UAAWC,EAAOwB,MAClBjB,MAAM,YACNK,OAAO,cACPa,YAAY,QACZC,KAAK,SACLC,eAAgB,CACdC,IAAK,GAEPpB,MAAOvB,EAAQ6C,OACfpB,SAAUf,QAKpB"}
@@ -1,2 +1,2 @@
1
- "use strict";var s=require("react"),o=require("../../TextInput/TextInput.js"),c=require("./AssetSearchInput.scss.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/objectWithoutProperties"),require("@icon-park/react/es/all");var e=require("react/jsx-runtime");require("../../../icons/IconParkProvider.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");var i=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");var n=s.memo((function(n){var r=n.searchText,u=n.onChange,t=s.useCallback((function(){return u("")}),[u]);return e.jsx(o.TextInput,{className:c.textInput,label:"Search",placeholder:"Search for Pads...",prefix:e.jsx(i.SearchOne,{}),onChange:u,value:r,onClear:t})}));module.exports=n;
1
+ "use strict";var s=require("react"),o=require("../../TextInput/TextInput.js"),c=require("./AssetSearchInput.scss.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/objectWithoutProperties"),require("@icon-park/react/es/all");var e=require("react/jsx-runtime");require("../../../icons/IconParkProvider.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");var i=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");var n=s.memo((function(n){var r=n.searchText,u=n.onChange,t=s.useCallback((function(){return u("")}),[u]);return e.jsx(o.TextInput,{className:c.textInput,label:"Search",placeholder:"Search for Pads...",prefix:e.jsx(i.SearchOne,{}),onChange:u,value:r,onClear:t,testId:"padSearchInput"})}));module.exports=n;
2
2
  //# sourceMappingURL=AssetSearchInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetSearchInput.js","sources":["../../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"sourcesContent":["import { FC, memo, useCallback } from 'react';\n\nimport { TextInput } from '../../TextInput';\n\nimport styles from './AssetSearchInput.scss';\n\nimport { SearchOne } from '~/icons';\n\ntype Props = {\n searchText: string;\n onChange: (value: string) => void;\n};\n\nconst AssetSearchInput: FC<Props> = memo(({ searchText, onChange }) => {\n const clearSearch = useCallback(() => onChange(''), [onChange]);\n\n return (\n <TextInput\n className={styles.textInput}\n label=\"Search\"\n placeholder=\"Search for Pads...\"\n prefix={<SearchOne />}\n onChange={onChange}\n value={searchText}\n onClear={clearSearch}\n />\n );\n});\n\nexport default AssetSearchInput;\n"],"names":["AssetSearchInput","memo","_ref","searchText","onChange","clearSearch","useCallback","_jsx","TextInput","className","styles","textInput","label","placeholder","prefix","SearchOne","value","onClear"],"mappings":"+jJAaA,IAAMA,EAA8BC,EAAAA,MAAK,SAA8BC,GAAA,IAA3BC,IAAAA,WAAYC,IAAAA,SAChDC,EAAcC,EAAAA,aAAY,WAAA,OAAMF,EAAS,MAAK,CAACA,IAErD,OACEG,EAAAA,IAACC,EAAAA,UAAS,CACRC,UAAWC,EAAOC,UAClBC,MAAM,SACNC,YAAY,qBACZC,OAAQP,EAAAA,IAACQ,EAASA,UAAI,IACtBX,SAAUA,EACVY,MAAOb,EACPc,QAASZ,GAGf"}
1
+ {"version":3,"file":"AssetSearchInput.js","sources":["../../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"sourcesContent":["import { FC, memo, useCallback } from 'react';\n\nimport { TextInput } from '../../TextInput';\n\nimport styles from './AssetSearchInput.scss';\n\nimport { SearchOne } from '~/icons';\n\ntype Props = {\n searchText: string;\n onChange: (value: string) => void;\n};\n\nconst AssetSearchInput: FC<Props> = memo(({ searchText, onChange }) => {\n const clearSearch = useCallback(() => onChange(''), [onChange]);\n\n return (\n <TextInput\n className={styles.textInput}\n label=\"Search\"\n placeholder=\"Search for Pads...\"\n prefix={<SearchOne />}\n onChange={onChange}\n value={searchText}\n onClear={clearSearch}\n testId=\"padSearchInput\"\n />\n );\n});\n\nexport default AssetSearchInput;\n"],"names":["AssetSearchInput","memo","_ref","searchText","onChange","clearSearch","useCallback","_jsx","TextInput","className","styles","textInput","label","placeholder","prefix","SearchOne","value","onClear","testId"],"mappings":"+jJAaA,IAAMA,EAA8BC,EAAAA,MAAK,SAA8BC,GAAA,IAA3BC,IAAAA,WAAYC,IAAAA,SAChDC,EAAcC,EAAAA,aAAY,WAAA,OAAMF,EAAS,MAAK,CAACA,IAErD,OACEG,EAAAA,IAACC,EAAAA,UAAS,CACRC,UAAWC,EAAOC,UAClBC,MAAM,SACNC,YAAY,qBACZC,OAAQP,EAAAA,IAACQ,EAASA,UAAI,IACtBX,SAAUA,EACVY,MAAOb,EACPc,QAASZ,EACTa,OAAO,kBAGb"}